/* ============================================================================
   ICOPAD — Components v1
   Buttons, badges, cards, forms, alerts, tables, panels, stats, hero, theme
   picker, language picker, search suggestions.
   Mobile-first.
   ============================================================================ */

/* ═══════════════════════════════════════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════════════════════════════════════ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 0 var(--space-4);
  min-height: 40px;
  font-family: inherit;
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  line-height: 1;
  letter-spacing: 0;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  background: var(--brand);
  color: var(--brand-ink);
  box-shadow: var(--shadow-xs);
  transition: background-color var(--dur-fast) var(--ease-out),
              border-color var(--dur-fast) var(--ease-out),
              color var(--dur-fast) var(--ease-out),
              box-shadow var(--dur-fast) var(--ease-out),
              transform var(--dur-fast) var(--ease-out);
}

.btn:hover {
  background: var(--brand-hover);
  text-decoration: none;
  box-shadow: var(--shadow-sm);
}
.btn:active { transform: scale(0.98); }
.btn:focus-visible { outline: none; box-shadow: var(--ring-brand); }
.btn:disabled, .btn[aria-disabled="true"] {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
}

.btn-primary { background: var(--brand); color: var(--brand-ink); }
.btn-primary:hover { background: var(--brand-hover); }

.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { background: var(--accent-600); }

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-2xs);
}
.btn-secondary:hover {
  background: var(--surface-hover);
  border-color: var(--text-subtle);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  box-shadow: none;
}
.btn-ghost:hover {
  background: var(--surface-hover);
  color: var(--text);
}

.btn-outline {
  background: transparent;
  color: var(--brand);
  border-color: var(--brand);
  box-shadow: none;
}
.btn-outline:hover { background: var(--accent-50); }

.btn-danger  { background: var(--error);   color: #fff; }
.btn-danger:hover  { background: var(--error-700); }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: var(--success-700); }
.btn-warning { background: var(--warning); color: #fff; }
.btn-warning:hover { background: var(--warning-700); }

.btn-link {
  background: transparent;
  color: var(--brand);
  padding: 0;
  min-height: 0;
  box-shadow: none;
  font-weight: var(--fw-medium);
}
.btn-link:hover { color: var(--brand-hover); text-decoration: underline; }

.btn-sm { min-height: 32px; padding: 0 var(--space-3); font-size: var(--fs-xs); border-radius: var(--radius-sm); }
.btn-lg { min-height: 48px; padding: 0 var(--space-6); font-size: var(--fs-base); }
.btn-xl { min-height: 56px; padding: 0 var(--space-8); font-size: var(--fs-md); border-radius: var(--radius-lg); }
.btn-block { width: 100%; }

.btn-icon { padding: 0; width: 40px; min-height: 40px; }
.btn-icon.btn-sm { width: 32px; min-height: 32px; }
.btn-icon.btn-lg { width: 48px; min-height: 48px; }

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-muted);
  cursor: pointer;
  flex-shrink: 0;
  transition: background-color var(--dur-fast) var(--ease-out),
              color var(--dur-fast) var(--ease-out),
              border-color var(--dur-fast) var(--ease-out);
}
.icon-btn:hover {
  background: var(--surface-hover);
  color: var(--text);
  border-color: var(--border-strong);
}
.icon-btn:focus-visible { outline: none; box-shadow: var(--ring-brand); }

/* ═══════════════════════════════════════════════════════════════════════
   BADGES
   ═══════════════════════════════════════════════════════════════════════ */

.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 0.15rem 0.55rem;
  font-size: var(--fs-xs);
  font-weight: var(--fw-medium);
  line-height: 1.5;
  letter-spacing: var(--tracking-wide);
  white-space: nowrap;
  border-radius: var(--radius-full);
  background: var(--bg-muted);
  color: var(--text-muted);
  border: 1px solid transparent;
}

.badge::before {
  content: "";
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.7;
}
.badge--no-dot::before { display: none; }

.badge--brand    { background: var(--accent-50); color: var(--accent-700); }
.badge--success  { background: var(--success-50); color: var(--success-700); }
.badge--warning  { background: var(--warning-50); color: var(--warning-700); }
.badge--error    { background: var(--error-50);   color: var(--error-700); }
.badge--neutral  { background: var(--bg-muted);   color: var(--text-muted); }
.badge--info     { background: var(--info-50);    color: var(--info-700); }

