/* IRS Design System — Components */

/* ── Cards ─────────────────────────────────────────────── */
.card {
  background: var(--ds-white);
  border: 1px solid var(--ds-border);
  border-radius: var(--ds-radius-lg);
  padding: var(--ds-space-5);
  margin-bottom: var(--ds-space-5);
  box-shadow: var(--ds-shadow-sm);
}
.card__title {
  margin: 0 0 var(--ds-space-4);
  font-size: var(--ds-fs-xl);
  font-weight: 600;
}

/* ── Buttons ───────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--ds-space-2);
  padding: var(--ds-space-3) var(--ds-space-5);
  border: 1px solid transparent;
  border-radius: var(--ds-radius-lg);
  font-family: inherit;
  font-size: var(--ds-fs-base);
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  text-decoration: none;
  transition: background-color var(--ds-transition-fast), color var(--ds-transition-fast), box-shadow var(--ds-transition-fast);
}
.btn:focus-visible {
  outline: var(--ds-focus-width) solid var(--ds-focus);
  outline-offset: var(--ds-focus-offset);
}
.btn:disabled,
.btn[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}
.btn.is-disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn--primary {
  background: var(--ds-primary);
  color: var(--ds-white);
}
.btn--primary:hover:not(:disabled) {
  background: var(--ds-primary-dark);
  color: var(--ds-white);
}

.btn--secondary {
  background: var(--ds-white);
  color: var(--ds-primary);
  border-color: var(--ds-primary);
}
.btn--secondary:hover:not(:disabled) {
  background: var(--ds-primary-lighter);
  color: var(--ds-primary-dark);
}

.btn--link {
  background: none;
  border: none;
  color: var(--ds-primary);
  text-decoration: underline;
  padding: var(--ds-space-1) 0;
  font-weight: 600;
  border-radius: 0;
}
.btn--link:hover:not(:disabled) { color: var(--ds-primary-dark); }
.btn--link.btn--danger { color: var(--ds-red); }
.btn--link.btn--danger:hover { color: var(--ds-red-dark); }

.btn--danger {
  background: var(--ds-red);
  color: var(--ds-white);
}
.btn--danger:hover:not(:disabled) { background: var(--ds-red-dark); }

.btn--block { width: 100%; display: flex; }

/* ── Forms ─────────────────────────────────────────────── */
.form { display: block; }

.field { margin-bottom: var(--ds-space-5); }

.field label {
  display: block;
  font-weight: 600;
  margin-bottom: var(--ds-space-1);
  font-size: var(--ds-fs-base);
  color: var(--ds-text);
}

.field input[type="text"],
.field input[type="email"],
.field input[type="password"],
.field input[type="tel"],
.field input[type="date"],
.field input[type="number"],
.field input[type="search"],
.field select,
.field textarea {
  width: 100%;
  padding: var(--ds-space-2) var(--ds-space-3);
  border: 1px solid var(--ds-border-strong);
  border-radius: var(--ds-radius);
  font-family: inherit;
  font-size: var(--ds-fs-base);
  line-height: var(--ds-lh-base);
  background: var(--ds-white);
  color: var(--ds-text);
  transition: border-color var(--ds-transition-fast), box-shadow var(--ds-transition-fast);
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: var(--ds-focus-width) solid var(--ds-focus);
  outline-offset: var(--ds-focus-offset);
  border-color: var(--ds-primary);
}
.field input:disabled,
.field select:disabled,
.field textarea:disabled {
  background: var(--ds-gray-100);
  color: var(--ds-text-muted);
  cursor: not-allowed;
}

.field textarea { resize: vertical; min-height: 100px; }

.field input[type="file"] {
  padding: var(--ds-space-2) 0;
  font-size: var(--ds-fs-sm);
}

.field--checkbox label {
  display: flex;
  align-items: flex-start;
  gap: var(--ds-space-2);
  font-weight: 400;
}
.field--checkbox input[type="checkbox"] {
  margin-top: 4px;
  width: 18px; height: 18px;
  accent-color: var(--ds-primary);
  flex-shrink: 0;
}

