/* ==========================================================================
   TGSPDCL Power Bill Intelligence & Power Factor Terminal
   Aesthetics: Luxury Financial / Executive Terminal (bananapatterns.com & hedgewall.in)
   Typography: Space Grotesk (Display & Brand) + Plus Jakarta Sans + JetBrains Mono (Tabular)
   ========================================================================== */

:root {
  /* Canvas & Obsidian Surfaces */
  --bg-base: #090d14;
  --bg-surface: #0f1523;
  --bg-surface-elevated: #141c2e;
  --bg-card: rgba(18, 25, 40, 0.72);
  --bg-card-hover: rgba(24, 33, 52, 0.88);
  --bg-table-header: #0b101a;
  --bg-table-sticky: #0b101a;
  --bg-sidebar: #0a0e17;

  /* Precision Hairline Borders */
  --border-hairline: rgba(255, 255, 255, 0.07);
  --border-subtle: rgba(255, 255, 255, 0.11);
  --border-medium: rgba(255, 255, 255, 0.17);
  --border-active: rgba(99, 102, 241, 0.5);

  /* Typography Colors */
  --text-main: #f8fafc;
  --text-heading: #ffffff;
  --text-muted: #94a3b8;
  --text-subtle: #64748b;
  --text-faint: #475569;

  /* Executive Brand & Semantic Accents */
  --accent-gold: #f59e0b;
  --accent-gold-light: #fbbf24;
  --accent-gold-glow: rgba(245, 158, 11, 0.15);

  --accent-emerald: #10b981;
  --accent-emerald-light: #34d399;
  --accent-emerald-glow: rgba(16, 185, 129, 0.15);

  --accent-cyan: #06b6d4;
  --accent-cyan-light: #38bdf8;
  --accent-cyan-glow: rgba(6, 182, 212, 0.15);

  --accent-rose: #f43f5e;
  --accent-rose-light: #fb7185;
  --accent-rose-glow: rgba(244, 63, 94, 0.15);

  --accent-indigo: #6366f1;
  --accent-indigo-light: #818cf8;

  /* Typographic Families */
  --font-display: 'Space Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

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

  /* Shadows */
  --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  --shadow-card-hover: 0 12px 36px -6px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  --shadow-modal: 0 24px 64px rgba(0, 0, 0, 0.75), inset 0 1px 0 rgba(255, 255, 255, 0.1);

  /* Spacing */
  --sidebar-width: 320px;
  --transition-fast: 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-smooth: 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ==========================================================================
   RESET & BASE ENVIRONMENT
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  color-scheme: dark;
}

body.dashboard-body {
  font-family: var(--font-sans);
  font-size: 0.875rem;
  line-height: 1.5;
  background-color: var(--bg-base);
  color: var(--text-main);
  height: 100vh;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background-image: 
    radial-gradient(1200px 600px at 50% -120px, rgba(99, 102, 241, 0.08) 0%, transparent 60%),
    radial-gradient(900px 500px at 100% 100%, rgba(16, 185, 129, 0.04) 0%, transparent 50%),
    radial-gradient(800px 400px at 0% 60%, rgba(245, 158, 11, 0.03) 0%, transparent 50%);
  background-attachment: fixed;
}

/* Custom Sleek Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 999px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.24);
}

.tabular {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}

.hidden {
  display: none !important;
}

/* APP SHELL LAYOUT */
.layout-wrapper {
  display: flex;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  position: relative;
}

/* ==========================================================================
   OFF-CANVAS SIDEBAR DRAWER (Smooth Slide & Blur)
   ========================================================================== */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-width);
  max-width: 88vw;
  height: 100vh;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  z-index: 90;
  transform: translateX(-100%);
  transition: transform var(--transition-smooth), box-shadow var(--transition-smooth);
  box-shadow: none;
}

.sidebar.open {
  transform: translateX(0);
  box-shadow: 20px 0 60px rgba(0, 0, 0, 0.7);
}

.sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(4, 7, 13, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 85;
  transition: opacity 0.24s ease;
}

.sidebar-backdrop.hidden {
  display: none;
  opacity: 0;
  pointer-events: none;
}

/* Sidebar Brand */
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border-hairline);
  background: rgba(255, 255, 255, 0.015);
}

.brand-logo {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.2) 0%, rgba(99, 102, 241, 0.2) 100%);
  border: 1px solid rgba(245, 158, 11, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-gold-light);
  flex-shrink: 0;
}

.brand-logo svg {
  width: 20px;
  height: 20px;
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-family: var(--font-display);
  font-size: 1.12rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-heading);
  line-height: 1.15;
}

.brand-subtitle {
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.01em;
}

.sidebar-close-btn {
  margin-left: auto;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-hairline);
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.sidebar-close-btn:hover {
  background: rgba(244, 63, 94, 0.15);
  color: var(--accent-rose-light);
  border-color: rgba(244, 63, 94, 0.3);
}

.sidebar-close-btn svg {
  width: 17px;
  height: 17px;
}

.sidebar-action-wrap {
  padding: 12px 18px;
}

.btn-block {
  width: 100%;
}

