*{ box-sizing:border-box; }
html,body{ margin:0; padding:0; font-family:system-ui, -apple-system, Segoe UI, Roboto, Arial; background:#f6f7fb; color:#111; }

.auth-wrap{
  min-height:100vh;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:24px;
}
.card{
  background:#fff;
  border:1px solid rgba(0,0,0,.08);
  border-radius:14px;
  padding:18px;
  box-shadow:0 12px 26px rgba(0,0,0,.08);
}
.h1{ margin:0 0 14px; font-size:22px; }
.h2{ margin:0 0 10px; font-size:18px; }
.p{ margin:0; line-height:1.6; color:#333; }

.label{ display:block; margin:10px 0 6px; font-weight:600; font-size:13px; }
.input{
  width:100%;
  padding:10px 12px;
  border-radius:10px;
  border:1px solid rgba(0,0,0,.18);
  outline:none;
}
.input:focus{ border-color: rgba(0,0,0,.45); }

.btn{
  display:inline-block;
  padding:10px 12px;
  border-radius:10px;
  border:1px solid rgba(0,0,0,.18);
  text-decoration:none;
  color:#111;
  background:#fff;
  cursor:pointer;
}
.btn.primary{
  width:100%;
  margin-top:12px;
  background:#145b31;
  color:#fff;
  border-color:#145b31;
}
.alert{
  background:#ffe8e8;
  border:1px solid #ffb3b3;
  color:#7a0000;
  padding:10px 12px;
  border-radius:10px;
  margin-bottom:12px;
}
.hint{ margin-top:12px; font-size:12px; color:#666; }

.topbar{
  position:sticky;
  top:0;
  z-index:10;
  background:#fff;
  border-bottom:1px solid rgba(0,0,0,.08);
  padding:12px 14px;
  display:flex;
  align-items:center;
  justify-content:space-between;
}
.brand{ font-weight:800; letter-spacing:.3px; }
.topbar-right{ display:flex; gap:10px; align-items:center; }
.user-pill{
  padding:8px 10px;
  border:1px solid rgba(0,0,0,.12);
  border-radius:999px;
  background:#fafafa;
  font-size:12px;
}

.layout{
  display:flex;
  min-height:calc(100vh - 56px);
}
.sidebar{
  width:240px;
  background:#ffffff;
  border-right:1px solid rgba(0,0,0,.08);
  padding:12px;
}
.nav-item{
  display:block;
  padding:10px 10px;
  border-radius:10px;
  margin-bottom:6px;
  text-decoration:none;
  color:#111;
  border:1px solid transparent;
}
.nav-item.active{ background:#e9f5ee; border-color:#cfe8da; }
.nav-item.muted{ opacity:.55; cursor:not-allowed; }
.nav-section-title{
  margin:14px 6px 8px;
  font-size:12px;
  font-weight:800;
  color:#444;
  opacity:.8;
}
.content{
  flex:1;
  padding:16px;
}
.grid{
  display:grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap:12px;
  margin-bottom:12px;
}
.kpi-title{ font-size:12px; color:#666; font-weight:700; margin-bottom:8px; }
.kpi-value{ font-size:18px; font-weight:900; }

.footer{
  padding:14px;
  color:#666;
  font-size:12px;
}

/* Responsive */
@media (max-width: 900px){
  .sidebar{ display:none; }
  .grid{ grid-template-columns: 1fr; }
}

/* Topbar left group */
.topbar-left{
  display:flex;
  align-items:center;
  gap:10px;
}

/* Menu button */
.icon-btn{
  width:40px;
  height:40px;
  border-radius:10px;
  border:1px solid rgba(0,0,0,.14);
  background:#fff;
  cursor:pointer;
  font-size:18px;
  line-height:1;
  display:none; /* desktop hidden */
}

/* Mobile sidebar drawer + overlay */
@media (max-width: 900px){
  .icon-btn{ display:inline-flex; align-items:center; justify-content:center; }

  .sidebar{
    display:block;              /* was none */
    position:fixed;
    top:0;
    left:0;
    height:100vh;
    width:260px;
    z-index:9999;
    transform:translateX(-110%);
    transition:transform .18s ease;
    box-shadow: 18px 0 40px rgba(0,0,0,.18);
  }

  /* overlay */
  html.sidebar-open::before{
    content:"";
    position:fixed;
    inset:0;
    background:rgba(0,0,0,.35);
    z-index:9998;
  }

  html.sidebar-open .sidebar{
    transform:translateX(0);
  }

  /* When overlay clicked -> close (simple) */
  html.sidebar-open body{
    overflow:hidden;
  }

  .layout{ min-height:calc(100vh - 56px); }
}