.field__error {
  color: var(--ds-red);
  font-size: var(--ds-fs-sm);
  margin: var(--ds-space-1) 0 0;
  font-weight: 600;
}
.field__hint {
  color: var(--ds-text-muted);
  font-size: var(--ds-fs-sm);
  margin: var(--ds-space-1) 0 0;
}

.field--error input,
.field--error select,
.field--error textarea {
  border-color: var(--ds-red);
}

fieldset {
  border: 1px solid var(--ds-border);
  border-radius: var(--ds-radius);
  padding: var(--ds-space-5);
  margin: 0 0 var(--ds-space-5);
}
legend {
  font-weight: 600;
  padding: 0 var(--ds-space-2);
}

.form__actions {
  display: flex;
  gap: var(--ds-space-3);
  align-items: center;
  flex-wrap: wrap;
  margin-top: var(--ds-space-4);
}

/* ── Badges ────────────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: 2px var(--ds-space-2);
  border-radius: var(--ds-radius-pill);
  font-size: var(--ds-fs-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.badge--neutral { background: var(--ds-gray-200); color: var(--ds-text); }
.badge--success { background: var(--ds-accent-light); color: var(--ds-accent-dark); }
.badge--warning { background: var(--ds-gold-light); color: var(--ds-gold-dark); }
.badge--danger  { background: var(--ds-red-light); color: var(--ds-red-dark); }
.badge--info    { background: var(--ds-primary-lighter); color: var(--ds-primary-dark); }

/* ── Notifications ─────────────────────────────────────── */
.notification {
  width: 100%;
  padding: var(--ds-space-4) var(--ds-space-5);
  border-bottom: 1px solid var(--ds-border);
}
.notification--info    { background: var(--ds-primary-lighter); border-left: 6px solid var(--ds-primary); }
.notification--action  { background: var(--ds-gold-light);      border-left: 6px solid var(--ds-gold); }
.notification--urgent  { background: var(--ds-red-light);       border-left: 6px solid var(--ds-red); }
.notification--success { background: var(--ds-accent-light);    border-left: 6px solid var(--ds-accent); }
.notification__inner {
  max-width: var(--ds-container-wide);
  margin: 0 auto;
}
.notification__label {
  display: block;
  font-size: var(--ds-fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
  margin-bottom: var(--ds-space-1);
  color: var(--ds-text);
}
.notification__body {
  font-size: var(--ds-fs-lg);
  font-weight: 600;
  color: var(--ds-text);
  display: block;
  line-height: var(--ds-lh-tight);
}

/* ── Flash ─────────────────────────────────────────────── */
.flash-stack { padding: var(--ds-space-4) var(--ds-space-5); max-width: var(--ds-container-wide); margin: 0 auto; }
.flash {
  padding: var(--ds-space-3) var(--ds-space-4);
  border-radius: var(--ds-radius);
  margin-bottom: var(--ds-space-2);
  border-left: 4px solid;
  font-size: var(--ds-fs-sm);
}
.flash--success { background: var(--ds-accent-light);    border-color: var(--ds-accent); }
.flash--error   { background: var(--ds-red-light);       border-color: var(--ds-red); }
.flash--info    { background: var(--ds-primary-lighter); border-color: var(--ds-primary); }

/* ── Tables ────────────────────────────────────────────── */
.table {
  width: 100%;
  border-collapse: collapse;
  background: var(--ds-white);
  border: 1px solid var(--ds-border);
  border-radius: var(--ds-radius-lg);
  overflow: hidden;
  font-size: var(--ds-fs-sm);
}
.table th, .table td {
  padding: var(--ds-space-3) var(--ds-space-4);
  text-align: left;
  border-bottom: 1px solid var(--ds-border);
  vertical-align: top;
}
.table th {
  background: var(--ds-gray-100);
  font-weight: 600;
  text-transform: uppercase;
  font-size: var(--ds-fs-xs);
  letter-spacing: 0.04em;
  color: var(--ds-text-muted);
}
.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: var(--ds-gray-50); }