/* Sidebar Navigation Tabs */
.sidebar-nav-section {
  padding: 4px 12px;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.nav-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 9px 12px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-align: left;
}

.nav-item-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-item svg {
  width: 17px;
  height: 17px;
  color: var(--text-subtle);
  transition: color var(--transition-fast);
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-heading);
}

.nav-item.active {
  background: rgba(99, 102, 241, 0.12);
  color: var(--accent-indigo-light);
  border-color: rgba(99, 102, 241, 0.28);
}

.nav-item.active svg {
  color: var(--accent-indigo-light);
}

.nav-count {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-subtle);
  font-family: var(--font-mono);
}

.nav-item.active .nav-count {
  background: rgba(99, 102, 241, 0.24);
  color: #c7d2fe;
}

/* Sidebar Lifts Filter Section */
.sidebar-lifts-header {
  padding: 14px 18px 8px 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-top: 1px solid var(--border-hairline);
  margin-top: 8px;
}

.lifts-header-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-subtle);
}

.btn-reset-all {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
  border: 1px solid var(--border-hairline);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-reset-all:hover {
  background: var(--accent-indigo);
  color: #fff;
  border-color: var(--accent-indigo);
}

.sidebar-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.sidebar-search-wrap svg {
  position: absolute;
  left: 10px;
  width: 14px;
  height: 14px;
  color: var(--text-subtle);
  pointer-events: none;
}

.sidebar-search-wrap input {
  width: 100%;
  padding: 7px 10px 7px 32px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--border-hairline);
  color: var(--text-main);
  font-size: 0.78rem;
  font-family: var(--font-sans);
  outline: none;
  transition: all var(--transition-fast);
}

.sidebar-search-wrap input:focus {
  border-color: var(--accent-indigo);
  background: rgba(255, 255, 255, 0.06);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

/* Scrollable Lifts Scheme List */
.sidebar-lifts-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 4px 12px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.sidebar-lift-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.sidebar-lift-item:hover {
  background: rgba(255, 255, 255, 0.035);
  border-color: var(--border-hairline);
}

.sidebar-lift-item.active {
  background: rgba(99, 102, 241, 0.12);
  border-color: rgba(99, 102, 241, 0.3);
}

.sidebar-item-delete {
  padding: 4px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  opacity: 0.45;
  transition: all var(--transition-fast);
  cursor: pointer;
}

.sidebar-lift-item:hover .sidebar-item-delete {
  opacity: 0.85;
}

.sidebar-item-delete:hover {
  color: var(--accent-rose) !important;
  background: rgba(244, 63, 94, 0.15) !important;
  opacity: 1 !important;
}

.lift-item-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-width: 75%;
}

.lift-item-name {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lift-item-sub {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.7rem;
  color: var(--text-subtle);
  font-family: var(--font-mono);
}

.sidebar-lift-skeleton {
  padding: 24px 12px;
  text-align: center;
  font-size: 0.78rem;
  color: var(--text-subtle);
}

/* Sidebar Footer */
.sidebar-footer {
  padding: 12px 18px;
  border-top: 1px solid var(--border-hairline);
  background: rgba(255, 255, 255, 0.015);
}

.server-status-pill {
  display: flex;
  align-items: center;
  gap: 10px;
}

.status-meta {
  display: flex;
  flex-direction: column;
}

.status-name {
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--text-muted);
}

.status-time {
  font-size: 0.7rem;
  font-family: var(--font-mono);
  color: var(--accent-emerald-light);
}

/* ==========================================================================
   MAIN DASHBOARD SHELL
   ========================================================================== */
.main-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  position: relative;
}

/* ==========================================================================
   TOP STICKY FROSTED NAVIGATION (bananapatterns & hedgewall style)
   ========================================================================== */
.top-header {
  position: sticky;
  top: 0;
  z-index: 40;
  height: 64px;
  background: rgba(9, 13, 20, 0.82);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-hairline);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  gap: 16px;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.header-hamburger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-hairline);
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.header-hamburger:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--border-subtle);
  transform: translateY(-1px);
}

.header-hamburger svg {
  width: 16px;
  height: 16px;
  color: var(--accent-gold-light);
}

.brand-badge-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-logo-mini {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.2) 0%, rgba(99, 102, 241, 0.2) 100%);
  border: 1px solid rgba(245, 158, 11, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-gold-light);
  flex-shrink: 0;
}

.brand-logo-mini svg {
  width: 17px;
  height: 17px;
}

.header-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-name {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--accent-gold-light);
  line-height: 1;
}

.brand-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--text-subtle);
}

.header-breadcrumb {
  display: flex;
  flex-direction: column;
}

.header-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-heading);
  line-height: 1.2;
}

.header-desc {
  font-size: 0.7rem;
  color: var(--text-subtle);
  font-weight: 500;
}

/* Header Center: Click here to add new service connection */
.header-center {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  max-width: 440px;
  margin: 0 16px;
}

/* Mobile Action Bar: Hidden on Desktop */
.mobile-action-bar {
  display: none;
}

.btn-header-add-mobile {
  display: none;
}

.btn-add-conn-pane {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  box-shadow: 0 2px 10px rgba(99, 102, 241, 0.25);
}

