/* ==========================================================================
   AC 171 - PADMANABHANAGAR KPCC EXECUTIVE DASHBOARD
   Pixel-Accurate Design System with Light/Dark Themes, Glassmorphism & 3D Effects
   ========================================================================== */

:root {
  /* LIGHT THEME (Default) */
  --bg-app: linear-gradient(135deg, #e0f2fe 0%, #f0fdf4 50%, #f8fafc 100%);
  --bg-sidebar: rgba(13, 33, 55, 0.85);
  --bg-sidebar-hover: rgba(22, 47, 76, 0.9);
  --bg-sidebar-active: rgba(25, 56, 92, 0.95);
  --bg-card: #ffffff;
  --bg-card-glass: rgba(255, 255, 255, 0.55);
  --bg-card-subtle: rgba(248, 250, 252, 0.7);
  
  --border-light: #e2e8f0;
  --border-card: #e2e8f0;
  --border-glass: rgba(255, 255, 255, 0.95);
  --divider-color: #cbd5e1;

  --text-dark: #0f172a;
  --text-body: #334155;
  --text-muted: #64748b;
  --text-light-muted: #94a3b8;

  /* Accents */
  --color-primary: #1b59b8;
  --color-blue: #2563eb;
  --color-blue-tint: #eff6ff;
  --color-cyan: #0284c7;
  --color-green: #10b981;
  --color-green-dark: #15803d;
  --color-green-tint: #f0fdf4;
  --color-red: #dc2626;
  --color-red-tint: #fef2f2;
  --color-orange: #ea580c;
  --color-orange-tint: #fff7ed;
  --color-amber: #f59e0b;
  --color-pink: #db2777;
  --color-purple: #7c3aed;
  --color-purple-tint: #faf5ff;
  --color-yellow: #facc15;

  /* 3D Shadows & Specular Lights */
  --shadow-card-3d: 0 4px 12px -2px rgba(15, 23, 42, 0.08), 0 2px 4px -1px rgba(15, 23, 42, 0.04), inset 0 1px 0 rgba(255, 255, 255, 0.9);
  --shadow-card-3d-hover: 0 14px 28px -6px rgba(15, 23, 42, 0.14), 0 4px 8px -2px rgba(15, 23, 42, 0.06), inset 0 1px 0 rgba(255, 255, 255, 1);
  --shadow-popup: 0 15px 35px -5px rgba(15, 23, 42, 0.25);
  --banner-bg: #0d2137;

  /* Radii */
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 10px;
  --radius-xl: 14px;
  --radius-pill: 9999px;

  /* Fonts */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-cursive: var(--font-sans);
  --font-display: var(--font-sans);
}

/* DARK THEME */
[data-theme="dark"] {
  --bg-app: linear-gradient(135deg, #080d1a 0%, #060e1a 50%, #0a1128 100%);
  --bg-sidebar: rgba(6, 14, 26, 0.85);
  --bg-sidebar-hover: rgba(16, 28, 48, 0.9);
  --bg-sidebar-active: rgba(21, 39, 68, 0.95);
  --bg-card: #0f192c;
  --bg-card-glass: rgba(16, 27, 48, 0.45);
  --bg-card-subtle: rgba(18, 30, 53, 0.7);

  --border-light: rgba(255, 255, 255, 0.08);
  --border-card: rgba(255, 255, 255, 0.09);
  --border-glass: rgba(255, 255, 255, 0.12);
  --divider-color: rgba(255, 255, 255, 0.12);

  --text-dark: #f8fafc;
  --text-body: #cbd5e1;
  --text-muted: #94a3b8;
  --text-light-muted: #64748b;

  --color-blue-tint: rgba(37, 99, 235, 0.15);
  --color-green-tint: rgba(16, 185, 129, 0.15);
  --color-red-tint: rgba(220, 38, 38, 0.15);
  --color-orange-tint: rgba(234, 88, 12, 0.15);
  --color-purple-tint: rgba(124, 58, 237, 0.15);

  --shadow-card-3d: 0 4px 16px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  --shadow-card-3d-hover: 0 14px 30px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  --banner-bg: #0b172a;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background: var(--bg-app);
  color: var(--text-body);
  font-size: 13px;
  line-height: 1.45;
  height: 100vh;
  margin: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.25s ease, color 0.25s ease;
}

/* ==========================================================================
   LOGIN OVERLAY
   ========================================================================== */
.login-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: var(--bg-app);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.login-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.login-card {
  width: 100%;
  max-width: 420px;
  padding: 2.5rem 2rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 40px rgba(0,0,0,0.15);
}

.login-logo {
  height: 65px;
  width: auto;
  margin-bottom: 0.5rem;
}

.login-title {
  font-family: var(--font-display);
  font-size: 1.65rem;
  font-weight: 800;
  color: var(--text-dark);
  margin-bottom: 0.25rem;
}

.login-sub {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.input-group {
  position: relative;
  display: flex;
  align-items: center;
  margin-bottom: 1.15rem;
}

.input-group svg.input-icon-left,
.input-group > svg:first-child {
  position: absolute;
  left: 1rem;
  color: var(--text-muted);
  pointer-events: none;
}

.input-group input {
  width: 100%;
  padding: 0.85rem 1rem 0.85rem 3.2rem;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  color: var(--text-dark);
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.input-group.password-group input {
  padding-right: 3rem;
}

.password-toggle-btn {
  position: absolute;
  right: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  transition: all 0.15s ease;
}

.password-toggle-btn:hover {
  color: var(--color-blue);
  background: var(--color-blue-tint);
}

.input-group input:focus {
  border-color: var(--color-blue);
  box-shadow: 0 0 0 3px var(--color-blue-tint);
}

.login-btn {
  width: 100%;
  padding: 0.9rem;
  background: var(--color-blue);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-top: 0.5rem;
}

.login-btn:hover {
  background: #1d4ed8;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(37,99,235,0.3);
}

.login-error-msg {
  color: var(--color-red);
  font-size: 0.85rem;
  min-height: 1.25rem;
  margin-bottom: 0.5rem;
}

/* ==========================================================================
   TOP GLOBAL EXECUTIVE HEADER
   ========================================================================== */
.top-nav-bar {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-light);
  min-height: 68px;
  padding: 0.5rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  transition: background-color 0.25s ease;
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 1.35rem;
}

.kpcc-brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.kpcc-title {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-dark);
  line-height: 1;
}

.kpcc-sub {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-muted);
}

.header-slogan {
  display: flex;
  flex-direction: column;
  font-family: var(--font-cursive);
  line-height: 1.05;
  color: var(--text-dark);
  border-left: 1px solid var(--border-light);
  padding-left: 1rem;
}

.slogan-line1 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-muted);
}

