/* ============================================================
   PROJECT6 - DELEGATE (MA) APP DESIGN SYSTEM
   Palette: CC White/Dark Grey (#333333 / #1e293b), Red (#dc2626)
   Mobile-first, progressive enhancement
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
  --bg-primary: #f8fafc;
  --bg-secondary: #f1f5f9;
  --bg-card: rgba(255,255,255,0.92);
  --bg-glass-nav: rgba(255,255,255,0.95);
  --border-glass: rgba(0,0,0,0.07);
  --border-glass-glow: rgba(220,38,38,0.22);

  --text-main: #333333;
  --text-dark: #1e293b;
  --text-muted: #64748b;
  --text-dim: #94a3b8;

  --accent-red: #dc2626;
  --accent-red-hover: #b91c1c;
  --accent-red-subtle: rgba(220,38,38,0.08);
  --accent-red-border: rgba(220,38,38,0.2);

  --accent-blue: #2563eb;
  --accent-emerald: #16a34a;
  --accent-amber: #d97706;
  --accent-purple: #7c3aed;
  --accent-cyan: #0284c7;

  --grad-red: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
  --grad-dark: linear-gradient(135deg, #333333 0%, #1e293b 100%);
  --grad-emerald: linear-gradient(135deg, #16a34a 0%, #15803d 100%);
  --grad-blue: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  --grad-amber: linear-gradient(135deg, #d97706 0%, #b45309 100%);
  --grad-purple: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);

  --blur: 16px;
  --bottom-nav-height: 68px;
  --topbar-height: 60px;
  --radius-lg: 16px;
  --radius-md: 10px;
  --radius-sm: 6px;

  --shadow-sm: 0 2px 8px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 20px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.10);
  --shadow-glow: 0 0 20px rgba(220,38,38,0.18);
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background-color: var(--bg-primary);
  background-image:
    radial-gradient(at 0% 0%, rgba(220,38,38,0.04) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(37,99,235,0.04) 0px, transparent 50%);
  background-attachment: fixed;
  color: var(--text-main);
  min-height: 100vh;
  line-height: 1.5;
  overflow-x: hidden;
  padding-bottom: var(--bottom-nav-height);
}

/* ---- TOPBAR ---- */
.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--topbar-height);
  background: var(--bg-glass-nav);
  backdrop-filter: blur(var(--blur));
  -webkit-backdrop-filter: blur(var(--blur));
  border-bottom: 1px solid var(--border-glass);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  z-index: 200;
  box-shadow: var(--shadow-sm);
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar-brand img { height: 34px; width: auto; }

.brand-label { line-height: 1; }
.brand-label .brand-title {
  font-size: 0.92rem;
  font-weight: 800;
  color: var(--text-dark);
  letter-spacing: -0.02em;
}
.brand-label .brand-sub {
  font-size: 0.62rem;
  color: var(--accent-red);
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar-icon-btn {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border-glass);
  background: #fff;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 0.95rem;
  transition: all 0.2s ease;
  position: relative;
}
.topbar-icon-btn:hover { background: var(--bg-secondary); color: var(--accent-red); }
.topbar-icon-btn .notif-dot {
  position: absolute;
  top: 3px; right: 3px;
  width: 8px; height: 8px;
  background: var(--accent-red);
  border-radius: 50%;
  border: 2px solid #fff;
}

.delegate-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--grad-dark);
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 0.85rem;
  border: 2px solid var(--accent-red);
  cursor: pointer;
}

/* ---- MAIN CONTENT AREA ---- */
.main-content {
  margin-top: var(--topbar-height);
  padding: 16px;
  min-height: calc(100vh - var(--topbar-height) - var(--bottom-nav-height));
}

/* ---- VIEWS (Pages) ---- */
.view { display: none; animation: fadeIn 0.25s ease; }
.view.active { display: block; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---- BOTTOM NAV ---- */
.bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: var(--bottom-nav-height);
  background: var(--bg-glass-nav);
  backdrop-filter: blur(var(--blur));
  -webkit-backdrop-filter: blur(var(--blur));
  border-top: 1px solid var(--border-glass);
  display: flex;
  align-items: stretch;
  z-index: 200;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.06);
}

