/* VyaparBusy Pro - Modern ERP & Billing Design System (Light Theme & Dedicated Sidebar/Header/Footer) */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Outfit:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&family=Noto+Sans+Devanagari:wght@400;500;600;700&display=swap');

:root {
  /* LIGHT THEME (PRIMARY) */
  --bg-app: #f1f5f9;
  --bg-surface: #ffffff;
  --bg-surface-elevated: #f8fafc;
  --bg-card: #ffffff;
  --bg-sidebar: #ffffff;
  --border-subtle: #e2e8f0;
  --border-strong: #cbd5e1;
  
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-glow: rgba(37, 99, 235, 0.18);
  --primary-soft: #eff6ff;
  
  --accent-gold: #d97706;
  --accent-gold-hover: #b45309;
  --accent-gold-glow: rgba(217, 119, 6, 0.18);
  --accent-gold-soft: #fffbeb;
  
  --success: #059669;
  --success-hover: #047857;
  --success-glow: rgba(5, 150, 105, 0.18);
  --success-soft: #ecfdf5;
  
  --danger: #dc2626;
  --danger-hover: #b91c1c;
  --danger-glow: rgba(220, 38, 38, 0.18);
  --danger-soft: #fef2f2;
  
  --purple: #7c3aed;
  --purple-hover: #6d28d9;
  --purple-glow: rgba(124, 58, 237, 0.18);
  --purple-soft: #f5f3ff;
  
  --teal: #0d9488;
  --teal-soft: #f0fdfa;
  
  --text-main: #0f172a;
  --text-muted: #475569;
  --text-dim: #64748b;
  
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans Devanagari", sans-serif;
  --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  
  --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.04);
  --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.06), 0 1px 2px -1px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
  --shadow-glow: 0 0 16px rgba(37, 99, 235, 0.2);
  
  --header-height: 58px;
  --footer-height: 46px;
  --sidebar-width: 250px;
  --sidebar-collapsed-width: 70px;
}

/* Optional Dark Theme Switcher Support */
body.theme-dark {
  --bg-app: #0b1120;
  --bg-surface: #131d33;
  --bg-surface-elevated: #1a2744;
  --bg-card: #131d33;
  --bg-sidebar: #0f172a;
  --border-subtle: #24355a;
  --border-strong: #334b7e;
  
  --primary: #3b82f6;
  --primary-hover: #2563eb;
  --primary-glow: rgba(59, 130, 246, 0.25);
  --primary-soft: rgba(59, 130, 246, 0.15);
  
  --accent-gold: #f59e0b;
  --accent-gold-hover: #d97706;
  --accent-gold-glow: rgba(245, 158, 11, 0.25);
  --accent-gold-soft: rgba(245, 158, 11, 0.15);
  
  --success: #10b981;
  --success-hover: #059669;
  --success-glow: rgba(16, 185, 129, 0.25);
  --success-soft: rgba(16, 185, 129, 0.15);
  
  --danger: #ef4444;
  --danger-hover: #dc2626;
  --danger-glow: rgba(239, 68, 68, 0.25);
  --danger-soft: rgba(239, 68, 68, 0.15);
  
  --purple: #8b5cf6;
  --purple-hover: #7c3aed;
  --purple-glow: rgba(139, 92, 246, 0.25);
  --purple-soft: rgba(139, 92, 246, 0.15);
  
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 16px 36px rgba(0, 0, 0, 0.55);
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-app);
  color: var(--text-main);
  min-height: 100vh;
  line-height: 1.5;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
}

/* ====================================================================
   1. APP HEADER (DEDICATED TOP BAR)
   ==================================================================== */