.slogan-line2 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-dark);
}

/* Center Top Bar Direct Text (No oval card) */
.nav-center-direct {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 1rem;
}

.nav-center-direct .header-center-main-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-dark);
  letter-spacing: 0.02em;
  line-height: 1.25;
  white-space: nowrap;
}

.nav-center-direct .header-center-sub-title {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-muted);
  line-height: 1.2;
  white-space: nowrap;
}

[data-theme="dark"] .nav-center-direct .header-center-main-title {
  color: #f8fafc;
}

[data-theme="dark"] .nav-center-direct .header-center-sub-title {
  color: #94a3b8;
}

.nav-leaders-group {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.leader-photo-item {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
}

[data-theme="dark"] .leader-photo-item {
  border-color: #334155;
  background: #1e293b;
}

.leader-photo-item:hover {
  transform: translateY(-3px) scale(1.15);
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.4);
  border-color: var(--color-blue);
  z-index: 10;
}

.leader-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Sidebar Constituency Selector */
.sidebar-constituency-box {
  position: relative;
  margin-bottom: 0.85rem;
  padding: 0.25rem 0.25rem 0.85rem 0.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-constituency-label {
  display: block;
  font-family: var(--font-display);
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #94a3b8;
  margin-bottom: 0.4rem;
  padding-left: 0.2rem;
}

.sidebar-select-pill {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius-md);
  padding: 0.48rem 0.65rem;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  transition: all 0.2s ease;
}

.sidebar-select-pill:hover {
  background: rgba(37, 99, 235, 0.25);
  border-color: rgba(96, 165, 250, 0.5);
}

.sidebar-select-pill .pill-text {
  font-size: 0.76rem;
  font-weight: 700;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-select-pill .chevron-icon {
  color: #94a3b8;
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

/* Constituency Selector Dropdown Menu */
.constituency-menu-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  width: 100%;
  min-width: 236px;
  background: #0f1f38;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius-lg);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.55);
  padding: 0.4rem;
  display: none;
  flex-direction: column;
  gap: 0.25rem;
  z-index: 500;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  animation: fadeIn 0.15s ease-out;
}

.constituency-menu-dropdown.active {
  display: flex;
}

.constituency-option {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.5rem 0.7rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.15s ease;
  color: #e2e8f0;
}

.constituency-option:hover {
  background: rgba(37, 99, 235, 0.25);
}

.constituency-option.active {
  background: rgba(37, 99, 235, 0.35);
}

.constituency-option .ac-title {
  color: #ffffff;
}

.constituency-option .ac-sub {
  color: #94a3b8;
}

.ac-badge {
  background: #0d2137;
  color: #ffffff;
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 800;
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}

.constituency-option.active .ac-badge {
  background: var(--color-blue);
}

.ac-meta {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.ac-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-dark);
}

.ac-sub {
  font-size: 0.67rem;
  color: var(--text-muted);
}

.constituency-option .check-icon {
  opacity: 0;
  color: var(--color-blue);
  margin-left: auto;
  flex-shrink: 0;
}

.constituency-option.active .check-icon {
  opacity: 1;
}

.nav-center {
  text-align: center;
}

.doc-main-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-dark);
  line-height: 1.2;
}

.doc-sub-title {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 500;
}

.nav-monument {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

/* Page View Switcher Tabs */
.view-switch-tabs {
  display: flex;
  background: var(--bg-app);
  padding: 3px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  gap: 3px;
}

.view-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.75rem;
  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.15s ease;
}

.view-tab-btn:hover {
  color: var(--text-dark);
}

.view-tab-btn.active {
  background: var(--color-blue);
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.35);
}

/* Header Buttons */
.header-icon-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  color: var(--text-muted);
  width: 34px;
  height: 34px;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.header-icon-btn:hover {
  color: var(--color-blue);
  border-color: var(--color-blue);
}

/* Sun/Moon Theme Toggle Visibility */
[data-theme="light"] .sun-icon { display: none; }
[data-theme="light"] .moon-icon { display: block; }
[data-theme="dark"] .sun-icon { display: block; }
[data-theme="dark"] .moon-icon { display: none; }

/* Sidebar Toggle Button */
.sidebar-toggle-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  color: var(--text-muted);
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.sidebar-toggle-btn:hover {
  color: var(--color-blue);
  border-color: var(--color-blue);
  background-color: var(--color-blue-tint);
}

.kpcc-logo-img {
  height: 44px;
  width: auto;
  max-width: 50px;
  object-fit: contain;
  display: block;
}