.badge--solid    { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.badge--solid::before { background: #fff; }
.badge--outline  { background: transparent; border-color: currentColor; }

/* ═══════════════════════════════════════════════════════════════════════
   CARDS
   ═══════════════════════════════════════════════════════════════════════ */

.card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--space-5);
  box-shadow: var(--shadow-2xs);
  transition: border-color var(--dur-base) var(--ease-out),
              box-shadow var(--dur-base) var(--ease-out),
              transform var(--dur-base) var(--ease-out);
}
@media (min-width: 640px) {
  .card { padding: var(--space-6); }
}
.card--flush { padding: 0; overflow: hidden; }
.card--interactive { cursor: pointer; }
.card--interactive:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.card__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-4);
  flex-wrap: wrap;
}
.card__title {
  font-size: var(--fs-lg);
  font-weight: var(--fw-semibold);
  line-height: var(--lh-snug);
  letter-spacing: var(--tracking-snug);
  margin: 0;
  color: var(--text);
}
.card__title a { color: inherit; font-weight: inherit; }
.card__title a:hover { color: var(--brand); text-decoration: none; }

.card__body {
  font-size: var(--fs-sm);
  line-height: var(--lh-base);
  color: var(--text-muted);
  margin-bottom: var(--space-4);
  flex: 1;
}
.card__meta {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: var(--fs-xs);
  color: var(--text-subtle);
  flex-wrap: wrap;
}
.card__footer {
  margin-top: auto;
  padding-top: var(--space-4);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.card-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-5);
}
@media (min-width: 640px) {
  .card-list { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
}

/* ═══════════════════════════════════════════════════════════════════════
   FORMS
   ═══════════════════════════════════════════════════════════════════════ */

.form { display: grid; gap: var(--space-6); max-width: 720px; }

.form fieldset {
  display: grid;
  gap: var(--space-5);
  padding: var(--space-5);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: var(--surface);
}
@media (min-width: 640px) {
  .form fieldset { padding: var(--space-6); }
}
.form legend {
  padding: 0 var(--space-2);
  font-size: var(--fs-base);
  font-weight: var(--fw-semibold);
  color: var(--text);
}

.form label {
  display: grid;
  gap: var(--space-2);
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  color: var(--text);
  letter-spacing: var(--tracking-snug);
}
.form .req { color: var(--error); font-weight: var(--fw-semibold); }

.form input[type="text"],
.form input[type="email"],
.form input[type="password"],
.form input[type="tel"],
.form input[type="url"],
.form input[type="number"],
.form input[type="search"],
.form input[type="date"],
.form input[type="datetime-local"],
.form input[type="time"],
.form input[type="file"],
.form select,
.form textarea {
  width: 100%;
  padding: 0 var(--space-4);
  min-height: 44px;
  font-size: var(--fs-base);
  font-family: inherit;
  line-height: 1.4;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-2xs);
  transition: border-color var(--dur-fast) var(--ease-out),
              box-shadow var(--dur-fast) var(--ease-out);
}

.form textarea {
  min-height: 120px;
  padding: var(--space-3) var(--space-4);
  resize: vertical;
  line-height: var(--lh-base);
}

.form select {
  appearance: none;
  padding-right: var(--space-10);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2376706a' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--space-4) center;
}

.form input:focus,
.form select:focus,
.form textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: var(--ring-brand);
}

.form input[aria-invalid="true"],
.form select[aria-invalid="true"],
.form textarea[aria-invalid="true"] {
  border-color: var(--error);
  box-shadow: var(--ring-error);
}

.form input:disabled,
.form select:disabled,
.form textarea:disabled {
  background: var(--bg-muted);
  cursor: not-allowed;
  opacity: 0.6;
}

.form .field-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-4);
}
@media (min-width: 640px) {
  .form .field-row { grid-template-columns: 1fr 1fr; }
}

.form .form-actions {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
  align-items: center;
  padding-top: var(--space-4);
  border-top: 1px solid var(--border-subtle);
}
.form .form-note {
  font-size: var(--fs-sm);
  color: var(--text-muted);
  line-height: var(--lh-base);
}

/* Checkboxes / radios */
.chk {
  display: inline-flex;
  align-items: flex-start;
  gap: var(--space-3);
  font-weight: var(--fw-regular);
  font-size: var(--fs-sm);
  cursor: pointer;
  line-height: var(--lh-snug);
  padding: var(--space-2);
  margin: calc(-1 * var(--space-2));
  border-radius: var(--radius-sm);
  transition: background-color var(--dur-fast) var(--ease-out);
}
.chk:hover { background: var(--surface-hover); }
.chk input[type="checkbox"],
.chk input[type="radio"] {
  flex-shrink: 0;
  width: 18px; height: 18px;
  margin-top: 2px;
  accent-color: var(--brand);
  cursor: pointer;
}