.app-header {
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  z-index: 1000;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

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

.sidebar-toggle-btn {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  font-size: 16px;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.sidebar-toggle-btn:hover {
  background: var(--border-subtle);
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-logo {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
  color: #ffffff;
}

.brand-title {
  font-family: var(--font-heading);
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.3px;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
  line-height: 1.2;
}

.brand-badge {
  background: var(--accent-gold-soft);
  border: 1px solid rgba(217, 119, 6, 0.3);
  color: var(--accent-gold);
  font-size: 10.5px;
  padding: 1px 6px;
  border-radius: 999px;
  font-weight: 700;
  letter-spacing: 0.3px;
}

.brand-subtitle {
  font-size: 11.5px;
  color: var(--text-muted);
  line-height: 1.2;
  white-space: nowrap;
}

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

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

/* Device & Network Badges */
.device-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  padding: 5px 12px;
  border-radius: var(--radius-lg);
  font-size: 12.5px;
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.2s ease;
  font-weight: 500;
}

.device-badge:hover {
  border-color: var(--primary);
  background: var(--primary-soft);
}

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

.status-dot.offline {
  background-color: var(--danger);
  box-shadow: 0 0 8px var(--danger);
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(0.9); }
}

/* ====================================================================
   2. APP LAYOUT (SIDEBAR + MAIN WORKSPACE)
   ==================================================================== */
.app-layout {
  display: flex;
  flex: 1;
  position: relative;
  min-height: calc(100vh - var(--header-height) - var(--footer-height));
}

/* Distinct Sidebar */
.app-sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: var(--header-height);
  height: calc(100vh - var(--header-height) - var(--footer-height));
  overflow-y: auto;
  transition: width 0.2s ease, transform 0.2s ease;
  z-index: 500;
  box-shadow: 1px 0 3px rgba(0, 0, 0, 0.02);
}

.app-sidebar::-webkit-scrollbar {
  width: 5px;
}
.app-sidebar::-webkit-scrollbar-thumb {
  background: var(--border-subtle);
  border-radius: 4px;
}

.app-sidebar.collapsed {
  width: var(--sidebar-collapsed-width);
  min-width: var(--sidebar-collapsed-width);
}

.app-sidebar.collapsed .nav-text,
.app-sidebar.collapsed .nav-shortcut,
.app-sidebar.collapsed .nav-group-title,
.app-sidebar.collapsed .sidebar-bottom-info {
  display: none !important;
}

.app-sidebar.collapsed .nav-tab {
  justify-content: center;
  padding: 10px 0;
}

.sidebar-content {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 10px 8px;
  gap: 4px;
}

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

.nav-group-title {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-dim);
  padding: 12px 10px 4px;
}

/* Sidebar Nav Tab Buttons */
.sidebar-nav .nav-tab {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-size: 13.5px;
  font-weight: 600;
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: left;
  width: 100%;
  position: relative;
  user-select: none;
}

.sidebar-nav .nav-tab:hover {
  background: var(--bg-surface-elevated);
  color: var(--text-main);
  border-color: var(--border-subtle);
}

.sidebar-nav .nav-tab.active {
  background: var(--primary-soft);
  color: var(--primary);
  border-color: rgba(37, 99, 235, 0.25);
  font-weight: 700;
  box-shadow: 0 1px 2px rgba(37, 99, 235, 0.08);
}

.sidebar-nav .nav-tab.highlight {
  color: var(--accent-gold);
}

.sidebar-nav .nav-tab.highlight.active {
  background: var(--accent-gold-soft);
  color: var(--accent-gold);
  border-color: rgba(217, 119, 6, 0.3);
}

.nav-icon {
  font-size: 17px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  flex-shrink: 0;
}

.nav-text {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.1px;
}

.nav-shortcut {
  font-size: 10px;
  font-family: var(--font-mono);
  font-weight: 700;
  padding: 2px 5px;
  border-radius: 4px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
}

.sidebar-nav .nav-tab.active .nav-shortcut {
  background: rgba(37, 99, 235, 0.15);
  border-color: rgba(37, 99, 235, 0.25);
  color: var(--primary);
}

/* Sidebar Bottom Quick Card */
.sidebar-bottom-info {
  margin-top: auto;
  padding-top: 10px;
}

.sidebar-info-card {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px;
  font-size: 11.5px;
}

.info-label {
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.info-keys {
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 10.5px;
  line-height: 1.4;
}

/* ====================================================================
   3. MAIN WORKSPACE AREA (.app-container)
   ==================================================================== */
.app-container {
  flex: 1;
  padding: 20px 24px;
  max-width: 100%;
  overflow-x: hidden;
  padding-bottom: 70px;
}

/* View Section Switching */
.view-section {
  display: none !important;
  animation: fadeIn 0.15s ease-out;
}

.view-section.active {
  display: block !important;
}

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

/* ====================================================================
   4. APP FOOTER (DEDICATED BOTTOM STATUS & SHORTCUT BAR)
   ==================================================================== */
.app-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--footer-height);
  background: var(--bg-surface);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  z-index: 900;
  box-shadow: 0 -1px 3px rgba(0, 0, 0, 0.04);
}

.footer-left {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
  white-space: nowrap;
}

.footer-status-indicator {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: var(--success);
  display: inline-block;
}

