:root{
  --bg: #f4f6fb;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #64748b;

  --sidebar: #0b1f3a;
  --sidebar-2: #0a1a31;
  --sidebar-text: #cbd5e1;

  --accent: #22c55e;
  --accent-2: #38bdf8;
  --border: #e2e8f0;
  --shadow: 0 12px 30px rgba(15, 23, 42, .08);
}

*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, "Noto Sans", "Apple Color Emoji","Segoe UI Emoji";
  color: var(--text);
  background: var(--bg);
}

.app{
  height:100vh;
  display:grid;
  grid-template-columns: 260px 1fr;
}

/* Sidebar */
.sidebar{
  background: linear-gradient(180deg, var(--sidebar), var(--sidebar-2));
  color: var(--sidebar-text);
  padding: 18px 14px;
  display:flex;
  flex-direction:column;
  gap:18px;
}

.brand{
  display:flex;
  align-items:center;
  gap:10px;
  padding: 8px 10px;
}
.brand-dot{
  width:14px; height:14px; border-radius:6px;
  background: var(--accent);
  box-shadow: 0 0 0 6px rgba(34,197,94,.12);
}
.brand-title{ font-weight:700; letter-spacing:.3px; }

.menu{ display:flex; flex-direction:column; gap:6px; }

.menu-item{
  width:100%;
  border:1px solid rgba(148,163,184,.12);
  background: rgba(255,255,255,.03);
  color: var(--sidebar-text);
  padding: 10px 12px;
  border-radius: 12px;
  display:flex;
  align-items:center;
  gap:10px;
  cursor:pointer;
  transition: transform .06s ease, background .14s ease, border-color .14s ease, color .14s ease;
  text-align:left;
}

.menu-item:hover{
  background: rgba(56,189,248,.10);
  border-color: rgba(56,189,248,.35);
}

.menu-item:active{ transform: translateY(1px); }

.menu-item.active{
  background: rgba(34,197,94,.12);
  border-color: rgba(34,197,94,.45);
  color: #eafff2;
  position:relative;
}
.menu-item.active::before{
  content:"";
  position:absolute;
  left:-6px; top:10px; bottom:10px;
  width:3px;
  border-radius: 4px;
  background: var(--accent);
}

.menu-icon{ width:22px; display:inline-flex; justify-content:center; }
.menu-text{ font-weight:600; }

.sidebar-footer{
  margin-top:auto;
  padding: 8px 10px;
  opacity:.85;
}
.mini{ font-size:12px; color: rgba(203,213,225,.8); }

/* Main */
.main{
  display:flex;
  flex-direction:column;
  min-width:0;
}

.topbar{
  height:64px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding: 0 18px;
  border-bottom:1px solid var(--border);
  background: rgba(255,255,255,.75);
  backdrop-filter: blur(10px);
}

.breadcrumb{ color: var(--muted); }
.topbar-right{
  display:flex;
  align-items:center;
  gap:10px;
}

.search{
  width: 260px;
  padding: 10px 12px;
  border-radius: 12px;
  border:1px solid var(--border);
  outline:none;
  background:#fff;
}
.search:focus{ border-color: rgba(56,189,248,.6); box-shadow: 0 0 0 4px rgba(56,189,248,.15); }

.icon-btn{
  border:1px solid var(--border);
  background:#fff;
  border-radius: 12px;
  padding: 10px 12px;
  cursor:pointer;
}

.user-chip{
  display:flex;
  align-items:center;
  gap:10px;
  padding: 6px 10px;
  border:1px solid var(--border);
  background:#fff;
  border-radius: 999px;
}
.avatar{
  width:32px; height:32px;
  border-radius: 999px;
  display:grid; place-items:center;
  background: rgba(34,197,94,.12);
  border:1px solid rgba(34,197,94,.35);
  font-weight:700;
}
.user-name{ font-weight:700; font-size:14px; }

.content{
  padding: 18px;
  overflow:auto;
}
.content-inner{ min-width:0; }

/* Cards/Grid */
.grid{
  display:grid;
  grid-template-columns: repeat(12, 1fr);
  gap:14px;
}

.card{
  grid-column: span 4;
  background: var(--card);
  border:1px solid var(--border);
  border-radius: 16px;
  padding: 14px;
  box-shadow: var(--shadow);
  min-width:0;
}

.card-wide{ grid-column: span 8; }

.card-title{
  font-weight:800;
  margin-bottom:10px;
}

.metric{
  font-size: 28px;
  font-weight: 900;
  letter-spacing: .2px;
}

.muted{
  color: var(--muted);
  margin: 6px 0 0 0;
  font-size: 13px;
}

.chart-placeholder,
.donut-placeholder{
  height: 180px;
  border-radius: 14px;
  border:1px dashed #cbd5e1;
  display:grid;
  place-items:center;
  color: var(--muted);
  background: rgba(2,6,23,.02);
}

.table{ display:flex; flex-direction:column; gap:10px; }
.row{
  display:grid;
  grid-template-columns: 1fr 180px 200px;
  gap:10px;
  align-items:center;
  font-size: 13px;
}
.row.header{ color: var(--muted); font-weight:700; }

.bar{
  height: 10px;
  border-radius: 999px;
  background: rgba(2,6,23,.08);
  position:relative;
  overflow:hidden;
}
.bar::after{
  content:"";
  position:absolute; left:0; top:0; bottom:0;
  width:60%;
  background: rgba(34,197,94,.55);
}
.bar.b2::after{ width:40%; background: rgba(56,189,248,.55); }
.bar.b3::after{ width:28%; background: rgba(244,63,94,.45); }

/* Responsive */
@media (max-width: 1100px){
  .app{ grid-template-columns: 220px 1fr; }
  .search{ width: 180px; }
  .card{ grid-column: span 6; }
  .card-wide{ grid-column: span 12; }
}
@media (max-width: 780px){
  .app{ grid-template-columns: 1fr; }
  .sidebar{ position: sticky; top:0; z-index: 10; }
  .topbar{ position: sticky; top:0; z-index: 9; }
  .card{ grid-column: span 12; }
}
