/* =============================================================================
   Admin shell — sidebar nav + main pane. Only loaded under /admin pages.
   ============================================================================= */

.admin-body { background: var(--c-bg); }

.admin-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 260px 1fr;
  align-items: stretch;
}

/* ───────── Sidebar nav ───────── */
.admin-nav {
  background: linear-gradient(180deg, var(--c-navy-dark) 0%, var(--c-navy) 100%);
  color: rgba(255,255,255,0.88);
  padding: var(--s-5) var(--s-4);
  display: flex;
  flex-direction: column;
  gap: var(--s-4);
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.admin-nav__brand {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  color: #fff;
  padding-bottom: var(--s-4);
  border-bottom: 1px solid rgba(255,255,255,0.12);
  text-decoration: none;
}
.admin-nav__brand:hover { text-decoration: none; color: #fff; }
.admin-nav__brand-mark { color: var(--c-orange); display: inline-flex; }
.admin-nav__brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.admin-nav__brand-text strong { font-family: var(--font-display); font-size: var(--fs-md); }
.admin-nav__brand-text small  { font-size: var(--fs-xs); color: rgba(255,255,255,0.55); letter-spacing: 0.16em; text-transform: uppercase; }

.admin-nav__list { display: flex; flex-direction: column; gap: 2px; }
.admin-nav__link {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: 0.55rem 0.85rem;
  border-radius: var(--r-md);
  color: rgba(255,255,255,0.78);
  font-size: var(--fs-sm);
  font-weight: 500;
  transition: background .2s var(--ease-out), color .2s, transform .2s;
}
.admin-nav__link:hover {
  background: rgba(255,255,255,0.08);
  color: #fff;
  text-decoration: none;
  transform: translateX(2px);
}
.admin-nav__link.is-active {
  background: var(--c-orange);
  color: #fff;
  box-shadow: 0 6px 14px rgba(249,115,22,0.35);
}
.admin-nav__link.is-active:hover { background: var(--c-orange-dark); color: #fff; }

.admin-nav__divider {
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.4);
  padding: var(--s-3) 0.85rem var(--s-1);
  margin-top: var(--s-2);
}

.admin-nav__foot {
  margin-top: auto;
  border-top: 1px solid rgba(255,255,255,0.12);
  padding-top: var(--s-4);
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
}
.admin-nav__viewsite { color: rgba(255,255,255,0.78); font-size: var(--fs-sm); }
.admin-nav__viewsite:hover { color: #fff; }
.admin-nav__user { font-size: var(--fs-xs); color: rgba(255,255,255,0.55); margin: 0; }
.admin-nav__logout {
  width: 100%;
  padding: 0.55rem 0.85rem;
  background: rgba(255,255,255,0.08);
  color: #fff;
  border-radius: var(--r-md);
  font-size: var(--fs-sm);
  font-weight: 600;
  transition: background .2s;
}
.admin-nav__logout:hover { background: var(--c-danger); }

/* ───────── Main pane ───────── */
.admin-main {
  padding: var(--s-6) var(--s-7);
  max-width: 1200px;
  min-width: 0;
}

.admin-page__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: var(--s-4);
  margin-bottom: var(--s-6);
  flex-wrap: wrap;
}
.admin-page__head h1 { font-size: var(--fs-2xl); margin-top: var(--s-2); }
.admin-page__lede { color: var(--c-ink-muted); margin-top: var(--s-2); }
.admin-page__actions { display: flex; gap: var(--s-2); flex-wrap: wrap; }

/* ───────── Dashboard stat tiles ───────── */
.admin-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--s-4);
  margin-bottom: var(--s-6);
}
.admin-stat {
  background: #fff;
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  padding: var(--s-4) var(--s-5);
  box-shadow: var(--sh-sm);
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: transform .25s var(--ease-out), box-shadow .25s;
}
.admin-stat:hover { transform: translateY(-2px); box-shadow: var(--sh-md); }
.admin-stat__label { font-size: var(--fs-xs); letter-spacing: 0.12em; text-transform: uppercase; color: var(--c-ink-faint); }
.admin-stat__value {
  font-family: var(--font-display);
  font-size: clamp(1.375rem, 0.9rem + 1.1vw, 1.9rem);
  line-height: 1.15;
  color: var(--c-navy);
  white-space: nowrap;
}
.admin-stat__sub   { font-size: var(--fs-sm); color: var(--c-ink-muted); }
.admin-stat__sub a { color: var(--c-orange-dark); font-weight: 600; }

