/* ==========================================================================
   Modern CSS Design System - Multi-User Expense Tracker & Receipt OCR
   Aesthetics: Glassmorphism, Dark/Light Themes, Neon Accents, Smooth Motion
   ========================================================================== */

:root {
  --bg-primary: #0b0f19;
  --bg-secondary: #111827;
  --bg-card: rgba(17, 24, 39, 0.75);
  --bg-card-hover: rgba(31, 41, 55, 0.85);
  --bg-nav: rgba(11, 15, 25, 0.85);
  --bg-input: rgba(0, 0, 0, 0.3);
  --bg-input-focus: rgba(0, 0, 0, 0.45);
  --bg-subtle-item: rgba(255, 255, 255, 0.03);
  --bg-table-header: rgba(0, 0, 0, 0.3);
  --bg-hover-row: rgba(255, 255, 255, 0.04);
  --bg-btn-secondary: rgba(255, 255, 255, 0.08);
  --bg-btn-secondary-hover: rgba(255, 255, 255, 0.15);
  --bg-btn-icon: rgba(255, 255, 255, 0.05);
  --bg-badge: rgba(0, 0, 0, 0.3);

  --hero-gradient: linear-gradient(135deg, rgba(30, 41, 59, 0.85), rgba(15, 23, 42, 0.95));
  --hero-title-gradient: linear-gradient(to right, #ffffff, var(--accent-blue));

  --border-color: rgba(255, 255, 255, 0.1);
  --border-accent: rgba(56, 189, 248, 0.3);

  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --accent-blue: #38bdf8;
  --accent-purple: #a855f7;
  --accent-emerald: #10b981;
  --accent-amber: #f59e0b;
  --accent-rose: #f43f5e;
  --accent-cyan: #06b6d4;

  --shadow-main: 0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 25px rgba(56, 189, 248, 0.15);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  --font-family: 'Inter', system-ui, -apple-system, sans-serif;
  --transition-fast: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="light"] {
  --bg-primary: #f1f5f9;
  --bg-secondary: #ffffff;
  --bg-card: rgba(255, 255, 255, 0.9);
  --bg-card-hover: rgba(248, 250, 252, 1);
  --bg-nav: rgba(255, 255, 255, 0.85);
  --bg-input: #ffffff;
  --bg-input-focus: #ffffff;
  --bg-subtle-item: #f8fafc;
  --bg-table-header: #f1f5f9;
  --bg-hover-row: #e2e8f0;
  --bg-btn-secondary: #e2e8f0;
  --bg-btn-secondary-hover: #cbd5e1;
  --bg-btn-icon: #e2e8f0;
  --bg-badge: #e2e8f0;

  --hero-gradient: linear-gradient(135deg, #e0f2fe, #f3e8ff);
  --hero-title-gradient: linear-gradient(to right, #0f172a, #0284c7);

  --border-color: rgba(0, 0, 0, 0.12);
  --border-accent: rgba(56, 189, 248, 0.5);

  --text-primary: #0f172a;
  --text-secondary: #334155;
  --text-muted: #64748b;

  --accent-blue: #0284c7;
  --accent-purple: #9333ea;
  --accent-emerald: #059669;
  --accent-amber: #d97706;
  --accent-rose: #e11d48;

  --shadow-main: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.03);
  --shadow-glow: 0 0 20px rgba(2, 132, 199, 0.15);
}

/* Reset & Global Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.5;
  overflow-x: hidden;
  background-image: 
    radial-gradient(at 0% 0%, rgba(56, 189, 248, 0.08) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(168, 85, 247, 0.08) 0px, transparent 50%);
  background-attachment: fixed;
}

/* Glassmorphism Panel Utility */
.glass-panel {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-main);
  transition: var(--transition-normal);
}

.glass-panel:hover {
  border-color: rgba(255, 255, 255, 0.18);
}

/* Layout App Shell */
.app-container {
  display: flex;
  min-height: 100vh;
}

/* Sidebar Navigation */
.sidebar {
  width: 260px;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  padding: 1.5rem 1rem;
  position: fixed;
  height: 100vh;
  top: 0;
  left: 0;
  z-index: 100;
  transition: var(--transition-normal);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0 0.5rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
}

.brand-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 1.2rem;
  box-shadow: 0 0 15px rgba(56, 189, 248, 0.4);
}

