/* ProLife Hub — Executive Premium Enterprise Design System */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800;900&family=JetBrains+Mono:wght@400;500;700&display=swap');

:root {
  /* PayLedger Executive Modern Design Tokens */
  --primary: #0F172A;
  --primary-gradient: linear-gradient(135deg, #0F172A 0%, #1E293B 100%);
  --accent-gradient: linear-gradient(135deg, #16A34A 0%, #15803D 100%);

  --secondary: #16A34A;
  --accent: #15803D;

  --ledger-green: #16A34A;
  --ledger-green-bg: rgba(22, 163, 74, 0.08);
  --ledger-green-border: rgba(22, 163, 74, 0.22);

  --ledger-red: #DC2626;
  --ledger-red-bg: rgba(220, 38, 38, 0.08);
  --ledger-red-border: rgba(220, 38, 38, 0.22);

  --bg-main: #F8FAFC;
  --bg-card: #FFFFFF;
  --bg-glass: rgba(255, 255, 255, 0.96);
  --text-primary: #0F172A;
  --text-secondary: #334155;
  --text-muted: #64748B;

  --success: #16A34A;
  --warning: #D97706;
  --error: #DC2626;

  --sidebar-bg: #FFFFFF;
  --sidebar-text: #475569;
  --sidebar-hover-bg: #F8FAFC;
  --sidebar-hover-text: #0F172A;
  --sidebar-active-bg: #16A34A;
  --sidebar-active-text: #FFFFFF;

  --border-color: #E2E8F0;
  --border-focus: #16A34A;

  --shadow-sm: 0 1px 2px 0 rgba(15, 23, 42, 0.04);
  --shadow-md: 0 2px 6px 0 rgba(15, 23, 42, 0.06), 0 1px 3px 0 rgba(15, 23, 42, 0.03);
  --shadow-lg: 0 12px 24px -4px rgba(15, 23, 42, 0.08), 0 4px 6px -2px rgba(15, 23, 42, 0.03);
  --shadow-glow: 0 0 16px rgba(22, 163, 74, 0.14);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-full: 9999px;

  --transition: all 0.15s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Dark Mode Tokens */
[data-theme="dark"] {
  --primary: #F8FAFC;
  --primary-gradient: linear-gradient(135deg, #1E293B 0%, #0F172A 100%);
  --secondary: #22C55E;
  --accent: #16A34A;

  --ledger-green: #22C55E;
  --ledger-green-bg: rgba(34, 197, 94, 0.12);
  --ledger-green-border: rgba(34, 197, 94, 0.28);

  --ledger-red: #EF4444;
  --ledger-red-bg: rgba(239, 68, 68, 0.12);
  --ledger-red-border: rgba(239, 68, 68, 0.28);

  --bg-main: #0B0F19;
  --bg-card: #131B2E;
  --bg-glass: rgba(19, 27, 46, 0.94);
  --text-primary: #F8FAFC;
  --text-secondary: #94A3B8;
  --text-muted: #64748B;

  --sidebar-bg: #0B1120;
  --sidebar-text: #94A3B8;
  --sidebar-hover-bg: #1E293B;
  --sidebar-hover-text: #F8FAFC;
  --sidebar-active-bg: #16A34A;
  --sidebar-active-text: #FFFFFF;

  --border-color: rgba(255, 255, 255, 0.08);
  --border-focus: #22C55E;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 20px 40px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 20px rgba(34, 197, 94, 0.15);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Inter', 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

body {
  background-color: var(--bg-main);
  background-image: 
    radial-gradient(circle at 12% 12%, rgba(37, 99, 235, 0.02) 0%, transparent 45%),
    radial-gradient(circle at 88% 88%, rgba(15, 23, 42, 0.02) 0%, transparent 45%);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  transition: background-color 0.2s ease, color 0.2s ease;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: #CBD5E1;
  border-radius: var(--radius-full);
}
[data-theme="dark"] ::-webkit-scrollbar-thumb {
  background: #334155;
}

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

/* ==========================================================================
   Modernized Sidebar Navigation & Fintech Widget UI
   ========================================================================== */
.sidebar {
  width: 250px;
  background: var(--bg-card);
  border-right: 1px solid var(--border-color);
  padding: 14px 10px 14px 10px;
  display: flex;
  flex-direction: column;
  position: fixed;
  height: 100vh;
  height: 100dvh;
  z-index: 100;
  box-shadow: 1px 0 10px rgba(0, 0, 0, 0.03);
  transition: var(--transition);
  box-sizing: border-box;
}

[data-theme="dark"] .sidebar {
  background: #0B1120;
  border-right: 1px solid rgba(255, 255, 255, 0.07);
}

.brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 4px 12px 4px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 10px;
}

.brand-link {
  transition: opacity 0.15s ease;
}

.brand-link:hover {
  opacity: 0.9;
}

.brand-icon-wrapper {
  position: relative;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  flex-shrink: 0;
}

.brand-logo-img {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  object-fit: cover;
  box-shadow: 0 4px 12px rgba(22, 163, 74, 0.3);
}

.brand-pulse-dot {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #22C55E;
  border: 2px solid var(--bg-card);
  box-shadow: 0 0 6px rgba(34, 197, 94, 0.9);
  animation: pulseDot 2s infinite;
}

@keyframes pulseDot {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7); }
  70% { transform: scale(1.1); box-shadow: 0 0 0 5px rgba(34, 197, 94, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

.brand-app-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.4px;
  margin: 0;
  line-height: 1.1;
}

.brand-pro-pill {
  font-size: 8.5px;
  font-weight: 800;
  background: rgba(22, 163, 74, 0.15);
  color: var(--ledger-green);
  padding: 1.5px 5px;
  border-radius: 4px;
  border: 1px solid rgba(22, 163, 74, 0.25);
  letter-spacing: 0.5px;
}

.brand-store-name {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
  margin-top: 1px;
}

/* Sidebar Balance & Quick Action Snapshot Widget */
.sidebar-balance-widget {
  background: linear-gradient(135deg, rgba(22, 163, 74, 0.08) 0%, rgba(15, 23, 42, 0.03) 100%);
  border: 1px solid rgba(22, 163, 74, 0.2);
  border-radius: 13px;
  padding: 9px 11px;
  margin-bottom: 10px;
  transition: all 0.2s ease;
}

[data-theme="dark"] .sidebar-balance-widget {
  background: linear-gradient(135deg, rgba(22, 163, 74, 0.12) 0%, rgba(15, 23, 42, 0.7) 100%);
  border-color: rgba(22, 163, 74, 0.28);
}

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

.sb-widget-title {
  font-size: 9.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-muted);
}

.sb-widget-live-dot {
  font-size: 9px;
  font-weight: 800;
  color: #16A34A;
}

.sb-widget-amount {
  font-size: 17px;
  font-weight: 900;
  color: var(--text-primary);
  letter-spacing: -0.4px;
  margin: 2px 0 7px 0;
}

.sb-widget-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.sb-action-btn {
  font-size: 10.5px;
  font-weight: 700;
  padding: 5px 6px;
  border-radius: 7px;
  cursor: pointer;
  border: none;
  transition: all 0.15s ease;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
}

.sb-action-customer {
  background: rgba(22, 163, 74, 0.12);
  color: var(--ledger-green);
  border: 1px solid rgba(22, 163, 74, 0.3);
}

.sb-action-customer:hover {
  background: var(--ledger-green);
  color: #FFFFFF;
}

.sb-action-qr {
  background: linear-gradient(135deg, #16A34A, #15803D);
  color: #FFFFFF;
  box-shadow: 0 2px 8px rgba(22, 163, 74, 0.3);
}

.sb-action-qr:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

/* Nav Menu Section Headers */
.nav-section-label {
  font-size: 9.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  padding: 10px 8px 4px 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-section-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-color);
  opacity: 0.6;
}

[data-theme="dark"] .nav-section-label {
  color: #94A3B8;
}

/* Nav Menu Scrollable Container */
.nav-menu {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 2px;
  scrollbar-width: thin;
  scrollbar-color: rgba(148, 163, 184, 0.25) transparent;
}

.nav-menu::-webkit-scrollbar {
  width: 4px;
}

.nav-menu::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.25);
  border-radius: 4px;
}

/* Nav Items */
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6.5px 9px;
  color: var(--text-secondary);
  border-radius: 11px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.16s ease;
  text-decoration: none;
  position: relative;
  user-select: none;
}

.nav-item:hover {
  background: rgba(22, 163, 74, 0.08);
  color: var(--text-primary);
  transform: translateX(2px);
}

[data-theme="dark"] .nav-item {
  color: #CBD5E1;
}

[data-theme="dark"] .nav-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #FFFFFF;
}

.nav-icon-box {
  width: 27px;
  height: 27px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  background: rgba(0, 0, 0, 0.04);
  flex-shrink: 0;
  transition: all 0.16s ease;
}

[data-theme="dark"] .nav-icon-box {
  background: rgba(255, 255, 255, 0.06);
}

.nav-item-text {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-pill-badge {
  font-size: 9.5px;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.06);
  color: var(--text-muted);
  flex-shrink: 0;
}

[data-theme="dark"] .nav-pill-badge {
  background: rgba(255, 255, 255, 0.09);
  color: #94A3B8;
}

.upi-badge {
  background: rgba(22, 163, 74, 0.15) !important;
  color: var(--ledger-green) !important;
  border: 1px solid rgba(22, 163, 74, 0.3);
}

.nav-item.active {
  background: linear-gradient(135deg, #16A34A 0%, #15803D 100%) !important;
  color: #FFFFFF !important;
  box-shadow: 0 4px 14px rgba(22, 163, 74, 0.35) !important;
  transform: translateX(2px) !important;
}

.nav-item.active .nav-icon-box {
  background: rgba(255, 255, 255, 0.22);
  color: #FFFFFF;
}

.nav-item.active .nav-item-text {
  color: #FFFFFF !important;
  font-weight: 700;
}

.nav-item.active .nav-pill-badge {
  background: rgba(255, 255, 255, 0.25);
  color: #FFFFFF;
}

/* Sidebar Footer & User Profile */
.sidebar-footer {
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.sidebar-user-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 9px;
  border-radius: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  cursor: pointer;
  transition: all 0.18s ease;
}

[data-theme="dark"] .sidebar-user-card {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.08);
}

.sidebar-user-card:hover {
  border-color: rgba(22, 163, 74, 0.35);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
  transform: translateY(-1px);
}

.user-avatar-container {
  position: relative;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
}

.user-avatar {
  width: 100%;
  height: 100%;
  border-radius: 10px;
  background: linear-gradient(135deg, #16A34A 0%, #15803D 100%);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 14px;
  box-shadow: 0 2px 8px rgba(22, 163, 74, 0.25);
}

.online-badge {
  position: absolute;
  bottom: -1px;
  right: -1px;
  width: 10px;
  height: 10px;
  background: #22C55E;
  border: 2px solid var(--bg-card);
  border-radius: 50%;
}

.user-info {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  flex: 1;
  min-width: 0;
}

.user-name {
  font-size: 12.5px;
  font-weight: 800;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}

.user-role {
  font-size: 10.5px;
  color: var(--text-muted);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}

.sidebar-settings-shortcut {
  font-size: 14px;
  color: var(--text-muted);
  margin-left: auto;
  transition: transform 0.2s ease, color 0.2s ease;
  flex-shrink: 0;
}

.sidebar-user-card:hover .sidebar-settings-shortcut {
  transform: rotate(45deg);
  color: var(--ledger-green);
}

.sidebar-btn-install {
  width: 100%;
  font-size: 11px;
  font-weight: 700;
  padding: 7px 10px;
  border-radius: 9px;
  background: rgba(22, 163, 74, 0.09);
  border: 1px solid rgba(22, 163, 74, 0.3);
  color: var(--ledger-green);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.sidebar-btn-install:hover {
  background: var(--ledger-green);
  color: #FFFFFF;
}

.sidebar-btn-logout {
  width: 100%;
  font-size: 11px;
  font-weight: 700;
  padding: 6px 10px;
  border-radius: 9px;
  background: transparent;
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: var(--error);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.sidebar-btn-logout:hover {
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.4);
}

.main-content {
  margin-left: 240px;
  flex: 1;
  padding: 16px 20px 32px 20px;
  min-height: 100vh;
  width: calc(100% - 240px);
  max-width: calc(100% - 240px);
  box-sizing: border-box;
  overflow-x: hidden;
}

/* Header Bar */
.header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding: 12px 18px;
  border: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 90;
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  width: 100%;
  box-sizing: border-box;
}

.header-title h2 {
  font-size: 20px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.4px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* Form Controls */
.form-control {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 13px;
  color: var(--text-primary);
  outline: none;
  transition: var(--transition);
}

.form-control:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  border: none;
  outline: none;
  text-decoration: none;
}

.btn-primary {
  background: var(--secondary);
  color: #FFFFFF;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
}

.btn-primary:hover {
  background: #1D4ED8;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
}

.btn-primary:active {
  transform: translateY(0) scale(0.98);
}

.btn-glass {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}

.btn-glass:hover {
  background: var(--sidebar-hover-bg);
  border-color: var(--text-muted);
  transform: translateY(-1px);
}

.btn-success {
  background: var(--success);
  color: #FFFFFF;
  box-shadow: 0 2px 8px rgba(5, 150, 105, 0.2);
}

.btn-warning {
  background: var(--warning);
  color: #FFFFFF;
  box-shadow: 0 2px 8px rgba(217, 119, 6, 0.2);
}

.btn-revenue {
  background: var(--success);
  color: #FFFFFF !important;
  border: none;
  box-shadow: 0 2px 8px rgba(5, 150, 105, 0.2);
}

.btn-revenue:hover {
  background: #047857;
  color: #FFFFFF !important;
  transform: translateY(-1px);
}

.btn-expense {
  background: var(--error);
  color: #FFFFFF !important;
  border: none;
  box-shadow: 0 2px 8px rgba(220, 38, 38, 0.2);
}

.btn-expense:hover {
  background: #B91C1C;
  color: #FFFFFF !important;
  transform: translateY(-1px);
}

/* Theme Toggle Button */
.theme-toggle-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 9px 14px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}

.theme-toggle-btn:hover {
  transform: scale(1.04);
  border-color: var(--secondary);
}

/* Tab Content Visibility */
.tab-content {
  display: none;
  animation: fadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.tab-content.active {
  display: block;
}

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

/* Dashboard Welcome Banner */
.welcome-banner {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--secondary);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 28px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.welcome-banner::before {
  display: none;
}

.welcome-banner-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 20px;
}

.welcome-title {
  font-size: 24px;
  font-weight: 900;
  color: var(--text-primary);
  letter-spacing: -0.5px;
  margin-bottom: 6px;
}

.welcome-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  max-width: 620px;
  line-height: 1.5;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  background: rgba(16, 185, 129, 0.12);
  color: var(--success);
  font-size: 11px;
  font-weight: 800;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 8px var(--success);
  animation: pulseDot 2s infinite;
}

@keyframes pulseDot {
  0% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.3); opacity: 0.6; }
  100% { transform: scale(1); opacity: 1; }
}

/* Quick Action Pills */
.quick-actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.action-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 700;
  color: var(--text-primary);
  cursor: pointer;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}

