:root {
  --primary: #6c63ff;
  --primary-strong: #5548ee;
  --primary-soft: #eeedff;
  --ink: #263238;
  --muted: #7b8190;
  --line: #e9eaf2;
  --bg: #f7f7fc;
  --card: #ffffff;
  --success: #5ac75a;
  --danger: #f05252;
  --warning: #f5ad45;
  --info: #18bfe0;
  --shadow: 0 10px 30px rgba(41, 45, 62, .08);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; color: var(--ink); background: var(--bg); font-size: 14px; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
img { max-width: 100%; }
.hidden { display: none !important; }
.overflow-hidden { overflow: hidden; }
.app-shell { min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: 250px; background: #fff; border-right: 1px solid var(--line); z-index: 50; display: flex; flex-direction: column; transition: transform .25s ease; }
.sidebar-brand { height: 78px; display: flex; align-items: center; gap: 11px; padding: 0 24px; font-weight: 800; font-size: 20px; letter-spacing: -.5px; }
.brand-mark { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; color: #fff; background: linear-gradient(145deg, #8f88ff, var(--primary)); box-shadow: 0 8px 20px rgba(108,99,255,.25); font-weight: 900; }
.sidebar-nav { padding: 8px 12px 24px; overflow-y: auto; flex: 1; }
.nav-caption { padding: 20px 12px 8px; font-size: 11px; color: #b0b4c0; text-transform: uppercase; letter-spacing: .08em; }
.nav-link { display: flex; align-items: center; gap: 11px; min-height: 43px; border-radius: 9px; padding: 10px 12px; color: #5e6470; margin: 3px 0; transition: .18s ease; }
.nav-link:hover { background: #f7f6ff; color: var(--primary-strong); transform: translateX(2px); }
.nav-link.active { background: var(--primary-soft); color: var(--primary-strong); font-weight: 700; box-shadow: inset 3px 0 0 var(--primary); }
.nav-icon { width: 20px; height: 20px; display: grid; place-items: center; font-size: 16px; }
.nav-badge { margin-left: auto; padding: 2px 7px; border-radius: 999px; background: #f2f1ff; color: var(--primary); font-size: 10px; font-weight: 800; }
.sidebar-user { border-top: 1px solid var(--line); padding: 16px; display: flex; align-items: center; gap: 10px; }
.avatar { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(145deg, #eef0ff, #d7d4ff); color: var(--primary-strong); font-weight: 800; flex: 0 0 auto; }
.sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(29, 32, 48, .45); z-index: 40; }
.main { margin-left: 250px; min-height: 100vh; }
.topbar { height: 72px; padding: 0 24px; background: rgba(255,255,255,.96); border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 16px; position: sticky; top: 0; z-index: 30; backdrop-filter: blur(10px); }
.search { flex: 1; max-width: 560px; position: relative; }
.search input { width: 100%; border: 1px solid transparent; background: #f8f8fc; border-radius: 9px; padding: 11px 14px 11px 40px; outline: none; transition: .2s; }
.search input:focus { border-color: #c9c5ff; background: #fff; box-shadow: 0 0 0 4px rgba(108,99,255,.09); }
.search::before { content: "⌕"; position: absolute; left: 14px; top: 8px; font-size: 22px; color: #9196a4; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.icon-btn { min-width: 38px; height: 38px; border: 1px solid var(--line); background: #fff; border-radius: 9px; display: grid; place-items: center; color: #666d7a; }
.mobile-only { display: none; }
.content { padding: 24px; max-width: 1540px; margin: 0 auto; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.page-title { margin: 0; font-size: 24px; letter-spacing: -.4px; }
.page-subtitle { color: var(--muted); margin: 5px 0 0; }
.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); }
.card-body { padding: 20px; }
.card-head { padding: 18px 20px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.card-title { margin: 0; font-size: 16px; font-weight: 750; }
.stat-card { padding: 20px; display: flex; justify-content: space-between; gap: 18px; min-height: 132px; }
.stat-icon { width: 42px; height: 42px; border-radius: 10px; display: grid; place-items: center; font-size: 19px; background: var(--primary-soft); color: var(--primary); }
.stat-icon.success { background: #edfaed; color: var(--success); }
.stat-icon.info { background: #eafaff; color: var(--info); }
.stat-icon.warning { background: #fff7e9; color: var(--warning); }
.stat-label { color: var(--muted); margin-top: 14px; }
.stat-value { font-size: 27px; font-weight: 800; letter-spacing: -.7px; margin-top: 4px; }
.stat-trend { color: var(--success); font-size: 12px; font-weight: 700; margin-top: 6px; }
.hero-card { display: flex; align-items: center; min-height: 158px; overflow: hidden; position: relative; background: linear-gradient(115deg, #fff 55%, #f0efff); }
.hero-copy { padding: 22px; max-width: 62%; position: relative; z-index: 2; }
.hero-title { color: var(--primary); font-size: 18px; font-weight: 800; margin: 0 0 8px; }
.hero-text { color: #676e7b; line-height: 1.55; }
.hero-art { position: absolute; right: 20px; bottom: 0; width: 220px; height: 145px; }
.hero-orb { position: absolute; border-radius: 50%; background: rgba(108,99,255,.13); }
.hero-orb.one { width: 110px; height: 110px; right: 8px; bottom: 15px; }
.hero-orb.two { width: 58px; height: 58px; right: 118px; top: 18px; }
.hero-screen { position: absolute; width: 108px; height: 72px; background: #5d63a9; border-radius: 8px; right: 48px; bottom: 12px; transform: skew(-8deg); box-shadow: 0 12px 20px rgba(45,48,87,.2); }
.hero-person { position: absolute; width: 58px; height: 86px; background: var(--primary); border-radius: 28px 28px 8px 8px; right: 104px; bottom: 53px; }
.hero-person::before { content:""; position:absolute; width:38px; height:38px; background:#ffd7bd; border-radius:50%; left:10px; top:-27px; }
.hero-person::after { content:""; position:absolute; width:42px; height:22px; background:#263238; border-radius:50% 50% 35% 35%; left:8px; top:-34px; }
.btn { border: 1px solid transparent; border-radius: 7px; min-height: 38px; padding: 9px 14px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; font-weight: 700; transition: .18s ease; }
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 7px 16px rgba(108,99,255,.22); }
.btn-primary:hover { background: var(--primary-strong); }
.btn-secondary { background: #fff; border-color: #ccc8f8; color: var(--primary-strong); }
.btn-muted { background: #f4f5f8; color: #606776; }
.btn-success { background: var(--success); color: #fff; }
.btn-danger { background: #fff0f0; color: var(--danger); border-color: #ffd3d3; }
.btn-sm { min-height: 31px; padding: 6px 10px; font-size: 12px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.field { margin-bottom: 16px; }
.label { display: block; font-weight: 700; margin-bottom: 7px; color: #4b5160; }
.input, .select, .textarea { width: 100%; border: 1px solid #dfe1ea; border-radius: 8px; background: #fff; color: var(--ink); padding: 10px 12px; outline: none; transition: .18s; }
.input:focus, .select:focus, .textarea:focus { border-color: #aaa4ff; box-shadow: 0 0 0 4px rgba(108,99,255,.09); }
.textarea { min-height: 104px; resize: vertical; }
.help { color: var(--muted); font-size: 12px; margin-top: 6px; }
.form-row { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 16px; }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; min-width: 760px; }
.table th { color: #8a8f9e; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; text-align: left; background: #fbfbfd; border-bottom: 1px solid var(--line); padding: 12px 16px; white-space: nowrap; }
.table td { padding: 13px 16px; border-bottom: 1px solid #f0f1f5; vertical-align: middle; color: #525967; }
.table tr:hover td { background: #fcfcff; }
.table tr:last-child td { border-bottom: 0; }
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 5px 9px; border-radius: 999px; font-size: 11px; font-weight: 800; white-space: nowrap; }
.badge.active { color: #2b9d37; background: #eaf8eb; }
.badge.disabled { color: #cc4949; background: #fff0f0; }
.badge.expired { color: #ad7120; background: #fff6e5; }
.badge.role { color: var(--primary-strong); background: var(--primary-soft); }
.alert { border-radius: 8px; padding: 12px 14px; margin-bottom: 16px; border: 1px solid; }
.alert.success { color: #257c30; background: #eef9ef; border-color: #cceccd; }
.alert.error { color: #ae3737; background: #fff1f1; border-color: #ffd0d0; }
.alert.info { color: #336a96; background: #eef7ff; border-color: #cfe8ff; }
.empty { padding: 42px 20px; text-align: center; color: var(--muted); }
.kv { display: grid; grid-template-columns: 170px 1fr; gap: 10px 18px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 650; word-break: break-word; }
.code { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; background: #f4f4fb; border: 1px solid #e3e2f4; padding: 7px 9px; border-radius: 6px; word-break: break-all; }
.progress { height: 8px; border-radius: 999px; background: #ececf4; overflow: hidden; }
.progress > span { display: block; height: 100%; background: linear-gradient(90deg, var(--primary), #8e88ff); }
.chart-bars { height: 230px; display: flex; align-items: flex-end; gap: 18px; padding: 18px 8px 0; border-bottom: 1px solid var(--line); background-image: linear-gradient(to top, #f1f1f6 1px, transparent 1px); background-size: 100% 25%; }
.chart-col { flex: 1; min-width: 28px; display: flex; align-items: center; justify-content: flex-end; flex-direction: column; gap: 8px; height: 100%; }
.chart-bar { width: min(32px, 65%); min-height: 4px; border-radius: 7px 7px 2px 2px; background: linear-gradient(180deg, #8b83ff, var(--primary)); box-shadow: 0 6px 13px rgba(108,99,255,.18); }
.chart-label { font-size: 11px; color: var(--muted); }
.donut { --p: 78; width: 150px; height: 150px; border-radius: 50%; background: conic-gradient(var(--primary) calc(var(--p)*1%), #ececf6 0); display: grid; place-items: center; margin: 14px auto; position: relative; }
.donut::after { content:""; width: 112px; height: 112px; background: #fff; border-radius: 50%; position:absolute; }
.donut-label { position: relative; z-index: 2; text-align: center; font-weight: 800; font-size: 23px; }
.donut-label small { display:block; color:var(--muted); font-size:12px; font-weight:600; margin-top:2px; }
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at 12% 8%, #e9e7ff 0, transparent 32%), radial-gradient(circle at 90% 88%, #e7f9ff 0, transparent 28%), var(--bg); }
.login-card { width: min(430px, 100%); background:#fff; border:1px solid var(--line); box-shadow: 0 22px 60px rgba(41,45,62,.13); border-radius: 14px; padding: 30px; }
.login-brand { display:flex; align-items:center; justify-content:center; gap:10px; margin-bottom:22px; font-size:22px; font-weight:850; }
.login-title { margin: 0; text-align:center; font-size:25px; }
.login-subtitle { text-align:center; color:var(--muted); margin:8px 0 24px; }
.password-wrap { position:relative; }
.password-wrap .input { padding-right:65px; }
.password-toggle { position:absolute; right:8px; top:7px; border:0; background:#f4f4fa; border-radius:6px; padding:5px 8px; color:#626878; font-size:12px; }
.impersonation { background:#fff4cf; color:#765b00; border-bottom:1px solid #f0da8f; padding:8px 24px; display:flex; align-items:center; justify-content:center; gap:12px; font-size:12px; }
.footer { text-align:center; color:#a0a4b0; padding:20px 24px 28px; font-size:12px; }
.installer-wrap { max-width: 980px; margin: 0 auto; padding: 32px 20px; }
.installer-head { display:flex; align-items:center; gap:12px; margin-bottom:22px; }
.check-list { display:grid; gap:8px; }
.check-row { display:flex; justify-content:space-between; border-bottom:1px solid var(--line); padding:9px 0; }
.text-muted { color: var(--muted); }
.text-danger { color: var(--danger); }
.text-success { color: #2a9b39; }
.text-right { text-align: right; }
.mt-0 { margin-top:0; } .mt-1{margin-top:6px}.mt-2{margin-top:12px}.mt-3{margin-top:18px}.mb-0{margin-bottom:0}.mb-2{margin-bottom:12px}.w-full{width:100%}
@media (max-width: 1100px) { .grid-4 { grid-template-columns: repeat(2,minmax(0,1fr)); } .grid-3 { grid-template-columns: repeat(2,minmax(0,1fr)); } }
@media (max-width: 860px) {
  .sidebar { transform: translateX(-105%); box-shadow: 20px 0 40px rgba(21,23,34,.16); }
  .sidebar.is-open { transform: translateX(0); }
  .sidebar-overlay.is-open { display:block; }
  .main { margin-left:0; }
  .mobile-only { display:grid; }
  .content { padding:18px; }
  .topbar { padding:0 14px; }
  .hero-copy { max-width:75%; }
  .grid-2, .grid-3 { grid-template-columns:1fr; }
}
@media (max-width: 620px) {
  .grid-4 { grid-template-columns:1fr; }
  .form-row { grid-template-columns:1fr; gap:0; }
  .page-head { flex-direction:column; }
  .page-head .actions { width:100%; }
  .page-head .btn { flex:1; }
  .content { padding:14px; }
  .card-body { padding:16px; }
  .hero-art { opacity:.28; right:-15px; }
  .hero-copy { max-width:100%; }
  .kv { grid-template-columns:1fr; gap:4px; }
  .kv dd { margin-bottom:9px; }
  .login-card { padding:24px 20px; }
}
@media (max-width: 860px) {
  .grid > [style*="grid-column:span 2"],
  .grid > [style*="grid-column: span 2"] { grid-column: span 1 !important; }
}
