:root{
  --bg: #f6f7fb;
  --card: #ffffff;
  --muted: #6b7280;
  --text: #0f172a;
  --brand: #1d4ed8;

  --red: #ef4444;
  --amber: #f59e0b;
  --green: #22c55e;

  --shadow: 0 10px 25px rgba(15,23,42,.08);
  --radius: 14px;
}

*{ box-sizing:border-box; }
body{
  margin:0;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

.app{ min-height:100vh; display:flex; }

/* Sidebar */
.sidebar{
  width: 300px;
  background:#eef0f4;
  border-right: 1px solid rgba(15,23,42,.08);
  padding: 18px 14px;
  display:flex;
  flex-direction:column;
}

.mp-logo-wrap{
  padding: 8px 10px 6px;
  border-radius: 12px;
  background: rgba(255,255,255,.65);
  border: 1px solid rgba(15,23,42,.06);
}
.mp-logo{
  width:100%;
  max-height: 44px;
  object-fit: contain;
  display:block;
}

.system-badge{
  padding: 12px 10px 10px;
}
.system-name{
  font-weight: 900;
  font-size: 34px;
  letter-spacing: -.03em;
  color: var(--brand);
  line-height: 1.05;
}
.system-sub{
  margin-top: 6px;
  font-weight: 700;
  font-size: 12px;
  color:#334155;
  opacity:.9;
}
.system-org{
  margin-top: 6px;
  font-weight: 700;
  font-size: 12px;
  color:#111827;
  opacity:.75;
}

.menu-title{
  margin: 10px 10px 8px;
  font-weight:800;
  color:#111827;
  font-size:26px;
  opacity:.55;
}

.nav{ display:flex; flex-direction:column; gap:6px; padding: 6px; }
.nav-item{
  display:flex;
  gap:10px;
  align-items:center;
  padding: 12px 12px;
  border-radius: 10px;
  color:#111827;
  text-decoration:none;
  opacity:.82;
}
.nav-item:hover{ background: rgba(29,78,216,.08); opacity:1; }
.nav-item.active{
  background:#fff;
  box-shadow: 0 2px 10px rgba(15,23,42,.06);
  border: 1px solid rgba(15,23,42,.06);
  opacity:1;
}
.nav-ico{ width:26px; display:inline-flex; justify-content:center; }

.sidebar-footer{
  margin-top:auto;
  padding: 12px 10px 4px;
  color:#64748b;
  font-size: 12px;
}
.sidebar-footer-line{ line-height: 1.4; }

/* Main + topbar */
.main{ flex:1; display:flex; flex-direction:column; }
.topbar{
  height:64px;
  background:#fff;
  border-bottom: 1px solid rgba(15,23,42,.06);
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding: 0 18px;
}
.topbar-left{ display:flex; align-items:center; gap:12px; }
.topbar-logo{
  width: 340px;
  background: transparent;
  border: none;
  padding: 0;
}
.topbar-right{ display:flex; align-items:center; gap:10px; }

.icon-btn{
  width:36px;height:36px;border-radius:10px;
  border:1px solid rgba(15,23,42,.08);
  background:#fff;
  cursor:pointer;
}

.user-chip{
  display:flex;
  align-items:center;
  gap:10px;
  padding: 6px 10px;
  border-radius: 999px;
  border:1px solid rgba(15,23,42,.08);
  background:#fff;
}
.user-chip-name{ font-weight:700; color:#111827; }
.user-chip-avatar{
  width:28px;height:28px;border-radius:999px;
  background:#cbd5e1;
}

/* Content */
.content{ padding: 26px 26px 60px; }

.welcome{
  display:flex;
  gap:18px;
  align-items:flex-start;
  margin-bottom: 18px;
}

.avatar-lg{
  width:78px;height:78px;border-radius:999px;
  background:#cbd5e1;
  flex:0 0 auto;
  box-shadow: 0 6px 18px rgba(15,23,42,.10);
}

.kicker{
  font-weight:800;
  color:#64748b;
  letter-spacing:.02em;
  font-size: 12px;
  text-transform: uppercase;
}

.welcome-text h1{
  margin: 6px 0 6px;
  font-size: 34px;
  color: var(--brand);
  letter-spacing: -.02em;
}

.subtitle{
  margin: 0 0 14px;
  color: var(--muted);
}

.section-title{
  display:flex; align-items:center; gap:10px;
  font-weight:900;
  font-size: 28px;
  color: var(--brand);
}
.section-ico{
  display:inline-flex;
  width:34px;height:34px;border-radius:10px;
  align-items:center; justify-content:center;
  border:1px solid rgba(29,78,216,.18);
  background: rgba(29,78,216,.06);
}
.divider{
  height:2px;
  background: rgba(29,78,216,.22);
  margin-top: 10px;
}

/* Panel */
.panel{
  position:relative;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
  border: 1px solid rgba(15,23,42,.06);
}

.panel-head{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.panel-title{
  margin:0;
  font-size: 26px;
  color: var(--brand);
}
.panel-caption{
  color:#64748b;
  font-weight:700;
  font-size: 12px;
}

/* Layout grid */
.grid{
  display:grid;
  grid-template-columns: 1.4fr .9fr;
  gap: 18px;
  align-items: stretch;
}

/* KPI cards */
.kpis{
  display:grid;
  grid-template-columns: repeat(3, minmax(200px, 1fr));
  gap: 16px;
}
.kpi{
  background:#f8fafc;
  border: 1px solid rgba(15,23,42,.06);
  border-radius: 14px;
  padding: 16px 16px 14px;
  box-shadow: 0 8px 18px rgba(15,23,42,.06);
}
.kpi-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  margin-bottom: 12px;
}
.kpi-label{ font-weight:800; }
.kpi-arrow{ color:#ef4444; font-weight:900; }
.kpi-value{
  font-weight:900;
  font-size: 58px;
  letter-spacing: -.03em;
  line-height: 1;
}
.kpi-foot{
  margin-top: 10px;
  color:#94a3b8;
  font-weight:800;
  font-size: 12px;
}

/* Donut */
.donut-card{
  background:#fff;
  border-radius: 14px;
  border: 1px solid rgba(15,23,42,.06);
  box-shadow: 0 8px 18px rgba(15,23,42,.06);
  padding: 16px;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap: 12px;
}
.donut-wrap{
  position:relative;
  width: 260px;
  height: 260px;
  display:grid;
  place-items:center;
}
.donut-center{
  position:absolute;
  text-align:center;
  pointer-events:none;
}
.donut-center-label{
  color:#6b7280;
  font-weight:800;
  font-size: 13px;
}
.donut-center-value{
  font-weight:900;
  font-size: 44px;
  color:#9ca3af;
}

.legend{
  display:flex;
  gap: 16px;
  font-weight:700;
  color:#6b7280;
}
.legend-item{ display:flex; align-items:center; gap:8px; }
.dot{ width:10px;height:10px;border-radius:999px; display:inline-block; }
.dot-red{ background: var(--red); }
.dot-amber{ background: var(--amber); }
.dot-green{ background: var(--green); }

/* Color helpers */
.kpi-red{ color: var(--red); }
.kpi-amber{ color: var(--amber); }
.kpi-green{ color: var(--green); }

/* Floating button */
.fab{
  position:absolute;
  right: 18px;
  top: 120px;
  width: 56px;
  height: 56px;
  border-radius: 999px;
  border: 3px solid #1e3a8a;
  background: #1d4ed8;
  color:#fff;
  font-size: 22px;
  cursor:pointer;
  box-shadow: 0 12px 22px rgba(15,23,42,.18);
}

/* Panel footer */
.panel-footer{
  margin-top: 18px;
  padding-top: 12px;
  border-top: 1px dashed rgba(15,23,42,.10);
  color:#64748b;
  font-weight:700;
  font-size: 12px;
  display:flex;
  gap:10px;
  align-items:center;
}
.dot-sep{ opacity:.6; }

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