.action-pill-btn:hover {
  background: var(--secondary);
  color: #FFFFFF;
  border-color: var(--secondary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow);
}

/* Cards & Metrics Grid */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 28px;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-md);
  transition: var(--transition);
  position: relative;
}

.card:hover {
  box-shadow: var(--shadow-lg);
}

.metric-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  box-shadow: var(--shadow-md);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.metric-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--accent-gradient);
  opacity: 0;
  transition: var(--transition);
}

.metric-card:hover::after {
  opacity: 1;
}

.metric-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(37, 99, 235, 0.35);
}

.metric-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.metric-title {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
}

.metric-icon-wrapper {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.icon-blue { background: rgba(37, 99, 235, 0.08); color: #2563EB; }
.icon-cyan { background: rgba(2, 132, 199, 0.08); color: #0284C7; }
.icon-amber { background: rgba(217, 119, 6, 0.08); color: #D97706; }
.icon-emerald { background: rgba(5, 150, 105, 0.08); color: #059669; }
.icon-rose { background: rgba(220, 38, 38, 0.08); color: #DC2626; }

.metric-value {
  font-size: 26px;
  font-weight: 900;
  color: var(--text-primary);
  letter-spacing: -0.5px;
  margin-bottom: 6px;
  font-family: 'Plus Jakarta Sans', sans-serif;
}

.metric-change {
  font-size: 11px;
  font-weight: 700;
}

.badge-success {
  color: var(--success);
  background: rgba(16, 185, 129, 0.1);
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.badge-danger {
  color: var(--error);
  background: rgba(239, 68, 68, 0.1);
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
}

.card-title {
  font-size: 17px;
  font-weight: 800;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 10px;
  letter-spacing: -0.3px;
}

/* Timelines & Lists */
.timeline-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.timeline-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  background: var(--bg-main);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  transition: var(--transition);
}

.timeline-item:hover {
  background: var(--bg-card);
  border-color: var(--text-muted);
  transform: translateX(3px);
}

.timeline-badge {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.timeline-content {
  flex: 1;
}

.timeline-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
}

.timeline-meta {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* KANBAN BOARD STYLING - ENTERPRISE MODERN SYSTEM */
.kanban-wrapper-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

.kanban-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 16px;
}

.kanban-header-title {
  font-size: 20px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.4px;
}

.kanban-header-subtitle {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.kanban-header-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.task-view-switcher {
  display: inline-flex;
  background: #F1F5F9;
  border-radius: 9999px;
  padding: 3px;
  border: 1px solid #E2E8F0;
}

[data-theme="dark"] .task-view-switcher {
  background: #1E293B;
  border-color: #334155;
}

.task-view-btn {
  padding: 6px 14px;
  border-radius: 9999px;
  border: none;
  background: transparent;
  font-size: 12px;
  font-weight: 700;
  color: #64748B;
  cursor: pointer;
  transition: all 0.15s ease;
}

[data-theme="dark"] .task-view-btn {
  color: #94A3B8;
}

.task-view-btn.active {
  background: var(--secondary);
  color: #FFFFFF !important;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
}

.kanban-search-input {
  width: 240px;
  padding: 8px 14px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-color);
  background: var(--bg-main);
  font-size: 12.5px;
  color: var(--text-primary);
  transition: all 0.2s ease;
}

.kanban-search-input:focus {
  outline: none;
  border-color: var(--secondary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
  background: var(--bg-card);
}

.kanban-board {
  display: grid;
  grid-template-columns: repeat(5, minmax(250px, 1fr));
  gap: 16px;
  overflow-x: auto;
  padding-bottom: 8px;
  -webkit-overflow-scrolling: touch;
}

.kanban-column {
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 16px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  min-height: 560px;
  transition: all 0.2s ease;
}

[data-theme="dark"] .kanban-column {
  background: #111827;
  border-color: #1F2937;
}

.kanban-column-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  border-radius: 12px;
  margin-bottom: 12px;
  font-weight: 700;
  font-size: 13px;
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

[data-theme="dark"] .kanban-column-header {
  background: #1E293B;
  border-color: #334155;
  color: #F8FAFC;
}

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

.col-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.dot-pending { background: #D97706; box-shadow: 0 0 6px rgba(217, 119, 6, 0.4); }
.dot-in_progress { background: #2563EB; box-shadow: 0 0 6px rgba(37, 99, 235, 0.4); }
.dot-waiting_for_followup { background: #64748B; box-shadow: 0 0 6px rgba(100, 116, 139, 0.4); }
.dot-completed { background: #059669; box-shadow: 0 0 6px rgba(5, 150, 105, 0.4); }
.dot-closed { background: #94A3B8; box-shadow: 0 0 6px rgba(148, 163, 184, 0.4); }

.kanban-column-title {
  font-size: 12.5px;
  font-weight: 800;
  color: #0F172A;
  letter-spacing: -0.2px;
}

[data-theme="dark"] .kanban-column-title {
  color: #F8FAFC;
}

.kanban-count-badge {
  background: #F1F5F9;
  color: #475569;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 800;
}

[data-theme="dark"] .kanban-count-badge {
  background: #334155;
  color: #CBD5E1;
}

.col-add-btn {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: none;
  background: #F1F5F9;
  color: #475569;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.col-add-btn:hover {
  background: var(--secondary);
  color: #FFFFFF;
}

.kanban-cards-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

/* Kanban Cards */
.kanban-card {
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 14px;
  padding: 14px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: grab;
  position: relative;
}

[data-theme="dark"] .kanban-card {
  background: #1E293B;
  border-color: #334155;
}

.kanban-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
  border-color: var(--secondary);
}

.kanban-card.dragging {
  opacity: 0.4 !important;
  border: 2px dashed var(--secondary) !important;
  transform: scale(0.97) rotate(1deg) !important;
  cursor: grabbing !important;
}

.kanban-column.drag-over {
  background: rgba(37, 99, 235, 0.04) !important;
  border: 2px dashed var(--secondary) !important;
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(22, 163, 74, 0.08) !important;
}

.kanban-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 6px;
}

.kanban-card-title {
  font-size: 13.5px;
  font-weight: 700;
  color: #0F172A;
  line-height: 1.35;
  letter-spacing: -0.2px;
}

[data-theme="dark"] .kanban-card-title {
  color: #F8FAFC;
}

.kanban-card-title.strikethrough {
  text-decoration: line-through;
  opacity: 0.6;
}

.kanban-card-edit-btn {
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 12px;
  opacity: 0.5;
  transition: opacity 0.15s ease;
  padding: 2px;
}

.kanban-card-edit-btn:hover {
  opacity: 1;
}

.kanban-card-desc {
  font-size: 12px;
  color: #64748B;
  margin-bottom: 12px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

[data-theme="dark"] .kanban-card-desc {
  color: #94A3B8;
}

.kanban-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid #F1F5F9;
  gap: 6px;
  flex-wrap: wrap;
}

[data-theme="dark"] .kanban-card-footer {
  border-top-color: #334155;
}

.kanban-card-actions {
  display: flex;
  gap: 4px;
  margin-left: auto;
}

.kanban-act-btn {
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.btn-act-start {
  background: var(--secondary);
  color: #FFFFFF;
}
.btn-act-start:hover {
  background: #1D4ED8;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

.btn-act-done {
  background: #10B981;
  color: #FFFFFF;
}
.btn-act-done:hover {
  background: #059669;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.btn-act-followup {
  background: #FEF3C7;
  color: #92400E;
}
.btn-act-followup:hover {
  background: #FDE68A;
}

.btn-act-reopen {
  background: #F1F5F9;
  color: #334155;
}
.btn-act-reopen:hover {
  background: #E2E8F0;
}

.btn-act-archive {
  background: #F1F5F9;
  color: #64748B;
}
.btn-act-archive:hover {
  background: #E2E8F0;
}

/* Modern Priority Badges */
.priority-badge {
  font-size: 10px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 12px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.badge-priority-urgent {
  background: #FEE2E2;
  color: #991B1B;
}
.badge-priority-high {
  background: #FFEDD5;
  color: #9A3412;
}
.badge-priority-medium {
  background: #FEF3C7;
  color: #92400E;
}
.badge-priority-low {
  background: #E0F2FE;
  color: #075985;
}

.kanban-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 10px;
  text-align: center;
  border: 2px dashed #E2E8F0;
  border-radius: 12px;
  margin-top: 10px;
}
.badge-priority-urgent { background: #FEE2E2; color: #B91C1C; }

.btn-xs {
  font-size: 11px !important;
  padding: 4px 10px !important;
  height: 26px !important;
  border-radius: 6px !important;
  white-space: nowrap !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 4px !important;
  font-weight: 700 !important;
  line-height: 1 !important;
}
.badge-priority-medium { background: rgba(245, 158, 11, 0.12); color: #D97706; }
.badge-priority-high { background: rgba(239, 68, 68, 0.12); color: #DC2626; }
.badge-priority-urgent { background: rgba(225, 29, 72, 0.12); color: #BE123C; }

.btn-xs {
  padding: 4px 8px !important;
  font-size: 10px !important;
  border-radius: 6px !important;
}

/* Search Dropdown */
.search-results-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  width: 380px;
  max-height: 400px;
  overflow-y: auto;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  z-index: 10000;
  padding: 8px 0;
}

.search-result-item {
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: var(--transition);
  border-bottom: 1px solid var(--border-color);
}

.search-result-item:hover {
  background: var(--sidebar-hover-bg);
}

.search-result-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
}

.search-result-sub {
  font-size: 11px;
  color: var(--text-muted);
}

.search-result-badge {
  font-size: 10px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  background: rgba(79, 70, 229, 0.12);
  color: var(--secondary);
}

/* Form Control, Alignment & Error Validation System */
/* Responsive Form Grid Rows */
.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.form-row-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
}

@media (max-width: 640px) {
  .form-row-2,
  .form-row-3 {
    grid-template-columns: 1fr !important;
    gap: 8px !important;
  }
}

.form-group {
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

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

.form-control,
.modal-card input,
.modal-card select,
.modal-card textarea {
  width: 100%;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: 14px;
  font-family: inherit;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  box-sizing: border-box;
}

.modal-card input:focus,
.modal-card select:focus,
.modal-card textarea:focus,
.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

.input-error,
.modal-card input.input-error,
.modal-card select.input-error,
.modal-card textarea.input-error {
  border: 2px solid var(--error) !important;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15) !important;
  animation: fieldShake 0.3s ease;
}

@keyframes fieldShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

/* Modals */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease;
}

.modal-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 28px;
  width: 90%;
  max-width: 520px;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: scaleUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
}

@keyframes scaleUp {
  from { transform: scale(0.94); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* Highlight section animation */
.section-highlight {
  animation: pulseHighlight 2s ease-out;
}

@keyframes pulseHighlight {
  0% { box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.6); transform: scale(1.005); }
  50% { box-shadow: 0 0 0 8px rgba(79, 70, 229, 0.3); }
  100% { box-shadow: 0 0 0 0 rgba(79, 70, 229, 0); transform: scale(1); }
}

/* AI Assistant Card & Input Group */
.ai-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 28px;
  box-shadow: var(--shadow-md);
}

.ai-input-group {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
  width: 100%;
}

.ai-input {
  flex: 1;
  width: 100%;
  padding: 11px 16px;
  background: var(--bg-main);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 13px;
  color: var(--text-primary);
  outline: none;
  transition: var(--transition);
}

.ai-input:focus {
  border-color: var(--secondary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

.prompt-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.prompt-chip {
  font-size: 11px;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: var(--radius-full);
  background: var(--bg-main);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
}

.prompt-chip:hover {
  background: var(--secondary);
  color: #FFFFFF;
  border-color: var(--secondary);
}

/* PLANORA ENTERPRISE CALENDAR DESIGN SYSTEM */
.planora-calendar-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 100%;
}

/* 1. Stat Cards Row (4 pastel metric cards) */
.planora-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  width: 100%;
}

.planora-stat-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.planora-stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.planora-stat-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.stat-icon-blue { background: #EFF6FF; color: #2563EB; border: 1px solid #DBEAFE; }
.stat-icon-green { background: #ECFDF5; color: #059669; border: 1px solid #D1FAE5; }
.stat-icon-red { background: #FEF2F2; color: #DC2626; border: 1px solid #FEE2E2; }
.stat-icon-purple { background: #F1F5F9; color: #475569; border: 1px solid #E2E8F0; }

.planora-stat-val {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.1;
}

.planora-stat-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
}

/* 2. Calendar Layout Grid (Main 1fr + Right Sidebar 340px) */
.planora-main-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 20px;
  align-items: start;
  width: 100%;
}

@media (max-width: 1240px) {
  .planora-stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .planora-main-grid {
    grid-template-columns: 1fr;
  }
}

/* View switcher pills */
.planora-view-switcher {
  display: flex;
  background: var(--bg-main);
  padding: 3px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-color);
}

.planora-view-btn {
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  border-radius: var(--radius-full);
  border: none;
  background: transparent;
  cursor: pointer;
  transition: var(--transition);
}

.planora-view-btn.active {
  background: var(--secondary);
  color: #FFFFFF;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
}

/* Day cell head & date numbers */
.calendar-day-head.sun-head {
  color: var(--error) !important;
  font-weight: 800;
}

.day-number-badge {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
}

.day-number-badge.is-today-active {
  background: var(--secondary) !important;
  color: #FFFFFF !important;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.35);
}

.day-number-badge.is-selected-active {
  background: rgba(22, 163, 74, 0.08);
  color: var(--secondary);
}

/* Planora Pill Events */
.planora-event-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 6px;
  border-radius: 6px;
  font-size: 10.5px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  cursor: pointer;
  transition: var(--transition);
  margin-bottom: 2px;
}

.planora-event-pill:hover {
  transform: scale(1.02);
}

.planora-event-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.pill-green { background: #ECFDF5; color: #065F46; border: 1px solid #D1FAE5; }
.pill-green .planora-event-dot { background: #059669; }

.pill-blue { background: #EFF6FF; color: #1E40AF; border: 1px solid #DBEAFE; }
.pill-blue .planora-event-dot { background: #2563EB; }

.pill-pink { background: #F1F5F9; color: #334155; border: 1px solid #E2E8F0; }
.pill-pink .planora-event-dot { background: #64748B; }

.pill-yellow { background: #FEF3C7; color: #92400E; border: 1px solid #FDE68A; }
.pill-yellow .planora-event-dot { background: #D97706; }

.pill-purple { background: #EEF2FF; color: #3730A3; border: 1px solid #E0E7FF; }
.pill-purple .planora-event-dot { background: #4F46E5; }

.pill-cyan { background: #F0F9FF; color: #0369A1; border: 1px solid #E0F2FE; }
.pill-cyan .planora-event-dot { background: #0284C7; }

/* Right Sidebar Modules */
.planora-sidebar-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-md);
}

.planora-sidebar-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 14px;
}

/* Mini Month Widget Grid */
.mini-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  text-align: center;
}

.mini-day-cell {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
  padding: 6px 0;
  border-radius: 50%;
  cursor: pointer;
  transition: var(--transition);
}

.mini-day-cell:hover {
  background: var(--sidebar-hover-bg);
}

.mini-day-cell.mini-active {
  background: var(--secondary);
  color: #FFFFFF;
  font-weight: 800;
}

/* Quick Actions 6-Pill Grid */
.planora-quick-actions-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.planora-action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-primary);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  cursor: pointer;
  transition: var(--transition);
}

.planora-action-btn:hover {
  background: var(--secondary);
  color: #FFFFFF;
  border-color: var(--secondary);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.btn-blue-act, .btn-green-act, .btn-pink-act, .btn-yellow-act, .btn-purple-act, .btn-cyan-act {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

/* Layout Grids for Responsive Desktop Screen Ratio */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 20px;
  align-items: start;
  width: 100%;
}

.responsive-two-column-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 20px;
  width: 100%;
}

/* Calendar System Layout (7 Columns Grid) */
.calendar-layout-container {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 20px;
  align-items: start;
  width: 100%;
}

.calendar-header-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
  text-align: center;
  width: 100%;
}

.calendar-day-head {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 8px 0;
  letter-spacing: 0.5px;
  background: var(--bg-main);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calendar-day-cell {
  background: var(--bg-main);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  min-height: 85px;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  cursor: pointer;
  transition: var(--transition);
  text-align: left;
  min-width: 0;
  overflow: hidden;
}

.calendar-day-cell:hover {
  border-color: var(--secondary);
  box-shadow: var(--shadow-sm);
  transform: translateY(-2px);
}

.calendar-day-cell.other-month {
  opacity: 0.4;
  background: transparent;
}

.calendar-day-cell.today {
  border: 2px solid var(--secondary);
  background: rgba(79, 70, 229, 0.05);
}

.calendar-day-cell.selected {
  background: rgba(79, 70, 229, 0.1);
  border-color: var(--secondary);
}

.day-number-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.day-number {
  font-size: 12px;
  font-weight: 800;
  color: var(--text-primary);
}

.event-count-dot {
  font-size: 10px;
  font-weight: 800;
  padding: 1px 5px;
  border-radius: var(--radius-full);
  background: var(--secondary);
  color: #FFFFFF;
}

.event-tag {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 5px;
  border-radius: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  display: block;
}

@media (max-width: 1200px) {
  .dashboard-grid, .calendar-layout-container {
    grid-template-columns: 1fr;
  }
}

.event-meeting { background: #FEF3C7; color: #92400E; }
.event-activity { background: #E0E7FF; color: #3730A3; }
.event-task { background: #CFFAFE; color: #0891B2; }
.event-expense { background: #FEE2E2; color: #991B1B; }

/* PROFLOW 9-ICON QUICK ADD GRID & EXTENDED MODULE STYLES */
.proflow-quick-add-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  padding: 10px 0;
}

.proflow-quick-add-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px 12px;
  border-radius: var(--radius-md);
  background: var(--bg-main);
  border: 1px solid var(--border-color);
  cursor: pointer;
  transition: var(--transition);
}

.proflow-quick-add-item:hover {
  transform: translateY(-3px);
  border-color: var(--secondary);
  box-shadow: var(--shadow-md);
}

.proflow-icon-circle {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.proflow-quick-add-item:hover .proflow-icon-circle {
  transform: scale(1.05);
}

.bg-act { background: #ECFDF5; color: #059669; border-color: #A7F3D0; }
.bg-meet { background: #EFF6FF; color: #2563EB; border-color: #BFDBFE; }
.bg-call { background: #F0F9FF; color: #0284C7; border-color: #BAE6FD; }
.bg-pay { background: #ECFDF5; color: #059669; border-color: #A7F3D0; }
.bg-exp { background: #FEF2F2; color: #DC2626; border-color: #FECACA; }
.bg-trv { background: #EFF6FF; color: #3B82F6; border-color: #DBEAFE; }
.bg-tsk { background: #F1F5F9; color: #475569; border-color: #CBD5E1; }
.bg-cli { background: #EEF2FF; color: #4F46E5; border-color: #C7D2FE; }
.bg-nte { background: #F8FAFC; color: #64748B; border-color: #E2E8F0; }

[data-theme="dark"] .bg-act, [data-theme="dark"] .bg-pay { background: rgba(5, 150, 105, 0.15); color: #6EE7B7; border-color: rgba(5, 150, 105, 0.3); }
[data-theme="dark"] .bg-exp { background: rgba(220, 38, 38, 0.15); color: #FCA5A5; border-color: rgba(220, 38, 38, 0.3); }
[data-theme="dark"] .bg-meet, [data-theme="dark"] .bg-trv { background: rgba(37, 99, 235, 0.15); color: #93C5FD; border-color: rgba(37, 99, 235, 0.3); }
[data-theme="dark"] .bg-call { background: rgba(2, 132, 199, 0.15); color: #7DD3FC; border-color: rgba(2, 132, 199, 0.3); }
[data-theme="dark"] .bg-tsk, [data-theme="dark"] .bg-nte { background: rgba(148, 163, 184, 0.12); color: #CBD5E1; border-color: rgba(148, 163, 184, 0.25); }
[data-theme="dark"] .bg-cli { background: rgba(99, 102, 241, 0.15); color: #A5B4FC; border-color: rgba(99, 102, 241, 0.3); }

.proflow-quick-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-primary);
  text-align: center;
}

/* Travel Mode Pills */
.travel-mode-row {
  display: flex;
  gap: 10px;
  margin-top: 8px;
}

.travel-mode-pill {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 8px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: var(--bg-main);
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
  transition: var(--transition);
}

.travel-mode-pill.active {
  background: #EFF6FF;
  border-color: #3B82F6;
  color: #1E40AF;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.2);
}

/* Reports Bar Chart */
.reports-bar-chart {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  height: 200px;
  padding: 20px 10px 0 10px;
  border-bottom: 2px solid var(--border-color);
}

.chart-bar-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  flex: 1;
}

.chart-bars-wrapper {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 150px;
}

.bar-income {
  width: 14px;
  background: linear-gradient(180deg, #3B82F6, #2563EB);
  border-radius: 4px 4px 0 0;
  transition: height 0.5s ease;
}

.bar-expense {
  width: 14px;
  background: linear-gradient(180deg, #EF4444, #DC2626);
  border-radius: 4px 4px 0 0;
  transition: height 0.5s ease;
}

.chart-month-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
}

/* Reports Donut Breakdown Progress Bars */
.breakdown-progress-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.breakdown-label {
  width: 90px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-primary);
}

.breakdown-track {
  flex: 1;
  height: 10px;
  background: var(--bg-main);
  border-radius: var(--radius-full);
  overflow: hidden;
  border: 1px solid var(--border-color);
}

.breakdown-fill {
  height: 100%;
  border-radius: var(--radius-full);
}

.breakdown-pct {
  width: 40px;
  text-align: right;
  font-size: 12px;
  font-weight: 800;
  color: var(--text-primary);
}

/* PROFLOW NATIVE MOBILE RESPONSIVE ENGINE */
.mobile-top-bar {
  display: none;
  position: sticky;
  top: 0;
  left: 0;
  width: 100%;
  height: 58px;
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-color);
  padding: 0 14px;
  align-items: center;
  justify-content: space-between;
  z-index: 102;
  box-shadow: var(--shadow-sm);
}

.mobile-hamburger {
  background: var(--bg-main);
  border: 1px solid var(--border-color);
  font-size: 16px;
  color: var(--text-primary);
  cursor: pointer;
  padding: 6px 10px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.mobile-hamburger:active {
  background: var(--sidebar-hover-bg);
  transform: scale(0.95);
}

/* ProFlow Native Mobile Bottom Navigation Bar */
.mobile-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100vw;
  height: 66px;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-top: 1px solid rgba(226, 232, 240, 0.9);
  display: none;
  align-items: center;
  justify-content: space-around;
  z-index: 105;
  box-shadow: 0 -8px 30px rgba(15, 23, 42, 0.08);
  padding: 0 10px;
}

[data-theme="dark"] .mobile-bottom-nav {
  background: rgba(15, 23, 42, 0.94);
  border-top: 1px solid rgba(30, 41, 59, 0.9);
  box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.4);
}

.mobile-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: #94A3B8;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  flex: 1;
  padding: 6px 0;
  position: relative;
  border-radius: var(--radius-md);
}

.mobile-nav-item.active {
  color: var(--secondary) !important;
  font-weight: 800;
}

[data-theme="dark"] .mobile-nav-item.active {
  color: #60A5FA !important;
}

/* Active Top Indicator Bar */
.mobile-nav-item.active::before {
  content: '';
  position: absolute;
  top: -1px;
  width: 24px;
  height: 3px;
  background: var(--secondary);
  border-radius: var(--radius-full);
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.4);
}

.mobile-nav-icon {
  font-size: 20px;
  transition: transform 0.2s ease;
}

.mobile-nav-item.active .mobile-nav-icon {
  transform: translateY(-2px) scale(1.1);
}

/* Central Floating Action Button (FAB) */
.mobile-fab-wrapper {
  position: relative;
  top: -18px;
  cursor: pointer;
  z-index: 110;
  flex: 0 0 60px;
  display: flex;
  justify-content: center;
}

.mobile-fab-btn {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: var(--secondary);
  color: #FFFFFF;
  font-size: 28px;
  font-weight: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.35);
  border: 4px solid var(--bg-card);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme="dark"] .mobile-fab-btn {
  border: 4px solid #0F172A;
}

.mobile-fab-btn:active {
  transform: scale(0.92);
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.4);
}

/* TABLET MEDIA QUERIES (768px <= Viewport Width <= 1024px) */
@media (min-width: 768px) and (max-width: 1024px) {
  /* Hide mobile top bar and mobile bottom nav on tablets */
  .mobile-top-bar { display: none !important; }
  .mobile-bottom-nav { display: none !important; }
  
  /* Compact Tablet Sidebar */
  .sidebar {
    width: 200px;
    padding: 16px 8px;
    transform: translateX(0) !important;
  }

  .brand {
    padding: 0 4px 12px 4px;
    margin-bottom: 12px;
  }

  .brand-icon-wrapper {
    width: 32px;
    height: 32px;
  }

  .brand-text h1 {
    font-size: 15px;
  }

  .nav-item {
    padding: 8px 10px;
    font-size: 11.5px;
    gap: 8px;
  }

  .nav-icon {
    font-size: 14px;
  }

  .user-profile {
    padding: 8px 10px;
  }

  .user-avatar {
    width: 30px;
    height: 30px;
    font-size: 12px;
  }

  .user-name {
    font-size: 11px;
  }

  .user-role {
    font-size: 9px;
  }

  /* Main Content Area on Tablet */
  .main-content {
    margin-left: 200px;
    width: calc(100% - 200px);
    max-width: calc(100% - 200px);
    padding: 16px 16px 32px 16px;
  }

  /* Header Bar on Tablet */
  .header-bar {
    display: flex !important;
    padding: 10px 14px;
    gap: 12px;
  }

  #globalSearchInput {
    width: 200px !important;
  }

  .header-actions {
    gap: 8px;
  }

  .header-actions .btn {
    padding: 6px 12px;
    font-size: 12px;
  }

  .theme-toggle-btn {
    padding: 6px 10px;
    font-size: 12px;
  }

  /* Welcome Banner on Tablet */
  .welcome-banner {
    padding: 20px;
  }

  .welcome-banner-header {
    flex-direction: row;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
  }

  .welcome-title {
    font-size: 21px;
  }

  .welcome-subtitle {
    font-size: 12px;
    max-width: 420px;
  }

  .welcome-banner-header > div:last-child {
    width: auto !important;
    padding: 10px 14px !important;
  }

  /* Tablet Grid Systems */
  .metrics-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 14px;
  }

  .planora-stats-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 12px;
  }

  .calendar-layout-container {
    grid-template-columns: 1fr !important;
    gap: 16px;
  }

  .kanban-board {
    grid-template-columns: repeat(5, minmax(200px, 1fr)) !important;
    overflow-x: auto;
    gap: 12px;
  }

  .calendar-grid {
    gap: 2px;
  }

  .calendar-day {
    min-height: 68px;
    padding: 4px;
  }

  /* Tablet Modal Overlay */
  .modal-overlay {
    align-items: center;
  }

  .modal-card {
    width: 90%;
    max-width: 540px;
    border-radius: var(--radius-lg);
  }
}

/* Mobile Media Queries (<= 768px Viewports — Unified Mobile Responsive Engine) */
@media (max-width: 768px) {
  /* Global Overflow & Viewport Lockdown */
  html, body {
    max-width: 100vw !important;
    overflow-x: hidden !important;
    -webkit-text-size-adjust: 100%;
  }

  .app-container {
    max-width: 100vw !important;
    overflow-x: hidden !important;
  }

  /* Hide desktop top header bar on mobile */
  .header-bar {
    display: none !important;
  }

  /* Mobile Top Bar Header */
  .mobile-top-bar {
    display: flex !important;
    height: 54px !important;
    padding: 0 10px !important;
    box-sizing: border-box;
  }

  .sidebar {
    transform: translateX(-100%);
    width: 280px;
    z-index: 110;
  }
  .sidebar.mobile-open {
    transform: translateX(0);
  }
  .mobile-sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(4px);
    z-index: 109;
  }
  .mobile-sidebar-overlay.active { display: block; }

  /* Main Viewport & Bottom Navigation Clearance */
  .main-content {
    margin-left: 0 !important;
    width: 100% !important;
    max-width: 100vw !important;
    box-sizing: border-box !important;
    padding: 12px 10px calc(80px + env(safe-area-inset-bottom, 14px)) 10px !important;
    overflow-x: hidden !important;
  }

  /* Welcome Banner Mobile Layout Fixes */
  .welcome-banner {
    padding: 14px !important;
    margin-bottom: 16px !important;
    border-radius: var(--radius-lg) !important;
  }

  .welcome-banner-header {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    margin-bottom: 12px;
  }

  .welcome-banner-header > div:first-child {
    width: 100%;
  }

  .welcome-banner-header > div:first-child > div:first-child {
    flex-wrap: wrap;
    gap: 6px;
  }

  .welcome-title {
    font-size: 19px !important;
  }

  .welcome-subtitle {
    font-size: 12px !important;
  }

  .welcome-banner-header > div:last-child {
    width: 100% !important;
    text-align: left !important;
    padding: 12px 14px !important;
  }

  /* Quick Action Buttons 2-Column Grid on Mobile */
  .quick-actions-row {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
    overflow-x: visible !important;
    padding-bottom: 0 !important;
  }

  .action-pill-btn {
    width: 100% !important;
    justify-content: center !important;
    padding: 10px 8px !important;
    font-size: 11.5px !important;
    border-radius: var(--radius-md) !important;
    text-align: center;
  }

  .quick-actions-row > button:last-child {
    grid-column: span 2;
  }

  /* Telemetry Banner Mobile Card Stack */
  .telemetry-banner-card {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 10px !important;
  }

  .telemetry-banner-card button {
    width: 100% !important;
    margin-top: 4px;
  }

  /* AI Input Group Mobile Column Stack */
  .ai-input-group {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 8px !important;
  }

  .ai-input-group button {
    width: 100% !important;
  }

  /* Prompt Chips Horizontal Swipe Row */
  .prompt-chips {
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    gap: 8px !important;
    padding-bottom: 4px !important;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .prompt-chips::-webkit-scrollbar {
    display: none;
  }

  .prompt-chip {
    flex-shrink: 0 !important;
    white-space: nowrap !important;
  }

  /* Mobile Card Container Padding */
  .card {
    padding: 14px 12px !important;
    border-radius: var(--radius-md) !important;
    margin-bottom: 16px !important;
  }

  /* Card Header Vertical Stacking */
  .card-header {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 12px !important;
  }

  .card-header > div,
  .card-header > button {
    width: 100% !important;
  }

  /* Tab Header Control Bars Responsive Stacking (Search + Dropdowns + Buttons) */
  .tab-content .card > div:first-child[style*="justify-content: space-between"] {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 12px !important;
  }

  .tab-content .card > div:first-child[style*="justify-content: space-between"] > div:last-child {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    gap: 8px !important;
  }

  .tab-content .card > div:first-child[style*="justify-content: space-between"] > div:last-child input,
  .tab-content .card > div:first-child[style*="justify-content: space-between"] > div:last-child select,
  .tab-content .card > div:first-child[style*="justify-content: space-between"] > div:last-child button {
    width: 100% !important;
    max-width: 100% !important;
    min-height: 40px !important;
  }

  /* Universal Two-Column Grid Override: 1 Column on Mobile to Prevent Overflow */
  .responsive-two-column-grid {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
    width: 100% !important;
  }

  /* Form Rows Override: 1 Column on Mobile */
  .form-row-2,
  .form-row-3,
  .form-row-split {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 10px !important;
    width: 100% !important;
  }

  /* Horizontal Swipe Sub-Navigation Tabs */
  #financeSubNavPills,
  #noteCategoryPills {
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 8px !important;
    padding-bottom: 6px !important;
  }

  #financeSubNavPills::-webkit-scrollbar,
  #noteCategoryPills::-webkit-scrollbar {
    display: none;
  }

  #financeSubNavPills .note-pill,
  #noteCategoryPills .note-pill {
    flex-shrink: 0 !important;
    white-space: nowrap !important;
    padding: 7px 12px !important;
    font-size: 11.5px !important;
  }

  /* Metric Cards Grid Layouts */
  .metrics-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
    margin-bottom: 16px !important;
  }

  .metric-card {
    padding: 12px 10px !important;
  }

  .metric-title {
    font-size: 10.5px !important;
    letter-spacing: 0.3px !important;
  }

  .metric-value {
    font-size: 19px !important;
  }

  .metric-change span {
    white-space: normal !important;
    font-size: 9.5px !important;
    display: inline-block;
    line-height: 1.2;
  }

  /* Planora Calendar Responsive */
  .planora-main-grid {
    grid-template-columns: 1fr !important;
    gap: 14px !important;
  }

  .planora-stats-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
  }

  .planora-stat-card {
    padding: 10px 12px !important;
  }

  .planora-stat-val {
    font-size: 18px !important;
  }

  .planora-view-switcher {
    width: 100% !important;
    display: flex !important;
  }

  .planora-view-btn {
    flex: 1 !important;
    text-align: center !important;
    padding: 6px 8px !important;
    font-size: 11.5px !important;
  }

  .calendar-header-nav {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
  }

  .calendar-header-nav > div:first-child {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    width: 100% !important;
  }

  #calendarMonthTitle {
    font-size: 18px !important;
  }

  .calendar-day-head {
    font-size: 10.5px !important;
    padding: 6px 0 !important;
    font-weight: 700 !important;
  }

  .calendar-day-cell {
    min-height: 50px !important;
    padding: 4px 2px !important;
    border-radius: 8px !important;
  }

  .calendar-day-number {
    font-size: 11px !important;
  }

  .planora-event-pill {
    padding: 2px 4px !important;
    font-size: 9px !important;
  }

  /* Kanban Board Swipeable Columns */
  .kanban-wrapper-card {
    padding: 14px 12px !important;
  }

  .kanban-header-bar {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 12px !important;
    margin-bottom: 16px !important;
  }

  .kanban-header-controls {
    flex-direction: column !important;
    align-items: stretch !important;
    width: 100% !important;
    gap: 8px !important;
  }

  .task-view-switcher {
    width: 100% !important;
    display: flex !important;
  }

  .task-view-btn {
    flex: 1 !important;
    text-align: center !important;
  }

  .kanban-search-input {
    width: 100% !important;
  }

  .kanban-header-controls .btn {
    width: 100% !important;
    min-height: 40px !important;
  }

  .kanban-board {
    display: flex !important;
    overflow-x: auto !important;
    scroll-snap-type: x mandatory;
    gap: 12px !important;
    padding-bottom: 14px !important;
    -webkit-overflow-scrolling: touch;
  }

  .kanban-column {
    flex: 0 0 82vw !important;
    max-width: 320px !important;
    min-width: 260px !important;
    scroll-snap-align: center;
    min-height: auto !important;
    height: auto !important;
  }

  /* Client Cards Mobile Grid */
  #clientsGrid .metric-card > div:last-child {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
    width: 100% !important;
  }

  #clientsGrid .metric-card > div:last-child .btn,
  #clientsGrid .metric-card > div:last-child a.btn {
    width: 100% !important;
    margin-left: 0 !important;
    justify-content: center !important;
    min-height: 38px !important;
  }

  /* Notes Grid Single Column on Mobile */
  #noteList {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }

  /* Timeline Items */
  .timeline-item {
    padding: 10px 12px !important;
    gap: 10px !important;
    word-break: break-word;
  }

  .timeline-content {
    min-width: 0 !important;
  }

  .timeline-title {
    font-size: 13px !important;
  }

  .status-tag {
    font-size: 10px !important;
    padding: 2px 6px !important;
    flex-shrink: 0;
  }

  /* Mobile Bottom Sheet Modals */
  .modal-overlay {
    align-items: flex-end !important;
    padding: 0 !important;
  }

  .modal-card {
    width: 100% !important;
    max-width: 100% !important;
    border-radius: 24px 24px 0 0 !important;
    max-height: 88vh !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
    animation: slideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    padding: 16px 18px calc(24px + env(safe-area-inset-bottom, 8px)) 18px !important;
    box-sizing: border-box;
  }

  /* Native Bottom Sheet Drag Indicator Handle */
  .modal-card::before {
    content: '';
    display: block;
    width: 36px;
    height: 4px;
    background: var(--border-color);
    border-radius: var(--radius-full);
    margin: 0 auto 12px auto;
  }

  .modal-card form > div[style*="justify-content: flex-end"],
  .modal-card form > div[style*="justify-content: space-between"] {
    display: flex !important;
    flex-direction: row !important;
    gap: 10px !important;
    margin-top: 18px !important;
  }

  .modal-card form button {
    min-height: 44px !important;
    font-size: 13.5px !important;
    font-weight: 700 !important;
  }

  .modal-card form > div[style*="justify-content: flex-end"] button {
    flex: 1 !important;
  }

  /* Prevent auto-zoom on mobile Safari / Chrome inputs */
  .modal-card input,
  .modal-card select,
  .modal-card textarea,
  .form-control {
    font-size: 16px !important;
  }

  /* Quick Add Grid */
  .proflow-quick-add-grid {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 10px !important;
  }

  /* Mobile Bottom Nav Safe Area Protection */
  .mobile-bottom-nav {
    display: flex !important;
    padding-bottom: max(6px, env(safe-area-inset-bottom, 8px)) !important;
    height: calc(62px + env(safe-area-inset-bottom, 8px)) !important;
  }

  .mobile-nav-item {
    padding: 6px 0 !important;
  }

  .mobile-nav-icon {
    font-size: 18px !important;
  }

  .mobile-nav-item span:last-child {
    font-size: 10px !important;
    font-weight: 700 !important;
  }

  /* Settings Profile Mobile Stack */
  #tab-settings .card:first-child > div {
    flex-direction: column !important;
    align-items: center !important;
    text-align: center !important;
    gap: 12px !important;
  }

  #tab-settings .card:first-child > div > div:last-child {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
  }

  #tab-settings .card:first-child > div > div:last-child > div {
    justify-content: center !important;
  }

  /* Mobile Tables Horizontal Scroll Protection */
  .table-responsive, table {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

/* Extra Compact Screens (<= 440px Viewports) */
@media (max-width: 440px) {
  .mobile-top-bar .btn:last-child {
    display: none !important;
  }

  .metrics-grid {
    gap: 8px !important;
  }

  .metric-card {
    padding: 10px 8px !important;
  }

  .metric-value {
    font-size: 17px !important;
  }

  .proflow-quick-add-grid {
    gap: 6px !important;
  }

  .proflow-icon-circle {
    width: 44px !important;
    height: 44px !important;
    font-size: 20px !important;
  }

  .proflow-quick-label {
    font-size: 11px !important;
  }
}

/* Toast Notifications Container & Animation - Top Center Banner */
.toast-container {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999999;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  pointer-events: none;
  width: 92%;
  max-width: 460px;
}

.toast {
  pointer-events: auto;
  width: 100%;
  padding: 14px 20px;
  background: rgba(15, 23, 42, 0.95);
  color: #ffffff;
  border-radius: 14px;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.4), 0 2px 6px rgba(255, 255, 255, 0.1);
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 12px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  animation: toastIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.toast-success {
  background: linear-gradient(135deg, #059669 0%, #10b981 100%) !important;
  color: #ffffff !important;
  border-color: rgba(255, 255, 255, 0.3) !important;
  box-shadow: 0 14px 32px rgba(16, 185, 129, 0.45) !important;
}

.toast-error {
  background: linear-gradient(135deg, #b91c1c 0%, #ef4444 100%) !important;
  color: #ffffff !important;
  border-color: rgba(255, 255, 255, 0.3) !important;
  box-shadow: 0 14px 32px rgba(239, 68, 68, 0.45) !important;
}

.toast-info {
  background: linear-gradient(135deg, #1d4ed8 0%, #3b82f6 100%) !important;
  color: #ffffff !important;
  border-color: rgba(255, 255, 255, 0.3) !important;
  box-shadow: 0 14px 32px rgba(59, 130, 246, 0.45) !important;
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(-30px) scale(0.92);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes toastOut {
  from {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateY(-24px) scale(0.92);
  }
}

/* Highlight section effect on search navigate */
.section-highlight {
  animation: highlightPulse 2s ease;
}

@keyframes highlightPulse {
  0% { box-shadow: 0 0 0 0 rgba(79, 70, 229, 0.4); }
  50% { box-shadow: 0 0 0 12px rgba(79, 70, 229, 0); }
  100% { box-shadow: 0 0 0 0 rgba(79, 70, 229, 0); }
}

/* Tab content smooth entrance animation */
.tab-content.active {
  display: block;
  animation: tabFadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

/* UNIFIED PREMIUM NOTES DESIGN SYSTEM (THEMED) */
.note-pill {
  background: var(--bg-main);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  padding: 7px 20px;
  font-weight: 700;
  font-size: 12px;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}

.note-pill:hover {
  background: var(--sidebar-hover-bg);
  color: var(--text-primary);
  border-color: var(--text-muted);
}

.note-pill.active {
  background: var(--primary) !important;
  color: #FFFFFF !important;
  border-color: var(--primary) !important;
  font-weight: 800;
  box-shadow: var(--shadow-sm);
}

.proflow-note-card {
  background: var(--bg-main);
  border-radius: var(--radius-lg);
  padding: 18px;
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 160px;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
  position: relative;
}

.proflow-note-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-focus);
  box-shadow: var(--shadow-md);
}

.proflow-note-title {
  font-size: 15px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 8px;
  line-height: 1.3;
}

.proflow-note-body {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

/* Floating Action Bar at Bottom of Notes */
.notes-floating-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  padding: 8px 14px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-color);
  max-width: 440px;
  margin: 0 auto;
  box-shadow: var(--shadow-lg);
}

.notes-icon-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--bg-main);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  font-size: 17px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

.notes-icon-btn:hover {
  background: var(--border-color);
}

.notes-create-btn {
  flex: 1;
  height: 44px;
  border-radius: var(--radius-full);
  background: var(--secondary);
  color: #FFFFFF;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.3px;
  border: none;
  margin: 0 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
  cursor: pointer;
  transition: var(--transition);
}

.notes-create-btn:hover {
  background: #1D4ED8;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
}

.notes-pen-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--primary);
  color: #FFFFFF;
  border: none;
  font-size: 17px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

.notes-pen-btn:hover {
  opacity: 0.9;
  transform: scale(1.05);
}

/* Touch Device Sticky Hover Removal & Instant Tactile Touch Feedback */
@media (hover: none), (max-width: 767px) {
  .card:hover,
  .metric-card:hover,
  .timeline-item:hover,
  .nav-item:hover,
  .btn-primary:hover,
  .btn-glass:hover,
  .action-pill-btn:hover,
  .prompt-chip:hover,
  .kanban-card:hover,
  .planora-stat-card:hover,
  .planora-event-pill:hover,
  .mini-day-cell:hover,
  .calendar-day-cell:hover,
  .proflow-quick-add-item:hover,
  .proflow-note-card:hover,
  .notes-icon-btn:hover,
  .notes-create-btn:hover,
  .notes-pen-btn:hover,
  .theme-toggle-btn:hover,
  .search-result-item:hover {
    transform: none !important;
    box-shadow: none !important;
  }

  /* Instant Tactile Touch Feedback on Tap */
  .card:active,
  .metric-card:active,
  .timeline-item:active,
  .btn-primary:active,
  .btn-glass:active,
  .action-pill-btn:active,
  .prompt-chip:active,
  .kanban-card:active,
  .proflow-quick-add-item:active,
  .proflow-note-card:active,
  .nav-item:active,
  .mobile-nav-item:active,
  .mobile-hamburger:active {
    transform: scale(0.97) !important;
    opacity: 0.9 !important;
    transition: transform 0.08s ease !important;
  }
}

/* Glass Card Theme Adaptive Fix */
.glass-card {
  background: var(--bg-card) !important;
  color: var(--text-primary) !important;
  border: 1px solid var(--border-color) !important;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.glass-card label,
.glass-card h3,
.glass-card h4,
.glass-card span {
  color: var(--text-primary) !important;
}

/* Live Backend & Database Connection Status Badge */
.connection-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  font-size: 11.5px;
  font-weight: 700;
  transition: all 0.25s ease;
  user-select: none;
  cursor: pointer;
}

.connection-status-pill.online {
  background: rgba(16, 185, 129, 0.12);
  color: #059669;
  border: 1px solid rgba(16, 185, 129, 0.35);
}

[data-theme="dark"] .connection-status-pill.online {
  background: rgba(16, 185, 129, 0.2);
  color: #34D399;
  border-color: rgba(52, 211, 153, 0.4);
}

.connection-status-pill.offline {
  background: rgba(239, 68, 68, 0.12);
  color: #DC2626;
  border: 1px solid rgba(239, 68, 68, 0.35);
  animation: pulse-border-red 2s infinite;
}

[data-theme="dark"] .connection-status-pill.offline {
  background: rgba(239, 68, 68, 0.2);
  color: #F87171;
  border-color: rgba(248, 113, 113, 0.4);
}

.connection-status-pill.checking {
  background: rgba(245, 158, 11, 0.12);
  color: #D97706;
  border: 1px solid rgba(245, 158, 11, 0.35);
}

.connection-status-pill .status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
}

.connection-status-pill.online .status-dot {
  background: #10B981;
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.8);
  animation: pulse-dot 1.8s infinite;
}

.connection-status-pill.offline .status-dot {
  background: #EF4444;
}

.connection-status-pill.checking .status-dot {
  background: #F59E0B;
  animation: pulse-dot 1.2s infinite;
}

@keyframes pulse-dot {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.3); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.8; }
}

@keyframes pulse-border-red {
  0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
  70% { box-shadow: 0 0 0 5px rgba(239, 68, 68, 0); }
  100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

.mobile-connection-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  cursor: pointer;
  margin-right: 4px;
}
.mobile-connection-dot.online {
  background: #10B981;
  box-shadow: 0 0 6px #10B981;
}
.mobile-connection-dot.offline {
  background: #EF4444;
  box-shadow: 0 0 6px #EF4444;
}
.mobile-connection-dot.checking {
  background: #F59E0B;
  box-shadow: 0 0 6px #F59E0B;
}

/* ==============================================================================
   AUTHENTICATION SCREENS (Sign In & Sign Up)
   ============================================================================== */
.auth-screen-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: var(--bg-main);
  background-image: 
    radial-gradient(at 0% 0%, rgba(79, 70, 229, 0.08) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(6, 182, 212, 0.08) 0px, transparent 50%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  overflow-y: auto;
  box-sizing: border-box;
}

[data-theme="dark"] .auth-screen-overlay {
  background-image: 
    radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.15) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(14, 165, 233, 0.12) 0px, transparent 50%);
}

.auth-card {
  width: 100%;
  max-width: 440px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.15), 0 0 1px 1px var(--border-color);
  padding: 32px 28px;
  box-sizing: border-box;
  animation: authFadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes authFadeIn {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.auth-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}

.auth-brand-logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.auth-logo-img {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  object-fit: cover;
  box-shadow: 0 4px 10px rgba(79, 70, 229, 0.25);
}

.auth-brand-title {
  font-size: 18px;
  font-weight: 900;
  color: var(--primary);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  letter-spacing: -0.4px;
}

.auth-version-badge {
  font-size: 10px;
  font-weight: 800;
  background: rgba(79, 70, 229, 0.12);
  color: var(--secondary);
  padding: 2px 6px;
  border-radius: 4px;
}

.auth-brand-subtitle {
  font-size: 11.5px;
  color: var(--text-muted);
  margin: 2px 0 0 0;
  font-weight: 500;
}

.auth-db-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: var(--radius-md);
  font-size: 11.5px;
  font-weight: 700;
  margin-bottom: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.auth-db-badge.online {
  background: rgba(16, 185, 129, 0.1);
  color: #059669;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

[data-theme="dark"] .auth-db-badge.online {
  background: rgba(16, 185, 129, 0.18);
  color: #34D399;
  border-color: rgba(52, 211, 153, 0.35);
}

.auth-db-badge.offline {
  background: rgba(239, 68, 68, 0.1);
  color: #DC2626;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.auth-db-badge.checking {
  background: rgba(245, 158, 11, 0.1);
  color: #D97706;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.auth-db-badge .status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.auth-db-badge.online .status-dot {
  background: #10B981;
  box-shadow: 0 0 6px #10B981;
}

.auth-db-badge.offline .status-dot {
  background: #EF4444;
}

.auth-db-badge.checking .status-dot {
  background: #F59E0B;
  animation: pulse-dot 1.2s infinite;
}

.auth-tab-switcher {
  display: flex;
  background: var(--bg-main);
  padding: 4px;
  border-radius: var(--radius-md);
  margin-bottom: 20px;
  border: 1px solid var(--border-color);
  gap: 4px;
}

.auth-tab-btn {
  flex: 1;
  padding: 8px 12px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-weight: 700;
  font-size: 13px;
  border-radius: calc(var(--radius-md) - 2px);
  cursor: pointer;
  transition: all 0.2s ease;
}

.auth-tab-btn.active {
  background: var(--bg-card);
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.auth-alert {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  font-weight: 600;
  margin-bottom: 16px;
  animation: shakeAlert 0.3s ease;
}

.auth-alert.error {
  background: #FEE2E2;
  color: #991B1B;
  border-left: 4px solid var(--error);
}

.auth-alert.success {
  background: #D1FAE5;
  color: #065F46;
  border-left: 4px solid var(--success);
}

@keyframes shakeAlert {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

.auth-divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 16px 0;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid var(--border-color);
}

.auth-divider span {
  padding: 0 10px;
  font-size: 10.5px;
  font-weight: 800;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

.password-toggle-link {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--secondary);
  cursor: pointer;
  user-select: none;
}

.auth-card-footer {
  text-align: center;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--border-color);
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
}

/* ==========================================================================
   MOBILE-FIRST FAST TRANSACTION RECORDER STYLES
   ========================================================================== */

.mobile-finance-quick-bar {
  display: none;
  gap: 12px;
  margin-bottom: 20px;
}

@media (max-width: 768px) {
  .mobile-finance-quick-bar {
    display: flex;
  }
}

.mobile-finance-act-btn {
  flex: 1;
  padding: 13px 14px;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 13.5px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
  transition: transform 0.15s ease, filter 0.15s ease;
}

.mobile-finance-act-btn:active {
  transform: scale(0.97);
}

.mobile-finance-act-btn.btn-exp {
  background: var(--error);
  color: #ffffff;
}

.mobile-finance-act-btn.btn-rev {
  background: var(--success);
  color: #ffffff;
}

/* Quick Add Banner */
.qt-featured-banner {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--secondary);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
}

.qt-featured-banner:hover,
.qt-featured-banner:active {
  border-color: var(--secondary);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.qt-banner-icon {
  background: var(--secondary);
  color: #ffffff;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
  flex-shrink: 0;
}

/* Quick Transaction Modal Card */
.qt-modal-card {
  max-width: 500px;
  padding: 22px 24px;
}

@media (max-width: 768px) {
  .qt-modal-card {
    padding: 18px 20px 28px 20px;
    max-height: 90vh;
    overflow-y: auto;
  }
}

.qt-label {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: block;
  margin-bottom: 6px;
}

/* Segmented Type Switcher */
.qt-type-switcher {
  display: flex;
  background: var(--bg-main);
  padding: 4px;
  border-radius: 14px;
  border: 1px solid var(--border-color);
  margin-bottom: 16px;
  gap: 4px;
}

.qt-type-btn {
  flex: 1;
  padding: 10px 12px;
  border-radius: 11px;
  font-weight: 700;
  font-size: 13px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.qt-type-btn.active {
  background: var(--bg-card);
  color: var(--text-primary);
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.08);
}

.qt-type-btn.active#qtTypeExpense {
  color: #EF4444;
  border: 1px solid rgba(239, 68, 68, 0.25);
}

.qt-type-btn.active#qtTypeRevenue {
  color: #10B981;
  border: 1px solid rgba(16, 185, 129, 0.25);
}

/* Hero Amount Section */
.qt-amount-card {
  background: var(--bg-main);
  border: 1.5px solid var(--border-color);
  border-radius: 18px;
  padding: 14px 18px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.qt-amount-card:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

.qt-amount-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.qt-currency-symbol {
  font-size: 26px;
  font-weight: 800;
  color: var(--text-muted);
}

.qt-amount-input {
  font-size: 32px !important;
  font-weight: 900;
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
  padding: 4px 0 !important;
  color: var(--text-primary);
  width: 100%;
}

.qt-amount-input:focus {
  outline: none;
}

.qt-clear-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: rgba(100, 116, 139, 0.15);
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  transition: all 0.15s ease;
}

.qt-clear-btn:hover {
  background: rgba(239, 68, 68, 0.2);
  color: #EF4444;
}

/* Quick Amount Chips */
.qt-quick-amount-chips {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-top: 10px;
  margin-top: 6px;
  border-top: 1px dashed var(--border-color);
  scrollbar-width: none;
}

.qt-quick-amount-chips::-webkit-scrollbar {
  display: none;
}

.qt-amt-chip {
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-primary);
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.qt-amt-chip:active {
  transform: scale(0.93);
  background: var(--primary);
  color: #ffffff;
}

/* Category Chips Carousel */
.qt-category-scroll {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 2px 6px 2px;
  flex-wrap: wrap;
}

.qt-cat-chip {
  padding: 7px 13px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-secondary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.18s ease;
  user-select: none;
}

.qt-cat-chip:active {
  transform: scale(0.95);
}

.qt-cat-chip.active {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.35);
  font-weight: 700;
}

/* Payment Method & Date Chips */
.qt-method-chips,
.qt-date-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.qt-method-chip,
.qt-date-chip {
  padding: 8px 13px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-secondary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.18s ease;
}

.qt-method-chip:active,
.qt-date-chip:active {
  transform: scale(0.95);
}

.qt-method-chip.active,
.qt-date-chip.active {
  background: rgba(79, 70, 229, 0.15);
  color: var(--primary);
  border-color: var(--primary);
  font-weight: 700;
}

/* Voice Button */
.qt-voice-btn {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 19px;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.qt-voice-btn:hover {
  background: rgba(79, 70, 229, 0.1);
  border-color: var(--primary);
}

.qt-voice-btn.recording {
  background: #EF4444 !important;
  color: #ffffff !important;
  border-color: #EF4444 !important;
  animation: pulseVoice 1s infinite alternate;
}

@keyframes pulseVoice {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.6); }
  100% { transform: scale(1.08); box-shadow: 0 0 0 8px rgba(239, 68, 68, 0); }
}

/* Huge Thumb-Friendly Submit Button */
.qt-submit-btn {
  width: 100%;
  padding: 14px 20px;
  font-size: 15px;
  font-weight: 800;
  border-radius: 14px;
  letter-spacing: 0.3px;
  box-shadow: 0 6px 20px rgba(79, 70, 229, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform 0.15s ease, filter 0.15s ease;
}

.qt-submit-btn:active {
  transform: scale(0.98);
}




/* ==============================================================================
   ✨ PROFLOW EXECUTIVE UI & DESIGN SYSTEM ELEVATION (v2.0)
   ============================================================================== */

/* 1. Global Elevation & Smooth Physics */
html {
  scroll-behavior: smooth;
}

body {
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Enhanced Ambient Glow & Cards */
.card, .metric-card {
  border-radius: 16px !important;
  border: 1px solid var(--border-color) !important;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04), 0 4px 12px -2px rgba(15, 23, 42, 0.03) !important;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.2s ease !important;
}

.card:hover, .metric-card:hover {
  transform: translateY(-3px) !important;
  box-shadow: 0 12px 28px -6px rgba(15, 23, 42, 0.09), 0 4px 12px -2px rgba(15, 23, 42, 0.04) !important;
  border-color: rgba(22, 163, 74, 0.3) !important;
}

[data-theme="dark"] .card, [data-theme="dark"] .metric-card {
  background: #111827 !important;
  border-color: rgba(255, 255, 255, 0.07) !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35) !important;
}

[data-theme="dark"] .card:hover, [data-theme="dark"] .metric-card:hover {
  border-color: rgba(34, 197, 94, 0.35) !important;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.55), 0 0 16px rgba(34, 197, 94, 0.12) !important;
}

/* 2. Primary & Action Buttons Elevation */
.btn-primary {
  background: linear-gradient(135deg, #16A34A 0%, #15803D 100%) !important;
  color: #FFFFFF !important;
  border-radius: 10px !important;
  font-weight: 700 !important;
  letter-spacing: 0.1px !important;
  box-shadow: 0 2px 8px rgba(22, 163, 74, 0.28) !important;
  border: none !important;
  transition: all 0.16s ease !important;
}

.btn-primary:hover {
  background: linear-gradient(135deg, #15803D 0%, #166534 100%) !important;
  box-shadow: 0 4px 14px rgba(22, 163, 74, 0.38) !important;
  transform: translateY(-1px) !important;
}

.btn-primary:active {
  transform: translateY(0) scale(0.97) !important;
  box-shadow: 0 2px 6px rgba(22, 163, 74, 0.2) !important;
}

.btn-glass {
  background: var(--bg-card) !important;
  color: var(--text-primary) !important;
  border: 1px solid var(--border-color) !important;
  border-radius: 10px !important;
  font-weight: 600 !important;
  transition: all 0.16s ease !important;
}

.btn-glass:hover {
  background: var(--bg-main) !important;
  border-color: rgba(15, 23, 42, 0.25) !important;
  color: var(--text-primary) !important;
  transform: translateY(-1px) !important;
}

/* 3. Header Bar & Sticky Glass Polish */
.header-bar {
  border-radius: 16px !important;
  background: rgba(255, 255, 255, 0.88) !important;
  backdrop-filter: blur(20px) !important;
  -webkit-backdrop-filter: blur(20px) !important;
  border: 1px solid rgba(226, 232, 240, 0.85) !important;
  box-shadow: 0 4px 20px -2px rgba(15, 23, 42, 0.05) !important;
  padding: 12px 22px !important;
}

[data-theme="dark"] .header-bar {
  background: rgba(17, 24, 39, 0.88) !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4) !important;
}

/* 4. Sidebar Items with Left Indicator Pill */
.nav-item {
  border-radius: 12px !important;
  margin-bottom: 3px !important;
  padding: 10px 16px !important;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1) !important;
  position: relative !important;
}

.nav-item:hover {
  background: var(--sidebar-hover-bg) !important;
  transform: translateX(4px) !important;
}

.nav-item.active {
  background: linear-gradient(135deg, #16a34a 0%, #15803d 100%) !important;
  color: #FFFFFF !important;
  box-shadow: 0 4px 14px rgba(22, 163, 74, 0.35) !important;
  transform: translateX(2px) !important;
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 25%;
  bottom: 25%;
  width: 4px;
  background: #FFFFFF;
  border-radius: 0 4px 4px 0;
}

/* 5. Executive Welcome Banner Polish */
.welcome-banner {
  border-radius: 18px !important;
  border: 1px solid var(--border-color) !important;
  background: var(--bg-card) !important;
  box-shadow: 0 6px 20px -4px rgba(15, 23, 42, 0.06) !important;
  position: relative !important;
  overflow: hidden !important;
}

.welcome-banner::after {
  content: '';
  position: absolute;
  top: -60px;
  right: -60px;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(22, 163, 74, 0.08) 0%, transparent 70%);
  pointer-events: none;
}

/* 6. Modals Sleek Physics & Backdrop Blur */
.modal-overlay {
  background: rgba(15, 23, 42, 0.55) !important;
  backdrop-filter: blur(10px) !important;
  -webkit-backdrop-filter: blur(10px) !important;
  transition: opacity 0.25s ease !important;
}

.modal-card {
  border-radius: 20px !important;
  border: 1px solid var(--border-color) !important;
  box-shadow: 0 24px 48px -12px rgba(15, 23, 42, 0.25) !important;
  animation: modalPopIn 0.28s cubic-bezier(0.16, 1, 0.3, 1) forwards !important;
}

@keyframes modalPopIn {
  from {
    opacity: 0;
    transform: scale(0.96) translateY(10px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* 7. Timeline Rows Hover Elevation */
.timeline-item {
  border-radius: 14px !important;
  border: 1px solid var(--border-color) !important;
  background: var(--bg-main) !important;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.timeline-item:hover {
  background: var(--bg-card) !important;
  border-color: var(--secondary) !important;
  transform: translateX(4px) translateY(-1px) !important;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.05) !important;
}

/* 8. Kanban Column Polish */
.kanban-column {
  border-radius: 16px !important;
  background: var(--bg-main) !important;
  border: 1px solid var(--border-color) !important;
  padding: 14px !important;
  transition: background 0.15s ease, border-color 0.15s ease !important;
}

.kanban-column-header {
  border-radius: 12px !important;
  padding: 10px 14px !important;
  font-weight: 800 !important;
  font-size: 13px !important;
  margin-bottom: 12px !important;
}

.kanban-card {
  border-radius: 14px !important;
  border: 1px solid var(--border-color) !important;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.04) !important;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.kanban-card:hover {
  transform: translateY(-3px) !important;
  box-shadow: 0 8px 20px -4px rgba(15, 23, 42, 0.1) !important;
  border-color: rgba(37, 99, 235, 0.35) !important;
}

/* 9. Floating Glass Toast Notifications */
.toast {
  border-radius: 16px !important;
  padding: 14px 20px !important;
  backdrop-filter: blur(16px) !important;
  -webkit-backdrop-filter: blur(16px) !important;
  box-shadow: 0 16px 36px -6px rgba(15, 23, 42, 0.25) !important;
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
  font-weight: 600 !important;
}

/* 10. Metric Values & Numerical Readability */
.metric-value {
  font-feature-settings: "tnum" 1, "ss01" 1 !important;
  letter-spacing: -0.6px !important;
}

/* 11. Interactive Chart Cards Container */
#reportsBarChart, #expenseDonutCanvas {
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.04));
}


/* ==============================================================================
   📱 PROFLOW MASTER MOBILE ALIGNMENT & RESPONSIVE SUITE (<= 900px Viewports)
   ============================================================================== */
@media (max-width: 900px) {
  /* Complete Viewport Lockdown — Zero Horizontal Shake or Drift */
  html, body {
    width: 100vw !important;
    max-width: 100vw !important;
    overflow-x: hidden !important;
    position: relative !important;
    -webkit-text-size-adjust: 100% !important;
  }

  .app-container {
    width: 100vw !important;
    max-width: 100vw !important;
    overflow-x: hidden !important;
  }

  /* Desktop Header Bar Hide */
  .header-bar {
    display: none !important;
  }

  /* Mobile Top Bar Perfect Alignment */
  .mobile-top-bar {
    display: flex !important;
    position: sticky !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 56px !important;
    padding: 0 14px !important;
    background: var(--bg-card) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    border-bottom: 1px solid var(--border-color) !important;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.05) !important;
    align-items: center !important;
    justify-content: space-between !important;
    box-sizing: border-box !important;
    z-index: 1000 !important;
  }

  .mobile-hamburger {
    background: var(--bg-main) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 10px !important;
    cursor: pointer !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-width: 36px !important;
    height: 36px !important;
    padding: 0 !important;
    font-size: 15px !important;
    color: var(--text-primary) !important;
  }

  .mobile-hamburger:active {
    transform: scale(0.94) !important;
  }

  /* Main Content Alignment & Safe Area Clearance */
  .main-content {
    margin-left: 0 !important;
    width: 100vw !important;
    max-width: 100vw !important;
    box-sizing: border-box !important;
    padding: 12px 12px calc(80px + env(safe-area-inset-bottom, 14px)) 12px !important;
    overflow-x: hidden !important;
  }

  /* Welcome Banner Stacking & Sizing */
  .welcome-banner {
    padding: 16px 14px !important;
    margin-bottom: 16px !important;
    border-radius: 16px !important;
    box-sizing: border-box !important;
  }

  .welcome-banner-header {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 12px !important;
    margin-bottom: 12px !important;
  }

  .welcome-banner-header > div:first-child {
    width: 100% !important;
  }

  .welcome-title {
    font-size: 19px !important;
    letter-spacing: -0.4px !important;
    margin-bottom: 4px !important;
  }

  .welcome-subtitle {
    font-size: 12px !important;
    line-height: 1.4 !important;
  }

  .welcome-banner-header > div:last-child {
    width: 100% !important;
    text-align: left !important;
    padding: 12px 14px !important;
    box-sizing: border-box !important;
    border-radius: 12px !important;
  }

  /* Quick Actions Grid on Welcome Banner (2 Equal Columns) */
  .quick-actions-row {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .action-pill-btn {
    width: 100% !important;
    justify-content: center !important;
    padding: 9px 8px !important;
    font-size: 11.5px !important;
    border-radius: 10px !important;
    text-align: center !important;
    box-sizing: border-box !important;
    margin: 0 !important;
  }

  .quick-actions-row > button:last-child {
    grid-column: span 2 !important;
  }

  /* Metrics Grid (2x2 Balanced Cards with Ellipsis Protection) */
  .metrics-grid {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
    margin-bottom: 16px !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .metric-card {
    padding: 12px 12px !important;
    border-radius: 14px !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
    min-width: 0 !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
  }

  .metric-header {
    margin-bottom: 6px !important;
  }

  .metric-title {
    font-size: 10px !important;
    font-weight: 700 !important;
    letter-spacing: 0.3px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  .metric-value {
    font-size: clamp(16px, 4.5vw, 20px) !important;
    font-weight: 800 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    margin: 3px 0 !important;
  }

  .metric-change {
    font-size: 9.5px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  /* Universal Card Padding & Layout */
  .card {
    padding: 16px 14px !important;
    border-radius: 16px !important;
    margin-bottom: 16px !important;
    box-sizing: border-box !important;
    width: 100% !important;
  }

  /* Tab Header Control Bars Alignment (Search + Action Buttons) */
  .card > div:first-child[style*="justify-content: space-between"],
  .card-header,
  .kanban-header-bar {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 12px !important;
    width: 100% !important;
  }

  .card > div:first-child[style*="justify-content: space-between"] > div:first-child,
  .card-header > div:first-child,
  .kanban-header-bar > div:first-child {
    width: 100% !important;
  }

  .card > div:first-child[style*="justify-content: space-between"] > div:last-child,
  .card-header > div:last-child,
  .kanban-header-controls {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    gap: 8px !important;
  }

  .card > div:first-child[style*="justify-content: space-between"] > div:last-child input,
  .card > div:first-child[style*="justify-content: space-between"] > div:last-child select,
  .card-header > div:last-child input,
  .kanban-search-input {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    min-height: 40px !important;
    font-size: 13.5px !important;
  }

  .card > div:first-child[style*="justify-content: space-between"] > div:last-child button,
  .card-header > div:last-child button,
  .kanban-header-controls button {
    width: 100% !important;
    min-height: 40px !important;
    justify-content: center !important;
    box-sizing: border-box !important;
  }

  /* Universal Two-Column Grid into Clean 1-Column Stack */
  .responsive-two-column-grid {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 12px !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  /* Client Cards Grid on Mobile (2x2 Clean Action Buttons) */
  #clientsGrid {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 12px !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  #clientsGrid .metric-card {
    padding: 14px 14px !important;
  }

  #clientsGrid .metric-card > div:last-child {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
    margin-top: 14px !important;
    padding-top: 12px !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  #clientsGrid .metric-card > div:last-child .btn,
  #clientsGrid .metric-card > div:last-child a.btn {
    width: 100% !important;
    margin: 0 !important;
    justify-content: center !important;
    min-height: 38px !important;
    font-size: 11.5px !important;
    box-sizing: border-box !important;
    text-align: center !important;
  }

  #clientsGrid .metric-card > div:last-child button[onclick^="openCallModalWithContact"] {
    grid-column: span 2 !important;
  }

  /* Kanban Board Touch-Swipe Alignment */
  .kanban-board {
    display: flex !important;
    overflow-x: auto !important;
    scroll-snap-type: x mandatory !important;
    gap: 12px !important;
    padding: 4px 2px 14px 2px !important;
    -webkit-overflow-scrolling: touch !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .kanban-column {
    flex: 0 0 84vw !important;
    max-width: 320px !important;
    min-width: 260px !important;
    scroll-snap-align: center !important;
    box-sizing: border-box !important;
  }

  .task-view-switcher {
    width: 100% !important;
    display: flex !important;
  }

  .task-view-btn {
    flex: 1 !important;
    text-align: center !important;
    padding: 8px 10px !important;
  }

  /* Planora Calendar Mobile Alignment */
  .planora-main-grid {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
    width: 100% !important;
  }

  .planora-stats-grid {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
    width: 100% !important;
  }

  .planora-view-switcher {
    width: 100% !important;
    display: flex !important;
  }

  .planora-view-btn {
    flex: 1 !important;
    text-align: center !important;
    padding: 6px 4px !important;
    font-size: 11px !important;
  }

  .calendar-day-head {
    font-size: 10px !important;
    padding: 6px 0 !important;
  }

  .calendar-day-cell {
    min-height: 48px !important;
    padding: 3px 2px !important;
  }

  /* Modals Native Bottom Sheets */
  .modal-overlay {
    align-items: flex-end !important;
    padding: 0 !important;
  }

  .modal-card {
    width: 100vw !important;
    max-width: 100vw !important;
    border-radius: 22px 22px 0 0 !important;
    max-height: 88vh !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    padding: 16px 16px calc(24px + env(safe-area-inset-bottom, 12px)) 16px !important;
    box-sizing: border-box !important;
  }

  .modal-card input,
  .modal-card select,
  .modal-card textarea {
    font-size: 16px !important;
    min-height: 42px !important;
    box-sizing: border-box !important;
  }

  /* Client Dossier Modal Mobile Polish */
  #clientDossierModal .metrics-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
    margin-bottom: 14px !important;
  }

  #clientDossierModal .modal-card > div:nth-child(3) {
    display: flex !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
    flex-wrap: nowrap !important;
    gap: 6px !important;
    padding-bottom: 8px !important;
  }

  #clientDossierModal button[id^="dossierTab"] {
    flex: 0 0 auto !important;
    white-space: nowrap !important;
    font-size: 11.5px !important;
    padding: 6px 12px !important;
  }

  /* Mobile Bottom Navigation Dock Bar */
  .mobile-bottom-nav {
    display: flex !important;
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: calc(60px + env(safe-area-inset-bottom, 8px)) !important;
    padding-bottom: max(6px, env(safe-area-inset-bottom, 8px)) !important;
    background: var(--bg-card) !important;
    backdrop-filter: blur(24px) !important;
    -webkit-backdrop-filter: blur(24px) !important;
    border-top: 1px solid var(--border-color) !important;
    align-items: center !important;
    justify-content: space-around !important;
    z-index: 9999 !important;
    box-shadow: 0 -4px 20px rgba(15, 23, 42, 0.08) !important;
    box-sizing: border-box !important;
  }

  .mobile-fab-wrapper {
    position: relative !important;
    top: -16px !important;
    flex: 0 0 54px !important;
    display: flex !important;
    justify-content: center !important;
    z-index: 10000 !important;
  }

  .mobile-fab-btn {
    width: 50px !important;
    height: 50px !important;
    border-radius: 50% !important;
    background: linear-gradient(135deg, #2563EB 0%, #1D4ED8 100%) !important;
    color: #FFFFFF !important;
    font-size: 26px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-shadow: 0 6px 18px rgba(37, 99, 235, 0.45) !important;
    border: 3px solid var(--bg-card) !important;
  }
}

/* ==========================================================================
   payledger DIGITAL BAHI LEDGER & SMART PAYMENTS STYLES
   ========================================================================== */
:root {
  --ledger-green: #16a34a;
  --ledger-green-bg: rgba(22, 163, 74, 0.1);
  --ledger-green-border: rgba(22, 163, 74, 0.3);
  --ledger-red: #dc2626;
  --ledger-red-bg: rgba(220, 38, 38, 0.1);
  --ledger-red-border: rgba(220, 38, 38, 0.3);
  --ledger-blue: #1d4ed8;
  --whatsapp-green: #25D366;
}

.ledger-summary-banner {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
}

.ledger-metric-card {
  padding: 16px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  transition: var(--transition);
}

.ledger-metric-card.get {
  background: var(--ledger-green-bg);
  border-color: var(--ledger-green-border);
}

.ledger-metric-card.give {
  background: var(--ledger-red-bg);
  border-color: var(--ledger-red-border);
}

.ledger-metric-card {
  background: var(--bg-card) !important;
  border: 1px solid var(--border-color) !important;
  border-radius: 14px !important;
  padding: 18px 20px !important;
  box-shadow: var(--shadow-sm) !important;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.ledger-metric-card:hover {
  border-color: rgba(22, 163, 74, 0.35) !important;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06) !important;
  transform: translateY(-2px) !important;
}

.ledger-metric-card.get {
  border-top: 3px solid var(--ledger-green) !important;
}

.ledger-metric-card.give {
  border-top: 3px solid var(--ledger-red) !important;
}

.ledger-metric-card.cash {
  border-top: 3px solid var(--text-primary) !important;
}

.ledger-metric-card.net {
  border-top: 3px solid #64748B !important;
}

.ledger-metric-title {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.ledger-metric-val {
  font-size: 26px;
  font-weight: 800;
  font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
  letter-spacing: -0.6px;
  font-variant-numeric: tabular-nums;
}

.ledger-metric-val.get { color: var(--ledger-green) !important; }
.ledger-metric-val.give { color: var(--ledger-red) !important; }
.ledger-metric-val.cash { color: var(--text-primary) !important; }
.ledger-metric-val.net { color: var(--text-primary) !important; }

.ledger-metric-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Big Bottom payledger Action Bar (Signature payledger UI) */
.ledger-bottom-action-bar {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  padding: 16px 20px;
  background: var(--bg-card);
  border-top: 1px solid var(--border-color);
  position: sticky;
  bottom: 0;
  z-index: 100;
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.06);
}

.btn-ledger-gave {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: #ffffff !important;
  font-size: 15px;
  font-weight: 800;
  padding: 14px 20px;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
  transition: var(--transition);
}

.btn-ledger-gave:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(220, 38, 38, 0.4);
}

.btn-ledger-got {
  background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
  color: #ffffff !important;
  font-size: 15px;
  font-weight: 800;
  padding: 14px 20px;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 4px 12px rgba(22, 163, 74, 0.3);
  transition: var(--transition);
}

.btn-ledger-got:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(22, 163, 74, 0.4);
}

/* Badges for payledger */
.badge-you-get {
  background: var(--ledger-green-bg);
  color: var(--ledger-green);
  border: 1px solid var(--ledger-green-border);
  font-weight: 800;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.badge-you-give {
  background: var(--ledger-red-bg);
  color: var(--ledger-red);
  border: 1px solid var(--ledger-red-border);
  font-weight: 800;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.badge-settled {
  background: rgba(148, 163, 184, 0.15);
  color: var(--text-muted);
  border: 1px solid rgba(148, 163, 184, 0.3);
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 12px;
}

.btn-whatsapp {
  background: #25D366;
  color: #ffffff !important;
  font-weight: 700;
  border: none;
  border-radius: var(--radius-full);
  padding: 6px 14px;
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
}

.btn-whatsapp:hover {
  background: #20ba59;
  transform: translateY(-1px);
}

/* Customer / Supplier List Item Card */
.ledger-party-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  cursor: pointer;
  transition: var(--transition);
}

.ledger-party-card:hover {
  border-color: var(--secondary);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.ledger-party-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 16px;
  flex-shrink: 0;
}

/* Ledger Transaction Table Rows */
.ledger-row {
  display: grid;
  grid-template-columns: 110px 1fr 120px 120px 130px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
  align-items: center;
  font-size: 13px;
  transition: var(--transition);
}

.ledger-row:hover {
  background: rgba(37, 99, 235, 0.02);
}

.ledger-row.header {
  background: var(--bg-main);
  font-weight: 800;
  color: var(--text-muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 2px solid var(--border-color);
}

@media (max-width: 768px) {
  .ledger-row {
    grid-template-columns: 80px 1fr 90px 90px;
    font-size: 12px;
    padding: 10px 12px;
  }
  .ledger-row .col-balance {
    display: none;
  }
}

/* UPI QR Display Card */
.upi-qr-box {
  background: #ffffff;
  padding: 24px;
  border-radius: var(--radius-lg);
  border: 2px solid #e2e8f0;
  text-align: center;
  display: inline-block;
  box-shadow: var(--shadow-md);
}

.upi-apps-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.upi-app-badge {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-sm);
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 700;
  color: #334155;
  display: flex;
  align-items: center;
  gap: 4px;
}


/* ==========================================================================
   STATE-OF-THE-ART MOBILE-FIRST RESPONSIVE ENGINE (<= 768px & <= 480px)
   Native App Feel • Bottom Sheets • Glassmorphic Navigation • Touch Ergonomics
   ========================================================================== */

@keyframes mobileBottomSheetUp {
  from {
    transform: translateY(100%);
    opacity: 0.5;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes dotPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.3); opacity: 0.7; }
}

@keyframes fabPulse {
  0% { box-shadow: 0 6px 18px rgba(22, 163, 74, 0.45); }
  50% { box-shadow: 0 8px 26px rgba(22, 163, 74, 0.75); }
  100% { box-shadow: 0 6px 18px rgba(22, 163, 74, 0.45); }
}

@media (max-width: 768px) {
  /* Global Touch & Viewport Lockdown */
  html, body {
    width: 100vw !important;
    max-width: 100vw !important;
    overflow-x: hidden !important;
    -webkit-text-size-adjust: 100% !important;
    -webkit-tap-highlight-color: transparent !important;
  }

  .app-container {
    width: 100vw !important;
    max-width: 100vw !important;
    overflow-x: hidden !important;
  }

  /* Hide Desktop Header on Mobile */
  .header-bar {
    display: none !important;
  }

  /* Safe-area Aware Viewport Padding */
  .main-content {
    margin-left: 0 !important;
    width: 100vw !important;
    max-width: 100vw !important;
    box-sizing: border-box !important;
    padding: 12px 12px calc(90px + env(safe-area-inset-bottom, 16px)) 12px !important;
    overflow-x: hidden !important;
  }

  /* --------------------------------------------------------------------------
     1. Modern Mobile App Header Bar
     -------------------------------------------------------------------------- */
  .mobile-top-bar {
    display: flex !important;
    position: sticky !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: calc(56px + env(safe-area-inset-top, 0px)) !important;
    padding-top: env(safe-area-inset-top, 0px) !important;
    padding-left: 12px !important;
    padding-right: 12px !important;
    background: rgba(255, 255, 255, 0.94) !important;
    backdrop-filter: blur(24px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(24px) saturate(180%) !important;
    border-bottom: 1px solid rgba(226, 232, 240, 0.8) !important;
    box-shadow: 0 2px 12px rgba(15, 23, 42, 0.04) !important;
    align-items: center !important;
    justify-content: space-between !important;
    box-sizing: border-box !important;
    z-index: 1000 !important;
  }

  [data-theme="dark"] .mobile-top-bar {
    background: rgba(15, 23, 42, 0.94) !important;
    border-bottom: 1px solid rgba(30, 41, 59, 0.8) !important;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.4) !important;
  }

  .mobile-hamburger,
  .mobile-action-icon-btn {
    background: var(--bg-main) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 10px !important;
    cursor: pointer !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 36px !important;
    height: 36px !important;
    padding: 0 !important;
    font-size: 15px !important;
    color: var(--text-primary) !important;
    transition: transform 0.15s ease !important;
    -webkit-tap-highlight-color: transparent !important;
  }

  .mobile-hamburger:active,
  .mobile-action-icon-btn:active {
    transform: scale(0.92) !important;
  }

  .mobile-action-qr-pill {
    background: linear-gradient(135deg, #16a34a 0%, #15803d 100%) !important;
    color: #ffffff !important;
    border: none !important;
    border-radius: 18px !important;
    padding: 6px 11px !important;
    font-size: 11.5px !important;
    font-weight: 800 !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 3px !important;
    cursor: pointer !important;
    box-shadow: 0 2px 8px rgba(22, 163, 74, 0.35) !important;
    transition: transform 0.15s ease !important;
    -webkit-tap-highlight-color: transparent !important;
  }

  .mobile-action-qr-pill:active {
    transform: scale(0.93) !important;
  }

  .mobile-connection-dot {
    width: 9px !important;
    height: 9px !important;
    border-radius: 50% !important;
    cursor: pointer !important;
    position: relative !important;
    flex-shrink: 0 !important;
  }

  .mobile-connection-dot.online {
    background: #16a34a !important;
    box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.2) !important;
  }

  .mobile-connection-dot.checking {
    background: #f59e0b !important;
    animation: dotPulse 1.2s infinite ease-in-out !important;
  }

  .mobile-connection-dot.offline {
    background: #ef4444 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2) !important;
  }

  /* --------------------------------------------------------------------------
     2. Slide-In Navigation Drawer with Close Button
     -------------------------------------------------------------------------- */
  .sidebar {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    height: 100vh !important;
    height: 100dvh !important;
    width: 290px !important;
    max-width: 85vw !important;
    background: var(--bg-card) !important;
    border-right: 1px solid var(--border-color) !important;
    z-index: 2000 !important;
    transform: translateX(-100%) !important;
    transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1) !important;
    display: flex !important;
    flex-direction: column !important;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.35) !important;
    padding-top: env(safe-area-inset-top, 0px) !important;
    padding-bottom: env(safe-area-inset-bottom, 12px) !important;
  }

  .sidebar.mobile-open {
    transform: translateX(0) !important;
  }

  .mobile-sidebar-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background: rgba(15, 23, 42, 0.55) !important;
    backdrop-filter: blur(8px) !important;
    -webkit-backdrop-filter: blur(8px) !important;
    z-index: 1999 !important;
    opacity: 0 !important;
    pointer-events: none !important;
    transition: opacity 0.25s ease !important;
  }

  .mobile-sidebar-overlay.active {
    opacity: 1 !important;
    pointer-events: auto !important;
    display: block !important;
  }

  .mobile-sidebar-close-btn {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 32px !important;
    height: 32px !important;
    border-radius: 8px !important;
    border: 1px solid var(--border-color) !important;
    background: var(--bg-main) !important;
    color: var(--text-muted) !important;
    font-size: 18px !important;
    cursor: pointer !important;
    margin-left: auto !important;
  }

  .sidebar .nav-item {
    min-height: 44px !important;
    padding: 10px 14px !important;
    font-size: 13.5px !important;
  }

  /* --------------------------------------------------------------------------
     3. Enhanced Mobile Bottom Navigation Bar with Central FAB
     -------------------------------------------------------------------------- */
  .mobile-bottom-nav {
    display: flex !important;
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: calc(64px + env(safe-area-inset-bottom, 0px)) !important;
    padding-bottom: env(safe-area-inset-bottom, 0px) !important;
    background: rgba(255, 255, 255, 0.94) !important;
    backdrop-filter: blur(24px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(24px) saturate(180%) !important;
    border-top: 1px solid rgba(226, 232, 240, 0.8) !important;
    box-shadow: 0 -4px 24px rgba(15, 23, 42, 0.08) !important;
    align-items: center !important;
    justify-content: space-around !important;
    z-index: 1000 !important;
    box-sizing: border-box !important;
  }

  [data-theme="dark"] .mobile-bottom-nav {
    background: rgba(15, 23, 42, 0.94) !important;
    border-top: 1px solid rgba(30, 41, 59, 0.8) !important;
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.5) !important;
  }

  .mobile-nav-item {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    flex: 1 !important;
    height: 100% !important;
    color: var(--text-muted) !important;
    font-size: 10.5px !important;
    font-weight: 600 !important;
    text-decoration: none !important;
    gap: 3px !important;
    cursor: pointer !important;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
    -webkit-tap-highlight-color: transparent !important;
    position: relative !important;
    padding: 0 !important;
  }

  .mobile-nav-item:active {
    transform: scale(0.92) !important;
  }

  .mobile-nav-item.active {
    color: var(--primary) !important;
    font-weight: 800 !important;
  }

  .mobile-nav-item.active .mobile-nav-icon {
    transform: translateY(-2px) scale(1.1);
  }

  .mobile-nav-item.active::after {
    content: '';
    position: absolute;
    bottom: calc(4px + env(safe-area-inset-bottom, 0px));
    width: 16px;
    height: 3px;
    border-radius: 2px;
    background: var(--primary);
  }

  .mobile-nav-icon {
    font-size: 19px !important;
    transition: transform 0.2s ease !important;
  }

  .mobile-fab-wrapper {
    position: relative !important;
    top: -18px !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    z-index: 1001 !important;
    flex: 1 !important;
    -webkit-tap-highlight-color: transparent !important;
  }

  .mobile-fab-btn {
    width: 54px !important;
    height: 54px !important;
    border-radius: 50% !important;
    background: linear-gradient(135deg, #16a34a 0%, #15803d 100%) !important;
    color: #ffffff !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 22px !important;
    box-shadow: 0 6px 20px rgba(22, 163, 74, 0.5) !important;
    border: 3.5px solid var(--bg-card) !important;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
    animation: fabPulse 3s infinite ease-in-out;
  }

  .mobile-fab-wrapper:active .mobile-fab-btn {
    transform: scale(0.92) !important;
  }

  .mobile-fab-label {
    font-size: 10px !important;
    font-weight: 800 !important;
    color: var(--ledger-green) !important;
    margin-top: 3px !important;
    letter-spacing: 0.3px !important;
  }

  /* --------------------------------------------------------------------------
     4. Native Mobile Bottom Sheets System
     -------------------------------------------------------------------------- */
  .modal-overlay {
    align-items: flex-end !important;
    padding: 0 !important;
    background: rgba(15, 23, 42, 0.6) !important;
    backdrop-filter: blur(8px) !important;
    -webkit-backdrop-filter: blur(8px) !important;
  }

  .modal-card {
    width: 100vw !important;
    max-width: 100vw !important;
    border-radius: 24px 24px 0 0 !important;
    max-height: 92vh !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    padding: 18px 18px calc(24px + env(safe-area-inset-bottom, 16px)) 18px !important;
    box-sizing: border-box !important;
    box-shadow: 0 -8px 36px rgba(0, 0, 0, 0.3) !important;
    animation: mobileBottomSheetUp 0.28s cubic-bezier(0.16, 1, 0.3, 1) forwards !important;
    border-bottom: none !important;
  }

  /* Fullbleed Header Modals on Mobile */
  #ledgerPartyModal .modal-card,
  #paymentConfirmationModal .modal-card,
  #paymentFailedModal .modal-card,
  #changeUpiModal .modal-card,
  #syncContactsModal .modal-card,
  #clientDossierModal .modal-card,
  .modal-card.modal-card-fullbleed {
    padding: 0 !important;
    overflow: hidden !important;
  }

  .modal-card::before {
    content: '';
    display: block;
    width: 44px;
    height: 5px;
    border-radius: 3px;
    background: var(--border-color);
    margin: -4px auto 14px auto;
    opacity: 0.8;
  }

  #ledgerPartyModal .modal-card::before,
  #paymentConfirmationModal .modal-card::before,
  #paymentFailedModal .modal-card::before,
  #changeUpiModal .modal-card::before,
  #syncContactsModal .modal-card::before {
    display: none !important;
  }

  /* Form Controls in Modals: Prevent iOS auto-zoom */
  .modal-card input,
  .modal-card select,
  .modal-card textarea,
  .form-control {
    font-size: 16px !important;
    min-height: 44px !important;
    border-radius: 12px !important;
    box-sizing: border-box !important;
  }

  /* Modal Actions Stacking & Ergonomics */
  .modal-actions {
    display: flex !important;
    gap: 10px !important;
    margin-top: 20px !important;
  }

  .modal-actions .btn {
    flex: 1 !important;
    min-height: 46px !important;
    border-radius: 12px !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    justify-content: center !important;
  }

  /* --------------------------------------------------------------------------
     5. Customers & Suppliers Segmented Toggle Bar on Mobile
     -------------------------------------------------------------------------- */
  .mobile-ledger-tab-toggle {
    display: flex !important;
    background: var(--bg-main) !important;
    padding: 4px !important;
    border-radius: 14px !important;
    border: 1px solid var(--border-color) !important;
    margin-bottom: 14px !important;
    gap: 4px !important;
  }

  .ml-toggle-btn {
    flex: 1 !important;
    padding: 9px 12px !important;
    border-radius: 11px !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    border: none !important;
    background: transparent !important;
    color: var(--text-muted) !important;
    cursor: pointer !important;
    text-align: center !important;
    transition: all 0.2s ease !important;
    -webkit-tap-highlight-color: transparent !important;
  }

  .ml-toggle-btn.active {
    background: var(--bg-card) !important;
    color: var(--ledger-green) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08) !important;
    font-weight: 800 !important;
  }

  /* Full-width Responsive Search & Actions in Customer/Supplier Directory */
  #ledgerCustomerSearchInput,
  #ledgerSupplierSearchInput {
    width: 100% !important;
    min-height: 44px !important;
    font-size: 14px !important;
    border-radius: 12px !important;
    box-sizing: border-box !important;
  }

  #tab-customers .card > div:first-child > div:last-child,
  #tab-suppliers .card > div:first-child > div:last-child {
    display: flex !important;
    flex-wrap: wrap !important;
    width: 100% !important;
    gap: 8px !important;
  }

  #tab-customers .card > div:first-child > div:last-child > button,
  #tab-suppliers .card > div:first-child > div:last-child > button {
    flex: 1 !important;
    min-height: 40px !important;
    justify-content: center !important;
  }

  /* --------------------------------------------------------------------------
     6. Party Cards (.ledger-party-card) on Mobile
     -------------------------------------------------------------------------- */
  .ledger-party-card {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
    padding: 14px 14px !important;
    border-radius: 16px !important;
    background: var(--bg-card) !important;
    border: 1px solid var(--border-color) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03) !important;
    transition: transform 0.15s ease !important;
    -webkit-tap-highlight-color: transparent !important;
  }

  .ledger-party-card:active {
    transform: scale(0.985) !important;
  }

  .ledger-party-avatar {
    width: 42px !important;
    height: 42px !important;
    font-size: 17px !important;
    flex-shrink: 0 !important;
    border-radius: 12px !important;
  }

  .btn-party-icon {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 36px !important;
    height: 36px !important;
    border-radius: 50% !important;
    background: rgba(37, 99, 235, 0.1) !important;
    color: #2563eb !important;
    border: 1px solid rgba(37, 99, 235, 0.2) !important;
    text-decoration: none !important;
    font-size: 15px !important;
    cursor: pointer !important;
    transition: transform 0.15s ease !important;
    -webkit-tap-highlight-color: transparent !important;
  }

  .btn-party-icon:active {
    transform: scale(0.9) !important;
  }

  /* --------------------------------------------------------------------------
     7. Signature Customer / Supplier Ledger Sheet Modal (#ledgerLedgerModal)
     -------------------------------------------------------------------------- */
  #ledgerLedgerModal .modal-card {
    width: 100vw !important;
    max-width: 100vw !important;
    height: 95vh !important;
    max-height: 95vh !important;
    border-radius: 24px 24px 0 0 !important;
    padding: 0 !important;
    display: flex !important;
    flex-direction: column !important;
  }

  #ledgerLedgerModal .modal-card::before {
    margin: 8px auto 8px auto !important;
  }

  .ledger-modal-sticky-header {
    padding: 12px 16px !important;
  }

  .ledger-modal-toolbar {
    overflow-x: auto !important;
    white-space: nowrap !important;
    -webkit-overflow-scrolling: touch !important;
    flex-wrap: nowrap !important;
    padding: 8px 14px !important;
    gap: 8px !important;
    scrollbar-width: none !important;
    display: flex !important;
  }

  .ledger-modal-toolbar::-webkit-scrollbar {
    display: none !important;
  }

  .ledger-modal-toolbar button {
    flex-shrink: 0 !important;
    font-size: 12px !important;
    padding: 6px 12px !important;
    border-radius: 20px !important;
  }

  /* 4-Column Mobile Ledger Timeline */
  .ledger-row.header {
    display: grid !important;
    grid-template-columns: 75px 1fr 85px 85px !important;
    padding: 8px 12px !important;
    font-size: 10.5px !important;
    font-weight: 800 !important;
    letter-spacing: 0.3px !important;
  }

  .ledger-row {
    display: grid !important;
    grid-template-columns: 75px 1fr 85px 85px !important;
    gap: 6px !important;
    font-size: 12px !important;
    padding: 10px 12px !important;
    align-items: center !important;
    border-bottom: 1px solid var(--border-color) !important;
  }

  .ledger-row .col-balance {
    display: none !important;
  }

  /* Pinned Bottom Dual Action Bar */
  .ledger-bottom-action-bar {
    padding: 10px 14px calc(14px + env(safe-area-inset-bottom, 14px)) 14px !important;
    gap: 10px !important;
    background: var(--bg-card) !important;
    border-top: 1px solid var(--border-color) !important;
    display: flex !important;
  }

  .btn-ledger-gave, .btn-ledger-got {
    padding: 14px 10px !important;
    font-size: 14px !important;
    font-weight: 800 !important;
    border-radius: 14px !important;
    flex: 1 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08) !important;
    -webkit-tap-highlight-color: transparent !important;
  }

  .btn-ledger-gave:active, .btn-ledger-got:active {
    transform: scale(0.97) !important;
  }

  /* --------------------------------------------------------------------------
     8. PayLedger Welcome Banner & Executive Dashboard on Mobile
     -------------------------------------------------------------------------- */
  .welcome-banner {
    padding: 14px 14px 16px 14px !important;
    margin-bottom: 14px !important;
    border-radius: 18px !important;
    border-left: 4px solid var(--ledger-green) !important;
  }

  .welcome-title {
    font-size: 17.5px !important;
    line-height: 1.25 !important;
    margin-bottom: 2px !important;
  }

  /* Hide long paragraph on mobile so vital metrics & actions appear above the fold */
  .welcome-subtitle {
    display: none !important;
  }

  .welcome-banner-header {
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 10px !important;
    margin-bottom: 10px !important;
  }

  .welcome-banner-header > div:last-child {
    width: auto !important;
    padding: 8px 12px !important;
    border-radius: 12px !important;
    text-align: right !important;
    flex-shrink: 0 !important;
  }

  /* Modern 3-Column / 6-Card Fintech Quick Actions Grid */
  .quick-actions-row {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 8px !important;
    margin-top: 12px !important;
    overflow-x: visible !important;
    padding-bottom: 0 !important;
  }

  .action-pill-btn {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 12px 6px !important;
    min-height: 62px !important;
    border-radius: 14px !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    text-align: center !important;
    gap: 4px !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04) !important;
    transition: transform 0.15s ease, box-shadow 0.15s ease !important;
    -webkit-tap-highlight-color: transparent !important;
    width: 100% !important;
  }

  .action-pill-btn:active {
    transform: scale(0.93) !important;
  }

  .quick-actions-row > button:last-child {
    grid-column: span 1 !important;
  }

  /* --------------------------------------------------------------------------
     8.1 PayLedger Summary 2x2 Metric Cards with Vibrant Tinted Glass
     -------------------------------------------------------------------------- */
  .ledger-summary-banner {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 10px !important;
    margin-bottom: 16px !important;
    padding: 0 !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
  }

  .ledger-metric-card {
    padding: 13px 12px !important;
    border-radius: 16px !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
    min-height: 98px !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04) !important;
    transition: transform 0.15s ease !important;
    -webkit-tap-highlight-color: transparent !important;
  }

  .ledger-metric-card:active {
    transform: scale(0.96) !important;
  }

  .ledger-metric-card.get {
    background: linear-gradient(145deg, rgba(22, 163, 74, 0.1) 0%, rgba(22, 163, 74, 0.03) 100%) !important;
    border: 1.5px solid rgba(22, 163, 74, 0.3) !important;
  }

  .ledger-metric-card.give {
    background: linear-gradient(145deg, rgba(239, 68, 68, 0.1) 0%, rgba(239, 68, 68, 0.03) 100%) !important;
    border: 1.5px solid rgba(239, 68, 68, 0.3) !important;
  }

  .ledger-metric-card.cash {
    background: linear-gradient(145deg, rgba(245, 158, 11, 0.1) 0%, rgba(245, 158, 11, 0.03) 100%) !important;
    border: 1.5px solid rgba(245, 158, 11, 0.3) !important;
  }

  .ledger-metric-card.net {
    background: linear-gradient(145deg, rgba(59, 130, 246, 0.1) 0%, rgba(59, 130, 246, 0.03) 100%) !important;
    border: 1.5px solid rgba(59, 130, 246, 0.3) !important;
  }

  .ledger-metric-title {
    font-size: 10px !important;
    font-weight: 800 !important;
    letter-spacing: 0.5px !important;
    text-transform: uppercase !important;
    display: flex !important;
    align-items: center !important;
    gap: 4px !important;
    margin-bottom: 4px !important;
  }

  .ledger-metric-val {
    font-size: 21px !important;
    font-weight: 900 !important;
    line-height: 1.1 !important;
    letter-spacing: -0.4px !important;
    font-variant-numeric: tabular-nums !important;
  }

  .ledger-metric-sub {
    font-size: 10.5px !important;
    margin-top: 4px !important;
    color: var(--text-muted) !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  /* Daily Cashbook 3 Metric Cards on Mobile */
  .cashbook-metrics-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 10px !important;
  }

  .cashbook-metrics-grid > div:last-child {
    grid-column: span 2 !important;
  }

  /* --------------------------------------------------------------------------
     8.2 Digital Bills & Invoice Line Items on Mobile
     -------------------------------------------------------------------------- */
  .invoice-item-row {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
    background: var(--bg-main) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 14px !important;
    padding: 12px 12px 14px 12px !important;
    margin-bottom: 10px !important;
    position: relative !important;
  }

  .invoice-item-row > input:first-child {
    grid-column: span 2 !important;
    font-weight: 700 !important;
    padding-right: 36px !important;
  }

  .invoice-item-row > button {
    position: absolute !important;
    top: 12px !important;
    right: 12px !important;
    width: 28px !important;
    height: 28px !important;
    border-radius: 50% !important;
    background: rgba(239, 68, 68, 0.12) !important;
    color: #ef4444 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 18px !important;
    font-weight: 800 !important;
    border: none !important;
    cursor: pointer !important;
    z-index: 2 !important;
  }

  /* --------------------------------------------------------------------------
     9. Dynamic UPI QR Modal Mobile Friendly
     -------------------------------------------------------------------------- */
  #ledgerUpiQrModal .modal-card {
    padding: 18px 16px calc(24px + env(safe-area-inset-bottom, 16px)) 16px !important;
  }

  #quickUpiQrImg, #quickUpiQrPlaceholder {
    width: 190px !important;
    height: 190px !important;
  }

  /* --------------------------------------------------------------------------
     10. Horizontal Swipe Filter Tabs & Touch Pills
     -------------------------------------------------------------------------- */
  .note-pills-bar,
  .cashbook-period-pills {
    display: flex !important;
    overflow-x: auto !important;
    white-space: nowrap !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
    padding-bottom: 4px !important;
    gap: 8px !important;
  }

  .note-pills-bar::-webkit-scrollbar,
  .cashbook-period-pills::-webkit-scrollbar {
    display: none !important;
  }

  .note-pill {
    flex-shrink: 0 !important;
    padding: 8px 14px !important;
    font-size: 12.5px !important;
    border-radius: 20px !important;
    min-height: 36px !important;
    display: inline-flex !important;
    align-items: center !important;
  }

  /* Responsive Two-Column Grids -> 1 Column */
  .responsive-two-column-grid,
  .form-row-2,
  .form-row-3,
  .form-row-split {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
    width: 100% !important;
  }
}