/* ───────── Dashboard cards grid ───────── */
.admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: var(--s-5);
}
.admin-card {
  background: #fff;
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  padding: var(--s-5);
  box-shadow: var(--sh-sm);
}
.admin-card__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--s-3);
}
.admin-card__head h2 { font-size: var(--fs-lg); color: var(--c-navy); }

.admin-feed {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--s-1);
}
.admin-feed li {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--s-3);
  align-items: center;
  padding: var(--s-3) 0;
  border-bottom: 1px solid var(--c-border);
}
.admin-feed li:last-child { border-bottom: 0; }
.admin-feed li > a {
  color: var(--c-ink);
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-decoration: none;
}
.admin-feed li > a strong { color: var(--c-ink); }
.admin-feed li > a small { color: var(--c-ink-faint); font-size: var(--fs-xs); }
.admin-feed li > a:hover strong { color: var(--c-navy); }

.admin-feed--links li { grid-template-columns: 1fr; }
.admin-feed--links a {
  padding: var(--s-3);
  background: var(--c-bg);
  border-radius: var(--r-md);
  transition: background .2s, transform .2s;
}
.admin-feed--links a:hover { background: var(--c-info-bg); transform: translateX(2px); }

/* ───────── Status filter tabs (segmented control) ───────── */
.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
  margin-bottom: var(--s-5);
  padding: var(--s-2);
  background: #fff;
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  box-shadow: var(--sh-sm);
}
.tab {
  flex: 1 1 auto;
  text-align: center;
  padding: 0.55rem 1rem;
  border-radius: var(--r-sm);
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--c-ink-muted);
  white-space: nowrap;
  transition: background .2s var(--ease-out), color .2s;
}
.tab:hover { background: var(--c-bg); color: var(--c-navy); text-decoration: none; }
.tab.is-active {
  background: var(--c-navy);
  color: #fff;
  box-shadow: var(--sh-sm);
}
.tab.is-active:hover { background: var(--c-navy-dark); color: #fff; }

/* ───────── Data tables (card-wrapped, centered) ───────── */
.table-wrap {
  background: #fff;
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-sm);
  overflow: hidden;
  overflow-x: auto;
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-sm);
}
.data-table thead th {
  background: var(--c-bg);
  text-align: center;
  font-size: var(--fs-xs);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--c-ink-faint);
  font-weight: 700;
  padding: var(--s-3) var(--s-4);
  border-bottom: 1px solid var(--c-border);
  white-space: nowrap;
}
.data-table tbody td {
  text-align: center;
  vertical-align: middle;
  padding: var(--s-4);
  border-bottom: 1px solid var(--c-border);
  color: var(--c-ink);
}
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr { transition: background .15s; }
.data-table tbody tr:hover { background: var(--c-bg); }
.data-table small { color: var(--c-ink-faint); }
/* Numeric columns: right-aligned, monospaced figures so prices/totals line up
   and never wrap mid-number. */
.data-table__amt {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  white-space: nowrap;
}
.data-table thead th.data-table__amt { text-align: right; }
/* Text column (e.g. line-item description): left-aligned, allowed to wrap. */
.data-table__l { text-align: left; }
.data-table thead th.data-table__l { text-align: left; }
/* Totals footer: separated from the body and right-aligned to match figures. */
.data-table tfoot td {
  padding: var(--s-2) var(--s-4);
  color: var(--c-ink);
}
.data-table tfoot tr:first-child td { border-top: 2px solid var(--c-border); padding-top: var(--s-3); }
.data-table tfoot tr:last-child td { padding-bottom: var(--s-3); }

/* Flush variant: a horizontal-scroll wrapper with no box of its own, for use
   inside a card that already provides the border/padding/background. */
