:root {
  --navy: #173328;
  --navy-2: #1f4636;
  --ink: #1b1b1b;
  --muted: #66756d;
  --gold: #2f8a45;
  --gold-2: #4caf63;
  --cream: #eef3ee;
  --paper: #fff;
  --line: #d5e0d8;
  --ok: #2c6a4e;
  --ok-bg: #e7f4ec;
  --err: #9b3226;
  --err-bg: #fbeceb;
  --shadow: 0 18px 40px rgba(23, 51, 40, 0.12);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: Assistant, "Segoe UI", Tahoma, sans-serif;
  background: var(--cream);
  color: var(--ink);
}

.app-shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 260px;
  background: linear-gradient(180deg, var(--navy) 0%, #0f241c 100%);
  color: #eef6f0;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 20;
}
.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 22px 18px 18px;
  border-bottom: 1px solid rgba(76, 175, 99, 0.18);
}
.brand-mark {
  width: 42px; height: 42px; border-radius: 12px;
  background: linear-gradient(135deg, var(--gold), #8ed49e);
  color: #0f241c;
  display: grid; place-items: center;
  font-weight: 800; font-size: 22px;
}
.brand strong { display: block; font-size: 16px; line-height: 1.2; }
.brand span { display: block; font-size: 12px; opacity: 0.7; margin-top: 2px; }
.sidebar nav { padding: 12px 10px; display: grid; gap: 4px; overflow: auto; }
.sidebar nav a {
  color: #dceee2;
  text-decoration: none;
  padding: 10px 12px;
  border-radius: 10px;
  font-weight: 600;
}
.sidebar nav a:hover { background: rgba(255,255,255,0.06); }
.sidebar nav a.active {
  background: rgba(47, 138, 69, 0.28);
  color: #fff;
  box-shadow: inset 3px 0 0 var(--gold-2);
}
.sidebar-foot {
  margin-top: auto;
  padding: 16px 18px 20px;
  display: flex;
  justify-content: space-between;
  border-top: 1px solid rgba(76, 175, 99, 0.18);
  font-size: 13px;
}
.sidebar-foot a { color: var(--gold-2); }

.main { flex: 1; min-width: 0; }
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 24px 8px;
}
.topbar h1 { margin: 0; font-size: 26px; }
.nav-toggle { display: none; }
.nav-backdrop { display: none; }
.content { padding: 8px 24px 32px; }

.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px;
  box-shadow: var(--shadow);
}
.card h2 { margin: 0 0 12px; font-size: 18px; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 16px; }
.stat {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px 18px;
  box-shadow: var(--shadow);
}
.stat span { color: var(--muted); font-size: 13px; }
.stat strong { display: block; font-size: 28px; margin-top: 6px; }
.stat small { font-size: 14px; font-weight: 600; color: var(--muted); }

.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 8px 0 14px; }
.inline-form { display: flex; gap: 8px; align-items: center; }
.inline-form input, .inline-form select { padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; font: inherit; }

.alert { padding: 10px 14px; border-radius: 10px; margin: 0 24px 12px; font-weight: 600; }
.alert.ok { background: var(--ok-bg); color: var(--ok); }
.alert.err { background: var(--err-bg); color: var(--err); }
.alert.warn {
  background: #fbeceb;
  color: #9b3226;
  border: 2px solid #9b3226;
  font-size: 18px;
  text-align: center;
  padding: 14px 16px;
}
.login-wrap .alert, .verify-card .alert { margin: 0 0 12px; }

