/* VIJIVO Management System */

:root {
  --bg: #060a13;
  --bg-2: #080e19;
  --surface: #0d1526;
  --surface-2: #111b30;
  --elevated: #15203a;
  --border: #1d2a45;
  --border-soft: #16213a;
  --text: #e9eef9;
  --muted: #93a1bd;
  --subtle: #64748b;
  --blue: #4f8cff;
  --blue-deep: #2f6bff;
  --blue-soft: rgba(79, 140, 255, 0.12);
  --green: #2fd47f;
  --green-soft: rgba(47, 212, 127, 0.13);
  --amber: #f5b83d;
  --amber-soft: rgba(245, 184, 61, 0.13);
  --red: #ff5d6c;
  --red-soft: rgba(255, 93, 108, 0.13);
  --purple: #a78bfa;
  --purple-soft: rgba(167, 139, 250, 0.14);
  --cyan: #22d3ee;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  min-height: 100%;
}

body {
  background:
    radial-gradient(1200px 600px at 85% -10%, rgba(47, 107, 255, 0.14), transparent 60%),
    radial-gradient(900px 500px at -10% 20%, rgba(167, 139, 250, 0.08), transparent 55%),
    var(--bg);
}

a { color: var(--blue); text-decoration: none; }
button { font-family: inherit; }
input, select, textarea { font-family: inherit; }
::selection { background: rgba(79, 140, 255, 0.35); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #1c2944; border-radius: 99px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: #26365a; }

/* ------------------------------------------------------------------ boot */

.boot-screen {
  min-height: 100vh;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 18px;
  color: var(--subtle);
  font-size: 12.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.boot-mark {
  width: 58px;
  height: 58px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 26px;
  color: #fff;
  background: linear-gradient(135deg, #2f6bff, #7b5cff);
  box-shadow: 0 18px 40px rgba(47, 107, 255, 0.35);
}

.boot-bar {
  width: 180px;
  height: 3px;
  border-radius: 99px;
  background: #101a2e;
  overflow: hidden;
}

.boot-bar span {
  display: block;
  width: 40%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, transparent, var(--blue), transparent);
  animation: boot-slide 1.1s infinite ease-in-out;
}

@keyframes boot-slide {
  from { transform: translateX(-120%); }
  to { transform: translateX(320%); }
}

/* ------------------------------------------------------------------ login */

.login-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.05fr 1fr;
}

.login-brand {
  position: relative;
  overflow: hidden;
  padding: 56px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background:
    radial-gradient(700px 420px at 20% 110%, rgba(47, 107, 255, 0.22), transparent 60%),
    radial-gradient(500px 360px at 100% 0%, rgba(167, 139, 250, 0.16), transparent 60%),
    linear-gradient(160deg, #0a1120, #070b14);
  border-right: 1px solid var(--border-soft);
}

.login-brand::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(255, 255, 255, 0.022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.022) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(circle at 40% 45%, #000 30%, transparent 78%);
  pointer-events: none;
}

.brand-lockup { display: flex; align-items: center; gap: 14px; z-index: 1; }

.brand-mark {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 21px;
  color: #fff;
  background: linear-gradient(135deg, #2f6bff, #7b5cff);
  box-shadow: 0 12px 30px rgba(47, 107, 255, 0.35);
}

.brand-name { font-size: 17px; font-weight: 800; letter-spacing: 0.16em; }
.brand-sub { font-size: 10px; letter-spacing: 0.3em; color: var(--subtle); margin-top: 3px; text-transform: uppercase; }

.login-headline {
  position: relative;
  z-index: 1;
  max-width: 480px;
}

.login-headline h1 {
  margin: 0 0 18px;
  font-size: clamp(30px, 3.4vw, 44px);
  line-height: 1.1;
  letter-spacing: -0.02em;
  font-weight: 800;
}

.login-headline h1 span {
  background: linear-gradient(100deg, #6ea2ff, #a78bfa 70%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.login-headline p {
  margin: 0;
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.65;
}

.login-points {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 14px;
  margin-top: 34px;
}

.login-point {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  font-size: 13px;
  color: var(--muted);
}

.login-point svg { flex: 0 0 auto; margin-top: 2px; color: var(--blue); }

.login-foot {
  position: relative;
  z-index: 1;
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--subtle);
  text-transform: uppercase;
}

.login-panel {
  display: grid;
  place-items: center;
  padding: 40px 24px;
}

.login-card {
  width: min(420px, 100%);
  background: linear-gradient(180deg, rgba(17, 27, 48, 0.9), rgba(11, 18, 34, 0.94));
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 34px;
  box-shadow: var(--shadow);
}

.login-card h2 { margin: 0; font-size: 22px; letter-spacing: -0.01em; }
.login-card .sub { margin: 8px 0 26px; color: var(--muted); font-size: 13px; line-height: 1.55; }

.login-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 99px;
  background: var(--blue-soft);
  border: 1px solid rgba(79, 140, 255, 0.25);
  color: #9dbcff;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 16px;
}

.login-error {
  margin-top: 14px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--red-soft);
  border: 1px solid rgba(255, 93, 108, 0.28);
  color: #ff9aa4;
  font-size: 12.5px;
  display: none;
}

.login-error.show { display: block; }

/* ------------------------------------------------------------------ shell */

.shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 268px;
  flex: 0 0 268px;
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, #0a1120, #080d18);
  border-right: 1px solid var(--border-soft);
  z-index: 40;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 22px 20px 18px;
}