.btn-header-add {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 8px 18px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.18) 0%, rgba(6, 182, 212, 0.14) 100%);
  border: 1px solid rgba(99, 102, 241, 0.48);
  color: #ffffff;
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 2px 12px rgba(99, 102, 241, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  transition: all var(--transition-fast);
  position: relative;
  overflow: hidden;
}

.btn-header-add:hover {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.32) 0%, rgba(6, 182, 212, 0.26) 100%);
  border-color: rgba(129, 140, 248, 0.85);
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.4), 0 0 14px rgba(6, 182, 212, 0.28);
}

.btn-header-add:active {
  transform: translateY(0);
}

.btn-header-add-pulse {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-cyan-light);
  box-shadow: 0 0 8px var(--accent-cyan);
  animation: pulseCyanDot 2s infinite;
  flex-shrink: 0;
}

@keyframes pulseCyanDot {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.35;
    transform: scale(0.85);
  }
}

.btn-header-add .add-icon {
  width: 16px;
  height: 16px;
  color: var(--accent-gold-light);
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.btn-header-add:hover .add-icon {
  transform: rotate(90deg) scale(1.15);
}

.btn-header-add-text {
  letter-spacing: -0.01em;
  background: linear-gradient(90deg, #ffffff 0%, #e0e7ff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.btn-header-add .arrow-icon {
  width: 14px;
  height: 14px;
  color: var(--accent-cyan-light);
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.btn-header-add:hover .arrow-icon {
  transform: translateX(3px);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Header Status Badges */
.sync-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--border-hairline);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
  transition: all var(--transition-fast);
}

.sync-status-badge:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--border-subtle);
}

.sync-status-badge svg {
  width: 14px;
  height: 14px;
  color: var(--accent-cyan-light);
}

#autoSyncScheduleBadge {
  border-color: rgba(6, 182, 212, 0.25);
  background: rgba(6, 182, 212, 0.06);
  color: var(--accent-cyan-light);
}

/* Pulsing Status Dot */
.pulse-dot, .pulse-indicator {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: var(--accent-emerald-light);
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  animation: pulse-emerald 2s infinite cubic-bezier(0.66, 0, 0, 1);
  display: inline-block;
  flex-shrink: 0;
}

@keyframes pulse-emerald {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { box-shadow: 0 0 0 7px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* ==========================================================================
   SCROLLABLE CONTENT BODY
   ========================================================================== */
.content-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px 60px 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* ==========================================================================
   EXECUTIVE KPI CARDS (Minimalist, Architectural, Refined)
   ========================================================================== */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
}

.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: var(--shadow-card);
  transition: all var(--transition-smooth);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}

.kpi-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.12), transparent);
  pointer-events: none;
}

.kpi-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-medium);
  box-shadow: var(--shadow-card-hover);
  background: var(--bg-card-hover);
}

.kpi-card-header, .kpi-card .kpi-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* Eyebrow Label */
.kpi-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  line-height: 1.2;
}

/* Large Value */
.kpi-value {
  font-family: var(--font-display);
  font-size: 1.65rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.2;
  color: var(--text-heading);
  margin: 6px 0 4px 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Card Specific Hero Accents */
#kpiTotalPayableCard .kpi-value {
  color: var(--accent-gold-light);
}

#kpiConsumptionCard .kpi-value {
  color: var(--accent-emerald-light);
}

#kpiNetBillCard .kpi-value {
  color: #93c5fd;
}

.kpi-subtext {
  font-size: 0.74rem;
  color: var(--text-subtle);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Minimalist Icon Badge */
.kpi-icon-wrap {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--border-hairline);
  color: var(--text-muted);
}

.kpi-icon-wrap svg {
  width: 16px;
  height: 16px;
}

.kpi-icon-wrap.amber { color: var(--accent-gold-light); border-color: rgba(245, 158, 11, 0.25); background: rgba(245, 158, 11, 0.06); }
.kpi-icon-wrap.blue { color: #93c5fd; border-color: rgba(59, 130, 246, 0.25); background: rgba(59, 130, 246, 0.06); }
.kpi-icon-wrap.emerald { color: var(--accent-emerald-light); border-color: rgba(16, 185, 129, 0.25); background: rgba(16, 185, 129, 0.06); }
.kpi-icon-wrap.cyan { color: var(--accent-cyan-light); border-color: rgba(6, 182, 212, 0.25); background: rgba(6, 182, 212, 0.06); }
.kpi-icon-wrap.purple { color: #c084fc; border-color: rgba(168, 85, 247, 0.25); background: rgba(168, 85, 247, 0.06); }

/* ==========================================================================
   SUMMARY STRIP & FILTER PILLS (hedgewall & bananapatterns style)
   ========================================================================== */
.summary-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: rgba(14, 19, 29, 0.55);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(10px);
  gap: 16px;
}

.summary-filters {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px;
  border-radius: 999px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.filter-chip:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-heading);
}

