/* ================================================================
   CarteraHQ — Custom CSS
   Brand variables + base overrides.
   Tailwind CDN does not process @apply, so these are plain CSS.
   ================================================================ */

:root {
  --color-primary:  #0A2D4D;
  --color-accent:   #1B6B93;
  --color-success:  #15803D;
  --color-warning:  #CA8A04;
  --color-danger:   #B91C1C;
  --font-sans: Verdana, Geneva, system-ui, sans-serif;
}

/* ── Body ─────────────────────────────────────────────────────── */
body {
  font-family: var(--font-sans);
}

/* ── Sidebar nav links ────────────────────────────────────────── */
.nav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  transition: background-color 150ms ease, color 150ms ease;
  color: rgba(255, 255, 255, 0.65);
  text-decoration: none;
  white-space: nowrap;
}

.nav-link:hover {
  background-color: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.nav-link.active {
  background-color: var(--color-accent);
  color: #ffffff;
}

.nav-link svg {
  flex-shrink: 0;
  opacity: 0.85;
}

.nav-link.active svg,
.nav-link:hover svg {
  opacity: 1;
}

/* ── Alpine.js: hide un-hydrated elements until Alpine loads ───── */
[x-cloak] {
  display: none !important;
}

/* ── HTMX loading indicator ──────────────────────────────────── */
.htmx-indicator {
  opacity: 0;
  transition: opacity 200ms ease;
}
.htmx-request .htmx-indicator,
.htmx-request.htmx-indicator {
  opacity: 1;
}

/* ── Scrollbar subtle ─────────────────────────────────────────── */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background-color: rgba(0, 0, 0, 0.2);
  border-radius: 3px;
}

/* ── Language switcher (spec 003) ──────────────────────────────────────────
   Plain CSS on purpose: the template carries no class lists. Colours come from
   the tokens, never hardcoded. */
.lang-switch { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem; font-size: 0.75rem; }
.lang-switch__btn { border-radius: 0.25rem; padding: 0.25rem 0.5rem; font-weight: 500; transition: background-color 0.15s, color 0.15s; }
.lang-switch__btn:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 1px; }
.lang-switch--dark .lang-switch__btn { color: rgb(255 255 255 / 0.7); }
.lang-switch--dark .lang-switch__btn:hover { background-color: rgb(255 255 255 / 0.1); color: #fff; }
.lang-switch--dark .lang-switch__btn.is-active { background-color: rgb(255 255 255 / 0.15); color: #fff; }
.lang-switch--light .lang-switch__btn { color: #64748b; }
.lang-switch--light .lang-switch__btn:hover { background-color: #f1f5f9; color: #1e293b; }
.lang-switch--light .lang-switch__btn.is-active { background-color: var(--color-primary); color: #fff; }

/* A form sent once (data-submit-once) while its request is in flight. */
form[aria-busy="true"] button[type="submit"] {
  opacity: 0.6;
  cursor: wait;
}
