/* ============================================
   VERITY AUDIT - MOBILE-FIRST DESIGN SYSTEM
   Clean Architecture - V2.0.0
   ============================================ */

/* ============================================
   LEDGR - GLOBAL DESIGN SYSTEM
   Consistent with Wapplify Product Suite
   ============================================ */

/* ============================================
   CSS VARIABLES (Design Tokens)
   ============================================ */
:root {
  /* Primary Colors */
  --primary: #3b82f6;
  --primary-hover: #2563eb;
  --primary-light: rgba(59, 130, 246, 0.1);

  /* Status Colors */
  --success: #22c55e;
  --success-light: #dcfce7;
  --warning: #f59e0b;
  --warning-light: #fef3c7;
  --danger: #ef4444;
  --danger-light: #fee2e2;
  --info: #06b6d4;
  --info-light: #cffafe;

  /* Neutral Colors */
  --background: #f8fafc;
  --surface: #ffffff;
  --border: #e2e8f0;
  --border-light: #f1f5f9;

  /* Text Colors */
  --text-primary: #0f172a;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;

  /* Sidebar Colors */
  --sidebar-bg: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
  --sidebar-text: #94a3b8;
  --sidebar-text-hover: #3b82f6;
  --sidebar-active: #3b82f6;
  --sidebar-width: 260px;

  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);

  /* Border Radius */
  --radius-sm: 4px;
  --radius: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-full: 9999px;

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition: 200ms ease;
  --transition-slow: 300ms ease;

  /* Z-Index Scale */
  --z-sidebar: 100;
  --z-topbar: 90;
  --z-bottom-nav: 1000;
  --z-overlay: 1100;
  --z-modal: 1200;
}

/* ============================================
   PERFORMANCE OPTIMIZATIONS
   ============================================ */
html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

* {
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
}

body {
  overscroll-behavior: none;
  touch-action: pan-y;
}

/* GPU acceleration for animated elements */
.top-bar,
.bottom-nav,
.pull-to-refresh,
.card,
.stat-card,
.btn,
.top-bar-dropdown,
.more-menu {
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  perspective: 1000px;
}

/* Optimize transitions */
a, button, .btn, input, select, textarea {
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.15s ease, opacity 0.15s ease;
  will-change: auto;
}

/* Faster touch response */
a, button, .btn {
  touch-action: manipulation;
}

/* ============================================
   HIDE SCROLLBARS (Global)
   ============================================ */
* {
  -ms-overflow-style: none !important;
  scrollbar-width: none !important;
}

*::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
  background: transparent !important;
}

*::-webkit-scrollbar-track {
  background: transparent !important;
}

*::-webkit-scrollbar-thumb {
  background: transparent !important;
}

html, body, .main-content, .page-content {
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

/* ============================================
   DARK MODE VARIABLES
   ============================================ */
html.dark-mode {
  /* Enable dark color scheme for native elements */
  color-scheme: dark;

  /* Primary Colors - slightly adjusted for dark backgrounds */
  --primary: #60a5fa;
  --primary-hover: #3b82f6;
  --primary-light: rgba(96, 165, 250, 0.15);

  /* Status Colors - slightly brighter for dark mode */
  --success: #4ade80;
  --success-light: rgba(74, 222, 128, 0.15);
  --warning: #fbbf24;
  --warning-light: rgba(251, 191, 36, 0.15);
  --danger: #f87171;
  --danger-light: rgba(248, 113, 113, 0.15);
  --info: #22d3ee;
  --info-light: rgba(34, 211, 238, 0.15);

  /* Neutral Colors - Dark theme */
  --background: #0f172a;
  --surface: #1e293b;
  --border: #334155;
  --border-light: #1e293b;

  /* Text Colors - Light text for dark backgrounds */
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  /* Sidebar Colors - Darker for dark mode */
  --sidebar-bg: linear-gradient(180deg, #0f172a 0%, #020617 100%);
  --sidebar-text: #94a3b8;
  --sidebar-text-hover: #60a5fa;
  --sidebar-active: #60a5fa;

  /* Shadows - More subtle in dark mode */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
  --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.4), 0 1px 2px -1px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -2px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -4px rgba(0, 0, 0, 0.3);
}

/* Auto dark mode based on system preference */
@media (prefers-color-scheme: dark) {
  html:not(.light-mode) {
    /* Enable dark color scheme for native elements */
    color-scheme: dark;

    /* Primary Colors */
    --primary: #60a5fa;
    --primary-hover: #3b82f6;
    --primary-light: rgba(96, 165, 250, 0.15);

    /* Status Colors */
    --success: #4ade80;
    --success-light: rgba(74, 222, 128, 0.15);
    --warning: #fbbf24;
    --warning-light: rgba(251, 191, 36, 0.15);
    --danger: #f87171;
    --danger-light: rgba(248, 113, 113, 0.15);
    --info: #22d3ee;
    --info-light: rgba(34, 211, 238, 0.15);

    /* Neutral Colors */
    --background: #0f172a;
    --surface: #1e293b;
    --border: #334155;
    --border-light: #1e293b;

    /* Text Colors */
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;

    /* Sidebar Colors */
    --sidebar-bg: linear-gradient(180deg, #0f172a 0%, #020617 100%);
    --sidebar-text: #94a3b8;
    --sidebar-text-hover: #60a5fa;
    --sidebar-active: #60a5fa;

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.4), 0 1px 2px -1px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -2px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -4px rgba(0, 0, 0, 0.3);
  }
}

/* ============================================
   BASE STYLES
   ============================================ */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  font-size: 14px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--background);
  color: var(--text-primary);
  line-height: 1.5;
  margin: 0;
  padding: 0;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ============================================
   SIDEBAR STYLES
   ============================================ */
.sidebar {
  width: var(--sidebar-width);
  height: 100vh;
  position: fixed;
  left: 0;
  top: 0;
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  z-index: var(--z-sidebar);
  box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
}

.sidebar-header {
  padding: 24px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  color: white;
  font-size: 20px;
  font-weight: 700;
}

.logo i {
  font-size: 28px;
  color: var(--primary);
}

.org-name {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--sidebar-text);
  font-size: 13px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.org-name i {
  font-size: 12px;
}

.org-name span {
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-nav {
  flex: 1;
  padding: 16px 12px;
  overflow-y: auto;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  color: var(--sidebar-text);
  text-decoration: none;
  border-radius: var(--radius);
  margin-bottom: 4px;
  transition: all var(--transition);
  font-size: 14px;
  font-weight: 500;
}

.nav-item:hover {
  background: var(--primary-light);
  color: var(--sidebar-text-hover);
}

.nav-item.active {
  background: var(--sidebar-active);
  color: white;
}

.nav-item i {
  font-size: 18px;
  width: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.nav-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.1);
  margin: 12px 0;
}

.nav-section-label {
  padding: 8px 20px 4px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: rgba(255, 255, 255, 0.4);
}

.nav-logout {
  color: var(--danger) !important;
}

.nav-logout:hover {
  background: var(--danger-light) !important;
  color: var(--danger) !important;
}

/* AI Assistant Nav Item - Special Styling */
.nav-ai {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.15) 0%, rgba(59, 130, 246, 0.15) 100%);
  border: 1px solid rgba(168, 85, 247, 0.3);
  margin-bottom: 8px;
}

.nav-ai i {
  color: #a855f7;
}

.nav-ai:hover {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.25) 0%, rgba(59, 130, 246, 0.25) 100%);
  border-color: rgba(168, 85, 247, 0.5);
  color: #a855f7;
}

.nav-ai.active {
  background: linear-gradient(135deg, #a855f7 0%, #3b82f6 100%);
  border-color: transparent;
  color: white;
}

.nav-ai.active i {
  color: white;
}

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.user-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
  font-size: 16px;
  flex-shrink: 0;
}

.user-details {
  flex: 1;
  min-width: 0;
}

.user-name {
  color: white;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-role {
  color: var(--sidebar-text);
  font-size: 12px;
  text-transform: capitalize;
}

/* Sidebar Scrollbar */
.sidebar-nav::-webkit-scrollbar {
  width: 4px;
}

.sidebar-nav::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar-nav::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-full);
}

.sidebar-nav::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* ============================================
   MAIN CONTENT AREA
   ============================================ */
.main-content {
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  background: var(--background);
}

.top-bar {
  display: none;
}

.page-content {
  padding: 24px 32px;
  animation: fadeIn var(--transition-slow);
}

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

/* Auth Content (no sidebar) */
.auth-content {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--background);
}

/* ============================================
   CARDS
   ============================================ */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition);
}

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

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: transparent;
  border-bottom: 1px solid var(--border);
  padding: 16px 24px;
  font-weight: 600;
  font-size: 16px;
}

.card-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-title i {
  color: var(--primary);
}

.card-body {
  padding: 24px;
}

.card-footer {
  background: var(--background);
  border-top: 1px solid var(--border);
  padding: 16px 24px;
}

/* ============================================
   DASHBOARD STYLES (Matching Audit App)
   ============================================ */

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
  margin-bottom: 32px;
}

/* Stat Card - White with colored icon */
.stat-card {
  background: var(--surface);
  border-radius: 16px;
  padding: 24px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  transition: all 0.3s;
}

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

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

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

.stat-icon.blue {
  background: var(--primary-light);
  color: var(--primary);
}

.stat-icon.green {
  background: var(--success-light);
  color: var(--success);
}

.stat-icon.purple {
  background: rgba(168, 85, 247, 0.15);
  color: #a855f7;
}

.stat-icon.orange {
  background: var(--warning-light);
  color: var(--warning);
}

.stat-label {
  font-size: 14px;
  color: var(--text-secondary);
  font-weight: 500;
  margin-bottom: 8px;
}

.stat-value {
  font-size: 36px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
  line-height: 1;
}

.stat-change {
  font-size: 14px;
  color: var(--success);
  font-weight: 500;
}

.stat-change.negative {
  color: var(--danger);
}

/* Stat Card as Link */
a.stat-card,
a.stat-card-link {
  display: block;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}

a.stat-card:hover,
a.stat-card-link:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  border-color: var(--primary);
}

a.stat-card .stat-change i,
a.stat-card-link .stat-change i {
  transition: transform 0.2s;
}

a.stat-card:hover .stat-change i,
a.stat-card-link:hover .stat-change i {
  transform: translateX(3px);
}

/* ============================================
   DASHBOARD - NEW DESIGN
   ============================================ */

/* Dashboard Alerts */
.dashboard-alerts {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 24px;
}

.dashboard-alert {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-lg);
  text-decoration: none;
  transition: all 0.2s;
  flex: 1;
  min-width: 200px;
}

.dashboard-alert.danger {
  background: var(--danger-light);
  border: 1px solid var(--danger);
}

.dashboard-alert.warning {
  background: var(--warning-light);
  border: 1px solid var(--warning);
}

.dashboard-alert.info {
  background: var(--info-light);
  border: 1px solid var(--info);
}

.dashboard-alert:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.dashboard-alert-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.dashboard-alert.danger .dashboard-alert-icon {
  background: var(--danger);
  color: white;
}

.dashboard-alert.warning .dashboard-alert-icon {
  background: var(--warning);
  color: white;
}

.dashboard-alert.info .dashboard-alert-icon {
  background: var(--info);
  color: white;
}

.dashboard-alert-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.dashboard-alert-title {
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
}

.dashboard-alert-amount {
  font-size: 13px;
  color: var(--text-secondary);
}

.dashboard-alert-arrow {
  color: var(--text-muted);
  font-size: 14px;
}

/* Dashboard Financial Cards */
.dashboard-financial-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
  margin-bottom: 28px;
}

.dashboard-financial-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: flex-start;
  gap: 16px;
  transition: all 0.3s;
}

.dashboard-financial-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.financial-card-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
}

.financial-card-icon.green {
  background: var(--success-light);
  color: var(--success);
}

.financial-card-icon.red {
  background: var(--danger-light);
  color: var(--danger);
}

.financial-card-icon.blue {
  background: var(--primary-light);
  color: var(--primary);
}

.financial-card-icon.orange {
  background: var(--warning-light);
  color: var(--warning);
}

.financial-card-icon.purple {
  background: rgba(139, 92, 246, 0.1);
  color: #8b5cf6;
}

.financial-card-content {
  flex: 1;
  overflow: visible;
}

.financial-card-label {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 4px;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.financial-card-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
  margin-bottom: 4px;
  white-space: nowrap;
}

.financial-card-value.negative {
  color: var(--danger);
}

.financial-card-change {
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.financial-card-change.positive {
  color: var(--success);
}

.financial-card-change.negative {
  color: var(--danger);
}

.financial-card-change.neutral {
  color: var(--text-secondary);
}

/* Dashboard Widgets Grid */
.dashboard-widgets-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
}

.dashboard-widget {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
}

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

.widget-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}

.widget-title i {
  color: var(--text-secondary);
}

.widget-link {
  font-size: 13px;
  color: var(--primary);
  text-decoration: none;
}

.widget-link:hover {
  text-decoration: underline;
}

.widget-content {
  padding: 20px;
}

.widget-empty {
  text-align: center;
  padding: 32px 16px;
  color: var(--text-muted);
}

.widget-empty i {
  font-size: 32px;
  margin-bottom: 8px;
  display: block;
}

.widget-empty p {
  margin: 0;
  font-size: 14px;
}

/* Widget Status Bars */
.widget-status-bars {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.widget-status-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.widget-status-label {
  width: 90px;
  font-size: 13px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.widget-status-label i {
  font-size: 14px;
}

.widget-status-bar-wrapper {
  flex: 1;
  height: 8px;
  background: var(--background);
  border-radius: 4px;
  overflow: hidden;
}

.widget-status-bar {
  height: 100%;
  border-radius: 4px;
  transition: width 0.5s ease;
}

.widget-status-bar.success {
  background: var(--success);
}

.widget-status-bar.danger {
  background: var(--danger);
}

.widget-status-bar.warning {
  background: var(--warning);
}

.widget-status-bar.info {
  background: var(--info);
}

.widget-status-bar.secondary {
  background: var(--text-muted);
}

.widget-status-bar.primary {
  background: var(--primary);
}

.widget-status-value {
  width: 32px;
  text-align: right;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

/* Widget Inventory Stats */
.widget-inventory-stats {
  display: flex;
  gap: 16px;
  margin-bottom: 16px;
}

.inventory-stat-item {
  flex: 1;
  text-align: center;
  padding: 16px 8px;
  border-radius: var(--radius);
}

.inventory-stat-item.success {
  background: var(--success-light);
}

.inventory-stat-item.warning {
  background: var(--warning-light);
}

.inventory-stat-item.danger {
  background: var(--danger-light);
}

.inventory-stat-value {
  font-size: 28px;
  font-weight: 700;
  line-height: 1.2;
}

.inventory-stat-item.success .inventory-stat-value {
  color: var(--success);
}

.inventory-stat-item.warning .inventory-stat-value {
  color: var(--warning);
}

.inventory-stat-item.danger .inventory-stat-value {
  color: var(--danger);
}

.inventory-stat-label {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 4px;
  word-wrap: break-word;
  overflow-wrap: break-word;
  text-align: center;
}

.widget-inventory-value {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: var(--background);
  border-radius: var(--radius);
}

.inventory-value-label {
  font-size: 13px;
  color: var(--text-secondary);
}

.inventory-value-amount {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}

/* Widget Quick Stats */
.widget-quick-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.quick-stat-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: var(--background);
  border-radius: var(--radius);
  text-decoration: none;
  transition: all 0.2s;
}

.quick-stat-item:hover {
  background: var(--border);
}

.quick-stat-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.quick-stat-icon.blue {
  background: var(--primary-light);
  color: var(--primary);
}

.quick-stat-icon.green {
  background: var(--success-light);
  color: var(--success);
}

.quick-stat-icon.purple {
  background: rgba(168, 85, 247, 0.15);
  color: #a855f7;
}

.quick-stat-icon.orange {
  background: var(--warning-light);
  color: var(--warning);
}

.quick-stat-info {
  flex: 1;
}

.quick-stat-value {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}

.quick-stat-label {
  font-size: 12px;
  color: var(--text-secondary);
  word-wrap: break-word;
  overflow-wrap: break-word;
}

/* Dashboard Recent Section */
.dashboard-recent-section {
  margin-bottom: 24px;
}

.dashboard-recent-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 24px;
}

.dashboard-recent-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.recent-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.recent-card-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}

.recent-card-title i {
  color: var(--text-secondary);
}

.recent-card-link {
  font-size: 13px;
  color: var(--primary);
  text-decoration: none;
}

.recent-card-link:hover {
  text-decoration: underline;
}

.recent-card-list {
  padding: 8px;
}

.recent-card-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px;
  border-radius: var(--radius);
  text-decoration: none;
  color: inherit;
  transition: background 0.2s;
}

.recent-card-item:hover {
  background: var(--background);
}

.recent-item-main {
  flex: 1;
  min-width: 0;
}

.recent-item-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.recent-item-subtitle {
  font-size: 12px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
}

/* Ensure recent card items don't inherit link color */
a.recent-card-item {
  text-decoration: none;
  color: inherit;
}

a.recent-card-item .recent-item-title {
  color: var(--text-primary);
}

a.recent-card-item .recent-item-subtitle {
  color: var(--text-secondary);
}

.recent-item-category {
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
}

.recent-item-right {
  text-align: right;
  flex-shrink: 0;
  margin-left: 12px;
}

.recent-item-amount {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.recent-item-amount.positive {
  color: var(--success);
}

.recent-item-amount.negative {
  color: var(--danger);
}

.badge-status {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
  text-transform: capitalize;
  margin-top: 4px;
}

.badge-status.badge-success {
  background: var(--success-light);
  color: var(--success);
}

.badge-status.badge-danger {
  background: var(--danger-light);
  color: var(--danger);
}

.badge-status.badge-info {
  background: var(--info-light);
  color: var(--info);
}

.badge-status.badge-secondary {
  background: var(--background);
  color: var(--text-secondary);
}

/* Dashboard Quick Actions */
.dashboard-quick-actions {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow);
}

.quick-actions-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.quick-action-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  background: var(--background);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.quick-action-btn:hover {
  background: var(--border);
  transform: translateY(-2px);
}

.quick-action-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

.quick-action-icon.purple {
  background: rgba(168, 85, 247, 0.15);
  color: #a855f7;
}

.quick-action-icon.blue {
  background: var(--primary-light);
  color: var(--primary);
}

.quick-action-icon.green {
  background: var(--success-light);
  color: var(--success);
}

.quick-action-icon.red {
  background: var(--danger-light);
  color: var(--danger);
}

.quick-action-icon.orange {
  background: var(--warning-light);
  color: var(--warning);
}

/* Dashboard Charts */
.widget-subtitle {
  font-size: 12px;
  color: var(--text-muted);
}

/* Bar Chart Styles */
.chart-bar-container {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  height: 180px;
  padding: 0 8px;
  gap: 12px;
}

.chart-bar-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
}

.chart-bar-wrapper {
  flex: 1;
  width: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.chart-bar {
  width: 100%;
  max-width: 48px;
  background: linear-gradient(180deg, var(--primary) 0%, var(--primary-hover) 100%);
  border-radius: var(--radius) var(--radius) 0 0;
  min-height: 4px;
  position: relative;
  transition: height 0.5s ease;
}

.chart-bar:hover {
  background: linear-gradient(180deg, var(--primary-hover) 0%, var(--primary) 100%);
}

.chart-bar-value {
  position: absolute;
  top: -24px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 11px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.2s;
}

.chart-bar:hover .chart-bar-value,
.chart-bar-item:hover .chart-bar-value {
  opacity: 1;
}

.chart-bar-label {
  margin-top: 8px;
  font-size: 12px;
  color: var(--text-secondary);
  text-align: center;
}

/* Donut Chart Styles */
.chart-donut-container {
  display: flex;
  align-items: center;
  gap: 24px;
}

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

.donut-svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.donut-segment {
  transition: stroke-dasharray 0.5s ease, stroke 0.2s;
}

.donut-segment:hover {
  filter: brightness(1.1);
}

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

.donut-total {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}

.donut-label {
  font-size: 11px;
  color: var(--text-muted);
}

.chart-legend {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

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

.legend-color {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  flex-shrink: 0;
}

.legend-label {
  flex: 1;
  font-size: 13px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.legend-value {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.legend-percent {
  font-size: 12px;
  color: var(--text-muted);
  min-width: 36px;
  text-align: right;
}

/* Dashboard Responsive */
@media (max-width: 768px) {
  .dashboard-alerts {
    flex-direction: column;
  }

  .dashboard-alert {
    min-width: 100%;
  }

  .chart-donut-container {
    flex-direction: column;
    align-items: center;
  }

  .chart-legend {
    width: 100%;
  }

  .dashboard-financial-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .dashboard-financial-card {
    padding: 16px;
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .financial-card-icon {
    width: 48px;
    height: 48px;
    font-size: 20px;
  }

  .financial-card-value {
    font-size: 20px;
  }

  .financial-card-change {
    flex-wrap: wrap;
    white-space: normal;
  }

  .dashboard-widgets-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-recent-grid {
    grid-template-columns: 1fr;
  }

  .widget-inventory-stats {
    gap: 8px;
  }

  .inventory-stat-value {
    font-size: 22px;
  }

  .quick-actions-grid {
    gap: 8px;
  }

  .quick-action-btn {
    flex: 1;
    min-width: calc(50% - 4px);
    padding: 10px 12px;
    font-size: 13px;
  }
}

@media (max-width: 480px) {
  .dashboard-financial-grid {
    grid-template-columns: 1fr;
  }

  .widget-quick-stats {
    grid-template-columns: 1fr;
  }
}

/* Quick Actions Section */
.quick-actions {
  background: var(--surface);
  border-radius: 16px;
  padding: 32px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  margin-bottom: 32px;
}

.section-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 20px;
}

.action-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
}

.action-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  background: var(--background);
  border: 2px solid var(--border);
  border-radius: 12px;
  text-decoration: none;
  color: var(--text-primary);
  font-weight: 600;
  transition: all 0.2s;
}

.action-btn:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
  transform: translateY(-2px);
}

.action-btn i {
  font-size: 24px;
}

/* Recent Section */
.recent-section {
  background: var(--surface);
  border-radius: 16px;
  padding: 24px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  height: 100%;
}

.recent-item {
  display: flex;
  align-items: center;
  padding: 16px;
  border-radius: 12px;
  margin-bottom: 8px;
  transition: all 0.2s;
  text-decoration: none;
  color: inherit;
}

.recent-item:hover {
  background: var(--background);
}

.recent-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 16px;
  font-size: 18px;
  flex-shrink: 0;
}

.recent-icon.blue {
  background: var(--primary-light);
  color: var(--primary);
}

.recent-icon.green {
  background: var(--success-light);
  color: var(--success);
}

.recent-icon.purple {
  background: rgba(168, 85, 247, 0.15);
  color: #a855f7;
}

.recent-icon.orange {
  background: var(--warning-light);
  color: var(--warning);
}

.recent-icon.red {
  background: var(--danger-light);
  color: var(--danger);
}

.recent-content {
  flex: 1;
  min-width: 0;
}