.filter-chip.active {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.18);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.chip-indicator {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.ind-all { background: #94a3b8; }
.ind-danger { background: var(--accent-rose-light); }
.ind-amber { background: var(--accent-gold-light); }
.ind-idle { background: #64748b; }

.chip-badge {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-subtle);
}

.filter-chip.active .chip-badge {
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
}

.badge-danger { color: var(--accent-rose-light); }
.badge-amber { color: var(--accent-gold-light); }

.summary-metrics-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.summary-stat-box {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px;
  border-radius: var(--radius-sm);
  background: rgba(245, 158, 11, 0.07);
  border: 1px solid rgba(245, 158, 11, 0.22);
}

.stat-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--accent-gold-light);
}

.stat-val {
  font-family: var(--font-mono);
  font-size: 0.88rem;
  font-weight: 700;
  color: #fef08a;
}

/* ==========================================================================
   COLLAPSIBLE INGESTION ACCORDION CARD
   ========================================================================== */
.ingestion-card {
  background: var(--bg-card);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  transition: all var(--transition-fast);
}

.ingestion-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  background: rgba(255, 255, 255, 0.015);
  border-bottom: 1px solid transparent;
}

.ingestion-card:not(.collapsed) .ingestion-header {
  border-bottom-color: var(--border-hairline);
}

.ingestion-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ingest-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.25);
  color: var(--accent-indigo-light);
  display: flex;
  align-items: center;
  justify-content: center;
}

.ingest-icon svg {
  width: 17px;
  height: 17px;
}

.ingest-title {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-heading);
}

.ingest-subtitle {
  font-size: 0.74rem;
  color: var(--text-subtle);
}

.ingestion-body {
  padding: 18px 20px;
}

.ingestion-card.collapsed .ingestion-body,
.ingestion-body.collapsed {
  display: none !important;
}

.fetch-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-row-primary {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 16px;
  align-items: flex-start;
}

.form-row-dept {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 14px;
  align-items: flex-start;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-md);
}

.form-action-group {
  display: flex;
  justify-content: flex-end;
  margin-top: 2px;
}

.dept-cell {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 0.78rem;
  line-height: 1.35;
}

.dept-division {
  font-weight: 600;
  color: #e2e8f0;
  display: flex;
  align-items: center;
  gap: 4px;
}

.dept-circle {
  color: var(--text-muted);
  font-size: 0.73rem;
  display: flex;
  align-items: center;
  gap: 4px;
}

.dept-ce {
  color: var(--text-subtle);
  font-size: 0.70rem;
  display: flex;
  align-items: center;
  gap: 4px;
}

@media (max-width: 900px) {
  .form-row-primary,
  .form-row-dept {
    grid-template-columns: 1fr;
  }
}

.input-field-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.input-field-group label {
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--text-muted);
}

.input-field-group label .req {
  color: var(--accent-rose-light);
}

.input-with-icon {
  position: relative;
  display: flex;
  align-items: center;
}

.input-with-icon svg {
  position: absolute;
  left: 12px;
  width: 15px;
  height: 15px;
  color: var(--text-subtle);
  pointer-events: none;
}

.input-with-icon input, .modal-form input {
  width: 100%;
  padding: 8px 12px 8px 36px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  color: var(--text-heading);
  font-size: 0.84rem;
  font-family: var(--font-sans);
  outline: none;
  transition: all var(--transition-fast);
}

.input-with-icon input:focus, .modal-form input:focus {
  border-color: var(--accent-indigo);
  background: rgba(255, 255, 255, 0.07);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

.input-hint {
  font-size: 0.7rem;
  color: var(--text-subtle);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.chip-link {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-hairline);
  color: var(--accent-indigo-light);
  font-size: 0.68rem;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 4px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.chip-link:hover {
  background: rgba(99, 102, 241, 0.15);
  border-color: rgba(99, 102, 241, 0.3);
}

.alert-banner {
  margin-top: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  line-height: 1.4;
}

.alert-banner.success {
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #6ee7b7;
}

.alert-banner.error {
  background: rgba(244, 63, 94, 0.12);
  border: 1px solid rgba(244, 63, 94, 0.3);
  color: #fda4af;
}

/* ==========================================================================
   VIEW PANES & STICKY TOOLBAR
   ========================================================================== */
.data-view-container {
  display: flex;
  flex-direction: column;
}

.tab-pane {
  display: none;
}

.tab-pane.active {
  display: block;
  animation: tabFadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* Sticky Toolbar */
.sticky-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  margin-bottom: 12px;
  background: rgba(13, 18, 28, 0.6);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-md);
  backdrop-filter: blur(10px);
  gap: 14px;
}

.toolbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.search-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  width: 240px;
}

.search-input-wrap svg {
  position: absolute;
  left: 10px;
  width: 14px;
  height: 14px;
  color: var(--text-subtle);
  pointer-events: none;
}

.search-input-wrap input {
  width: 100%;
  padding: 6px 10px 6px 32px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  font-size: 0.78rem;
  font-family: var(--font-sans);
  outline: none;
  transition: all var(--transition-fast);
}

.search-input-wrap input:focus {
  border-color: var(--accent-indigo);
  background: rgba(255, 255, 255, 0.07);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

.filter-dropdown-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.74rem;
  color: var(--text-muted);
}