.table-wrap--flush {
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

/* ───────── Status badges ───────── */
.status-badge {
  display: inline-block;
  padding: 0.25rem 0.7rem;
  border-radius: var(--r-pill);
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: capitalize;
  line-height: 1.4;
  background: var(--c-border);
  color: var(--c-ink-muted);
}
/* Green — done / good standing */
.status-badge--completed,
.status-badge--paid,
.status-badge--approved,
.status-badge--confirmed { background: var(--c-success-bg); color: var(--c-success); }
/* Amber — needs attention / in-between */
.status-badge--pending,
.status-badge--unpaid,
.status-badge--partial,
.status-badge--new { background: var(--c-warning-bg); color: var(--c-warning); }
/* Blue — active / in-flight */
.status-badge--enRoute,
.status-badge--inProgress,
.status-badge--read,
.status-badge--replied { background: var(--c-info-bg); color: var(--c-info); }
/* Red — cancelled / failed / urgent */
.status-badge--cancelled,
.status-badge--voided,
.status-badge--rejected,
.status-badge--overdue,
.status-badge--danger { background: var(--c-danger-bg); color: var(--c-danger); }

/* ───────── Row action link ───────── */
.link-arrow {
  font-weight: 600;
  color: var(--c-orange-dark);
  white-space: nowrap;
}
.link-arrow:hover { color: var(--c-orange); }

/* ───────── Empty state ───────── */
.empty {
  text-align: center;
  color: var(--c-ink-muted);
  padding: var(--s-6);
  background: #fff;
  border: 1px dashed var(--c-border-strong);
  border-radius: var(--r-lg);
}
.empty--full {
  padding: var(--s-8) var(--s-6);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--s-2);
}
.empty strong { color: var(--c-ink); font-size: var(--fs-md); }

/* ───────── Unread row highlighting ───────── */
.data-table tr.is-unread { background: color-mix(in srgb, var(--c-info-bg) 60%, transparent); }
.data-table tr.is-unread strong { color: var(--c-navy-dark); }

/* ───────── Responsive ───────── */
@media (max-width: 1024px) {
  .admin-shell { grid-template-columns: 1fr; }
  .admin-nav {
    position: static;
    height: auto;
    flex-direction: row;
    flex-wrap: wrap;
    gap: var(--s-3);
    padding: var(--s-3) var(--s-4);
  }
  .admin-nav__brand { padding-bottom: 0; border-bottom: 0; }
  .admin-nav__list { flex-direction: row; flex-wrap: wrap; flex: 1; gap: 4px; }
  .admin-nav__link { padding: 0.4rem 0.7rem; }
  .admin-nav__divider { display: none; }
  .admin-nav__foot { width: 100%; flex-direction: row; align-items: center; padding-top: var(--s-2); }
  .admin-main { padding: var(--s-5) var(--s-4); }
}

@media (max-width: 600px) {
  .admin-main { padding: var(--s-5) var(--s-3); }
  .admin-page__head { align-items: flex-start; }
  .admin-page__head h1 { font-size: var(--fs-xl); }
  /* Stack the nav links one per row so they stay comfortably tappable. */
  .admin-nav__list { flex-direction: column; }
  .admin-nav__link { padding: 0.5rem 0.7rem; }
  /* Action buttons span the card and may wrap, so long labels don't overflow. */
  .admin-main form .btn { width: 100%; white-space: normal; }
}

/* ───────────────────────────────────────────────────────────────────
   Admin polish — invoice-detail layout, money tables, kv tightening,
   draft / refunded badges, dev sandbox styling.
   ─────────────────────────────────────────────────────────────────── */

/* Money columns get fixed-width digits so totals line up cleanly. */
.data-table--money { font-variant-numeric: tabular-nums; }
.kv .num { font-variant-numeric: tabular-nums; }

/* Tighter KV grid for compact sidebars (used in invoice Summary). */
.kv--tight dt { padding-block: .25rem; color: var(--c-ink-faint); font-size: var(--fs-xs); letter-spacing: .04em; text-transform: uppercase; }
.kv--tight dd { padding-block: .25rem; }

/* Subtle horizontal separator inside a card. */
.card-sep { border: 0; border-top: 1px solid var(--c-border); margin: var(--s-3) 0; }