.footer-divider {
  color: var(--border-strong);
}

.footer-center {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex: 1;
}

.footer-right {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 11.5px;
  color: var(--text-dim);
  white-space: nowrap;
}

/* ====================================================================
   5. FUNCTION KEY BUTTONS (BUSY / TALLY 1-CLICK BAR)
   ==================================================================== */
.fkeys-container {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
}

.fkey-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  color: var(--text-main);
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
  white-space: nowrap;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.fkey-btn:hover {
  background: var(--bg-surface-elevated);
  border-color: var(--primary);
  transform: translateY(-1px);
}

.fkey-btn:active, .fkey-btn.pressed {
  transform: translateY(1px);
  filter: brightness(0.95);
}

.fkey-tag {
  background: var(--bg-surface-elevated);
  padding: 1px 5px;
  border-radius: 3px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 800;
  border: 1px solid var(--border-strong);
  color: var(--text-main);
}

.fkey-btn.primary {
  background: #2563eb;
  border-color: #1d4ed8;
  color: #ffffff;
}
.fkey-btn.primary:hover {
  background: #1d4ed8;
}
.fkey-btn.primary .fkey-tag {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.35);
  color: #ffffff;
}

.fkey-btn.voice {
  background: #7c3aed;
  border-color: #6d28d9;
  color: #ffffff;
}
.fkey-btn.voice:hover {
  background: #6d28d9;
}
.fkey-btn.voice .fkey-tag {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.35);
  color: #ffffff;
}

.fkey-btn.cross {
  background: #d97706;
  border-color: #b45309;
  color: #ffffff;
}
.fkey-btn.cross:hover {
  background: #b45309;
}
.fkey-btn.cross .fkey-tag {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.35);
  color: #ffffff;
}

.fkey-btn.tracker {
  background: #0284c7;
  border-color: #0369a1;
  color: #ffffff;
}
.fkey-btn.tracker:hover {
  background: #0369a1;
}
.fkey-btn.tracker .fkey-tag {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.35);
  color: #ffffff;
}

.fkey-btn.ledger {
  background: #059669;
  border-color: #047857;
  color: #ffffff;
}
.fkey-btn.ledger:hover {
  background: #047857;
}
.fkey-btn.ledger .fkey-tag {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.35);
  color: #ffffff;
}

.fkey-btn.default {
  background: var(--bg-surface-elevated);
  border-color: var(--border-subtle);
  color: var(--text-muted);
}
.fkey-btn.default:hover {
  background: var(--border-subtle);
  color: var(--text-main);
}

/* ====================================================================
   6. BUTTONS & UI COMPONENTS
   ==================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  border: none;
  font-family: inherit;
  white-space: nowrap;
}

.btn-sm {
  padding: 5px 10px;
  font-size: 12px;
  border-radius: var(--radius-sm);
}

.btn-lg {
  padding: 10px 20px;
  font-size: 14.5px;
  border-radius: var(--radius-md);
}

.btn-primary {
  background: #2563eb;
  color: #ffffff;
  box-shadow: 0 1px 3px rgba(37, 99, 235, 0.25);
}

.btn-primary:hover {
  background: #1d4ed8;
  box-shadow: 0 3px 6px rgba(37, 99, 235, 0.35);
}

.btn-voice {
  background: #7c3aed;
  color: #ffffff;
  box-shadow: 0 1px 3px rgba(124, 58, 237, 0.25);
}

.btn-voice:hover {
  background: #6d28d9;
}

.btn-cross {
  background: #d97706;
  color: #ffffff;
  box-shadow: 0 1px 3px rgba(217, 119, 6, 0.25);
}

.btn-cross:hover {
  background: #b45309;
}

.btn-success {
  background: #059669;
  color: #ffffff;
  box-shadow: 0 1px 3px rgba(5, 150, 105, 0.25);
}

.btn-success:hover {
  background: #047857;
}

.btn-danger {
  background: #dc2626;
  color: #ffffff;
  box-shadow: 0 1px 3px rgba(220, 38, 38, 0.25);
}

.btn-danger:hover {
  background: #b91c1c;
}

.btn-secondary {
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  color: var(--text-main);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.btn-secondary:hover {
  background: var(--bg-surface-elevated);
  border-color: var(--text-dim);
}

/* Offline / Roaming Banner */
.offline-banner {
  background: #dc2626;
  color: #ffffff;
  padding: 6px 18px;
  font-size: 12.5px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 600;
}