/* Recipients table refinements */
.table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.table--recipients { min-width: 860px; }
.table__primary {
  display: block;
  font-weight: 600;
  text-decoration: none;
}
.table__secondary {
  display: block;
  color: var(--ds-text-muted);
  font-size: var(--ds-fs-xs);
  margin-top: 2px;
}
.table__muted { color: var(--ds-text-muted); }
.table__actions-col { text-align: right; }
.table__actions {
  display: flex;
  gap: var(--ds-space-2);
  align-items: center;
  flex-wrap: nowrap;
  white-space: nowrap;
}
.table__actions a,
.table__actions button { margin-right: 0; }
.table__actions form { margin: 0; display: inline-flex; }

@media (max-width: 640px) {
  .table { display: block; overflow-x: auto; white-space: nowrap; }
}

/* ── Nav (admin sidebar) ───────────────────────────────── */
.admin-nav__list { list-style: none; margin: 0; padding: 0; }
.admin-nav__item { margin: 0; }
.admin-nav__link {
  display: flex;
  align-items: center;
  gap: var(--ds-space-3);
  padding: var(--ds-space-3) var(--ds-space-5);
  color: var(--ds-text);
  text-decoration: none;
  font-weight: 600;
  font-size: var(--ds-fs-sm);
  transition: background var(--ds-transition-fast);
}
.admin-nav__link .icon { color: var(--ds-primary); flex-shrink: 0; }
.admin-nav__link:hover { background: var(--ds-gray-200); }
.admin-nav__link.is-active {
  background: var(--ds-white);
  border-left: 4px solid var(--ds-primary);
  padding-left: calc(var(--ds-space-5) - 4px);
  color: var(--ds-primary-dark);
}

/* ── Terms box ─────────────────────────────────────────── */
.terms-box {
  background: var(--ds-gray-100);
  border: 1px solid var(--ds-border);
  border-radius: var(--ds-radius);
  padding: var(--ds-space-5);
  max-height: 400px;
  overflow-y: auto;
  line-height: var(--ds-lh-loose);
}
.terms-box h2:first-child,
.terms-box h3:first-child { margin-top: 0; }

/* ── Key/value definition list ─────────────────────────── */
.kv {
  display: grid;
  grid-template-columns: minmax(140px, 180px) 1fr;
  gap: var(--ds-space-2) var(--ds-space-4);
  margin: 0;
}
.kv dt { font-weight: 600; color: var(--ds-text-muted); font-size: var(--ds-fs-sm); }
.kv dd { margin: 0; word-break: break-word; }

@media (max-width: 640px) {
  .kv { grid-template-columns: 1fr; gap: var(--ds-space-1) 0; }
  .kv dt { margin-top: var(--ds-space-3); }
}

/* ── Grid ──────────────────────────────────────────────── */
.grid { display: grid; gap: var(--ds-space-5); margin-bottom: var(--ds-space-5); }
.grid--2 { grid-template-columns: 1fr 1fr; }
@media (max-width: 900px) { .grid--2 { grid-template-columns: 1fr; } }