/* Action card sub-blocks — visually grouped sections inside one card. */
.action-block { padding-block: var(--s-3); }
.action-block + .action-block { border-top: 1px solid var(--c-border); }
.action-block:first-of-type { padding-top: 0; }
.action-block:last-of-type { padding-bottom: 0; }
.action-block h3 {
  font-size: var(--fs-md);
  color: var(--c-navy);
  margin: 0 0 var(--s-2);
  font-weight: 600;
}
.action-block--dev {
  background: linear-gradient(180deg, #fffaf0, #fff7e6);
  border: 1px dashed #d49a00;
  border-radius: 10px;
  padding: var(--s-3);
  margin-block: var(--s-3);
}
.action-block--dev + .action-block { border-top: 0; }
.action-block--dev h3 { color: #7a5100; }
.action-block--danger { padding-top: var(--s-4); }

/* Status badges — fill in the ones the base file doesn't cover. */
.status-badge--draft    { background: var(--c-bg);      color: var(--c-ink-muted); border: 1px solid var(--c-border); }
.status-badge--refunded { background: var(--c-info-bg); color: var(--c-info); }

/* Slightly softer card shadow on the accent variant so it stands out
   without screaming. */
.form-card--accent {
  box-shadow: 0 1px 0 rgba(15,23,42,0.04), 0 8px 24px -8px rgba(15,23,42,0.08);
}

/* ───────────────────────────────────────────────────────────────────
   Invoice-detail layout v2 — stacked, symmetric, predictable.
   Replaces the lopsided detail-grid two-column layout with a single
   column of full-width cards + a 3-cell stat strip and a 3-cell
   action grid. Each row has the same width, headings, and rhythm.
   ─────────────────────────────────────────────────────────────────── */

/* Top stat strip — Total / Paid / Balance / Issued / Due. */
.stat-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: var(--s-3);
  margin-block: var(--s-4) var(--s-5);
}
.stat-strip__cell {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: 10px;
  padding: 0.75rem 0.95rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.stat-strip__cell--accent {
  background: color-mix(in srgb, var(--c-warning-bg) 60%, var(--c-surface));
  border-color: color-mix(in srgb, var(--c-warning) 35%, var(--c-border));
}
.stat-strip__label {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--c-ink-faint);
}
.stat-strip__value {
  font-size: var(--fs-lg);
  font-weight: 700;
  color: var(--c-navy);
  font-variant-numeric: tabular-nums;
}
@media (max-width: 900px) {
  .stat-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 480px) {
  .stat-strip { grid-template-columns: 1fr; }
}

/* Action grid — three equal columns at desktop, stacks on smaller screens.
   Cards inside share the same internal structure (h3, hint, form/button)
   so they line up visually no matter how much content each has. */
.action-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--s-3);
  margin-block: var(--s-4) var(--s-3);
}
.action-grid__cell {
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
  align-self: stretch;   /* all cells stretch to the tallest one */
}
.action-grid__cell h3 {
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--c-navy);
  margin: 0;
}
.action-grid__cell .auth-form { gap: var(--s-2); }
.action-grid__cell form { margin-top: auto; }   /* button anchors to bottom */
.action-grid__cell--danger { border-top: 3px solid var(--c-danger); }
@media (max-width: 900px) {
  .action-grid { grid-template-columns: 1fr; }
}

/* Card empty + note states — quieter copy than body text. */
.form-card__empty,
.form-card__hint,
.form-card__note {
  font-size: var(--fs-xs);
  color: var(--c-ink-muted);
  margin: 0;
}
.form-card__note { margin-top: var(--s-3); }

/* Foot link — secondary nav at the very bottom of detail pages. */
.page-foot-link {
  margin-top: var(--s-4);
  font-size: var(--fs-sm);
  color: var(--c-ink-muted);
  text-align: center;
}

/* Destructive action area — kept off in its own band at the very bottom
   so it never sits next to the primary actions and never gets a stray
   click. Subtle separator above, right-aligned. */
.page-foot-danger {
  margin-top: var(--s-5);
  padding-top: var(--s-4);
  border-top: 1px dashed var(--c-border);
  display: flex;
  justify-content: flex-end;
}

/* ───────────────────────────────────────────────────────────────────
   Belt-and-braces on the heading sizes. The earlier overrides used
   variable-driven sizes that some browsers ignored if a more-specific
   public-site rule was already cached. These set them explicitly.
   ─────────────────────────────────────────────────────────────────── */