/* ====================================================================
   7. DASHBOARD KPIS & ACTION BARS
   ==================================================================== */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  position: relative;
  overflow: hidden;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
}

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

.kpi-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--kpi-accent, var(--primary));
}

.kpi-card.receivable { --kpi-accent: #2563eb; }
.kpi-card.payable { --kpi-accent: #dc2626; }
.kpi-card.sales { --kpi-accent: #059669; }
.kpi-card.cross { --kpi-accent: #d97706; }
.kpi-card.devices { --kpi-accent: #7c3aed; }

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

.kpi-title {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-muted);
}

.kpi-icon {
  font-size: 18px;
}

.kpi-value {
  font-family: var(--font-heading);
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--text-main);
  margin-bottom: 3px;
}

.kpi-meta {
  font-size: 11.5px;
  color: var(--text-dim);
}

/* Quick Action Bar */
.quick-action-bar {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
  box-shadow: var(--shadow-sm);
}

.action-buttons-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* Common Card & Panel */
.content-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}

.card-title-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-subtle);
  gap: 12px;
}

.card-title {
  font-family: var(--font-heading);
  font-size: 17px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-main);
}

/* ====================================================================
   8. FORMS, INPUTS & CONTROLS
   ==================================================================== */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

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

.form-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
}

.form-input, .form-select, .form-textarea {
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  color: var(--text-main);
  padding: 8px 11px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-family: inherit;
  transition: all 0.15s ease;
  width: 100%;
}

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

.form-select option {
  background: var(--bg-surface);
  color: var(--text-main);
}

/* ====================================================================
   9. TABLES & DATA LISTS
   ==================================================================== */
.items-table-wrapper {
  overflow-x: auto;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  margin-bottom: 16px;
  background: var(--bg-surface);
  box-shadow: var(--shadow-xs);
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  text-align: left;
}

.table th {
  background: var(--bg-surface-elevated);
  color: var(--text-muted);
  font-weight: 700;
  padding: 9px 12px;
  border-bottom: 1px solid var(--border-subtle);
  white-space: nowrap;
}

.table td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-main);
}

.table tr:hover td {
  background: var(--bg-surface-elevated);
}

.table-input {
  background: var(--bg-surface);
  border: 1.5px solid var(--border-strong);
  color: var(--text-main);
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 600;
  width: 100%;
  transition: all 0.15s ease;
}

.table-input:hover {
  border-color: #38bdf8;
}

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

.item-qty, .item-disc, .item-rate {
  font-size: 14.5px !important;
  font-weight: 700 !important;
}

/* Billing Totals Panel */
.bill-summary-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 20px;
  margin-top: 16px;
}

.bill-totals-box {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
}

.total-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  padding: 5px 0;
  color: var(--text-muted);
}

.total-row.grand {
  border-top: 1px solid var(--border-strong);
  margin-top: 8px;
  padding-top: 8px;
  font-size: 17px;
  font-weight: 800;
  color: var(--primary);
  font-family: var(--font-heading);
}

/* ====================================================================
   10. CROSS-PARTY (HAWALA) & VOICE COMPONENTS
   ==================================================================== */
.cross-diagram-box {
  background: var(--bg-surface);
  border: 1px solid rgba(217, 119, 6, 0.3);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 20px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.cross-diagram-box::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #d97706, #2563eb);
}

.flow-steps-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr;
  align-items: center;
  gap: 14px;
  margin: 16px 0;
}

.flow-card {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px;
  text-align: center;
}

.flow-card.payer {
  border-color: rgba(37, 99, 235, 0.4);
  background: var(--primary-soft);
}

.flow-card.receiver {
  border-color: rgba(5, 150, 105, 0.4);
  background: var(--success-soft);
}

.flow-card.middle {
  border-color: rgba(217, 119, 6, 0.4);
  background: var(--accent-gold-soft);
}

.flow-arrow {
  font-size: 20px;
  color: var(--accent-gold);
  animation: floatArrow 1.5s infinite alternate ease-in-out;
}

@keyframes floatArrow {
  from { transform: translateX(-3px); }
  to { transform: translateX(3px); }
}

.impact-alert {
  background: var(--accent-gold-soft);
  border-left: 4px solid var(--accent-gold);
  padding: 10px 14px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 12.5px;
  color: #92400e;
  margin-top: 12px;
  line-height: 1.5;
}