/* ── Stats ─────────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--ds-space-4);
  margin-bottom: var(--ds-space-5);
}
.stat-card {
  display: flex;
  flex-direction: column;
  padding: var(--ds-space-5);
  background: var(--ds-white);
  border: 1px solid var(--ds-border);
  border-radius: var(--ds-radius-md);
  text-decoration: none;
  color: var(--ds-text);
  transition: background var(--ds-transition-fast), transform var(--ds-transition-fast), box-shadow var(--ds-transition-fast);
  box-shadow: var(--ds-shadow-sm);
}
.stat-card:hover { background: var(--ds-primary-lighter); color: var(--ds-text); transform: translateY(-1px); }
.stat-card:focus-visible { outline: var(--ds-focus-width) solid var(--ds-focus); outline-offset: var(--ds-focus-offset); }
.stat-card__label {
  font-size: var(--ds-fs-xs);
  color: var(--ds-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--ds-space-2);
  font-weight: 600;
}
.stat-card__value {
  font-size: var(--ds-fs-4xl);
  font-weight: 700;
  color: var(--ds-primary);
  line-height: 1;
}

/* ── Filter bar ────────────────────────────────────────── */
.filter-bar {
  display: flex;
  align-items: center;
  gap: var(--ds-space-3);
  margin-bottom: var(--ds-space-4);
  padding: var(--ds-space-3) var(--ds-space-4);
  background: var(--ds-gray-100);
  border-radius: var(--ds-radius);
  flex-wrap: wrap;
}
.filter-bar label { font-weight: 600; font-size: var(--ds-fs-sm); margin: 0; }
.filter-bar__count { color: var(--ds-text-muted); font-size: var(--ds-fs-sm); margin-left: auto; }

/* ── Ticket messages ───────────────────────────────────── */
.ticket-msg {
  border-left: 4px solid var(--ds-border);
  padding: var(--ds-space-4);
  margin-bottom: var(--ds-space-4);
  background: var(--ds-gray-50);
  border-radius: var(--ds-radius);
}
.ticket-msg:last-child { margin-bottom: 0; }
.ticket-msg--admin    { border-left-color: var(--ds-primary); background: var(--ds-primary-lighter); }
.ticket-msg--claimant { border-left-color: var(--ds-accent);  background: var(--ds-accent-light); }
.ticket-msg--internal { border-left-color: var(--ds-gold);    background: var(--ds-gold-light); }
.ticket-msg__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--ds-space-2);
  gap: var(--ds-space-3);
  flex-wrap: wrap;
}
.ticket-msg__time { color: var(--ds-text-muted); font-size: var(--ds-fs-xs); }
.ticket-msg__body { line-height: var(--ds-lh-base); word-wrap: break-word; }
.ticket-msg__attachments { list-style: none; padding: 0; margin: var(--ds-space-2) 0 0; }
.ticket-msg__attachments li { margin: var(--ds-space-1) 0; }

/* ── Notifications list (admin view) ───────────────────── */
.notification-list { list-style: none; padding: 0; margin: 0; }
.notification-list li {
  padding: var(--ds-space-3) 0;
  border-bottom: 1px solid var(--ds-border);
  display: flex;
  gap: var(--ds-space-3);
  align-items: center;
  flex-wrap: wrap;
}
.notification-list li:last-child { border-bottom: none; }
.notification-list__body { flex: 1 1 220px; min-width: 0; }
.notification-list li form { margin: 0 0 0 auto; }

/* ── Image previews (settings) ─────────────────────────── */
.image-preview {
  display: flex;
  align-items: center;
  gap: var(--ds-space-4);
  margin-bottom: var(--ds-space-2);
  padding: var(--ds-space-3);
  border: 1px solid var(--ds-border);
  border-radius: var(--ds-radius);
  background: var(--ds-gray-50);
}
.image-preview img { max-height: 60px; max-width: 240px; }
.image-preview--small { max-height: 32px; max-width: 32px; }

/* ── Inline form ───────────────────────────────────────── */
.inline-form { display: inline; }

/* ── Badge groups ──────────────────────────────────────── */
.badge-row { display: flex; flex-wrap: wrap; gap: var(--ds-space-1); }

/* ── Icons ─────────────────────────────────────────────── */
.icon {
  display: inline-block;
  width: 1em;
  height: 1em;
  vertical-align: -0.125em;
  fill: none;
  stroke: currentColor;
}
.icon--sm { width: 16px; height: 16px; }
.icon--md { width: 20px; height: 20px; }
.icon--lg { width: 24px; height: 24px; }
.icon--xl { width: 32px; height: 32px; }