@keyframes upiPulse { 0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7); } 70% { transform: scale(1); box-shadow: 0 0 0 8px rgba(34, 197, 94, 0); } 100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); } }

/* ==========================================================================
   PWA (Progressive Web App) Install Banner & Standalone Mobile Styles
   ========================================================================== */
.pwa-install-banner {
  position: fixed;
  bottom: 20px;
  left: 20px;
  right: 20px;
  max-width: 480px;
  margin: 0 auto;
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.28), 0 0 0 1px rgba(22, 163, 74, 0.25);
  border-radius: 16px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  z-index: 9999;
  animation: pwaSlideUp 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.pwa-banner-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.pwa-banner-img {
  width: 42px;
  height: 42px;
  border-radius: 11px;
  box-shadow: 0 4px 12px rgba(22, 163, 74, 0.3);
  flex-shrink: 0;
}

.pwa-banner-title {
  font-size: 13.5px;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.25;
}

.pwa-banner-subtitle {
  font-size: 11.5px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

.pwa-banner-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.pwa-banner-close-btn {
  background: transparent;
  border: none;
  font-size: 20px;
  line-height: 1;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  transition: color 0.15s ease;
}

.pwa-banner-close-btn:hover {
  color: var(--text-primary);
}

.mobile-action-install-pill {
  background: linear-gradient(135deg, rgba(22, 163, 74, 0.2), rgba(22, 163, 74, 0.08));
  border: 1px solid rgba(22, 163, 74, 0.4);
  color: var(--ledger-green);
  font-size: 11px;
  font-weight: 800;
  padding: 4px 9px;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.mobile-action-install-pill:hover {
  background: var(--ledger-green);
  color: #fff;
}

/* Standalone PWA adjustments (when launched from home screen icon) */
@media all and (display-mode: standalone) {
  body {
    -webkit-user-select: none;
    user-select: none;
    padding-top: env(safe-area-inset-top, 0px);
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }

  .mobile-top-bar {
    padding-top: calc(8px + env(safe-area-inset-top, 0px));
  }

  .mobile-bottom-nav {
    padding-bottom: calc(6px + env(safe-area-inset-bottom, 0px));
  }

  /* Hide install prompts once already installed and running standalone */
  .pwa-install-banner,
  #sidebarPwaInstallBtn,
  #desktopPwaInstallBtn,
  #mobilePwaInstallBtn {
    display: none !important;
  }
}


/* ==============================================================================
   🎯 UNIFIED EXECUTIVE FINTECH THEME POLISH
   ============================================================================== */
/* Neutralized Metric Icon Wrappers (No more rainbow icons) */
.metric-icon-wrapper,
.icon-blue,
.icon-cyan,
.icon-amber,
.icon-emerald,
.icon-rose {
  background: rgba(15, 23, 42, 0.04) !important;
  border: 1px solid var(--border-color) !important;
  color: var(--text-primary) !important;
  border-radius: 10px !important;
}

[data-theme="dark"] .metric-icon-wrapper,
[data-theme="dark"] .icon-blue,
[data-theme="dark"] .icon-cyan,
[data-theme="dark"] .icon-amber,
[data-theme="dark"] .icon-emerald,
[data-theme="dark"] .icon-rose {
  background: rgba(255, 255, 255, 0.05) !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
  color: var(--text-primary) !important;
}

/* Unified Action Pill Buttons */
.action-pill-btn {
  background: var(--bg-card) !important;
  color: var(--text-primary) !important;
  border: 1px solid var(--border-color) !important;
  box-shadow: var(--shadow-sm) !important;
  font-weight: 700 !important;
  transition: all 0.16s ease !important;
}

.action-pill-btn:hover {
  border-color: rgba(22, 163, 74, 0.4) !important;
  color: var(--ledger-green) !important;
  transform: translateY(-1px) !important;
}

/* Subtle, Modern Welcome Banner */
.welcome-banner {
  background: var(--bg-card) !important;
  border: 1px solid var(--border-color) !important;
  border-left: 4px solid var(--ledger-green) !important;
  box-shadow: var(--shadow-sm) !important;
}

/* Form Controls with Focused Emerald Glow */
.form-control:focus,
select:focus,
textarea:focus {
  border-color: var(--ledger-green) !important;
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.15) !important;
  outline: none !important;
}

/* Tabs & Filter Pills */
.note-pill.active,
.cashbook-pill.active {
  background: var(--primary) !important;
  color: #ffffff !important;
  border-color: var(--primary) !important;
  font-weight: 700 !important;
}

/* Unified Clean Status Badges */
.status-pill {
  font-size: 11px !important;
  font-weight: 700 !important;
  padding: 3px 8px !important;
  border-radius: 9999px !important;
  background: rgba(15, 23, 42, 0.06) !important;
  color: var(--text-secondary) !important;
}

[data-theme="dark"] .status-pill {
  background: rgba(255, 255, 255, 0.08) !important;
  color: var(--text-primary) !important;
}

.badge-success {
  background: rgba(22, 163, 74, 0.1) !important;
  color: var(--ledger-green) !important;
  border: 1px solid rgba(22, 163, 74, 0.25) !important;
}

.badge-danger {
  background: rgba(220, 38, 38, 0.1) !important;
  color: var(--ledger-red) !important;
  border: 1px solid rgba(220, 38, 38, 0.25) !important;
}
