:root{
  --brand:#0f172a;
  --brand2:#020617;
  --accent:#16a34a;
  --bg:#f3f4f6;
  --b:#e5e7eb;
  --mut:#6b7280;
  --card:#fff;
}

*{box-sizing:border-box;}
html,body{max-width:100%;overflow-x:hidden;}
body{
  margin:0;
  font-family:system-ui,Segoe UI,Roboto,Arial;
  background:var(--bg);
  color:#111827;
}

.app{display:flex;min-height:100vh;align-items:stretch;}
main,.main,.app-main{flex:1;min-width:0;display:flex;flex-direction:column;}
.content,.main-content{padding:16px 18px 32px;max-width:1200px;}
.content{width:100%;}

/* ===== Sidebar base (kept for compatibility; final layer lives in partials/sidebar.php) ===== */
.sidebar{
  width:260px; min-width:260px; max-width:260px;
  background:var(--brand2);
  color:#e5e7eb;
  display:flex;
  flex-direction:column;
  padding:16px 14px;
  position:sticky;
  top:0;
  height:100vh;
  z-index:50;
}
.side-brand{
  display:flex;
  align-items:center;
  gap:12px;
  padding:10px 12px;
  margin-bottom:18px;
}
.side-brand img{
  height:54px;width:54px;max-width:54px;max-height:54px;
  object-fit:contain;display:block;
}
.side-title{font-weight:800;font-size:18px;line-height:1;}
.side-sub{font-size:12px;color:#9ca3af;margin-top:2px;}

.nav-sec{
  font-size:11px;
  color:#9ca3af;
  padding:10px 12px 6px;
  text-transform:uppercase;
  letter-spacing:.06em;
}

.sidebar-nav{list-style:none;padding:0;margin:0;}
.sidebar-nav li{margin-bottom:6px;}
.sidebar-nav a{
  display:flex;
  align-items:center;
  gap:10px;
  padding:9px 10px;
  border-radius:12px;
  font-size:13px;
  color:#e5e7eb;
  text-decoration:none;
  border:1px solid transparent;
}
.sidebar-nav a .icon{width:18px;text-align:center;opacity:.9;}
.sidebar-nav a:hover{background:rgba(255,255,255,.08);}
.sidebar-nav a.active{
  background:rgba(22,163,74,.18);
  border:1px solid rgba(22,163,74,.35);
  color:#ecfdf3;
}

.sidebar-footer{
  margin-top:auto;
  font-size:11px;
  color:#9ca3af;
  padding:10px 12px 0;
}

/* ===== Main ===== */
.topbar{
  background:#fff;
  border-bottom:1px solid var(--b);
  padding:10px 18px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  position:sticky;
  top:0;
  z-index:10;
}
.topbar-left{display:flex;align-items:flex-start;gap:12px;min-width:0;}
.topbar-title{
  font-weight:800;
  font-size:16px;
  color:var(--brand);
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.topbar-sub{font-size:12px;color:var(--mut);}
.topbar-right{font-size:12px;color:var(--mut);}

.card{
  background:var(--card);
  border-radius:16px;
  box-shadow:0 10px 25px rgba(15,23,42,.08);
  border:1px solid var(--b);
  padding:14px;
  margin-bottom:16px;
}

.footer{text-align:center;font-size:12px;color:#6b7280;margin-top:18px;}

/* ===== Legacy mobile sidebar hooks ===== */
.hamb{
  display:none;
  border:1px solid var(--b);
  background:#fff;
  border-radius:10px;
  padding:8px 10px;
  cursor:pointer;
}
.overlay{
  display:none;
  position:fixed;
  inset:0;
  background:rgba(0,0,0,.35);
  z-index:40;
}

@media(max-width:980px){
  .hamb{display:inline-flex;align-items:center;gap:8px;}
  .sidebar{position:fixed;left:-280px;height:100vh;transition:.2s;}
  .sidebar.open{left:0;}
  .overlay.show{display:block;}
  .content,.main-content{padding:12px;}
}

.topbar{
    height:60px;
    background:#ffffff;
    border-bottom:1px solid #e6e6e6;
    display:flex;
    align-items:center;
    justify-content:space-between;
    padding:0 18px;
    position:sticky;
    top:0;
    z-index:900;
}

.topbar-left{
    display:flex;
    align-items:center;
    gap:14px;
}

.topbar-title{
    font-weight:700;
    font-size:16px;
}

.topbar-menu-btn{
    border:none;
    background:none;
    font-size:22px;
    cursor:pointer;
}

.topbar-right{
    display:flex;
    align-items:center;
}

.topbar-user{
    display:flex;
    align-items:center;
    gap:10px;
}

.topbar-avatar{
    width:34px;
    height:34px;
    border-radius:50%;
    background:#16a34a;
    color:white;
    display:flex;
    align-items:center;
    justify-content:center;
    font-weight:600;
}

.topbar-user-name{
    font-size:13px;
    font-weight:600;
}

.topbar-user-role{
    font-size:11px;
    color:#777;
}