:root {
  --sidebar-width: 250px;
  --sidebar-bg: #0f172a;
  --sidebar-text: #94a3b8;
  --sidebar-active: #3b82f6;
  --topbar-h: 60px;
  --accent-blue: #3b82f6;
  --accent-green: #22c55e;
  --accent-orange: #f97316;
  --accent-red: #ef4444;
  --accent-purple: #a855f7;
}

* { box-sizing: border-box; }
body { margin: 0; background: #f1f5f9; font-family: 'Segoe UI', system-ui, sans-serif; }

/* ── Sidebar ── */
.sidebar {
  position: fixed; top: 0; left: 0; height: 100vh;
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  display: flex; flex-direction: column;
  z-index: 1000; overflow-y: auto;
  transition: transform .25s ease;
}
.sidebar-header {
  display: flex; align-items: center; gap: 12px;
  padding: 20px 16px 16px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.sidebar-logo {
  width: 40px; height: 40px;
  background: var(--accent-blue);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 18px; flex-shrink: 0;
}
.brand-title { color: #f1f5f9; font-size: 15px; font-weight: 700; display: block; line-height: 1.2; }
.brand-sub   { color: var(--sidebar-text); font-size: 11px; }
.sidebar-nav { list-style: none; padding: 12px 10px; margin: 0; flex: 1; }
.sidebar-nav li { margin-bottom: 2px; }
.nav-section-label {
  color: #475569; font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 1px;
  padding: 14px 8px 4px;
}
.nav-link {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: 8px;
  color: var(--sidebar-text); text-decoration: none;
  font-size: 14px; transition: all .15s;
  position: relative;
}
.nav-link:hover { background: rgba(255,255,255,.07); color: #e2e8f0; }
.nav-link.active { background: var(--accent-blue); color: #fff; font-weight: 600; }
.nav-link i { font-size: 16px; flex-shrink: 0; }
.badge-count {
  margin-left: auto;
  background: #ef4444; color: #fff;
  border-radius: 10px; font-size: 11px; font-weight: 700;
  padding: 1px 7px;
}
.sidebar-footer {
  padding: 12px 16px;
  border-top: 1px solid rgba(255,255,255,.06);
}

/* ── Main wrapper ── */
.main-wrapper {
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  transition: margin-left .25s ease;
}

/* ── Topbar ── */
.topbar {
  height: var(--topbar-h);
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
  display: flex; align-items: center; gap: 16px;
  padding: 0 24px;
  position: sticky; top: 0; z-index: 100;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.topbar-left { flex: 1; }
.topbar-title { font-size: 15px; font-weight: 600; color: #1e293b; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.btn-icon {
  width: 36px; height: 36px; padding: 0;
  display: flex; align-items: center; justify-content: center;
  border-radius: 8px;
}
.sidebar-toggle { display: none; }

/* ── Flash ── */
.flash-container { padding: 12px 24px 0; }

/* ── Content ── */
.content { padding: 24px; }
.page-header {
  display: flex; justify-content: space-between; align-items: flex-start;
  margin-bottom: 24px; gap: 16px; flex-wrap: wrap;
}
.page-heading { font-size: 22px; font-weight: 700; color: #1e293b; margin: 0; }

/* ── Stat cards ── */
.stat-card {
  border-radius: 12px; padding: 20px;
  display: flex; flex-direction: column; gap: 8px;
  position: relative; overflow: hidden;
  box-shadow: 0 1px 4px rgba(0,0,0,.07);
}
.stat-blue   { background: linear-gradient(135deg, #eff6ff, #dbeafe); }
.stat-green  { background: linear-gradient(135deg, #f0fdf4, #dcfce7); }
.stat-orange { background: linear-gradient(135deg, #fff7ed, #fed7aa); }
.stat-red    { background: linear-gradient(135deg, #fef2f2, #fecaca); }
.stat-purple { background: linear-gradient(135deg, #faf5ff, #e9d5ff); }
.stat-icon { font-size: 24px; }
.stat-blue   .stat-icon { color: var(--accent-blue); }
.stat-green  .stat-icon { color: var(--accent-green); }
.stat-orange .stat-icon { color: var(--accent-orange); }
.stat-red    .stat-icon { color: var(--accent-red); }
.stat-purple .stat-icon { color: var(--accent-purple); }
.stat-value { font-size: 22px; font-weight: 700; color: #1e293b; }
.stat-label { font-size: 12px; color: #64748b; }

/* ── Cards ── */
.card { border: 1px solid #e2e8f0; border-radius: 12px; box-shadow: 0 1px 4px rgba(0,0,0,.05); }
.card-header {
  background: #f8fafc; border-bottom: 1px solid #e2e8f0;
  padding: 14px 20px; font-size: 14px;
  border-radius: 12px 12px 0 0 !important;
}
.card-body { padding: 20px; }

/* ── Tables ── */
.table > thead > tr > th {
  background: #f8fafc; font-size: 12px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .5px;
  color: #64748b; padding: 10px 16px;
}
.table > tbody > tr > td { padding: 12px 16px; vertical-align: middle; font-size: 14px; }
.table-hover > tbody > tr:hover { background: #f8fafc; }

/* ── Reminder items ── */
.reminder-item {
  padding: 12px 20px;
  border-bottom: 1px solid #f1f5f9;
}
.reminder-item:last-child { border-bottom: none; }
.reminder-today    { background: #fef2f2; border-left: 3px solid var(--accent-red); }
.reminder-tomorrow { background: #fffbeb; border-left: 3px solid #f59e0b; }

/* ── Notification items ── */
.notification-item {
  padding: 16px 20px;
  border-bottom: 1px solid #f1f5f9;
  transition: background .1s;
}
.notification-item:last-child { border-bottom: none; }
.notification-item.unread { background: #f0f9ff; border-left: 3px solid var(--accent-blue); }
.notif-icon {
  width: 36px; height: 36px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; flex-shrink: 0;
}
.icon-blue   { background: #dbeafe; color: var(--accent-blue); }
.icon-red    { background: #fee2e2; color: var(--accent-red); }
.icon-orange { background: #fed7aa; color: var(--accent-orange); }

/* ── User avatar ── */
.user-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--accent-blue); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; flex-shrink: 0;
}

/* ── SMS bubble ── */
.sms-bubble {
  background: #f0f9ff; border: 1px solid #bae6fd;
  border-radius: 12px; padding: 14px 16px;
  font-size: 14px; white-space: pre-wrap; line-height: 1.6;
  color: #0c4a6e;
}

/* ── Empty state ── */
.empty-state {
  text-align: center; padding: 40px 20px; color: #94a3b8;
}

/* ── Misc ── */
.btn-xs { padding: 2px 8px; font-size: 12px; border-radius: 4px; }
.font-monospace { font-family: 'Consolas', 'Monaco', monospace; }

/* ── Responsive ── */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-wrapper { margin-left: 0; }
  .sidebar-toggle { display: flex; }
  .content { padding: 16px; }
  .topbar { padding: 0 16px; }
}