/* ── Auth board ────────────────────────────────────────── */
.auth-page { min-height: 100vh; display: flex; flex-direction: column; }
.auth-board {
  background: var(--ds-primary-darker);
  color: var(--ds-text-inverse);
  padding: var(--ds-space-5) var(--ds-space-5);
  border-bottom: 4px solid var(--ds-primary);
}
.auth-board__inner {
  max-width: var(--ds-container);
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: var(--ds-space-4);
}
.auth-board__logo {
  height: 56px;
  width: auto;
  background: #fff;
  padding: 6px;
  border-radius: var(--ds-radius);
}
.auth-board__logo-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px; height: 56px;
  background: var(--ds-primary);
  color: #fff;
  border-radius: var(--ds-radius);
  font-weight: 700;
  font-size: 26px;
}
.auth-board__text { display: flex; flex-direction: column; }
.auth-board__title { font-size: var(--ds-fs-2xl); font-weight: 700; line-height: 1.2; }
.auth-board__sub   { font-size: var(--ds-fs-sm); opacity: 0.85; }
.auth-shell { flex: 1; display: flex; align-items: center; justify-content: center; padding: var(--ds-space-5); }
.auth-footer {
  text-align: center;
  padding: var(--ds-space-4);
  color: var(--ds-text-muted);
  font-size: var(--ds-fs-sm);
}
.auth-card__help { margin-top: var(--ds-space-4); font-size: var(--ds-fs-sm); color: var(--ds-text-muted); }

/* ── Dashboard (claimant) ──────────────────────────────── */
.dashboard { max-width: 960px; margin: 0 auto; padding: var(--ds-space-5); }

.dash-hero {
  background: linear-gradient(135deg, var(--ds-primary-darker) 0%, var(--ds-primary-dark) 100%);
  color: #fff;
  border-radius: var(--ds-radius-lg);
  padding: var(--ds-space-6);
  margin-bottom: var(--ds-space-5);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--ds-space-5);
  flex-wrap: wrap;
  box-shadow: var(--ds-shadow);
}
.dash-hero__title,
.dash-hero__sub,
.dash-hero__amount,
.dash-hero__amount-label {
  color: #fff;
}
.dash-hero__title { font-size: var(--ds-fs-2xl); font-weight: 700; margin: 0 0 var(--ds-space-1); }
.dash-hero__sub   { font-size: var(--ds-fs-sm); opacity: 0.85; margin: 0; }
.dash-hero__amount { font-size: var(--ds-fs-4xl); font-weight: 700; line-height: 1; }
.dash-hero__amount-label { font-size: var(--ds-fs-xs); text-transform: uppercase; letter-spacing: 0.06em; opacity: 0.8; }

.dash-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--ds-space-4);
  margin-bottom: var(--ds-space-5);
}
.dash-card {
  background: #fff;
  border: 1px solid var(--ds-border);
  border-radius: var(--ds-radius-lg);
  padding: var(--ds-space-5);
  box-shadow: var(--ds-shadow-sm);
  transition: box-shadow 120ms ease;
}
.dash-card:hover { box-shadow: var(--ds-shadow); }
.dash-card__head {
  display: flex;
  align-items: center;
  gap: var(--ds-space-3);
  margin-bottom: var(--ds-space-3);
}
.dash-card__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px; height: 40px;
  border-radius: var(--ds-radius);
  background: var(--ds-primary-lighter);
  color: var(--ds-primary);
  flex-shrink: 0;
}
.dash-card__icon--success { background: var(--ds-accent-light); color: var(--ds-accent-dark); }
.dash-card__icon--warning { background: var(--ds-gold-light); color: var(--ds-gold-dark); }
.dash-card__icon--danger  { background: var(--ds-red-light); color: var(--ds-red-dark); }
.dash-card__label { font-size: var(--ds-fs-xs); text-transform: uppercase; letter-spacing: 0.05em; color: var(--ds-text-muted); font-weight: 600; }
.dash-card__value { font-size: var(--ds-fs-3xl); font-weight: 700; color: var(--ds-text); line-height: 1.1; }
.dash-card__desc { font-size: var(--ds-fs-sm); color: var(--ds-text-muted); margin: var(--ds-space-2) 0 0; }