.recent-title {
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.recent-meta {
  font-size: 14px;
  color: var(--text-secondary);
}

/* Badge Custom */
.badge-custom {
  padding: 4px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
}

/* Page Subtitle */
.page-subtitle {
  font-size: 16px;
  color: var(--text-secondary);
  margin-bottom: 0;
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
  font-weight: 500;
  font-size: 14px;
  padding: 10px 20px;
  border-radius: var(--radius);
  transition: all var(--transition);
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn:focus {
  box-shadow: 0 0 0 3px var(--primary-light);
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-primary:hover {
  background: var(--primary-hover);
  color: white;
}

.btn-success {
  background: var(--success);
  color: white;
}

.btn-success:hover {
  background: #16a34a;
  color: white;
}

.btn-warning {
  background: var(--warning);
  color: white;
}

.btn-warning:hover {
  background: #d97706;
  color: white;
}

.btn-danger {
  background: var(--danger);
  color: white;
}

.btn-danger:hover {
  background: #dc2626;
  color: white;
}

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

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

.btn-outline-primary {
  background: transparent;
  color: var(--primary);
  border: 1px solid var(--primary);
}

.btn-outline-primary:hover {
  background: var(--primary);
  color: white;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 13px;
}

.btn-lg {
  padding: 14px 28px;
  font-size: 16px;
}

/* ============================================
   FORMS
   ============================================ */
.form-label {
  font-weight: 500;
  font-size: 14px;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.form-control,
.form-select {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 14px;
  font-size: 14px;
  transition: all var(--transition);
  background: var(--surface);
  color: var(--text-primary);
}

.form-control:focus,
.form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
  outline: none;
}

.form-control::placeholder {
  color: var(--text-muted);
}

.input-group-text {
  background: var(--background);
  border: 1px solid var(--border);
  color: var(--text-secondary);
}

/* ============================================
   TABLES
   ============================================ */
.table {
  font-size: 14px;
  color: var(--text-primary);
}

.table thead th {
  background: var(--background);
  border-bottom: 2px solid var(--border);
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: 0.5px;
  padding: 14px 16px;
  white-space: nowrap;
}

.table tbody tr {
  border-bottom: 1px solid var(--border-light);
  transition: background var(--transition-fast);
}

.table tbody tr:hover {
  background: var(--primary-light);
}

.table td {
  padding: 14px 16px;
  vertical-align: middle;
}

/* Responsive Table Container */
.table-responsive {
  border-radius: var(--radius);
  overflow: hidden;
}

/* ============================================
   BADGES
   ============================================ */
.badge {
  padding: 4px 10px;
  font-weight: 500;
  font-size: 12px;
  border-radius: var(--radius-full);
  letter-spacing: 0.3px;
}

.badge-success {
  background: var(--success-light);
  color: #166534;
}

.badge-warning {
  background: var(--warning-light);
  color: #92400e;
}

.badge-danger {
  background: var(--danger-light);
  color: #991b1b;
}

.badge-info {
  background: var(--info-light);
  color: #0e7490;
}

/* ============================================
   ALERTS
   ============================================ */
.alert {
  border: none;
  border-radius: var(--radius);
  padding: 14px 20px;
  font-size: 14px;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 12px;
}

.alert-success {
  background: var(--success-light);
  color: #166534;
}

.alert-danger {
  background: var(--danger-light);
  color: #991b1b;
}

.alert-warning {
  background: var(--warning-light);
  color: #92400e;
}

.alert-info {
  background: var(--info-light);
  color: #0e7490;
}

/* ============================================
   HEADINGS & TYPOGRAPHY
   ============================================ */
h1, h2, h3, h4, h5, h6 {
  color: var(--text-primary);
  font-weight: 600;
  line-height: 1.3;
}

h1 {
  font-size: 28px;
}

h2 {
  font-size: 24px;
}

h3 {
  font-size: 20px;
}

h4 {
  font-size: 18px;
}

h5 {
  font-size: 16px;
}

h6 {
  font-size: 14px;
}

.page-title {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 24px;
  color: var(--text-primary);
}

.text-muted {
  color: var(--text-muted) !important;
}

.text-secondary {
  color: var(--text-secondary) !important;
}

/* ============================================
   DROPDOWN MENUS
   ============================================ */
.dropdown-menu {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 8px 0;
}

.dropdown-item {
  padding: 10px 16px;
  font-size: 14px;
  color: var(--text-primary);
  transition: background var(--transition-fast);
}

.dropdown-item:hover {
  background: var(--primary-light);
  color: var(--primary);
}

/* ============================================
   AUTH PAGES
   ============================================ */
/* ============================================
   AUTH PAGES - Modern Design
   ============================================ */
.auth-page {
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 24px;
  padding-top: calc(60px + env(safe-area-inset-top, 0px));
  padding-bottom: calc(40px + env(safe-area-inset-bottom, 0px));
  overflow: hidden;
  background: var(--background);
}

.auth-container {
  width: 100%;
  max-width: 100%;
}

.auth-container-wide {
  max-width: 100%;
}

.auth-header {
  text-align: center;
  margin-bottom: 32px;
}

.auth-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 24px;
  color: var(--text-primary);
  font-size: 24px;
  font-weight: 700;
}

.auth-logo-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-lg);
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-logo-icon i {
  font-size: 26px;
  color: #fff;
}

.auth-header h1 {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.auth-header p {
  font-size: 16px;
  color: var(--text-secondary);
  margin-bottom: 0;
}

.auth-form {
  background: var(--surface);
  border-radius: var(--radius-xl);
  padding: 24px;
  border: 1px solid var(--border);
}

.auth-form .form-group {
  margin-bottom: 18px;
}

.auth-form .form-group:last-of-type {
  margin-bottom: 24px;
}

.auth-form label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

.auth-form .input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.auth-form .input-wrapper i {
  position: absolute;
  left: 16px;
  color: var(--text-muted);
  font-size: 18px;
}

.auth-form .input-wrapper input {
  width: 100%;
  padding: 16px 16px 16px 48px;
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: 16px;
  transition: all var(--transition);
}

.auth-form .input-wrapper input::placeholder {
  color: var(--text-muted);
}

.auth-form .input-wrapper input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

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

.btn-auth-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 16px 24px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-auth-primary:hover {
  background: var(--primary-hover);
}

.auth-footer {
  text-align: center;
  margin-top: 24px;
}

.auth-footer p {
  font-size: 15px;
  color: var(--text-secondary);
  margin-bottom: 0;
}

.auth-footer a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
}

.auth-footer a:hover {
  text-decoration: underline;
}

/* Auth pages mobile */
@media (max-width: 480px) {
  .auth-form .form-row {
    grid-template-columns: 1fr 1fr;
  }

  .auth-form {
    padding: 24px;
  }

  .auth-header h1 {
    font-size: 22px;
  }
}

/* Legacy auth-card styles for backwards compatibility */
.auth-card {
  background: var(--surface);
  border-radius: var(--radius-xl);
  padding: 40px;
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 420px;
}

.auth-card .logo {
  justify-content: center;
  margin-bottom: 32px;
  color: var(--text-primary);
}

.auth-card .logo i {
  color: var(--primary);
}

.auth-title {
  text-align: center;
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 8px;
}

.auth-subtitle {
  text-align: center;
  color: var(--text-secondary);
  margin-bottom: 32px;
}

.auth-card-wide {
  max-width: 480px;
}

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

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

.auth-divider span {
  padding: 0 16px;
  color: var(--text-muted);
  font-size: 14px;
}

.auth-footer-old {
  text-align: center;
  color: var(--text-secondary);
  margin-bottom: 0;
}

.auth-footer-old a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
}

.auth-footer-old a:hover {
  text-decoration: underline;
}

/* ============================================
   MODALS
   ============================================ */
.modal-content {
  border-radius: var(--radius-xl);
  border: none;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.modal-header {
  border-bottom: 1px solid var(--border-light);
  padding: 20px 24px;
}

.modal-title {
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-body {
  padding: 24px;
}

.modal-footer {
  border-top: 1px solid var(--border-light);
  padding: 16px 24px;
}

/* ============================================
   EMPTY STATES
   ============================================ */
.empty-state {
  text-align: center;
  padding: 60px 24px;
}

.empty-state > i {
  font-size: 64px;
  color: var(--text-muted);
  margin-bottom: 16px;
  display: block;
}

.empty-state h3 {
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.empty-state p {
  color: var(--text-muted);
  margin-bottom: 24px;
}

.empty-state .btn {
  font-size: 14px;
}

.empty-state .btn i {
  font-size: inherit;
  margin-bottom: 0;
}

/* ============================================
   MOBILE BOTTOM NAVIGATION
   ============================================ */
.bottom-nav {
  display: none;
}

/* ============================================
   MORE MENU (Bottom Sheet) - Hidden on desktop
   ============================================ */
.more-menu-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1100;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.more-menu-overlay.open {
  opacity: 1;
  visibility: visible;
}

.more-menu {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--surface);
  border-radius: 16px 16px 0 0;
  z-index: 1200;
  max-height: 70vh;
  overflow-y: auto;
  padding-bottom: env(safe-area-inset-bottom, 16px);
  box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.15);
  transform: translateY(100%);
  opacity: 0;
  visibility: hidden;
  transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1), opacity 0.3s ease, visibility 0.3s ease;
}

.more-menu.open {
  transform: translateY(0);
  opacity: 1;
  visibility: visible;
}

/* ============================================
   AI INSIGHTS BUTTON & MODAL
   ============================================ */
.page-header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}

.btn-ai-insights {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%);
  color: white;
  border: none;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  box-shadow: 0 2px 8px rgba(139, 92, 246, 0.3);
}

.btn-ai-insights:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(139, 92, 246, 0.4);
}

.btn-ai-insights i {
  font-size: 16px;
}

/* AI Insights Modal Overlay */
.ai-insights-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 20px;
}

.ai-insights-overlay.show {
  display: flex;
}

/* AI Insights Modal Container */
.ai-insights-modal {
  background: var(--surface);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 700px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.3s ease;
}

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

.ai-insights-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}

.ai-insights-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.ai-insights-title i {
  color: #8b5cf6;
}

.ai-insights-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--transition);
}

.ai-insights-close:hover {
  background: var(--background);
  color: var(--text-primary);
}

.ai-insights-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}

/* Insights Loading */
.insights-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  gap: 16px;
}

.insights-loading .spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: #8b5cf6;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.insights-loading p {
  color: var(--text-secondary);
  font-size: 14px;
  margin: 0;
}

/* Insights Content */
.insights-content {
  display: none;
}

.insights-text {
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-primary);
}

.insights-text p {
  margin-bottom: 16px;
}

.insights-text strong {
  color: #8b5cf6;
}

.insights-text li {
  margin-bottom: 8px;
  padding-left: 8px;
}

.insights-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 40px 20px;
  text-align: center;
  gap: 12px;
  color: var(--danger);
}

.insights-error i {
  font-size: 40px;
}

.insights-error p {
  color: var(--text-secondary);
  margin: 0;
}

/* ============================================
   VISUAL INSIGHTS COMPONENTS
   ============================================ */

/* Health Score Circle */
.insight-health-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}

.insight-health-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 16px;
}

.insight-health-circle {
  position: relative;
  width: 140px;
  height: 140px;
}

.insight-health-circle svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.insight-health-circle .health-bg {
  fill: none;
  stroke: var(--border);
  stroke-width: 6;
}

.insight-health-circle .health-fill {
  fill: none;
  stroke-width: 6;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.8s ease-out;
}

.health-score-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
}

.health-score-value {
  display: block;
  font-size: 42px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
}

.insight-health-label {
  display: inline-block;
  font-size: 14px;
  font-weight: 600;
  margin-top: 16px;
  padding: 6px 16px;
  border-radius: var(--radius-full);
}

.insight-health-label.healthy {
  background: rgba(34, 197, 94, 0.1);
  color: #22c55e;
}

.insight-health-label.attention {
  background: rgba(245, 158, 11, 0.1);
  color: #f59e0b;
}

.insight-health-label.critical {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

/* Metrics Grid */
.insight-metrics-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.insight-metric-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px;
  background: var(--background);
  border-radius: var(--radius);
}

.insight-metric-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.insight-metric-icon i {
  font-size: 18px;
}

.insight-metric-icon.green {
  background: rgba(34, 197, 94, 0.1);
  color: #22c55e;
}

.insight-metric-icon.red {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

.insight-metric-icon.blue {
  background: rgba(59, 130, 246, 0.1);
  color: #3b82f6;
}

.insight-metric-icon.orange {
  background: rgba(245, 158, 11, 0.1);
  color: #f59e0b;
}

.insight-metric-info {
  flex: 1;
  min-width: 0;
}

.insight-metric-value {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.2;
}

.insight-metric-value.negative {
  color: #ef4444;
}

.insight-metric-label {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.insight-metric-change {
  font-size: 11px;
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 2px;
}

.insight-metric-change.positive {
  color: #22c55e;
}

.insight-metric-change.negative {
  color: #ef4444;
}

.insight-metric-change.neutral {
  color: var(--text-secondary);
}

/* Section Titles */
.insight-section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.insight-section-title i {
  color: #8b5cf6;
}

.insight-section-title.clickable {
  cursor: pointer;
  user-select: none;
}

.insight-section-title.clickable:hover {
  color: #8b5cf6;
}

/* Alerts Section */
.insight-alerts-section {
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.insight-alert {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: var(--radius);
  margin-bottom: 8px;
}

.insight-alert:last-child {
  margin-bottom: 0;
}

.insight-alert.danger {
  background: rgba(239, 68, 68, 0.08);
  border-left: 3px solid #ef4444;
}

.insight-alert.warning {
  background: rgba(245, 158, 11, 0.08);
  border-left: 3px solid #f59e0b;
}

.insight-alert.info {
  background: rgba(59, 130, 246, 0.08);
  border-left: 3px solid #3b82f6;
}

.insight-alert.success {
  background: rgba(34, 197, 94, 0.08);
  border-left: 3px solid #22c55e;
}

.insight-alert-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.insight-alert.danger .insight-alert-icon {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}

.insight-alert.warning .insight-alert-icon {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
}

.insight-alert.info .insight-alert-icon {
  background: rgba(59, 130, 246, 0.15);
  color: #3b82f6;
}

.insight-alert.success .insight-alert-icon {
  background: rgba(34, 197, 94, 0.15);
  color: #22c55e;
}

.insight-alert-content {
  flex: 1;
  min-width: 0;
}

.insight-alert-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.insight-alert-value {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.insight-alert-action {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  padding: 4px 8px;
  background: var(--surface);
  border-radius: var(--radius-sm);
}

/* Top Customers Chart */
.insight-customers-section {
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.insight-customers-chart {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.insight-customer-bar {
  display: flex;
  align-items: center;
  gap: 12px;
}

.insight-customer-name {
  width: 100px;
  font-size: 13px;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-shrink: 0;
}

.insight-customer-bar-wrap {
  flex: 1;
  height: 8px;
  background: var(--background);
  border-radius: 4px;
  overflow: hidden;
}

.insight-customer-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.5s ease;
}

.insight-customer-value {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  width: 70px;
  text-align: right;
  flex-shrink: 0;
}

/* AI Text Section */
.insight-ai-section {
  margin-top: 8px;
}

.insight-ai-text {
  background: var(--background);
  border-radius: var(--radius);
  padding: 16px;
  margin-top: 12px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-primary);
}

.insight-ai-text p {
  margin-bottom: 12px;
}

.insight-ai-text p:last-child {
  margin-bottom: 0;
}

.insight-ai-text strong {
  color: #8b5cf6;
}

.insight-ai-text li {
  margin-bottom: 6px;
  padding-left: 4px;
}

/* AI Insights Footer */
.ai-insights-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  background: var(--background);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.insights-timestamp {
  font-size: 12px;
  color: var(--text-muted);
}

.btn-export-report {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
  border: none;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-export-report:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.btn-export-report:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.btn-export-report i {
  font-size: 16px;
}

/* Performance Indicator Gauges */
.insight-gauges-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.insight-gauge-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 12px;
  text-align: center;
  transition: all var(--transition);
}

.insight-gauge-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
}

.gauge-mini {
  width: 90px;
  height: 90px;
  margin: 0 auto 12px;
  position: relative;
}

.gauge-mini svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.gauge-bg {
  fill: none;
  stroke: var(--border);
  stroke-width: 6;
}

.gauge-fill {
  fill: none;
  stroke-width: 6;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.6s ease-out;
}

.gauge-value {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
}

.gauge-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.gauge-trend {
  font-size: 11px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.gauge-trend.positive,
.gauge-trend.improving {
  color: var(--success);
}

.gauge-trend.negative,
.gauge-trend.declining {
  color: var(--danger);
}

.gauge-trend.stable {
  color: var(--warning);
}

.gauge-trend i {
  font-size: 10px;
}

.gauge-detail {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
  line-height: 1.4;
}

.gauge-detail .positive,
.gauge-detail .risk-low {
  color: var(--success);
}

.gauge-detail .stable,
.gauge-detail .risk-medium {
  color: var(--warning);
}

.gauge-detail .negative,
.gauge-detail .risk-high {
  color: var(--danger);
}

/* Financial Ratios Section */
.insight-ratios-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 20px;
}

.insight-ratios-section h4 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 12px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.insight-ratios-section h4 i {
  color: var(--primary);
}

.insight-ratios-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.ratio-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  background: var(--background);
  border-radius: var(--radius-sm);
}

.ratio-item .ratio-label {
  font-size: 12px;
  color: var(--text-secondary);
}

.ratio-item .ratio-value {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.ratio-item .ratio-value.positive {
  color: var(--success);
}

.ratio-item .ratio-value.negative {
  color: var(--danger);
}

.ratio-item .ratio-value.warning {
  color: var(--warning);
}

/* Dead Stock Alert Section */
.insight-deadstock-section {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  border: 1px solid #f59e0b;
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 20px;
}

html.dark-mode .insight-deadstock-section {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.15) 0%, rgba(245, 158, 11, 0.1) 100%);
}

.insight-deadstock-section h4 {
  font-size: 14px;
  font-weight: 600;
  color: #92400e;
  margin: 0 0 12px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

html.dark-mode .insight-deadstock-section h4 {
  color: #fbbf24;
}

.insight-deadstock-section h4 i {
  color: #f59e0b;
}

.deadstock-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.deadstock-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.7);
  border-radius: var(--radius-sm);
}

html.dark-mode .deadstock-item {
  background: rgba(0, 0, 0, 0.2);
}

.deadstock-item .item-name {
  font-size: 13px;
  font-weight: 500;
  color: #92400e;
}

html.dark-mode .deadstock-item .item-name {
  color: var(--text-primary);
}

.deadstock-item .item-qty {
  font-size: 12px;
  color: #b45309;
  font-weight: 600;
}

html.dark-mode .deadstock-item .item-qty {
  color: #fbbf24;
}

.deadstock-note {
  font-size: 11px;
  color: #92400e;
  margin-top: 8px;
  font-style: italic;
}

html.dark-mode .deadstock-note {
  color: var(--text-muted);
}

/* ============================================
   MOBILE RESPONSIVE STYLES
   ============================================ */
@media (max-width: 1024px) {
  :root {
    --sidebar-width: 0px;
  }

  /* Hide sidebar on tablet/mobile */
  .sidebar {
    display: none;
  }

  /* Full width main content */
  .main-content {
    margin-left: 0;
  }

  /* Page header with AI button */
  .page-header {
    flex-wrap: wrap;
    gap: 12px;
  }

  .page-header-actions {
    order: 3;
    width: 100%;
  }

  .btn-ai-insights {
    width: 100%;
    justify-content: center;
    padding: 12px 16px;
  }

  /* AI Insights Modal - Mobile */
  .ai-insights-overlay {
    padding: 0;
    align-items: flex-end;
  }

  .ai-insights-modal {
    max-width: 100%;
    max-height: 90vh;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  }

  .ai-insights-header {
    padding: 16px 20px;
  }

  .ai-insights-title {
    font-size: 16px;
  }

  .ai-insights-body {
    padding: 16px 20px;
  }

  .insights-loading {
    padding: 40px 16px;
  }

  .insights-text {
    font-size: 13px;
    line-height: 1.6;
  }

  /* Visual Insights Mobile */
  .insight-health-title {
    font-size: 14px;
    margin-bottom: 12px;
  }

  .insight-health-circle {
    width: 120px;
    height: 120px;
  }

  .health-score-value {
    font-size: 36px;
  }

  .insight-health-label {
    font-size: 13px;
    margin-top: 12px;
    padding: 5px 14px;
  }

  .insight-metrics-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .insight-metric-card {
    padding: 12px;
  }

  .insight-metric-value {
    font-size: 16px;
  }

  .insight-alert {
    flex-wrap: wrap;
    gap: 8px;
  }

  .insight-alert-action {
    width: 100%;
    text-align: center;
    margin-top: 4px;
  }

  .insight-customer-name {
    width: 80px;
    font-size: 12px;
  }

  .insight-customer-value {
    width: 60px;
    font-size: 12px;
  }

  .ai-insights-footer {
    padding: 12px 16px;
  }

  .btn-export-report {
    width: 100%;
    justify-content: center;
  }

  /* Performance Gauges Mobile */
  .insight-gauges-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .insight-gauge-card {
    padding: 12px 8px;
  }

  .gauge-mini {
    width: 70px;
    height: 70px;
    margin-bottom: 10px;
  }

  .gauge-value {
    font-size: 16px;
  }

  .gauge-label {
    font-size: 12px;
  }

  .gauge-trend {
    font-size: 10px;
  }

  .gauge-detail {
    font-size: 10px;
  }

  /* Financial Ratios Mobile */
  .insight-ratios-grid {
    grid-template-columns: 1fr;
  }

  .ratio-item {
    padding: 8px 10px;
  }

  .ratio-item .ratio-label {
    font-size: 11px;
  }

  .ratio-item .ratio-value {
    font-size: 13px;
  }

  /* Dead Stock Mobile */
  .insight-deadstock-section {
    padding: 12px;
  }

  .deadstock-item {
    padding: 8px 10px;
  }

  .deadstock-item .item-name {
    font-size: 12px;
  }

  .deadstock-item .item-qty {
    font-size: 11px;
  }

  /* Show top bar on mobile */
  .top-bar {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    padding-top: calc(12px + env(safe-area-inset-top, 0px));
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: var(--z-topbar);
    box-shadow: var(--shadow-sm);
  }

  .top-bar-left {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--text-primary);
  }

  .top-bar-left i {
    color: var(--primary);
    font-size: 1.25rem;
  }

  /* Pull to Refresh - Native Style */
  .pull-to-refresh {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%) translateY(-60px);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface);
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    z-index: calc(var(--z-topbar) + 10);
    opacity: 0;
    transition: transform 0.2s ease, opacity 0.2s ease;
    margin-top: env(safe-area-inset-top, 0px);
  }

  .pull-to-refresh.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(70px);
  }

  .pull-to-refresh.refreshing {
    opacity: 1;
    transform: translateX(-50%) translateY(70px);
  }

  /* Loading Spinner */
  .pull-to-refresh-spinner {
    width: 22px;
    height: 22px;
    border: 2.5px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
  }

  .pull-to-refresh.refreshing .pull-to-refresh-spinner {
    animation: ptr-spin 0.7s linear infinite;
  }

  @keyframes ptr-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
  }

  .top-bar-switcher-wrap {
    position: relative;
  }

  .top-bar-switcher {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--primary-light);
    border: none;
    border-radius: var(--radius-full);
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
  }

  .top-bar-switcher:hover,
  .top-bar-switcher.active {
    background: var(--primary);
    color: white;
  }

  .top-bar-switcher i:first-child {
    color: var(--primary);
    font-size: 0.9rem;
  }

  .top-bar-switcher:hover i:first-child,
  .top-bar-switcher.active i:first-child {
    color: white;
  }

  .top-bar-switcher i:last-child {
    font-size: 0.7rem;
    opacity: 0.7;
    transition: var(--transition);
  }

  .top-bar-switcher.active i:last-child {
    transform: rotate(180deg);
  }

  .top-bar-switcher span {
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .top-bar-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 220px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    z-index: var(--z-modal);
    overflow: hidden;
  }

  .top-bar-dropdown.show {
    display: block;
    animation: slideDown 0.2s ease;
  }

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

  .top-bar-dropdown-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
    font-size: 0.8rem;
    color: var(--text-secondary);
  }

  .top-bar-dropdown-header a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
  }

  .top-bar-dropdown-list {
    max-height: 240px;
    overflow-y: auto;
  }

  .top-bar-dropdown-list form {
    margin: 0;
  }

  .top-bar-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 12px 14px;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 0.9rem;
    text-align: left;
    cursor: pointer;
    transition: var(--transition);
  }

  .top-bar-dropdown-item:hover {
    background: var(--primary-light);
  }

  .top-bar-dropdown-item.active {
    background: var(--primary-light);
    color: var(--primary);
  }

  .top-bar-dropdown-item i:first-child {
    color: var(--primary);
    font-size: 1rem;
  }

  .top-bar-dropdown-item span {
    flex: 1;
  }

  .top-bar-dropdown-item i:last-child {
    color: var(--success);
    font-size: 0.9rem;
  }

  .top-bar-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
  }

  .top-bar-title i {
    color: var(--primary);
    font-size: 22px;
  }

  .top-bar-business {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 2px;
  }

  .top-bar-business i {
    font-size: 11px;
  }

  .top-bar-business span {
    max-width: 200px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* Adjust page content for mobile */
  .page-content {
    padding: 16px;
    padding-bottom: 100px; /* Space for bottom nav */
  }

  /* Show bottom navigation */
  .bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 64px;
    background: var(--surface);
    border-top: 1px solid var(--border);
    z-index: var(--z-bottom-nav);
    padding: 0 8px;
    padding-bottom: env(safe-area-inset-bottom, 0);
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
  }

  .bottom-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 11px;
    font-weight: 500;
    padding: 8px 4px;
    background: none;
    border: none;
    cursor: pointer;
    transition: color var(--transition-fast);
  }

  .bottom-nav-item i {
    font-size: 22px;
    transition: transform var(--transition-fast);
  }

  .bottom-nav-item.active,
  .bottom-nav-item:hover {
    color: var(--primary);
  }

  .bottom-nav-item.active i {
    transform: scale(1.1);
  }

  /* Center button (New Invoice) */
  .bottom-nav-center .center-btn {
    width: 48px;
    height: 48px;
    background: var(--primary);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
    margin-top: -20px;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
    transition: all var(--transition);
  }

  .bottom-nav-center:hover .center-btn {
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(59, 130, 246, 0.5);
  }

  .bottom-nav-center span {
    margin-top: 4px;
  }

  /* More Menu Handle */
  .more-menu-handle {
    width: 40px;
    height: 4px;
    background: var(--border);
    border-radius: var(--radius-full);
    margin: 12px auto;
  }

  .more-menu-header {
    padding: 8px 20px 16px;
    border-bottom: 1px solid var(--border-light);
  }

  .more-menu-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
  }

  .more-menu-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    padding: 16px 12px;
  }

  .more-menu-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px 8px;
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--text-primary);
    transition: background var(--transition-fast);
  }

  .more-menu-item:hover {
    background: var(--background);
  }

  .more-menu-item i {
    font-size: 24px;
    color: var(--primary);
  }

  .more-menu-item span {
    font-size: 12px;
    font-weight: 500;
    text-align: center;
  }

  .more-menu-divider {
    height: 1px;
    background: var(--border-light);
    margin: 0 16px;
  }

  .more-menu-list {
    padding: 8px 0;
  }

  .more-menu-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    transition: background var(--transition-fast);
  }

  .more-menu-link:hover {
    background: var(--background);
  }

  .more-menu-link i {
    font-size: 20px;
    color: var(--text-secondary);
    width: 24px;
  }

  .more-menu-link.danger {
    color: var(--danger);
  }

  .more-menu-link.danger i {
    color: var(--danger);
  }

  /* Prevent body scroll when menu open */
  body.menu-open {
    overflow: hidden;
  }
}

