/* Konsol Admin (/admin, Phase 10) — memakai token warna dari chat.css; tanpa gaya inline (CSP style-src 'self'). */
.ad { max-width: 1180px; margin: 0 auto; padding: 16px; }
.ad [hidden] { display: none !important; }
.ad-denied, .ad-error { padding: 12px 14px; border-radius: 10px; margin: 12px 0; }
.ad-denied { background: var(--sc-notice); border: 1px solid var(--sc-notice-line); }
.ad-error { background: var(--sc-error); border: 1px solid var(--sc-error-line); }
.ad-status { min-height: 20px; font-size: 13px; color: var(--sc-ink-soft); margin: 6px 0; }

/* Tab */
.ad-tabs { display: flex; gap: 4px; overflow-x: auto; border-bottom: 1px solid var(--sc-line); padding-bottom: 0;
  scrollbar-width: thin; }
.ad-tabs button { font: inherit; font-size: 14px; white-space: nowrap; padding: 10px 14px; border: 0;
  border-bottom: 3px solid transparent; background: transparent; color: var(--sc-ink-soft); cursor: pointer; }
.ad-tabs button:hover { color: var(--sc-ink); }
.ad-tabs button[aria-selected="true"] { color: var(--sc-accent); border-bottom-color: var(--sc-accent); font-weight: 600; }
.ad-tabs button:focus-visible { outline: 2px solid var(--sc-accent); outline-offset: -2px; }

/* Kartu & tata letak */
.ad-panel { padding-top: 8px; }
.ad-card { background: var(--sc-bg); border: 1px solid var(--sc-line); border-radius: var(--sc-radius);
  padding: 14px 16px; margin: 12px 0; }
.ad-card h2 { font-size: 16px; margin: 0 0 10px; }
.ad-card h3 { font-size: 14px; margin: 14px 0 6px; color: var(--sc-ink-soft); }
.ad-grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.ad-grid2 > .ad-card { margin: 0; }
@media (max-width: 860px) { .ad-grid2 { grid-template-columns: minmax(0, 1fr); } }
.ad-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 8px 0; }
.ad-muted { color: var(--sc-ink-soft); font-size: 13px; }
.ad-note { font-size: 13px; color: var(--sc-ink-soft); margin: 6px 0 0; }

/* Angka ringkas */
.ad-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; margin: 12px 0; }
.ad-tile { background: var(--sc-bg); border: 1px solid var(--sc-line); border-radius: var(--sc-radius); padding: 12px 14px; }
.ad-tile b { display: block; font-size: 24px; font-weight: 700; line-height: 1.2; font-variant-numeric: tabular-nums; }
.ad-tile span { display: block; font-size: 13px; color: var(--sc-ink-soft); margin-top: 2px; }
.ad-tile small { display: block; font-size: 12px; color: var(--sc-ink-soft); margin-top: 4px; }

/* Grafik batang harian (tinggi diatur lewat CSSOM, bukan atribut style) */
.ad-chart { display: flex; align-items: flex-end; gap: 3px; height: 140px; padding: 8px 0 0;
  border-bottom: 1px solid var(--sc-line); }
.ad-col { flex: 1 1 0; min-width: 4px; display: flex; flex-direction: column; justify-content: flex-end; height: 100%; }
.ad-col i { display: block; background: var(--sc-accent); border-radius: 3px 3px 0 0; min-height: 1px; }
.ad-col.ad-zero i { background: var(--sc-line); }
.ad-axis { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--sc-ink-soft); margin-top: 4px; }

/* Tabel */
.ad-scroll { overflow-x: auto; }
.ad-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.ad-table th, .ad-table td { text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--sc-line); vertical-align: top; }
.ad-table th { font-size: 12px; color: var(--sc-ink-soft); font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
.ad-table td.ad-n, .ad-table th.ad-n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ad-table tr.ad-sel td { background: var(--sc-user); }
.ad-empty { color: var(--sc-ink-soft); font-size: 13.5px; padding: 8px 0; }
.ad-code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; overflow-wrap: anywhere; }

