:root{
  --bg:#f4f6fb;
  --sidebar:#0f1f35;
  --sidebar2:#122b4a;
  --blue:#2563eb;
  --text:#0f172a;
  --muted:#64748b;
  --card:#ffffff;
  --border:#e2e8f0;
}
*{box-sizing:border-box}
body{margin:0;font-family:Arial,Helvetica,sans-serif;background:var(--bg);color:var(--text)}
.login-page{min-height:100vh;display:flex;align-items:center;justify-content:center;padding:30px}
.login-card{width:420px;background:white;border-radius:20px;padding:30px;box-shadow:0 20px 60px rgba(15,23,42,.12)}
.login-card h1{margin:0 0 8px;font-size:30px}
.login-card p{margin:0 0 24px;color:var(--muted)}
.input{width:100%;padding:13px 14px;border:1px solid var(--border);border-radius:12px;margin-bottom:14px;font-size:15px}
.btn{border:0;border-radius:12px;padding:12px 16px;font-weight:700;cursor:pointer;text-decoration:none;display:inline-flex;align-items:center;gap:8px}
.btn-primary{background:var(--blue);color:white;width:100%;justify-content:center}
.error{background:#fee2e2;color:#991b1b;border:1px solid #fecaca;padding:10px;border-radius:12px;margin-bottom:14px}
.langs{display:flex;gap:8px;margin-bottom:16px}
.langs a{padding:7px 10px;border-radius:10px;text-decoration:none;background:#eef2ff;color:#1e3a8a;font-weight:700}
.app{display:flex;min-height:100vh}
.sidebar{width:260px;background:linear-gradient(180deg,var(--sidebar),var(--sidebar2));color:white;padding:18px 14px;position:fixed;top:0;bottom:0;left:0}
.brand{font-size:22px;font-weight:800;padding:14px 12px;margin-bottom:16px}
.nav a{display:flex;align-items:center;gap:10px;color:#dbeafe;text-decoration:none;padding:12px;border-radius:12px;margin-bottom:6px;font-weight:700}
.nav a.active,.nav a:hover{background:#2563eb;color:white}
.main{margin-left:260px;width:calc(100% - 260px)}
.topbar{height:70px;background:white;border-bottom:1px solid var(--border);display:flex;align-items:center;justify-content:space-between;padding:0 24px}
.content{padding:24px}
.card{background:white;border:1px solid var(--border);border-radius:18px;padding:22px;box-shadow:0 8px 24px rgba(15,23,42,.06)}
.grid{display:grid;grid-template-columns:repeat(4,1fr);gap:16px;margin-top:18px}
.kpi{background:white;border:1px solid var(--border);border-radius:18px;padding:18px}
.kpi b{font-size:26px}
.kpi span{display:block;color:var(--muted);margin-top:8px}
.badge{background:#dcfce7;color:#166534;padding:7px 10px;border-radius:999px;font-weight:800}
.top-actions{display:flex;align-items:center;gap:10px}
.select{padding:10px 12px;border:1px solid var(--border);border-radius:12px;background:white}
.logout{color:#dc2626;text-decoration:none;font-weight:800}

.typeahead-wrap{position:relative}
.typeahead-list{
  display:none;
  position:absolute;
  left:0;
  right:0;
  top:50px;
  background:white;
  border:1px solid var(--border);
  border-radius:14px;
  box-shadow:0 14px 40px rgba(15,23,42,.14);
  overflow:hidden;
  z-index:20;
}
.typeahead-item{
  padding:12px 14px;
  cursor:pointer;
  font-weight:700;
}
.typeahead-item:hover,
.typeahead-item.active{
  background:#eef2ff;
  color:#1d4ed8;
}

.toolbar{display:flex;flex-wrap:wrap;gap:8px;margin-bottom:14px;align-items:center}
.toolbar .btn{background:#eef2ff;color:#1e3a8a;border:1px solid #dbeafe}
.toolbar .danger{background:#fee2e2;color:#991b1b;border:1px solid #fecaca}
.toolbar .danger2{background:#7f1d1d;color:white;border:1px solid #7f1d1d}
.finder{padding:11px 12px;border:1px solid var(--border);border-radius:12px;min-width:260px;margin-left:auto}
.table-wrap{overflow:auto;border:1px solid var(--border);border-radius:14px;max-height:68vh;background:white}
.excel-table{border-collapse:collapse;width:100%;min-width:1300px;font-size:14px}
.excel-table th{position:sticky;top:0;background:#0f1f35;color:white;z-index:2}
.excel-table th,.excel-table td{border:1px solid #dbe3ef;padding:8px;min-width:110px}
.excel-table td{background:white}
.excel-table tr:hover td{background:#f8fafc}
.excel-table td[contenteditable="true"]:focus{outline:2px solid #2563eb;background:#eff6ff}
.excel-table th:first-child,.excel-table td:first-child{min-width:45px;text-align:center}

/* SIDEBAR SCROLL FIX */
.sidebar{
  height:100vh;
  overflow-y:auto;
  overflow-x:hidden;
}
.sidebar::-webkit-scrollbar{
  width:6px;
}
.sidebar::-webkit-scrollbar-thumb{
  background:rgba(255,255,255,.25);
  border-radius:10px;
}

/* GLOBAL SIDEBAR FINAL SCROLL */
.sidebar{
  height:100vh !important;
  overflow-y:auto !important;
  overflow-x:hidden !important;
}
.nav{
  padding-bottom:40px !important;
}

/* SIDEBAR REAL SCROLL FINAL */
html, body {
  height: 100%;
}

.app {
  height: 100vh;
  overflow: hidden;
}

.sidebar {
  height: 100vh !important;
  max-height: 100vh !important;
  overflow-y: scroll !important;
  overflow-x: hidden !important;
  flex-shrink: 0 !important;
}

.sidebar .nav {
  display: flex !important;
  flex-direction: column !important;
  padding-bottom: 120px !important;
}

.main {
  height: 100vh;
  overflow-y: auto;
}


/* === W2026 SIDEBAR SCROLL FIX === */
.sidebar,
.side-bar,
aside.sidebar,
aside[class*="sidebar"],
.layout-sidebar,
nav.sidebar {
  max-height: 100vh !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  scrollbar-width: thin;
}

.sidebar nav,
.side-bar nav,
aside.sidebar nav,
aside[class*="sidebar"] nav {
  padding-bottom: 80px !important;
}

.sidebar::-webkit-scrollbar,
.side-bar::-webkit-scrollbar,
aside.sidebar::-webkit-scrollbar,
aside[class*="sidebar"]::-webkit-scrollbar {
  width: 8px;
}

.sidebar::-webkit-scrollbar-thumb,
.side-bar::-webkit-scrollbar-thumb,
aside.sidebar::-webkit-scrollbar-thumb,
aside[class*="sidebar"]::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.55);
  border-radius: 10px;
}

