/* The admin console (/admin). Builds on meet.css's tokens: dense tables, a side nav. */

.a-shell { display: grid; grid-template-columns: 220px minmax(0, 1fr); min-height: 100%; }
.a-side { position: sticky; top: 0; align-self: start; height: 100vh; display: flex; flex-direction: column; padding: 18px 14px; border-right: 1px solid var(--line); background: var(--surface); }
.a-side-brand { display: flex; align-items: center; gap: 10px; padding: 0 6px 16px; }
.a-console-tag { padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.a-nav { display: flex; flex-direction: column; gap: 2px; }
.a-nav a { padding: 9px 12px; border-radius: 9px; color: var(--muted); text-decoration: none; font-weight: 600; }
.a-nav a:hover { background: var(--surface-2); color: var(--fg); }
.a-nav a.current { background: var(--surface-3); color: var(--fg); }
.a-side-foot { margin-top: auto; padding: 12px 6px 0; border-top: 1px solid var(--line); font-size: 14px; }
.a-me { display: flex; flex-direction: column; margin-bottom: 8px; }
.a-main { padding: 28px 32px 64px; min-width: 0; }
.a-page h1 { font-size: 26px; letter-spacing: -0.015em; margin: 0 0 18px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.a-page h2 { font-size: 18px; margin: 24px 0 12px; }
.a-page h3 { font-size: 14px; color: var(--muted); margin: 16px 0 8px; text-transform: uppercase; letter-spacing: 0.05em; }
.a-crumbs { margin: 0 0 6px; color: var(--muted); font-size: 14px; }
.a-crumbs a, .a-main a { color: var(--accent-2); }
.a-title-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.a-title-row h1 { margin-bottom: 10px; }
.a-actions { display: inline-flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.a-loading { padding: 40px; text-align: center; }
.a-empty { padding: 18px 4px; }

/* cards and layout */
.a-card { margin: 0 0 18px; padding: 18px 20px; }
.a-card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 12px; }
.a-card-head h2 { margin: 0; font-size: 17px; }
.a-two { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 18px; }
.a-grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 14px; }
.a-grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 0 14px; }
.a-kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 8px 18px; margin: 0; font-size: 14px; }
.a-kv > div { display: contents; }
.a-kv dt { color: var(--muted); }
.a-kv dd { margin: 0; overflow-wrap: anywhere; }
.a-list { list-style: none; margin: 0; padding: 0; font-size: 14px; }
.a-list li { display: flex; justify-content: space-between; padding: 6px 0; border-top: 1px solid var(--line); }
.a-audit-list { list-style: none; margin: 0; padding: 0; font-size: 14px; }
.a-audit-list li { display: grid; grid-template-columns: 90px minmax(0, 1fr); gap: 12px; padding: 7px 0; border-top: 1px solid var(--line); }
.a-audit-list li:first-child { border-top: 0; }
.a-action { color: var(--accent-2); }