.dash-section { margin-bottom: var(--ds-space-5); }
.dash-section__title { font-size: var(--ds-fs-lg); font-weight: 600; margin: 0 0 var(--ds-space-3); display: flex; align-items: center; gap: var(--ds-space-2); }

/* Call-to-action block inside a dashboard section */
.dash-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--ds-space-4);
  flex-wrap: wrap;
  padding: var(--ds-space-4) var(--ds-space-5);
  background: var(--ds-white);
  border: 1px solid var(--ds-border);
  border-radius: var(--ds-radius-lg);
  box-shadow: var(--ds-shadow-sm);
}
.dash-action__text { min-width: 220px; }
.dash-action__lead { margin: 0; font-weight: 600; }
.dash-action__hint { margin: var(--ds-space-1) 0 0; color: var(--ds-text-muted); font-size: var(--ds-fs-sm); }
.dash-action__buttons { display: flex; gap: var(--ds-space-3); flex-wrap: wrap; }

.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li {
  display: flex;
  gap: var(--ds-space-3);
  padding: var(--ds-space-3) 0;
  border-bottom: 1px solid var(--ds-border);
}
.timeline li:last-child { border-bottom: none; }
.timeline__icon {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--ds-gray-100);
  color: var(--ds-primary);
  flex-shrink: 0;
}
.timeline__body { flex: 1; }
.timeline__title { font-weight: 600; margin: 0; }
.timeline__meta  { font-size: var(--ds-fs-xs); color: var(--ds-text-muted); margin: 2px 0 0; }

.stat-card__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px; height: 40px;
  border-radius: var(--ds-radius);
  background: var(--ds-primary-lighter);
  color: var(--ds-primary);
  margin-bottom: var(--ds-space-3);
}
.stat-card__icon--success { background: var(--ds-accent-light); color: var(--ds-accent-dark); }
.stat-card__icon--warning { background: var(--ds-gold-light); color: var(--ds-gold-dark); }
.stat-card__icon--danger  { background: var(--ds-red-light); color: var(--ds-red-dark); }

@media (max-width: 640px) {
  .dashboard { padding: var(--ds-space-4); }
  .dash-hero { padding: var(--ds-space-5); }
  .dash-hero__amount { font-size: var(--ds-fs-3xl); }
  .dash-grid { grid-template-columns: 1fr; }
}

.site-header__name {
  font-weight: 600;
  font-size: var(--ds-fs-lg);
  color: var(--ds-text-inverse);
}
.site-header__name--standalone { font-size: var(--ds-fs-xl); }
.site-header__right {
  display: flex;
  align-items: center;
  gap: var(--ds-space-4);
}
.site-header__signout { color: var(--ds-text-inverse); }
.site-header__signout:hover { color: var(--ds-text-inverse); }

.lang-selector { display: inline-block; }
.lang-selector__select {
  background: rgba(255, 255, 255, 0.1);
  color: var(--ds-text-inverse);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: var(--ds-radius);
  padding: 6px 10px;
  font-family: inherit;
  font-size: var(--ds-fs-sm);
  font-weight: 600;
  cursor: pointer;
  min-width: 120px;
}
.lang-selector__select option {
  color: var(--ds-text);
  background: var(--ds-white);
}
.lang-selector__select:focus-visible {
  outline: var(--ds-focus-width) solid var(--ds-focus);
  outline-offset: 2px;
}