.brand-title {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  background: var(--hero-title-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.nav-menu {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 1.5rem;
  flex: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.75rem 1rem;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: var(--radius-md);
  font-weight: 500;
  transition: var(--transition-fast);
}

.nav-item:hover {
  background: var(--bg-btn-secondary);
  color: var(--text-primary);
}

.nav-item.active {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.15), rgba(168, 85, 247, 0.15));
  color: var(--accent-blue);
  border: 1px solid var(--border-accent);
}

.sidebar-footer {
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* Main Content Area */
.main-content {
  margin-left: 260px;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Header Navbar */
.top-navbar {
  height: 70px;
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-nav);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 90;
}

.top-navbar-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.currency-badge {
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-emerald);
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 0.35rem 0.75rem;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
}

/* User Switcher Component Styles */
.user-switcher-wrapper {
  position: relative;
}

.user-profile-pill {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.4rem 0.85rem 0.4rem 0.4rem;
  border-radius: 30px;
  cursor: pointer;
  background: var(--bg-btn-secondary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.user-profile-pill:hover {
  border-color: var(--border-accent);
  background: var(--bg-btn-secondary-hover);
}

.user-avatar-circle {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  color: #fff;
  font-weight: 700;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

.user-avatar-circle.small {
  width: 28px;
  height: 28px;
  font-size: 0.75rem;
}

.user-pill-info {
  display: flex;
  flex-direction: column;
  text-align: left;
  line-height: 1.2;
}

.user-pill-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
}

.user-pill-role {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.user-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 260px;
  padding: 0.85rem;
  z-index: 500;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
}

.dropdown-header {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  padding: 0.25rem 0.5rem;
}

.dropdown-user-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.dropdown-user-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.75rem;
  border-radius: var(--radius-sm);
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-primary);
  cursor: pointer;
  width: 100%;
  text-align: left;
  transition: var(--transition-fast);
}

.dropdown-user-item:hover {
  background: var(--bg-btn-secondary);
}

.dropdown-user-item.active {
  background: rgba(56, 189, 248, 0.12);
  border-color: rgba(56, 189, 248, 0.3);
}

.user-item-details {
  flex: 1;
}

.dropdown-footer {
  padding-top: 0.5rem;
}

.user-profile-manage-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1rem;
  margin-bottom: 0.55rem;
  background: var(--bg-subtle-item);
  border: 1px solid var(--border-color);
}

.user-manage-left {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.user-manage-actions {
  display: flex;
  gap: 0.35rem;
}

.color-picker-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* View Container Padding */
.content-body {
  padding: 2rem;
  flex: 1;
}

.tab-view.hidden {
  display: none !important;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.25rem;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: var(--transition-fast);
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-blue), #0284c7);
  color: #fff;
  box-shadow: 0 4px 12px rgba(56, 189, 248, 0.25);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(56, 189, 248, 0.4);
}