/* Voice UI */
.voice-hero-card {
  background: var(--bg-surface-elevated);
  border: 1px solid rgba(124, 58, 237, 0.3);
  border-radius: var(--radius-lg);
  padding: 24px;
  text-align: center;
  margin-bottom: 20px;
  position: relative;
  overflow: hidden;
}

.voice-mic-circle {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, #7c3aed, #6d28d9);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 34px;
  margin: 0 auto 14px;
  cursor: pointer;
  box-shadow: 0 0 25px var(--purple-glow);
  transition: all 0.3s ease;
  color: #ffffff;
}

.voice-mic-circle.recording {
  animation: pulse-mic 1.2s infinite;
  background: linear-gradient(135deg, #dc2626, #b91c1c);
  box-shadow: 0 0 30px var(--danger-glow);
}

@keyframes pulse-mic {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.6); }
  70% { transform: scale(1.08); box-shadow: 0 0 0 16px rgba(220, 38, 38, 0); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(220, 38, 38, 0); }
}

.voice-transcript-bubble {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 18px;
  max-width: 580px;
  margin: 12px auto 0;
  font-size: 14px;
  color: var(--text-main);
  min-height: 44px;
  box-shadow: var(--shadow-xs);
}

/* ====================================================================
   11. MODALS & POPUPS
   ==================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(6px);
  z-index: 2000;
  display: none !important;
  pointer-events: none !important;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay.active {
  display: flex !important;
  pointer-events: auto !important;
}

.modal-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 700px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  padding: 22px;
  position: relative;
  animation: modalScale 0.2s ease-out;
}

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

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

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 22px;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
}

.modal-close:hover {
  background: var(--bg-surface-elevated);
  color: var(--text-main);
}

/* ====================================================================
   12. TOASTS & BADGES
   ==================================================================== */
.toast-container {
  position: fixed;
  bottom: calc(var(--footer-height) + 16px);
  right: 20px;
  z-index: 2500;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  padding: 10px 18px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  gap: 8px;
  animation: slideToast 0.2s ease-out;
  color: var(--text-main);
}

.toast.success { border-left: 4px solid var(--success); }
.toast.error { border-left: 4px solid var(--danger); }
.toast.info { border-left: 4px solid var(--primary); }
.toast.gold { border-left: 4px solid var(--accent-gold); }

@keyframes slideToast {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}

.badge-dr {
  background: var(--primary-soft);
  color: var(--primary);
  border: 1px solid rgba(37, 99, 235, 0.25);
}

.badge-cr {
  background: var(--danger-soft);
  color: var(--danger);
  border: 1px solid rgba(220, 38, 38, 0.25);
}

.badge-gold {
  background: var(--accent-gold-soft);
  color: var(--accent-gold);
  border: 1px solid rgba(217, 119, 6, 0.25);
}

.badge-green {
  background: var(--success-soft);
  color: var(--success);
  border: 1px solid rgba(5, 150, 105, 0.25);
}

.kbd-chip {
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  padding: 1px 5px;
  font-size: 10px;
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--text-muted);
}

/* Suppress Google Translate frame */
.goog-te-banner-frame, #goog-gt-tt, .goog-te-balloon-frame {
  display: none !important;
  pointer-events: none !important;
  visibility: hidden !important;
}

/* ====================================================================
   13. RESPONSIVE MEDIA QUERIES
   ==================================================================== */
@media (max-width: 1024px) {
  .app-sidebar {
    width: 220px;
    min-width: 220px;
  }
  .bill-summary-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 820px) {
  .app-sidebar {
    position: fixed;
    top: var(--header-height);
    bottom: var(--footer-height);
    left: 0;
    z-index: 1500;
    transform: translateX(-100%);
    box-shadow: 4px 0 16px rgba(0, 0, 0, 0.15);
  }
  
  .app-sidebar.mobile-open {
    transform: translateX(0);
  }
  
  .footer-center {
    display: none;
  }
  
  .brand-subtitle {
    display: none;
  }
}

/* ====================================================================
   14. PRINT STYLES
   ==================================================================== */
@media print {
  @page {
    margin: 8mm;
    size: A4 portrait;
  }
  body {
    background: #ffffff !important;
    color: #000000 !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  .app-header, .app-sidebar, .app-footer, .quick-action-bar, .btn, .modal-close, .toast-container, .no-print {
    display: none !important;
  }
  .app-layout {
    display: block !important;
  }
  .app-container {
    padding: 0 !important;
  }
  .modal-overlay {
    position: static !important;
    background: none !important;
    display: block !important;
    padding: 0 !important;
    margin: 0 !important;
  }
  .modal-card {
    border: none !important;
    box-shadow: none !important;
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
  }
  .photo-bill-sheet {
    border: 1.5px solid #000000 !important;
    page-break-inside: auto !important;
  }
  .photo-bill-sheet table {
    page-break-after: auto !important;
  }
  .photo-bill-sheet thead {
    display: table-header-group !important;
  }
  .photo-bill-sheet tr {
    page-break-inside: avoid !important;
  }
}