.chk-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-1);
}
@media (min-width: 640px)  { .chk-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .chk-grid { grid-template-columns: repeat(3, 1fr); } }

/* ═══════════════════════════════════════════════════════════════════════
   ALERTS
   ═══════════════════════════════════════════════════════════════════════ */

.alert {
  display: flex;
  gap: var(--space-3);
  padding: var(--space-4);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: var(--fs-sm);
  line-height: var(--lh-base);
  margin: var(--space-4) 0;
}
.alert strong { display: block; margin-bottom: var(--space-1); font-weight: var(--fw-semibold); }
.alert-error   { background: var(--error-50);   color: var(--error-700);   border-color: var(--error-100); }
.alert-success { background: var(--success-50); color: var(--success-700); border-color: var(--success-100); }
.alert-warning { background: var(--warning-50); color: var(--warning-700); border-color: var(--warning-100); }
.alert-info    { background: var(--info-50);    color: var(--info-700);    border-color: var(--info-100); }

/* ═══════════════════════════════════════════════════════════════════════
   ANNOUNCEMENT BAR
   ═══════════════════════════════════════════════════════════════════════ */

.announcement-bar {
  position: relative;
  z-index: calc(var(--z-sticky) + 1);
  background: var(--gray-950);
  color: var(--gray-0);
  font-size: var(--fs-sm);
}
.announcement-bar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding-block: var(--space-2);
}
.announcement-bar__text {
  margin: 0;
  line-height: var(--lh-snug);
}
.announcement-bar__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  background: transparent;
  border: 0;
  color: inherit;
  cursor: pointer;
  border-radius: var(--radius-md);
  flex-shrink: 0;
  transition: background-color var(--dur-fast) var(--ease-out);
}
.announcement-bar__close:hover { background: rgb(255 255 255 / 0.12); }
.announcement-bar__close:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgb(255 255 255 / 0.5);
}

/* ═══════════════════════════════════════════════════════════════════════
   TABLES
   ═══════════════════════════════════════════════════════════════════════ */

.table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: var(--surface);
  box-shadow: var(--shadow-2xs);
}

.table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); font-variant-numeric: tabular-nums; }
.table th, .table td {
  padding: var(--space-3) var(--space-4);
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--border-subtle);
}
.table th {
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider);
  color: var(--text-subtle);
  background: var(--bg-muted);
  white-space: nowrap;
}
.table tbody tr { transition: background-color var(--dur-fast) var(--ease-out); }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: var(--surface-hover); }

@media (max-width: 720px) {
  .table.responsive thead { display: none; }
  .table.responsive,
  .table.responsive tbody,
  .table.responsive tr,
  .table.responsive td { display: block; width: 100%; }
  .table.responsive tr { border-bottom: 1px solid var(--border); padding: var(--space-4); }
  .table.responsive td {
    display: flex;
    justify-content: space-between;
    gap: var(--space-4);
    padding: var(--space-2) 0;
    border: 0;
  }
  .table.responsive td::before {
    content: attr(data-label);
    font-weight: var(--fw-semibold);
    color: var(--text-subtle);
    font-size: var(--fs-xs);
    text-transform: uppercase;
    letter-spacing: var(--tracking-wide);
  }
}

/* ═══════════════════════════════════════════════════════════════════════
   PANELS
   ═══════════════════════════════════════════════════════════════════════ */

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--space-5);
  margin: var(--space-5) 0;
  box-shadow: var(--shadow-2xs);
}
@media (min-width: 640px) {
  .panel { padding: var(--space-6); }
}

.panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-5);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--border-subtle);
  flex-wrap: wrap;
}
.panel__head h2,
.panel__head h3 {
  margin: 0;
  font-size: var(--fs-lg);
  letter-spacing: var(--tracking-snug);
}
.panel--info { background: var(--info-50); border-color: var(--info-100); }

/* ═══════════════════════════════════════════════════════════════════════
   STATS
   ═══════════════════════════════════════════════════════════════════════ */

.stat-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-4);
  margin: var(--space-6) 0;
}
@media (min-width: 480px) { .stat-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 768px) { .stat-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); } }