.btn-secondary {
  background: var(--bg-btn-secondary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background: var(--bg-btn-secondary-hover);
}

.btn-success {
  background: linear-gradient(135deg, var(--accent-emerald), #059669);
  color: #fff;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);
}

.btn-danger {
  background: rgba(244, 63, 94, 0.15);
  color: var(--accent-rose);
  border: 1px solid rgba(244, 63, 94, 0.3);
}

.btn-danger:hover {
  background: var(--accent-rose);
  color: #fff;
}

.btn-small {
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
}

.btn-large {
  padding: 0.85rem 1.75rem;
  font-size: 1rem;
}

.btn-icon {
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: var(--radius-sm);
  background: var(--bg-btn-icon);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-fast);
}

.btn-icon:hover {
  background: var(--bg-btn-secondary-hover);
  color: var(--text-primary);
}

/* Dashboard Hero & Cards */
.dashboard-hero {
  padding: 2.5rem;
  margin-bottom: 2rem;
  background: var(--hero-gradient) !important;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

.hero-text h1 {
  font-size: 1.85rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  background: var(--hero-title-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-text p {
  color: var(--text-secondary);
  font-weight: 500;
  max-width: 540px;
}

.hero-cta {
  display: flex;
  gap: 1rem;
}

.dashboard-metrics-grid, .crm-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.metric-card {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  position: relative;
  overflow: hidden;
}

.metric-card.interactive-card {
  cursor: pointer;
}

.metric-card.interactive-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-accent);
  box-shadow: var(--shadow-glow);
}

.card-icon-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.metric-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.metric-value {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.metric-subtext {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.icon-bubble {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

.danger-bubble { background: rgba(244, 63, 94, 0.15); color: var(--accent-rose); }
.accent-bubble { background: rgba(56, 189, 248, 0.15); color: var(--accent-blue); }
.success-bubble { background: rgba(16, 185, 129, 0.15); color: var(--accent-emerald); }
.info-bubble { background: rgba(168, 85, 247, 0.15); color: var(--accent-purple); }

/* Dashboard Two Column Layout */
.dashboard-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.dash-section {
  padding: 1.5rem;
}

.section-title-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.dash-expense-list, .dash-client-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.dash-expense-item, .dash-client-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1rem;
  background: var(--bg-subtle-item);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}

.exp-icon-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 0.75rem;
}

.exp-details {
  flex: 1;
}

/* Expenses Budget & Controls */
.crm-header-bar, .expenses-header-bar {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.crm-controls, .expense-controls {
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.search-input-wrapper {
  position: relative;
  flex: 1;
  min-width: 240px;
}

.search-input-wrapper input {
  width: 100%;
  padding: 0.65rem 1rem 0.65rem 2.5rem;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.9rem;
}

.search-icon {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--text-muted);
}

/* Data Table Component */
.table-container {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.9rem;
}

.data-table th {
  padding: 1rem 1.25rem;
  background: var(--bg-table-header);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border-color);
}

.data-table td {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-primary);
}

.data-table tr:hover td {
  background: var(--bg-hover-row);
}

/* Expenses Budget & Categories Bar */
.budget-summary-panel {
  padding: 1.5rem 2rem;
}

.budget-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 2rem;
  margin-bottom: 1rem;
}

.budget-progress-wrapper {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.progress-bar-bg {
  height: 10px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-blue), var(--accent-emerald));
  border-radius: 6px;
  transition: width 0.4s ease;
}

.progress-bar-fill.warning { background: var(--accent-amber); }
.progress-bar-fill.danger { background: var(--accent-rose); }

.progress-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

/* Categories Scroll Pills */
.categories-pills-scroll {
  display: flex;
  gap: 0.65rem;
  overflow-x: auto;
  padding-bottom: 0.85rem;
  margin-bottom: 1rem;
}

.pill-btn {
  background: var(--bg-btn-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 0.45rem 0.85rem;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  white-space: nowrap;
  transition: var(--transition-fast);
}

.pill-btn:hover {
  background: var(--bg-btn-secondary-hover);
  color: var(--text-primary);
}

.pill-btn.active {
  background: var(--bg-card);
  border-color: var(--accent-blue);
  color: var(--accent-blue);
}

.pill-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.pill-badge {
  background: var(--bg-badge);
  color: var(--text-secondary);
  padding: 0.1rem 0.4rem;
  border-radius: 8px;
  font-size: 0.75rem;
}

/* Receipt Scanner Module UI */
.scanner-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.drop-zone {
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-lg);
  padding: 3rem 2rem;
  text-align: center;
  transition: var(--transition-normal);
  background: var(--bg-subtle-item);
  min-height: 350px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.drop-zone.drag-over {
  border-color: var(--accent-blue);
  background: rgba(56, 189, 248, 0.08);
}

.upload-icon-wrapper {
  color: var(--accent-blue);
  margin-bottom: 1rem;
}

.drop-zone-preview img {
  max-width: 100%;
  max-height: 320px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-main);
  margin-bottom: 1rem;
}

.ocr-progress-box {
  margin-top: 1.5rem;
  padding: 1.25rem;
  background: var(--bg-subtle-item);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
}

.ocr-status-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  margin-bottom: 0.5rem;
}

.highlighted-field input {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--accent-emerald);
}

.input-currency-wrapper {
  position: relative;
}

.currency-symbol {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--accent-emerald);
  z-index: 1;
  pointer-events: none;
}

.input-currency-wrapper input {
  padding-left: 2.8rem;
}

/* Modals & Drawers */
.modal-backdrop {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  z-index: 1000;
}

.modal-card {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 90%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  z-index: 1001;
  padding: 2rem;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.close-modal-btn {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-muted);
  cursor: pointer;
}

.modal-body {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.form-row {
  display: flex;
  gap: 1rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  flex: 1;
}

.form-group label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.form-group input, .form-group select, .form-group textarea {
  padding-top: 0.65rem;
  padding-bottom: 0.65rem;
  padding-left: 0.85rem;
  padding-right: 0.85rem;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.9rem;
  font-family: var(--font-family);
}

.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  outline: none;
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.2);
  background: var(--bg-input-focus);
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