.dropdown-filter {
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  background: rgba(18, 25, 38, 0.9);
  border: 1px solid var(--border-subtle);
  color: var(--text-heading);
  font-size: 0.78rem;
  font-family: var(--font-sans);
  outline: none;
  cursor: pointer;
  max-width: 210px;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: all var(--transition-fast);
}

.dropdown-filter:focus,
.dropdown-filter:hover {
  border-color: var(--accent-indigo);
  background: rgba(24, 32, 48, 0.95);
}

.dropdown-filter option {
  background: #0f1523;
  color: #fff;
  padding: 6px 8px;
}

/* Filter Reset Button */
.filter-reset-btn {
  padding: 5px 10px !important;
  font-size: 0.75rem !important;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.filter-reset-btn:hover {
  background: rgba(99, 102, 241, 0.12);
  border-color: rgba(99, 102, 241, 0.35);
  color: var(--accent-indigo-light);
}

.filter-reset-btn svg {
  width: 13px;
  height: 13px;
}

/* ==========================================================================
   ACTIVE FILTER TAGS BADGE BAR
   ========================================================================== */
.active-filter-tags-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 14px;
  margin-bottom: 12px;
  border-radius: var(--radius-md);
  background: rgba(99, 102, 241, 0.07);
  border: 1px solid rgba(99, 102, 241, 0.22);
  backdrop-filter: blur(8px);
  animation: tabFadeIn 0.2s ease;
  gap: 12px;
}

.active-filter-tags-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-icon-indicator {
  width: 14px;
  height: 14px;
  color: var(--accent-indigo-light);
  flex-shrink: 0;
}

.filter-tag-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent-indigo-light);
  white-space: nowrap;
}

.filter-pills-container {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.active-filter-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px 3px 10px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.15);
  font-size: 0.74rem;
  color: var(--text-heading);
  animation: tabFadeIn 0.15s ease;
}

.pill-type {
  font-weight: 500;
  color: var(--text-subtle);
}

.pill-val {
  font-weight: 600;
  color: #fff;
  max-width: 220px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pill-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 1px;
  border-radius: 50%;
  color: var(--text-subtle);
  transition: all var(--transition-fast);
}

.pill-remove:hover {
  color: var(--accent-rose-light);
  background: rgba(244, 63, 94, 0.15);
}

.pill-remove svg {
  width: 12px;
  height: 12px;
}

.btn-clear-tags {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: transparent;
  border: 1px solid rgba(244, 63, 94, 0.3);
  color: var(--accent-rose-light);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition-fast);
}

.btn-clear-tags:hover {
  background: rgba(244, 63, 94, 0.15);
  border-color: rgba(244, 63, 94, 0.5);
}

.btn-clear-tags svg {
  width: 12px;
  height: 12px;
}

.pf-legend {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.7rem;
  color: var(--text-subtle);
}