/* ============================================
   SMALL MOBILE (< 576px)
   ============================================ */
@media (max-width: 575.98px) {
  html {
    font-size: 13px;
  }

  .page-content {
    padding: 12px;
    padding-bottom: 90px;
  }

  .card-body {
    padding: 16px;
  }

  .auth-card {
    padding: 24px;
    margin: 16px;
  }

  .page-title {
    font-size: 24px;
  }

  .btn {
    padding: 10px 16px;
    font-size: 13px;
  }

  .table td,
  .table th {
    padding: 10px 12px;
  }

  /* Stack buttons on mobile */
  .btn-group-mobile {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  .btn-group-mobile .btn {
    width: 100%;
  }

  /* More menu adjustments */
  .more-menu-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ============================================
   UTILITY CLASSES
   ============================================ */
.gap-1 { gap: 4px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 16px; }
.gap-4 { gap: 24px; }

.rounded-lg { border-radius: var(--radius-lg); }
.rounded-xl { border-radius: var(--radius-xl); }

.shadow-sm { box-shadow: var(--shadow-sm); }
.shadow-md { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }

/* Hide on mobile */
@media (max-width: 1024px) {
  .hide-mobile {
    display: none !important;
  }
}

/* Hide on desktop */
@media (min-width: 1025px) {
  .hide-desktop {
    display: none !important;
  }
}

/* ============================================
   PWA / iOS SAFE AREA
   ============================================ */
@supports (padding: env(safe-area-inset-bottom)) {
  .bottom-nav {
    padding-bottom: calc(8px + env(safe-area-inset-bottom));
    height: calc(64px + env(safe-area-inset-bottom));
  }

  .page-content {
    padding-bottom: calc(100px + env(safe-area-inset-bottom));
  }

  .more-menu {
    padding-bottom: calc(16px + env(safe-area-inset-bottom));
  }
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

.animate-slide-up {
  animation: slideUp var(--transition-slow) ease-out;
}

.animate-pulse {
  animation: pulse 2s infinite;
}

/* ============================================
   ERROR PAGES
   ============================================ */
.error-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--background);
}

.error-content {
  text-align: center;
  max-width: 480px;
}

.error-icon {
  width: 100px;
  height: 100px;
  border-radius: var(--radius-full);
  background: var(--warning-light);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
}

.error-icon i {
  font-size: 48px;
  color: var(--warning);
}

.error-icon-danger {
  background: var(--danger-light);
}

.error-icon-danger i {
  color: var(--danger);
}

.error-code {
  font-size: 72px;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 8px;
  line-height: 1;
}

.error-title {
  font-size: 24px;
  font-weight: 600;
  margin-bottom: 12px;
}

.error-message {
  color: var(--text-secondary);
  margin-bottom: 32px;
}

.error-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ============================================
   LANDING PAGE - Modern Design
   ============================================ */
.landing-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  background: var(--background);
  padding: 0 24px;
  padding-top: calc(60px + env(safe-area-inset-top, 0px));
  padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px));
}

.landing-hero {
  padding: 40px 0 32px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.hero-content {
  text-align: center;
  width: 100%;
}

.hero-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 24px;
  color: var(--text-primary);
  font-size: 28px;
  font-weight: 700;
}

.hero-logo-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-lg);
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-logo-icon i {
  font-size: 28px;
  color: #fff;
}

.hero-title {
  font-size: 32px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 16px;
  line-height: 1.2;
}

.hero-title span {
  color: var(--primary);
}

.hero-subtitle {
  font-size: 16px;
  color: var(--text-secondary);
  margin-bottom: 32px;
  line-height: 1.6;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}

.hero-actions {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.btn-hero-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px 28px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  transition: all var(--transition);
}

.btn-hero-primary:hover {
  background: var(--primary-hover);
  color: #fff;
  transform: translateY(-2px);
}

.btn-hero-secondary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px 28px;
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 16px;
  font-weight: 500;
  text-decoration: none;
  transition: all var(--transition);
}

.btn-hero-secondary:hover {
  background: var(--primary-light);
  color: var(--primary);
  border-color: var(--primary);
}

/* Stats Section */
.landing-stats {
  padding: 32px 0;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 12px;
  text-align: center;
  transition: all var(--transition);
}

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

.stat-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 4px;
}

.stat-label {
  font-size: 11px;
  color: var(--text-secondary);
  font-weight: 500;
}

/* Workflow Section */
.landing-workflow {
  padding: 40px 0;
}

.section-title {
  text-align: center;
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.section-subtitle {
  text-align: center;
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 24px;
}

.workflow-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.workflow-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  transition: all var(--transition);
}

.workflow-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.workflow-number {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 12px;
}

.workflow-card h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.workflow-card p {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin: 0;
}

/* Features Section */
.landing-features {
  padding: 40px 0;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.feature-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px;
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  transition: all var(--transition);
}

.feature-item:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.feature-item-icon {
  width: 40px;
  height: 40px;
  min-width: 40px;
  border-radius: var(--radius);
  background: var(--primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
}

.feature-item-icon i {
  font-size: 18px;
  color: var(--primary);
}

.feature-item-icon-success {
  background: rgba(74, 222, 128, 0.15);
}

.feature-item-icon-success i {
  color: #4ade80;
}

.feature-item-icon-warning {
  background: rgba(251, 191, 36, 0.15);
}

.feature-item-icon-warning i {
  color: #fbbf24;
}

.feature-item-icon-info {
  background: rgba(34, 211, 238, 0.15);
}

.feature-item-icon-info i {
  color: #22d3ee;
}

.feature-item-icon-danger {
  background: rgba(248, 113, 113, 0.15);
}

.feature-item-icon-danger i {
  color: #f87171;
}

.feature-item-icon-purple {
  background: rgba(167, 139, 250, 0.15);
}

.feature-item-icon-purple i {
  color: #a78bfa;
}

.feature-item-icon-teal {
  background: rgba(45, 212, 191, 0.15);
}

.feature-item-icon-teal i {
  color: #2dd4bf;
}

.feature-item-icon-orange {
  background: rgba(251, 146, 60, 0.15);
}

.feature-item-icon-orange i {
  color: #fb923c;
}

.feature-item-content h3 {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.feature-item-content p {
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.4;
  margin: 0;
}

/* CTA Section */
.landing-cta {
  padding: 40px 20px;
  text-align: center;
  background: var(--primary-light);
  border-radius: var(--radius-lg);
  margin: 20px 0;
}

.landing-cta h2 {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.landing-cta p {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 20px;
}

.landing-cta .btn-hero-primary {
  display: inline-flex;
}

/* Footer */
.landing-footer {
  padding: 24px 0;
  text-align: center;
  background: transparent;
  border-top: 1px solid var(--border);
  margin-top: auto;
}

.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-primary);
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 8px;
}

.footer-brand i {
  color: var(--primary);
}

.landing-footer p {
  display: block;
  color: var(--text-muted);
  font-size: 12px;
  margin: 4px 0;
}

.footer-powered {
  font-size: 11px !important;
  color: var(--text-muted);
}

/* Mobile Landing Page */
@media (max-width: 480px) {
  .landing-page {
    padding: 0 16px;
    padding-top: calc(60px + env(safe-area-inset-top, 0px));
    padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  }

  .hero-title {
    font-size: 26px;
  }

  .hero-subtitle {
    font-size: 14px;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .stat-card {
    padding: 14px 8px;
  }

  .stat-value {
    font-size: 20px;
  }

  .stat-label {
    font-size: 10px;
  }

  .workflow-grid {
    grid-template-columns: 1fr;
  }

  .features-grid {
    grid-template-columns: 1fr;
  }

  .section-title {
    font-size: 20px;
  }

  .landing-cta {
    padding: 30px 16px;
    margin: 16px 0;
  }

  .landing-cta h2 {
    font-size: 18px;
  }
}

/* ============================================
   LIST GROUP ENHANCEMENTS
   ============================================ */
.list-group-item {
  border: none;
  border-bottom: 1px solid var(--border-light);
  padding: 12px 16px;
  transition: background var(--transition-fast);
}

.list-group-item:last-child {
  border-bottom: none;
}

.list-group-item-action:hover {
  background: var(--primary-light);
}

/* ============================================
   PAGE HEADER
   ============================================ */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.page-header-left {
  flex: 1;
  min-width: 200px;
}

.page-header .text-muted {
  font-size: 14px;
}

.page-header-content {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
  width: 100%;
}

.page-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  margin-bottom: 8px;
  transition: color var(--transition-fast);
}

.back-link:hover {
  color: var(--primary);
}

.inline-form {
  display: inline;
}

/* ============================================
   SEARCH SECTION
   ============================================ */
.search-section {
  margin-bottom: 24px;
}

.filter-select {
  min-width: 160px;
  max-width: 200px;
}

.filter-row {
  display: flex;
  gap: 12px;
  align-items: center;
}

.search-form {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

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

.search-input-wrapper > i.bi-search {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.search-clear-btn {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--border);
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  width: 24px;
  height: 24px;
  min-width: 24px;
  min-height: 24px;
  display: none;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all var(--transition);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  z-index: 5;
}

.search-clear-btn i {
  font-size: 12px;
  line-height: 1;
}

.search-clear-btn:hover,
.search-clear-btn:active {
  color: var(--text-primary);
  background: var(--text-muted);
}

.search-input-wrapper.has-value .search-clear-btn {
  display: flex !important;
}

.search-input-wrapper.has-value .search-input {
  padding-right: 40px;
}

/* Mobile-specific clear button - larger touch target */
@media (max-width: 768px) {
  .search-clear-btn {
    width: 28px;
    height: 28px;
    min-width: 28px;
    min-height: 28px;
    right: 10px;
  }

  .search-clear-btn i {
    font-size: 14px;
  }

  .search-input-wrapper.has-value .search-input {
    padding-right: 46px;
  }
}

.search-input {
  width: 100%;
  padding: 12px 14px 12px 42px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  transition: all var(--transition);
  background: var(--surface);
}

.search-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
  outline: none;
}

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

.btn-outline:hover {
  background: var(--background);
  border-color: var(--text-secondary);
}

/* ============================================
   DATA LIST (List Items)
   ============================================ */
.data-list {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
  margin-bottom: 24px;
}

.data-list.compact {
  box-shadow: none;
  border: 1px solid var(--border);
}

.data-list-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  text-decoration: none;
  color: inherit;
  border-bottom: 1px solid var(--border-light);
  transition: background var(--transition-fast);
}

.data-list-item:last-child {
  border-bottom: none;
}

.data-list-item:hover {
  background: var(--primary-light);
}

.data-list-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.data-list-icon i {
  font-size: 20px;
}

.data-list-icon.blue {
  background: var(--primary-light);
  color: var(--primary);
}

.data-list-icon.green {
  background: var(--success-light);
  color: var(--success);
}

.data-list-icon.purple {
  background: rgba(139, 92, 246, 0.15);
  color: #8b5cf6;
}

.data-list-icon.orange {
  background: var(--warning-light);
  color: var(--warning);
}

.data-list-icon.red {
  background: var(--danger-light);
  color: var(--danger);
}

.data-list-content {
  flex: 1;
  min-width: 0;
}

.data-list-title {
  font-weight: 600;
  font-size: 15px;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.data-list-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 13px;
  color: var(--text-secondary);
}

.data-list-meta span {
  display: flex;
  align-items: center;
  gap: 4px;
}

.data-list-meta i {
  font-size: 14px;
}

.data-list-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 6px;
}

.data-list-stats span {
  display: flex;
  align-items: center;
  gap: 4px;
}

.data-list-arrow {
  color: var(--text-muted);
  font-size: 16px;
}

.data-list-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.data-list-item.inactive {
  opacity: 0.6;
}

.data-list-amount {
  font-weight: 600;
  font-size: 15px;
  color: var(--text-primary);
  margin-right: 12px;
}

.data-list-badge {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  flex-shrink: 0;
}

.data-list-item.item-cancelled {
  opacity: 0.6;
  background: rgba(239, 68, 68, 0.03);
}

.data-list-item.item-cancelled:hover {
  background: rgba(239, 68, 68, 0.08);
}

.data-list-title .departure-time {
  font-size: 13px;
  font-weight: 500;
  color: var(--primary);
  background: var(--primary-light);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  margin-left: 8px;
}

.data-list-title .amount-badge {
  font-size: 13px;
  font-weight: 600;
  color: var(--success);
  margin-left: 8px;
}

.data-list-title .code-badge {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--border-light);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  margin-left: 6px;
}

/* ============================================
   PAGINATION
   ============================================ */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 20px;
  border-top: 1px solid var(--border-light);
}

.pagination-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: all var(--transition-fast);
}

.pagination-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.pagination-info {
  color: var(--text-secondary);
  font-size: 14px;
}

/* ============================================
   EMPTY STATE
   ============================================ */
.empty-state {
  text-align: center;
  padding: 60px 24px;
}

.empty-state.compact {
  padding: 40px 24px;
}

.empty-icon {
  width: 80px;
  height: 80px;
  border-radius: var(--radius-full);
  background: var(--background);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
}

.empty-icon i {
  font-size: 32px;
  color: var(--text-muted);
}

.empty-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.empty-text {
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: 24px;
}

/* ============================================
   FORM COMPONENTS
   ============================================ */
.form-container {
  width: 100%;
  max-width: 100%;
}

/* Invoice form needs more space */
.invoice-form-container {
  max-width: 100%;
}

/* Permission checkbox cards */
.permission-check {
  padding: 12px 16px;
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: all var(--transition-fast);
}

.permission-check:has(input:checked) {
  background: var(--primary-light);
  border-color: var(--primary);
}

.permission-check .form-check-input {
  margin-top: 0;
}

.permission-check .form-check-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  width: 100%;
}

.permission-check .form-check-label i {
  font-size: 18px;
  color: var(--primary);
}

/* Permission grid for mobile-friendly layout */
.permission-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.permission-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.permission-item:has(input:checked) {
  background: var(--primary-light);
  border-color: var(--primary);
}

.permission-item input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
  flex-shrink: 0;
}

.permission-content {
  display: flex;
  align-items: center;
  gap: 10px;
}

.permission-content i {
  font-size: 18px;
  color: var(--primary);
}

.permission-content span {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
}

@media (max-width: 480px) {
  .permission-grid {
    grid-template-columns: 1fr;
  }
}

/* Member avatar styles */
.member-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 16px;
}

.member-avatar-lg {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 24px;
  flex-shrink: 0;
}

.member-info-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: var(--background);
  border-radius: var(--radius);
}

.member-details {
  min-width: 0;
}