/* ==========================================================================
   APP LAYOUT: SIDEBAR & STAGE
   ========================================================================== */
.app-layout {
  display: flex;
  flex: 1;
  overflow: hidden;
  position: relative;
}

/* Left Sidebar - Stationary & Non-Scrollable with Page Content */
.sidebar-nav {
  width: 250px;
  background: var(--bg-sidebar);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  color: #cbd5e1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  flex-shrink: 0;
  height: 100%;
  position: sticky;
  top: 0;
  border-right: 1px solid rgba(255, 255, 255, 0.05);
  transition: width 0.25s cubic-bezier(0.16, 1, 0.3, 1), transform 0.25s ease;
  overflow: hidden;
  z-index: 50;
}

.sidebar-menu-wrapper {
  padding: 0.85rem 0.5rem;
  overflow-y: auto;
  flex: 1;
}

.sidebar-menu-wrapper::-webkit-scrollbar {
  width: 3px;
}
.sidebar-menu-wrapper::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 3px;
}

/* Collapsible Sidebar State */
body.sidebar-collapsed .sidebar-nav {
  width: 62px;
}

body.sidebar-collapsed .sidebar-nav .menu-label,
body.sidebar-collapsed .sidebar-nav .sub-menu-tree,
body.sidebar-collapsed .sidebar-nav .chevron-toggle,
body.sidebar-collapsed .sidebar-nav .sidebar-cursive-slogan,
body.sidebar-collapsed .sidebar-nav .sidebar-constituency-label,
body.sidebar-collapsed .sidebar-nav .sidebar-select-pill .pill-text,
body.sidebar-collapsed .sidebar-nav .sidebar-select-pill .chevron-icon,
body.sidebar-collapsed .sidebar-nav .karnataka-map-watermark {
  display: none !important;
}

body.sidebar-collapsed .sidebar-constituency-box {
  padding: 0.4rem 0 0.75rem 0;
  display: flex;
  justify-content: center;
}

body.sidebar-collapsed .sidebar-select-pill {
  width: 44px;
  height: 38px;
  padding: 0;
  justify-content: center;
}

body.sidebar-collapsed .sidebar-select-pill::before {
  content: "AC";
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 800;
  color: #60a5fa;
}

body.sidebar-collapsed .sidebar-constituency-menu {
  left: 62px;
  top: 0;
  width: 240px;
}

body.sidebar-collapsed .sidebar-nav .menu-item-root,
body.sidebar-collapsed .sidebar-nav .menu-group-header {
  justify-content: center;
  padding: 0.7rem 0;
  text-align: center;
}

body.sidebar-collapsed .sidebar-nav .group-title-wrap {
  justify-content: center;
  gap: 0;
}

body.sidebar-collapsed .sidebar-nav .sidebar-footer {
  padding: 0.5rem 0.35rem;
  display: flex;
  justify-content: center;
}

body.sidebar-collapsed .sidebar-user-profile {
  padding: 0.35rem;
  justify-content: center;
  border: none;
  background: transparent;
}

body.sidebar-collapsed .sidebar-user-profile .user-info-text,
body.sidebar-collapsed .sidebar-user-profile .user-status-dot {
  display: none !important;
}

.sidebar-footer {
  padding: 0.65rem 0.65rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.15);
}

.sidebar-user-profile {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.45rem 0.55rem;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  cursor: pointer;
  transition: all 0.2s ease;
}

.sidebar-user-profile:hover {
  background: rgba(37, 99, 235, 0.2);
  border-color: rgba(96, 165, 250, 0.4);
}

.sidebar-user-profile .user-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.sidebar-user-profile .user-info-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.sidebar-user-profile .user-name {
  font-size: 0.78rem;
  font-weight: 700;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}

.sidebar-user-profile .user-role {
  font-size: 0.65rem;
  color: #94a3b8;
  font-weight: 500;
  line-height: 1.1;
}

.sidebar-user-profile .user-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: #10b981;
  box-shadow: 0 0 6px #10b981;
  flex-shrink: 0;
}

.menu-item-root {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.85rem;
  color: #94a3b8;
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  margin-bottom: 0.35rem;
  transition: all 0.15s ease;
}

.menu-item-root:hover {
  background-color: var(--bg-sidebar-hover);
  color: #ffffff;
  transform: translateX(4px);
}

.menu-item-root.active {
  background-color: #1e40af;
  color: #ffffff;
}

.menu-group {
  margin-bottom: 0.5rem;
}

.menu-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 0.85rem;
  color: #f1f5f9;
  cursor: pointer;
  border-radius: var(--radius-md);
  font-size: 0.82rem;
  font-weight: 600;
  transition: background 0.15s ease;
}

.menu-group-header:hover {
  background-color: var(--bg-sidebar-hover);
}