/* Voice Live Billing Controller Styles */
.voice-bill-live-bar {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.08), rgba(59, 130, 246, 0.08));
  border: 1.5px solid #10b981;
  border-radius: var(--radius-md);
  padding: 12px 16px;
  margin-bottom: 14px;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.15);
  animation: fadeInDown 0.25s ease-out;
}

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

.live-mic-pulse {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #10b981;
  color: white;
  font-size: 18px;
  animation: micPulseGlow 1.4s infinite;
}

@keyframes micPulseGlow {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.6); }
  70% { box-shadow: 0 0 0 12px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.voice-added-row {
  animation: highlightNewRow 2s ease-out;
}

@keyframes highlightNewRow {
  0% { background-color: rgba(16, 185, 129, 0.35); }
  100% { background-color: transparent; }
}

.voice-history-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #065f46;
  font-size: 11.5px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.field-voice-highlight {
  outline: 2.5px solid #10b981 !important;
  box-shadow: 0 0 14px rgba(16, 185, 129, 0.7) !important;
  background-color: rgba(16, 185, 129, 0.18) !important;
  border-color: #10b981 !important;
  transition: all 0.35s ease;
}

.voice-streaming-row {
  animation: pulseStreamingRow 1.2s infinite ease-in-out;
}

@keyframes pulseStreamingRow {
  0%, 100% { background-color: rgba(16, 185, 129, 0.08); }
  50% { background-color: rgba(16, 185, 129, 0.22); }
}

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

.typing-cursor {
  display: inline-block;
  color: #0284c7;
  font-weight: 900;
  animation: blinkCursor 0.75s infinite;
  margin-left: 3px;
}

.voice-billing-card {
  transition: all 0.3s ease;
}

.btn-mic-active {
  background: #dc2626 !important;
  border-color: #b91c1c !important;
  color: #ffffff !important;
  animation: micActivePulse 1.2s infinite ease-in-out !important;
  box-shadow: 0 0 18px rgba(220, 38, 38, 0.6) !important;
}

@keyframes micActivePulse {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.7); }
  50% { transform: scale(1.03); box-shadow: 0 0 0 12px rgba(220, 38, 38, 0); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(220, 38, 38, 0); }
}

#billPartySearchInput:focus {
  border-color: #10b981 !important;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.25) !important;
  outline: none !important;
}

/* Active Cell Highlight for Voice & Touch ("कोष्ठक में उंगली रखी") */
.cell-active-voice {
  border-color: #10b981 !important;
  outline: 3px solid #10b981 !important;
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.45) !important;
  background: #f0fdf4 !important;
  position: relative;
  z-index: 5;
  transition: all 0.2s ease;
}

@keyframes cellFlashSuccess {
  0% { background: #bbf7d0 !important; transform: scale(1.05); }
  50% { background: #86efac !important; transform: scale(1.08); }
  100% { background: #f0fdf4 !important; transform: scale(1); }
}

.cell-flash-success {
  animation: cellFlashSuccess 0.8s ease-in-out !important;
}

/* Autocomplete Suggestions Box for Party & Item Fast Search */
.autocomplete-dropdown {
  background: #ffffff;
  border: 2px solid #059669;
  border-radius: 8px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.25), 0 8px 10px -6px rgba(0, 0, 0, 0.15);
  overflow-y: auto;
  z-index: 99999;
}

.suggest-item {
  padding: 9px 12px;
  cursor: pointer;
  border-bottom: 1px solid #f1f5f9;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.12s ease;
  user-select: none;
}

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

.suggest-item:hover,
.suggest-item.highlighted {
  background: #ecfdf5 !important;
  border-left: 4px solid #059669 !important;
  padding-left: 14px;
}

.suggest-item-name {
  font-weight: 800;
  font-size: 14px;
  color: #0f172a;
}

.suggest-item-meta {
  font-size: 11.5px;
  color: #64748b;
  margin-top: 2px;
}

.suggest-item-badge {
  font-size: 11.5px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 4px;
  white-space: nowrap;
}