.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  box-shadow: var(--shadow-2xs);
}
.stat__num, .stat .num {
  display: block;
  font-size: var(--fs-4xl);
  font-weight: var(--fw-bold);
  line-height: 1;
  color: var(--text);
  letter-spacing: var(--tracking-tight);
  font-variant-numeric: tabular-nums;
}
.stat__lbl, .stat .lbl {
  display: block;
  font-size: var(--fs-xs);
  font-weight: var(--fw-medium);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider);
  color: var(--text-subtle);
}

/* ═══════════════════════════════════════════════════════════════════════
   FILTERS
   ═══════════════════════════════════════════════════════════════════════ */

.filters {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-3);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--space-4);
  margin: var(--space-5) 0;
  box-shadow: var(--shadow-2xs);
}
@media (min-width: 640px) {
  .filters { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); align-items: end; }
}
.filters label {
  display: grid;
  gap: var(--space-2);
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  color: var(--text-subtle);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider);
}
.filters input, .filters select {
  width: 100%;
  min-height: 40px;
  padding: 0 var(--space-3);
  font-size: var(--fs-sm);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-2xs);
  transition: border-color var(--dur-fast) var(--ease-out),
              box-shadow var(--dur-fast) var(--ease-out);
}
.filters input:focus, .filters select:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: var(--ring-brand);
}

/* ═══════════════════════════════════════════════════════════════════════
   TAGS
   ═══════════════════════════════════════════════════════════════════════ */

.tag-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  padding: 0;
  margin: var(--space-3) 0;
}
.tag-list a, .tag-list > li {
  display: inline-block;
  padding: var(--space-1) var(--space-3);
  font-size: var(--fs-xs);
  font-weight: var(--fw-medium);
  letter-spacing: var(--tracking-snug);
  background: var(--bg-muted);
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  text-decoration: none;
  transition: background-color var(--dur-fast) var(--ease-out),
              color var(--dur-fast) var(--ease-out),
              border-color var(--dur-fast) var(--ease-out);
}
.tag-list a:hover {
  background: var(--accent-50);
  color: var(--accent-700);
  border-color: var(--accent-200);
  text-decoration: none;
}

/* ═══════════════════════════════════════════════════════════════════════
   HERO
   ═══════════════════════════════════════════════════════════════════════ */

.hero {
  position: relative;
  padding: var(--space-14) var(--space-4);
  background: linear-gradient(180deg, var(--brand) 0%, var(--brand-hover) 100%);
  color: var(--brand-ink);
  overflow: hidden;
  isolation: isolate;
}
@media (min-width: 768px) {
  .hero { padding: var(--space-20) var(--space-6); }
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(ellipse 80% 50% at 20% 0%, rgb(255 255 255 / 0.10) 0%, transparent 60%),
    radial-gradient(ellipse 60% 50% at 90% 100%, rgb(255 255 255 / 0.06) 0%, transparent 60%);
  pointer-events: none;
  z-index: -1;
}
.hero > * { position: relative; max-width: var(--content-max); margin-inline: auto; }
.hero h1 {
  font-size: clamp(2rem, 1.6rem + 2.5vw, 4rem);
  font-weight: var(--fw-bold);
  color: var(--brand-ink);
  margin-bottom: var(--space-5);
  letter-spacing: -0.03em;
  line-height: 1.05;
  max-width: 900px;
}
.hero .lead, .hero p {
  font-size: clamp(1rem, 0.9rem + 0.5vw, 1.25rem);
  line-height: var(--lh-snug);
  color: rgb(255 255 255 / 0.9);
  margin-bottom: var(--space-6);
  max-width: 640px;
  letter-spacing: var(--tracking-snug);
}
.hero .btn { background: #fff; color: var(--brand); box-shadow: 0 4px 14px rgb(0 0 0 / 0.15); }
.hero .btn:hover { background: rgb(255 255 255 / 0.95); box-shadow: 0 6px 20px rgb(0 0 0 / 0.20); }

/* ═══════════════════════════════════════════════════════════════════════
   DETAIL
   ═══════════════════════════════════════════════════════════════════════ */

.detail {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--space-5);
  margin: var(--space-6) 0;
  max-width: 760px;
  box-shadow: var(--shadow-2xs);
}
@media (min-width: 768px) {
  .detail { padding: var(--space-10); }
}
.detail h1 { font-size: var(--fs-4xl); letter-spacing: -0.02em; margin-bottom: var(--space-4); }
.detail .body {
  font-size: var(--fs-md);
  line-height: var(--lh-loose);
  color: var(--text);
  margin-top: var(--space-5);
}
.detail .body p { margin-bottom: var(--space-5); }