.admin-body .admin-page__head h1 { font-size: 1.5rem; line-height: 1.25; }
.admin-body .form-card h2        { font-size: 1.05rem; font-weight: 700; margin-bottom: 0.85rem; color: var(--c-navy); }
.admin-body .form-card h3        { font-size: 0.95rem; font-weight: 600; margin: 0 0 0.4rem; color: var(--c-navy); }

/* ───────────────────────────────────────────────────────────────────
   Admin form density — `.auth-form` is sized for finger-friendly public
   sign-in screens, which makes admin look pumped up. These overrides
   are scoped to `.admin-body` (and `.ic-modal`, which only renders in
   admin pages) so the public site keeps its current sizing.
   ─────────────────────────────────────────────────────────────────── */

/* Tighter vertical rhythm between fields. */
.admin-body .auth-form { gap: var(--s-3); align-items: stretch; }

/* Stop the flex-column from stretching every button across the row —
   buttons should size to their content unless explicitly told otherwise. */
.admin-body .auth-form > .btn,
.admin-body .auth-form > button,
.ic-modal .auth-form > .btn,
.ic-modal .auth-form > button { align-self: flex-start; width: auto; }

/* Compact labels. */
.admin-body .field { gap: 4px; }
.admin-body .field__label {
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--c-ink-muted);
  letter-spacing: .03em;
}
.admin-body .field__label small { font-weight: 400; }

/* Compact inputs / textareas / selects. */
.admin-body .field input,
.admin-body .field textarea,
.admin-body .field select {
  font-size: var(--fs-sm);
  padding: 0.45rem 0.65rem;
  border-width: 1px;
  border-radius: var(--r-sm, 6px);
}

/* Narrower row gap. */
.admin-body .field-row,
.admin-body .field-row--3 { gap: var(--s-3); }

/* Calm buttons — admin shouldn't have huge orange marketing CTAs.
   We strip the gradient bouncing, drop the size, and disable the
   moving shine. The look is still branded, just professional. */
.admin-body .btn,
.ic-modal .btn {
  padding: 0.45rem 0.95rem;
  font-size: var(--fs-sm);
  border-radius: var(--r-sm, 6px);
}
.admin-body .btn--lg,
.ic-modal .btn--lg {
  padding: 0.55rem 1.1rem;
  font-size: var(--fs-sm);
}
.admin-body .btn--primary,
.ic-modal .btn--primary {
  animation: none;
  box-shadow: none;
  background: var(--c-orange);
}
.admin-body .btn--primary::before,
.ic-modal .btn--primary::before { content: none; }
.admin-body .btn--sheen::after,
.ic-modal .btn--sheen::after { content: none; } /* no moving shine in admin */

/* Card section headings — quieter than marketing h2. */
.admin-body .form-card h2 {
  font-size: var(--fs-md);
  margin-bottom: var(--s-3);
}
.admin-body .form-card h3 {
  font-size: var(--fs-sm);
  font-weight: 600;
}

/* Page-head title — already overridden, but trim once more for breathing room. */
.admin-body .admin-page__head h1 { font-size: var(--fs-xl); }
.admin-body .admin-page__head .admin-page__lede { font-size: var(--fs-sm); }

/* Modal polish — tighter panel, smaller title, compact line-item table. */
.ic-modal__panel { max-width: 640px; padding: 1.25rem 1.5rem; }
.ic-modal__head h2 { font-size: var(--fs-lg); font-weight: 700; margin: 0; }
.ic-modal .field__hint { font-size: var(--fs-xs); }
.ic-modal .lineitems th {
  font-size: var(--fs-xs);
  font-weight: 600;
  text-align: left;
  color: var(--c-ink-muted);
  text-transform: uppercase;
  letter-spacing: .04em;
}
.ic-modal .lineitems input {
  font-size: var(--fs-sm);
  padding: 0.35rem 0.55rem;
  border: 1px solid var(--c-border-strong);
  border-radius: var(--r-sm, 6px);
}
.ic-modal #add-lineitem {
  margin-top: var(--s-2);
  padding: 0.35rem 0.7rem;
  font-size: var(--fs-xs);
}