.sidebar-brand .brand-mark { width: 38px; height: 38px; border-radius: 12px; font-size: 18px; }
.sidebar-brand .brand-name { font-size: 14.5px; }
.sidebar-brand .brand-sub { font-size: 8.5px; letter-spacing: 0.24em; }

.sidebar-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 4px 12px 18px;
}

.nav-label {
  padding: 16px 10px 8px;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.22em;
  color: #4d5b76;
  text-transform: uppercase;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  margin-bottom: 2px;
  border-radius: 11px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
  width: 100%;
  background: none;
  text-align: left;
}

.nav-item:hover { background: rgba(255, 255, 255, 0.035); color: var(--text); }

.nav-item.active {
  background: linear-gradient(90deg, rgba(79, 140, 255, 0.16), rgba(79, 140, 255, 0.05));
  border-color: rgba(79, 140, 255, 0.24);
  color: #dce7ff;
}

.nav-item svg { flex: 0 0 auto; opacity: 0.85; }
.nav-item .nav-count {
  margin-left: auto;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--subtle);
  background: rgba(255, 255, 255, 0.05);
  border-radius: 6px;
  padding: 2px 6px;
}

.terminal-dot {
  width: 8px;
  height: 8px;
  border-radius: 3px;
  flex: 0 0 auto;
  margin: 0 3px;
  box-shadow: 0 0 12px currentColor;
}

.sidebar-user {
  border-top: 1px solid var(--border-soft);
  padding: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, #2f6bff, #7b5cff);
  flex: 0 0 auto;
}

.avatar.sm { width: 28px; height: 28px; border-radius: 9px; font-size: 10px; }

.user-meta { min-width: 0; flex: 1; }
.user-name { font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: 10px; color: var(--subtle); letter-spacing: 0.08em; text-transform: uppercase; margin-top: 2px; }

.main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 28px;
  background: rgba(6, 10, 19, 0.82);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-soft);
}

.topbar-title { font-size: 16px; font-weight: 700; letter-spacing: -0.01em; }
.topbar-sub { font-size: 11.5px; color: var(--subtle); margin-top: 2px; }
.topbar-spacer { flex: 1; }

.content {
  padding: 26px 28px 60px;
  width: 100%;
  max-width: 1340px;
  margin: 0 auto;
  animation: fade-up 0.32s ease both;
}

@keyframes fade-up {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.menu-btn { display: none; }

/* ------------------------------------------------------------------ common */

.page-head {
  display: flex;
  align-items: flex-end;
  gap: 16px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}

.page-head h1 { margin: 0; font-size: 25px; letter-spacing: -0.02em; }
.page-head p { margin: 6px 0 0; color: var(--muted); font-size: 13px; max-width: 640px; line-height: 1.5; }
.page-head .spacer { flex: 1; }
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.card {
  background: linear-gradient(180deg, rgba(17, 27, 48, 0.72), rgba(12, 19, 34, 0.82));
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 20px;
}

.card-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  margin: 0 0 16px;
  letter-spacing: 0.01em;
}