/* ═══════════════════════════════════════════════════════════════════════
   EMPTY STATES
   ═══════════════════════════════════════════════════════════════════════ */

.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  padding: var(--space-12) var(--space-5);
  text-align: center;
  color: var(--text-muted);
  background: var(--bg-subtle);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-xl);
  margin: var(--space-6) 0;
  font-size: var(--fs-sm);
  line-height: var(--lh-base);
}

/* ═══════════════════════════════════════════════════════════════════════
   DASHBOARD HERO + ACTION CARDS
   ═══════════════════════════════════════════════════════════════════════ */

.dash-hero {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-5);
  padding: var(--space-5);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  margin: var(--space-6) 0;
  box-shadow: var(--shadow-2xs);
}
@media (min-width: 640px) {
  .dash-hero { padding: var(--space-6); }
}
.dash-hero h2 { margin: 0; font-size: var(--fs-3xl); letter-spacing: var(--tracking-tight); }
.dash-hero p { margin: 0; font-size: var(--fs-sm); color: var(--text-muted); }
.dash-hero__actions { display: flex; gap: var(--space-2); flex-wrap: wrap; }

.action-grid { display: grid; grid-template-columns: 1fr; gap: var(--space-4); }
@media (min-width: 640px)  { .action-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .action-grid { grid-template-columns: repeat(4, 1fr); } }

.action-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-5);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  color: var(--text);
  text-decoration: none;
  box-shadow: var(--shadow-2xs);
  transition: border-color var(--dur-base) var(--ease-out),
              box-shadow var(--dur-base) var(--ease-out),
              transform var(--dur-base) var(--ease-out);
}
.action-card:hover {
  border-color: var(--brand);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  text-decoration: none;
}
.action-card__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px; height: 40px;
  background: var(--accent-50);
  color: var(--brand);
  border-radius: var(--radius-lg);
  font-size: var(--fs-lg);
}
.action-card__title { font-weight: var(--fw-semibold); font-size: var(--fs-base); color: var(--text); }
.action-card__desc { font-size: var(--fs-sm); color: var(--text-muted); line-height: var(--lh-base); }

/* ═══════════════════════════════════════════════════════════════════════
   TOASTS
   ═══════════════════════════════════════════════════════════════════════ */

.toast-stack {
  position: fixed;
  bottom: var(--space-4);
  right: var(--space-4);
  left: var(--space-4);
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  pointer-events: none;
}
@media (min-width: 640px) {
  .toast-stack {
    left: auto;
    bottom: var(--space-5);
    right: var(--space-5);
    max-width: min(420px, calc(100vw - var(--space-8)));
  }
}
.toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: var(--gray-900);
  color: var(--gray-0);
  border-radius: var(--radius-lg);
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  box-shadow: var(--shadow-xl);
  transition: opacity var(--dur-base) var(--ease-out),
              transform var(--dur-base) var(--ease-out);
  animation: toast-in var(--dur-slow) var(--ease-spring);
}
.toast.is-leaving { opacity: 0; transform: translateY(20px); }
.toast--success { background: var(--success-600); }
.toast--error   { background: var(--error-600); }
.toast--warning { background: var(--warning-600); }
.toast--info    { background: var(--info-600); }

