:root {
  color-scheme: dark;
  --page: #0e1118;
  --panel: #181d27;
  --soft: #222938;
  --line: #303949;
  --ink: #f6f8fb;
  --muted: #a8b0bd;
  --teal: #1fa8a8;
  --coral: #e56858;
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: var(--page); color: var(--ink); font-family: "Segoe UI", sans-serif; }
button, input { font: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
.admin-shell { width: min(1440px, calc(100% - 28px)); margin: 0 auto; padding: 22px 0 40px; }
.admin-header, .admin-header-actions, .panel-title, .tabs { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.admin-header { margin-bottom: 18px; }
.admin-header p { margin: 0 0 3px; color: var(--teal); font-size: .75rem; font-weight: 800; text-transform: uppercase; }
h1, h2 { margin: 0; }
h1 { font-size: 1.7rem; }
h2 { font-size: 1.05rem; }
button { min-height: 40px; border: 1px solid var(--line); border-radius: 7px; background: var(--soft); color: var(--ink); padding: 0 14px; font-weight: 800; }
button:hover, button.active { border-color: var(--teal); background: rgba(31, 168, 168, .14); }
.site-link { display: inline-flex; align-items: center; min-height: 40px; border: 1px solid var(--line); border-radius: 7px; background: var(--soft); color: var(--ink); padding: 0 14px; font-weight: 800; text-decoration: none; }
.site-link:hover { border-color: var(--teal); background: rgba(31, 168, 168, .14); }
.login-panel { display: grid; place-items: center; min-height: 65vh; }
.login-panel form { display: grid; gap: 14px; width: min(400px, 100%); padding: 22px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
label { display: grid; gap: 7px; color: var(--muted); font-size: .82rem; font-weight: 700; }
input { min-height: 42px; border: 1px solid var(--line); border-radius: 7px; background: #10141c; color: var(--ink); padding: 0 11px; outline: 0; }
input:focus { border-color: var(--teal); }
#loginMessage { min-height: 20px; margin: 0; color: var(--coral); font-size: .84rem; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.stat { padding: 16px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
.stat strong { display: block; font-size: 1.8rem; }
.stat span { display: block; margin-top: 5px; color: var(--muted); font-size: .75rem; font-weight: 700; text-transform: uppercase; }
.tabs { justify-content: flex-start; margin: 16px 0 10px; }
.data-panel { border: 1px solid var(--line); border-radius: 8px; background: var(--panel); overflow: hidden; }
.panel-title { padding: 14px; border-bottom: 1px solid var(--line); }
.panel-title input { width: min(320px, 50vw); }
.table-wrap { overflow: auto; max-height: calc(100vh - 270px); }
table { width: 100%; border-collapse: collapse; font-size: .82rem; }
th, td { padding: 11px 13px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
th { position: sticky; top: 0; background: var(--soft); color: var(--muted); font-size: .72rem; text-transform: uppercase; }
td { color: #dce1ea; }
tr:hover td { background: rgba(255,255,255,.025); }
.log-type { color: var(--teal); font-weight: 800; }
.password-safe { color: #79c98a; font-weight: 800; }
.table-action { min-height: 32px; padding: 0 10px; font-size: .76rem; }
.table-action:disabled { cursor: wait; opacity: .65; }
.account-actions { display: flex; gap: 8px; }
.primary-action, .primary-button { border-color: var(--teal); background: rgba(31, 168, 168, .16); }
.password-dialog { width: min(460px, calc(100% - 30px)); border: 1px solid var(--line); border-radius: 10px; padding: 0; background: var(--panel); color: var(--ink); box-shadow: 0 24px 70px rgba(0,0,0,.5); }
.password-dialog::backdrop { background: rgba(0,0,0,.68); }
.password-dialog form { display: grid; gap: 15px; padding: 22px; }
.dialog-title { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.dialog-title p { margin: 0 0 3px; color: var(--teal); font-size: .72rem; font-weight: 800; text-transform: uppercase; }
.icon-button { display: grid; width: 34px; min-height: 34px; place-items: center; padding: 0; font-size: 1.35rem; line-height: 1; }
.dialog-copy, .dialog-note, .dialog-message { margin: 0; color: var(--muted); font-size: .86rem; }
.dialog-note { line-height: 1.5; }
.dialog-message { min-height: 18px; color: var(--coral); }
.dialog-actions { display: flex; justify-content: flex-end; gap: 9px; }
@media (max-width: 760px) { .admin-header { align-items: stretch; flex-direction: column; } .admin-header-actions { width: 100%; } .site-link { flex: 1; justify-content: center; } .login-panel { min-height: 0; padding-top: 48px; } .stats { grid-template-columns: repeat(2, 1fr); } .panel-title { align-items: stretch; display: grid; } .panel-title input { width: 100%; } }