.group-title-wrap {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.chevron-toggle {
  transition: transform 0.2s ease;
  color: #64748b;
}

.menu-group.open .chevron-toggle {
  transform: rotate(180deg);
}

/* Sub-Menu Tree Links */
.sub-menu-tree {
  list-style: none;
  padding-left: 1.65rem;
  position: relative;
  margin-top: 0.2rem;
  margin-bottom: 0.5rem;
}

.sub-menu-tree::before {
  content: '';
  position: absolute;
  left: 1.85rem;
  top: 0.4rem;
  bottom: 0.6rem;
  width: 1px;
  background: rgba(255, 255, 255, 0.12);
}

.sub-item a {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.38rem 0.5rem 0.38rem 1.1rem;
  color: #94a3b8;
  text-decoration: none;
  font-size: 0.76rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  position: relative;
  transition: all 0.15s ease;
}

.sub-item a:hover {
  color: #ffffff;
  transform: translateX(3px);
}

.tree-bullet {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #64748b;
  position: absolute;
  left: 0.25rem;
}

.sub-item.active a {
  color: #ffffff;
  font-weight: 600;
}

.sub-item.active .tree-bullet {
  background: #38bdf8;
  box-shadow: 0 0 6px #38bdf8;
  width: 6px;
  height: 6px;
}

.sidebar-footer {
  padding: 1rem;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.sidebar-cursive-slogan {
  display: flex;
  flex-direction: column;
  font-family: var(--font-cursive);
  font-size: 1.15rem;
  color: #94a3b8;
  line-height: 1.1;
}

.sidebar-cursive-slogan .cursive-highlight {
  color: #ffffff;
  font-size: 1.25rem;
}

.constituency-map-wrap {
  width: 100%;
  max-height: 200px;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  border-radius: var(--radius-md);
  margin-top: 0.5rem;
  padding: 0.5rem;
  background: rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow: inset 0 2px 8px rgba(0,0,0,0.2);
}

.constituency-map-img {
  width: 100%;
  height: auto;
  max-height: 180px;
  object-fit: contain;
  object-position: center;
  opacity: 0.9;
  transition: opacity 0.25s ease, transform 0.3s ease;
}

.constituency-map-wrap:hover .constituency-map-img {
  opacity: 1;
  transform: scale(1.05);
}

body.sidebar-collapsed .constituency-map-wrap {
  display: none !important;
}

/* ==========================================================================
   MAIN CONTENT STAGE (PAGES)
   ========================================================================== */
.main-content-stage {
  flex: 1;
  overflow-y: auto;
  padding: 1.15rem 1.5rem 3rem;
  background-color: var(--bg-app);
}

.page-view-container {
  display: none;
  animation: fadeIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.page-view-container.active {
  display: block;
}

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

/* Sub-header Strip */
.content-header-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.15rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.header-strip-left {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.strip-icon-box {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: #0d2137;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(13, 33, 55, 0.3);
}

.strip-icon-box.orange-bg {
  background: #ea580c;
}

.page-title {
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--text-dark);
  line-height: 1.1;
}

.page-subtitle {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.header-strip-right {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.booth-quick-search-box {
  position: relative;
  width: 220px;
}

.booth-quick-search-box .search-ico {
  position: absolute;
  left: 0.7rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.booth-filter-input {
  width: 100%;
  padding: 0.4rem 0.65rem 0.4rem 2rem;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  font-size: 0.78rem;
  color: var(--text-dark);
  outline: none;
}

.booth-filter-input:focus {
  border-color: var(--color-blue);
}

.booth-dropdown {
  position: absolute;
  top: 110%;
  left: 0;
  right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-popup);
  max-height: 250px;
  overflow-y: auto;
  display: none;
  z-index: 150;
}

.booth-dropdown.active {
  display: block;
}

.booth-dropdown-item {
  padding: 0.5rem 0.75rem;
  font-size: 0.78rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-light);
}

.booth-dropdown-item:hover {
  background: var(--bg-card-subtle);
}

.export-pdf-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 0.4rem 0.85rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-dark);
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
  transition: all 0.15s ease;
}

.export-pdf-btn:hover {
  border-color: var(--color-blue);
  color: var(--color-blue);
}

.last-updated-text {
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* ==========================================================================
   WINDOW BOXES, 3D GLASS CARDS & SUBTLE LINE DIVIDERS
   ========================================================================== */
.window-box {
  scroll-margin-top: 85px;
  position: relative;
}

/* Subtle line between boxes */
.subtle-line-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--divider-color) 25%, var(--divider-color) 75%, transparent);
  margin: 1.45rem 0;
  position: relative;
}

.subtle-line-divider::after {
  content: '';
  position: absolute;
  top: -2px;
  left: 50%;
  transform: translateX(-50%);
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--color-blue);
  box-shadow: 0 0 6px var(--color-blue);
}

/* 3D Glass Effect Card */
.glass-card-3d {
  background: var(--bg-card-glass);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card-3d);
  overflow: hidden;
  position: relative;
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.22s ease;
  transform-style: preserve-3d;
}

.glass-card-3d:hover {
  transform: translateY(-4px) scale(1.015);
  box-shadow: var(--shadow-card-3d-hover);
}

.glass-card-3d.h-100 {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.block-title-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.65rem;
}

.block-num-badge {
  background-color: var(--color-primary);
  color: #ffffff;
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 800;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  box-shadow: 0 2px 4px rgba(27, 89, 184, 0.3);
}

.block-num-badge.red-badge { background-color: var(--color-red); }
.block-num-badge.blue-badge { background-color: var(--color-blue); }
.block-num-badge.green-badge { background-color: var(--color-green-dark); }
.block-num-badge.orange-badge { background-color: var(--color-orange); }

.block-heading {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text-dark);
  letter-spacing: 0.03em;
}

/* Top Ribbons */
.card-top-ribbon {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 1rem;
  font-size: 0.8rem;
  font-weight: 700;
  border-bottom: 1px solid var(--border-light);
}

.card-top-ribbon.blue-ribbon {
  background-color: var(--color-blue-tint);
  color: var(--color-blue);
}

.card-top-ribbon.purple-ribbon {
  background-color: var(--color-purple-tint);
  color: var(--color-purple);
}

.card-header-clean {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1rem 0.35rem;
}

.card-clean-title {
  font-family: var(--font-display);
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-dark);
}

.card-inner-body {
  padding: 0.85rem 1rem 0.95rem;
}

/* ==========================================================================
   PAGE 1: SUMMARY VIEW SECTIONS
   ========================================================================== */