@keyframes toast-in {
  from { opacity: 0; transform: translateY(20px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ═══════════════════════════════════════════════════════════════════════
   THEME PICKER — inline dropdown
   ═══════════════════════════════════════════════════════════════════════ */

.theme-picker { position: relative; }

.theme-picker__menu {
  position: absolute;
  top: calc(100% + var(--space-2));
  right: 0;
  min-width: 180px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  padding: var(--space-2);
  list-style: none;
  margin: 0;
  z-index: 10500;                          /* ← above drawer content */
  animation: menu-in var(--dur-base) var(--ease-out);
}
.theme-picker__menu[hidden] { display: none; }

.theme-picker__option {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  width: 100%;
  padding: var(--space-2) var(--space-3);
  background: transparent;
  border: 0;
  border-radius: var(--radius-md);
  color: var(--text);
  font-family: inherit;
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  text-align: left;
  cursor: pointer;
  transition: background-color var(--dur-fast) var(--ease-out);
}
.theme-picker__option:hover { background: var(--surface-hover); }
.theme-picker__option[aria-checked="true"] {
  color: var(--brand);
  background: var(--accent-50);
}

.theme-picker__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px; height: 18px;
  color: var(--text-subtle);
  flex-shrink: 0;
}
.theme-picker__option[aria-checked="true"] .theme-picker__icon { color: var(--brand); }

.theme-picker__check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: auto;
  width: 16px; height: 16px;
  opacity: 0;
  color: var(--brand);
  transition: opacity var(--dur-fast) var(--ease-out);
}
.theme-picker__option[aria-checked="true"] .theme-picker__check { opacity: 1; }

/* Mobile drawer context — anchor to the header-actions */
@media (max-width: 1023px) {
  .site-nav__header .theme-picker { position: static; }
  .site-nav__header .theme-picker__menu {
    position: absolute;
    top: calc(100% + var(--space-2));
    right: var(--space-4);
    left: auto;
    min-width: 180px;
    max-width: calc(100vw - var(--space-8));
    z-index: 10500;
  }
}

/* ═══════════════════════════════════════════════════════════════════════
   LANGUAGE PICKER (desktop)
   ═══════════════════════════════════════════════════════════════════════ */

.lang-picker { position: relative; }

.lang-picker > summary {
  list-style: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  height: 40px;
  padding: 0 var(--space-2);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  letter-spacing: var(--tracking-wide);
  transition: background-color var(--dur-fast) var(--ease-out),
              border-color var(--dur-fast) var(--ease-out),
              color var(--dur-fast) var(--ease-out);
}
.lang-picker > summary::-webkit-details-marker { display: none; }
.lang-picker > summary::marker { content: ""; }
.lang-picker > summary:hover {
  background: var(--surface-hover);
  color: var(--text);
  border-color: var(--border-strong);
}
.lang-picker[open] > summary {
  background: var(--surface-hover);
  color: var(--text);
  border-color: var(--border-strong);
}

.lang-picker__current {
  font-size: var(--fs-xs);
  font-weight: var(--fw-bold);
  letter-spacing: var(--tracking-wide);
}

.lang-picker__menu {
  position: absolute;
  top: calc(100% + var(--space-2));
  right: 0;
  min-width: 180px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  padding: var(--space-2);
  list-style: none;
  margin: 0;
  z-index: var(--z-dropdown);
  animation: menu-in var(--dur-base) var(--ease-out);
}
.lang-picker__menu[hidden] { display: none; }

.lang-picker__menu a {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  color: var(--text);
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  text-decoration: none;
  transition: background-color var(--dur-fast) var(--ease-out);
}
.lang-picker__menu a:hover { background: var(--surface-hover); text-decoration: none; }
.lang-picker__menu a[aria-current="true"] {
  color: var(--brand);
  background: var(--accent-50);
}

.lang-picker__short {
  display: inline-block;
  min-width: 22px;
  font-size: var(--fs-xs);
  font-weight: var(--fw-bold);
  color: var(--text-subtle);
  letter-spacing: var(--tracking-wide);
}
.lang-picker__menu a[aria-current="true"] .lang-picker__short { color: var(--brand); }

/* ═══════════════════════════════════════════════════════════════════════
   SEARCH SUGGESTIONS
   ═══════════════════════════════════════════════════════════════════════ */

.search-suggestions {
  position: absolute;
  top: calc(100% + var(--space-2));
  left: var(--space-4);
  right: var(--space-4);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  z-index: var(--z-dropdown);
  overflow: hidden;
  animation: menu-in var(--dur-base) var(--ease-out);
}
.search-suggestions[hidden] { display: none; }

@media (min-width: 768px) {
  .search-suggestions {
    left: auto;
    right: var(--space-4);
    width: min(480px, calc(100vw - var(--space-8)));
  }
}

.search-suggestions .suggestion {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid var(--border-subtle);
  font-size: var(--fs-sm);
  transition: background-color var(--dur-fast) var(--ease-out);
}
.search-suggestions .suggestion:hover { background: var(--surface-hover); text-decoration: none; }
.search-suggestions .suggestion:last-child { border-bottom: 0; }

.search-suggestions .suggestion__type {
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider);
  color: var(--text-subtle);
  min-width: 70px;
  flex-shrink: 0;
  font-weight: var(--fw-semibold);
}