.btn, button.btn {
  display: inline-flex; align-items: center; justify-content: center;
  border: 0; border-radius: 10px; padding: 9px 14px;
  background: var(--navy); color: #fff; font: inherit; font-weight: 700;
  text-decoration: none; cursor: pointer;
}
.btn.gold { background: var(--gold); }
.btn.ghost { background: #e7eee8; color: var(--ink); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }

.field { margin-bottom: 10px; }
.field label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 4px; font-weight: 600; }
.field input, .field select, .field textarea {
  width: 100%; padding: 9px 11px; border: 1px solid var(--line); border-radius: 10px; font: inherit;
  background: #fff;
}
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.form-grid .full { grid-column: 1 / -1; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.net-box {
  margin-top: 12px; padding: 14px; border-radius: 12px;
  background: #eef8f1; font-size: 22px; font-weight: 800; text-align: center;
}
.field input.live-clock {
  font-family: "Segoe UI", Consolas, monospace;
  font-variant-numeric: tabular-nums;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-align: center;
  color: #123628;
  background: #eef8f1;
  direction: ltr;
}

.filters { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 14px; }
.table-wrap { overflow: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data th, table.data td { padding: 8px 7px; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; }
table.data th { color: var(--muted); font-weight: 700; }
.row-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row-actions a, .row-actions button { color: var(--gold); font-weight: 700; text-decoration: none; background: none; border: 0; padding: 0; cursor: pointer; font: inherit; }
.empty { text-align: center; color: var(--muted); padding: 24px !important; }
.hint { color: var(--muted); font-size: 13px; }
.pager { display: flex; gap: 6px; margin-top: 12px; }
.pager a { padding: 6px 10px; border-radius: 8px; background: #e7eee8; color: inherit; text-decoration: none; }
.pager a.active { background: var(--gold); color: #fff; }

.split-layout { display: grid; grid-template-columns: 1.4fr 0.9fr; gap: 16px; }
.tabs { display: flex; gap: 8px; margin-bottom: 12px; }
.tabs a { padding: 8px 12px; border-radius: 10px; background: #fff; color: inherit; text-decoration: none; font-weight: 700; border: 1px solid var(--line); }
.tabs a.active { background: var(--gold); color: #fff; border-color: var(--gold); }
.check { display: flex; gap: 8px; align-items: center; margin: 8px 0; }

.combo { position: relative; }
.combo select { display: none; }
.combo-input { width: 100%; padding: 9px 11px; border: 1px solid var(--line); border-radius: 10px; font: inherit; }
.combo-list {
  display: none; position: absolute; z-index: 30; right: 0; left: 0; top: 100%;
  max-height: 240px; overflow: auto; background: #fff; border: 1px solid var(--line);
  border-radius: 10px; box-shadow: var(--shadow);
}
.combo.open .combo-list { display: block; }
.combo-item { padding: 8px 10px; cursor: pointer; }
.combo-item:hover, .combo-item.active { background: #eef8f1; }

.login-wrap, .verify-page {
  min-height: 100vh; display: grid; place-items: center;
  background: linear-gradient(160deg, #173328, #2f8a45 90%);
  padding: 24px;
}
.login-card, .verify-card {
  width: min(460px, 100%);
  background: #fff;
  border-radius: 18px;
  padding: 28px;
  box-shadow: var(--shadow);
}
.login-brand, .verify-card .login-brand {
  font-size: 36px; font-weight: 800; letter-spacing: 0.08em; text-align: center; color: #1f4636;
}
.login-card h1, .verify-card h1 { margin: 8px 0 6px; text-align: center; font-size: 22px; }
.login-card p, .muted { text-align: center; color: var(--muted); }
.verify-dl { display: grid; gap: 8px; margin-top: 16px; }
.verify-dl div { display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px dashed var(--line); padding-bottom: 6px; }
.verify-dl dt { color: var(--muted); }
.verify-dl dd { margin: 0; font-weight: 700; }
.verify-dl .net { color: var(--gold); font-size: 18px; }

@media (max-width: 980px) {
  .stats, .filters, .form-grid, .split-layout { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; transform: translateX(110%); transition: transform .2s;
  }
  .sidebar.open { transform: none; }
  .nav-toggle { display: inline-flex; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 6px 10px; }
  .nav-backdrop.show { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 15; }
}
