:root {
  font: 14px/1.55 "Segoe UI", Inter, system-ui, -apple-system, sans-serif;
  color: #ecf0f8;
  background: #070a12;
  color-scheme: dark;
  --bg-deep: #070a12;
  --bg-surface: #0e1422;
  --bg-elevated: #141d30;
  --bg-hover: #1b2740;
  --line: rgba(148, 168, 204, 0.14);
  --line-strong: rgba(148, 168, 204, 0.26);
  --muted: #8f9fb8;
  --accent: #00d2d8;
  --accent-strong: #06b6d4;
  --accent-glow: rgba(0, 210, 216, 0.22);
  --gold: #f5b942;
  --green: #34d399;
  --red: #fb7185;
  --purple: #818cf8;
  --radius: 14px;
  --radius-sm: 10px;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background:
    radial-gradient(ellipse 900px 520px at 85% -10%, rgba(0, 210, 216, 0.10), transparent 65%),
    radial-gradient(ellipse 800px 500px at -10% 100%, rgba(129, 140, 248, 0.09), transparent 65%),
    var(--bg-deep);
  min-height: 100vh;
}

button, input, select, textarea { font: inherit; }
button, a, input, select, textarea { outline-offset: 3px; }

button {
  cursor: pointer;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: rgba(25, 36, 58, 0.85);
  color: #ecf0f8;
  padding: 9px 15px;
  font-weight: 600;
  font-size: 13px;
  transition: all 0.16s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}
button:hover:not(:disabled) {
  background: var(--bg-hover);
  border-color: rgba(0, 210, 216, 0.45);
  transform: translateY(-1px);
}
button:active:not(:disabled) { transform: translateY(0); }
button:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }

.primary {
  color: #041e22;
  background: linear-gradient(135deg, #22e3e8, #00b8d4);
  border-color: transparent;
  box-shadow: 0 6px 20px -4px rgba(0, 210, 216, 0.42);
}
.primary:hover:not(:disabled) {
  background: linear-gradient(135deg, #4ef0f4, #08c9e6);
  border-color: transparent;
  box-shadow: 0 8px 24px -3px rgba(0, 210, 216, 0.55);
}

.danger {
  color: #fda4af;
  border-color: rgba(251, 113, 133, 0.35);
  background: rgba(136, 19, 55, 0.25);
}
.danger:hover:not(:disabled) {
  background: rgba(159, 18, 57, 0.42);
  border-color: rgba(251, 113, 133, 0.65);
}

input, select, textarea {
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: rgba(9, 13, 24, 0.85);
  color: #ecf0f8;
  padding: 10px 13px;
  width: 100%;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
textarea { resize: vertical; min-height: 80px; }

label {
  display: grid;
  gap: 7px;
  color: #c5d1e6;
  font-size: 13px;
  font-weight: 500;
}

small, .muted { color: var(--muted); }
h1, h2, h3, p { margin-top: 0; }
h1 { font-size: 28px; font-weight: 700; letter-spacing: -0.6px; margin-bottom: 6px; }
h2 { font-size: 18px; font-weight: 650; letter-spacing: -0.2px; }
h3 { font-size: 15px; font-weight: 600; }
a { color: var(--accent); text-decoration: none; }

.layout {
  display: grid;
  grid-template-columns: 256px 1fr;
  min-height: 100vh;
}

.sidebar {
  padding: 26px 18px;
  background: rgba(11, 16, 28, 0.92);
  backdrop-filter: blur(18px);
  border-right: 1px solid var(--line);
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 8px 26px;
}
.brand img {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  box-shadow: 0 4px 16px rgba(0, 210, 216, 0.25);
}
.brand strong {
  display: block;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.eyebrow {
  font-size: 10px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 700;
}

.nav { display: grid; gap: 6px; }
.nav button {
  text-align: left;
  justify-content: flex-start;
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 11px 14px;
  background: transparent;
  border-color: transparent;
  color: #9fb0ca;
  border-radius: 11px;
  font-weight: 550;
}
.nav button:hover {
  background: rgba(148, 168, 204, 0.08);
  color: #f1f5fb;
  transform: none;
}
.nav .active {
  color: #22e3e8;
  background: linear-gradient(90deg, rgba(0, 210, 216, 0.16), rgba(0, 210, 216, 0.04));
  border-color: rgba(0, 210, 216, 0.28);
  font-weight: 650;
}
.nav svg { width: 18px; height: 18px; flex-shrink: 0; }
.nav-pill {
  margin-left: auto;
  padding: 1px 7px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 700;
  background: rgba(245, 185, 66, 0.2);
  color: var(--gold);
  border: 1px solid rgba(245, 185, 66, 0.4);
}
.nav-pill.red {
  background: rgba(244, 63, 94, 0.2);
  color: var(--red);
  border-color: rgba(251, 113, 133, 0.45);
}

.side-foot {
  margin-top: auto;
  border-top: 1px solid var(--line);
  padding-top: 18px;
  font-size: 12px;
  color: #a9b8cf;
}
.side-foot button {
  margin-top: 12px;
  width: 100%;
  font-size: 12px;
}

.main {
  padding: 34px clamp(20px, 4vw, 56px);
  max-width: 1560px;
  width: 100%;
  min-width: 0;
  margin: 0 auto;
}

.top {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}
.top p { color: var(--muted); margin-bottom: 0; font-size: 13.5px; }
.top-actions { display: flex; gap: 9px; flex-shrink: 0; align-items: center; }

.cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 26px;
}
.card {
  padding: 22px;
  background: linear-gradient(180deg, rgba(20, 29, 48, 0.9), rgba(13, 19, 33, 0.9));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  position: relative;
  overflow: hidden;
}
.card::after {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(148, 168, 204, 0.35), transparent);
}
.card.gold {
  border-color: rgba(0, 210, 216, 0.35);
  background: linear-gradient(145deg, rgba(10, 44, 54, 0.65), rgba(14, 21, 36, 0.95));
}
.card.gold::after {
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
}
.card.warn {
  border-color: rgba(245, 185, 66, 0.4);
  background: linear-gradient(145deg, rgba(56, 40, 14, 0.55), rgba(14, 21, 36, 0.95));
}
.card .value {
  font-size: 34px;
  font-weight: 750;
  letter-spacing: -1px;
  display: block;
  margin: 8px 0 6px;
  font-variant-numeric: tabular-nums;
}
.card .label {
  color: #a8b8d0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.9px;
}
.card .hint { font-size: 12px; color: var(--muted); }

.section {
  background: rgba(14, 20, 34, 0.88);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 24px;
  box-shadow: 0 14px 40px -18px rgba(0, 0, 0, 0.65);
}
.section-head {
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
}
.section-head h2 { margin: 0; font-size: 16px; }

.toolbar {
  display: flex;
  gap: 10px;
  padding: 16px 22px;
  border-bottom: 1px solid var(--line);
  background: rgba(9, 14, 25, 0.55);
  flex-wrap: wrap;
}
.toolbar input { max-width: 380px; }
.toolbar select { max-width: 220px; }

.table-scroll { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; text-align: left; white-space: nowrap; }
th {
  font-weight: 600;
  color: #879ab8;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  background: rgba(9, 14, 25, 0.75);
}
th, td { padding: 14px 22px; border-bottom: 1px solid var(--line); }
td { font-size: 13.5px; }
td strong { font-weight: 600; color: #f1f5fb; }
td small { display: block; font-size: 11.5px; margin-top: 3px; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: rgba(28, 41, 66, 0.45); }

.row-actions { display: flex; gap: 7px; justify-content: flex-end; }
.row-actions.info-actions { justify-content: flex-start; margin-top: 14px; flex-wrap: wrap; }
.row-actions button { font-size: 12px; padding: 6px 11px; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 600;
  border: 1px solid rgba(148, 168, 204, 0.25);
  border-radius: 99px;
  padding: 3px 10px;
  background: rgba(30, 42, 66, 0.65);
  color: #b8c6dc;
}
.badge.green {
  background: rgba(16, 185, 129, 0.14);
  color: #6ee7b7;
  border-color: rgba(52, 211, 153, 0.35);
}
.badge.red {
  background: rgba(244, 63, 94, 0.15);
  color: #fda4af;
  border-color: rgba(251, 113, 133, 0.35);
}
.badge.gold {
  background: rgba(245, 185, 66, 0.16);
  color: #fcd34d;
  border-color: rgba(245, 185, 66, 0.4);
}
.badge.cyan {
  background: rgba(0, 210, 216, 0.14);
  color: #67e8f9;
  border-color: rgba(0, 210, 216, 0.35);
}

.empty {
  text-align: center;
  padding: 54px 24px;
  color: var(--muted);
}
.empty strong {
  display: block;
  color: #e2e8f4;
  font-size: 16px;
  margin-bottom: 7px;
}

.grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.info {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(14, 20, 34, 0.88);
}
.info p { color: var(--muted); font-size: 13.5px; }
.info ul { padding-left: 20px; color: #bdcae0; line-height: 1.85; font-size: 13.5px; }

.auth {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.08fr 0.92fr;
}
.auth-brand {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(32px, 8vw, 96px);
  background:
    radial-gradient(circle at 18% 22%, rgba(0, 210, 216, 0.18), transparent 52%),
    radial-gradient(circle at 82% 82%, rgba(129, 140, 248, 0.16), transparent 55%),
    linear-gradient(160deg, #0b1120 0%, #070b14 100%);
  border-right: 1px solid var(--line);
  position: relative;
}
.auth-brand .brand { padding-left: 0; }
.auth-brand h1 {
  font-size: clamp(32px, 3.6vw, 48px);
  line-height: 1.15;
  max-width: 520px;
  margin: 26px 0 18px;
  background: linear-gradient(135deg, #ffffff 30%, #80eef2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.auth-brand p {
  max-width: 460px;
  color: #9fb1cc;
  line-height: 1.75;
  font-size: 15px;
}
.auth-highlights {
  display: grid;
  gap: 12px;
  margin-top: 28px;
  max-width: 460px;
}
.auth-highlight {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 15px;
  border-radius: 12px;
  background: rgba(20, 30, 50, 0.6);
  border: 1px solid var(--line);
  font-size: 13px;
  color: #d4dff0;
}
.auth-highlight span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
  flex-shrink: 0;
}

.auth-form {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 28px;
}
.auth-card {
  width: 100%;
  max-width: 420px;
  padding: 34px 32px;
  border-radius: 20px;
  background: rgba(14, 20, 34, 0.92);
  border: 1px solid var(--line-strong);
  box-shadow: 0 28px 80px -20px rgba(0, 0, 0, 0.75);
}
.auth-form form {
  width: 100%;
  display: grid;
  gap: 18px;
}
.auth-form h2 { font-size: 24px; margin: 0 0 6px; }
.auth-form p { color: var(--muted); margin: 0; font-size: 13.5px; }

.form-grid { display: grid; gap: 16px; }
.form-two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.error {
  padding: 12px 14px;
  color: #fecdd3;
  background: rgba(136, 19, 55, 0.35);
  border: 1px solid rgba(251, 113, 133, 0.45);
  border-radius: var(--radius-sm);
  font-size: 13px;
}
.success {
  padding: 12px 14px;
  background: rgba(6, 95, 70, 0.35);
  color: #a7f3d0;
  border: 1px solid rgba(52, 211, 153, 0.45);
  border-radius: var(--radius-sm);
  font-size: 13px;
}

.loading { padding: 60px; text-align: center; color: var(--muted); font-size: 15px; }

#toast {
  position: fixed;
  bottom: 24px;
  right: 28px;
  max-width: 440px;
  background: #102a25;
  border: 1px solid rgba(52, 211, 153, 0.45);
  color: #ecfdf5;
  padding: 14px 20px;
  border-radius: 12px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.65);
  display: none;
  z-index: 50;
  font-weight: 500;
}
#toast.show { display: block; }
#toast.is-error {
  background: #3b1522;
  border-color: rgba(251, 113, 133, 0.45);
  color: #ffe4e6;
}

dialog {
  width: min(620px, calc(100% - 32px));
  max-height: 90vh;
  overflow: auto;
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  padding: 26px;
  background: #0f1728;
  color: #ecf0f8;
  box-shadow: 0 30px 100px rgba(0, 0, 0, 0.85);
}
dialog::backdrop {
  background: rgba(3, 6, 14, 0.72);
  backdrop-filter: blur(5px);
}
.dialog-head {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}
.dialog-head h2 { font-size: 20px; margin: 0; }
.dialog-foot {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  padding-top: 18px;
  margin-top: 16px;
  border-top: 1px solid var(--line);
}

.credentials {
  padding: 16px;
  background: #070b14;
  border: 1px solid rgba(0, 210, 216, 0.35);
  border-radius: 12px;
  white-space: pre-wrap;
  font: 13.5px/1.85 Consolas, "Cascadia Mono", monospace;
  color: #a5f3fc;
  overflow-wrap: anywhere;
}

.notice {
  padding: 12px 16px;
  border-left: 3px solid var(--accent);
  background: rgba(0, 210, 216, 0.08);
  color: #bae6fd;
  font-size: 12.5px;
  border-radius: 0 8px 8px 0;
  margin: 0 0 16px;
}

.status-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  background: var(--green);
  box-shadow: 0 0 8px var(--green);
  border-radius: 50%;
  margin-right: 7px;
}

.pager {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  align-items: center;
  padding: 14px 22px;
  color: var(--muted);
  font-size: 12.5px;
}
.pager button { font-size: 12px; padding: 6px 11px; }

.security { max-width: 580px; }
.security form { display: grid; gap: 16px; }

.page-foot {
  display: flex;
  justify-content: space-between;
  color: #6e819c;
  font-size: 12px;
  margin-top: 28px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.code-chip {
  font: 600 12.5px Consolas, monospace;
  padding: 4px 9px;
  border-radius: 7px;
  background: rgba(0, 210, 216, 0.1);
  border: 1px solid rgba(0, 210, 216, 0.28);
  color: #67e8f9;
}

.mobile-logout { display: none; }
.recent-activity { margin-top: 24px; }

@media (max-width: 1050px) {
  .layout { grid-template-columns: 210px 1fr; }
  .sidebar { padding: 22px 12px; }
  .main { padding: 26px 20px; }
  .cards { grid-template-columns: repeat(2, 1fr); }
  .top { align-items: flex-start; }
  .top-actions { flex-wrap: wrap; justify-content: flex-end; }
}

@media (max-width: 740px) {
  .layout { display: block; }
  .sidebar {
    height: auto;
    position: static;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 14px;
  }
  .brand { padding-bottom: 12px; }
  .nav { display: flex; overflow-x: auto; gap: 4px; }
  .nav button { white-space: nowrap; padding: 9px 12px; font-size: 12.5px; }
  .nav svg { display: none; }
  .side-foot { display: none; }
  .mobile-logout { display: inline-flex; }
  .main { padding: 22px 14px; }
  .top { display: block; }
  .top-actions { margin-top: 16px; justify-content: flex-start; }
  h1 { font-size: 24px; }
  .cards { gap: 10px; }
  .card { padding: 16px; }
  .card .value { font-size: 28px; }
  .grid2 { grid-template-columns: 1fr; }
  .toolbar { padding: 14px; flex-direction: column; }
  .toolbar input, .toolbar select { max-width: none; }
  th, td { padding: 12px 14px; }
  .auth { display: block; }
  .auth-brand { padding: 28px 20px; border-right: 0; border-bottom: 1px solid var(--line); }
  .auth-highlights { display: none; }
  .auth-form { padding: 24px 16px; }
  .auth-card { padding: 24px 20px; }
  .form-two { grid-template-columns: 1fr; }
  .page-foot { display: block; }
  .page-foot span { display: block; margin: 6px 0; }
}