/* Label kecil */
.ad-chip { display: inline-block; font-size: 12px; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--sc-line);
  background: var(--sc-bg-soft); margin: 1px 4px 1px 0; white-space: nowrap; }
.ad-chip.ad-ok { border-color: #8cc9a0; background: #e8f6ed; color: #1c6b36; }
.ad-chip.ad-bad { border-color: var(--sc-error-line); background: var(--sc-error); color: #a12a2a; }
.ad-chip.ad-warn { border-color: var(--sc-notice-line); background: var(--sc-notice); }
.ad-chip button { border: 0; background: transparent; color: inherit; cursor: pointer; padding: 0 0 0 4px; font: inherit; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .ad-chip.ad-ok { background: #183526; color: #7fd69a; border-color: #2c6b45; }
  :root:not([data-theme="light"]) .ad-chip.ad-bad { color: #f19a9a; }
}
:root[data-theme="dark"] .ad-chip.ad-ok { background: #183526; color: #7fd69a; border-color: #2c6b45; }
:root[data-theme="dark"] .ad-chip.ad-bad { color: #f19a9a; }

/* Formulir */
.ad-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 14px; }
.ad-form .ad-wide { grid-column: 1 / -1; }
@media (max-width: 700px) { .ad-form { grid-template-columns: minmax(0, 1fr); } }
.ad-field { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--sc-ink-soft); min-width: 0; }
.ad-field input[type="text"], .ad-field input[type="number"], .ad-field input[type="search"], .ad-field select,
.ad-field textarea, .ad-input { font: inherit; font-size: 14px; color: var(--sc-ink); background: var(--sc-bg);
  border: 1px solid var(--sc-line); border-radius: 8px; padding: 8px 10px; min-width: 0; width: 100%; box-sizing: border-box; }
.ad-field textarea { min-height: 72px; resize: vertical; }
.ad-check { display: flex; gap: 8px; align-items: center; font-size: 14px; color: var(--sc-ink); }
.ad-check input { width: 18px; height: 18px; accent-color: var(--sc-accent); }
.ad-btn { font: inherit; font-size: 14px; padding: 8px 12px; min-height: 38px; border-radius: 8px;
  border: 1px solid var(--sc-line); background: var(--sc-bg); color: var(--sc-ink); cursor: pointer; }
.ad-btn:hover { border-color: var(--sc-accent); }
.ad-btn:disabled { opacity: .6; cursor: wait; }
.ad-btn.ad-primary { background: var(--sc-accent); border-color: var(--sc-accent); color: var(--sc-accent-ink); }
.ad-btn.ad-danger { color: #a12a2a; }
.ad-btn.ad-small { min-height: 30px; padding: 4px 9px; font-size: 13px; }
.ad-secret { padding: 12px; border: 2px solid var(--sc-accent); border-radius: 10px; background: var(--sc-user); margin: 10px 0; }
.ad-secret code { display: block; margin: 6px 0; font-size: 14px; overflow-wrap: anywhere; user-select: all; }

/* Umpan balik */
.ad-fb { border: 1px solid var(--sc-line); border-radius: 10px; padding: 10px 12px; margin: 8px 0; background: var(--sc-bg); }
.ad-fb-q { font-weight: 600; margin: 6px 0; overflow-wrap: anywhere; }
.ad-fb-a { white-space: pre-wrap; font-size: 13.5px; color: var(--sc-ink); overflow-wrap: anywhere;
  border-left: 3px solid var(--sc-line); padding-left: 10px; margin: 6px 0; }
.ad-profile-desc { font-size: 13px; background: var(--sc-bg-soft); border: 1px solid var(--sc-line); border-radius: 8px;
  padding: 8px 10px; }
.ad-snippet { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; white-space: pre-wrap;
  overflow-wrap: anywhere; background: var(--sc-bg-soft); border: 1px solid var(--sc-line); border-radius: 8px; padding: 10px; }
.ad-bar > .ad-field { flex: 0 1 220px; }