.member-name {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.member-email {
  font-size: 14px;
  color: var(--text-muted);
}

.business-avatar {
  width: 36px;
  height: 36px;
  background: var(--primary-light);
  color: var(--primary);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

/* Permission badges */
.permission-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.permission-badges .badge {
  font-weight: 500;
  font-size: 11px;
}

.data-form {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.form-section {
  padding: 24px;
  border-bottom: 1px solid var(--border-light);
}

.form-section:last-of-type {
  border-bottom: none;
}

.form-section-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.form-section-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.form-group {
  margin-bottom: 20px;
}

.form-group:last-child {
  margin-bottom: 0;
}

.form-label {
  display: block;
  font-weight: 500;
  font-size: 14px;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.form-label .required {
  color: var(--danger);
}

.form-control {
  width: 100%;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

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

@media (max-width: 768px) {
  .form-row,
  .form-row-3 {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

@media (min-width: 1200px) {
  .form-row {
    gap: 24px;
  }
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 20px 24px;
  background: var(--background);
  border-top: 1px solid var(--border-light);
}

@media (max-width: 480px) {
  .form-actions {
    flex-direction: column-reverse;
    padding: 16px;
  }

  .form-actions .btn {
    width: 100%;
    justify-content: center;
  }
}

/* ============================================
   CONTACT ACTIONS
   ============================================ */
.contact-actions {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.contact-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 16px 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: all var(--transition-fast);
  min-width: 80px;
}

.contact-btn i {
  font-size: 20px;
  color: var(--primary);
}

.contact-btn:hover {
  border-color: var(--primary);
  background: var(--primary-light);
}

/* ============================================
   DETAIL SECTIONS
   ============================================ */
.detail-section {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 24px;
  margin-bottom: 24px;
}

.detail-section .form-actions {
  background: transparent;
  border-top: none;
  padding: 20px 0 0 0;
  margin-top: 16px;
}

.detail-section .section-header:first-child {
  margin-top: 0;
}

.detail-section .data-list.compact {
  border: none;
  background: transparent;
  margin: 0 -24px -24px -24px;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  overflow: hidden;
}

.detail-section .data-list.compact .data-list-item {
  padding: 16px 24px;
  border-bottom: 1px solid var(--border-light);
}

.detail-section .data-list.compact .data-list-item:last-child {
  border-bottom: none;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 32px;
  margin-bottom: 20px;
}

.section-header .section-title {
  margin-bottom: 0;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 24px;
}

.detail-item {
  min-width: 0;
}

.detail-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.detail-value {
  font-size: 14px;
  color: var(--text-primary);
  line-height: 1.5;
}

.notes-content {
  color: var(--text-secondary);
  line-height: 1.6;
  white-space: pre-wrap;
  margin: 0;
}

/* ============================================
   STATS GRID VARIATIONS
   ============================================ */
.stats-grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

/* ============================================
   BADGE CUSTOM
   ============================================ */
.badge-custom {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  font-weight: 500;
  font-size: 12px;
  border-radius: var(--radius-full);
  letter-spacing: 0.3px;
  text-transform: capitalize;
}

.badge-success {
  background: var(--success-light);
  color: #166534;
}

.badge-warning {
  background: var(--warning-light);
  color: #92400e;
}

.badge-danger {
  background: var(--danger-light);
  color: #991b1b;
}

.badge-secondary {
  background: var(--background);
  color: var(--text-secondary);
}

.badge-info {
  background: var(--info-light);
  color: #0e7490;
}

/* ============================================
   TEXT UTILITIES
   ============================================ */
.text-muted {
  color: var(--text-muted);
}

.text-warning {
  color: var(--warning);
}

.text-danger {
  color: var(--danger);
}

.text-success {
  color: var(--success);
}

/* ============================================
   MOBILE RESPONSIVE ADJUSTMENTS
   ============================================ */
@media (max-width: 768px) {
  .page-header-content {
    flex-direction: column;
    align-items: stretch;
  }

  .page-actions {
    justify-content: flex-start;
  }

  .search-form {
    flex-direction: column;
  }

  .search-input-wrapper {
    width: 100%;
  }

  /* Keep filter selects on same line in mobile */
  .search-form .filter-select {
    flex: 1;
    min-width: 0;
    max-width: none;
  }

  .filter-row {
    display: flex;
    gap: 8px;
    width: 100%;
  }

  .filter-row .filter-select {
    flex: 1;
    min-width: 0;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .stats-grid-3 {
    grid-template-columns: 1fr;
  }

  .data-list-item {
    flex-wrap: wrap;
    gap: 12px;
  }

  .data-list-arrow {
    display: none;
  }

  .data-list-amount {
    order: 3;
    width: 100%;
    text-align: right;
    margin-right: 0;
  }

  .contact-actions {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
  }

  .contact-btn {
    padding: 12px;
  }

  .detail-grid {
    grid-template-columns: 1fr;
  }

  .form-actions {
    flex-direction: column;
  }

  .form-actions .btn {
    width: 100%;
  }
}

/* ============================================
   PRODUCT SPECIFIC STYLES
   ============================================ */
.product-price {
  text-align: right;
  margin-right: 12px;
}

.price-value {
  font-weight: 600;
  font-size: 16px;
  color: var(--text-primary);
}

.stock-badge {
  font-size: 12px;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  margin-top: 4px;
  display: inline-block;
}

.stock-badge.in-stock {
  background: var(--success-light);
  color: #166534;
}

.stock-badge.low-stock {
  background: var(--warning-light);
  color: #92400e;
}

.stock-badge.out-of-stock {
  background: var(--danger-light);
  color: #991b1b;
}

.action-grid.compact {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.action-grid.compact .action-btn {
  flex: none;
  min-width: 140px;
}

.input-group {
  display: flex;
}

.input-group .input-group-text {
  border-radius: var(--radius) 0 0 var(--radius);
  border-right: none;
}

.input-group .form-control {
  border-radius: 0 var(--radius) var(--radius) 0;
}

.form-text {
  font-size: 12px;
  margin-top: 4px;
}

.form-select {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  background: var(--surface);
  cursor: pointer;
}

.form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
  outline: none;
}

/* ============================================
   INVOICE SPECIFIC STYLES
   ============================================ */
.status-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.status-tab {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  transition: all var(--transition-fast);
}

.status-tab:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.status-tab.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

.status-tab .count {
  background: rgba(0,0,0,0.1);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 12px;
}

.status-tab.active .count {
  background: rgba(255,255,255,0.2);
}

.invoice-amount {
  text-align: right;
  margin-right: 12px;
}

.amount-value {
  font-weight: 600;
  font-size: 16px;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.form-link {
  display: inline-block;
  margin-top: 8px;
  font-size: 13px;
  color: var(--primary);
  text-decoration: none;
}

.form-link:hover {
  text-decoration: underline;
}

.invoice-items {
  background: var(--background);
  border-radius: var(--radius);
  padding: 16px;
}

.invoice-items-header {
  display: grid;
  grid-template-columns: 2fr 80px 100px 100px 40px;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
}

.invoice-item-row {
  display: grid;
  grid-template-columns: 2fr 80px 100px 100px 40px;
  gap: 12px;
  margin-bottom: 12px;
  align-items: start;
}

.item-product {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.item-product .product-select {
  font-size: 13px;
}

.item-description {
  font-size: 14px;
}

.qty-input, .price-input {
  text-align: right;
}

.item-total {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  font-weight: 600;
  color: var(--text-primary);
}

.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.invoice-summary {
  max-width: 300px;
  margin-left: auto;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  font-size: 14px;
}

.summary-row.total {
  border-top: 2px solid var(--text-primary);
  margin-top: 8px;
  padding-top: 16px;
  font-size: 18px;
  font-weight: 700;
}

.tax-input {
  width: 60px;
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  text-align: center;
}

/* Invoice Detail */
.status-banner {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  border-radius: var(--radius);
  margin-bottom: 24px;
}

.status-banner.status-unpaid {
  background: var(--warning-light);
}

.status-banner.status-paid {
  background: var(--success-light);
}

.status-banner.status-overdue {
  background: var(--danger-light);
}

.status-banner.status-cancelled {
  background: var(--background);
  border: 1px solid var(--border);
}

.status-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 600;
}

.status-detail {
  font-size: 14px;
  color: var(--text-secondary);
}

.quick-action-bar {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.invoice-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  margin-bottom: 24px;
}

.customer-info {
  line-height: 1.8;
}

.customer-name {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 8px;
}

.customer-info i {
  width: 20px;
  color: var(--text-muted);
  margin-right: 4px;
}

.detail-grid.compact {
  gap: 16px;
}

.invoice-table-wrapper {
  overflow-x: auto;
}

.invoice-table {
  width: 100%;
  border-collapse: collapse;
}

.invoice-table th {
  padding: 12px;
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  border-bottom: 2px solid var(--border);
}

.invoice-table td {
  padding: 16px 12px;
  border-bottom: 1px solid var(--border-light);
}

.invoice-table .item-name {
  font-weight: 500;
}

.invoice-table .item-desc {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 4px;
}

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

.text-right {
  text-align: right;
}

.invoice-totals {
  max-width: 300px;
  margin-left: auto;
  margin-top: 24px;
}

.totals-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  font-size: 14px;
}

.totals-row.total {
  border-top: 2px solid var(--text-primary);
  margin-top: 8px;
  padding-top: 12px;
  font-size: 18px;
  font-weight: 700;
}

/* Mobile Invoice Form */
@media (max-width: 768px) {
  .invoice-items-header {
    display: none;
  }

  .invoice-item-row {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 16px;
    background: var(--surface);
    border-radius: var(--radius);
    margin-bottom: 12px;
  }

  .item-product {
    order: 1;
  }

  .item-qty, .item-price, .item-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  .item-qty::before { content: 'Quantity: '; }
  .item-price::before { content: 'Price: '; }
  .item-total::before { content: 'Total: '; }

  .item-action {
    order: 0;
    text-align: right;
    margin-bottom: 8px;
  }

  .invoice-detail-grid {
    grid-template-columns: 1fr;
  }

  .status-tabs {
    gap: 4px;
  }

  .status-tab {
    padding: 8px 12px;
    font-size: 13px;
  }
}

/* ============================================
   PAYMENT SPECIFIC STYLES
   ============================================ */
.stats-card-single {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow);
}

.stats-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

.stats-icon.green {
  background: var(--success-light);
  color: var(--success);
}

.stats-icon.blue {
  background: var(--primary-light);
  color: var(--primary);
}

.stats-icon.orange {
  background: var(--warning-light);
  color: var(--warning);
}

.stats-icon.red {
  background: var(--danger-light);
  color: var(--danger);
}

.stats-content {
  flex: 1;
}

.stats-label {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.stats-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
}

.payment-method-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 500;
  text-transform: capitalize;
  background: var(--background);
  color: var(--text-secondary);
}

.payment-method-badge.cash {
  background: var(--success-light);
  color: #166534;
}

.payment-method-badge.bank_transfer {
  background: var(--primary-light);
  color: var(--primary-dark);
}

.payment-method-badge.credit_card {
  background: var(--info-light);
  color: #1e40af;
}

.payment-method-badge.check {
  background: var(--warning-light);
  color: #92400e;
}

.amount-display-card {
  background: linear-gradient(135deg, var(--success), #059669);
  color: white;
  border-radius: var(--radius-lg);
  padding: 32px;
  margin-bottom: 24px;
  text-align: center;
}

.amount-display-value {
  font-size: 36px;
  font-weight: 700;
  margin-bottom: 12px;
}

.amount-display-label {
  font-size: 14px;
  opacity: 0.9;
}

.amount-display-label .payment-method-badge {
  background: rgba(255, 255, 255, 0.2);
  color: white;
}

.detail-grid-2col {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  margin-bottom: 24px;
}

.linked-records {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.linked-record-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background: var(--background);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text-primary);
  transition: all var(--transition-fast);
}

.linked-record-item:hover {
  background: var(--border-light);
}

.linked-record-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.linked-record-icon.blue {
  background: var(--primary-light);
  color: var(--primary);
}

.linked-record-icon.purple {
  background: rgba(124, 58, 237, 0.15);
  color: #7c3aed;
}

.linked-record-content {
  flex: 1;
}

.linked-record-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.linked-record-value {
  font-weight: 600;
}

.linked-record-meta {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 4px;
}

.linked-record-item > i.bi-chevron-right {
  color: var(--text-muted);
}

/* Input with prefix */
.input-with-prefix {
  display: flex;
  align-items: center;
}

.input-prefix {
  padding: 10px 12px;
  background: var(--background);
  border: 1px solid var(--border);
  border-right: none;
  border-radius: var(--radius) 0 0 var(--radius);
  color: var(--text-secondary);
  font-weight: 500;
}

.input-with-prefix .form-control {
  border-radius: 0 var(--radius) var(--radius) 0;
}

@media (max-width: 768px) {
  .detail-grid-2col {
    grid-template-columns: 1fr;
  }

  .amount-display-value {
    font-size: 28px;
  }

  .stats-card-single {
    padding: 16px 20px;
  }

  .stats-value {
    font-size: 20px;
  }
}

/* ============================================
   EXPENSE SPECIFIC STYLES
   ============================================ */
.expense-stats .stats-icon {
  background: var(--danger-light);
  color: var(--danger);
}

.expense-amount {
  font-weight: 600;
  color: var(--danger);
}

.expense-amount-card {
  background: linear-gradient(135deg, var(--danger), #dc2626);
}

.expense-category-tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 500;
}

.expense-category-tag.dynamic-color {
  background-color: var(--cat-color);
  background-color: color-mix(in srgb, var(--cat-color) 15%, transparent);
  color: var(--cat-color);
}

.expense-category-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 500;
}

.expense-category-badge.dynamic-color-light {
  background-color: var(--cat-color);
  background-color: color-mix(in srgb, var(--cat-color) 40%, transparent);
  color: white;
}

/* Dynamic color utilities - uses CSS custom property for color */
.dynamic-color {
  background-color: var(--cat-color, #6B7280);
  background-color: color-mix(in srgb, var(--cat-color, #6B7280) 15%, transparent);
  color: var(--cat-color, #6B7280);
}

.data-list-icon.dynamic-color {
  background-color: var(--cat-color, #6B7280);
  background-color: color-mix(in srgb, var(--cat-color, #6B7280) 20%, transparent);
  color: var(--cat-color, #6B7280);
}

.category-breakdown-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow);
}

.breakdown-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.category-bars {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.category-bar-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.category-bar-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}

.category-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background-color: var(--cat-color, #6B7280);
}

.category-bar-value {
  font-weight: 600;
  font-size: 14px;
}

.search-form-wide {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.search-form-wide .search-input-wrapper {
  flex: 1;
  min-width: 200px;
}

.search-form-wide .form-select,
.search-form-wide .form-control {
  width: auto;
  min-width: 140px;
}

/* Categories management */
.category-form {
  margin-bottom: 24px;
}

.compact-form .form-section {
  padding: 20px;
}

.compact-form .form-row {
  align-items: flex-end;
}

.form-group-btn {
  margin-bottom: 0;
}

.color-picker-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
}

.color-picker {
  width: 48px;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2px;
  cursor: pointer;
}

.color-preview {
  font-size: 14px;
  color: var(--text-secondary);
  font-family: monospace;
}

.categories-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.category-list-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border-light);
}

.category-list-color {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background-color: var(--cat-color, #6B7280);
}

.category-list-content {
  flex: 1;
}

.category-list-name {
  font-weight: 600;
  margin-bottom: 2px;
}

.category-list-meta {
  font-size: 13px;
  color: var(--text-secondary);
}

.category-list-actions {
  display: flex;
  gap: 8px;
}

/* Checkbox label */
.checkbox-label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 14px;
}

.checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.empty-state.small {
  padding: 32px;
}

@media (max-width: 768px) {
  .search-form-wide {
    flex-direction: column;
  }

  .search-form-wide .form-select,
  .search-form-wide .form-control {
    width: 100%;
  }

  .compact-form .form-row {
    flex-direction: column;
    align-items: stretch;
  }

  .form-group-btn {
    margin-top: 8px;
  }

  .category-list-item {
    flex-wrap: wrap;
  }

  .category-list-content {
    flex-basis: calc(100% - 48px);
  }

  .category-list-actions {
    margin-left: auto;
  }
}

/* ============================================
   REPORTS STYLES
   ============================================ */
.report-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.report-summary-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 16px;
}

.report-summary-card .summary-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

.report-summary-card.green .summary-icon {
  background: var(--success-light);
  color: var(--success);
}

.report-summary-card.red .summary-icon {
  background: var(--danger-light);
  color: var(--danger);
}

.report-summary-card.blue .summary-icon {
  background: var(--primary-light);
  color: var(--primary);
}

.report-summary-card.orange .summary-icon {
  background: var(--warning-light);
  color: var(--warning);
}

.report-summary-card.purple .summary-icon {
  background: rgba(139, 92, 246, 0.1);
  color: #8b5cf6;
}

.report-summary-card.secondary .summary-icon {
  background: var(--secondary-light, rgba(108, 117, 125, 0.1));
  color: var(--secondary, #6b7280);
}

.summary-content {
  flex: 1;
}

.summary-label {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.summary-value {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
}

.report-links-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.report-link-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  text-decoration: none;
  color: var(--text-primary);
  transition: all var(--transition-fast);
}

.report-link-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
}

.report-link-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

.report-link-icon.blue {
  background: var(--primary-light);
  color: var(--primary);
}

.report-link-icon.green {
  background: var(--success-light);
  color: var(--success);
}

.report-link-icon.red {
  background: var(--danger-light);
  color: var(--danger);
}

.report-link-icon.purple {
  background: rgba(139, 92, 246, 0.15) !important;
  color: #8b5cf6 !important;
}

.report-link-icon.orange {
  background: rgba(251, 146, 60, 0.15) !important;
  color: #f97316 !important;
}

.report-link-content {
  flex: 1;
}

.report-link-title {
  font-weight: 600;
  margin-bottom: 4px;
}

.report-link-desc {
  font-size: 13px;
  color: var(--text-secondary);
}

.report-link-card > i {
  color: var(--text-muted);
}

/* Status Cards - Matching Portal Design */
.status-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
}

.status-stat-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 16px;
  transition: all 0.3s;
}

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

.status-stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

.status-stat-card.unpaid .status-stat-icon {
  background: var(--warning-light);
  color: var(--warning);
}

.status-stat-card.paid .status-stat-icon {
  background: var(--success-light);
  color: var(--success);
}

.status-stat-card.overdue .status-stat-icon {
  background: var(--danger-light);
  color: var(--danger);
}

.status-stat-card.cancelled .status-stat-icon {
  background: var(--background);
  color: var(--text-muted);
}

.status-stat-card.partial .status-stat-icon {
  background: var(--warning-light);
  color: var(--warning);
}

.status-stat-content {
  flex: 1;
}

.status-stat-count {
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
}

.status-stat-label {
  font-size: 13px;
  color: var(--text-secondary);
  text-transform: capitalize;
}

/* Report Filters */
.report-filters {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  margin-bottom: 24px;
  box-shadow: var(--shadow);
}

.filter-form {
  display: flex;
  gap: 16px;
  align-items: flex-end;
  flex-wrap: wrap;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.filter-group label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
}

.filter-group .form-select {
  min-width: 160px;
}

/* P&L Summary */
.pl-summary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 32px;
  margin-bottom: 24px;
  box-shadow: var(--shadow);
  flex-wrap: wrap;
}

.pl-summary-item {
  text-align: center;
  min-width: 150px;
}

.pl-summary-label {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.pl-summary-value {
  font-size: 28px;
  font-weight: 700;
}

.pl-summary-item.revenue .pl-summary-value {
  color: var(--success);
}

.pl-summary-item.expenses .pl-summary-value {
  color: var(--danger);
}

.pl-summary-item.net.profit .pl-summary-value {
  color: var(--success);
}

.pl-summary-item.net.loss .pl-summary-value {
  color: var(--danger);
}

.pl-summary-divider {
  font-size: 24px;
  color: var(--text-muted);
  font-weight: 300;
}

/* Report Tables */
.report-table-wrapper {
  overflow-x: auto;
}

.report-table {
  width: 100%;
  border-collapse: collapse;
}

.report-table th {
  padding: 12px 16px;
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  border-bottom: 2px solid var(--border);
  background: var(--background);
}

.report-table td {
  padding: 16px;
  border-bottom: 1px solid var(--border-light);
}

.text-success {
  color: var(--success) !important;
}

.text-danger {
  color: var(--danger) !important;
}

.text-bold {
  font-weight: 600;
}

.text-muted {
  color: var(--text-muted);
}

/* Table Cell Helpers */
.cell-main {
  font-weight: 500;
  color: var(--text-primary);
}

.cell-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Empty State Card */
.empty-state-card {
  text-align: center;
  padding: 60px 20px;
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.empty-state-icon {
  font-size: 48px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.empty-state-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.empty-state-text {
  color: var(--text-secondary);
}

/* Category Expense List */
.category-expense-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.category-expense-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: var(--background);
  border-radius: var(--radius);
}

.category-expense-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.category-expense-name {
  font-weight: 500;
}

.category-expense-amount {
  font-weight: 600;
}

/* Sales Summary */
.sales-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.sales-summary-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 24px;
  text-align: center;
  box-shadow: var(--shadow);
}

.sales-summary-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.sales-summary-label {
  font-size: 13px;
  color: var(--text-secondary);
}

/* Top List */
.top-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.top-list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--background);
  border-radius: var(--radius);
}

.top-list-rank {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
}

.top-list-content {
  flex: 1;
}

.top-list-name {
  font-weight: 500;
}

.top-list-meta {
  font-size: 12px;
  color: var(--text-secondary);
}

.top-list-value {
  font-weight: 600;
}

/* Status Summary */
.status-summary-grid {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.status-summary-card {
  padding: 20px 24px;
  border-radius: var(--radius);
  text-align: center;
  min-width: 120px;
  flex: 1;
}

.status-summary-count {
  font-size: 28px;
  font-weight: 700;
}

.status-summary-label {
  font-size: 12px;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.status-summary-amount {
  font-size: 14px;
  opacity: 0.8;
}

/* Expense Report Summary */
.expense-report-summary {
  background: linear-gradient(135deg, var(--danger), #dc2626);
  color: white;
  border-radius: var(--radius-lg);
  padding: 32px;
  margin-bottom: 24px;
  text-align: center;
}

.expense-report-label {
  font-size: 14px;
  opacity: 0.9;
  margin-bottom: 8px;
}

.expense-report-value {
  font-size: 36px;
  font-weight: 700;
}

@media (max-width: 1024px) {
  .report-summary-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .report-links-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .report-summary-grid {
    grid-template-columns: 1fr;
  }

  .pl-summary {
    flex-direction: column;
    gap: 16px;
    padding: 24px;
  }

  .pl-summary-divider {
    display: none;
  }

  .pl-summary-value {
    font-size: 24px;
  }

  .sales-summary-grid {
    grid-template-columns: 1fr;
  }

  .filter-form {
    flex-direction: column;
    align-items: stretch;
  }

  .filter-group .form-select {
    width: 100%;
  }
}

/* ============================================
   SETTINGS STYLES
   ============================================ */
.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.settings-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  text-decoration: none;
  color: var(--text-primary);
  transition: all var(--transition-fast);
}

.settings-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
}

.settings-card-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

.settings-card-icon.blue {
  background: var(--primary-light);
  color: var(--primary);
}

.settings-card-icon.purple {
  background: rgba(124, 58, 237, 0.15);
  color: #7c3aed;
}

.settings-card-icon.green {
  background: var(--success-light);
  color: var(--success);
}

.settings-card-icon.orange {
  background: var(--warning-light);
  color: var(--warning);
}

.settings-card-content {
  flex: 1;
}

.settings-card-title {
  font-weight: 600;
  margin-bottom: 4px;
}

.settings-card-desc {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 0;
}

.settings-card > i {
  color: var(--text-muted);
}

.settings-summary {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.settings-summary-item {
  padding: 16px;
  background: var(--background);
  border-radius: var(--radius);
}

.settings-summary-label {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 4px;
}

.settings-summary-value {
  font-weight: 600;
  color: var(--text-primary);
}

.settings-info-card {
  display: flex;
  gap: 16px;
  padding: 16px;
  background: var(--info-light);
  border-radius: var(--radius);
  margin-bottom: 20px;
}

.info-card-icon {
  font-size: 20px;
  color: var(--info);
}

.info-card-content {
  flex: 1;
}

.info-card-content p {
  margin: 0 0 8px;
  font-size: 14px;
}

.info-card-content p:last-child {
  margin-bottom: 0;
}

.settings-note {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 16px;
  background: var(--warning-light);
  border-radius: var(--radius);
  margin-top: 20px;
  font-size: 14px;
}

.settings-note i {
  color: var(--warning);
  font-size: 18px;
}

.settings-note p {
  margin: 0;
}

.settings-note a {
  color: var(--primary);
}

.tax-example {
  background: var(--background);
  border-radius: var(--radius);
  padding: 20px;
  margin-top: 20px;
}

.tax-example-title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 16px;
}

.tax-calculation {
  max-width: 250px;
}

.calc-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  font-size: 14px;
}

.calc-row.total {
  border-top: 2px solid var(--border);
  margin-top: 8px;
  padding-top: 12px;
  font-weight: 600;
}

.tax-rates-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tax-rate-item {
  display: flex;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--background);
  border-radius: var(--radius);
}

.tax-rate-name {
  font-size: 14px;
}

.tax-rate-value {
  font-weight: 600;
}

@media (max-width: 768px) {
  .settings-grid {
    grid-template-columns: 1fr;
  }

  .settings-summary {
    grid-template-columns: 1fr;
  }
}

/* ============================================
   BUSINESS MANAGEMENT STYLES
   ============================================ */
.businesses-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.business-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all var(--transition);
}

.business-card:hover {
  border-color: var(--border-dark);
  box-shadow: var(--shadow-md);
}

.business-card.active {
  border-color: var(--primary);
  background: color-mix(in srgb, var(--primary) 3%, var(--surface));
}

.business-card-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
  border-bottom: 1px solid var(--border-light);
}

.business-icon {
  width: 48px;
  height: 48px;
  background: var(--primary-light);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  font-size: 24px;
  flex-shrink: 0;
}

.business-info {
  flex: 1;
  min-width: 0;
}

.business-name {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.business-meta {
  display: flex;
  gap: 12px;
  margin-top: 4px;
  font-size: 13px;
  color: var(--text-muted);
}

.business-badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 500;
  border-radius: var(--radius-full);
  text-transform: capitalize;
}

.badge-primary {
  background: var(--primary-light);
  color: var(--primary);
}

.badge-success {
  background: color-mix(in srgb, var(--success) 15%, transparent);
  color: var(--success);
}

.badge-secondary {
  background: var(--background);
  color: var(--text-secondary);
}

.business-card-body {
  padding: 16px 20px;
}

.business-details {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.business-detail {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text-secondary);
}

.business-detail i {
  color: var(--text-muted);
}

.business-card-footer {
  display: flex;
  gap: 8px;
  padding: 16px 20px;
  background: var(--background);
  border-top: 1px solid var(--border-light);
}

/* Sidebar Business Display */
.sidebar-business {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--sidebar-border);
  margin-bottom: 8px;
}

.sidebar-business-icon {
  width: 32px;
  height: 32px;
  background: var(--primary);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 16px;
  flex-shrink: 0;
}

.sidebar-business-info {
  flex: 1;
  min-width: 0;
}

.sidebar-business-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--sidebar-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-business-type {
  font-size: 11px;
  color: var(--sidebar-text-muted);
}

@media (max-width: 768px) {
  .business-card-header {
    flex-wrap: wrap;
  }

  .business-badges {
    width: 100%;
    margin-top: 8px;
  }

  .business-card-footer {
    flex-wrap: wrap;
  }
}

/* ============================================
   BUSINESS SWITCHER (Header Dropdown)
   ============================================ */
.business-switcher {
  position: relative;
  flex-shrink: 0;
}

.business-switcher-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.business-switcher-btn:hover {
  border-color: var(--primary);
  background: var(--primary-light);
}

.business-switcher-icon {
  width: 32px;
  height: 32px;
  background: var(--primary);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 16px;
  flex-shrink: 0;
}

.business-switcher-info {
  flex: 1;
  text-align: left;
  min-width: 0;
}

.business-switcher-name {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 150px;
}

.business-switcher-label {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
}

.business-switcher-arrow {
  color: var(--text-muted);
  font-size: 12px;
  transition: transform var(--transition-fast);
  margin-left: 4px;
}