.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 0.62rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  transition: all 0.2s ease;
  border: none;
  background: none;
  padding: 8px 4px;
  position: relative;
}
.nav-item i { font-size: 1.2rem; transition: all 0.2s ease; }
.nav-item.active { color: var(--accent-red); }
.nav-item.active i { color: var(--accent-red); transform: scale(1.15); }
.nav-item.active::before {
  content: '';
  position: absolute;
  top: 0; left: 25%; right: 25%;
  height: 2.5px;
  background: var(--accent-red);
  border-radius: 0 0 4px 4px;
}
.nav-item .nav-badge {
  position: absolute;
  top: 6px;
  right: calc(50% - 18px);
  min-width: 16px; height: 16px;
  background: var(--accent-red);
  color: #fff;
  font-size: 0.58rem;
  font-weight: 700;
  border-radius: 99px;
  display: flex; align-items: center; justify-content: center;
  padding: 0 4px;
  border: 2px solid #fff;
}

/* ---- GLASS CARD ---- */
.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(var(--blur));
  -webkit-backdrop-filter: blur(var(--blur));
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: all 0.22s ease;
}
.glass-card:hover { box-shadow: var(--shadow-md); }
.glass-card.glow:hover { box-shadow: var(--shadow-glow); border-color: var(--border-glass-glow); }

/* ---- PAGE HEADER ---- */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.page-header h1 {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-dark);
  letter-spacing: -0.03em;
}
.page-header .page-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ---- SECTION TABS ---- */
.section-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  padding: 4px;
}
.section-tab {
  flex: 1;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}
.section-tab.active {
  background: #fff;
  color: var(--accent-red);
  box-shadow: var(--shadow-sm);
}

/* ---- LEVEL TABS (Dashboard) ---- */
.level-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}
.level-tabs::-webkit-scrollbar { display: none; }

.level-tab {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 99px;
  border: 1.5px solid var(--border-glass);
  background: #fff;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  box-shadow: var(--shadow-sm);
}
.level-tab i { font-size: 0.85rem; }
.level-tab.active {
  background: var(--accent-red);
  color: #fff;
  border-color: var(--accent-red);
  box-shadow: 0 4px 12px rgba(220,38,38,0.3);
}

/* ---- STAT CARDS ---- */
.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 16px;
}
.stat-card {
  background: #fff;
  border-radius: var(--radius-md);
  padding: 14px;
  border: 1px solid var(--border-glass);
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}
.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
}
.stat-card.red::before { background: var(--grad-red); }
.stat-card.blue::before { background: var(--grad-blue); }
.stat-card.emerald::before { background: var(--grad-emerald); }
.stat-card.amber::before { background: var(--grad-amber); }
.stat-card.purple::before { background: var(--grad-purple); }

.stat-icon {
  width: 36px; height: 36px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 10px;
  font-size: 1rem;
}
.stat-icon.red { background: var(--accent-red-subtle); color: var(--accent-red); }
.stat-icon.blue { background: rgba(37,99,235,0.08); color: var(--accent-blue); }
.stat-icon.emerald { background: rgba(22,163,74,0.08); color: var(--accent-emerald); }
.stat-icon.amber { background: rgba(217,119,6,0.08); color: var(--accent-amber); }
.stat-icon.purple { background: rgba(124,58,237,0.08); color: var(--accent-purple); }

.stat-value {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text-dark);
  line-height: 1;
  letter-spacing: -0.03em;
}
.stat-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 4px;
  font-weight: 500;
}
.stat-change {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 0.68rem;
  font-weight: 600;
  margin-top: 6px;
}
.stat-change.up { color: var(--accent-emerald); }
.stat-change.down { color: var(--accent-red); }

/* ---- SECTION CARD ---- */
.section-card {
  background: #fff;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-glass);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  margin-bottom: 14px;
}
.section-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-glass);
  background: var(--bg-secondary);
}
.section-card-header h3 {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-dark);
  display: flex;
  align-items: center;
  gap: 8px;
}
.section-card-header h3 i { color: var(--accent-red); font-size: 0.95rem; }
.section-card-body { padding: 16px; }