.pf-legend-title {
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.pf-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.pf-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.pf-dot-good { background: var(--accent-emerald-light); }
.pf-dot-warn { background: var(--accent-gold-light); }
.pf-dot-danger { background: var(--accent-rose-light); }
.pf-dot-idle { background: #64748b; }

/* ==========================================================================
   TABLE CARD & EXECUTIVE LEDGER TABLE (Fintech / Terminal Grade)
   ========================================================================== */
.table-card {
  background: var(--bg-card);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.table-scroll-container {
  max-height: calc(100vh - 430px);
  min-height: 260px;
  overflow: auto;
  position: relative;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.82rem;
  white-space: nowrap;
}

/* Sticky Header */
.data-table thead th {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--bg-table-header);
  color: var(--text-muted);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 11px 14px;
  border-bottom: 1px solid var(--border-medium);
}

.data-table thead th.sortable {
  cursor: pointer;
  user-select: none;
  transition: color var(--transition-fast);
}

.data-table thead th.sortable:hover {
  color: var(--text-heading);
}

.sort-icon {
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-left: 4px;
  vertical-align: middle;
  color: var(--text-subtle);
}

/* Sticky Left Connection Column */
.th-sticky-col,
.data-table tbody td.td-sticky-col {
  position: sticky;
  left: 0;
  z-index: 15;
  background: var(--bg-table-sticky);
  border-right: 1px solid var(--border-subtle);
}

.data-table thead th.th-sticky-col {
  z-index: 25;
}

/* Table Body Rows */
.data-table tbody tr {
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  transition: background-color var(--transition-fast);
}

.data-table tbody tr:hover {
  background-color: rgba(255, 255, 255, 0.035);
}

.data-table tbody tr:hover .td-sticky-col {
  background-color: #111726;
}

.data-table tbody td {
  padding: 10px 14px;
  vertical-align: middle;
}

/* Numerical and Currency Alignment */
.th-num, .td-num {
  text-align: right;
}

/* Cells formatting */
.badge-scno {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
  color: #e2e8f0;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-hairline);
  padding: 2px 7px;
  border-radius: 5px;
  letter-spacing: 0.02em;
}

.scheme-cell {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.scheme-title {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-heading);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 240px;
}

.scheme-sub {
  font-size: 0.7rem;
  color: var(--text-subtle);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 240px;
}

.dates-cell {
  display: flex;
  flex-direction: column;
  gap: 1px;
  font-family: var(--font-mono);
}

.due-date-val {
  font-size: 0.78rem;
  font-weight: 600;
  color: #cbd5e1;
}

.bill-date-sub {
  font-size: 0.68rem;
  color: var(--text-subtle);
}

.energy-cell {
  display: flex;
  flex-direction: column;
  gap: 1px;
  font-family: var(--font-mono);
}

.kwh-main {
  font-size: 0.82rem;
  font-weight: 600;
  color: #e2e8f0;
}

.kvah-sub {
  font-size: 0.68rem;
  color: var(--text-subtle);
}

/* Power Factor Sparkline & Pill */
.pf-cell-wrap {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.pf-sparkline {
  width: 42px;
  height: 18px;
  overflow: visible;
  flex-shrink: 0;
}

.pf-badge {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  display: inline-block;
  letter-spacing: -0.01em;
}

.pf-good {
  background: rgba(16, 185, 129, 0.12);
  color: var(--accent-emerald-light);
  border: 1px solid rgba(16, 185, 129, 0.28);
}

.pf-warn {
  background: rgba(245, 158, 11, 0.12);
  color: var(--accent-gold-light);
  border: 1px solid rgba(245, 158, 11, 0.28);
}

.pf-danger {
  background: rgba(244, 63, 94, 0.12);
  color: var(--accent-rose-light);
  border: 1px solid rgba(244, 63, 94, 0.28);
}

.pf-idle {
  background: rgba(148, 163, 184, 0.08);
  color: var(--text-subtle);
  border: 1px solid rgba(148, 163, 184, 0.15);
}

/* Total Payable Highlighting (Never Truncated) */
.td-num.highlight {
  font-weight: 700;
  color: var(--accent-gold-light);
}

/* Status Badges */
.status-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.badge-emerald {
  background: rgba(16, 185, 129, 0.1);
  color: var(--accent-emerald-light);
  border: 1px solid rgba(16, 185, 129, 0.22);
}

.status-badge.badge-amber {
  background: rgba(245, 158, 11, 0.1);
  color: var(--accent-gold-light);
  border: 1px solid rgba(245, 158, 11, 0.22);
}

.status-badge.badge-danger {
  background: rgba(244, 63, 94, 0.1);
  color: var(--accent-rose-light);
  border: 1px solid rgba(244, 63, 94, 0.22);
}

.status-badge.badge-idle {
  background: rgba(148, 163, 184, 0.08);
  color: var(--text-subtle);
  border: 1px solid rgba(148, 163, 184, 0.16);
}

/* Action Buttons in Rows */
.action-btn-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn-icon {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-hairline);
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-icon:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--border-subtle);
  color: var(--text-heading);
  transform: translateY(-1px);
}

.btn-icon svg {
  width: 14px;
  height: 14px;
}

/* Skeleton Loading Animation */
.skeleton-row td {
  padding: 14px;
}

.skeleton-cell {
  height: 16px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.03) 25%, rgba(255, 255, 255, 0.07) 50%, rgba(255, 255, 255, 0.03) 75%);
  background-size: 200% 100%;
  border-radius: 4px;
  animation: skeletonShimmer 1.5s infinite linear;
}

@keyframes skeletonShimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Table Footer Meta */
.table-info-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  font-size: 0.72rem;
  color: var(--text-subtle);
  border-top: 1px solid var(--border-hairline);
  background: rgba(255, 255, 255, 0.01);
}

/* Buttons System */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  border: 1px solid transparent;
  white-space: nowrap;
}

.btn svg {
  width: 15px;
  height: 15px;
}

.btn-primary {
  background: var(--accent-gold);
  color: #1a1500;
  border-color: var(--accent-gold-light);
  font-weight: 700;
}

.btn-primary:hover {
  background: var(--accent-gold-light);
  box-shadow: 0 4px 14px var(--accent-gold-glow);
  transform: translateY(-1px);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--border-subtle);
  color: var(--text-main);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--border-medium);
  color: var(--text-heading);
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  border-color: var(--border-hairline);
  color: var(--text-muted);
}

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--border-subtle);
  color: var(--text-main);
}

.btn-sm {
  padding: 4px 10px;
  font-size: 0.74rem;
}

/* ==========================================================================
   TAB 2 & 3: CONNECTIONS & INGESTION GUIDE
   ========================================================================== */
.pane-header {
  margin-bottom: 14px;
}

.pane-title-group h2 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-heading);
}

.pane-subtitle {
  font-size: 0.74rem;
  color: var(--text-subtle);
}

.ingest-guide-card {
  background: var(--bg-card);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-card);
}

.guide-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.guide-card-step {
  padding: 16px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-md);
}

.step-badge {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--accent-indigo);
  color: #fff;
  font-weight: 700;
  font-size: 0.78rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}

.guide-card-step h4 {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-heading);
  margin-bottom: 6px;
}

