/* Login + admin screens. Builds on the tokens in style.css. */

.page-center { min-height: 100vh; display: grid; place-items: center; align-content: center; padding: 24px 16px; }
.auth-card {
  width: 100%; max-width: 400px; background: var(--panel); border: 1px solid var(--line);
  border-radius: 14px; box-shadow: var(--shadow); padding: 26px 24px;
}
.auth-card .brand { min-width: 0; margin-bottom: 18px; }
.auth-card h2 { font-size: 15px; margin: 0 0 10px; }
.field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
.field label, .label { font-size: 12px; font-weight: 600; color: var(--muted); }
.hint { font-size: 12px; color: var(--muted); margin: 4px 0 0; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.btn-primary:hover { filter: brightness(1.08); }
.btn-danger { color: var(--bad); }
.btn-danger:hover { border-color: var(--bad); }
.btn-sm { padding: 4px 9px; font-size: 12px; }
.btn[disabled] { opacity: .55; cursor: default; }
.w-full { width: 100%; }
.msg { border-radius: 8px; padding: 9px 11px; font-size: 13px; margin-bottom: 14px; }
.msg-bad { background: #fee2e2; color: #991b1b; }
.msg-info { background: var(--accent-soft); color: var(--accent); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .msg-bad { background: #3b1111; color: #fca5a5; }
}
.divider { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; margin: 20px 0 14px; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.foot { margin-top: 16px; font-size: 12px; color: var(--muted); text-align: center; }
.mono { font-family: var(--mono); font-size: 12px; }

/* ---------- admin ---------- */
.admin-top { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding: 12px 20px; background: var(--panel); border-bottom: 1px solid var(--line); }
.admin-top .brand { min-width: 0; }
.admin-top .spacer { flex: 1; }
.admin-tabs { display: flex; gap: 2px; padding: 0 20px; background: var(--panel); border-bottom: 1px solid var(--line); overflow-x: auto; }
.admin-tabs .tab { flex: 0 0 auto; padding: 11px 14px; }
.admin-main { padding: 18px 20px 40px; max-width: 1400px; margin: 0 auto; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; margin-bottom: 16px; }
.panel-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.panel-head h2 { font-size: 15px; }
.panel-head .spacer { flex: 1; }
.panel-head .input { width: auto; min-width: 220px; }
.table-scroll { overflow-x: auto; }
.atable { width: 100%; border-collapse: collapse; font-size: 13px; }
.atable th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); padding: 7px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.atable td { padding: 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.atable tr:last-child td { border-bottom: 0; }
.atable select.input { padding: 4px 6px; min-width: 170px; }
.actions { display: flex; gap: 4px; flex-wrap: wrap; }
.pill { display: inline-block; font-size: 11px; padding: 1px 7px; border-radius: 999px; background: var(--panel-2); border: 1px solid var(--line); margin: 1px 2px 1px 0; white-space: nowrap; }
.pill-good { background: #d1fae5; color: #065f46; border-color: transparent; }
.pill-bad { background: #fee2e2; color: #991b1b; border-color: transparent; }
.pill-warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.swatch { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: -2px; margin-right: 6px; }
.muted { color: var(--muted); }

.grid-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 14px; }
.grid-form .span2 { grid-column: 1 / -1; }
.checks { display: flex; flex-wrap: wrap; gap: 6px 14px; padding: 6px 0; }
.checks label { display: flex; align-items: center; gap: 5px; font-size: 13px; font-weight: 400; color: var(--text); }
textarea.input { resize: vertical; min-height: 60px; font-family: var(--mono); font-size: 12px; }

dialog.modal {
  width: min(640px, calc(100vw - 32px)); border: 1px solid var(--line); border-radius: 14px; padding: 0;
  background: var(--panel); color: var(--text); box-shadow: 0 20px 60px rgba(0,0,0,.35);
}
dialog.modal::backdrop { background: rgba(15, 23, 42, .45); }
.modal-head { display: flex; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.modal-head h3 { margin: 0; font-size: 15px; flex: 1; }
.modal-body { padding: 16px 18px 4px; max-height: 70vh; overflow: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--line); }

.settings-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 0 18px; }
.toast {
  position: fixed; right: 16px; bottom: 16px; z-index: 2000; background: var(--text); color: var(--bg);
  padding: 10px 14px; border-radius: 8px; box-shadow: var(--shadow); font-size: 13px; max-width: 360px;
}

@media (max-width: 640px) {
  .grid-form { grid-template-columns: 1fr; }
  .admin-main { padding: 14px 16px 30px; }
  .panel-head .input { min-width: 0; width: 100%; }
}