/* ---- PROGRESS BARS ---- */
.progress-item { margin-bottom: 12px; }
.progress-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
  font-size: 0.78rem;
  font-weight: 500;
}
.progress-bar-bg {
  height: 8px;
  background: var(--bg-secondary);
  border-radius: 99px;
  overflow: hidden;
}
.progress-bar-fill {
  height: 100%;
  border-radius: 99px;
  transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---- ACTIVITY ITEMS ---- */
.activity-list { display: flex; flex-direction: column; gap: 10px; }
.activity-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-glass);
  background: var(--bg-secondary);
  transition: all 0.2s ease;
}
.activity-item:hover { background: #fff; box-shadow: var(--shadow-sm); }
.activity-dot {
  width: 36px; height: 36px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  font-size: 0.95rem;
}
.activity-info { flex: 1; min-width: 0; }
.activity-title {
  font-size: 0.83rem;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 3px;
}
.activity-meta {
  font-size: 0.7rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.activity-meta i { font-size: 0.68rem; }

/* ---- BADGE ---- */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px;
  font-size: 0.68rem; font-weight: 600;
  border-radius: 99px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.badge-red { background: rgba(220,38,38,0.1); color: var(--accent-red); border: 1px solid rgba(220,38,38,0.22); }
.badge-emerald { background: rgba(22,163,74,0.1); color: var(--accent-emerald); border: 1px solid rgba(22,163,74,0.22); }
.badge-blue { background: rgba(37,99,235,0.1); color: var(--accent-blue); border: 1px solid rgba(37,99,235,0.22); }
.badge-amber { background: rgba(217,119,6,0.1); color: var(--accent-amber); border: 1px solid rgba(217,119,6,0.22); }
.badge-purple { background: rgba(124,58,237,0.1); color: var(--accent-purple); border: 1px solid rgba(124,58,237,0.22); }
.badge-dark { background: rgba(51,51,51,0.08); color: var(--text-dark); border: 1px solid rgba(51,51,51,0.15); }

/* ---- BUTTONS ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  font-size: 0.83rem; font-weight: 600;
  padding: 9px 16px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}
.btn-primary {
  background: var(--grad-red);
  color: #fff;
  box-shadow: 0 2px 8px rgba(220,38,38,0.28);
}
.btn-primary:hover { filter: brightness(1.05); transform: translateY(-1px); }
.btn-dark { background: var(--grad-dark); color: #fff; }
.btn-dark:hover { filter: brightness(1.1); transform: translateY(-1px); }
.btn-outline {
  background: transparent;
  color: var(--accent-red);
  border-color: var(--accent-red-border);
}
.btn-outline:hover { background: var(--accent-red-subtle); }
.btn-glass {
  background: #fff;
  color: var(--text-muted);
  border-color: var(--border-glass);
  box-shadow: var(--shadow-sm);
}
.btn-glass:hover { background: var(--bg-secondary); color: var(--text-dark); }
.btn-sm { padding: 6px 12px; font-size: 0.75rem; }
.btn-xs { padding: 4px 8px; font-size: 0.68rem; }
.btn-block { width: 100%; }
.btn-emerald { background: var(--grad-emerald); color: #fff; }
.btn-emerald:hover { filter: brightness(1.05); }

/* ---- CALENDAR ---- */
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  text-align: center;
}
.cal-day-name {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text-dim);
  text-transform: uppercase;
  padding: 4px 0 8px;
}
.cal-day {
  aspect-ratio: 1;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.78rem;
  font-weight: 500;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.15s ease;
  position: relative;
}
.cal-day:hover { background: var(--accent-red-subtle); }
.cal-day.today {
  background: var(--accent-red);
  color: #fff;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(220,38,38,0.35);
}
.cal-day.has-event::after {
  content: '';
  position: absolute;
  bottom: 2px;
  left: 50%; transform: translateX(-50%);
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--accent-blue);
}
.cal-day.today.has-event::after { background: #fff; }
.cal-day.other-month { color: var(--text-dim); }
.cal-day.selected { background: var(--accent-red-subtle); color: var(--accent-red); font-weight: 700; }

/* ---- ACTION PLAN TASK ---- */
.task-list { display: flex; flex-direction: column; gap: 8px; }
.task-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-glass);
  background: #fff;
  transition: all 0.2s ease;
}
.task-item:hover { box-shadow: var(--shadow-sm); }
.task-item.completed { opacity: 0.6; background: var(--bg-secondary); }
.task-item.completed .task-title { text-decoration: line-through; color: var(--text-muted); }