.guide-card-step p {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.guide-card-step code {
  background: rgba(255, 255, 255, 0.07);
  padding: 1px 5px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--accent-gold-light);
}

/* ==========================================================================
   DASHBOARD FOOTER
   ========================================================================== */
.app-footer {
  padding: 12px 24px;
  border-top: 1px solid var(--border-hairline);
  background: rgba(9, 13, 20, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
}

.footer-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  font-size: 0.72rem;
  color: var(--text-subtle);
}

/* ==========================================================================
   MODAL WINDOWS & PREVIEWS
   ========================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(4, 7, 13, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: modalFadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-window {
  width: 95vw;
  max-width: 1200px;
  height: 90vh;
  background: var(--bg-surface);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-modal);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  background: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid var(--border-hairline);
}

.modal-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal-icon {
  width: 20px;
  height: 20px;
  color: var(--accent-gold-light);
}

.modal-header h3 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-heading);
}

.modal-sub {
  font-size: 0.7rem;
  color: var(--text-subtle);
}

.modal-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-body {
  flex: 1;
  background: #ffffff;
  position: relative;
}

.modal-body iframe {
  width: 100%;
  height: 100%;
  border: none;
}

/* Edit Nickname Modal */
.modal-dialog {
  width: 100%;
  max-width: 440px;
  background: var(--bg-surface);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-modal);
  overflow: hidden;
}

.modal-form {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 8px;
}

/* Mobile Cards Container (Visible < 1024px) */
.mobile-cards-container {
  display: none;
}

/* ==========================================================================
   RESPONSIVE BREAKPOINTS (Mobile & Tablet)
   ========================================================================== */
/* ==========================================================================
   RESPONSIVE BREAKPOINTS (Mobile & Tablet Optimization)
   ========================================================================== */
@media (max-width: 1360px) {
  .kpi-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 1024px) {
  .table-scroll-container {
    display: none !important;
  }

  .mobile-cards-container {
    display: flex !important;
    flex-direction: column;
    gap: 12px;
    padding: 4px 0 16px 0;
  }
}

/* Base Mobile Card Styles */
.mobile-cards-container {
  display: none;
}

.ledger-card-mobile {
  background: linear-gradient(145deg, rgba(19, 27, 43, 0.9) 0%, rgba(12, 17, 28, 0.95) 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
  padding: 15px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.ledger-card-mobile:active {
  transform: scale(0.99);
}

.card-mobile-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.card-mobile-title {
  font-family: var(--font-sans);
  font-size: 0.92rem;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.35;
  letter-spacing: -0.01em;
}

.card-mobile-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px 12px;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-md);
  padding: 12px;
}

