/* Page-specific styles for admin core pages (overview, tenants, tenant detail, plans, review, configuration). Shared tokens live in styles.css. */

/* Setup checklist (overview) */
.setup-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.setup-step { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-top: 1px solid var(--border); flex-wrap: wrap; }
.setup-step:first-child { border-top: 0; padding-top: 0; }
.setup-step .setup-num { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); color: var(--fg-muted); font-weight: 700; font-size: 13px; flex: none; }
.setup-step.done .setup-num { background: var(--good-soft); color: var(--good); }
.setup-step > .btn { margin-left: auto; }
@media (max-width: 560px) { .setup-step > .btn { margin-left: 42px; } }

/* Tenant header */
.tenant-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.tenant-head .tid { font-family: var(--font-display); font-size: 22px; font-weight: 700; letter-spacing: -0.01em; }
.tenant-head .facts { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12.5px; color: var(--fg-muted); width: 100%; }
.tenant-head .facts code { font-size: 12px; }
.action-bar { display: flex; flex-wrap: wrap; gap: 8px; }

/* Entitlement editor */
.ent-table td:first-child { min-width: 180px; }
.ent-group th { background: var(--surface-2); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--fg-muted); padding: 6px 14px; }
.ent-dep { font-size: 11.5px; color: var(--fg-subtle); }
.ent-num { width: 92px; height: 32px; padding: 0 8px; border: 1px solid var(--border-strong); border-radius: 7px; background: var(--surface); color: var(--fg); font: inherit; font-variant-numeric: tabular-nums; }
.ent-num:disabled { opacity: .5; }

/* Plans and flags */
.plan-cards { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.plan-card { display: flex; flex-direction: column; gap: 10px; padding: 16px; border-radius: var(--radius-lg); border: 1px solid var(--border); background: var(--surface); min-width: 0; }
.plan-card .price { font-family: var(--font-display); font-size: 28px; font-weight: 700; letter-spacing: -0.02em; }
.plan-card .price small { font-size: 13px; font-weight: 500; color: var(--fg-subtle); margin-left: 4px; }
.plan-card ul { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; color: var(--fg-muted); }
.plan-card li { display: flex; align-items: center; gap: 6px; }
.plan-card li svg { color: var(--good); flex: none; }
.plan-card li.off { color: var(--fg-subtle); }
.plan-card li.off svg { color: var(--fg-subtle); }
.plan-card .plan-actions { margin-top: auto; display: flex; flex-wrap: wrap; gap: 6px; }

.flag-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding: 12px 18px; border-top: 1px solid var(--border); }
.flag-row:first-child { border-top: 0; }
.flag-row .flag-main { flex: 1 1 260px; min-width: 0; }
.flag-row input[type="range"] { width: 140px; accent-color: var(--accent); }
.flag-row select.input { width: auto; }

/* Forms shared by settings pages */
.save-bar { padding-top: 10px; border-top: 1px solid var(--border); margin-top: 4px; }
.secret-input { display: flex; align-items: center; gap: 8px; }
.secret-input .input { flex: 1; min-width: 0; }
.secret-input .pill { flex: none; }
.verify-result { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.copy-field { display: flex; align-items: center; gap: 6px; padding: 6px 6px 6px 10px; border-radius: 8px; background: var(--surface-2); min-width: 0; }
.copy-field code { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.app-admin .field .label-text { font-size: 13px; font-weight: 600; }
.app-admin select.input { width: 100%; }
.app-admin .row > select.input { width: auto; max-width: 100%; }

/* Danger zone */
.danger-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 10px 0; border-top: 1px solid var(--border); }
.danger-row:first-child { border-top: 0; padding-top: 0; }
.danger-row > .btn { margin-left: auto; }

/* Logs */
.log-view { margin: 0; font-family: var(--font-mono); font-size: 12px; line-height: 1.5; padding: 12px 14px; background: var(--surface-2); border-radius: 0 0 var(--radius-lg) var(--radius-lg); overflow: auto; max-height: 480px; white-space: pre-wrap; overflow-wrap: anywhere; }
.log-line { display: block; }
.log-line .ts { color: var(--fg-subtle); }
.log-line.lvl-warn, .log-line .lvl-warn { color: var(--warn); }
.log-line.lvl-error, .log-line .lvl-error { color: var(--crit); }

/* Phone breakpoints in styles.css collapse grids to `1fr` (minmax(auto,1fr)); nowrap content inside
   (truncated text, tables, code blocks) would otherwise widen the track. Scoped to the admin app. */
.app-admin .grid > * { min-width: 0; }
.app-admin .stats > * { min-width: 0; }
.app-admin .nowrap { white-space: nowrap; }
.app-admin .meter-row { grid-template-columns: minmax(130px, 1.4fr) 3fr auto; }
.app-admin .table .meter-row { grid-template-columns: 0 minmax(60px, 1fr) auto; min-width: 140px; }
.app-admin .page-header .actions { flex-wrap: wrap; }
.app-admin .segmented { flex-wrap: wrap; }