.task-check {
  width: 22px; height: 22px;
  border-radius: 6px;
  border: 2px solid var(--border-glass);
  background: #fff;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s ease;
  flex-shrink: 0;
  color: transparent;
  font-size: 0.75rem;
}
.task-check:hover { border-color: var(--accent-red); }
.task-check.checked {
  background: var(--accent-emerald);
  border-color: var(--accent-emerald);
  color: #fff;
}

.task-content { flex: 1; min-width: 0; }
.task-title { font-size: 0.85rem; font-weight: 600; color: var(--text-dark); margin-bottom: 4px; }
.task-meta { font-size: 0.7rem; color: var(--text-muted); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.task-meta i { font-size: 0.68rem; }
.task-priority {
  padding: 2px 7px; border-radius: 99px; font-size: 0.63rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.04em;
}
.task-priority.high { background: rgba(220,38,38,0.1); color: var(--accent-red); }
.task-priority.medium { background: rgba(217,119,6,0.1); color: var(--accent-amber); }
.task-priority.low { background: rgba(22,163,74,0.1); color: var(--accent-emerald); }

/* ---- MESSAGING ---- */
.message-card {
  background: #fff;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-glass);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  margin-bottom: 14px;
  transition: all 0.2s ease;
}
.message-card:hover { box-shadow: var(--shadow-md); }
.message-banner {
  background: var(--grad-red);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
}
.message-banner i { font-size: 1.1rem; }
.message-banner .msg-type {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  opacity: 0.85;
}
.message-banner .msg-heading {
  font-size: 0.92rem;
  font-weight: 700;
}
.message-body { padding: 14px 16px; }
.message-body p { font-size: 0.83rem; color: var(--text-muted); line-height: 1.65; }
.message-body .key-points { margin-top: 12px; list-style: none; }
.message-body .key-points li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 7px;
  font-size: 0.81rem;
  color: var(--text-main);
}
.message-body .key-points li::before {
  content: '\f058';
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  color: var(--accent-red);
  flex-shrink: 0;
  margin-top: 1px;
}

/* ---- NEWS TRACKER ---- */
.news-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-glass);
  background: #fff;
  margin-bottom: 10px;
  transition: all 0.2s ease;
}
.news-item:hover { box-shadow: var(--shadow-sm); }
.news-source-icon {
  width: 40px; height: 40px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}
.news-content { flex: 1; min-width: 0; }
.news-headline {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 4px;
  line-height: 1.4;
}
.news-meta {
  font-size: 0.7rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.news-meta i { font-size: 0.65rem; }

.feedback-section {
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  padding: 10px;
  margin-top: 8px;
}
.feedback-section label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  display: block;
  margin-bottom: 6px;
}
.feedback-textarea {
  width: 100%;
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  font-size: 0.78rem;
  font-family: inherit;
  color: var(--text-main);
  background: #fff;
  resize: vertical;
  min-height: 60px;
  transition: border-color 0.2s ease;
}
.feedback-textarea:focus { outline: none; border-color: var(--accent-red); }
.sentiment-row {
  display: flex;
  gap: 6px;
  margin: 8px 0;
}
.sentiment-btn {
  flex: 1;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border-glass);
  background: #fff;
  cursor: pointer;
  font-size: 0.7rem;
  font-weight: 600;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: var(--text-muted);
}
.sentiment-btn:hover { background: var(--bg-secondary); }
.sentiment-btn.selected-pos { background: rgba(22,163,74,0.12); color: var(--accent-emerald); border-color: var(--accent-emerald); }
.sentiment-btn.selected-neu { background: rgba(217,119,6,0.12); color: var(--accent-amber); border-color: var(--accent-amber); }
.sentiment-btn.selected-neg { background: rgba(220,38,38,0.12); color: var(--accent-red); border-color: var(--accent-red); }