.tri-card-grid {
  display: grid;
  grid-template-columns: 1.15fr 1.3fr 1.05fr;
  gap: 0.9rem;
}

.details-table,
.segments-table,
.duplicates-table {
  width: 100%;
  border-collapse: collapse;
}

.details-table td,
.segments-table td,
.duplicates-table td {
  padding: 0.32rem 0;
  font-size: 0.77rem;
  vertical-align: middle;
}

.td-icon { width: 22px; }
.td-label { color: var(--text-muted); }
.td-colon { width: 14px; color: var(--text-light-muted); text-align: center; }
.td-val { color: var(--text-dark); }
.text-right { text-align: right; }

.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.text-navy { color: var(--text-dark); }
.text-blue { color: var(--color-blue); }
.text-pink { color: var(--color-pink); }
.text-green { color: var(--color-green-dark); }
.text-red { color: var(--color-red); }
.text-orange { color: var(--color-orange); }

.pct-sub, .range-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.warning-callout-pill {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-md);
  margin-top: 0.65rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.warning-callout-pill.orange-tint {
  background-color: var(--color-orange-tint);
  border: 1px solid #fed7aa;
}

.warning-icon-circle {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background-color: var(--color-orange);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.warning-text {
  font-size: 0.74rem;
  color: #9a3412;
  line-height: 1.35;
}

[data-theme="dark"] .warning-text {
  color: #fdba74;
}

/* Donut & Legends */
.voter-composition-wrap {
  padding: 0.4rem 1rem 0.85rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.donut-chart-holder {
  position: relative;
  width: 145px;
  height: 145px;
  flex-shrink: 0;
}

.donut-chart-holder.sm {
  width: 125px;
  height: 125px;
}

.donut-center-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  pointer-events: none;
}

.center-lbl {
  display: block;
  font-size: 0.65rem;
  color: var(--text-muted);
  font-weight: 500;
  line-height: 1;
}

.center-count {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-dark);
  line-height: 1.15;
}

.donut-legend-right {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  flex: 1;
}

.legend-row {
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
}