/* Toast Notifications */
#toast-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.toast-message {
  padding: 0.85rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.9rem;
  border-left: 4px solid var(--accent-emerald);
  transform: translateX(120%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.toast-message.show {
  transform: translateX(0);
}

/* Analytics Header & Layout */
.analytics-header {
  padding: 2rem;
  margin-bottom: 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  background: var(--hero-gradient) !important;
}

.export-actions {
  display: flex;
  gap: 0.75rem;
}

/* Analytics Charts */
.charts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.chart-card {
  padding: 1.5rem;
}

.chart-wrapper {
  height: 300px;
  position: relative;
  margin-top: 1rem;
}

.divider {
  border: none;
  border-top: 1px solid var(--border-color);
  margin: 1.25rem 0;
}

/* Helper Utilities */
.text-danger { color: var(--accent-rose); }
.text-success { color: var(--accent-emerald); }
.text-accent { color: var(--accent-blue); }
.text-warning { color: var(--accent-amber); }
.text-muted { color: var(--text-muted); }
.hidden { display: none !important; }
.w-full { width: 100%; }

/* Explicit Light Mode Component Overrides */
body[data-theme="light"] {
  background-color: #f1f5f9 !important;
  color: #0f172a !important;
  background-image: 
    radial-gradient(at 0% 0%, rgba(56, 189, 248, 0.12) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(168, 85, 247, 0.1) 0px, transparent 50%) !important;
}

body[data-theme="light"] .top-navbar {
  background: rgba(255, 255, 255, 0.9) !important;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1) !important;
}

body[data-theme="light"] #page-title {
  color: #0f172a !important;
}

body[data-theme="light"] .sidebar {
  background: #ffffff !important;
  border-right: 1px solid rgba(0, 0, 0, 0.08) !important;
}

body[data-theme="light"] .brand-title {
  color: #0f172a !important;
  font-weight: 700 !important;
  background: linear-gradient(to right, #0f172a, #0284c7) !important;
  -webkit-background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
}

body[data-theme="light"] .brand-icon {
  background: linear-gradient(135deg, #0284c7, #9333ea) !important;
  color: #ffffff !important;
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.3) !important;
}

body[data-theme="light"] .glass-panel:not(.dashboard-hero):not(.analytics-header) {
  background: #ffffff !important;
  border: 1px solid rgba(0, 0, 0, 0.08) !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04) !important;
}

body[data-theme="light"] .dashboard-hero,
body[data-theme="light"] .analytics-header {
  background: linear-gradient(135deg, #e0f2fe 0%, #f3e8ff 100%) !important;
  border: 1px solid rgba(56, 189, 248, 0.3) !important;
}

body[data-theme="light"] .hero-text h1,
body[data-theme="light"] .analytics-header h2 {
  background: linear-gradient(to right, #0f172a, #0284c7) !important;
  -webkit-background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
}

body[data-theme="light"] .hero-text p,
body[data-theme="light"] .analytics-header p {
  color: #334155 !important;
}

body[data-theme="light"] .user-profile-pill,
body[data-theme="light"] .btn-secondary,
body[data-theme="light"] .btn-icon,
body[data-theme="light"] .pill-btn {
  background: #f1f5f9 !important;
  color: #0f172a !important;
  border: 1px solid rgba(0, 0, 0, 0.12) !important;
}

body[data-theme="light"] .user-profile-pill:hover,
body[data-theme="light"] .btn-secondary:hover,
body[data-theme="light"] .btn-icon:hover,
body[data-theme="light"] .pill-btn:hover {
  background: #e2e8f0 !important;
}

body[data-theme="light"] input,
body[data-theme="light"] select,
body[data-theme="light"] textarea {
  background: #ffffff !important;
  color: #0f172a !important;
  border: 1px solid rgba(0, 0, 0, 0.15) !important;
}

body[data-theme="light"] input::placeholder,
body[data-theme="light"] textarea::placeholder {
  color: #94a3b8 !important;
}

body[data-theme="light"] .data-table th {
  background: #f1f5f9 !important;
  color: #334155 !important;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1) !important;
}

body[data-theme="light"] .data-table td {
  color: #0f172a !important;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06) !important;
}

body[data-theme="light"] .data-table tr:hover td {
  background: #f8fafc !important;
}

body[data-theme="light"] .dash-expense-item,
body[data-theme="light"] .dash-client-item,
body[data-theme="light"] .user-profile-manage-card,
body[data-theme="light"] .ocr-progress-box,
body[data-theme="light"] .drop-zone {
  background: #f8fafc !important;
  border: 1px solid rgba(0, 0, 0, 0.08) !important;
}

body[data-theme="light"] .modal-card {
  background: #ffffff !important;
  border: 1px solid rgba(0, 0, 0, 0.12) !important;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1) !important;
}

/* Mobile Navigation Bar & FAB */
.mobile-bottom-bar {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 64px;
  background: var(--bg-nav);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--border-color);
  z-index: 900;
  justify-content: space-around;
  align-items: center;
  padding: 0 0.5rem;
}