/* stats */
.a-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; margin: 0 0 20px; }
.a-stat { padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.a-stat-value { font-size: 30px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.a-stat-label { font-size: 13px; font-weight: 600; color: var(--muted); }
.a-stat-note { font-size: 12px; margin-top: 2px; }
.a-stat.warn .a-stat-value { color: var(--warn); }
.a-stat.danger .a-stat-value { color: var(--danger); }
.a-stat.ok .a-stat-value { color: var(--ok); }
.a-stat-link { text-decoration: none; color: inherit; }
.a-stat-link:hover .a-stat { border-color: var(--accent); }

/* toolbar and controls */
.a-toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 0 0 14px; }
.a-search { width: min(360px, 100%); padding: 9px 12px; }
.a-select, .a-toolbar select { width: auto; padding: 9px 32px 9px 12px; }
.a-check { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); cursor: pointer; }
.a-check input { width: auto; }
.a-inline-form { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 14px; }
.a-inline-form input, .a-inline-form select { width: auto; flex: 1 1 180px; padding: 9px 12px; }
button.small, a.button.small { width: auto; padding: 7px 12px; font-size: 14px; border-radius: 8px; }
button.secondary.danger { border-color: rgba(239, 68, 68, 0.5); color: #fca5a5; }
button.secondary.danger:hover { background: rgba(239, 68, 68, 0.12); }
button.primary.danger { background: var(--danger-2); }
.a-main .actions { margin-top: 12px; }

/* tables */
.a-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.a-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.a-table th { text-align: left; padding: 10px 12px; color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; border-bottom: 1px solid var(--line); white-space: nowrap; }
.a-table td { padding: 10px 12px; border-top: 1px solid var(--line); vertical-align: top; }
.a-table tr:first-child td { border-top: 0; }
.a-table .right { text-align: right; }
.a-table tr.clickable { cursor: pointer; }
.a-table tr.clickable:hover td { background: var(--surface-2); }
.a-table tr.blocked td { color: var(--muted); }
.a-table code, .a-kv code, .a-audit-list code { font: 500 13px ui-monospace, "Cascadia Mono", Consolas, monospace; }
.a-id { letter-spacing: 0.04em; font-variant-numeric: tabular-nums; }
.a-ua { font-size: 12px; overflow-wrap: anywhere; }
.a-pager { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 14px 0; font-size: 14px; }

/* badges, lights */
.a-badge { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; border: 1px solid transparent; vertical-align: middle; margin: 0 2px; }
.a-badge.ok { background: rgba(34, 197, 94, 0.14); color: #86efac; }
.a-badge.warn { background: rgba(245, 180, 11, 0.14); color: #fcd34d; }
.a-badge.danger { background: rgba(239, 68, 68, 0.14); color: #fca5a5; }
.a-badge.info { background: rgba(79, 140, 255, 0.16); color: #bcd3ff; }
.a-badge.muted { background: var(--surface-3); color: var(--muted); }
.a-lights { list-style: none; margin: 0; padding: 0; font-size: 14px; }
.a-lights li { padding: 7px 0; border-top: 1px solid var(--line); }
.a-lights li:first-child { border-top: 0; }
.a-light { display: inline-flex; align-items: center; gap: 10px; }
.a-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--muted); flex: none; }
.a-dot.ok { background: var(--ok); box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.18); }
.a-dot.danger { background: var(--danger); box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.18); }

/* settings */
.a-setting { padding: 16px 0; border-top: 1px solid var(--line); }
.a-setting:first-child { border-top: 0; padding-top: 0; }
.a-setting-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.a-setting-head h3 { margin: 0; }
.a-setting .field { margin-bottom: 8px; }
.a-payform { border-color: var(--accent); }
.a-payform h2 { margin: 0 0 6px; font-size: 18px; }

/* confirm dialog */
.a-confirm { padding: 22px; }
.a-confirm h2 { margin: 0 0 8px; font-size: 19px; }
.a-confirm .actions .primary, .a-confirm .actions .secondary { width: auto; }

/* toasts */
.a-toasts { position: fixed; right: 16px; bottom: 16px; z-index: 60; display: flex; flex-direction: column; gap: 8px; max-width: min(420px, calc(100vw - 32px)); }
.a-toast { padding: 10px 14px; border-radius: 10px; background: var(--surface-3); border: 1px solid var(--line); font-size: 14px; overflow-wrap: anywhere; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4); }
.a-toast.error { border-color: rgba(239, 68, 68, 0.6); color: #fca5a5; }

@media (max-width: 900px) {
  .a-shell { grid-template-columns: 1fr; }
  .a-side { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .a-nav { flex-direction: row; flex-wrap: wrap; }
  .a-nav a { padding: 7px 10px; font-size: 14px; }
  .a-side-foot { display: flex; gap: 12px; align-items: center; margin-top: 10px; }
  .a-me { flex-direction: row; gap: 8px; margin: 0; }
  .a-main { padding: 20px 16px 48px; }
  .a-table .minor { display: none; }
  .a-stats { grid-template-columns: repeat(2, 1fr); }
}