/* ---- SETTINGS ---- */
.settings-list { display: flex; flex-direction: column; gap: 2px; }
.settings-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
}
.settings-item:hover { background: var(--bg-secondary); }
.settings-icon {
  width: 38px; height: 38px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}
.settings-text { flex: 1; }
.settings-label { font-size: 0.88rem; font-weight: 600; color: var(--text-dark); }
.settings-sub { font-size: 0.72rem; color: var(--text-muted); margin-top: 2px; }
.settings-arrow { color: var(--text-dim); font-size: 0.78rem; }

/* ---- PROFILE HEADER ---- */
.profile-header {
  background: var(--grad-dark);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
  color: #fff;
  position: relative;
  overflow: hidden;
}
.profile-header::before {
  content: '';
  position: absolute;
  top: -20px; right: -20px;
  width: 120px; height: 120px;
  background: rgba(220,38,38,0.15);
  border-radius: 50%;
}
.profile-avatar {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--accent-red);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem;
  font-weight: 800;
  border: 3px solid rgba(255,255,255,0.3);
  position: relative; z-index: 1;
}
.profile-info { position: relative; z-index: 1; }
.profile-name { font-size: 1rem; font-weight: 700; }
.profile-role { font-size: 0.72rem; color: rgba(255,255,255,0.7); margin-top: 2px; }
.profile-location {
  display: flex; align-items: center; gap: 5px;
  font-size: 0.72rem;
  color: rgba(255,255,255,0.6);
  margin-top: 4px;
}

/* ---- TOGGLE ---- */
.toggle-switch {
  position: relative;
  width: 44px; height: 24px;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; inset: 0;
  background: #ddd;
  border-radius: 99px;
  cursor: pointer;
  transition: background 0.25s ease;
}
.toggle-slider::before {
  content: '';
  position: absolute;
  width: 18px; height: 18px;
  left: 3px; top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.25s ease;
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}
input:checked + .toggle-slider { background: var(--accent-red); }
input:checked + .toggle-slider::before { transform: translateX(20px); }

/* ---- HERO BANNER ---- */
.hero-banner {
  background: var(--grad-red);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 16px;
  color: #fff;
  position: relative;
  overflow: hidden;
}
.hero-banner::before {
  content: '';
  position: absolute;
  bottom: -30px; right: -30px;
  width: 150px; height: 150px;
  background: rgba(255,255,255,0.06);
  border-radius: 50%;
}
.hero-banner::after {
  content: '';
  position: absolute;
  top: -40px; right: 60px;
  width: 100px; height: 100px;
  background: rgba(255,255,255,0.04);
  border-radius: 50%;
}
.hero-greeting {
  font-size: 0.75rem;
  font-weight: 600;
  opacity: 0.8;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 4px;
}
.hero-name {
  font-size: 1.2rem;
  font-weight: 800;
  margin-bottom: 6px;
  letter-spacing: -0.02em;
}
.hero-stats {
  display: flex;
  gap: 16px;
  margin-top: 12px;
}
.hero-stat-item { text-align: center; }
.hero-stat-num { font-size: 1.3rem; font-weight: 800; line-height: 1; }
.hero-stat-label { font-size: 0.62rem; opacity: 0.75; margin-top: 2px; text-transform: uppercase; letter-spacing: 0.05em; }

/* ---- CHART PLACEHOLDER ---- */
.chart-placeholder {
  height: 140px;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-dim);
  font-size: 0.8rem;
  position: relative;
  overflow: hidden;
  margin-bottom: 10px;
}
.chart-bars {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 8px;
  height: 100%;
  padding: 16px 20px;
  width: 100%;
}
.chart-bar {
  flex: 1;
  border-radius: 4px 4px 0 0;
  transition: all 0.3s ease;
  position: relative;
}
.chart-bar:hover { filter: brightness(1.1); }

