/* The admin area's layouts, on top of the customer pages' base (billing.css)
   and the design system (design/). Every colour, space and radius is a token
   (seeka-email docs/21-admin-design-system.md). */
html { color-scheme: light; }
html[data-theme="dark"] { color-scheme: dark; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.sk-btn:hover, .sk-nav-item, .sk-nav-item:hover, .ad-brand:hover { text-decoration: none; }

/* The shell: the top bar stays in view, and the sidebar sits under it. */
.ad-shell .sk-topbar { position: sticky; top: 0; z-index: 30; }
.ad-shell .sk-side { top: 76px; }
.ad-brand { color: var(--ink); }
.sk-side-bottom form { margin: 0; }

/* Phones: the pages become a row under the top bar, and the theme switch
   stays in the top bar. */
@media (max-width: 760px) {
  .ad-shell .sk-side { display: flex; position: static; height: auto; flex-direction: row; align-items: center; border-right: 0; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
  .ad-shell .sk-side::-webkit-scrollbar { display: none; }
  .ad-shell .sk-profile, .ad-shell .sk-nav-label { display: none; }
  .ad-shell .sk-nav-wrap { display: flex; padding: var(--space-2) 0 var(--space-2) var(--space-4); }
  .ad-shell .sk-nav-group { display: flex; padding: 0; }
  .ad-shell .sk-nav-group + .sk-nav-group { border-top: 0; }
  .ad-shell .sk-nav { flex-direction: row; }
  .ad-shell .sk-nav-item { width: auto; height: 40px; white-space: nowrap; gap: 8px; }
  .ad-shell .sk-side-bottom { margin: 0; padding: var(--space-2) var(--space-4) var(--space-2) 0; }
  .ad-shell .sk-topbar-right .sk-themetoggle { display: inline-flex; }
}

/* Sign-in: one card in the middle of the canvas. */
.ad-login { max-width: 440px; margin: 0 auto; padding: var(--space-16) var(--space-4); display: flex; flex-direction: column; align-items: center; gap: var(--space-6); }
.ad-login .sk-card { width: 100%; }

/* Page layouts. */
.ad-narrow { max-width: 820px; margin: 0 auto; }
.ad-stack { gap: var(--space-6); }
.ad-saved { margin-bottom: var(--space-6); }
.ad-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: var(--space-6); margin-bottom: var(--space-6); }
@media (max-width: 640px) {
  .ad-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-3); }
  .ad-stats .sk-stat-head { padding: var(--space-3) var(--space-4); }
  .ad-stats .sk-stat-head .sk-tile { display: none; }
  .ad-stats .sk-stat-label { font-size: 14.5px; line-height: 20px; white-space: normal; }
  .ad-stats .sk-stat-body { padding: var(--space-4); }
  .ad-stats .sk-stat-value { font-size: 30px; line-height: 36px; }
  .ad-stats .sk-stat-hint { margin: -6px var(--space-4) var(--space-3); font-size: 12.5px; }
}
.ad-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--space-6); align-items: start; margin-bottom: var(--space-6); }
@media (max-width: 1100px) { .ad-cols { grid-template-columns: 1fr; } }

/* Forms: short fields side by side, long ones across the card. */
.ad-fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: var(--space-5) var(--space-4); }
.ad-fields .ad-span { grid-column: 1 / -1; }
.ad-checkrow { display: inline-flex; align-items: center; gap: var(--space-3); font-weight: 500; cursor: pointer; }
.ad-form-foot { display: flex; justify-content: flex-end; }
.ad-subform { padding: var(--space-5) var(--space-6) var(--space-6); border-top: 1px solid var(--line); }
.ad-issue { justify-content: flex-start; }
.ad-issue .sk-input { max-width: 320px; }
.ad-secret-row { flex-wrap: wrap; }
.ad-secret { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-4); border-radius: var(--radius-tile); background: var(--canvas); border: 1px solid var(--line); }
.ad-secret code { flex: 1; min-width: 0; font-family: var(--font-mono); font-size: 13.5px; line-height: 20px; overflow-wrap: anywhere; }

/* Tables: they scroll sideways inside their card on small screens. */
.ad-table-wrap { overflow-x: auto; }
.sk-table th { text-align: left; white-space: nowrap; }
.sk-table .ad-num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.sk-table .sk-date { white-space: nowrap; font-size: 13.5px; }
.ad-strong-link { color: var(--ink); font-weight: 500; }
.ad-sub { display: block; margin-top: 2px; color: var(--ink-muted); font-size: 13px; line-height: 18px; overflow-wrap: anywhere; }
.ad-sub.sk-mono { font-size: 12px; }
.ad-faint { color: var(--ink-faint); }
.ad-break { overflow-wrap: anywhere; }
.ad-plan { margin-right: var(--space-2); }
.ad-detail { color: var(--ink-muted); font-size: 13px; line-height: 18px; min-width: 200px; max-width: 360px; overflow-wrap: anywhere; }
.ad-detail.sk-mono { font-size: 12px; }
tr.ad-empty td { padding: var(--space-6) var(--space-4); color: var(--ink-muted); text-align: center; }
.sk-table tbody tr.ad-empty:hover td { background: transparent; }
.ad-input-sm { height: 36px; font-size: 13.5px; padding: 0 12px; border-radius: var(--radius-md); }
.ad-row-actions { text-align: right; }
.ad-row-actions > form, .ad-row-actions > details { display: inline-block; margin: 0 0 0 var(--space-2); vertical-align: top; }
.ad-row-actions > :first-child { margin-left: 0; }
/* An open confirmation takes the place of the row's other actions. */
.ad-row-actions:has(> details[open]) > form { display: none; }

/* Inline confirmations: the button opens the amber block in its place. */
.ad-confirm > summary { list-style: none; }
.ad-confirm > summary::-webkit-details-marker { display: none; }
.ad-confirm[open] > summary { display: none; }
.ad-confirm .sk-confirm { text-align: left; min-width: 280px; max-width: 460px; }
.sk-card-foot .ad-confirm[open] { flex: 1 1 100%; }
.sk-card-foot .ad-confirm .sk-confirm { max-width: none; }
.ad-confirm form { margin: 0; }

/* A customer's balance: the forms sit above the history, and money in is
   green. */
.ad-subform--first { border-top: 0; }
.ad-subhead { font-size: 15px; font-weight: 500; margin-bottom: var(--space-4); }
.ad-static { height: 42px; display: flex; align-items: center; font-weight: 500; }
.ad-balance .ad-confirm .sk-confirm { max-width: none; }
.ad-remove .ad-fields { grid-template-columns: minmax(0, 200px) minmax(0, 1fr); }
.sk-table td.ad-in { color: var(--success); }
.ad-balance { margin-bottom: var(--space-6); }
.ad-balance .ad-table-wrap { border-top: 1px solid var(--line); }
.ad-subform .sk-notice { margin-bottom: var(--space-4); }