@media (max-width: 640px) {
  .site-header__inner { flex-wrap: wrap; gap: var(--ds-space-3); }
  .site-header__right {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    column-gap: var(--ds-space-4);
    row-gap: var(--ds-space-2);
  }
  .site-header__right .lang-selector { grid-row: 1 / span 2; grid-column: 1; align-self: center; }
  .site-header__right .avatar-menu { grid-row: 1; grid-column: 2; justify-self: end; }
  .site-header__right .inline-form { grid-row: 2; grid-column: 2; justify-self: end; }
  .lang-selector__select { min-width: 0; }
}

.site-footer {
  background: var(--ds-primary-darker);
  color: var(--ds-gray-300);
  padding: var(--ds-space-6) 0 var(--ds-space-5);
  margin-top: var(--ds-space-7);
  font-size: var(--ds-fs-sm);
}
.site-footer__inner {
  max-width: var(--ds-container-wide);
  margin: 0 auto;
  padding: 0 var(--ds-space-5);
  display: flex;
  flex-direction: column;
  gap: var(--ds-space-3);
}
.site-footer__brand {
  display: flex;
  align-items: center;
  gap: var(--ds-space-3);
}
.site-footer__logo {
  max-height: 40px;
  width: auto;
  background: #fff;
  padding: 4px;
  border-radius: var(--ds-radius-sm);
}
.site-footer__name {
  font-weight: 700;
  font-size: var(--ds-fs-lg);
  color: var(--ds-white);
}
.site-footer__name--standalone { font-size: var(--ds-fs-xl); }
.site-footer__note {
  margin: 0;
  font-size: var(--ds-fs-sm);
  color: var(--ds-gray-300);
}
.site-footer__meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--ds-space-4);
  font-size: var(--ds-fs-xs);
  color: var(--ds-gray-400);
}
.site-footer__meta a { color: var(--ds-gray-300); }

html[dir="rtl"] .site-header__inner { direction: rtl; }
html[dir="rtl"] .site-header__right { flex-direction: row-reverse; }
html[dir="rtl"] .site-footer__meta { direction: rtl; }

.avatar {
  display: inline-block;
  border-radius: 50%;
  background: var(--ds-gray-100);
  vertical-align: middle;
  object-fit: cover;
}
.avatar--xs { width: 24px; height: 24px; }
.avatar--sm { width: 32px; height: 32px; }
.avatar--md { width: 40px; height: 40px; }
.avatar--lg { width: 64px; height: 64px; }
.avatar--xl { width: 96px; height: 96px; }

.avatar-menu {
  display: inline-flex;
  align-items: center;
  gap: var(--ds-space-2);
  color: inherit;
  text-decoration: none;
}
.avatar-block { display: flex; align-items: center; gap: var(--ds-space-4); padding: var(--ds-space-4) 0; }
.avatar-block__name { font-weight: 700; font-size: var(--ds-fs-lg); }
.avatar-block__meta { color: var(--ds-text-muted); font-size: var(--ds-fs-sm); }

.money { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }

.color-row {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: var(--ds-space-3);
  align-items: center;
}
.color-row input[type="color"] {
  width: 64px;
  height: 40px;
  padding: 2px;
  border: 1px solid var(--ds-border-strong);
  border-radius: var(--ds-radius);
  background: #fff;
  cursor: pointer;
}
.color-row input[type="text"] {
  font-family: var(--ds-font-mono);
  font-size: var(--ds-fs-sm);
  text-transform: lowercase;
}

/* ── Admin shell — mobile drawer ───────────────────────── */
.admin-shell__toggle {
  display: none;
  align-items: center;
  gap: var(--ds-space-2);
  background: none;
  border: 1px solid var(--ds-border);
  border-radius: var(--ds-radius);
  padding: var(--ds-space-2) var(--ds-space-3);
  cursor: pointer;
  color: var(--ds-text);
  font: inherit;
  font-weight: 600;
  font-size: var(--ds-fs-sm);
}
.admin-shell__toggle:hover { background: var(--ds-gray-100); }

.admin-shell__backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 90;
}