/* ---- FORM INPUTS ---- */
.form-group { margin-bottom: 14px; }
.form-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 6px;
}
.form-input, .form-select {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid var(--border-glass);
  border-radius: var(--radius-md);
  font-size: 0.83rem;
  font-family: inherit;
  color: var(--text-main);
  background: #fff;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.form-input:focus, .form-select:focus {
  outline: none;
  border-color: var(--accent-red);
  box-shadow: 0 0 0 3px var(--accent-red-subtle);
}

/* ---- ALERT NOTIFICATION ---- */
.alert-strip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  margin-bottom: 12px;
  font-size: 0.8rem;
  font-weight: 500;
}
.alert-strip.info { background: rgba(37,99,235,0.08); color: var(--accent-blue); border: 1px solid rgba(37,99,235,0.2); }
.alert-strip.warning { background: rgba(217,119,6,0.08); color: var(--accent-amber); border: 1px solid rgba(217,119,6,0.2); }
.alert-strip.success { background: rgba(22,163,74,0.08); color: var(--accent-emerald); border: 1px solid rgba(22,163,74,0.2); }
.alert-strip.danger { background: rgba(220,38,38,0.08); color: var(--accent-red); border: 1px solid rgba(220,38,38,0.2); }

/* ---- DIVIDER ---- */
.divider {
  height: 1px;
  background: var(--border-glass);
  margin: 12px 0;
}

/* ---- MODAL ---- */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(6px);
  z-index: 300;
  align-items: flex-end;
  justify-content: center;
}
.modal-overlay.open { display: flex; }
.modal-sheet {
  background: #fff;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  width: 100%;
  max-width: 600px;
  padding: 20px;
  max-height: 80vh;
  overflow-y: auto;
  animation: slideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}
.modal-handle {
  width: 36px; height: 4px;
  background: var(--border-glass);
  border-radius: 99px;
  margin: 0 auto 16px;
}
.modal-title { font-size: 1rem; font-weight: 700; color: var(--text-dark); margin-bottom: 14px; }

/* ---- TOAST ---- */
.toast {
  position: fixed;
  bottom: calc(var(--bottom-nav-height) + 16px);
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--text-dark);
  color: #fff;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-size: 0.82rem;
  font-weight: 600;
  z-index: 500;
  opacity: 0;
  transition: all 0.3s ease;
  white-space: nowrap;
  pointer-events: none;
  box-shadow: var(--shadow-lg);
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ---- FAB ---- */
.fab {
  position: fixed;
  bottom: calc(var(--bottom-nav-height) + 16px);
  right: 16px;
  width: 52px; height: 52px;
  border-radius: 50%;
  background: var(--grad-red);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem;
  box-shadow: 0 4px 16px rgba(220,38,38,0.4);
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
  z-index: 150;
}
.fab:hover { transform: scale(1.08); box-shadow: 0 6px 20px rgba(220,38,38,0.5); }

/* ---- MAP PLACEHOLDER ---- */
.map-placeholder {
  background: linear-gradient(135deg, #e2e8f0, #cbd5e1);
  border-radius: var(--radius-md);
  height: 180px;
  display: flex; align-items: center; justify-content: center;
  position: relative;
  overflow: hidden;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 10px;
}
.map-pin {
  position: absolute;
  width: 20px; height: 20px;
  background: var(--accent-red);
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  box-shadow: 0 2px 8px rgba(220,38,38,0.4);
}
.map-pin::after {
  content: '';
  width: 10px; height: 10px;
  background: #fff;
  border-radius: 50%;
  position: absolute;
  top: 5px; left: 5px;
  transform: rotate(45deg);
}

/* ---- SCROLLBAR ---- */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-glass); border-radius: 99px; }

/* ---- UTIL ---- */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.mt-3 { margin-top: 12px; }
.text-muted { color: var(--text-muted); font-size: 0.78rem; }
.text-sm { font-size: 0.78rem; }
.text-xs { font-size: 0.7rem; }
.font-bold { font-weight: 700; }
.w-full { width: 100%; }
.hidden { display: none !important; }

/* Responsive for wider screens */
@media (min-width: 600px) {
  body { max-width: 480px; margin: 0 auto; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
}
