/* ============================================================
   Ads.txt Validator: styles
   Change the look in ONE place: the colour variables just below.
   ============================================================ */
:root {
  --bg: #f6f7fb;
  --surface: #ffffff;
  --surface-2: #f1f3f9;
  --border: #e3e6ef;
  --text: #171a26;
  --muted: #697089;
  --brand: #4f46e5;
  --brand-ink: #ffffff;
  --brand-soft: #eceafd;
  --good: #16a34a;
  --good-soft: #dcfce7;
  --warn: #d97706;
  --warn-soft: #fef3c7;
  --bad: #dc2626;
  --bad-soft: #fee2e2;
  --info-soft: #dbeafe;
  --info: #1d4ed8;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.05), 0 4px 14px rgba(16, 24, 40, 0.05);
  --radius: 12px;
  --font: ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
:root[data-theme='dark'] {
  --bg: #0e1018;
  --surface: #161926;
  --surface-2: #1d2133;
  --border: #272c41;
  --text: #e8eaf4;
  --muted: #9097b3;
  --brand: #818cf8;
  --brand-ink: #0e1018;
  --brand-soft: #232650;
  --good: #4ade80;
  --good-soft: #12351f;
  --warn: #fbbf24;
  --warn-soft: #3b2f0f;
  --bad: #f87171;
  --bad-soft: #3d1a1a;
  --info-soft: #172a4d;
  --info: #93c5fd;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--text); font: 14px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
[hidden] { display: none !important; }
h1, h2, h3 { margin: 0; line-height: 1.25; }
h1 { font-size: 22px; letter-spacing: -0.01em; }
h2 { font-size: 16px; }
h3 { font-size: 15px; }
p { margin: 0; }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); font-size: 12.5px; }
a { color: var(--brand); }
.icon { display: inline-flex; vertical-align: middle; flex: none; }
.link { background: none; border: 0; color: var(--brand); cursor: pointer; padding: 0; font: inherit; font-weight: 600; }

/* ---------- login ---------- */
.login-wrap { min-height: 100%; display: grid; place-items: center; padding: 24px; background: radial-gradient(1200px 500px at 50% -10%, var(--brand-soft), transparent 70%), var(--bg); }
.login-card { width: 100%; max-width: 400px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 32px; box-shadow: var(--shadow); }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 16px; }
.logo-mark { width: 34px; height: 34px; border-radius: 10px; background: var(--brand); color: var(--brand-ink); display: grid; place-items: center; font-weight: 800; font-size: 13px; }
.login-card h1 { margin: 22px 0 4px; }
.login-card form { display: grid; gap: 14px; margin-top: 22px; }
.login-note { margin-top: 18px; font-size: 12.5px; }