.card-title .muted { color: var(--subtle); font-weight: 500; margin-left: auto; font-size: 11.5px; }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(168px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.stat {
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(17, 27, 48, 0.8), rgba(11, 18, 33, 0.9));
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  padding: 16px 17px;
}

.stat .glow {
  position: absolute;
  width: 90px;
  height: 90px;
  border-radius: 50%;
  right: -30px;
  top: -34px;
  filter: blur(26px);
  opacity: 0.55;
}

.stat-label { font-size: 10.5px; letter-spacing: 0.13em; text-transform: uppercase; color: var(--subtle); font-weight: 700; }
.stat-value { font-size: 27px; font-weight: 800; margin-top: 8px; letter-spacing: -0.02em; }
.stat-note { font-size: 11px; color: var(--muted); margin-top: 6px; }

.grid-2 { display: grid; grid-template-columns: 1.55fr 1fr; gap: 16px; margin-bottom: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font-size: 12.5px;
  font-weight: 600;
  padding: 9px 14px;
  border-radius: 10px;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.15s ease, border-color 0.15s ease;
  white-space: nowrap;
}

.btn:hover { background: var(--elevated); border-color: #2a3a5c; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary {
  background: linear-gradient(135deg, #2f6bff, #5b7bff);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 10px 24px rgba(47, 107, 255, 0.28);
}

.btn-primary:hover { background: linear-gradient(135deg, #3a76ff, #6d8bff); }

.btn-danger { background: var(--red-soft); border-color: rgba(255, 93, 108, 0.32); color: #ff9aa4; }
.btn-danger:hover { background: rgba(255, 93, 108, 0.2); }

.btn-ghost { background: transparent; }
.btn-icon { padding: 8px; width: 36px; height: 36px; }
.btn.sm { padding: 6px 10px; font-size: 11.5px; border-radius: 8px; }

.field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 14px; }
.field label { font-size: 11px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--subtle); }

.field input, .field select, .field textarea {
  width: 100%;
  background: #0a111f;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-size: 13.5px;
  padding: 11px 12px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.field input:focus, .field select:focus, .field textarea:focus {
  border-color: rgba(79, 140, 255, 0.6);
  box-shadow: 0 0 0 3px rgba(79, 140, 255, 0.13);
}

.field textarea { resize: vertical; min-height: 92px; line-height: 1.55; }
.field .hint { font-size: 11px; color: var(--subtle); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.toolbar {
  display: flex;
  gap: 9px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.toolbar .search {
  flex: 1;
  min-width: 180px;
  position: relative;
}

.toolbar .search svg {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--subtle);
  pointer-events: none;
}

.toolbar .search input {
  width: 100%;
  background: #0a111f;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-size: 12.5px;
  padding: 10px 12px 10px 35px;
  outline: none;
}

.toolbar select {
  background: #0a111f;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-size: 12px;
  padding: 10px 10px;
  outline: none;
}

/* ------------------------------------------------------------------ table */

.table-wrap {
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  overflow: auto;
  background: rgba(10, 16, 29, 0.55);
}

table { width: 100%; border-collapse: collapse; min-width: 720px; }

thead th {
  text-align: left;
  padding: 11px 14px;
  font-size: 9.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--subtle);
  background: rgba(255, 255, 255, 0.025);
  border-bottom: 1px solid var(--border-soft);
  white-space: nowrap;
}

tbody td {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(29, 42, 69, 0.5);
  font-size: 12.5px;
  vertical-align: middle;
}

tbody tr:last-child td { border-bottom: none; }
tbody tr { cursor: pointer; transition: background 0.12s ease; }
tbody tr:hover { background: rgba(79, 140, 255, 0.055); }
tbody tr.static { cursor: default; }
tbody tr.static:hover { background: transparent; }

.cell-title { font-weight: 600; color: var(--text); max-width: 380px; }
.cell-sub { font-size: 11px; color: var(--subtle); margin-top: 2px; display: flex; gap: 6px; align-items: center; }
.cell-muted { color: var(--muted); }
.cell-nowrap { white-space: nowrap; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 7px;
  font-size: 10.5px;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: var(--muted);
  white-space: nowrap;
}

.chip .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  border-radius: 99px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.badge.open { background: var(--blue-soft); color: #8db5ff; border: 1px solid rgba(79, 140, 255, 0.24); }
.badge.in_progress { background: var(--amber-soft); color: #ffcf6b; border: 1px solid rgba(245, 184, 61, 0.24); }
.badge.resolved { background: var(--green-soft); color: #6ee7a8; border: 1px solid rgba(47, 212, 127, 0.24); }
.badge.closed { background: rgba(148, 163, 184, 0.1); color: #9aa8c1; border: 1px solid rgba(148, 163, 184, 0.18); }

.badge.priority-low { background: rgba(148, 163, 184, 0.1); color: #9aa8c1; }
.badge.priority-medium { background: var(--blue-soft); color: #8db5ff; }
.badge.priority-high { background: var(--amber-soft); color: #ffcf6b; }
.badge.priority-critical { background: var(--red-soft); color: #ff9aa4; }

.badge.type-master { background: rgba(245, 184, 61, 0.14); color: #ffd27a; border: 1px solid rgba(245, 184, 61, 0.26); }
.badge.type-management { background: var(--purple-soft); color: #c4b1ff; border: 1px solid rgba(167, 139, 250, 0.26); }
.badge.type-staff { background: rgba(148, 163, 184, 0.1); color: #9aa8c1; border: 1px solid rgba(148, 163, 184, 0.16); }

.term-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 7px;
  font-size: 10.5px;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: #b7c3d9;
  margin: 1px 2px 1px 0;
}

.term-chip i {
  width: 6px;
  height: 6px;
  border-radius: 2px;
  display: inline-block;
  box-shadow: 0 0 8px currentColor;
}

/* ------------------------------------------------------------------ overview */

.hero {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border-soft);
  border-radius: 18px;
  padding: 24px 26px;
  margin-bottom: 18px;
  background:
    radial-gradient(600px 240px at 100% 0%, rgba(79, 140, 255, 0.18), transparent 60%),
    linear-gradient(120deg, #0e1729, #0a1120 60%);
}

.hero h2 { margin: 0 0 8px; font-size: 21px; letter-spacing: -0.015em; }
.hero p { margin: 0; color: var(--muted); font-size: 13px; max-width: 620px; line-height: 1.6; }
.hero .hero-meta { display: flex; gap: 18px; margin-top: 18px; flex-wrap: wrap; }
.hero .hero-meta div { font-size: 11px; color: var(--subtle); letter-spacing: 0.06em; text-transform: uppercase; }
.hero .hero-meta strong { display: block; font-size: 15px; color: var(--text); letter-spacing: 0; text-transform: none; margin-top: 3px; }

.dist { display: grid; gap: 13px; }

.dist-row { display: grid; grid-template-columns: 110px 1fr 42px; align-items: center; gap: 10px; }
.dist-name { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dist-track { display: block; height: 7px; background: rgba(255, 255, 255, 0.05); border-radius: 99px; overflow: hidden; }
.dist-fill { display: block; height: 100%; border-radius: 99px; transition: width 0.5s ease; }
.dist-value { font-size: 11px; font-weight: 700; color: var(--muted); text-align: right; }

.donut-wrap { display: flex; align-items: center; gap: 22px; }

.donut {
  width: 132px;
  height: 132px;
  border-radius: 50%;
  position: relative;
  flex: 0 0 auto;
}

.donut::after {
  content: "";
  position: absolute;
  inset: 17px;
  border-radius: 50%;
  background: var(--surface);
}

.donut-center {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  text-align: center;
  z-index: 1;
}

.donut-center strong { font-size: 24px; font-weight: 800; display: block; line-height: 1; }
.donut-center span { font-size: 9.5px; color: var(--subtle); letter-spacing: 0.12em; text-transform: uppercase; }

.legend { display: grid; gap: 9px; font-size: 12px; color: var(--muted); }
.legend div { display: flex; align-items: center; gap: 8px; }
.legend i { width: 8px; height: 8px; border-radius: 3px; display: inline-block; }
.legend b { margin-left: auto; color: var(--text); font-weight: 700; }

.activity-list { display: grid; gap: 2px; }

.activity-item {
  display: flex;
  gap: 12px;
  padding: 11px 2px;
  border-bottom: 1px solid rgba(29, 42, 69, 0.45);
}

.activity-item:last-child { border-bottom: none; }
.activity-icon {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: rgba(79, 140, 255, 0.1);
  color: var(--blue);
  flex: 0 0 auto;
}
.activity-body { min-width: 0; flex: 1; }
.activity-text { font-size: 12px; color: var(--text); line-height: 1.45; }
.activity-text b { font-weight: 700; }
.activity-meta { font-size: 10.5px; color: var(--subtle); margin-top: 3px; }

/* ------------------------------------------------------------------ terminal page */

.term-hero {
  position: relative;
  overflow: hidden;
  border-radius: 18px;
  border: 1px solid var(--border-soft);
  padding: 22px 24px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.term-hero .term-icon {
  width: 50px;
  height: 50px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}

.term-hero h1 { margin: 0; font-size: 22px; letter-spacing: -0.02em; }
.term-hero p { margin: 5px 0 0; color: var(--muted); font-size: 12.5px; }
.term-hero .spacer { flex: 1; }
.term-stats { display: flex; gap: 10px; flex-wrap: wrap; }

.term-stat {
  min-width: 84px;
  padding: 9px 12px;
  border-radius: 11px;
  background: rgba(7, 11, 20, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.06);
  text-align: center;
}

.term-stat strong { display: block; font-size: 17px; font-weight: 800; }
.term-stat span { font-size: 9px; letter-spacing: 0.12em; color: var(--subtle); text-transform: uppercase; }

/* ------------------------------------------------------------------ staff */

.staff-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 14px; }

.staff-card {
  background: linear-gradient(180deg, rgba(17, 27, 48, 0.75), rgba(11, 18, 33, 0.85));
  border: 1px solid var(--border-soft);
  border-radius: 15px;
  padding: 17px;
  display: flex;
  flex-direction: column;
  gap: 13px;
}

.staff-top { display: flex; gap: 11px; align-items: center; }
.staff-id { min-width: 0; flex: 1; }
.staff-name { font-size: 13.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.staff-user { font-size: 11px; color: var(--subtle); margin-top: 2px; }
.staff-terms { display: flex; gap: 4px; flex-wrap: wrap; min-height: 20px; }
.staff-foot { display: flex; align-items: center; gap: 8px; margin-top: auto; }
.staff-foot .spacer { flex: 1; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.status-dot.on { background: var(--green); box-shadow: 0 0 8px var(--green); }
.status-dot.off { background: var(--subtle); }
.field-inline { font-size: 10.5px; color: var(--subtle); }

/* ------------------------------------------------------------------ modal */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(3, 6, 12, 0.72);
  backdrop-filter: blur(6px);
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 22px;
  animation: fade-in 0.18s ease both;
}

@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

.modal {
  width: min(560px, 100%);
  max-height: calc(100vh - 44px);
  overflow-y: auto;
  background: linear-gradient(180deg, #101a2e, #0b1220);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow);
  animation: modal-in 0.2s ease both;
}

.modal.wide { width: min(720px, 100%); }

@keyframes modal-in {
  from { opacity: 0; transform: translateY(14px) scale(0.985); }
  to { opacity: 1; transform: none; }
}

.modal-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border-soft);
  position: sticky;
  top: 0;
  background: #101a2e;
  z-index: 1;
}

.modal-head h3 { margin: 0; font-size: 16px; letter-spacing: -0.01em; }
.modal-head .sub { font-size: 11.5px; color: var(--subtle); margin-top: 3px; }
.modal-head .spacer { flex: 1; }

.modal-body { padding: 20px; }
.modal-foot {
  display: flex;
  gap: 9px;
  justify-content: flex-end;
  padding: 16px 20px;
  border-top: 1px solid var(--border-soft);
  position: sticky;
  bottom: 0;
  background: #0c1424;
}

.modal-close {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--muted);
  cursor: pointer;
}

.modal-close:hover { color: var(--text); background: var(--elevated); }

.detail-grid { display: grid; gap: 14px; }
.detail-row { display: flex; justify-content: space-between; gap: 18px; font-size: 12.5px; padding: 9px 0; border-bottom: 1px solid rgba(29, 42, 69, 0.45); }
.detail-row:last-child { border-bottom: none; }
.detail-row span { color: var(--subtle); }
.detail-row b { color: var(--text); font-weight: 600; text-align: right; }
.detail-body { font-size: 13px; color: var(--muted); line-height: 1.65; white-space: pre-wrap; background: #0a111f; border: 1px solid var(--border-soft); border-radius: 11px; padding: 13px 14px; }

.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 7px; }

.check-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: #0a111f;
  font-size: 12px;
  color: var(--muted);
  cursor: pointer;
  transition: border-color 0.12s ease, background 0.12s ease;
  user-select: none;
}

.check-item:hover { border-color: #2a3a5c; }
.check-item.checked { border-color: rgba(79, 140, 255, 0.45); background: rgba(79, 140, 255, 0.09); color: var(--text); }
.check-item input { accent-color: var(--blue); }

/* ------------------------------------------------------------------ toasts / empty */

.toast-host {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 9px;
  max-width: min(380px, calc(100vw - 40px));
}

.toast {
  background: #111b30;
  border: 1px solid var(--border);
  border-left: 3px solid var(--blue);
  border-radius: 11px;
  padding: 12px 15px;
  font-size: 12.5px;
  color: var(--text);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4);
  animation: toast-in 0.22s ease both;
}

.toast.success { border-left-color: var(--green); }
.toast.error { border-left-color: var(--red); }
.toast.leaving { animation: toast-out 0.2s ease both; }

@keyframes toast-in { from { opacity: 0; transform: translateX(18px); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateX(18px); } }

.empty {
  text-align: center;
  padding: 46px 20px;
  color: var(--subtle);
  font-size: 12.5px;
}

.empty svg { color: #2b3b5c; margin-bottom: 10px; }
.empty strong { display: block; color: var(--muted); font-size: 13.5px; margin-bottom: 5px; }

.skeleton {
  background: linear-gradient(90deg, #0e1729 25%, #14203a 50%, #0e1729 75%);
  background-size: 200% 100%;
  animation: shimmer 1.2s infinite linear;
  border-radius: 8px;
}

@keyframes shimmer { to { background-position: -200% 0; } }

.loading-rows { display: grid; gap: 9px; padding: 8px 0; }
.loading-rows .skeleton { height: 38px; }

/* ------------------------------------------------------------------ responsive */

@media (max-width: 1080px) {
  .login-shell { grid-template-columns: 1fr; }
  .login-brand { display: none; }
  .grid-2 { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr; }
}

@media (max-width: 960px) {
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    transform: translateX(-104%);
    transition: transform 0.24s ease;
    box-shadow: 20px 0 60px rgba(0, 0, 0, 0.5);
  }
  .sidebar.open { transform: none; }
  .menu-btn { display: inline-flex; }
  .sidebar-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(3, 6, 12, 0.6);
    z-index: 35;
    backdrop-filter: blur(3px);
  }
  .content { padding: 20px 16px 60px; }
  .topbar { padding: 12px 16px; }
  .field-row { grid-template-columns: 1fr; }
  .hero { padding: 20px; }
  .term-hero { padding: 18px; }
}

@media (max-width: 520px) {
  .login-card { padding: 26px 22px; }
  .stat-value { font-size: 24px; }
  .page-head h1 { font-size: 21px; }
  .topbar-sub { display: none; }
}

/* ------------------------------------------------------------------ support */

.support-msgs {
  display: grid;
  align-content: start;
  gap: 10px;
  max-height: 46vh;
  overflow-y: auto;
  padding: 4px;
  background: rgba(7, 11, 20, 0.45);
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  min-height: 160px;
}

.msg {
  max-width: 78%;
  padding: 9px 12px;
  border-radius: 12px;
  font-size: 12.5px;
  line-height: 1.55;
  justify-self: start;
  background: #0e1b31;
  border: 1px solid var(--border-soft);
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
}

.msg.staff {
  justify-self: end;
  background: rgba(79, 140, 255, 0.14);
  border-color: rgba(79, 140, 255, 0.3);
}

.msg.system {
  justify-self: center;
  max-width: 90%;
  background: transparent;
  border: none;
  text-align: center;
  color: var(--subtle);
  font-size: 11px;
}

.msg-head {
  display: flex;
  gap: 8px;
  font-size: 9.5px;
  color: var(--subtle);
  margin-bottom: 4px;
  letter-spacing: 0.03em;
}

.msg.staff .msg-head { justify-content: flex-end; }

.stars { display: inline-flex; gap: 2px; }
.stars i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22304d;
  display: inline-block;
}
.stars i.on { background: var(--amber); box-shadow: 0 0 6px rgba(245, 184, 61, 0.5); }
