:root {
  color-scheme: dark;
  --bg: #07090d;
  --panel: #0d1017;
  --panel-2: #111621;
  --panel-3: #151b27;
  --line: rgba(255,255,255,.08);
  --line-strong: rgba(255,255,255,.14);
  --text: #f4f7fb;
  --muted: #8d96a8;
  --muted-2: #697386;
  --green: #83ffbd;
  --green-strong: #4cf39a;
  --blue: #8db7ff;
  --violet: #b18cff;
  --amber: #ffd48a;
  --red: #ff8a9a;
  --radius: 18px;
  --shadow: 0 24px 70px rgba(0,0,0,.35);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); }
body { min-height: 100vh; overflow-x: hidden; }
button, input, select, textarea { font: inherit; }
button { color: inherit; }
a { color: inherit; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
  background:
    radial-gradient(circle at 18% 20%, rgba(77,243,154,.11), transparent 28%),
    radial-gradient(circle at 84% 72%, rgba(177,140,255,.10), transparent 30%),
    #07090d;
}
.login-card {
  width: min(440px,100%);
  padding: 34px;
  background: rgba(13,16,23,.88);
  border: 1px solid var(--line);
  border-radius: 26px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px);
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  width: 42px; height: 42px; border-radius: 50%; position: relative; flex: 0 0 auto;
  background: radial-gradient(circle at center, #0a0c11 52%, transparent 53%),
              conic-gradient(from 20deg, var(--green), var(--blue), var(--violet), var(--green));
  box-shadow: 0 0 26px rgba(76,243,154,.18);
}
.brand-mark::after { content:"Б"; position:absolute; inset:0; display:grid; place-items:center; font-weight:800; font-size:18px; }
.brand-title { font-size: 17px; font-weight: 760; letter-spacing: -.02em; }
.brand-sub { margin-top: 2px; color: var(--muted); font-size: 12px; }
.login-card h1 { margin: 34px 0 8px; font-size: 30px; letter-spacing: -.045em; }
.login-card p { margin: 0 0 26px; color: var(--muted); line-height: 1.55; }
.field { display: grid; gap: 8px; margin: 0 0 16px; }
.field label { font-size: 12px; color: var(--muted); font-weight: 650; }
.input, .select, .textarea {
  width: 100%; border: 1px solid var(--line); background: #090c12; color: var(--text);
  border-radius: 12px; padding: 12px 14px; outline: none; transition: .18s ease;
}
.input:focus, .select:focus, .textarea:focus { border-color: rgba(131,255,189,.48); box-shadow: 0 0 0 3px rgba(131,255,189,.08); }
.textarea { resize: vertical; min-height: 96px; }
.btn {
  border: 1px solid var(--line); background: var(--panel-3); border-radius: 11px; padding: 10px 14px;
  cursor: pointer; font-weight: 680; transition: .16s ease; display: inline-flex; align-items:center; justify-content:center; gap:8px;
}
.btn:hover { transform: translateY(-1px); border-color: var(--line-strong); background: #19202d; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform:none; }
.btn-primary { background: var(--green); color: #08110d; border-color: transparent; }
.btn-primary:hover { background: #a1ffcd; }
.btn-danger { background: rgba(255,138,154,.10); color: #ffb6c1; border-color: rgba(255,138,154,.22); }
.btn-ghost { background: transparent; }
.btn-block { width: 100%; }
.login-meta { margin-top: 20px; font-size: 11px; color: var(--muted-2); display:flex; justify-content:space-between; gap:12px; }

.shell { min-height: 100vh; display: grid; grid-template-columns: 242px minmax(0,1fr); }
.sidebar {
  position: sticky; top:0; height:100vh; border-right:1px solid var(--line); padding: 22px 16px;
  background: #090b10; display:flex; flex-direction:column; z-index:10;
}
.sidebar .brand { padding: 0 7px 22px; }
.nav { display:grid; gap:6px; }
.nav-btn {
  border:0; background:transparent; color:var(--muted); padding:11px 12px; border-radius:11px; cursor:pointer;
  text-align:left; display:flex; align-items:center; gap:11px; font-size:14px; font-weight:640;
}
.nav-btn:hover { background: rgba(255,255,255,.035); color:var(--text); }
.nav-btn.active { background: rgba(131,255,189,.075); color:var(--green); }
.nav-icon { width:18px; text-align:center; opacity:.9; }
.sidebar-bottom { margin-top:auto; border-top:1px solid var(--line); padding-top:16px; }
.admin-mini { padding: 8px 9px 12px; }
.admin-mini strong { display:block; font-size:13px; }
.admin-mini span { display:block; color:var(--muted); font-size:11px; margin-top:4px; }

.main { min-width:0; }
.topbar {
  height:74px; border-bottom:1px solid var(--line); display:flex; align-items:center; justify-content:space-between;
  padding: 0 28px; position:sticky; top:0; background:rgba(7,9,13,.88); backdrop-filter:blur(18px); z-index:8;
}
.topbar-title { font-size:16px; font-weight:760; letter-spacing:-.02em; }
.topbar-right { display:flex; align-items:center; gap:10px; }
.health-dot { width:8px; height:8px; border-radius:50%; background:var(--green); box-shadow:0 0 12px rgba(76,243,154,.65); }
.content { padding: 26px 28px 48px; max-width: 1540px; margin:0 auto; }
.page-head { display:flex; align-items:end; justify-content:space-between; gap:18px; margin-bottom:22px; }
.page-head h1 { margin:0; font-size:28px; letter-spacing:-.045em; }
.page-head p { margin:6px 0 0; color:var(--muted); font-size:13px; }

.stats-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:14px; margin-bottom:18px; }
.stat-card { border:1px solid var(--line); background:var(--panel); border-radius:var(--radius); padding:18px; min-height:126px; }
.stat-label { color:var(--muted); font-size:12px; font-weight:650; }
.stat-value { margin-top:18px; font-size:29px; font-weight:780; letter-spacing:-.045em; }
.stat-note { color:var(--muted-2); font-size:11px; margin-top:7px; }
.stat-accent { background:linear-gradient(145deg, rgba(131,255,189,.09), var(--panel) 58%); }

.grid-2 { display:grid; grid-template-columns:minmax(0,1.2fr) minmax(320px,.8fr); gap:14px; }
.card { border:1px solid var(--line); background:var(--panel); border-radius:var(--radius); overflow:hidden; }
.card-head { min-height:56px; padding:14px 17px; border-bottom:1px solid var(--line); display:flex; align-items:center; justify-content:space-between; gap:12px; }
.card-title { font-size:14px; font-weight:730; }
.card-body { padding:17px; }

.toolbar { display:flex; gap:10px; flex-wrap:wrap; margin-bottom:14px; }
.search { min-width:260px; flex:1; }
.table-wrap { width:100%; overflow:auto; border:1px solid var(--line); border-radius:16px; background:var(--panel); }
table { width:100%; border-collapse:collapse; min-width:840px; }
th { color:var(--muted-2); text-transform:uppercase; letter-spacing:.08em; font-size:10px; text-align:left; padding:12px 14px; font-weight:700; border-bottom:1px solid var(--line); }
td { padding:14px; border-bottom:1px solid rgba(255,255,255,.055); vertical-align:middle; font-size:13px; }
tr:last-child td { border-bottom:0; }
tbody tr { cursor:pointer; transition:.12s ease; }
tbody tr:hover { background:rgba(255,255,255,.025); }
.user-cell { display:flex; align-items:center; gap:10px; min-width:210px; }
.avatar { width:34px; height:34px; border-radius:10px; display:grid; place-items:center; background:linear-gradient(145deg, rgba(141,183,255,.18), rgba(177,140,255,.12)); color:#dfe8ff; font-weight:760; font-size:12px; flex:0 0 auto; }
.user-cell strong { display:block; font-size:13px; }
.user-cell small { display:block; margin-top:3px; color:var(--muted); }
.badges { display:flex; gap:5px; flex-wrap:wrap; }
.badge { padding:5px 8px; border-radius:999px; border:1px solid var(--line); font-size:10px; font-weight:720; color:var(--muted); background:rgba(255,255,255,.02); }
.badge.green { color:var(--green); border-color:rgba(131,255,189,.18); background:rgba(131,255,189,.06); }
.badge.blue { color:var(--blue); border-color:rgba(141,183,255,.2); background:rgba(141,183,255,.06); }
.badge.violet { color:#cfb6ff; border-color:rgba(177,140,255,.2); background:rgba(177,140,255,.07); }
.badge.amber { color:var(--amber); border-color:rgba(255,212,138,.2); background:rgba(255,212,138,.06); }
.badge.red { color:#ffb0bb; border-color:rgba(255,138,154,.2); background:rgba(255,138,154,.06); }
.pagination { display:flex; align-items:center; justify-content:space-between; margin-top:12px; color:var(--muted); font-size:12px; }
.pagination .actions { display:flex; gap:8px; }

.detail-grid { display:grid; grid-template-columns:minmax(0,1.25fr) minmax(310px,.75fr); gap:14px; }
.profile-head { display:flex; gap:14px; align-items:center; }
.profile-head .avatar { width:52px; height:52px; border-radius:14px; font-size:16px; }
.profile-head h2 { margin:0; font-size:20px; letter-spacing:-.03em; }
.profile-head p { margin:5px 0 0; color:var(--muted); font-size:12px; }
.kv { display:grid; grid-template-columns:150px minmax(0,1fr); gap:10px 18px; margin-top:18px; }
.kv dt { color:var(--muted); font-size:12px; }
.kv dd { margin:0; font-size:12px; overflow-wrap:anywhere; }
.action-row { display:flex; gap:8px; flex-wrap:wrap; }
.section-spacer { height:14px; }
.timeline { display:grid; gap:9px; }
.timeline-item { border-left:1px solid var(--line-strong); padding:3px 0 12px 14px; position:relative; }
.timeline-item::before { content:""; position:absolute; left:-4px; top:7px; width:7px; height:7px; border-radius:50%; background:var(--green); }
.timeline-item strong { font-size:12px; }
.timeline-item p { margin:4px 0 0; color:var(--muted); font-size:11px; line-height:1.45; }

.route-card { border:1px solid var(--line); border-radius:15px; overflow:hidden; margin-bottom:10px; }
.route-summary { padding:14px 15px; display:flex; justify-content:space-between; gap:16px; align-items:center; background:var(--panel-2); cursor:pointer; }
.route-summary h3 { margin:0; font-size:14px; }
.route-summary p { margin:5px 0 0; color:var(--muted); font-size:11px; }
.route-body { padding:14px; border-top:1px solid var(--line); }
.point-box { border:1px solid var(--line); border-radius:12px; padding:13px; margin-bottom:10px; }
.point-box label { display:block; color:var(--muted); font-size:10px; text-transform:uppercase; letter-spacing:.08em; margin-bottom:7px; }
.point-box p { margin:0; font-size:12px; line-height:1.55; white-space:pre-wrap; }
.stage { border-left:1px solid var(--line-strong); padding:4px 0 10px 15px; margin-left:4px; }
.stage h4 { margin:0; font-size:12px; }
.stage-meta { color:var(--muted); font-size:10px; margin:4px 0 8px; }
.task { background:rgba(255,255,255,.025); border:1px solid var(--line); border-radius:10px; padding:10px; margin-top:6px; }
.task strong { font-size:11px; }
.task p { margin:5px 0 0; color:var(--muted); font-size:10px; line-height:1.45; }
.progress { height:5px; border-radius:999px; overflow:hidden; background:#1a202a; margin-top:8px; }
.progress > span { display:block; height:100%; background:linear-gradient(90deg,var(--green-strong),var(--blue)); border-radius:inherit; }

.empty { padding:42px 22px; text-align:center; color:var(--muted); }
.empty strong { color:var(--text); display:block; margin-bottom:7px; }
.loading { display:grid; place-items:center; min-height:260px; color:var(--muted); }
.spinner { width:22px; height:22px; border:2px solid var(--line-strong); border-top-color:var(--green); border-radius:50%; animation:spin .7s linear infinite; margin-bottom:10px; }
@keyframes spin { to { transform:rotate(360deg); } }

.modal-backdrop { position:fixed; inset:0; z-index:50; background:rgba(0,0,0,.68); display:grid; place-items:center; padding:20px; backdrop-filter:blur(7px); }
.modal { width:min(480px,100%); background:#0e1219; border:1px solid var(--line-strong); border-radius:20px; box-shadow:var(--shadow); }
.modal-head { padding:18px 20px 12px; }
.modal-head h3 { margin:0; font-size:18px; }
.modal-head p { margin:6px 0 0; color:var(--muted); font-size:12px; line-height:1.45; }
.modal-body { padding:10px 20px 20px; }
.modal-actions { display:flex; justify-content:flex-end; gap:8px; margin-top:18px; }
.quick-days { display:grid; grid-template-columns:repeat(4,1fr); gap:7px; margin-bottom:14px; }
.quick-days button { border:1px solid var(--line); border-radius:10px; background:var(--panel-2); padding:9px 5px; cursor:pointer; color:var(--muted); }
.quick-days button.active { border-color:rgba(131,255,189,.35); background:rgba(131,255,189,.08); color:var(--green); }
.toast-root { position:fixed; right:18px; bottom:18px; z-index:80; display:grid; gap:8px; }
.toast { max-width:390px; padding:12px 14px; border-radius:12px; background:#151b25; border:1px solid var(--line-strong); box-shadow:var(--shadow); font-size:12px; animation:toastIn .2s ease; }
.toast.error { border-color:rgba(255,138,154,.25); color:#ffd3d9; }
.toast.success { border-color:rgba(131,255,189,.25); color:#d3ffe7; }
@keyframes toastIn { from { transform:translateY(8px); opacity:0; } }

.mobile-menu { display:none; }
@media (max-width: 1100px) {
  .stats-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .detail-grid,.grid-2 { grid-template-columns:1fr; }
}
@media (max-width: 760px) {
  .shell { display:block; }
  .sidebar { position:fixed; left:0; top:0; width:250px; transform:translateX(-105%); transition:.2s ease; box-shadow:var(--shadow); }
  .sidebar.open { transform:translateX(0); }
  .mobile-menu { display:inline-flex; }
  .topbar { height:64px; padding:0 16px; }
  .content { padding:20px 14px 40px; }
  .stats-grid { grid-template-columns:1fr 1fr; gap:9px; }
  .stat-card { min-height:108px; padding:14px; }
  .stat-value { font-size:23px; margin-top:14px; }
  .page-head { align-items:flex-start; flex-direction:column; }
  .search { min-width:100%; }
  .toolbar > .select { width:calc(50% - 5px); }
  .login-card { padding:26px 22px; }
  .kv { grid-template-columns:1fr; gap:5px; }
  .kv dd { margin-bottom:7px; }
}