/* ---------- layout ---------- */
.app { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.side { background: var(--surface); border-right: 1px solid var(--border); padding: 18px 14px; display: flex; flex-direction: column; gap: 18px; position: sticky; top: 0; height: 100vh; }
.nav { display: grid; gap: 2px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 9px; color: var(--muted); text-decoration: none; font-weight: 600; }
.nav a:hover { background: var(--surface-2); color: var(--text); }
.nav a.on { background: var(--brand-soft); color: var(--brand); }
.nav .sep { font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); padding: 14px 12px 4px; }
.side-foot { margin-top: auto; display: grid; gap: 10px; }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 10px; border: 1px solid var(--border); border-radius: 10px; }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; font-weight: 700; font-size: 12px; flex: none; }
.user-chip b { display: block; line-height: 1.2; }
.user-chip small { color: var(--muted); }
.side-actions { display: flex; gap: 8px; }
.side-actions .btn { flex: 1; justify-content: center; }
.main { padding: 28px 32px 64px; max-width: 1280px; width: 100%; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head p { color: var(--muted); margin-top: 4px; }
.sync { font-size: 12px; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.sync.on .icon { animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.mobile-bar { display: none; }
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .side { position: fixed; z-index: 30; left: 0; top: 0; width: 250px; transform: translateX(-100%); transition: transform 0.2s; }
  .side.open { transform: none; box-shadow: var(--shadow); }
  .mobile-bar { display: flex; align-items: center; gap: 10px; padding: 12px 16px; background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 20; }
  .main { padding: 18px 16px 56px; }
}

/* ---------- cards & forms ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.card + .card, .card + .stack, .stack + .card { margin-top: 16px; }
.card-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.stack { display: grid; gap: 16px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 760px) { .grid2, .grid3 { grid-template-columns: 1fr; } }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.field { display: grid; gap: 6px; }
.field > label, .label { font-weight: 600; font-size: 13px; }
.hint { font-size: 12px; color: var(--muted); }
input[type='text'], input[type='password'], input[type='search'], select, textarea, .ms-field {
  width: 100%; background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 9px; padding: 9px 12px; font: inherit; outline: none; transition: border-color 0.15s, box-shadow 0.15s;
}
input:focus, select:focus, textarea:focus, .ms.open .ms-field { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
textarea { resize: vertical; min-height: 120px; font-family: var(--mono); font-size: 12.5px; line-height: 1.55; }
input:disabled, textarea:disabled, select:disabled { background: var(--surface-2); color: var(--muted); cursor: not-allowed; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; }
.check input { width: 16px; height: 16px; accent-color: var(--brand); }

.btn { display: inline-flex; align-items: center; gap: 7px; padding: 8px 14px; border-radius: 9px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; font-weight: 600; cursor: pointer; white-space: nowrap; }
.btn:hover:not(:disabled) { background: var(--surface-2); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn.primary { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.btn.primary:hover:not(:disabled) { filter: brightness(1.08); background: var(--brand); }
.btn.danger { color: var(--bad); }
.btn.danger:hover:not(:disabled) { background: var(--bad-soft); }
.btn.ghost { border-color: transparent; background: transparent; color: var(--muted); }
.btn.sm { padding: 5px 10px; font-size: 12.5px; }
.icon-btn { background: none; border: 0; color: var(--muted); cursor: pointer; padding: 6px; border-radius: 8px; display: inline-flex; }
.icon-btn:hover { background: var(--surface-2); color: var(--text); }

.seg { display: inline-flex; background: var(--surface-2); border-radius: 10px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: none; padding: 7px 18px; border-radius: 8px; font: inherit; font-weight: 600; color: var(--muted); cursor: pointer; }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }

.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.badge.good { background: var(--good-soft); color: var(--good); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.bad { background: var(--bad-soft); color: var(--bad); }
.badge.info { background: var(--info-soft); color: var(--info); }
.badge.brand { background: var(--brand-soft); color: var(--brand); }

.notice { display: flex; gap: 10px; padding: 11px 14px; border-radius: 10px; background: var(--info-soft); color: var(--info); font-size: 13px; align-items: flex-start; }
.notice.warn { background: var(--warn-soft); color: var(--warn); }
.notice.bad { background: var(--bad-soft); color: var(--bad); }
.notice.good { background: var(--good-soft); color: var(--good); }
.notice > div { color: var(--text); }
.notice b { color: inherit; }

/* ---------- multi select ---------- */
.ms { position: relative; }
.ms-field { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 6px 8px; min-height: 42px; cursor: text; max-height: 168px; overflow: auto; }
.ms-input { flex: 1; min-width: 140px; border: 0 !important; box-shadow: none !important; background: transparent !important; padding: 4px !important; width: auto !important; }
.chip { display: inline-flex; align-items: center; gap: 4px; background: var(--brand-soft); color: var(--brand); padding: 3px 4px 3px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 600; }
.chip.new { background: var(--warn-soft); color: var(--warn); }
.chip.more { padding-right: 10px; background: var(--surface-2); color: var(--muted); }
.chip-x { border: 0; background: none; color: inherit; cursor: pointer; display: inline-flex; padding: 2px; border-radius: 50%; opacity: 0.7; }
.chip-x:hover { opacity: 1; background: rgba(0, 0, 0, 0.08); }
.ms-menu { position: absolute; z-index: 40; left: 0; right: 0; top: calc(100% + 6px); background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 12px 32px rgba(16, 24, 40, 0.18); max-height: 300px; overflow: auto; padding: 4px; }
.ms-item { display: flex; justify-content: space-between; gap: 12px; padding: 8px 10px; border-radius: 7px; cursor: pointer; }
.ms-item.active { background: var(--brand-soft); }
.ms-custom { font-weight: 700; color: var(--brand); }
.ms-hint { color: var(--muted); font-size: 12px; }
.ms-empty { padding: 10px; font-size: 13px; }
.ms-actions { display: flex; justify-content: space-between; padding: 8px 10px 4px; border-top: 1px solid var(--border); margin-top: 4px; position: sticky; bottom: -4px; background: var(--surface); }
.quick { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; align-items: center; }
.pill { border: 1px solid var(--border); background: var(--surface); color: var(--muted); padding: 3px 11px; border-radius: 999px; font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.pill:hover { border-color: var(--brand); color: var(--brand); }
.pill.on { background: var(--brand-soft); color: var(--brand); border-color: transparent; }

/* ---------- KPIs ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; }
.kpi small { color: var(--muted); font-weight: 600; }
.kpi b { display: block; font-size: 24px; letter-spacing: -0.02em; margin-top: 2px; }
.kpi b.good { color: var(--good); } .kpi b.warn { color: var(--warn); } .kpi b.bad { color: var(--bad); }

/* ---------- progress ---------- */
.progress { height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.progress > i { display: block; height: 100%; background: var(--brand); border-radius: 99px; transition: width 0.2s; }

/* ---------- tables ---------- */
.table-wrap { overflow: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--border); white-space: nowrap; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); background: var(--surface-2); position: sticky; top: 0; user-select: none; }
th.sortable { cursor: pointer; }
th.sortable:hover { color: var(--text); }
tbody tr:last-child td { border-bottom: 0; }
tbody tr.hover:hover { background: var(--surface-2); cursor: pointer; }
td.wrap { white-space: normal; min-width: 220px; }
tr.detail > td { background: var(--surface-2); white-space: normal; padding: 14px 18px; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.cov { display: flex; align-items: center; gap: 10px; min-width: 130px; }
.bar { flex: 1; height: 7px; border-radius: 99px; background: var(--surface-2); overflow: hidden; min-width: 60px; }
.bar > i { display: block; height: 100%; border-radius: 99px; }
.bar > i.good { background: var(--good); } .bar > i.warn { background: var(--warn); } .bar > i.bad { background: var(--bad); }
.cov-n { font-weight: 700; font-variant-numeric: tabular-nums; width: 52px; text-align: right; }
.cov-n.good { color: var(--good); } .cov-n.warn { color: var(--warn); } .cov-n.bad { color: var(--bad); }
.codebox { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: 9px; padding: 10px 12px; font-family: var(--mono); font-size: 12.5px; white-space: pre-wrap; word-break: break-all; max-height: 240px; overflow: auto; }
.detail-grid { display: grid; gap: 12px; }
.detail-grid h4 { margin: 0 0 6px; font-size: 12.5px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.toolbar .grow { flex: 1; min-width: 200px; }
.toolbar select { width: auto; }
.empty { text-align: center; padding: 40px 16px; color: var(--muted); }
.empty .icon { opacity: 0.5; margin-bottom: 6px; }

details.dcard { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
details.dcard + details.dcard { margin-top: 10px; }
details.dcard > summary { list-style: none; cursor: pointer; padding: 14px 16px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
details.dcard > summary::-webkit-details-marker { display: none; }
details.dcard[open] > summary { border-bottom: 1px solid var(--border); }
details.dcard .dbody { padding: 6px 16px 14px; }
.prow { display: grid; grid-template-columns: minmax(140px, 1.2fr) minmax(160px, 1fr) 90px 90px; gap: 12px; align-items: center; padding: 8px 0; border-bottom: 1px dashed var(--border); }
.prow:last-child { border-bottom: 0; }

.change { padding: 10px 0; border-bottom: 1px dashed var(--border); }
.change:last-child { border-bottom: 0; }
.change .codebox { margin-top: 6px; max-height: 140px; }

/* ---------- modal & toasts ---------- */
.overlay { position: fixed; inset: 0; background: rgba(10, 12, 24, 0.55); z-index: 100; display: grid; place-items: center; padding: 20px; animation: fade 0.15s; }
.modal { background: var(--surface); border-radius: 16px; width: 100%; max-width: 480px; max-height: calc(100vh - 40px); display: flex; flex-direction: column; box-shadow: 0 24px 64px rgba(0, 0, 0, 0.35); animation: pop 0.15s; }
.modal.wide { max-width: 860px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.modal-body { padding: 20px; overflow: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--border); }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { transform: translateY(8px) scale(0.98); opacity: 0; } }
#toasts { position: fixed; right: 18px; bottom: 18px; display: grid; gap: 8px; z-index: 200; }
.toast { display: flex; align-items: center; gap: 10px; background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 10px; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3); max-width: 380px; animation: pop 0.2s; }
.toast.success .icon { color: #4ade80; }
.toast.error .icon { color: #f87171; }
.toast.out { opacity: 0; transition: opacity 0.25s; }

.skeleton { background: linear-gradient(90deg, var(--surface-2), var(--border), var(--surface-2)); background-size: 200% 100%; animation: sh 1.2s infinite; border-radius: 8px; height: 14px; }
@keyframes sh { to { background-position: -200% 0; } }