.dot-legend {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-top: 4px;
  flex-shrink: 0;
}
.dot-blue { background-color: var(--color-blue); }
.dot-pink { background-color: var(--color-pink); }
.dot-green { background-color: var(--color-green); }
.dot-orange { background-color: var(--color-orange); }
.dot-red { background-color: var(--color-red); }
.dot-purple { background-color: var(--color-purple); }
.dot-indigo { background-color: #a855f7; }
.dot-teal { background-color: #0d9488; }
.dot-cyan { background-color: var(--color-cyan); }

/* Card View Toggle Buttons */
.card-view-toggle {
  display: inline-flex;
  background: rgba(0, 0, 0, 0.06);
  padding: 2px;
  border-radius: var(--radius-pill);
  gap: 2px;
}

[data-theme="dark"] .card-view-toggle {
  background: rgba(255, 255, 255, 0.08);
}

.toggle-pill-btn {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.68rem;
  font-weight: 600;
  padding: 0.15rem 0.55rem;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: all 0.15s ease;
}

.toggle-pill-btn:hover {
  color: var(--text-dark);
}

.toggle-pill-btn.active {
  background: #ffffff;
  color: var(--color-purple);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

[data-theme="dark"] .toggle-pill-btn.active {
  background: #7c3aed;
  color: #ffffff;
}

/* Special Segments Layout */
.special-segments-split-wrap {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-height: 200px;
}

.special-pie-holder {
  width: 135px;
  height: 135px;
  flex-shrink: 0;
  position: relative;
}

.special-table-wrap {
  flex: 1;
  min-width: 0;
}

.segments-table.compact td {
  padding: 0.2rem 0;
  font-size: 0.72rem;
}

.leg-title { font-size: 0.72rem; color: var(--text-muted); }
.leg-val { font-size: 0.8rem; color: var(--text-dark); }
.leg-pct { font-size: 0.72rem; color: var(--text-muted); }

/* Roll Change Section - Unified Single Card Layout */
.card-split-layout.roll-change-split {
  grid-template-columns: 1.35fr 1.05fr;
  gap: 1.15rem;
}

@media (max-width: 1024px) {
  .card-split-layout.roll-change-split {
    grid-template-columns: 1fr;
  }
}

.roll-change-left-col {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  justify-content: space-between;
  height: 100%;
}

.stat-tiles-group {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.55rem;
}

.stat-tile-card {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 0.6rem 0.35rem;
  text-align: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.stat-tile-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
}

.tile-header-label {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-muted);
  line-height: 1.2;
  min-height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tile-icon-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0.4rem 0;
}

.tile-icon-circle.blue-tint { background-color: var(--color-blue-tint); }
.tile-icon-circle.navy-tint { background-color: rgba(13, 33, 55, 0.15); }
.tile-icon-circle.green-tint { background-color: var(--color-green-tint); }
.tile-icon-circle.red-tint { background-color: var(--color-red-tint); }
.tile-icon-circle.orange-tint { background-color: var(--color-orange-tint); }

.tile-number-val {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-dark);
  line-height: 1;
}

.navy-reduction-banner {
  background-color: var(--banner-bg);
  border-radius: var(--radius-lg);
  padding: 0.9rem 1.15rem;
  color: #ffffff;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 6px 18px rgba(13, 33, 55, 0.35);
}

.reduction-top-flex {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.chart-drop-icon { flex-shrink: 0; }
.banner-line-one { font-size: 0.8rem; color: #e2e8f0; line-height: 1.35; }
.banner-line-two { font-family: var(--font-display); font-size: 1.15rem; font-weight: 800; color: #ffffff; }
.highlight-yellow { color: #facc15; text-shadow: 0 0 10px rgba(250, 204, 21, 0.3); }

.reduction-bottom-pill {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-pill);
  padding: 0.3rem 0.65rem;
  font-size: 0.7rem;
  color: #cbd5e1;
  margin-top: 0.65rem;
}

/* Tri Columns Row (ASDDO, Religion, Duplicates) */
.tri-columns-section-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.15rem;
}

/* Side-by-Side Split Layout for Cards 3, 4, 5, 6 */
.card-split-layout {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 1.25rem;
  padding: 1rem 1.2rem;
  align-items: stretch;
}

@media (max-width: 960px) {
  .card-split-layout {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
}

.split-left-content {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.75rem;
  height: 100%;
}

.split-right-chart {
  display: flex;
  flex-direction: column;
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 0.85rem 1rem;
  min-height: 210px;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.02);
}

.chart-panel-title {
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 0.6rem;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.chart-canvas-holder {
  flex: 1;
  position: relative;
  min-height: 170px;
  width: 100%;
}

.asddo-chart-legend-flex {
  padding: 0;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 1;
}

.asddo-legend-list {
  display: flex;
  flex-direction: column;
  gap: 0.38rem;
  flex: 1;
}

.asddo-item {
  display: flex;
  align-items: flex-start;
  gap: 0.4rem;
}

.asddo-item-meta {
  display: flex;
  justify-content: space-between;
  width: 100%;
  font-size: 0.74rem;
}

.asddo-title { color: var(--text-muted); }
.asddo-val { color: var(--text-dark); }

.bottom-callout-box {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  background-color: var(--bg-card-subtle);
  border-top: 1px solid var(--border-light);
  padding: 0.6rem 0.85rem;
  margin-top: auto;
}

.bottom-callout-box.purple-tint {
  background-color: var(--color-purple-tint);
}

.callout-icon-circle {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}
.callout-icon-circle.blue { background-color: var(--color-blue); }
.callout-icon-circle.purple { background-color: var(--color-purple); }
.callout-icon-circle.lg { width: 28px; height: 28px; }

.callout-text {
  font-size: 0.72rem;
  color: var(--text-body);
  line-height: 1.35;
}

/* Religion Card */
.religion-body-flex {
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  height: 100%;
  justify-content: space-between;
}

.religion-top-row {
  display: flex;
  align-items: center;
  gap: 1.15rem;
  width: 100%;
}

.religion-legend-metrics-col {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1;
  min-width: 0;
}

.religion-legend-list {
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
  width: 100%;
  font-size: 0.72rem;
}

.rel-row {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--text-muted);
}

.rel-count { margin-left: auto; color: var(--text-dark); }

.rel-obs-card {
  background-color: var(--bg-card-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 0.65rem 0.85rem;
  width: 100%;
}

.rel-obs-header {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--color-blue);
  margin-bottom: 0.3rem;
}

.rel-obs-para {
  font-size: 0.72rem;
  color: var(--text-body);
  line-height: 1.4;
}

.rel-metrics-pills {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.green-trend-pill {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background-color: var(--color-green-tint);
  border: 1px solid #bbf7d0;
  border-radius: var(--radius-md);
  padding: 0.3rem 0.6rem;
  font-size: 0.7rem;
  color: var(--color-green-dark);
}

/* Family Grouping Card */
.family-analysis-layout {
  padding: 0.85rem 1.15rem;
  display: grid;
  grid-template-columns: 1.8fr 1fr;
  gap: 1.5rem;
  align-items: center;
}

.family-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 1.5rem;
  row-gap: 0.5rem;
}

.family-stat-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.77rem;
  border-bottom: 1px dashed var(--border-light);
  padding-bottom: 0.35rem;
}

.f-label-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-muted);
}

.family-callout-panel {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  background-color: var(--color-blue-tint);
  border: 1px solid #bfdbfe;
  border-radius: var(--radius-lg);
  padding: 0.85rem 1rem;
}

.family-callout-text {
  font-size: 0.76rem;
  color: #1e3a8a;
  line-height: 1.4;
}

[data-theme="dark"] .family-callout-text {
  color: #93c5fd;
}

/* ==========================================================================
   PAGE 2: ACTIONABLE INSIGHTS VIEW SECTIONS
   ========================================================================== */

/* Key Observations Grid */
.key-observations-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.85rem;
}

.obs-card {
  padding: 0.95rem 1rem;
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
}

.obs-num-circle {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  color: #ffffff;
  font-weight: 800;
  font-size: 0.82rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.obs-num-circle.red { background-color: var(--color-red); }
.obs-num-circle.orange { background-color: var(--color-orange); }
.obs-num-circle.purple { background-color: var(--color-purple); }
.obs-num-circle.blue { background-color: var(--color-blue); }
.obs-num-circle.green { background-color: var(--color-green-dark); }

.obs-title {
  font-family: var(--font-display);
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 0.25rem;
}

.obs-text {
  font-size: 0.77rem;
  color: var(--text-body);
  line-height: 1.4;
}

/* Priority Action Plan */
.tag-ribbon-yellow {
  font-size: 0.7rem;
  font-weight: 700;
  background-color: #fef08a;
  color: #854d0e;
  padding: 0.15rem 0.55rem;
  border-radius: var(--radius-pill);
  margin-left: auto;
}

.priority-actions-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.85rem;
}

.priority-action-card {
  padding: 0.95rem 1rem;
  display: flex;
  flex-direction: column;
}

.priority-top-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.55rem;
  padding-bottom: 0.45rem;
  border-bottom: 1px solid var(--border-light);
}