/* Per-row remove button — small ✕ icon, danger-colored on hover. */
.ic-modal .lineitems__remove {
  width: 1.7rem;
  height: 1.7rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--c-border);
  border-radius: 6px;
  color: var(--c-ink-faint);
  cursor: pointer;
  font-size: 0.85rem;
  line-height: 1;
  padding: 0;
  transition: color .15s, border-color .15s, background .15s;
}
.ic-modal .lineitems__remove:hover {
  color: var(--c-danger);
  border-color: var(--c-danger);
  background: var(--c-danger-bg);
}
.ic-modal .lineitems th:last-child,
.ic-modal .lineitems td:last-child { text-align: center; }

/* Payment-mode picker inside the modal. */
.ic-modal .paymode {
  margin-top: var(--s-3);
  padding: .65rem .8rem;
  border: 1px solid var(--c-border);
  border-radius: 8px;
  background: var(--c-bg);
}
.ic-modal .paymode legend {
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--c-ink-muted);
  padding: 0 .3rem;
}
.ic-modal .paymode__choice {
  display: flex;
  align-items: flex-start;
  gap: .55rem;
  padding: .25rem 0;
  font-size: var(--fs-sm);
  cursor: pointer;
}
.ic-modal .paymode__choice input { margin-top: .25rem; }


/* Inline row actions on appointment / invoice list tables */
.row-actions {
  display: flex;
  gap: 14px;
  justify-content: flex-end;
  align-items: center;
  white-space: nowrap;
}
.row-actions__form { margin: 0; display: inline; }
.row-actions__delete {
  appearance: none;
  background: transparent;
  border: 1px solid transparent;
  color: var(--c-danger, #b91c1c);
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 10px;
  border-radius: 6px;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.row-actions__delete:hover,
.row-actions__delete:focus-visible {
  background: rgba(220, 38, 38, 0.08);
  border-color: rgba(220, 38, 38, 0.35);
  color: #991b1b;
}

/* ───────── Floating flash toast (admin only) ─────────
   On admin pages the flash floats top-right instead of pushing the
   nav + content down. Public site keeps the inline banner. */
.admin-body .flash {
  position: fixed;
  top: var(--s-4);
  right: var(--s-4);
  left: auto;
  width: auto;
  max-width: min(440px, calc(100vw - 2rem));
  margin: 0;
  z-index: 1100;
  padding: var(--s-3) var(--s-4);
  font-size: var(--fs-sm);
  box-shadow: var(--sh-lg);
  border-radius: var(--r-md);
  animation: toastIn .28s var(--ease-out);
}
@keyframes toastIn {
  from { opacity: 0; transform: translateY(-10px) scale(.98); }
  to   { opacity: 1; transform: none; }
}
@media (max-width: 600px) {
  .admin-body .flash { left: var(--s-4); right: var(--s-4); max-width: none; }
}
@media (prefers-reduced-motion: reduce) {
  .admin-body .flash { animation: none; }
}

/* ───────── Designed confirm dialog ───────── */
.confirm {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--s-4);
}
.confirm[hidden] { display: none; }
.confirm__backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(2px);
  animation: confirmFade .2s var(--ease-out);
}
.confirm__panel {
  position: relative;
  background: #fff;
  border-radius: var(--r-lg);
  padding: var(--s-6) var(--s-6) var(--s-5);
  max-width: 420px;
  width: 100%;
  text-align: center;
  box-shadow: var(--sh-lg);
  animation: confirmPop .22s var(--ease-out);
}
.confirm__icon {
  width: 3rem;
  height: 3rem;
  margin: 0 auto var(--s-3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--c-danger);
  background: var(--c-danger-bg);
  border-radius: 50%;
}
.confirm__title {
  font-family: var(--font-display);
  font-size: var(--fs-lg);
  margin: 0 0 var(--s-2);
  color: var(--c-navy);
}
.confirm__msg { color: var(--c-ink-muted); margin: 0 0 var(--s-5); line-height: 1.5; }
.confirm__actions { display: flex; gap: var(--s-3); justify-content: center; }
.confirm__actions .btn { min-width: 7rem; }
@keyframes confirmFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes confirmPop {
  from { opacity: 0; transform: translateY(10px) scale(.96); }
  to   { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .confirm__backdrop, .confirm__panel { animation: none; }
}