/* Business Switcher Dropdown */
.business-switcher-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  min-width: 280px;
  max-width: 320px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: 1000;
  margin-top: 8px;
  overflow: hidden;
}

.business-switcher-dropdown.open {
  display: block;
}

.business-switcher-dropdown-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-light);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}

.business-switcher-manage {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
  font-size: 12px;
}

.business-switcher-manage:hover {
  text-decoration: underline;
}

.business-switcher-dropdown-list {
  max-height: 240px;
  overflow-y: auto;
}

.business-switcher-form {
  margin: 0;
}

.business-switcher-option {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 16px;
  background: none;
  border: none;
  cursor: pointer;
  transition: background var(--transition-fast);
  text-align: left;
}

.business-switcher-option:hover {
  background: var(--background);
}

.business-switcher-option.active {
  background: var(--primary-light);
}

.business-switcher-option-icon {
  width: 28px;
  height: 28px;
  background: var(--background);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  font-size: 14px;
  flex-shrink: 0;
}

.business-switcher-option.active .business-switcher-option-icon {
  background: var(--primary);
  color: white;
}

.business-switcher-option-info {
  flex: 1;
  min-width: 0;
}

.business-switcher-option-name {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.business-switcher-option-type {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
}

.business-switcher-check {
  color: var(--primary);
  font-size: 16px;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .page-header {
    flex-direction: column;
    align-items: stretch;
  }

  .business-switcher {
    display: none; /* Hidden on mobile - using top-bar switcher instead */
  }

  .business-switcher-btn {
    width: 100%;
    justify-content: flex-start;
    padding: 10px 14px;
    gap: 10px;
  }

  .business-switcher-icon {
    width: 32px;
    height: 32px;
    font-size: 16px;
  }

  .business-switcher-name {
    font-size: 14px;
    max-width: none;
  }

  .business-switcher-label {
    display: block;
  }

  .business-switcher-dropdown {
    left: 0;
    right: 0;
    max-width: none;
    min-width: auto;
  }
}

/* ============================================
   MODAL STYLES
   ============================================ */
body.modal-open {
  overflow: hidden;
}

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 9998;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: all 0.3s ease;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.modal-container {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.9);
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 90%;
  max-width: 480px;
  max-height: 90vh;
  overflow: hidden;
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: all 0.3s ease;
}

.modal-container.active,
.modal-overlay.active .modal-container,
.modal-overlay.active > .modal-container,
.modal-overlay.active > .modal-container.modal-lg {
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
  transform: translate(-50%, -50%) scale(1) !important;
  display: block !important;
}

/* Modal sizes */
.modal-container.modal-lg {
  max-width: 600px;
}

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

.modal-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.modal-close {
  background: none;
  border: none;
  font-size: 20px;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  line-height: 1;
  transition: color 0.2s;
}

.modal-close:hover {
  color: var(--text-primary);
}

.modal-body {
  padding: 20px;
  overflow-y: auto;
  max-height: calc(90vh - 140px);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  margin-top: 16px;
}

/* Mobile modal adjustments - slide up from bottom */
@media (max-width: 576px) {
  .modal-container,
  .modal-container.modal-lg {
    width: 100% !important;
    max-width: none !important;
    max-height: 90vh !important;
    height: auto !important;
    top: auto !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    transform: translateY(100%) !important;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0 !important;
  }

  .modal-container.active,
  .modal-overlay.active .modal-container,
  .modal-overlay.active > .modal-container,
  .modal-overlay.active > .modal-container.modal-lg {
    transform: translateY(0) !important;
  }

  .modal-body {
    max-height: calc(90vh - 140px);
    overflow-y: auto;
  }

  .modal-footer {
    padding: 12px 16px;
    padding-bottom: calc(12px + env(safe-area-inset-bottom));
  }
}

/* ============================================
   PAYMENT HISTORY STYLES
   ============================================ */
.payment-history {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.payment-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: var(--background);
  border-radius: var(--radius);
}

.payment-icon {
  width: 40px;
  height: 40px;
  background: var(--success-light);
  color: var(--success);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.payment-details {
  flex: 1;
  min-width: 0;
}

.payment-amount {
  font-size: 16px;
  font-weight: 600;
  color: var(--success);
}

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

/* Invoice totals extra rows */
.totals-row.paid {
  color: var(--success);
}

.totals-row.balance-due {
  font-weight: 600;
  color: var(--warning);
}

/* ============================================
   INVENTORY SPECIFIC STYLES
   ============================================ */

/* Movement quantity display */
.movement-quantity {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}

.quantity-change {
  font-size: 16px;
  font-weight: 600;
}

.quantity-change.positive {
  color: var(--success);
}

.quantity-change.negative {
  color: var(--danger);
}

.quantity-after {
  font-size: 12px;
  color: var(--text-muted);
}

/* Data list item without link styling */
.data-list-item.no-link {
  cursor: default;
}

.data-list-item.no-link:hover {
  background: var(--primary-light);
  transform: none;
}

/* Toggle switch */
.toggle-switch {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}

.toggle-switch input {
  display: none;
}

.toggle-slider {
  width: 44px;
  height: 24px;
  background: var(--border);
  border-radius: 12px;
  position: relative;
  transition: background 0.2s;
}

.toggle-slider::before {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  background: var(--surface);
  border-radius: 50%;
  transition: transform 0.2s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.toggle-switch input:checked + .toggle-slider {
  background: var(--primary);
}

.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(20px);
}

.toggle-label {
  font-size: 14px;
  color: var(--text-secondary);
}

/* Form actions inside detail sections */
.form-actions {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

/* Stats grid 2 columns variant */
.stats-grid-2 {
  grid-template-columns: repeat(2, 1fr);
}

@media (max-width: 768px) {
  .stats-grid-2 {
    grid-template-columns: 1fr;
  }
}

/* Stats grid 3 columns variant */
.stats-grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

@media (max-width: 768px) {
  .stats-grid-3 {
    grid-template-columns: 1fr;
  }
}

/* Page subtitle row for multiple items */
.page-subtitle-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 4px;
  color: var(--text-secondary);
  font-size: 14px;
  flex-wrap: wrap;
}

/* Stock display card */
.stock-display-card {
  text-align: center;
  padding: 32px;
  background: var(--surface);
  border-radius: var(--radius-lg);
  margin-bottom: 24px;
  border: 1px solid var(--border);
}

.stock-display-label {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.stock-display-value {
  font-size: 56px;
  font-weight: 700;
  line-height: 1;
  margin-bottom: 8px;
}

.stock-display-unit {
  font-size: 16px;
  color: var(--text-secondary);
}

/* Adjustment type grid */
.adjustment-type-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

@media (max-width: 576px) {
  .adjustment-type-grid {
    grid-template-columns: 1fr;
  }
}

.adjustment-option {
  display: block;
  padding: 16px;
  background: var(--background);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.adjustment-option:hover {
  border-color: var(--primary-light);
}

.adjustment-option:has(input:checked) {
  border-color: var(--primary);
  background: var(--primary-light);
}

.adjustment-option input {
  display: none;
}

.adjustment-option-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
}

.adjustment-option-content i {
  font-size: 28px;
}

.adjustment-option:nth-child(1) i { color: var(--success); }
.adjustment-option:nth-child(2) i { color: var(--danger); }
.adjustment-option:nth-child(3) i { color: var(--info); }

.adjustment-option-title {
  font-weight: 600;
  color: var(--text-primary);
}

.adjustment-option-desc {
  font-size: 13px;
  color: var(--text-muted);
}

/* Quantity input wrapper */
.quantity-input-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
}

.quantity-input {
  font-size: 24px;
  font-weight: 600;
  text-align: center;
  max-width: 150px;
}

.quantity-unit {
  font-size: 16px;
  color: var(--text-secondary);
}

/* Adjustment preview */
.adjustment-preview {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 32px;
  padding: 24px;
  background: var(--background);
  border-radius: var(--radius-lg);
  margin-top: 20px;
}

.preview-item {
  text-align: center;
}

.preview-label {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.preview-value {
  font-size: 32px;
  font-weight: 700;
  color: var(--text-secondary);
}

.preview-value.highlight {
  color: var(--primary);
}

.preview-arrow {
  font-size: 24px;
  color: var(--text-muted);
}

/* Movement info in list items */
.movement-info {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

/* Filter select in search form */
.filter-select {
  min-width: 150px;
}

/* ============================================
   DARK MODE COMPONENT OVERRIDES
   ============================================ */

/* Theme Toggle Switch */
.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.theme-toggle-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.theme-toggle-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-light);
  border-radius: var(--radius);
  color: var(--primary);
  font-size: 20px;
}

.theme-toggle-text h4 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

.theme-toggle-text p {
  margin: 0;
  font-size: 13px;
  color: var(--text-muted);
}

.theme-switch {
  position: relative;
  width: 52px;
  height: 28px;
}

.theme-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.theme-switch-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--border);
  transition: var(--transition);
  border-radius: 28px;
}

.theme-switch-slider:before {
  position: absolute;
  content: "";
  height: 22px;
  width: 22px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: var(--transition);
  border-radius: 50%;
  box-shadow: var(--shadow-sm);
}

.theme-switch input:checked + .theme-switch-slider {
  background-color: var(--primary);
}

.theme-switch input:checked + .theme-switch-slider:before {
  transform: translateX(24px);
}

.theme-switch input:focus + .theme-switch-slider {
  box-shadow: 0 0 0 3px var(--primary-light);
}

/* Dark mode - Form Controls */
html.dark-mode .form-control,
html.dark-mode .form-select {
  background-color: #1e293b !important;
  border-color: #334155 !important;
  color: #f1f5f9 !important;
}

html.dark-mode .form-control:focus,
html.dark-mode .form-select:focus {
  background-color: #1e293b !important;
  border-color: var(--primary) !important;
  color: #f1f5f9 !important;
  box-shadow: 0 0 0 3px var(--primary-light);
}

html.dark-mode .form-control::placeholder {
  color: #64748b !important;
}

html.dark-mode .form-control:disabled,
html.dark-mode .form-select:disabled {
  background-color: #0f172a !important;
  color: #64748b !important;
}

/* Dark mode - Select dropdown options */
html.dark-mode .form-select option,
html.dark-mode select option {
  background-color: #1e293b !important;
  color: #f1f5f9 !important;
}

html.dark-mode .form-select option:hover,
html.dark-mode .form-select option:focus,
html.dark-mode .form-select option:checked,
html.dark-mode select option:hover,
html.dark-mode select option:focus,
html.dark-mode select option:checked {
  background-color: #334155 !important;
  color: #f1f5f9 !important;
}

html.dark-mode select,
html.dark-mode .form-select {
  background-color: #1e293b !important;
  color: #f1f5f9 !important;
}

/* Force dark colors on native select in WebView */
html.dark-mode select:focus,
html.dark-mode .form-select:focus {
  background-color: #1e293b !important;
  color: #f1f5f9 !important;
}

/* Dark mode - Tables */
html.dark-mode .table {
  --bs-table-bg: transparent;
  --bs-table-color: var(--text-primary);
  --bs-table-border-color: var(--border);
  --bs-table-striped-bg: var(--background);
  --bs-table-hover-bg: var(--background);
}

html.dark-mode .table thead th {
  background-color: var(--background);
  border-bottom-color: var(--border);
  color: var(--text-secondary);
}

html.dark-mode .table tbody tr {
  border-bottom-color: var(--border);
}

html.dark-mode .table-hover tbody tr:hover {
  background-color: var(--background);
}

/* Dark mode - Cards */
html.dark-mode .card {
  background-color: var(--surface);
  border-color: var(--border);
}

html.dark-mode .card-header {
  background-color: var(--surface);
  border-bottom-color: var(--border);
}

/* Dark mode - Calendar */
html.dark-mode .booking-calendar {
  background-color: var(--surface);
}

html.dark-mode .booking-calendar .calendar-header {
  background-color: var(--background);
  border-bottom-color: var(--border);
}

html.dark-mode .calendar-day-name {
  color: var(--text-muted);
}

html.dark-mode .calendar-grid {
  background-color: var(--surface);
}

html.dark-mode .calendar-day {
  border-color: var(--border);
}

html.dark-mode .calendar-day.empty {
  background-color: var(--background);
}

html.dark-mode .calendar-day:hover:not(.empty) {
  background-color: var(--primary-light);
}

html.dark-mode .calendar-day.today {
  background-color: var(--primary-light);
}

html.dark-mode .calendar-day.today .day-number {
  background-color: var(--primary);
  color: white;
}

html.dark-mode .day-number {
  color: var(--text-primary);
}

/* Dark mode - Modals */
html.dark-mode .modal-content {
  background-color: var(--surface);
  border-color: var(--border);
}

html.dark-mode .modal-header {
  border-bottom-color: var(--border);
}

html.dark-mode .modal-footer {
  border-top-color: var(--border);
}

html.dark-mode .btn-close {
  filter: invert(1) grayscale(100%) brightness(200%);
}

/* Dark mode - Dropdowns */
html.dark-mode .dropdown-menu {
  background-color: var(--surface);
  border-color: var(--border);
}

html.dark-mode .dropdown-item {
  color: var(--text-primary);
}

html.dark-mode .dropdown-item:hover,
html.dark-mode .dropdown-item:focus {
  background-color: var(--background);
  color: var(--text-primary);
}

html.dark-mode .dropdown-divider {
  border-color: var(--border);
}

/* Dark mode - Badges */
html.dark-mode .badge.bg-light {
  background-color: var(--background) !important;
  color: var(--text-primary) !important;
}

html.dark-mode .badge.bg-secondary {
  background-color: var(--border) !important;
}

html.dark-mode .badge-success,
html.dark-mode .badge-status.badge-success {
  background: rgba(34, 197, 94, 0.2) !important;
  color: #4ade80 !important;
}

html.dark-mode .badge-warning {
  background: rgba(251, 191, 36, 0.2) !important;
  color: #fbbf24 !important;
}

html.dark-mode .badge-danger,
html.dark-mode .badge-status.badge-danger {
  background: rgba(239, 68, 68, 0.2) !important;
  color: #f87171 !important;
}

html.dark-mode .badge-info,
html.dark-mode .badge-status.badge-info {
  background: rgba(59, 130, 246, 0.2) !important;
  color: #60a5fa !important;
}

html.dark-mode .badge-secondary,
html.dark-mode .badge-status.badge-secondary {
  background: rgba(100, 116, 139, 0.2) !important;
  color: #94a3b8 !important;
}

html.dark-mode .badge-primary {
  background: rgba(59, 130, 246, 0.2) !important;
  color: #60a5fa !important;
}

/* Dark mode - Stock badges */
html.dark-mode .stock-badge.in-stock {
  background: rgba(34, 197, 94, 0.2);
  color: #4ade80;
}

html.dark-mode .stock-badge.low-stock {
  background: rgba(251, 191, 36, 0.2);
  color: #fbbf24;
}

html.dark-mode .stock-badge.out-of-stock {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
}

/* Dark mode - Type badges */
html.dark-mode .type-badge.product {
  background: rgba(59, 130, 246, 0.2);
  color: #60a5fa;
}

html.dark-mode .type-badge.service {
  background: rgba(34, 197, 94, 0.2);
  color: #4ade80;
}

/* Dark mode - Alerts */
html.dark-mode .alert {
  border-color: var(--border);
}

html.dark-mode .alert-success {
  background-color: var(--success-light);
  color: var(--success);
}

html.dark-mode .alert-danger {
  background-color: var(--danger-light);
  color: var(--danger);
}

html.dark-mode .alert-warning {
  background-color: var(--warning-light);
  color: var(--warning);
}

html.dark-mode .alert-info {
  background-color: var(--info-light);
  color: var(--info);
}

/* Dark mode - Buttons */
html.dark-mode .btn-outline-secondary {
  border-color: var(--border);
  color: var(--text-secondary);
}

html.dark-mode .btn-outline-secondary:hover {
  background-color: var(--border);
  border-color: var(--border);
  color: var(--text-primary);
}

html.dark-mode .btn-light {
  background-color: var(--surface);
  border-color: var(--border);
  color: var(--text-primary);
}

html.dark-mode .btn-light:hover {
  background-color: var(--background);
  border-color: var(--border);
  color: var(--text-primary);
}

/* Dark mode - Pagination */
html.dark-mode .page-link {
  background-color: var(--surface);
  border-color: var(--border);
  color: var(--text-primary);
}

html.dark-mode .page-link:hover {
  background-color: var(--background);
  border-color: var(--border);
  color: var(--primary);
}

html.dark-mode .page-item.active .page-link {
  background-color: var(--primary);
  border-color: var(--primary);
}

html.dark-mode .page-item.disabled .page-link {
  background-color: var(--surface);
  border-color: var(--border);
  color: var(--text-muted);
}

/* Dark mode - List groups */
html.dark-mode .list-group-item {
  background-color: var(--surface);
  border-color: var(--border);
  color: var(--text-primary);
}

html.dark-mode .list-group-item:hover {
  background-color: var(--background);
}

/* Dark mode - Breadcrumbs */
html.dark-mode .breadcrumb {
  background-color: transparent;
}

html.dark-mode .breadcrumb-item a {
  color: var(--text-secondary);
}

html.dark-mode .breadcrumb-item.active {
  color: var(--text-muted);
}

/* Dark mode - Empty states */
html.dark-mode .empty-state {
  background-color: var(--background);
}

/* Dark mode - Stats cards */
html.dark-mode .stat-card {
  background-color: var(--surface);
  border-color: var(--border);
}

/* Dark mode - Top bar (mobile) */
html.dark-mode .top-bar {
  background-color: var(--surface);
  border-bottom-color: var(--border);
}

/* Dark mode - Bottom nav (mobile) */
html.dark-mode .bottom-nav {
  background-color: var(--surface);
  border-top-color: var(--border);
}

html.dark-mode .more-menu {
  background-color: var(--surface);
}

html.dark-mode .more-menu-header {
  border-bottom-color: var(--border);
}

/* Dark mode - Business avatar */
html.dark-mode .business-avatar {
  background-color: var(--background);
  color: var(--text-secondary);
}

/* Dark mode - Scrollbar */
html.dark-mode ::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

html.dark-mode ::-webkit-scrollbar-track {
  background: var(--background);
}

html.dark-mode ::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

html.dark-mode ::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* Dark mode - Selection */
html.dark-mode ::selection {
  background-color: var(--primary);
  color: white;
}

/* Theme transition for smooth switching */
html.theme-transition,
html.theme-transition *,
html.theme-transition *:before,
html.theme-transition *:after {
  transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease !important;
}

/* ============================================
   PRODUCT/SERVICE TYPE TOGGLE
   ============================================ */

/* Type Toggle Container */
.type-toggle-container {
  margin-bottom: 24px;
}

.type-toggle {
  display: flex;
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 4px;
  gap: 4px;
}

.type-toggle-option {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 16px;
  border: none;
  background: transparent;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}

.type-toggle-option:hover {
  color: var(--text-primary);
  background: var(--surface);
}

.type-toggle-option.active {
  background: var(--surface);
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.type-toggle-option i {
  font-size: 18px;
}

.type-toggle-option input {
  display: none;
}

/* Type Badge */
.type-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.type-badge.product {
  background: var(--info-light);
  color: var(--info);
}

.type-badge.service {
  background: var(--success-light);
  color: var(--success);
}

.type-badge i {
  font-size: 12px;
}

/* Conditional Form Sections */
.form-section-conditional {
  transition: opacity var(--transition), max-height var(--transition-slow);
  overflow: hidden;
}

.form-section-conditional.hidden {
  opacity: 0;
  max-height: 0;
  margin: 0;
  padding: 0;
  pointer-events: none;
}

.form-section-conditional.visible {
  opacity: 1;
  max-height: 500px;
}

/* Service-specific unit options highlight */
.unit-option-service {
  color: var(--success);
}

/* Dynamic Labels */
.dynamic-label {
  transition: opacity var(--transition-fast);
}

/* Product icon in list */
.data-list-icon.product-icon {
  background: var(--info-light);
  color: var(--info);
}

.data-list-icon.service-icon {
  background: var(--success-light);
  color: var(--success);
}

/* Type indicator in product details */
.type-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--background);
  border-radius: var(--radius);
  font-size: 13px;
  color: var(--text-secondary);
}

.type-indicator i {
  font-size: 16px;
}

.type-indicator.product i {
  color: var(--info);
}

.type-indicator.service i {
  color: var(--success);
}

/* Mobile Responsive */
@media (max-width: 576px) {
  .type-toggle {
    flex-direction: row;
  }

  .type-toggle-option {
    padding: 10px 12px;
    font-size: 13px;
  }

  .type-toggle-option i {
    font-size: 16px;
  }

  .type-toggle-option span {
    display: inline;
  }
}

/* ============================================
   PRODUCT IMAGE UPLOAD & DISPLAY
   ============================================ */

/* Image Upload Container */
.image-upload-container {
  display: flex;
  gap: 20px;
  align-items: flex-start;
}

.image-preview {
  width: 150px;
  height: 150px;
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--background);
  color: var(--text-muted);
  overflow: hidden;
  flex-shrink: 0;
}

.image-preview i {
  font-size: 32px;
  margin-bottom: 8px;
}

.image-preview span {
  font-size: 12px;
}

.image-preview.has-image {
  border-style: solid;
  border-color: var(--border);
}

.image-preview.has-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.image-preview.marked-for-removal {
  opacity: 0.5;
  position: relative;
}

.image-preview.marked-for-removal::after {
  content: '\f62a';
  font-family: 'bootstrap-icons';
  position: absolute;
  font-size: 32px;
  color: var(--danger);
}

.image-upload-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.hidden-file-input {
  display: none;
}

.remove-image-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 13px;
  color: var(--danger);
}

.remove-image-toggle input {
  cursor: pointer;
}

/* Product Image Display (Show Page) */
.product-image-display {
  margin-bottom: 24px;
  text-align: center;
}

.product-image-display img {
  max-width: 300px;
  max-height: 300px;
  width: auto;
  height: auto;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  object-fit: contain;
  background: var(--surface);
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.product-image-display img:hover {
  transform: scale(1.02);
  box-shadow: var(--shadow-lg);
}

/* Product Image in List */
.data-list-image {
  width: 48px;
  height: 48px;
  border-radius: var(--radius);
  overflow: hidden;
  flex-shrink: 0;
  background: var(--background);
  display: flex;
  align-items: center;
  justify-content: center;
}

.data-list-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: var(--surface);
}

/* Image Lightbox Modal */
.image-lightbox-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.9);
  z-index: 10000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.image-lightbox-overlay.active {
  opacity: 1;
  visibility: visible;
}