.search-suggestions .suggestion__title {
  font-weight: var(--fw-medium);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-suggestions .suggestion--empty {
  padding: var(--space-5);
  text-align: center;
  color: var(--text-muted);
  font-style: italic;
}

/* ═══════════════════════════════════════════════════════════════════════
   SHARED KEYFRAMES
   ═══════════════════════════════════════════════════════════════════════ */

@keyframes menu-in {
  from { opacity: 0; transform: translateY(-4px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes sheet-in {
  from { transform: translateY(100%); opacity: 0.6; }
  to   { transform: translateY(0);    opacity: 1; }
}



/* ═══════════════════════════════════════════════════════════════════════
   PAGE HERO — reusable secondary hero for all inner public pages
   Mobile-first. Uses brand gradient fallback when no image is provided.
   ═══════════════════════════════════════════════════════════════════════ */

.page-hero {
  position: relative;
  width: 100%;
  overflow: hidden;
  isolation: isolate;
  background: var(--gray-950);
  color: var(--gray-0);
  border-bottom: 1px solid var(--border-subtle);
}

/* ── Sizing variants ─────────────────────────────────────────────────── */

.page-hero--sm { min-height: 240px; }
.page-hero--md { min-height: 320px; }
.page-hero--lg { min-height: 420px; }

@media (min-width: 768px) {
  .page-hero--sm { min-height: 280px; }
  .page-hero--md { min-height: 380px; }
  .page-hero--lg { min-height: 520px; }
}

/* ── Background layer ────────────────────────────────────────────────── */

.page-hero__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background: linear-gradient(135deg,
    color-mix(in srgb, var(--brand) 92%, black) 0%,
    color-mix(in srgb, var(--brand) 55%, var(--gray-950)) 55%,
    var(--gray-950) 100%);
}

.page-hero__bg-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transform: scale(1.02);
  transition: transform 8000ms linear;
}

@media (min-width: 768px) {
  .page-hero--lg .page-hero__bg-img { transform: scale(1.04); }
}

/* If the image fails to load, the container keeps the gradient. */
.page-hero__bg--failed::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg,
    color-mix(in srgb, var(--brand) 92%, black) 0%,
    color-mix(in srgb, var(--brand) 55%, var(--gray-950)) 55%,
    var(--gray-950) 100%);
}

/* ── Overlay tints — keep text legible over any image ────────────────── */

.page-hero--overlay-none   .page-hero__overlay { display: none; }

.page-hero--overlay-dark   .page-hero__overlay {
  background:
    linear-gradient(180deg,
      rgb(11 10 10 / 0.55) 0%,
      rgb(11 10 10 / 0.60) 40%,
      rgb(11 10 10 / 0.85) 100%),
    linear-gradient(90deg,
      rgb(11 10 10 / 0.60) 0%,
      transparent 60%);
}
.page-hero--overlay-medium .page-hero__overlay {
  background:
    linear-gradient(180deg,
      rgb(11 10 10 / 0.30) 0%,
      rgb(11 10 10 / 0.40) 45%,
      rgb(11 10 10 / 0.70) 100%),
    linear-gradient(90deg,
      rgb(11 10 10 / 0.40) 0%,
      transparent 60%);
}
.page-hero--overlay-light .page-hero__overlay {
  background:
    linear-gradient(180deg,
      rgb(11 10 10 / 0.10) 0%,
      rgb(11 10 10 / 0.25) 50%,
      rgb(11 10 10 / 0.55) 100%);
}
.page-hero__overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

/* Brand-gradient hero (no image) — the underlying .page-hero__bg
   already contains the gradient, add a subtle brand sweep on top. */
.page-hero--brand .page-hero__bg::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(ellipse 60% 40% at 15% 0%,
      rgb(255 255 255 / 0.14) 0%, transparent 60%),
    radial-gradient(ellipse 50% 40% at 90% 100%,
      rgb(255 255 255 / 0.08) 0%, transparent 60%);
  pointer-events: none;
}

/* ── Inner content ───────────────────────────────────────────────────── */

.page-hero__inner {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  padding-block: var(--space-12) var(--space-14);
  min-height: inherit;
  justify-content: flex-end;
}

@media (min-width: 768px) {
  .page-hero__inner {
    padding-block: var(--space-16) var(--space-20);
    gap: var(--space-5);
    max-width: 900px;
  }
  .page-hero--center .page-hero__inner {
    margin-inline: auto;
    text-align: center;
    align-items: center;
  }
}

/* Alignment */
.page-hero--center .page-hero__inner { text-align: center; align-items: center; }
.page-hero--center .page-hero__breadcrumb ol { justify-content: center; }
.page-hero--center .page-hero__actions { justify-content: center; }
.page-hero--center .page-hero__meta { justify-content: center; }

