:root{
  --bg:#f5f7fb;
  --card:#ffffff;
  --text:#0f172a;
  --muted:#64748b;
  --primary:#4f46e5;
  --border:#e5e7eb;
  --shadow: 0 10px 30px rgba(15,23,42,.08);
  --shadow2: 0 18px 40px rgba(15,23,42,.10);
}

*{box-sizing:border-box}
body{margin:0;font-family:ui-sans-serif,system-ui,-apple-system,Segoe UI,Roboto;color:var(--text)}
.bg{background:var(--bg);min-height:100vh;display:flex;align-items:center;justify-content:center}

.app{display:flex;min-height:100vh;background:var(--bg)}
.sidebar{width:270px;background:var(--card);border-right:1px solid var(--border);padding:18px;display:flex;flex-direction:column}
.logo{display:flex;gap:10px;align-items:center;margin-bottom:14px}
.logoMark{width:36px;height:36px;border-radius:12px;background:#eef2ff;display:flex;align-items:center;justify-content:center}
.logoTitle{font-weight:900;letter-spacing:.2px}
.logoSub{font-size:12px;color:var(--muted);margin-top:2px}

.sidebar nav a{display:block;padding:10px 10px;border-radius:10px;color:var(--text);text-decoration:none;margin:2px 0;font-weight:700;font-size:13px}
.sidebar nav a.active, .sidebar nav a:hover{background:#eef2ff;color:#1e1b4b}
.sidebar-bottom{margin-top:auto;display:flex;flex-direction:column;gap:10px}
.me{border:1px solid var(--border);border-radius:14px;padding:10px;background:#fbfcff}
.meName{font-weight:900}
.meRole{font-size:12px;color:var(--muted);font-weight:800;margin-top:2px}

.main{flex:1;padding:22px}
.topbar{display:flex;align-items:flex-start;justify-content:space-between;margin-bottom:16px;gap:12px}
.h1{font-size:22px;font-weight:900}
.muted{color:var(--muted);font-size:13px}
.actions{display:flex;gap:10px;align-items:center;flex-wrap:wrap}
.actions .btn{background:var(--card);border:1px solid var(--border);padding:10px 12px;border-radius:12px;cursor:pointer;box-shadow:var(--shadow);display:inline-block;font-weight:800;font-size:13px}
.primary{background:var(--primary);color:white;border:0;padding:10px 14px;border-radius:12px;cursor:pointer;font-weight:900}

.panel{background:var(--card);border:1px solid var(--border);border-radius:16px;box-shadow:var(--shadow);padding:14px}
.filters{display:flex;gap:10px;align-items:end;flex-wrap:wrap;padding:10px}
.label{font-size:11px;color:var(--muted);margin-bottom:6px;font-weight:900;letter-spacing:.3px}
select,input,textarea{border:1px solid var(--border);border-radius:12px;padding:10px 12px;min-width:220px;background:white;font-weight:700}
textarea{min-width:320px}
button.ghost{background:transparent;border:1px solid var(--border);padding:10px 12px;border-radius:12px;cursor:pointer;font-weight:900}
button.small{padding:8px 10px;border-radius:10px;font-size:12px}

.kpis{display:grid;grid-template-columns:repeat(4,minmax(170px,1fr));gap:10px;padding:10px}
.kpi{border:1px solid var(--border);border-radius:14px;padding:12px}
.kpiTitle{font-size:11px;color:var(--muted);font-weight:900;letter-spacing:.3px}
.kpiVal{font-size:18px;font-weight:900;margin-top:6px}

.table{width:100%;border-collapse:separate;border-spacing:0 8px;padding:10px}
.table th{font-size:11px;text-align:left;color:var(--muted);padding:8px 10px;font-weight:900;letter-spacing:.3px}
.table td{background:#fbfcff;border-top:1px solid var(--border);border-bottom:1px solid var(--border);padding:10px;vertical-align:top}
.table tr td:first-child{border-left:1px solid var(--border);border-top-left-radius:12px;border-bottom-left-radius:12px}
.table tr td:last-child{border-right:1px solid var(--border);border-top-right-radius:12px;border-bottom-right-radius:12px}
.table td .muted{font-size:12px}

.tag{display:inline-block;padding:6px 10px;border-radius:999px;font-size:12px;font-weight:900}
.tag.ok{background:#ecfdf5;color:#065f46;border:1px solid #a7f3d0}
.tag.warn{background:#fff7ed;color:#9a3412;border:1px solid #fed7aa}

.toast{position:fixed;right:18px;bottom:18px;background:#0f172a;color:white;padding:10px 12px;border-radius:12px;box-shadow:var(--shadow2);z-index:9999;font-weight:800}
.busy{
  position:fixed;inset:0;background:rgba(15,23,42,.25);
  display:none;align-items:center;justify-content:center;z-index:9998;
}
.busyCard{
  background:var(--card);border:1px solid var(--border);border-radius:16px;box-shadow:var(--shadow2);
  padding:16px 18px;min-width:320px;font-weight:900;
}
.busySub{margin-top:6px;color:var(--muted);font-size:13px;font-weight:800}

.login-card{width:380px;background:var(--card);border:1px solid var(--border);border-radius:16px;box-shadow:var(--shadow2);padding:18px;display:flex;flex-direction:column;gap:8px}
.brand{font-weight:900;font-size:22px}
.hint{color:var(--muted);font-size:12px;font-weight:700;margin-top:4px}
.error{color:#b91c1c;font-weight:900;font-size:13px;margin-top:6px}

@media (max-width: 980px){
  .sidebar{width:220px}
  select,input,textarea{min-width:180px}
  .kpis{grid-template-columns:repeat(2,minmax(160px,1fr))}
}
@media (max-width: 760px){
  .sidebar{display:none}
  .main{padding:14px}
  .kpis{grid-template-columns:1fr}
}