.image-lightbox-content {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.image-lightbox-content img {
  max-width: 100%;
  max-height: 85vh;
  object-fit: contain;
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  transform: scale(0.9);
  transition: transform 0.3s;
}

.image-lightbox-overlay.active .image-lightbox-content img {
  transform: scale(1);
}

.image-lightbox-close {
  position: absolute;
  top: -50px;
  right: 0;
  width: 44px;
  height: 44px;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  border-radius: 50%;
  color: white;
  font-size: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.image-lightbox-close:hover {
  background: rgba(255, 255, 255, 0.2);
}

.image-lightbox-zoom-controls {
  position: absolute;
  bottom: -60px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 12px;
}

.image-lightbox-zoom-controls button {
  width: 44px;
  height: 44px;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  border-radius: 50%;
  color: white;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.image-lightbox-zoom-controls button:hover {
  background: rgba(255, 255, 255, 0.2);
}

.image-lightbox-zoom-controls .zoom-level {
  color: white;
  font-size: 14px;
  display: flex;
  align-items: center;
  padding: 0 12px;
}

/* Clickable data-list-image */
.data-list-image[onclick] {
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.data-list-image[onclick]:hover {
  transform: scale(1.1);
  box-shadow: var(--shadow-md);
}

/* Mobile Responsive for Lightbox */
@media (max-width: 576px) {
  .image-lightbox-content {
    max-width: 95vw;
  }

  .image-lightbox-content img {
    max-height: 70vh;
  }

  .image-lightbox-close {
    top: -45px;
    right: 0;
    width: 40px;
    height: 40px;
    font-size: 20px;
  }

  .image-lightbox-zoom-controls {
    bottom: -55px;
    gap: 8px;
  }

  .image-lightbox-zoom-controls button {
    width: 40px;
    height: 40px;
    font-size: 16px;
  }

  .image-lightbox-zoom-controls .zoom-level {
    font-size: 12px;
    padding: 0 8px;
  }
}

/* Mobile Responsive */
@media (max-width: 576px) {
  .image-upload-container {
    gap: 12px;
  }

  .image-preview {
    width: 80px;
    height: 80px;
    min-width: 80px;
  }

  .image-preview i {
    font-size: 24px;
    margin-bottom: 4px;
  }

  .image-preview span {
    font-size: 10px;
  }

  .image-upload-actions {
    gap: 6px;
    justify-content: center;
  }

  .image-upload-actions .btn {
    padding: 6px 12px;
    font-size: 13px;
  }

  .image-upload-actions .form-text {
    font-size: 11px;
  }

  .product-image-display img {
    max-width: 200px;
    max-height: 200px;
  }

  .data-list-image {
    width: 40px;
    height: 40px;
  }
}

/* Dark mode support */
html.dark-mode .type-toggle {
  background: var(--background);
  border-color: var(--border);
}

html.dark-mode .type-toggle-option.active {
  background: var(--surface);
}

html.dark-mode .type-indicator {
  background: var(--surface);
}

/* ============================================
   INVOICE/QUOTATION DOCUMENT STYLES
   ============================================ */

/* Document container */
.invoice-document {
  background: var(--surface);
  color: var(--text-primary);
}

.invoice-document .card-body {
  padding: 32px;
}

/* Document Header */
.invoice-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 2px solid var(--border);
}

.invoice-company h2 {
  margin: 0 0 8px 0;
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
}

.invoice-company p {
  margin: 0 0 4px 0;
  font-size: 13px;
  color: var(--text-secondary);
}

.invoice-title {
  text-align: right;
}

.invoice-title h1 {
  margin: 0;
  font-size: 28px;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: 2px;
}

.invoice-number {
  margin: 4px 0 0 0;
  font-size: 14px;
  color: var(--text-secondary);
}

/* Customer & Dates Section */
.invoice-details {
  display: flex;
  justify-content: space-between;
  margin-bottom: 32px;
}

.invoice-to h4,
.invoice-info h4 {
  margin: 0 0 12px 0;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
}

.invoice-to .customer-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.invoice-to p {
  margin: 0 0 4px 0;
  font-size: 13px;
  color: var(--text-secondary);
}

.invoice-info {
  text-align: right;
}

.invoice-info .info-row {
  margin-bottom: 8px;
}

.invoice-info .info-row span {
  color: var(--text-secondary);
  font-size: 13px;
}

.invoice-info .info-row strong {
  display: block;
  font-size: 14px;
  color: var(--text-primary);
  margin-top: 2px;
}

/* Document Table */
.invoice-document .invoice-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 24px;
}

.invoice-document .invoice-table th {
  padding: 12px;
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  background: var(--background);
  border-bottom: 2px solid var(--border);
}

.invoice-document .invoice-table td {
  padding: 16px 12px;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-primary);
  font-size: 14px;
}

.invoice-document .invoice-table td strong {
  color: var(--text-primary);
}

/* Document Totals */
.invoice-document .invoice-totals {
  max-width: 300px;
  margin-left: auto;
}

.invoice-document .invoice-totals .totals-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  font-size: 14px;
  color: var(--text-secondary);
}

.invoice-document .invoice-totals .totals-row.total {
  border-top: 2px solid var(--border);
  margin-top: 8px;
  padding-top: 12px;
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}

/* Document Notes */
.invoice-notes {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--border-light);
}

.invoice-notes .notes-section {
  margin-bottom: 16px;
}

.invoice-notes .notes-section:last-child {
  margin-bottom: 0;
}

.invoice-notes h4 {
  margin: 0 0 8px 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.invoice-notes p {
  margin: 0;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* Info List in Sidebar */
.info-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.info-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-light);
}

.info-item:last-child {
  border-bottom: none;
}

.info-label {
  font-size: 13px;
  color: var(--text-muted);
}

.info-item span:last-child {
  font-size: 14px;
  color: var(--text-primary);
}

/* Badge Custom */
.badge-custom {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
}

.badge-success {
  background: var(--success-light);
  color: var(--success);
}

.badge-danger {
  background: var(--danger-light);
  color: var(--danger);
}

.badge-info {
  background: var(--info-light);
  color: var(--info);
}

.badge-primary {
  background: var(--primary-light);
  color: var(--primary);
}

.badge-secondary {
  background: var(--background);
  color: var(--text-secondary);
}

.badge-warning {
  background: var(--warning-light);
  color: var(--warning);
}

/* Responsive Document */
@media (max-width: 768px) {
  .invoice-document .card-body {
    padding: 20px;
  }

  .invoice-header {
    flex-direction: column;
    gap: 20px;
  }

  .invoice-title {
    text-align: left;
  }

  .invoice-details {
    flex-direction: column;
    gap: 20px;
  }

  .invoice-info {
    text-align: left;
  }

  .invoice-document .invoice-table th,
  .invoice-document .invoice-table td {
    padding: 10px 8px;
    font-size: 13px;
  }
}

/* Current Stock Info */
.current-stock-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: var(--background);
  border-radius: var(--radius);
  margin-bottom: 16px;
}

.current-stock-info span {
  color: var(--text-muted);
}

.current-stock-info strong {
  font-size: 18px;
  color: var(--text-primary);
}

/* Share Button Dropdown */
.share-dropdown {
  position: relative;
  display: inline-block;
}

.share-dropdown-content {
  display: none;
  position: absolute;
  right: 0;
  top: 100%;
  margin-top: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  min-width: 180px;
  box-shadow: var(--shadow-lg);
  z-index: 1000;
}

.share-dropdown-content.show {
  display: block;
}

.share-dropdown-content a,
.share-dropdown-content button {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  color: var(--text-primary);
  text-decoration: none;
  width: 100%;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 14px;
  text-align: left;
}

.share-dropdown-content a:hover,
.share-dropdown-content button:hover {
  background: var(--background);
}

.share-dropdown-content i {
  width: 18px;
  text-align: center;
}

.share-dropdown-content .bi-whatsapp {
  color: #25D366;
}

.share-dropdown-content .bi-envelope {
  color: var(--primary);
}

.share-dropdown-content .bi-link-45deg {
  color: var(--text-muted);
}

/* Toast Notification */
.toast-notification {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--surface);
  color: var(--text-primary);
  padding: 12px 24px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  z-index: 10000;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.toast-notification.show {
  opacity: 1;
}

/* Mobile fix for share dropdown */
@media (max-width: 576px) {
  .share-dropdown {
    position: static;
  }

  .share-dropdown-content {
    position: fixed;
    left: 16px;
    right: 16px;
    top: auto;
    bottom: 70px;
    width: auto;
    min-width: auto;
    max-width: calc(100% - 32px);
  }
}

/* ============================================
   BRANDING UPLOAD SECTION
   ============================================ */
.branding-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 16px;
}

@media (max-width: 768px) {
  .branding-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
  }
}

.branding-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  position: relative;
}

.branding-label {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 14px;
}

@media (max-width: 768px) {
  .branding-label {
    font-size: 11px;
  }
}

.branding-preview {
  width: 100%;
  max-width: 150px;
  aspect-ratio: 1;
  height: auto;
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  background: var(--background);
  overflow: hidden;
}

.branding-preview:hover {
  border-color: var(--primary);
}

.branding-image {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.branding-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
}

.branding-placeholder i {
  font-size: 32px;
}

.branding-placeholder span {
  font-size: 12px;
  text-align: center;
}

@media (max-width: 768px) {
  .branding-placeholder i {
    font-size: 20px;
  }

  .branding-placeholder span {
    font-size: 9px;
  }

  .branding-btn {
    font-size: 10px !important;
    padding: 5px 8px !important;
  }

  .branding-remove {
    width: 20px;
    height: 20px;
    font-size: 10px;
    opacity: 1;
  }
}

.branding-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--danger);
  color: white;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  opacity: 0;
  transition: opacity 0.2s;
}

.branding-preview:hover .branding-remove {
  opacity: 1;
}

.branding-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.branding-btn {
  cursor: pointer;
  margin-top: 8px;
}

.branding-preview-clickable {
  cursor: pointer;
  transition: border-color 0.2s, transform 0.2s;
}

.branding-preview-clickable:hover {
  border-color: var(--primary);
  transform: scale(1.02);
}

.branding-preview-clickable:active {
  transform: scale(0.98);
}

/* Cropper Modal Styles */
#cropperModal.modal-container.cropper-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.9);
  bottom: auto;
  right: auto;
  width: 90%;
  max-width: 450px;
  max-height: 85vh;
  z-index: 10000;
  border-radius: var(--radius-lg);
  opacity: 0;
  visibility: hidden;
}

#cropperModal.modal-container.cropper-modal.active {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, -50%) scale(1);
}

.cropper-modal-body {
  padding: 16px;
  overflow-y: auto;
  max-height: calc(85vh - 60px);
}

.cropper-container-wrapper {
  width: 100%;
  height: 280px;
  background: var(--background);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.cropper-container-wrapper img {
  display: block;
  max-width: 100%;
}

.cropper-controls {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.cropper-controls .btn {
  min-width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cropper-controls .btn i {
  font-size: 18px;
}

/* Cropper modal overlay */
#cropperModalOverlay.modal-overlay {
  z-index: 9999;
}

/* Mobile adjustments for cropper - override base modal bottom sheet */
@media (max-width: 576px) {
  #cropperModal.modal-container.cropper-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    bottom: auto;
    right: auto;
    transform: translate(-50%, -50%) scale(0.9);
    width: 94%;
    max-width: none;
    max-height: 80vh;
    border-radius: var(--radius-lg);
  }

  #cropperModal.modal-container.cropper-modal.active {
    transform: translate(-50%, -50%) scale(1);
  }

  .cropper-modal .cropper-modal-body {
    max-height: calc(80vh - 60px);
    padding: 12px;
  }

  .cropper-container-wrapper {
    height: 200px;
  }

  .cropper-controls {
    gap: 6px;
    margin-top: 12px;
    margin-bottom: 12px;
  }

  .cropper-controls .btn {
    min-width: 38px;
    height: 38px;
  }

  .cropper-controls .btn i {
    font-size: 16px;
  }

  .cropper-modal .modal-actions {
    padding: 12px 0 0 0;
  }
}

.form-section-desc {
  color: var(--text-secondary);
  font-size: 14px;
  margin-top: -8px;
  margin-bottom: 16px;
}

/* ============================================
   PAYROLL MODULE
   ============================================ */

/* Payroll Stats */
.payroll-stats {
  display: flex;
  gap: 16px;
  margin-bottom: 24px;
}

.payroll-stats .stats-card-single {
  flex: 1;
}

@media (max-width: 640px) {
  .payroll-stats {
    flex-direction: column;
  }
}

/* Salary Breakdown Card */
.salary-breakdown-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
}

.salary-breakdown-card .breakdown-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.salary-breakdown-card .breakdown-section.deductions {
  border-top: 1px dashed var(--border);
  padding-top: 16px;
  margin-top: 16px;
}

.salary-breakdown-card .breakdown-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.salary-breakdown-card .breakdown-item {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  font-size: 14px;
  border-bottom: 1px solid var(--border-light);
}

.salary-breakdown-card .breakdown-item:last-of-type {
  border-bottom: none;
}

.salary-breakdown-card .breakdown-subtotal {
  display: flex;
  justify-content: space-between;
  padding: 12px 0;
  font-weight: 600;
  border-top: 1px solid var(--border);
  margin-top: 8px;
}

.salary-breakdown-card .breakdown-total {
  display: flex;
  justify-content: space-between;
  padding: 16px;
  background: var(--primary);
  color: white;
  font-size: 18px;
  font-weight: 700;
  border-radius: var(--radius);
  margin-top: 16px;
}

/* Payroll Amount Card */
.payroll-amount-card {
  background: linear-gradient(135deg, var(--primary) 0%, #1d4ed8 100%);
}

/* ============================================
   BANK RECONCILIATION MODULE
   ============================================ */

/* Reconciliation Stats */
.reconciliation-stats {
  display: flex;
  gap: 16px;
  margin-bottom: 24px;
}

.reconciliation-stats .stats-card-single {
  flex: 1;
}

/* Balance Card */
.reconciliation-balance-card {
  display: flex;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  gap: 40px;
  margin-bottom: 24px;
}

.balance-item {
  text-align: center;
}

.balance-label {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.balance-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
}

/* Reconciliation Workspace */
.reconciliation-workspace {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 16px;
  align-items: start;
}

.reconciliation-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border-bottom: 1px solid var(--border);
  background: var(--background);
}

.panel-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.panel-tabs {
  display: flex;
  gap: 8px;
}

.panel-tab {
  background: none;
  border: none;
  padding: 6px 12px;
  font-size: 13px;
  color: var(--text-secondary);
  border-radius: var(--radius);
  cursor: pointer;
  transition: var(--transition-fast);
}

.panel-tab:hover {
  background: var(--border-light);
}

.panel-tab.active {
  background: var(--primary);
  color: white;
}

.panel-content {
  max-height: 500px;
  overflow-y: auto;
}

.panel-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  color: var(--text-muted);
}

.panel-empty i {
  font-size: 32px;
  margin-bottom: 12px;
}

.panel-empty p {
  margin: 0;
  font-size: 14px;
}

/* Transaction List */
.transaction-list {
  padding: 8px;
}

.transaction-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: var(--radius);
  transition: var(--transition-fast);
  cursor: pointer;
}

.transaction-item:hover {
  background: var(--background);
}

.transaction-item.selected {
  background: var(--primary-light);
  border: 1px solid var(--primary);
  margin: -1px;
}

.transaction-select {
  flex-shrink: 0;
}

.transaction-radio,
.record-radio {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.transaction-info {
  flex: 1;
  min-width: 0;
}

.transaction-desc {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.transaction-meta {
  display: flex;
  gap: 12px;
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.transaction-amount {
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
}

.transaction-amount.credit {
  color: var(--success);
}

.transaction-amount.debit {
  color: var(--danger);
}

/* Records Tab */
.records-tab {
  display: none;
}

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

/* Reconciliation Actions (Middle Column) */
.reconciliation-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px 0;
}

.btn-match {
  padding: 12px 24px;
  font-size: 15px;
}

.btn-match:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Statements Section */
.statements-section {
  margin-top: 32px;
}

.section-divider {
  height: 1px;
  background: var(--border);
  margin: 32px 0;
}

/* Import Dropzone */
.import-dropzone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: 40px 20px;
  text-align: center;
  transition: var(--transition);
  background: var(--background);
}

.import-dropzone.dragover {
  border-color: var(--primary);
  background: var(--primary-light);
}

.dropzone-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.dropzone-content i {
  font-size: 48px;
  color: var(--text-muted);
}

.dropzone-content p {
  margin: 0;
  font-size: 15px;
  color: var(--text-secondary);
}

.dropzone-content span {
  font-size: 13px;
  color: var(--text-muted);
}

.dropzone-hint {
  font-size: 12px !important;
  color: var(--text-muted) !important;
  margin-top: 8px !important;
}

.dropzone-selected {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.dropzone-selected i {
  font-size: 24px;
  color: var(--primary);
}

.dropzone-selected span {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
}

/* Import Format Help */
.import-format-help {
  margin-top: 24px;
  padding: 16px;
  background: var(--background);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.import-format-help h4 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 8px 0;
}

.import-format-help p {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 0 0 12px 0;
}

.import-format-help ul {
  margin: 0;
  padding-left: 20px;
}

.import-format-help li {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.import-format-help strong {
  color: var(--text-primary);
}

/* Button Icon (small icon button) */
.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  background: none;
  border: none;
  border-radius: var(--radius);
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition-fast);
}

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

.btn-icon:hover.delete-transaction {
  color: var(--danger);
}

/* Responsive - Mobile */
@media (max-width: 768px) {
  .reconciliation-stats {
    flex-direction: column;
  }

  .reconciliation-balance-card {
    flex-direction: column;
    gap: 16px;
    text-align: center;
  }

  .reconciliation-workspace {
    grid-template-columns: 1fr;
  }

  .reconciliation-actions {
    padding: 16px 0;
  }

  .panel-header {
    flex-direction: column;
    gap: 12px;
  }

  .panel-tabs {
    width: 100%;
    justify-content: center;
  }

  .transaction-item {
    padding: 10px 8px;
    gap: 8px;
  }

  .transaction-meta {
    flex-direction: column;
    gap: 2px;
  }
}

/* ============================================
   PAYROLL SPECIFIC STYLES
   ============================================ */

/* Status Header */
.status-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
  background: var(--surface);
  border-radius: var(--radius-lg);
  margin-bottom: 24px;
  border: 1px solid var(--border-light);
}

.status-header.paid {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(16, 185, 129, 0.05));
  border-color: rgba(16, 185, 129, 0.3);
}

.status-header.pending {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.1), rgba(245, 158, 11, 0.05));
  border-color: rgba(245, 158, 11, 0.3);
}

.status-header.cancelled {
  background: linear-gradient(135deg, rgba(107, 114, 128, 0.1), rgba(107, 114, 128, 0.05));
  border-color: rgba(107, 114, 128, 0.3);
}

.status-header .status-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 24px;
}

.status-header.paid .status-icon {
  background: rgba(16, 185, 129, 0.2);
  color: var(--success);
}

.status-header.pending .status-icon {
  background: rgba(245, 158, 11, 0.2);
  color: var(--warning);
}

.status-header.cancelled .status-icon {
  background: rgba(107, 114, 128, 0.2);
  color: var(--text-secondary);
}

.status-header .status-info {
  flex: 1;
}

.status-header .status-text {
  font-size: 18px;
  font-weight: 600;
}

.status-header .status-date {
  font-size: 14px;
  color: var(--text-secondary);
}

.status-header .status-amount {
  font-size: 24px;
  font-weight: 700;
}

/* Salary Summary */
.salary-summary {
  background: var(--background);
  border-radius: var(--radius);
  overflow: hidden;
}

.salary-summary .summary-row {
  display: flex;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-light);
}

.salary-summary .summary-row:last-child {
  border-bottom: none;
}

.salary-summary .summary-row.deduction {
  color: var(--danger);
}

.salary-summary .summary-row.total {
  background: var(--surface);
  font-weight: 700;
  font-size: 18px;
  padding: 16px;
}