.p-badge {
  width: 22px;
  height: 22px;
  border-radius: var(--radius-sm);
  color: #ffffff;
  font-size: 0.76rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.p-badge.red { background-color: var(--color-red); }
.p-badge.blue { background-color: var(--color-blue); }
.p-badge.orange { background-color: var(--color-orange); }
.p-badge.green { background-color: var(--color-green-dark); }
.p-badge.purple { background-color: var(--color-purple); }
.p-badge.cyan { background-color: var(--color-cyan); }

.p-title {
  font-family: var(--font-display);
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--text-dark);
}

.p-bullet-list {
  padding-left: 1.1rem;
  font-size: 0.76rem;
  color: var(--text-body);
  line-height: 1.45;
}

.p-bullet-list li {
  margin-bottom: 0.25rem;
}

/* 10-Day Execution Plan Timeline */
.tag-ribbon-green {
  font-size: 0.7rem;
  font-weight: 700;
  background-color: #bbf7d0;
  color: #166534;
  padding: 0.15rem 0.55rem;
  border-radius: var(--radius-pill);
  margin-left: auto;
}

.ten-day-timeline-card {
  padding: 1.15rem;
}

.days-flow-bar {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 0.4rem;
  overflow-x: auto;
  padding-bottom: 0.65rem;
}

.day-step {
  flex: 1;
  min-width: 95px;
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 0.65rem 0.45rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.day-step:hover {
  border-color: var(--color-blue);
  transform: translateY(-2px);
}

.day-step.done {
  background-color: var(--color-green-tint);
  border-color: #86efac;
}

.day-num-circle {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #0d2137;
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.35rem;
}

.day-step.done .day-num-circle {
  background-color: var(--color-green-dark);
}

.day-tag {
  font-size: 0.68rem;
  font-weight: 800;
  color: var(--color-blue);
  margin-bottom: 0.2rem;
}

.day-text {
  font-size: 0.68rem;
  color: var(--text-body);
  line-height: 1.25;
}

.day-arrow {
  display: flex;
  align-items: center;
  color: var(--text-light-muted);
  font-size: 0.8rem;
}

.timeline-interaction-hint {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.85rem;
  padding-top: 0.75rem;
  border-top: 1px dashed var(--border-light);
  font-size: 0.75rem;
  color: var(--text-muted);
}

.milestone-count-pill {
  font-weight: 700;
  color: var(--color-green-dark);
  background: var(--color-green-tint);
  padding: 0.2rem 0.65rem;
  border-radius: var(--radius-pill);
}

/* Expected Outcomes & Our Commitment */
.outcomes-commitment-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 0.9rem;
}

.outcomes-four-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}

.outcome-box {
  padding: 0.95rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.outcome-icon-circle {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--color-orange-tint);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.55rem;
}

.outcome-title {
  font-family: var(--font-display);
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 0.2rem;
}

.outcome-desc {
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* Commitment Card */
.commitment-card {
  padding: 1.45rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: linear-gradient(135deg, var(--color-blue-tint) 0%, var(--color-green-tint) 100%);
  border: 1px solid #bfdbfe;
}

.quote-sign {
  font-family: var(--font-display);
  font-size: 2.8rem;
  color: var(--color-primary);
  line-height: 0.8;
  margin-bottom: 0.2rem;
}

.commitment-quote-text {
  font-size: 0.88rem;
  font-style: italic;
  color: var(--text-dark);
  line-height: 1.55;
  margin-bottom: 0.95rem;
}

.commitment-author {
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--color-primary);
  letter-spacing: 0.05em;
  margin-bottom: 0.55rem;
}

.commitment-footer-tag {
  display: flex;
  gap: 0.65rem;
  font-size: 0.7rem;
  font-weight: 800;
  color: var(--text-muted);
  letter-spacing: 0.1em;
}

/* ==========================================================================
   BOOTH MODAL
   ========================================================================== */
.action-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(13, 33, 55, 0.75);
  backdrop-filter: blur(6px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 1.5rem;
}

.action-modal-backdrop.active {
  display: flex;
}

.action-modal-content {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  max-width: 560px;
  width: 100%;
  box-shadow: var(--shadow-popup);
  overflow: hidden;
  animation: popIn 0.2s ease;
}