.card-kv {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.card-k {
  font-size: 0.66rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.card-v {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
  word-break: break-word;
}

.card-v.highlight {
  color: var(--accent-gold-light);
  font-size: 1.02rem;
  font-weight: 800;
}

.card-mobile-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  gap: 8px;
  flex-wrap: wrap;
}

.card-mobile-bottom .action-btn-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-mobile-bottom .btn {
  padding: 6px 13px;
  font-size: 0.78rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

/* SMARTPHONE BREAKPOINTS (≤ 768px) */
@media (max-width: 768px) {
  /* Layout & Viewport */
  body.dashboard-body {
    overflow-x: hidden;
  }

  .content-body {
    padding: 12px 12px calc(76px + env(safe-area-inset-bottom, 0px)) 12px !important;
    gap: 14px;
    -webkit-overflow-scrolling: touch;
  }

  /* Header Optimization */
  .top-header {
    height: 56px;
    padding: 0 12px;
    gap: 8px;
  }

  .header-left {
    gap: 10px;
  }

  .brand-logo-mini {
    width: 28px;
    height: 28px;
  }

  .brand-logo-mini svg {
    width: 15px;
    height: 15px;
  }

  .header-desc {
    display: none;
  }

  .header-title {
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 180px;
  }

  .header-center {
    display: none !important;
  }

  /* Mobile Top Quick Action Bar: Prominent 'Click here to add new service connection' */
  .mobile-action-bar {
    display: flex !important;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    background: rgba(11, 17, 29, 0.98);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(99, 102, 241, 0.35);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
    position: sticky;
    top: 56px;
    z-index: 40;
  }

  .mobile-action-bar .mobile-add-btn {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.35) 0%, rgba(6, 182, 212, 0.3) 100%);
    border: 1.5px solid rgba(129, 140, 248, 0.75);
    color: #ffffff;
    font-family: var(--font-sans);
    font-size: 0.84rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 2px 14px rgba(99, 102, 241, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.18);
    white-space: nowrap;
    transition: all 0.15s ease;
  }

  .mobile-action-bar .mobile-add-btn:active {
    transform: scale(0.98);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.5) 0%, rgba(6, 182, 212, 0.45) 100%);
  }

  .mobile-action-bar .mobile-add-btn .btn-header-add-text {
    font-size: 0.84rem;
    font-weight: 700;
    letter-spacing: -0.01em;
  }

  /* Header Right Mobile Quick Add Button */
  .btn-header-add-mobile {
    display: inline-flex !important;
    align-items: center;
    gap: 4px;
    padding: 5px 9px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.35) 0%, rgba(6, 182, 212, 0.28) 100%);
    border: 1px solid rgba(129, 140, 248, 0.7);
    border-radius: var(--radius-sm);
    color: #ffffff;
    font-size: 0.74rem;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.25);
  }

  .btn-header-add-mobile svg {
    width: 14px;
    height: 14px;
    color: var(--accent-cyan-light);
  }

  .btn-add-conn-pane {
    width: 100%;
    margin-top: 10px;
    justify-content: center;
  }

  .btn-text-desktop, .hamburger-label {
    display: none !important;
  }

  /* KPI Grid: Clean Compact 2-Column Summary */
  .kpi-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
  }

  /* Make the Total Payable card span full width on top */
  .kpi-grid .kpi-card:first-child {
    grid-column: span 2;
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.15) 0%, rgba(18, 25, 40, 0.85) 100%);
    border-color: rgba(245, 158, 11, 0.35);
  }

  .kpi-card {
    padding: 10px 12px;
    border-radius: var(--radius-md);
  }

  .kpi-label {
    font-size: 0.64rem;
    letter-spacing: 0.04em;
  }

  .kpi-value {
    font-size: 1.25rem !important;
    line-height: 1.2;
  }

  .kpi-grid .kpi-card:first-child .kpi-value {
    font-size: 1.55rem !important;
    color: var(--accent-gold-light);
  }

  .kpi-sub {
    font-size: 0.66rem;
    margin-top: 2px;
  }

  /* Sticky Toolbar on Mobile */
  .sticky-toolbar {
    flex-direction: column;
    padding: 10px;
    gap: 10px;
    margin-bottom: 8px;
  }

  .toolbar-left {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .search-input-wrap {
    grid-column: span 2;
    width: 100%;
  }

  .search-input-wrap input {
    height: 40px;
    font-size: 0.84rem;
  }

  .filter-dropdown-wrap {
    width: 100%;
    margin: 0;
  }

  .dropdown-filter {
    height: 38px;
    width: 100%;
    font-size: 0.8rem;
  }

  .filter-reset-btn {
    grid-column: span 2;
    height: 36px;
    justify-content: center;
    width: 100%;
  }

  .toolbar-right {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 2px;
    -webkit-overflow-scrolling: touch;
  }

  .pf-legend {
    width: max-content;
  }

  /* Active Filter Tags Bar */
  .active-filter-tags-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  /* Forms & Modals on Mobile */
  .form-row-primary,
  .form-row-dept {
    grid-template-columns: 1fr !important;
    gap: 12px;
  }

  .input-with-icon input,
  .modal-form input {
    height: 44px;
    font-size: 0.9rem;
  }

  .modal-container {
    max-width: 95vw !important;
    margin: 10px !important;
    padding: 16px !important;
    border-radius: var(--radius-lg) !important;
  }

  /* Original Bill Notice Modal on Mobile: Fullscreen for Easy Reading */
  #billModal .modal-container {
    width: 100vw !important;
    height: 100vh !important;
    max-width: 100vw !important;
    max-height: 100vh !important;
    margin: 0 !important;
    border-radius: 0 !important;
    padding: 10px !important;
  }

  #billModal .modal-body {
    height: calc(100vh - 75px) !important;
  }

  /* Mobile Bottom Navigation Dock */
  .mobile-bottom-dock {
    position: fixed !important;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: rgba(9, 13, 22, 0.96);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex !important;
    align-items: center;
    justify-content: space-around;
    z-index: 85;
    padding: 0 4px;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.5);
  }

  .mobile-dock-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 0.68rem;
    font-weight: 600;
    font-family: var(--font-sans);
    padding: 6px 8px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.15s ease;
    flex: 1;
    touch-action: manipulation;
  }

  .mobile-dock-btn svg {
    width: 18px;
    height: 18px;
    color: var(--text-muted);
    transition: transform 0.15s ease, color 0.15s ease;
  }

  .mobile-dock-btn.active {
    color: var(--accent-gold-light);
  }

  .mobile-dock-btn.active svg {
    color: var(--accent-gold-light);
    transform: translateY(-2px);
  }

  .dock-add-icon-wrap {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366f1 0%, #06b6d4 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 10px rgba(99, 102, 241, 0.45);
    margin-bottom: -1px;
  }

  .dock-add-icon-wrap svg {
    width: 16px;
    height: 16px;
    color: #ffffff !important;
  }
}


.duplicate-alert-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}

.duplicate-alert-btn {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #fff;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: 0.15s;
}

.duplicate-alert-btn:hover {
  background: rgba(255, 255, 255, 0.22);
}

@keyframes inputPulseGlow {
  0% {
    box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.8);
    border-color: #818cf8;
  }
  50% {
    box-shadow: 0 0 0 8px rgba(99, 102, 241, 0);
    border-color: #06b6d4;
  }
  100% {
    box-shadow: 0 0 0 0 rgba(99, 102, 241, 0);
  }
}

.input-highlight-pulse {
  animation: inputPulseGlow 1.2s ease-in-out 2 !important;
  border-color: #818cf8 !important;
}