.mobile-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 500;
  cursor: pointer;
  padding: 0.4rem 0.6rem;
  border-radius: var(--radius-sm);
  transition: var(--transition-fast);
}

.mobile-nav-item.active {
  color: var(--accent-blue);
}

.mobile-fab-center {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-blue), #0284c7);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: -24px;
  box-shadow: 0 8px 20px rgba(56, 189, 248, 0.4);
  cursor: pointer;
  transition: var(--transition-fast);
}

.mobile-fab-center:active {
  transform: scale(0.92);
}

/* 1-Tap Quick Presets & Date Chips */
.presets-section {
  padding: 0.85rem;
  background: var(--bg-subtle-item);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  margin-bottom: 1rem;
}

.presets-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  display: block;
  margin-bottom: 0.5rem;
}

.presets-chips-row {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.35rem;
  -webkit-overflow-scrolling: touch;
}

.preset-chip {
  background: var(--bg-btn-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 0.4rem 0.75rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: var(--transition-fast);

}

.preset-chip:hover, .preset-chip:active {
  background: var(--accent-blue);
  color: #ffffff;
  border-color: var(--accent-blue);
}

.quick-date-chips {
  display: flex;
  gap: 0.35rem;
  margin-top: 0.35rem;
}

.date-chip {
  background: var(--bg-btn-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 0.72rem;
  font-weight: 500;
  padding: 0.2rem 0.5rem;
  border-radius: 12px;
  cursor: pointer;
}

.date-chip:hover {
  color: var(--text-primary);
  background: var(--bg-btn-secondary-hover);
}

.input-hint {
  font-size: 0.75rem;
  color: var(--accent-emerald);
  margin-top: 0.25rem;
  display: block;
}

/* Responsive Media Queries */
@media (max-width: 1024px) {
  .sidebar { width: 80px; padding: 1rem 0.5rem; }
  .sidebar-brand span, .nav-item span, .brand-title { display: none; }
  .main-content { margin-left: 80px; }
  .scanner-grid, .dashboard-columns, .charts-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .sidebar { display: none; }
  .main-content { margin-left: 0; padding-bottom: 70px; }
  .mobile-bottom-bar { display: flex; }
  .dashboard-hero { flex-direction: column; text-align: center; padding: 1.5rem; }
  .hero-cta { width: 100%; justify-content: center; }
  .w-full-mobile { width: 100% !important; }

  /* Mobile Bottom Sheet Modal */
  .modal-card.mobile-bottom-sheet {
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    transform: none;
    width: 100%;
    max-width: 100%;
    max-height: 85vh;
    border-radius: 20px 20px 0 0;
    border-bottom: none;
  }
}

@media (max-width: 640px) {
  .top-navbar { padding: 0 1rem; }
  .content-body { padding: 1rem; }
  .form-row { flex-direction: column; }
}

.login-screen-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: var(--bg-primary);
  background-image: 
    radial-gradient(at 0% 0%, rgba(56, 189, 248, 0.15) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(168, 85, 247, 0.15) 0px, transparent 50%);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.login-card {
  width: 100%;
  max-width: 420px;
  padding: 2.5rem 2rem;
  background: var(--bg-card);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-xl);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7), var(--shadow-glow);
  text-align: center;
}

.login-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 1.75rem;
}

.brand-icon.large {
  width: 56px;
  height: 56px;
  font-size: 1.75rem;
  border-radius: 16px;
  margin-bottom: 1rem;
}

.login-header h2 {
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
  background: linear-gradient(to right, #fff, var(--accent-blue));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.login-quick-demo {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border-color);
  text-align: center;
}
