:root {
  --bg: #fafaf7;
  --card: #ffffff;
  --card-2: #f4f2ec;
  --text: #1a1a1a;
  --text-secondary: #666663;
  --text-muted: #98978f;
  --border: rgba(0,0,0,0.10);
  --border-strong: rgba(0,0,0,0.22);
  --accent: #185fa5;
  --accent-bg: #e6f1fb;
  --accent-bg-muted: #f2f7fc;
  --danger: #a32d2d;
  --danger-bg: #fcebeb;
  --warning: #854f0b;
  --warning-bg: #faeeda;
  --radius: 8px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1013;
    --card: #191a1e;
    --card-2: #23252b;
    --text: #eaeaea;
    --text-secondary: #a4a4a1;
    --text-muted: #6b6b68;
    --border: rgba(255,255,255,0.10);
    --border-strong: rgba(255,255,255,0.22);
    --accent: #6ea6e0;
    --accent-bg: #1b2b3e;
    --accent-bg-muted: #182029;
    --danger: #f09595;
    --danger-bg: #3a1c1c;
    --warning: #ecb87a;
    --warning-bg: #3a2d15;
  }
}
* { box-sizing: border-box; }
html, body { margin:0; padding:0; background:var(--bg); color:var(--text);
  font: 400 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  min-height:100vh; overflow-x:hidden; max-width:100%; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 22px; font-weight: 500; margin: 0 0 8px; }
h2 { font-size: 18px; font-weight: 500; margin: 0 0 8px; }
h3 { font-size: 16px; font-weight: 500; margin: 0 0 8px; }
input, select, button { font: inherit; }
input[type=text], input[type=email], input[type=password] {
  border: 0.5px solid var(--border-strong); border-radius: var(--radius);
  padding: 8px 12px; width: 100%; background: var(--card);
  color: var(--text); height: 36px;
}
input:focus, select:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
button, .btn {
  border: 0.5px solid var(--border-strong); border-radius: var(--radius);
  padding: 6px 12px; background: transparent; color: var(--text);
  cursor: pointer; height: 34px; font-size: 14px; display:inline-flex; align-items:center; gap:6px;
}
button:hover, .btn:hover { background: var(--card-2); }
button:disabled, .btn:disabled { opacity: 0.5; cursor: not-allowed; }
button.primary { border-color: var(--accent); color: white; background: var(--accent); }
button.primary:hover { background: var(--accent); filter: brightness(1.1); }
.container { max-width: 960px; margin: 0 auto; padding: 20px 24px; }
.card { background: var(--card); border: 0.5px solid var(--border); border-radius: 12px; padding: 20px 24px; margin: 0 0 16px; }
.card-2 { background: var(--card-2); border-radius: var(--radius); padding: 12px 14px; }
.muted { color: var(--text-secondary); font-size: 13px; }
.tabular { font-variant-numeric: tabular-nums; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.header { display:flex; justify-content:space-between; align-items:center; margin: 0 0 20px; padding: 12px 24px 0; }
.header .brand { font-weight: 500; display:flex; align-items:center; gap:8px; }
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin: 0 0 16px; }
.stat { background: var(--card-2); border-radius: var(--radius); padding: 12px; }
.stat .label { font-size: 12px; color: var(--text-secondary); }
.stat .value { font-size: 22px; font-weight: 500; font-variant-numeric: tabular-nums; }
.tbl { width: 100%; border-collapse: collapse; border: 0.5px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.tbl th, .tbl td { padding: 10px 14px; font-size: 13px; text-align: left; border-bottom: 0.5px solid var(--border); }
.tbl th { background: var(--card-2); font-weight: 400; color: var(--text-secondary); font-size: 12px; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr:hover td { background: var(--card-2); }
.tbl .num, .tbl .actions { text-align: right; white-space: nowrap; }
.badge { background: var(--accent-bg); color: var(--accent); font-size: 11px; padding: 2px 8px; border-radius: 8px; margin-right: 6px; }
.error { background: var(--danger-bg); color: var(--danger); padding: 10px 12px; border-radius: var(--radius); margin: 0 0 12px; font-size: 13px; }
.info { background: var(--accent-bg-muted); color: var(--text-secondary); padding: 10px 12px; border-radius: var(--radius); margin: 12px 0; font-size: 13px; }
.warning { background: var(--warning-bg); color: var(--warning); padding: 10px 12px; border-radius: var(--radius); margin: 0 0 12px; font-size: 13px; }
.mono { font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace; font-size: 12px; }
.row { display:flex; gap:8px; align-items:center; }
.row.tight { gap:4px; }
.right { margin-left:auto; }
.checkbox { width:16px; height:16px; margin:0; }
.selected-row { background: var(--accent-bg-muted); }
.selection-bar { position: sticky; bottom:0; background:var(--card); border-top: 0.5px solid var(--border-strong);
  padding: 10px 14px; display:flex; justify-content:space-between; align-items:center;
  margin: 0 -24px -20px; border-radius: 0 0 12px 12px; }

/* Login-Panel */
.login-wrap { min-height: 70vh; display:flex; align-items:center; justify-content:center; }
.login-card { width: 340px; background: var(--card); border: 0.5px solid var(--border); border-radius: 12px; padding: 24px; }

/* Modal */
.modal-back { background: rgba(0,0,0,0.45); position: absolute; inset:0; display:flex; align-items:center; justify-content:center; }
.modal { background:var(--card); border-radius:12px; padding:24px; width:440px; max-width:calc(100% - 32px); }
.modal-actions { display:flex; gap:8px; justify-content:flex-end; margin-top:20px; }
