@tailwind base;
/* tw-elements (CDN) paints html.dark #262626; match the page background so body margins don't show a strip. */
html {
  background-color: theme('colors.ukko.white');
}
html.dark {
  background-color: theme('colors.ukko.black');
}
/* UKKO focus ring: 2px gap in the page colour, then a 2px ring — black on light, green on dark. */
:focus-visible {
  outline: 2px solid theme('colors.ukko.black');
  outline-offset: 2px;
}
.dark :focus-visible {
  outline-color: theme('colors.ukko.green');
}
@tailwind components;

/* Shared UI pieces (UKKO brand). Use them in new views instead of repeating long class lists.
   Brand rules: black/white lead, massive-green is the single accent (one primary action per view),
   square-ish edges (8px buttons/cards, 4px inputs/tags), flat surfaces with hairlines instead of shadows. */
@layer components {
  .page-header {
    @apply mb-6 flex flex-wrap items-end justify-between gap-3;
  }
  .page-title {
    @apply text-2xl font-bold tracking-tight text-ukko-black dark:text-ukko-white;
  }
  .page-subtitle {
    @apply mt-1 text-sm text-gray-600 dark:text-gray-400;
  }
  .section-title {
    @apply text-lg font-bold text-ukko-black dark:text-ukko-white;
  }

  .card {
    @apply rounded-lg bg-white ring-1 ring-ukko-line dark:bg-ukko-raised dark:ring-ukko-line-dark;
  }
  .card-body {
    @apply p-4 sm:p-6;
  }
  .card-header {
    @apply flex flex-wrap items-center justify-between gap-2 border-b border-ukko-line px-4 py-3 sm:px-6 dark:border-ukko-line-dark;
  }

  .btn {
    @apply inline-flex items-center justify-center gap-1.5 whitespace-nowrap rounded-lg px-3.5 py-2 text-sm font-bold transition-colors
      disabled:cursor-not-allowed disabled:opacity-50;
  }
  .btn-sm {
    @apply px-2.5 py-1 text-xs;
  }
  /* The one green action of the view. Text on massive-green is black (on-green, 7.9:1). */
  .btn-primary {
    @apply bg-ukko-green text-ukko-black hover:bg-ukko-green-hover;
  }
  .btn-secondary {
    @apply bg-white text-ukko-black ring-1 ring-inset ring-[#8A8A8A] hover:bg-ukko-white
      dark:bg-transparent dark:text-ukko-white dark:ring-gray-500 dark:hover:bg-white/5;
  }
  .btn-success {
    @apply bg-green-700 text-white hover:bg-green-800;
  }
  .btn-danger {
    @apply bg-red-700 text-white hover:bg-red-800 dark:bg-red-600 dark:hover:bg-red-700;
  }
  .btn-ghost {
    @apply font-medium text-gray-600 hover:bg-ukko-white hover:text-ukko-black dark:text-gray-300 dark:hover:bg-white/5 dark:hover:text-ukko-white;
  }

  /* Green text: accent-text on light (5.0:1), massive-green on dark (7.9:1). */
  .link {
    @apply font-medium text-ukko-accent underline-offset-2 hover:underline dark:text-ukko-green;
  }

  .form-label {
    @apply mb-1 block text-xs font-bold uppercase tracking-[0.08em] text-gray-600 dark:text-gray-400;
  }
  .form-input {
    @apply block w-full rounded border-[#8A8A8A] bg-white text-sm text-ukko-black focus:border-ukko-black focus:ring-ukko-black
      dark:border-gray-500 dark:bg-ukko-black dark:text-ukko-white dark:placeholder-gray-400 dark:focus:border-ukko-green dark:focus:ring-ukko-green;
  }
  .form-hint {
    @apply mt-1 text-xs text-gray-600 dark:text-gray-400;
  }

  /* relative: keeps absolutely positioned sr-only spans inside the scroll area (no page overflow on phones). */
  .table-wrap {
    @apply relative overflow-x-auto rounded-lg bg-white ring-1 ring-ukko-line dark:bg-ukko-raised dark:ring-ukko-line-dark;
  }
  /* :where() keeps cell rules at class specificity, so utilities like text-right on a th/td still win. */
  .table {
    @apply min-w-full divide-y divide-ukko-line text-sm dark:divide-ukko-line-dark;
  }
  .table > :where(thead) > :where(tr) > :where(th) {
    @apply whitespace-nowrap bg-ukko-white px-3 py-2.5 text-left text-xs font-bold uppercase tracking-[0.08em] text-gray-600 dark:bg-ukko-black/40 dark:text-gray-400;
  }
  .table > :where(tbody) {
    @apply divide-y divide-ukko-line dark:divide-ukko-line-dark;
  }
  .table > :where(tbody) > :where(tr) {
    @apply hover:bg-ukko-white dark:hover:bg-white/5;
  }
  .table > :where(tbody) > :where(tr) > :where(td) {
    @apply px-3 py-2 align-middle text-ukko-black dark:text-ukko-white;
  }

  /* Tags: radius-sm. State never relies on colour alone — badges always carry a word. */
  .badge {
    @apply inline-flex items-center gap-1 whitespace-nowrap rounded px-1.5 py-0.5 text-xs font-bold;
  }
  .badge-gray { @apply bg-gray-100 text-gray-600 ring-1 ring-inset ring-ukko-line dark:bg-white/5 dark:text-gray-300 dark:ring-ukko-line-dark; }
  .badge-green { @apply bg-green-100 text-green-800 dark:bg-green-900/60 dark:text-green-200; }
  .badge-red { @apply bg-red-100 text-red-800 dark:bg-red-900/60 dark:text-red-200; }
  .badge-yellow { @apply bg-yellow-100 text-yellow-800 dark:bg-yellow-900/60 dark:text-yellow-200; }
  .badge-blue { @apply bg-sky-100 text-sky-800 dark:bg-sky-900/60 dark:text-sky-200; }

  .empty-state {
    @apply px-4 py-10 text-center text-sm text-gray-600 dark:text-gray-400;
  }

  /* Navbar (always black-ukko): link_to (heimdall) adds "active" to the current page link. */
  .nav-top.active {
    @apply bg-white/10 text-white shadow-[inset_0_-2px_0_#5BBB67];
  }
  .nav-item.active {
    @apply font-bold text-ukko-accent dark:text-ukko-green;
  }

  .meta-label {
    @apply text-xs font-bold uppercase tracking-[0.08em] text-gray-600 dark:text-gray-400;
  }
}

.pagination {
  .current {
    @apply font-bold;
  }
}
.pagination * {
  @apply px-2 py-1 mx-1;
  @apply text-ukko-black no-underline bg-white rounded;
  @apply text-xs ring-1 ring-inset ring-ukko-line;
}
.pagination .current {
  @apply bg-ukko-black text-ukko-white ring-ukko-black;
}
.pagination a:hover {
  @apply bg-ukko-white;
}
.dark .pagination * {
  @apply text-ukko-white bg-ukko-raised ring-ukko-line-dark;
}
.dark .pagination .current {
  @apply bg-ukko-green text-ukko-black ring-ukko-green;
}
.dark .pagination a:hover {
  @apply bg-white/10;
}
@tailwind utilities;

/*

@layer components {
  .btn-primary {
    @apply py-2 px-4 bg-blue-200;
  }
}

*/
/* TMP */
.dark input[type=text], .dark input.string, .dark select, .dark textarea {
  background-color: #111111;
  color: #F7F7F7;
}
.dark input[type=text]:hover, .dark input.string:hover, .dark select:hover, .dark textarea:hover {
  background-color: #111111;
  color: #F7F7F7;
}

.ss-content input {
  color: black;
}

/* Slim Select: same height as other fields, and dark mode */
.ss-main {
  min-height: 38px;
}
.dark .ss-main, .dark .ss-content {
  background-color: #111111;
  border-color: #6B6B6B;
  color: white;
}
.dark .ss-content .ss-search input {
  background-color: #1C1C1C;
  border-color: #6B6B6B;
  color: white;
}
.dark .ss-content .ss-list .ss-option {
  color: #F7F7F7;
}
.dark .ss-content .ss-list .ss-option:hover,
.dark .ss-content .ss-list .ss-option.ss-highlighted {
  background-color: #5BBB67;
  color: #111111;
}
.dark .ss-main .ss-values .ss-placeholder {
  color: #A3A3A3;
}
/*
 * This is a manifest file that'll be compiled into application.css, which will include all the files
 * listed below.
 *
 * Any CSS (and SCSS, if configured) file within this directory, lib/assets/stylesheets, or any plugin's
 * vendor/assets/stylesheets directory can be referenced here using a relative path.
 *
 * You're free to add application-wide styles to this file and they'll appear at the bottom of the
 * compiled file so the styles you add here take precedence over styles defined in any other CSS
 * files in this directory. Styles in this file should be added after the last require_* statement.
 * It is generally better to create a new file per style scope.
 *


 */