@keyframes popIn {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

.modal-top-bar {
  background: #0d2137;
  color: #ffffff;
  padding: 1rem 1.35rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title-cluster {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.booth-badge-pill {
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 800;
  background: var(--color-blue);
  color: #ffffff;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-sm);
}

.modal-heading {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 800;
  color: #ffffff;
}

.modal-close-x {
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 1.75rem;
  cursor: pointer;
  line-height: 1;
}

.modal-close-x:hover { color: #ffffff; }

.modal-body-scroll {
  padding: 1.35rem;
  max-height: 70vh;
  overflow-y: auto;
  font-size: 0.84rem;
  color: var(--text-body);
}

.modal-footer-bar {
  padding: 0.85rem 1.35rem;
  border-top: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.65rem;
  background: var(--bg-card-subtle);
}

.btn-cancel {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  padding: 0.45rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
}

.btn-primary {
  background: #1e40af;
  border: none;
  padding: 0.45rem 1.15rem;
  border-radius: var(--radius-md);
  font-size: 0.8rem;
  font-weight: 600;
  color: #ffffff;
  cursor: pointer;
}

/* Subtle Line Divider */
.subtle-line-divider {
  width: 100%;
  height: 1px;
  background-color: var(--border-light);
  margin: 2rem 0;
  opacity: 0.7;
}

/* Mobile Navigation Elements */
.mobile-hamburger-btn {
  display: none;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  color: var(--text-dark);
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.mobile-hamburger-btn:hover {
  color: var(--color-blue);
  border-color: var(--color-blue);
}

.mobile-sidebar-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 490;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

body.sidebar-open-mobile .mobile-sidebar-backdrop {
  opacity: 1;
  pointer-events: all;
}

/* ==========================================================================
   COMPREHENSIVE MULTI-DEVICE RESPONSIVE BREAKPOINTS
   ========================================================================== */

/* 1. Large Laptops / Compact Desktops (<= 1200px) */
@media (max-width: 1200px) {
  .tri-card-grid {
    grid-template-columns: 1fr 1fr;
  }
  .tri-card-grid > .col-card:nth-child(3) {
    grid-column: 1 / -1;
  }
  .card-split-layout {
    grid-template-columns: 1.15fr 1fr;
    gap: 1rem;
  }
  .card-split-layout.roll-change-split {
    grid-template-columns: 1.15fr 1fr;
    gap: 1rem;
  }
}

/* 2. Tablet Landscape / Small Laptops (<= 992px) */
@media (max-width: 992px) {
  .top-nav-bar {
    padding: 0.4rem 0.85rem;
  }
  .nav-center-direct .header-center-main-title {
    font-size: 0.92rem;
  }
  .nav-center-direct .header-center-sub-title {
    font-size: 0.7rem;
  }
  .leader-photo-item {
    width: 38px;
    height: 38px;
  }
  .tri-card-grid {
    grid-template-columns: 1fr;
  }
  .card-split-layout {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  .card-split-layout.roll-change-split {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  .family-analysis-layout {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }
  .key-observations-grid,
  .priority-actions-grid,
  .outcomes-commitment-grid {
    grid-template-columns: 1fr;
  }
}

/* 3. Tablet Portrait / Mobile Off-Canvas Drawer (<= 860px) */
@media (max-width: 860px) {
  .mobile-hamburger-btn {
    display: flex;
  }
  .app-layout {
    display: block;
    position: relative;
    overflow-x: hidden;
  }
  .sidebar-nav {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 280px;
    height: 100vh;
    z-index: 500;
    transform: translateX(-100%);
    transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.5);
  }
  body.sidebar-open-mobile .sidebar-nav {
    transform: translateX(0);
  }
  .main-content-stage {
    padding: 1rem 0.85rem 3rem;
    height: calc(100vh - 68px);
    overflow-y: auto;
  }
  .content-header-strip {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }
  .header-strip-left {
    width: 100%;
  }
  .header-strip-right {
    width: 100%;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: space-between;
  }
  .booth-quick-search-box {
    flex: 1;
    min-width: 180px;
    width: auto;
  }
  .stat-tiles-group {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* 4. Mobile Phones (<= 640px) */
@media (max-width: 640px) {
  .top-nav-bar {
    min-height: 56px;
    padding: 0.35rem 0.55rem;
    gap: 0.35rem;
  }
  .kpcc-sub {
    display: none;
  }
  .kpcc-title {
    font-size: 1.1rem;
  }
  .kpcc-logo-img {
    height: 32px;
  }
  .nav-left {
    gap: 0.45rem;
  }
  .nav-right {
    gap: 0.45rem;
  }
  .nav-leaders-group {
    gap: 0.3rem;
  }
  .leader-photo-item {
    width: 32px;
    height: 32px;
  }
  .nav-center-direct {
    padding: 0 0.25rem;
  }
  .nav-center-direct .header-center-main-title {
    font-size: 0.78rem;
    letter-spacing: 0;
  }
  .nav-center-direct .header-center-sub-title {
    font-size: 0.62rem;
  }
  .theme-toggle-btn {
    width: 32px;
    height: 32px;
  }
  .mobile-hamburger-btn {
    width: 32px;
    height: 32px;
  }
  .stat-tiles-group {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.45rem;
  }
  .asddo-chart-legend-flex,
  .religion-body-flex {
    flex-direction: column;
    text-align: center;
    gap: 1rem;
  }
  .religion-donut-wrap {
    width: 100%;
  }
  .special-segments-split-wrap {
    flex-direction: column;
    min-height: auto;
    text-align: center;
  }
  .special-pie-holder {
    margin: 0 auto;
  }
  .voter-composition-wrap {
    flex-direction: column;
    text-align: center;
  }
  .family-stats-grid {
    grid-template-columns: 1fr;
    gap: 0.65rem;
  }
  .navy-reduction-banner {
    padding: 0.75rem 0.85rem;
  }
  .banner-line-two {
    font-size: 1rem;
  }
  .chart-drop-icon svg {
    width: 26px;
    height: 26px;
  }
  .card-inner-body {
    padding: 0.65rem 0.75rem;
  }
}

/* 5. Extra Small Devices (<= 420px) */
@media (max-width: 420px) {
  .stat-tiles-group {
    grid-template-columns: 1fr 1fr;
  }
  .tile-number-val {
    font-size: 0.92rem;
  }
  .stat-tile-card {
    padding: 0.45rem 0.2rem;
  }
  .header-strip-right {
    flex-direction: column;
    align-items: stretch;
  }
  .export-pdf-btn {
    width: 100%;
    justify-content: center;
  }
  .page-title {
    font-size: 1.2rem;
  }
  .login-card {
    padding: 1.75rem 1.15rem;
    width: 92%;
  }
  .login-title {
    font-size: 1.35rem;
  }
  .nav-center-direct .header-center-main-title {
    font-size: 0.72rem;
  }
  .nav-center-direct .header-center-sub-title {
    font-size: 0.58rem;
  }
}
