:root {
  --navy: #1f3864;
  --blue: #2e75b6;
  --bg: #f4f6fb;
  --sidebar-w: 250px;
}

* { box-sizing: border-box; }
body { background: var(--bg); font-family: 'Segoe UI', system-ui, -apple-system, sans-serif; }

/* ===== Sidebar ===== */
.app-wrapper { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar-w); background: linear-gradient(180deg, #1f3864, #14243f);
  color: #fff; display: flex; flex-direction: column; position: fixed; top: 0; bottom: 0; left: 0; z-index: 100;
}
.sidebar-brand {
  display: flex; align-items: center; gap: 12px; padding: 20px 22px; border-bottom: 1px solid rgba(255,255,255,.12);
}
.sidebar-brand i { font-size: 30px; color: #6cc2ff; }
.sidebar-brand strong { display: block; font-size: 18px; letter-spacing: .5px; }
.sidebar-brand span { font-size: 12px; color: #9fb6d8; }
.sidebar-nav { flex: 1; padding: 16px 12px; display: flex; flex-direction: column; gap: 4px; }
.sidebar-nav a {
  color: #cfdbee; text-decoration: none; padding: 11px 14px; border-radius: 8px; display: flex; align-items: center; gap: 10px;
  transition: .15s;
}
.sidebar-nav a i { font-size: 17px; }
.sidebar-nav a:hover { background: rgba(255,255,255,.08); color: #fff; }
.sidebar-nav a.active { background: var(--blue); color: #fff; }
.sidebar-footer { padding: 16px; border-top: 1px solid rgba(255,255,255,.12); }
.user-chip { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.user-chip i { font-size: 26px; color: #6cc2ff; }
.user-chip strong { display: block; font-size: 13px; }
.user-chip span { font-size: 11px; color: #9fb6d8; }

/* ===== Main ===== */
.main-content { flex: 1; margin-left: var(--sidebar-w); padding: 26px 30px; min-width: 0; }
.topbar { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.page-head { margin-bottom: 20px; }
.page-head h1 { font-size: 24px; font-weight: 700; color: var(--navy); margin-bottom: 2px; }

.flash-wrap { margin-bottom: 16px; }
.flash-wrap .alert { margin-bottom: 8px; }

/* ===== Cards ===== */
.panel { border: none; border-radius: 14px; box-shadow: 0 1px 3px rgba(20,36,63,.08); overflow: hidden; }
.panel-head { padding: 15px 20px; font-weight: 700; color: var(--navy); border-bottom: 1px solid #eef1f7; }
.panel-body { padding: 20px; }

.stat-card {
  background: #fff; border-radius: 14px; padding: 18px; display: flex; align-items: center; gap: 14px;
  box-shadow: 0 1px 3px rgba(20,36,63,.08); height: 100%;
}
.stat-card .icon {
  width: 52px; height: 52px; border-radius: 12px; display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 24px; flex-shrink: 0;
}
.bg-blue { background: var(--blue); }
.bg-green { background: #16a34a; }
.bg-orange { background: #f59e0b; }
.bg-red { background: #ef4444; }
.bg-teal { background: #00a88a; }
.stat-card .value { font-size: 26px; font-weight: 800; color: var(--navy); line-height: 1; }
.stat-card .label { font-size: 12.5px; color: #6b7280; }

/* ===== Tables ===== */
.table thead th { background: #eef2f9; color: var(--navy); font-size: 12.5px; text-transform: uppercase; letter-spacing: .3px; }
.table td { font-size: 14px; }

/* ===== Login ===== */
.login-body { display: flex; align-items: center; justify-content: center; min-height: 100vh;
  background: linear-gradient(135deg, #1f3864 0%, #2e75b6 100%); }
.login-card { background: #fff; border-radius: 18px; padding: 40px; width: 100%; max-width: 400px;
  box-shadow: 0 20px 50px rgba(0,0,0,.25); text-align: center; }
.login-logo i { font-size: 52px; color: var(--blue); }
.login-card h1 { font-size: 24px; color: var(--navy); margin: 12px 0 4px; }
.login-card h1 span { color: var(--blue); }
.login-card form { text-align: left; margin-top: 24px; }
.login-demo { margin-top: 20px; }
.login-demo code { background: #eef2f9; padding: 2px 6px; border-radius: 4px; }

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); transition: .25s; }
  .sidebar.show { transform: translateX(0); }
  .main-content { margin-left: 0; padding: 18px 16px; }
  .page-head h1 { font-size: 20px; }
}