/* Salary Breakdown */
.salary-breakdown {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.breakdown-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.breakdown-section.deductions {
  border-top: 1px dashed var(--border);
  padding-top: 16px;
}

.breakdown-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.breakdown-item {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  font-size: 14px;
}

.breakdown-subtotal {
  display: flex;
  justify-content: space-between;
  padding: 12px 0;
  font-weight: 600;
  border-top: 1px solid var(--border-light);
  margin-top: 8px;
}

.breakdown-total {
  display: flex;
  justify-content: space-between;
  padding: 16px;
  background: var(--primary);
  color: white;
  font-size: 18px;
  font-weight: 700;
  border-radius: var(--radius);
  margin-top: 8px;
}

/* Employee Select Grid (Bulk) */
.employee-select-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.employee-select-item {
  display: flex;
  align-items: flex-start;
  padding: 16px;
  background: var(--surface);
  border: 2px solid var(--border-light);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.15s ease;
}

.employee-select-item:hover {
  border-color: var(--primary);
}

.employee-select-item:has(.employee-checkbox:checked) {
  border-color: var(--primary);
  background: var(--primary-light);
}

.employee-checkbox {
  margin-right: 12px;
  margin-top: 4px;
  width: 18px;
  height: 18px;
}

.employee-select-content {
  flex: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.employee-avatar {
  width: 40px;
  height: 40px;
  background: var(--primary);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 14px;
}

.employee-info {
  flex: 1;
  min-width: 120px;
}

.employee-name {
  font-weight: 600;
  margin-bottom: 2px;
}

.employee-position {
  font-size: 13px;
  color: var(--text-secondary);
}

.employee-salary {
  font-size: 14px;
  font-weight: 600;
  color: var(--primary);
}

.last-paid {
  font-size: 12px;
  color: var(--text-muted);
  width: 100%;
}

.bulk-select-actions {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.bulk-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  background: var(--background);
  border-radius: var(--radius);
  font-weight: 500;
}

.bulk-total {
  font-size: 18px;
  font-weight: 700;
  color: var(--primary);
}

/* Inline form */
.inline-form {
  display: inline-block;
}

/* Empty state small */
.empty-state-small {
  padding: 24px;
  text-align: center;
  color: var(--text-secondary);
}

.empty-state-small p {
  margin: 0;
}

/* Data list amount */
.data-list-amount {
  font-weight: 600;
  font-size: 16px;
  white-space: nowrap;
}

/* Compact data list */
.data-list.compact .data-list-item {
  padding: 12px 0;
}

.data-list.compact .data-list-icon {
  width: 32px;
  height: 32px;
  font-size: 14px;
}

/* Stats sub text */
.stats-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

@media (max-width: 768px) {
  .status-header {
    flex-direction: column;
    text-align: center;
  }

  .status-header .status-amount {
    font-size: 20px;
  }

  .employee-select-grid {
    grid-template-columns: 1fr;
  }

  .bulk-summary {
    flex-direction: column;
    gap: 8px;
    text-align: center;
  }
}

/* ============================================
   RECEIVE GOODS STYLES
   ============================================ */
.receive-items-table {
  background: var(--surface);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.receive-items-header {
  display: grid;
  grid-template-columns: 2fr 80px 100px 80px 100px;
  gap: 12px;
  padding: 16px;
  background: var(--background);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  border-bottom: 1px solid var(--border);
}

.receive-item-row {
  display: grid;
  grid-template-columns: 2fr 80px 100px 80px 100px;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid var(--border);
  align-items: center;
}

.receive-item-row:last-child {
  border-bottom: none;
}

.receive-item-desc .item-name {
  font-weight: 500;
  color: var(--text-primary);
}

.receive-item-desc .item-sku {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

.receive-item-ordered,
.receive-item-received,
.receive-item-pending {
  text-align: center;
  font-size: 14px;
}

.receive-item-qty {
  text-align: center;
}

.receive-qty-input {
  max-width: 80px;
  text-align: center;
}

.mobile-label {
  display: none;
}

@media (max-width: 768px) {
  .receive-items-header {
    display: none;
  }

  .receive-item-row {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 16px;
    background: var(--background);
    margin: 8px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
  }

  .receive-item-ordered,
  .receive-item-received,
  .receive-item-pending,
  .receive-item-qty {
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-align: left;
  }

  .mobile-label {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
  }

  .receive-qty-input {
    max-width: 100px;
  }
}

/* ============================================
   COMPREHENSIVE MOBILE RESPONSIVE STYLES
   Ensuring all designs work on mobile devices
   ============================================ */

/* ----- TABLET (max-width: 1024px) ----- */
@media (max-width: 1024px) {
  /* Report Summary Grid */
  .report-summary-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Report Links Grid */
  .report-links-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Stats Grid */
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Action Grid */
  .action-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Detail Grid */
  .detail-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ----- MOBILE (max-width: 768px) ----- */
@media (max-width: 768px) {
  /* Tables - Card Style */
  .table-responsive {
    margin: 0 -16px;
    padding: 0;
    border-radius: 0;
  }

  .data-table {
    border: none;
  }

  .data-table thead {
    display: none;
  }

  .data-table tbody tr {
    display: flex;
    flex-direction: column;
    padding: 16px;
    margin: 8px 16px;
    background: var(--surface);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
  }

  .data-table tbody td {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 8px 0;
    border: none;
    border-bottom: 1px solid var(--border-light);
  }

  .data-table tbody td:last-child {
    border-bottom: none;
  }

  .data-table tbody td::before {
    content: attr(data-label);
    font-weight: 600;
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    flex-shrink: 0;
    margin-right: 16px;
  }

  /* Report Grids */
  .report-summary-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .report-summary-card {
    padding: 16px;
  }

  .report-summary-card .summary-icon {
    width: 40px;
    height: 40px;
    font-size: 20px;
  }

  .summary-value {
    font-size: 18px;
  }

  .report-links-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .report-link-card {
    padding: 16px;
  }

  /* Stats Cards */
  .status-cards-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .status-stat-card {
    padding: 16px;
    flex-direction: column;
    text-align: center;
    gap: 12px;
  }

  .status-stat-icon {
    width: 40px;
    height: 40px;
    font-size: 20px;
  }

  .status-stat-count {
    font-size: 20px;
  }

  /* P&L Summary */
  .pl-summary {
    flex-direction: column;
    padding: 20px;
    gap: 16px;
  }

  .pl-summary-item {
    min-width: 100%;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-light);
  }

  .pl-summary-item:last-child {
    border-bottom: none;
  }

  .pl-summary-value {
    font-size: 22px;
  }

  /* Filter Forms */
  .filter-form {
    flex-direction: column;
    gap: 12px;
  }

  .filter-group {
    width: 100%;
  }

  .filter-group .form-select {
    min-width: 100%;
    width: 100%;
  }

  /* Quick Action Bar */
  .quick-action-bar {
    flex-direction: column;
    gap: 8px;
  }

  .quick-action-bar .btn {
    width: 100%;
    justify-content: center;
  }

  /* Stats Grid */
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .stat-card {
    padding: 16px 12px;
  }

  .stat-value {
    font-size: 20px;
  }

  .stat-label {
    font-size: 11px;
  }

  /* Action Grid */
  .action-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .action-btn {
    padding: 14px 16px;
  }

  /* Detail Section */
  .detail-section {
    padding: 16px;
    margin-bottom: 16px;
  }

  .detail-section .data-list.compact {
    margin: 0 -16px -16px -16px;
  }

  .detail-section .data-list.compact .data-list-item {
    padding: 12px 16px;
  }

  /* Section Headers */
  .section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    margin-top: 24px;
  }

  /* Invoice Detail Grid */
  .invoice-detail-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  /* Invoice Table */
  .invoice-table-wrapper {
    margin: 0 -16px;
  }

  .invoice-table th,
  .invoice-table td {
    padding: 12px 8px;
    font-size: 13px;
  }

  /* Invoice Totals */
  .invoice-totals {
    max-width: 100%;
    margin-top: 16px;
  }

  .totals-row.total {
    font-size: 16px;
  }

  /* Contact Actions */
  .contact-actions {
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
  }

  .contact-btn {
    padding: 10px 8px;
    font-size: 11px;
    min-width: 0;
  }

  .contact-btn i {
    font-size: 18px;
  }

  /* Empty State */
  .empty-state {
    padding: 32px 16px;
  }

  .empty-state-icon {
    font-size: 48px;
  }

  .empty-state-title {
    font-size: 18px;
  }

  /* Modal Dialogs */
  .modal-dialog {
    margin: 16px;
    max-width: calc(100% - 32px);
  }

  .modal-body {
    padding: 16px;
  }

  .modal-footer {
    flex-direction: column-reverse;
    gap: 8px;
    padding: 16px;
  }

  .modal-footer .btn {
    width: 100%;
    margin: 0;
  }

  /* Tabs */
  .nav-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 2px;
  }

  .nav-tabs .nav-link {
    white-space: nowrap;
    padding: 10px 16px;
    font-size: 13px;
  }

  /* Status Tabs */
  .status-tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
    flex-wrap: nowrap;
  }

  .status-tab {
    flex-shrink: 0;
    padding: 8px 14px;
    font-size: 12px;
  }

  /* Linked Records */
  .linked-records {
    gap: 8px;
  }

  .linked-record-item {
    padding: 12px;
  }

  /* Data List Items */
  .data-list-item {
    padding: 14px 16px;
    gap: 12px;
  }

  .data-list-icon {
    width: 40px;
    height: 40px;
  }

  .data-list-icon i {
    font-size: 18px;
  }

  /* Amount Display */
  .amount-display-card {
    padding: 24px 16px;
  }

  .amount-display-value {
    font-size: 28px;
  }

  /* Bank Reconciliation */
  .reconciliation-grid {
    grid-template-columns: 1fr;
  }

  /* Employee Grid */
  .employee-grid {
    grid-template-columns: 1fr;
  }

  /* Payroll Summary */
  .payroll-summary {
    flex-direction: column;
    text-align: center;
    gap: 16px;
  }

  /* Website Builder */
  .website-preview-frame {
    height: 400px;
  }

  .theme-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Product Images Grid */
  .product-images-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  /* Breadcrumb */
  .breadcrumb {
    font-size: 12px;
    flex-wrap: wrap;
  }

  /* Alert Messages */
  .alert {
    padding: 12px 16px;
    font-size: 13px;
  }

  /* Button Groups */
  .btn-group {
    flex-wrap: wrap;
  }

  /* Page Title */
  .page-title {
    font-size: 22px;
  }

  .page-subtitle {
    font-size: 13px;
  }

  /* Cards */
  .card {
    border-radius: var(--radius);
  }

  .card-header {
    padding: 14px 16px;
    font-size: 15px;
  }

  .card-body {
    padding: 16px;
  }

  /* Vendor/Customer View */
  .vendor-header,
  .customer-header {
    flex-direction: column;
    text-align: center;
    gap: 16px;
  }

  /* Invoice Summary (in forms) */
  .invoice-summary {
    margin: 0 -16px -16px -16px;
    padding: 16px;
    background: var(--background);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  }

  .summary-row {
    font-size: 14px;
    padding: 10px 0;
  }

  .summary-row.total {
    font-size: 16px;
    padding-top: 14px;
  }

  /* Tax Input */
  .tax-input {
    width: 60px;
    padding: 6px 8px;
    font-size: 13px;
  }

  /* Settings Page */
  .settings-grid {
    grid-template-columns: 1fr;
  }

  .settings-section {
    padding: 16px;
  }

  /* Team Members */
  .team-grid {
    grid-template-columns: 1fr;
  }

  .team-member-card {
    padding: 16px;
  }

  /* Pagination */
  .pagination {
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px;
  }

  .pagination .page-link {
    padding: 8px 12px;
    font-size: 13px;
  }

  /* Print Button Group */
  .print-actions {
    flex-direction: column;
    gap: 8px;
  }

  .print-actions .btn {
    width: 100%;
  }
}

/* ----- SMALL MOBILE (max-width: 480px) ----- */
@media (max-width: 480px) {
  /* Extra small adjustments */
  html {
    font-size: 13px;
  }

  .page-content {
    padding: 12px;
    padding-bottom: 90px;
  }

  /* Status Cards - Single Column */
  .status-cards-grid {
    grid-template-columns: 1fr;
  }

  /* Stats Grid - Single Column */
  .stats-grid {
    grid-template-columns: 1fr;
  }

  /* Contact Actions - 3 columns max */
  .contact-actions {
    grid-template-columns: repeat(3, 1fr);
  }

  /* Form Section */
  .form-section {
    padding: 16px;
  }

  /* Page Header */
  .page-header {
    margin-bottom: 16px;
  }

  .page-title {
    font-size: 20px;
  }

  /* Back Link */
  .back-link {
    font-size: 13px;
    margin-bottom: 6px;
  }

  /* Buttons */
  .btn {
    padding: 10px 14px;
    font-size: 13px;
  }

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

  .btn-lg {
    padding: 12px 20px;
    font-size: 14px;
  }

  /* Invoice Items Mobile */
  .invoice-item-row {
    padding: 14px;
  }

  .item-product .form-control {
    font-size: 14px;
  }

  .item-description {
    font-size: 13px;
  }

  /* Product Select */
  .product-select {
    font-size: 14px;
    padding: 10px 12px;
  }

  /* Input fields */
  .form-control,
  .form-select {
    font-size: 14px;
    padding: 10px 12px;
  }

  /* Search Input */
  .search-input {
    padding: 10px 12px 10px 38px;
  }

  /* Data List */
  .data-list-item {
    padding: 12px;
  }

  .data-list-icon {
    width: 36px;
    height: 36px;
  }

  .data-list-icon i {
    font-size: 16px;
  }

  .data-list-title {
    font-size: 14px;
  }

  .data-list-subtitle {
    font-size: 12px;
  }

  /* Detail Items */
  .detail-label {
    font-size: 11px;
  }

  .detail-value {
    font-size: 13px;
  }

  /* Amount Display */
  .amount-display-card {
    padding: 20px 12px;
  }

  .amount-display-value {
    font-size: 24px;
  }

  /* Linked Records */
  .linked-record-item {
    padding: 10px;
    gap: 10px;
  }

  .linked-record-icon {
    width: 36px;
    height: 36px;
    font-size: 16px;
  }

  /* Badge */
  .badge,
  .badge-custom {
    font-size: 11px;
    padding: 3px 8px;
  }

  /* Theme Grid */
  .theme-grid {
    grid-template-columns: 1fr;
  }

  /* Product Images */
  .product-images-grid {
    grid-template-columns: 1fr;
  }

  /* Quick Actions */
  .quick-actions {
    padding: 20px;
  }

  /* Recent Section */
  .recent-section {
    padding: 16px;
  }

  .recent-item {
    padding: 12px;
  }

  .recent-icon {
    width: 36px;
    height: 36px;
    font-size: 16px;
    margin-right: 12px;
  }

  /* Widget Stats */
  .widget-inventory-stats {
    flex-direction: column;
    text-align: center;
  }

  /* Permission Grid */
  .permission-grid {
    grid-template-columns: 1fr;
  }

  .permission-item {
    padding: 12px;
  }

  /* Category List */
  .category-list-item {
    padding: 12px;
    gap: 12px;
  }

  /* Color Picker */
  .color-picker-wrapper {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .color-picker {
    width: 100%;
    height: 44px;
  }

  /* Report Filter */
  .report-filters {
    padding: 12px 16px;
  }

  /* Summary Cards */
  .report-summary-card {
    flex-direction: column;
    text-align: center;
    gap: 8px;
  }

  /* Member Info */
  .member-info-card {
    flex-direction: column;
    text-align: center;
    gap: 12px;
  }

  .member-avatar-lg {
    width: 56px;
    height: 56px;
    font-size: 20px;
  }

  /* Table in cards */
  .table th,
  .table td {
    padding: 10px 8px;
    font-size: 13px;
  }

  /* Website Preview */
  .website-preview-frame {
    height: 300px;
  }

  /* Empty State */
  .empty-state {
    padding: 24px 12px;
  }

  .empty-state-icon {
    font-size: 40px;
  }

  .empty-state-title {
    font-size: 16px;
  }

  .empty-state-text {
    font-size: 13px;
  }

  /* P&L Summary */
  .pl-summary {
    padding: 16px;
  }

  .pl-summary-value {
    font-size: 20px;
  }
}

/* ----- LANDSCAPE PHONE ----- */
@media (max-width: 768px) and (orientation: landscape) {
  .page-content {
    padding-bottom: 80px;
  }

  .bottom-nav {
    height: 56px;
  }

  .bottom-nav-item {
    font-size: 10px;
  }

  .bottom-nav-item i {
    font-size: 18px;
  }

  .more-menu-grid {
    grid-template-columns: repeat(5, 1fr);
  }
}

/* ----- PRINT STYLES ----- */
@media print {
  .sidebar,
  .top-bar,
  .bottom-nav,
  .page-actions,
  .form-actions,
  .btn,
  .search-section,
  .filter-form,
  .back-link,
  .quick-action-bar {
    display: none !important;
  }

  .main-content {
    margin-left: 0 !important;
  }

  .page-content {
    padding: 0 !important;
  }

  body {
    background: white !important;
  }

  .card,
  .detail-section {
    box-shadow: none !important;
    border: 1px solid #ddd !important;
  }
}

/* ----- TOUCH DEVICE OPTIMIZATIONS ----- */
@media (hover: none) and (pointer: coarse) {
  /* Larger touch targets */
  .btn {
    min-height: 44px;
  }

  .nav-item {
    min-height: 48px;
  }

  .data-list-item {
    min-height: 64px;
  }

  .form-control,
  .form-select {
    min-height: 44px;
  }

  /* Remove hover effects on touch */
  .btn:hover,
  .card:hover,
  .data-list-item:hover {
    transform: none;
  }

  /* Checkbox/Radio larger */
  input[type="checkbox"],
  input[type="radio"] {
    min-width: 20px;
    min-height: 20px;
  }
}

/* ============================================
   HOSPITALITY DASHBOARD STYLES
   ============================================ */

/* Dashboard Section */
.dashboard-section {
  margin-bottom: 28px;
}

/* Clickable Financial Cards */
a.dashboard-financial-card {
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}

a.dashboard-financial-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary);
}

/* Occupancy Gauge */
.occupancy-gauge-container {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
}

.occupancy-gauge {
  position: relative;
  width: 140px;
  height: 140px;
}

.occupancy-gauge svg {
  width: 100%;
  height: 100%;
}

.occupancy-gauge .gauge-bg {
  stroke: var(--border);
}

.occupancy-gauge .gauge-fill {
  stroke: var(--primary);
  stroke-linecap: round;
  transition: stroke-dasharray 0.5s ease;
}

.occupancy-gauge .gauge-value {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
}

.occupancy-stats {
  display: flex;
  justify-content: center;
  gap: 40px;
}

.occupancy-stat {
  text-align: center;
}

.occupancy-stat-value {
  display: block;
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
}

.occupancy-stat-label {
  font-size: 13px;
  color: var(--text-secondary);
}