/* ── Breadcrumb ──────────────────────────────────────────────────────── */

.page-hero__breadcrumb ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  font-size: var(--fs-xs);
  color: rgb(255 255 255 / 0.7);
}
.page-hero__breadcrumb li {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}
.page-hero__breadcrumb li + li::before {
  content: "/";
  color: rgb(255 255 255 / 0.4);
}
.page-hero__breadcrumb a {
  color: rgb(255 255 255 / 0.85);
  text-decoration: none;
  transition: color var(--dur-fast) var(--ease-out);
}
.page-hero__breadcrumb a:hover {
  color: var(--gray-0);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.page-hero__breadcrumb [aria-current="page"] span {
  color: var(--gray-0);
  font-weight: var(--fw-medium);
}

/* ── Kicker (badge + eyebrow) ────────────────────────────────────────── */

.page-hero__kicker {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.page-hero__badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.6rem;
  font-size: 0.625rem;
  font-weight: var(--fw-bold);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-radius: var(--radius-full);
  background: var(--brand);
  color: var(--brand-ink);
  white-space: nowrap;
}
.page-hero__badge--official { background: var(--brand); color: var(--brand-ink); }
.page-hero__badge--info     { background: color-mix(in srgb, var(--info-500) 90%, black); color: #fff; }
.page-hero__badge--neutral  { background: rgb(255 255 255 / 0.15); color: var(--gray-0); }

.page-hero__eyebrow {
  display: inline-flex;
  align-items: center;
  font-size: 0.6875rem;
  font-weight: var(--fw-bold);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: rgb(255 255 255 / 0.9);
}

/* ── Title & lead ───────────────────────────────────────────────────── */

.page-hero__title {
  font-size: clamp(1.75rem, 1.4rem + 2vw, 3rem);
  font-weight: var(--fw-bold);
  line-height: 1.08;
  letter-spacing: -0.03em;
  color: var(--gray-0);
  margin: 0;
  max-width: 22ch;
  text-wrap: balance;
}
@media (min-width: 768px) {
  .page-hero__title { max-width: 26ch; }
}

.page-hero__lead {
  font-size: clamp(0.9375rem, 0.9rem + 0.4vw, 1.125rem);
  line-height: 1.6;
  color: rgb(255 255 255 / 0.88);
  margin: 0;
  max-width: 62ch;
  text-wrap: pretty;
}

/* ── Meta chips ─────────────────────────────────────────────────────── */

.page-hero__meta {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-4);
}
.page-hero__meta-item {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--fs-xs);
  font-weight: var(--fw-medium);
  color: rgb(255 255 255 / 0.85);
  letter-spacing: 0.02em;
}
.page-hero__meta-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: rgb(255 255 255 / 0.7);
}

/* ── Actions ────────────────────────────────────────────────────────── */

.page-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-top: var(--space-2);
}

.page-hero__actions .btn {
  min-height: 48px;
  padding-inline: var(--space-6);
  border-radius: var(--radius-full);
}

.page-hero__actions .btn-primary {
  background: var(--brand);
  color: var(--brand-ink);
  box-shadow: 0 10px 24px -8px color-mix(in srgb, var(--brand) 60%, transparent);
}
.page-hero__actions .btn-primary:hover {
  background: var(--brand-hover);
  transform: translateY(-1px);
}

.page-hero__actions .btn-secondary {
  background: rgb(255 255 255 / 0.10);
  color: var(--gray-0);
  border-color: rgb(255 255 255 / 0.24);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.page-hero__actions .btn-secondary:hover {
  background: rgb(255 255 255 / 0.20);
  border-color: rgb(255 255 255 / 0.40);
}

.page-hero__actions .btn-ghost {
  color: var(--gray-0);
  background: transparent;
  border-color: transparent;
}
.page-hero__actions .btn-ghost:hover {
  background: rgb(255 255 255 / 0.10);
}

/* ── Small screens ──────────────────────────────────────────────────── */

@media (max-width: 480px) {
  .page-hero__inner { padding-block: var(--space-10) var(--space-12); }
  .page-hero__actions { flex-direction: column; width: 100%; }
  .page-hero__actions .btn { width: 100%; justify-content: center; }
  .page-hero__title { max-width: 100%; }
}

/* ── Reduced motion ─────────────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  .page-hero__bg-img { transform: none !important; transition: none !important; }
}