.admin-mobile-bar {
  display: none;
  padding: var(--ds-space-3) var(--ds-space-4);
  border-bottom: 1px solid var(--ds-border);
  background: var(--ds-bg-alt);
}

@media (max-width: 900px) {
  .admin-shell { display: block; }
  .admin-shell__toggle { display: inline-flex; }
  .admin-mobile-bar { display: block; }

  .admin-shell__sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 260px;
    max-width: 80vw;
    background: var(--ds-white);
    border-right: 1px solid var(--ds-border);
    padding: var(--ds-space-5) 0;
    overflow-y: auto;
    transform: translateX(-100%);
    transition: transform 180ms ease;
    z-index: 100;
    box-shadow: var(--ds-shadow-lg);
  }

  .admin-shell__sidebar.is-open { transform: translateX(0); }

  .admin-shell__backdrop.is-open { display: block; }

  .admin-shell__main { padding: var(--ds-space-4); }
}

@media (min-width: 901px) {
  .admin-mobile-bar { display: none; }
  .site-header__admin-toggle { display: none; }
}

/* Small buttons for tables and inline actions */
.btn--sm {
  padding: 6px 12px;
  font-size: var(--ds-fs-sm);
  line-height: 1.2;
  border-radius: var(--ds-radius);
}

/* Outlined danger — replaces the awkward inline-link-as-button pattern */
.btn--danger-outline {
  background: var(--ds-white);
  color: var(--ds-red);
  border: 1px solid var(--ds-red);
  text-decoration: none;
}
.btn--danger-outline:hover:not(:disabled) {
  background: var(--ds-red-light);
  color: var(--ds-red-dark);
}
.btn--danger-outline:focus-visible {
  outline: var(--ds-focus-width) solid var(--ds-focus);
  outline-offset: var(--ds-focus-offset);
}

/* Outlined neutral — for secondary actions in tables */
.btn--outline {
  background: var(--ds-white);
  color: var(--ds-primary);
  border: 1px solid var(--ds-primary);
  text-decoration: none;
}
.btn--outline:hover:not(:disabled) {
  background: var(--ds-primary-lighter);
  color: var(--ds-primary-dark);
}

.site-footer__copyright {
  margin: 0;
  font-size: var(--ds-fs-sm);
  color: var(--ds-footer-fg);
  opacity: 0.9;
}
.site-footer__note {
  margin: 0;
  font-size: var(--ds-fs-sm);
  color: var(--ds-footer-fg);
  opacity: 0.75;
}

.lang-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: var(--ds-space-1);
  border-bottom: 1px solid var(--ds-border);
  margin-bottom: var(--ds-space-5);
}
.lang-tab {
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  padding: var(--ds-space-2) var(--ds-space-4);
  font: inherit;
  font-weight: 600;
  font-size: var(--ds-fs-sm);
  color: var(--ds-text-muted);
  cursor: pointer;
}
.lang-tab:hover { color: var(--ds-text); }
.lang-tab.is-active {
  color: var(--ds-primary);
  border-bottom-color: var(--ds-primary);
}

/* Claimant navigation */
.claimant-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  padding: var(--ds-space-2) var(--ds-space-4);
  border-bottom: 1px solid var(--ds-border, #e6e6e6);
  background: var(--ds-surface, #fff);
}
.claimant-nav__link {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 6px;
  color: var(--ds-text, #333);
  text-decoration: none;
  font-size: var(--ds-fs-sm, 14px);
  line-height: 1;
  transition: background-color 120ms ease, color 120ms ease;
}
.claimant-nav__link:hover,
.claimant-nav__link:focus-visible {
  background-color: var(--ds-gray-100, #f1f4f8);
  color: var(--ds-primary, #1a5fb4);
  outline: none;
}
.claimant-nav__link.is-active {
  background-color: #e7effa;
  color: var(--ds-primary, #1a5fb4);
  font-weight: 600;
}