/* Revenue Display */
.revenue-display {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.revenue-amount {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
}

.revenue-change {
  font-size: 14px;
  padding: 4px 10px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  gap: 4px;
}

.revenue-change.positive {
  background: var(--success-light);
  color: var(--success);
}

.revenue-change.negative {
  background: var(--danger-light);
  color: var(--danger);
}

.revenue-breakdown {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.revenue-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  background: var(--background);
  border-radius: var(--radius);
}

.revenue-item-label {
  font-size: 14px;
  color: var(--text-secondary);
}

.revenue-item-value {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

/* KPI Grid */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.kpi-item {
  text-align: center;
  padding: 16px;
  background: var(--background);
  border-radius: var(--radius);
}

.kpi-value {
  display: block;
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
}

.kpi-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-top: 4px;
}

.kpi-hint {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Arrival Date Display */
.arrival-date {
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1;
}

.arrival-day {
  font-size: 18px;
  font-weight: 700;
  color: var(--primary);
}

.arrival-month {
  font-size: 10px;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* Data List Icons with colors */
.data-list-icon.blue {
  background: var(--primary-light);
  color: var(--primary);
}

.data-list-icon.green {
  background: var(--success-light);
  color: var(--success);
}

.data-list-icon.orange {
  background: var(--warning-light);
  color: var(--warning);
}

.data-list-icon.red {
  background: var(--danger-light);
  color: var(--danger);
}

.data-list-icon.teal {
  background: rgba(20, 184, 166, 0.1);
  color: #14b8a6;
}

/* Badge variants */
.badge-yellow {
  background: #eab308;
  color: white;
}

/* Large modal - supports both .modal-lg on container or parent */
.modal-lg .modal-container,
.modal-container.modal-lg {
  max-width: 600px;
}

/* Badge variants */
.badge-blue {
  background: #3b82f6;
  color: white;
}

/* Filter bar */
.filter-bar {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 16px;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.filter-group label {
  font-size: 12px;
  color: var(--text-muted);
}

.filter-group .form-control {
  min-width: 150px;
}

/* Mini progress bar */
.progress-bar-mini {
  width: 60px;
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
  display: inline-block;
  vertical-align: middle;
  margin-right: 8px;
}

.progress-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 3px;
}

/* Row states */
.row-cancelled {
  opacity: 0.6;
}

/* Days checkbox group */
.days-checkbox-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.day-checkbox {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 12px;
  background: var(--bg-secondary);
  border-radius: var(--radius);
  cursor: pointer;
}

.day-checkbox input:checked + span {
  color: var(--primary);
  font-weight: 600;
}

/* Route Rank (Ferry Dashboard) */
.route-rank {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 600;
  font-size: 0.875rem;
}

/* Empty State Variants */
.empty-state.small {
  padding: 32px 16px;
}

.empty-state.small i {
  font-size: 32px;
}

.empty-state.success {
  color: var(--success);
}

.empty-state.success i {
  opacity: 1;
}

/* Text Utilities */
.text-warning {
  color: var(--warning) !important;
}

.text-sm {
  font-size: 12px;
}

/* Card padding utilities */
.p-0 {
  padding: 0 !important;
}

/* ============================================
   TIMELINE CALENDAR STYLES (7-Day View)
   ============================================ */

.timeline-calendar {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.timeline-calendar::-webkit-scrollbar {
  display: none;
}

.timeline-day {
  flex: 1 0 0;
  min-width: 140px;
  border-right: 1px solid var(--border);
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
}

.timeline-day:last-child {
  border-right: none;
}

.timeline-day-header {
  padding: 12px 16px;
  background: var(--background);
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.timeline-day.is-today .timeline-day-header {
  background: var(--primary);
}

.timeline-day-name {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

.timeline-day.is-today .timeline-day-name {
  color: rgba(255, 255, 255, 0.8);
}

.timeline-day-date {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.timeline-day.is-today .timeline-day-date {
  color: white;
}

.timeline-day-body {
  flex: 1;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 180px;
  background: var(--surface);
}

.timeline-event {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  background: var(--background);
  border-radius: var(--radius);
  text-decoration: none;
  color: inherit;
  transition: all var(--transition);
  border-left: 3px solid transparent;
}

.timeline-event:hover {
  background: var(--border);
  transform: translateX(2px);
}

.timeline-event.checkin {
  border-left-color: var(--success);
}

.timeline-event.checkout {
  border-left-color: var(--danger);
}

.timeline-event-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-top: 4px;
  flex-shrink: 0;
}

.timeline-event.checkin .timeline-event-indicator {
  background: var(--success);
}

.timeline-event.checkout .timeline-event-indicator {
  background: var(--danger);
}

.timeline-event-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.timeline-event-type {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.timeline-event.checkin .timeline-event-type {
  color: var(--success);
}

.timeline-event.checkout .timeline-event-type {
  color: var(--danger);
}

.timeline-event-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.timeline-more {
  display: block;
  text-align: center;
  padding: 8px;
  font-size: 12px;
  font-weight: 500;
  color: var(--primary);
  text-decoration: none;
  border-radius: var(--radius);
  transition: background-color var(--transition);
}

.timeline-more:hover {
  background: var(--primary-light);
}

.timeline-empty {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 13px;
}

/* Timeline Calendar Dark Mode */
html.dark-mode .timeline-day-header {
  background: var(--surface);
}

html.dark-mode .timeline-day.is-today .timeline-day-header {
  background: var(--primary);
}

html.dark-mode .timeline-day-body {
  background: var(--surface);
}

html.dark-mode .timeline-event {
  background: var(--background);
}

html.dark-mode .timeline-event:hover {
  background: var(--border);
}

/* Timeline Calendar Responsive */
@media (max-width: 768px) {
  .timeline-day {
    min-width: 120px;
  }

  .timeline-day-header {
    padding: 10px 12px;
  }

  .timeline-day-body {
    padding: 10px;
    min-height: 150px;
  }

  .timeline-event {
    padding: 8px 10px;
    gap: 8px;
  }

  .timeline-event-name {
    font-size: 12px;
  }
}

@media (max-width: 480px) {
  .timeline-day {
    min-width: 100px;
  }

  .timeline-day-header {
    padding: 8px 10px;
  }

  .timeline-day-name {
    font-size: 10px;
  }

  .timeline-day-date {
    font-size: 12px;
  }

  .timeline-day-body {
    padding: 8px;
    gap: 6px;
    min-height: 120px;
  }

  .timeline-event {
    padding: 6px 8px;
    gap: 6px;
  }

  .timeline-event-indicator {
    width: 6px;
    height: 6px;
    margin-top: 3px;
  }

  .timeline-event-type {
    font-size: 9px;
  }

  .timeline-event-name {
    font-size: 11px;
  }

  .timeline-more {
    padding: 6px;
    font-size: 11px;
  }
}

/* ============================================
   WEEK TIMELINE (Horizontal Bars)
   ============================================ */

.week-timeline {
  display: flex;
  flex-direction: column;
}

.week-row {
  display: flex;
  align-items: stretch;
  border-bottom: 1px solid var(--border);
  min-height: 52px;
}

.week-row:last-child {
  border-bottom: none;
}

.week-row.is-today {
  background: rgba(var(--primary-rgb), 0.05);
}

.week-row.is-today .week-row-date {
  background: var(--primary);
  color: white;
}

.week-row.is-today .week-row-day {
  color: rgba(255, 255, 255, 0.8);
}

.week-row.is-today .week-row-num {
  color: white;
}

.week-row-date {
  width: 70px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 10px 8px;
  background: var(--background);
  border-right: 1px solid var(--border);
  gap: 2px;
}

.week-row-day {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

.week-row-num {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
}

.week-row-bar {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.week-row-bar::-webkit-scrollbar {
  display: none;
}

.week-event {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  transition: all var(--transition);
  flex-shrink: 0;
}

.week-event.checkin {
  background: rgba(16, 185, 129, 0.1);
  color: #059669;
}

.week-event.checkin:hover {
  background: rgba(16, 185, 129, 0.2);
}

.week-event.checkout {
  background: rgba(239, 68, 68, 0.1);
  color: #dc2626;
}

.week-event.checkout:hover {
  background: rgba(239, 68, 68, 0.2);
}

.week-event.more {
  background: var(--background);
  color: var(--primary);
  font-weight: 600;
}

.week-event.more:hover {
  background: var(--primary-light);
}

.week-event-icon {
  display: flex;
  font-size: 14px;
}

.week-event-name {
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Week Timeline Dark Mode */
html.dark-mode .week-row-date {
  background: var(--surface);
}

html.dark-mode .week-row.is-today .week-row-date {
  background: var(--primary);
}

html.dark-mode .week-event.checkin {
  background: rgba(16, 185, 129, 0.15);
}

html.dark-mode .week-event.checkout {
  background: rgba(239, 68, 68, 0.15);
}

html.dark-mode .week-event.more {
  background: var(--background);
}

/* Week Timeline Responsive */
@media (max-width: 480px) {
  .week-row-date {
    width: 55px;
    padding: 8px 6px;
  }

  .week-row-day {
    font-size: 9px;
  }

  .week-row-num {
    font-size: 16px;
  }

  .week-row-bar {
    padding: 6px 8px;
    gap: 6px;
  }

  .week-event {
    padding: 5px 10px;
    font-size: 12px;
    gap: 4px;
  }

  .week-event-icon {
    font-size: 12px;
  }

  .week-event-name {
    max-width: 80px;
  }
}

/* ============================================
   DAY LIST (Full-Width Mobile Cards)
   ============================================ */

.day-list {
  display: flex;
  flex-direction: column;
}

.day-card {
  border-bottom: 1px solid var(--border);
}

.day-card:last-child {
  border-bottom: none;
}

.day-card.is-today {
  background: rgba(var(--primary-rgb), 0.03);
}

.day-card-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
}

.day-card-date {
  width: 56px;
  height: 56px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--background);
  border-radius: 12px;
  flex-shrink: 0;
}

.day-card.is-today .day-card-date {
  background: var(--primary);
}

.day-date-num {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
}

.day-card.is-today .day-date-num {
  color: white;
}

.day-date-month {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.day-card.is-today .day-date-month {
  color: rgba(255, 255, 255, 0.8);
}

.day-card-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.day-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.today-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  background: var(--primary);
  color: white;
  border-radius: 10px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.day-summary {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
}

.summary-in {
  color: var(--success);
  display: flex;
  align-items: center;
  gap: 4px;
  font-weight: 500;
}

.summary-out {
  color: var(--danger);
  display: flex;
  align-items: center;
  gap: 4px;
  font-weight: 500;
}

.summary-none {
  color: var(--text-muted);
}

.day-card-events {
  padding: 0 16px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.day-event {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--background);
  border-radius: 10px;
  text-decoration: none;
  transition: all var(--transition);
}

.day-event:hover {
  background: var(--border);
}

.day-event-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-size: 16px;
  flex-shrink: 0;
}

.day-event.checkin .day-event-icon {
  background: rgba(16, 185, 129, 0.1);
  color: var(--success);
}

.day-event.checkout .day-event-icon {
  background: rgba(239, 68, 68, 0.1);
  color: var(--danger);
}

.day-event-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  width: 70px;
  flex-shrink: 0;
}

.day-event.checkin .day-event-label {
  color: var(--success);
}

.day-event.checkout .day-event-label {
  color: var(--danger);
}

.day-event-name {
  flex: 1;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.day-event-arrow {
  color: var(--text-muted);
  font-size: 14px;
}

.day-event-more {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px;
  font-size: 13px;
  font-weight: 500;
  color: var(--primary);
  text-decoration: none;
  border-radius: 8px;
  transition: background-color var(--transition);
}

.day-event-more:hover {
  background: var(--primary-light);
}

/* Day List Dark Mode */
html.dark-mode .day-card-date {
  background: var(--background);
}

html.dark-mode .day-card.is-today .day-card-date {
  background: var(--primary);
}

html.dark-mode .day-event {
  background: var(--background);
}

html.dark-mode .day-event:hover {
  background: var(--border);
}

/* ============================================
   BAR CALENDAR (Visual Horizontal Bars)
   ============================================ */

.bar-calendar {
  display: flex;
  flex-direction: column;
}

.bar-row {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  gap: 12px;
  text-decoration: none;
  border-bottom: 1px solid var(--border);
  transition: background-color var(--transition);
}

.bar-row:last-child {
  border-bottom: none;
}

.bar-row:hover {
  background: var(--background);
}

.bar-row.is-today {
  background: rgba(var(--primary-rgb), 0.05);
}

.bar-date {
  width: 44px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.bar-day {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

.bar-row.is-today .bar-day {
  color: var(--primary);
}

.bar-num {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
}

.bar-row.is-today .bar-num {
  color: var(--primary);
}

.bar-track {
  flex: 1;
  height: 40px;
  background: var(--background);
  border-radius: 8px;
  position: relative;
  display: flex;
  align-items: center;
  padding: 0 12px;
  gap: 16px;
  overflow: hidden;
}

.bar-row.is-today .bar-track {
  background: var(--primary);
}

.bar-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0;
  background: linear-gradient(90deg, rgba(var(--primary-rgb), 0.15), transparent);
  transition: width 0.3s ease;
}

.bar-fill.has-events {
  width: 100%;
}

.bar-row.is-today .bar-fill {
  background: rgba(255, 255, 255, 0.1);
}

.bar-marker {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  font-weight: 600;
  z-index: 1;
  padding: 4px 10px;
  border-radius: 14px;
}

.bar-marker.checkin {
  background: rgba(16, 185, 129, 0.15);
  color: #059669;
}

.bar-marker.checkout {
  background: rgba(239, 68, 68, 0.15);
  color: #dc2626;
}

.bar-row.is-today .bar-marker.checkin {
  background: rgba(255, 255, 255, 0.2);
  color: white;
}

.bar-row.is-today .bar-marker.checkout {
  background: rgba(255, 255, 255, 0.2);
  color: white;
}

.bar-marker i {
  font-size: 14px;
}

/* Bar Calendar Dark Mode */
html.dark-mode .bar-track {
  background: var(--background);
}

html.dark-mode .bar-row.is-today .bar-track {
  background: var(--primary);
}

html.dark-mode .bar-marker.checkin {
  background: rgba(16, 185, 129, 0.2);
}

html.dark-mode .bar-marker.checkout {
  background: rgba(239, 68, 68, 0.2);
}

/* ============================================
   TEAMS CALENDAR (MS365 Style)
   ============================================ */

.teams-calendar {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--border);
}

.teams-day {
  display: flex;
  min-height: 56px;
  border-bottom: 1px solid var(--border);
}

.teams-day.is-today {
  background: rgba(var(--primary-rgb), 0.04);
}

.teams-day-label {
  width: 52px;
  padding: 10px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border-right: 1px solid var(--border);
}

.teams-day-name {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
}

.teams-day.is-today .teams-day-name {
  color: var(--primary);
}

.teams-day-num {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.2;
}

.teams-day.is-today .teams-day-num {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary);
  color: white;
  border-radius: 50%;
}

.teams-day-bar {
  flex: 1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  min-height: 56px;
}

.teams-event {
  display: flex;
  align-items: center;
  height: 32px;
  padding: 0 12px;
  border-radius: 4px;
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  border-left: 3px solid;
  transition: opacity 0.15s ease;
}

.teams-event:hover {
  opacity: 0.85;
}

.teams-event.checkin {
  background: #d1fae5;
  border-left-color: #10b981;
  color: #065f46;
}

.teams-event.checkout {
  background: #fee2e2;
  border-left-color: #ef4444;
  color: #991b1b;
}

.teams-event-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 120px;
}

/* Teams Calendar Dark Mode */
html.dark-mode .teams-event.checkin {
  background: rgba(16, 185, 129, 0.2);
  color: #6ee7b7;
}

html.dark-mode .teams-event.checkout {
  background: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
}

html.dark-mode .teams-day.is-today .teams-day-num {
  background: var(--primary);
  color: white;
}

/* ============================================
   HOSPITALITY METRICS RESPONSIVE
   ============================================ */

@media (max-width: 480px) {
  .occupancy-gauge-container {
    padding: 16px;
  }

  .occupancy-gauge {
    width: 120px;
    height: 120px;
  }

  .occupancy-gauge .gauge-value {
    font-size: 22px;
  }

  .occupancy-stats {
    gap: 24px;
  }

  .occupancy-stat-value {
    font-size: 20px;
  }

  .revenue-display {
    padding: 16px;
  }

  .revenue-amount {
    font-size: 24px;
  }

  .kpi-grid {
    gap: 12px;
  }

  .kpi-item {
    padding: 12px;
  }

  .kpi-value {
    font-size: 18px;
  }
}

/* ============================================
   UTILITY CLASSES
   Global reusable utility classes
   ============================================ */

/* Display Utilities */
.hidden { display: none !important; }
.block { display: block !important; }
.inline { display: inline !important; }
.inline-block { display: inline-block !important; }
.flex { display: flex !important; }
.inline-flex { display: inline-flex !important; }
.grid { display: grid !important; }

/* Visibility */
.visible { visibility: visible !important; }
.invisible { visibility: hidden !important; }

/* Flex Utilities */
.flex-row { flex-direction: row !important; }
.flex-col { flex-direction: column !important; }
.flex-wrap { flex-wrap: wrap !important; }
.flex-nowrap { flex-wrap: nowrap !important; }
.flex-1 { flex: 1 !important; }
.flex-2 { flex: 2 !important; }

/* Modal form rows */
.modal-body .form-row {
  display: flex;
  gap: 16px;
}

.modal-body .form-row .form-group {
  flex: 1;
}

@media (max-width: 576px) {
  .modal-body .form-row {
    flex-direction: column;
    gap: 0;
  }
}
.flex-auto { flex: auto !important; }
.flex-none { flex: none !important; }
.items-start { align-items: flex-start !important; }
.items-center { align-items: center !important; }
.items-end { align-items: flex-end !important; }
.items-stretch { align-items: stretch !important; }
.justify-start { justify-content: flex-start !important; }
.justify-center { justify-content: center !important; }
.justify-end { justify-content: flex-end !important; }
.justify-between { justify-content: space-between !important; }
.justify-around { justify-content: space-around !important; }
.gap-4 { gap: 4px !important; }
.gap-8 { gap: 8px !important; }
.gap-12 { gap: 12px !important; }
.gap-16 { gap: 16px !important; }
.gap-20 { gap: 20px !important; }
.gap-24 { gap: 24px !important; }

/* Margin Utilities */
.m-0 { margin: 0 !important; }
.m-4 { margin: 4px !important; }
.m-8 { margin: 8px !important; }
.m-12 { margin: 12px !important; }
.m-16 { margin: 16px !important; }
.m-auto { margin: auto !important; }

.mt-0 { margin-top: 0 !important; }
.mt-4 { margin-top: 4px !important; }
.mt-8 { margin-top: 8px !important; }
.mt-12 { margin-top: 12px !important; }
.mt-16 { margin-top: 16px !important; }
.mt-20 { margin-top: 20px !important; }
.mt-24 { margin-top: 24px !important; }
.mt-32 { margin-top: 32px !important; }
.mt-40 { margin-top: 40px !important; }
.mt-48 { margin-top: 48px !important; }

.mb-0 { margin-bottom: 0 !important; }
.mb-4 { margin-bottom: 4px !important; }
.mb-8 { margin-bottom: 8px !important; }
.mb-12 { margin-bottom: 12px !important; }
.mb-16 { margin-bottom: 16px !important; }
.mb-20 { margin-bottom: 20px !important; }
.mb-24 { margin-bottom: 24px !important; }
.mb-32 { margin-bottom: 32px !important; }

.ml-0 { margin-left: 0 !important; }
.ml-4 { margin-left: 4px !important; }
.ml-8 { margin-left: 8px !important; }
.ml-12 { margin-left: 12px !important; }
.ml-16 { margin-left: 16px !important; }
.ml-auto { margin-left: auto !important; }

.mr-0 { margin-right: 0 !important; }
.mr-4 { margin-right: 4px !important; }
.mr-8 { margin-right: 8px !important; }
.mr-12 { margin-right: 12px !important; }
.mr-16 { margin-right: 16px !important; }
.mr-auto { margin-right: auto !important; }

.mx-auto { margin-left: auto !important; margin-right: auto !important; }
.my-0 { margin-top: 0 !important; margin-bottom: 0 !important; }
.my-8 { margin-top: 8px !important; margin-bottom: 8px !important; }
.my-16 { margin-top: 16px !important; margin-bottom: 16px !important; }

/* Padding Utilities */
.p-0 { padding: 0 !important; }
.p-4 { padding: 4px !important; }
.p-8 { padding: 8px !important; }
.p-12 { padding: 12px !important; }
.p-16 { padding: 16px !important; }
.p-20 { padding: 20px !important; }
.p-24 { padding: 24px !important; }
.p-32 { padding: 32px !important; }
.p-48 { padding: 48px !important; }

.pt-0 { padding-top: 0 !important; }
.pt-8 { padding-top: 8px !important; }
.pt-16 { padding-top: 16px !important; }
.pt-24 { padding-top: 24px !important; }
.pt-32 { padding-top: 32px !important; }
.pt-48 { padding-top: 48px !important; }
.pt-100 { padding-top: 100px !important; }

.pb-0 { padding-bottom: 0 !important; }
.pb-8 { padding-bottom: 8px !important; }
.pb-16 { padding-bottom: 16px !important; }
.pb-24 { padding-bottom: 24px !important; }

.pl-0 { padding-left: 0 !important; }
.pl-8 { padding-left: 8px !important; }
.pl-16 { padding-left: 16px !important; }

.pr-0 { padding-right: 0 !important; }
.pr-8 { padding-right: 8px !important; }
.pr-16 { padding-right: 16px !important; }

.px-0 { padding-left: 0 !important; padding-right: 0 !important; }
.px-8 { padding-left: 8px !important; padding-right: 8px !important; }
.px-16 { padding-left: 16px !important; padding-right: 16px !important; }
.px-24 { padding-left: 24px !important; padding-right: 24px !important; }

.py-0 { padding-top: 0 !important; padding-bottom: 0 !important; }
.py-8 { padding-top: 8px !important; padding-bottom: 8px !important; }
.py-16 { padding-top: 16px !important; padding-bottom: 16px !important; }

/* Width Utilities */
.w-full { width: 100% !important; }
.w-auto { width: auto !important; }
.w-50 { width: 50px !important; }
.w-60 { width: 60px !important; }
.w-100 { width: 100px !important; }
.w-150 { width: 150px !important; }
.w-200 { width: 200px !important; }
.min-w-0 { min-width: 0 !important; }
.min-w-100 { min-width: 100px !important; }
.min-w-140 { min-width: 140px !important; }
.max-w-100 { max-width: 100px !important; }
.max-w-150 { max-width: 150px !important; }
.max-w-200 { max-width: 200px !important; }
.max-w-300 { max-width: 300px !important; }
.max-w-400 { max-width: 400px !important; }
.max-w-500 { max-width: 500px !important; }

/* Height Utilities */
.h-full { height: 100% !important; }
.h-auto { height: auto !important; }
.h-60 { height: 60px !important; }
.h-100 { height: 100px !important; }
.min-h-0 { min-height: 0 !important; }
.min-h-screen { min-height: 100vh !important; }

/* Text Alignment */
.text-left { text-align: left !important; }
.text-center { text-align: center !important; }
.text-right { text-align: right !important; }

/* Text Decoration */
.no-underline { text-decoration: none !important; }
.underline { text-decoration: underline !important; }
.line-through { text-decoration: line-through !important; }

/* Font Size */
.text-xs { font-size: 0.75rem !important; }
.text-sm { font-size: 0.875rem !important; }
.text-base { font-size: 1rem !important; }
.text-lg { font-size: 1.125rem !important; }
.text-xl { font-size: 1.25rem !important; }
.text-2xl { font-size: 1.5rem !important; }
.text-3xl { font-size: 1.875rem !important; }
.text-4xl { font-size: 2.25rem !important; }

/* Font Weight */
.font-normal { font-weight: 400 !important; }
.font-medium { font-weight: 500 !important; }
.font-semibold { font-weight: 600 !important; }
.font-bold { font-weight: 700 !important; }

/* Text Colors */
.text-inherit { color: inherit !important; }
.text-primary { color: var(--primary) !important; }
.text-secondary { color: var(--text-secondary) !important; }
.text-muted { color: var(--text-muted) !important; }
.text-success { color: var(--success) !important; }
.text-danger { color: var(--danger) !important; }
.text-warning { color: var(--warning) !important; }
.text-info { color: var(--info) !important; }
.text-white { color: white !important; }
.text-gray-400 { color: var(--gray-400, #9ca3af) !important; }
.text-gray-500 { color: var(--gray-500, #6b7280) !important; }
.text-slate-400 { color: #94a3b8 !important; }

/* Background Colors */
.bg-transparent { background: transparent !important; }
.bg-white { background: white !important; }
.bg-primary { background: var(--primary) !important; }
.bg-secondary { background: var(--secondary) !important; }
.bg-success { background: var(--success) !important; }
.bg-danger { background: var(--danger) !important; }
.bg-warning { background: var(--warning) !important; }
.bg-muted { background: var(--bg-secondary) !important; }

/* Border */
.border-0 { border: none !important; }
.border { border: 1px solid var(--border) !important; }
.border-t { border-top: 1px solid var(--border) !important; }
.border-b { border-bottom: 1px solid var(--border) !important; }
.rounded { border-radius: var(--radius) !important; }
.rounded-sm { border-radius: calc(var(--radius) / 2) !important; }
.rounded-lg { border-radius: calc(var(--radius) * 1.5) !important; }
.rounded-xl { border-radius: calc(var(--radius) * 2) !important; }
.rounded-full { border-radius: 9999px !important; }

/* Position */
.relative { position: relative !important; }
.absolute { position: absolute !important; }
.fixed { position: fixed !important; }
.sticky { position: sticky !important; }
.top-0 { top: 0 !important; }
.right-0 { right: 0 !important; }
.bottom-0 { bottom: 0 !important; }
.left-0 { left: 0 !important; }
.inset-0 { top: 0 !important; right: 0 !important; bottom: 0 !important; left: 0 !important; }

/* Overflow */
.overflow-hidden { overflow: hidden !important; }
.overflow-auto { overflow: auto !important; }
.overflow-scroll { overflow: scroll !important; }
.overflow-x-auto { overflow-x: auto !important; }
.overflow-y-auto { overflow-y: auto !important; }

/* Cursor */
.cursor-pointer { cursor: pointer !important; }
.cursor-default { cursor: default !important; }
.cursor-not-allowed { cursor: not-allowed !important; }

/* Opacity */
.opacity-0 { opacity: 0 !important; }
.opacity-50 { opacity: 0.5 !important; }
.opacity-75 { opacity: 0.75 !important; }
.opacity-100 { opacity: 1 !important; }

/* Z-Index */
.z-0 { z-index: 0 !important; }
.z-10 { z-index: 10 !important; }
.z-20 { z-index: 20 !important; }
.z-50 { z-index: 50 !important; }
.z-100 { z-index: 100 !important; }

/* Whitespace */
.whitespace-nowrap { white-space: nowrap !important; }
.whitespace-normal { white-space: normal !important; }
.whitespace-pre { white-space: pre !important; }
.whitespace-pre-wrap { white-space: pre-wrap !important; }

/* Link Unstyled */
.link-unstyled {
  text-decoration: none !important;
  color: inherit !important;
}

.link-unstyled:hover {
  text-decoration: none !important;
  color: inherit !important;
}

/* Icon Sizes */
.icon-sm { font-size: 1rem !important; }
.icon-md { font-size: 1.5rem !important; }
.icon-lg { font-size: 2rem !important; }
.icon-xl { font-size: 3rem !important; }

/* Empty State Icon */
.empty-icon-large {
  font-size: 3rem;
  color: #cbd5e1;
}

/* Category Color Variable */
.category-color-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--cat-color, #6B7280);
}

.category-color-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--cat-color, #6B7280) 15%, transparent);
  color: var(--cat-color, #6B7280);
  font-size: 0.75rem;
  font-weight: 500;
}

/* Progress Bar */
.progress-bar-container {
  width: 100%;
  height: 8px;
  background: var(--bg-secondary);
  border-radius: 4px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.3s ease;
}

/* Feature Icon Box */
.feature-icon-box {
  width: 60px;
  height: 60px;
  background: var(--primary);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 24px;
}

/* Responsive Utilities */
@media (max-width: 768px) {
  .sm\:hidden { display: none !important; }
  .sm\:block { display: block !important; }
  .sm\:flex { display: flex !important; }
  .sm\:flex-col { flex-direction: column !important; }
  .sm\:text-center { text-align: center !important; }
  .sm\:w-full { width: 100% !important; }
}

@media (min-width: 769px) {
  .md\:hidden { display: none !important; }
  .md\:block { display: block !important; }
  .md\:flex { display: flex !important; }
}

/* Additional Height Utilities */
.max-h-32 { max-height: 32px !important; }
.max-h-60 { max-height: 60px !important; }
.max-h-100 { max-height: 100px !important; }
.max-h-150 { max-height: 150px !important; }

/* Background Surface */
.bg-surface { background: var(--surface) !important; }
.bg-background { background: var(--background) !important; }
.bg-soft { background: var(--bg-soft) !important; }

/* Grid Span */
.col-span-full { grid-column: 1 / -1 !important; }
.row-span-full { grid-row: 1 / -1 !important; }

/* Inline Flex with Gap */
.inline-flex-gap-8 {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

/* Pre-wrap text */
.pre-wrap {
  white-space: pre-wrap;
}

/* Dynamic category styling - use CSS variable */
.expense-category-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 500;
  background: color-mix(in srgb, var(--cat-color, #6B7280) 20%, transparent);
  color: var(--cat-color, #6B7280);
}

/* Image preview */
.img-preview-sm {
  max-height: 60px;
  max-width: 100%;
  border-radius: 4px;
  object-fit: contain;
}

.img-preview-md {
  max-height: 100px;
  max-width: 100%;
  border-radius: 8px;
  object-fit: contain;
}

.img-preview-lg {
  max-height: 150px;
  max-width: 100%;
  border-radius: 8px;
  object-fit: contain;
}

/* Additional Margin Utilities */
.mb-24 { margin-bottom: 24px !important; }

/* Text Warning Color */
.text-warning { color: var(--warning) !important; }

/* ===========================================
   FERRY BOOKING STYLES
   =========================================== */

/* Status Tabs */
.status-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.status-tab {
  padding: 8px 16px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  text-decoration: none;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

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

.status-tab.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.status-tab .count {
  background: rgba(255, 255, 255, 0.2);
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 12px;
}

.status-tab.active .count {
  background: rgba(255, 255, 255, 0.3);
}

/* Booking Form Grid */
.booking-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 80px;
}

@media (max-width: 768px) {
  .booking-grid {
    grid-template-columns: 1fr;
  }
}

/* Trip Details Box */
.trip-details-box {
  background: var(--bg-secondary);
  border-radius: var(--radius);
  padding: 12px;
  margin: 12px 0;
}

.trip-details-box:empty {
  display: none;
}

.trip-route {
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.trip-datetime {
  font-size: 14px;
  color: var(--text-muted);
}

/* Pricing Info Box */
.pricing-info-box {
  margin-top: 16px;
}

.pricing-breakdown {
  background: var(--bg-secondary);
  border-radius: var(--radius);
  padding: 12px;
}

.pricing-line {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  font-size: 14px;
  color: var(--text-secondary);
}

.pricing-line.pricing-total {
  border-top: 1px solid var(--border);
  margin-top: 8px;
  padding-top: 12px;
  font-weight: 600;
  color: var(--text-primary);
  font-size: 16px;
}

/* Booking Summary Bar */
.booking-summary-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--card-bg);
  border-top: 1px solid var(--border);
  padding: 16px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 100;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
}

@media (min-width: 769px) {
  .booking-summary-bar {
    left: var(--sidebar-width, 240px);
  }
}

.summary-details {
  display: flex;
  gap: 32px;
}

.summary-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.summary-label {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
}

.summary-value {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}

@media (max-width: 600px) {
  .booking-summary-bar {
    flex-direction: column;
    gap: 12px;
    padding: 12px 16px;
  }

  .summary-details {
    gap: 16px;
    width: 100%;
    justify-content: space-between;
  }

  .booking-summary-bar .btn {
    width: 100%;
  }
}

/* Ghost Button */
.btn-ghost {
  background: transparent;
  color: var(--text-muted);
}

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