/* ==========================================================================
   VELNOX TRADING AND SERVICES PVT LTD
   AI Accounting Agent - Ultra-Premium Dark Glassmorphic Theme
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Noto+Sans+Malayalam:wght@400;500;600;700&display=swap');

:root {
  /* Color Palette */
  --bg-deep: #0a0e1a;
  --bg-darker: #060911;
  --bg-surface: #0f1629;
  --bg-card: rgba(16, 24, 46, 0.65);
  --bg-card-hover: rgba(22, 33, 62, 0.8);
  
  /* Primary & Accents */
  --primary-cyan: #00d4ff;
  --primary-cyan-dim: rgba(0, 212, 255, 0.15);
  --primary-cyan-bright: #38e1ff;
  --accent-gold: #ffd700;
  --accent-gold-dim: rgba(255, 215, 0, 0.15);
  --accent-gold-bright: #ffe033;
  
  /* Status Colors */
  --color-success: #00ff88;
  --color-success-dim: rgba(0, 255, 136, 0.15);
  --color-danger: #ff4444;
  --color-danger-dim: rgba(255, 68, 68, 0.15);
  --color-warning: #ffaa00;
  --color-warning-dim: rgba(255, 170, 0, 0.15);
  --color-info: #3b82f6;
  --color-purple: #a855f7;

  /* Glassmorphism */
  --glass-bg: rgba(255, 255, 255, 0.04);
  --glass-bg-hover: rgba(255, 255, 255, 0.08);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-border-focus: rgba(0, 212, 255, 0.5);
  --glass-border-gold: rgba(255, 215, 0, 0.4);
  --glass-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.05);
  --glass-blur: blur(16px);

  /* Glow Effects */
  --cyan-glow: 0 0 20px rgba(0, 212, 255, 0.35);
  --cyan-glow-strong: 0 0 30px rgba(0, 212, 255, 0.6);
  --gold-glow: 0 0 20px rgba(255, 215, 0, 0.35);

  /* Typography */
  --font-ui: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-ml: 'Noto Sans Malayalam', 'Inter', sans-serif;
  
  --text-primary: #f0f6fc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-white: #ffffff;

  /* Layout */
  --header-height: 64px;
  --bottom-nav-height: 72px;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;
  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-smooth: 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Reset & Box Sizing */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  height: 100%;
  overflow-x: hidden;
  background-color: var(--bg-deep);
  color: var(--text-primary);
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Malayalam Text Class */
.ml-text {
  font-family: var(--font-ml);
  line-height: 1.6;
}

/* Ambient Animated Background Mesh */
body::before {
  content: '';
  position: fixed;
  top: -20%;
  left: -20%;
  width: 140%;
  height: 140%;
  z-index: -1;
  background: 
    radial-gradient(circle at 15% 25%, rgba(0, 212, 255, 0.12) 0%, transparent 40%),
    radial-gradient(circle at 85% 75%, rgba(255, 215, 0, 0.08) 0%, transparent 45%),
    radial-gradient(circle at 50% 50%, rgba(168, 85, 247, 0.06) 0%, transparent 50%),
    linear-gradient(180deg, var(--bg-deep) 0%, #080c17 100%);
  animation: ambientFloat 18s ease-in-out infinite alternate;
  pointer-events: none;
}

@keyframes ambientFloat {
  0% { transform: scale(1) translate(0, 0); }
  50% { transform: scale(1.04) translate(-2%, 2%); }
  100% { transform: scale(1.02) translate(2%, -2%); }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 212, 255, 0.4);
}

/* ==========================================================================
   App Shell & Layout
   ========================================================================== */
#app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  position: relative;
  max-width: 600px; /* Optimal mobile-first container centered on desktop */
  margin: 0 auto;
  border-left: 1px solid rgba(255, 255, 255, 0.03);
  border-right: 1px solid rgba(255, 255, 255, 0.03);
  background: rgba(10, 14, 26, 0.4);
  box-shadow: 0 0 50px rgba(0, 0, 0, 0.8);
}

@media (min-width: 992px) {
  #app {
    max-width: 760px;
  }
}

/* App Header */
#app-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
  padding: 0 16px;
  background: rgba(10, 14, 26, 0.85);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-bottom: 1px solid var(--glass-border);
}

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

.brand-logo {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--primary-cyan), #0077ff);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--cyan-glow);
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}

.brand-logo svg {
  width: 22px;
  height: 22px;
  fill: #060911;
}

.brand-logo::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    60deg,
    transparent,
    rgba(255, 255, 255, 0.4),
    transparent
  );
  transform: rotate(30deg);
  animation: logoShine 6s infinite;
}

@keyframes logoShine {
  0%, 80% { transform: translateX(-150%) rotate(30deg); }
  100% { transform: translateX(150%) rotate(30deg); }
}

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

.brand-title {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--text-white);
  display: flex;
  align-items: center;
  gap: 6px;
}

.brand-title .brand-accent {
  background: linear-gradient(135deg, var(--primary-cyan), var(--accent-gold));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-subtitle {
  font-size: 10px;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 600;
}

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

/* Connection Status Badge */
.connection-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition-fast);
}

.connection-badge:hover {
  background: var(--glass-bg-hover);
  border-color: rgba(255, 255, 255, 0.15);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--color-warning);
  box-shadow: 0 0 8px var(--color-warning);
  transition: var(--transition-fast);
}

.status-dot.online {
  background-color: var(--color-success);
  box-shadow: 0 0 8px var(--color-success);
  animation: pulseDot 2s infinite;
}

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

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

/* Language Switcher Button */
.lang-toggle-btn {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  color: var(--primary-cyan);
  border-radius: var(--radius-full);
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: var(--transition-fast);
}

.lang-toggle-btn:hover {
  background: var(--primary-cyan-dim);
  border-color: var(--primary-cyan);
  box-shadow: var(--cyan-glow);
}

/* Main Content Area */
#main-content {
  flex: 1;
  padding: 16px 16px calc(var(--bottom-nav-height) + 24px) 16px;
  overflow-y: auto;
  position: relative;
}

/* Bottom Navigation Bar */
#bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 600px;
  height: var(--bottom-nav-height);
  background: rgba(10, 14, 26, 0.88);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-top: 1px solid var(--glass-border);
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 0 8px;
  z-index: 50;
  box-shadow: 0 -10px 25px rgba(0, 0, 0, 0.4);
}

@media (min-width: 992px) {
  #bottom-nav {
    max-width: 760px;
  }
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  flex: 1;
  min-height: 48px;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition-fast);
  position: relative;
  text-decoration: none;
}

.nav-item svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: var(--transition-fast);
}

.nav-item:hover {
  color: var(--text-white);
}

.nav-item.active {
  color: var(--primary-cyan);
}

.nav-item.active svg {
  transform: translateY(-2px);
  filter: drop-shadow(0 0 8px rgba(0, 212, 255, 0.6));
}

.nav-item .nav-pip {
  position: absolute;
  top: 4px;
  width: 16px;
  height: 3px;
  background: var(--primary-cyan);
  border-radius: var(--radius-full);
  box-shadow: var(--cyan-glow);
  opacity: 0;
  transition: var(--transition-fast);
}

.nav-item.active .nav-pip {
  opacity: 1;
}

/* Floating Center Action Button in Nav (New Voucher) */
.nav-item.nav-special {
  position: relative;
  top: -12px;
}

.nav-special-btn {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-cyan), #0066cc);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(0, 212, 255, 0.4), inset 0 1px 1px rgba(255, 255, 255, 0.6);
  color: #060911 !important;
  border: 3px solid var(--bg-deep);
  transition: var(--transition-fast);
}

.nav-special-btn svg {
  width: 24px;
  height: 24px;
  stroke: #060911;
  stroke-width: 2.5;
}

.nav-item.nav-special:hover .nav-special-btn,
.nav-item.nav-special.active .nav-special-btn {
  transform: scale(1.08);
  box-shadow: 0 6px 25px rgba(0, 212, 255, 0.7);
}

/* ==========================================================================
   Glass Cards & Containers
   ========================================================================== */
.glass-card {
  background: var(--bg-card);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 18px;
  margin-bottom: 16px;
  box-shadow: var(--glass-shadow);
  position: relative;
  overflow: hidden;
  transition: var(--transition-smooth);
}

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

.glass-card.card-interactive:hover {
  border-color: rgba(0, 212, 255, 0.3);
  box-shadow: 0 12px 35px -5px rgba(0, 0, 0, 0.7), 0 0 15px rgba(0, 212, 255, 0.15);
  transform: translateY(-2px);
}

.glass-card.highlight-cyan {
  border-left: 3px solid var(--primary-cyan);
}

.glass-card.highlight-gold {
  border-left: 3px solid var(--accent-gold);
}

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

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

.card-title svg {
  width: 18px;
  height: 18px;
  stroke: var(--primary-cyan);
}

/* ==========================================================================
   Status Badges
   (DRAFT, APPROVED, CLAIMED, POSTING, POSTED, REJECTED, POSTING_UNCERTAIN)
   ========================================================================== */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  white-space: nowrap;
}

.badge-DRAFT {
  background: rgba(148, 163, 184, 0.12);
  color: #cbd5e1;
  border: 1px solid rgba(148, 163, 184, 0.25);
}

.badge-APPROVED {
  background: rgba(0, 212, 255, 0.12);
  color: var(--primary-cyan);
  border: 1px solid rgba(0, 212, 255, 0.35);
  box-shadow: 0 0 8px rgba(0, 212, 255, 0.2);
}

.badge-CLAIMED {
  background: rgba(168, 85, 247, 0.12);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.3);
}

.badge-POSTING {
  background: rgba(255, 170, 0, 0.12);
  color: var(--color-warning);
  border: 1px solid rgba(255, 170, 0, 0.35);
  animation: pulsePosting 1.5s infinite;
}

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

.badge-POSTED {
  background: rgba(0, 255, 136, 0.12);
  color: var(--color-success);
  border: 1px solid rgba(0, 255, 136, 0.35);
  box-shadow: 0 0 10px rgba(0, 255, 136, 0.2);
}

.badge-REJECTED {
  background: rgba(255, 68, 68, 0.12);
  color: var(--color-danger);
  border: 1px solid rgba(255, 68, 68, 0.35);
}

.badge-POSTING_UNCERTAIN {
  background: rgba(255, 215, 0, 0.12);
  color: var(--accent-gold);
  border: 1px solid rgba(255, 215, 0, 0.4);
  box-shadow: 0 0 8px rgba(255, 215, 0, 0.2);
}

/* ==========================================================================
   Voice Assistant & Pulse Animation
   ========================================================================== */
.voice-hero-card {
  text-align: center;
  padding: 24px 16px;
  background: radial-gradient(circle at 50% 20%, rgba(0, 212, 255, 0.12), transparent 70%), var(--bg-card);
  border: 1px solid rgba(0, 212, 255, 0.2);
}

.voice-btn-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 16px 0 20px 0;
  position: relative;
}

.voice-pulse-btn {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-cyan), #0055ff);
  border: none;
  outline: none;
  color: #060911;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  box-shadow: 0 6px 25px rgba(0, 212, 255, 0.45);
  transition: var(--transition-smooth);
  z-index: 2;
}

.voice-pulse-btn svg {
  width: 36px;
  height: 36px;
  stroke: #060911;
  stroke-width: 2.2;
}

.voice-pulse-btn:hover {
  transform: scale(1.06);
  box-shadow: 0 8px 32px rgba(0, 212, 255, 0.6);
}

.voice-pulse-btn:active {
  transform: scale(0.96);
}

/* Voice Listening Active Pulse Waves */
.voice-pulse-btn.listening {
  background: linear-gradient(135deg, #ff3366, #ff0044);
  box-shadow: 0 0 35px rgba(255, 51, 102, 0.8);
}

.voice-pulse-btn.listening svg {
  stroke: #ffffff;
}

.voice-rings {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 80px;
  height: 80px;
  pointer-events: none;
  z-index: 1;
}

.voice-ring {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 2px solid var(--primary-cyan);
  opacity: 0;
}

.listening ~ .voice-rings .voice-ring:nth-child(1) {
  animation: rippleRing 2s cubic-bezier(0.1, 0.2, 0.3, 1) infinite;
  border-color: #ff3366;
}
.listening ~ .voice-rings .voice-ring:nth-child(2) {
  animation: rippleRing 2s cubic-bezier(0.1, 0.2, 0.3, 1) infinite 0.6s;
  border-color: #ff3366;
}
.listening ~ .voice-rings .voice-ring:nth-child(3) {
  animation: rippleRing 2s cubic-bezier(0.1, 0.2, 0.3, 1) infinite 1.2s;
  border-color: #ff3366;
}

@keyframes rippleRing {
  0% { transform: scale(1); opacity: 0.8; }
  100% { transform: scale(2.4); opacity: 0; }
}

/* Audio Waveform Bars */
.audio-wave {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 24px;
  margin-top: 10px;
  opacity: 0;
  transition: var(--transition-fast);
}

.audio-wave.active {
  opacity: 1;
}

.wave-bar {
  width: 4px;
  height: 8px;
  background: var(--primary-cyan);
  border-radius: var(--radius-full);
  animation: waveBar 1.2s ease-in-out infinite;
}

.wave-bar:nth-child(2) { animation-delay: 0.15s; }
.wave-bar:nth-child(3) { animation-delay: 0.3s; height: 16px; }
.wave-bar:nth-child(4) { animation-delay: 0.45s; height: 20px; }
.wave-bar:nth-child(5) { animation-delay: 0.6s; height: 14px; }
.wave-bar:nth-child(6) { animation-delay: 0.75s; }

@keyframes waveBar {
  0%, 100% { height: 6px; }
  50% { height: 22px; background: var(--accent-gold); }
}

.live-transcript-box {
  min-height: 44px;
  padding: 10px 14px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: var(--radius-sm);
  border: 1px dashed var(--glass-border);
  color: var(--text-primary);
  font-size: 13.5px;
  margin-top: 12px;
  text-align: center;
  word-break: break-word;
}

.live-transcript-box.interim {
  color: var(--primary-cyan);
  font-style: italic;
}

/* ==========================================================================
   Metrics Grid & Stat Cards
   ========================================================================== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

.stat-card {
  background: var(--bg-card);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 14px;
  position: relative;
  overflow: hidden;
  transition: var(--transition-fast);
}

.stat-card:hover {
  border-color: rgba(255, 255, 255, 0.15);
  transform: translateY(-2px);
}

.stat-label {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.stat-value {
  font-size: 24px;
  font-weight: 800;
  color: var(--text-white);
  line-height: 1.1;
  font-family: var(--font-ui);
}

.stat-subtext {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}

.stat-gold .stat-value {
  color: var(--accent-gold);
  text-shadow: 0 0 15px rgba(255, 215, 0, 0.3);
}

.stat-green .stat-value {
  color: var(--color-success);
  text-shadow: 0 0 15px rgba(0, 255, 136, 0.3);
}

.stat-cyan .stat-value {
  color: var(--primary-cyan);
  text-shadow: 0 0 15px rgba(0, 212, 255, 0.3);
}

.stat-red .stat-value {
  color: var(--color-danger);
  text-shadow: 0 0 15px rgba(255, 68, 68, 0.3);
}

/* ==========================================================================
   Live Health Connector Widget
   ========================================================================== */
.health-widget {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  background: rgba(16, 24, 46, 0.5);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  margin-bottom: 16px;
}

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

.health-details {
  display: flex;
  flex-direction: column;
}

.health-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-white);
  display: flex;
  align-items: center;
  gap: 6px;
}

.health-sub {
  font-size: 11px;
  color: var(--text-secondary);
}

.health-metrics {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 11.5px;
}

.metric-pill {
  padding: 3px 8px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.metric-pill strong {
  color: var(--text-white);
}

/* ==========================================================================
   Tables (Debit / Credit Entry & Activity)
   ========================================================================== */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  margin: 10px 0;
  border-radius: var(--radius-sm);
  border: 1px solid var(--glass-border);
}

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

.velnox-table th {
  background: rgba(10, 14, 26, 0.8);
  padding: 10px 12px;
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--glass-border);
}

.velnox-table td {
  padding: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
  vertical-align: middle;
}

.velnox-table tr:last-child td {
  border-bottom: none;
}

.velnox-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.dc-badge {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 4px;
  font-weight: 700;
  font-size: 11px;
}

.dc-badge.dr {
  background: var(--primary-cyan-dim);
  color: var(--primary-cyan);
  border: 1px solid rgba(0, 212, 255, 0.3);
}

.dc-badge.cr {
  background: var(--accent-gold-dim);
  color: var(--accent-gold);
  border: 1px solid rgba(255, 215, 0, 0.3);
}

.amount-mono {
  font-family: 'SF Mono', Monaco, Menlo, Consolas, monospace;
  font-weight: 600;
  text-align: right;
  white-space: nowrap;
}

/* ==========================================================================
   Forms, Inputs, and Selects
   ========================================================================== */
.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
  letter-spacing: 0.02em;
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  background: rgba(10, 14, 26, 0.6);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  padding: 11px 14px;
  font-size: 14px;
  font-family: inherit;
  color: var(--text-primary);
  outline: none;
  min-height: 44px; /* Touch target minimum */
  transition: var(--transition-fast);
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--primary-cyan);
  box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.2);
  background: rgba(16, 24, 46, 0.8);
}

.form-input::placeholder, .form-textarea::placeholder {
  color: var(--text-muted);
}

.form-select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2300d4ff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
  padding-right: 36px;
}

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

.form-textarea {
  min-height: 80px;
  resize: vertical;
}

.input-row {
  display: flex;
  gap: 10px;
}

.input-row > * {
  flex: 1;
}

/* ==========================================================================
   Buttons & Interactive Elements
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: var(--transition-fast);
  text-decoration: none;
}

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

.btn-primary {
  background: linear-gradient(135deg, var(--primary-cyan), #0077ff);
  color: #060911;
  font-weight: 700;
  box-shadow: var(--cyan-glow);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #38e1ff, #1a88ff);
  box-shadow: var(--cyan-glow-strong);
}

.btn-gold {
  background: linear-gradient(135deg, var(--accent-gold), #e6b800);
  color: #060911;
  font-weight: 700;
  box-shadow: var(--gold-glow);
}

.btn-gold:hover {
  background: linear-gradient(135deg, #ffe033, #f5c400);
}

.btn-success {
  background: linear-gradient(135deg, var(--color-success), #00cc6a);
  color: #060911;
  font-weight: 700;
  box-shadow: 0 0 15px rgba(0, 255, 136, 0.4);
}

.btn-danger {
  background: linear-gradient(135deg, var(--color-danger), #cc1111);
  color: #ffffff;
  font-weight: 700;
  box-shadow: 0 0 15px rgba(255, 68, 68, 0.35);
}

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

.btn-secondary:hover {
  background: var(--glass-bg-hover);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-sm {
  min-height: 34px;
  padding: 6px 12px;
  font-size: 12px;
}

.btn-block {
  width: 100%;
}

.btn-icon-only {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: var(--radius-sm);
}

/* ==========================================================================
   Modals & Overlays
   ========================================================================== */
#modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(6, 9, 17, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 100;
  display: flex;
  align-items: flex-end; /* Sheet style on mobile */
  justify-content: center;
  transition: opacity 0.25s ease;
}

@media (min-width: 600px) {
  #modal-overlay {
    align-items: center; /* Centered modal on larger screens */
    padding: 20px;
  }
}

#modal-overlay.hidden {
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
}

.modal-dialog {
  background: var(--bg-surface);
  border: 1px solid var(--glass-border);
  width: 100%;
  max-width: 580px;
  max-height: 90vh;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  padding: 22px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 -15px 40px rgba(0, 0, 0, 0.7);
  overflow-y: auto;
  animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@media (min-width: 600px) {
  .modal-dialog {
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.08);
  }
}

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

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

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

.modal-close-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 22px;
  cursor: pointer;
  line-height: 1;
  padding: 4px;
}

.modal-close-btn:hover {
  color: var(--text-white);
}

.modal-body {
  flex: 1;
  overflow-y: auto;
  margin-bottom: 16px;
}

.modal-footer {
  display: flex;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--glass-border);
}

/* ==========================================================================
   Toast Notifications
   ========================================================================== */
#toast-container {
  position: fixed;
  top: calc(var(--header-height) + 12px);
  left: 50%;
  transform: translateX(-50%);
  width: 90%;
  max-width: 440px;
  z-index: 120;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  background: rgba(16, 24, 46, 0.95);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  gap: 12px;
  animation: toastIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.toast.toast-success {
  border-color: rgba(0, 255, 136, 0.4);
  box-shadow: 0 10px 30px rgba(0, 255, 136, 0.15);
}
.toast.toast-error {
  border-color: rgba(255, 68, 68, 0.4);
  box-shadow: 0 10px 30px rgba(255, 68, 68, 0.15);
}
.toast.toast-warning {
  border-color: rgba(255, 170, 0, 0.4);
}
.toast.toast-info {
  border-color: rgba(0, 212, 255, 0.4);
}

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

.toast-icon {
  font-size: 18px;
  flex-shrink: 0;
}

.toast-content {
  flex: 1;
  font-size: 13px;
  color: var(--text-primary);
  line-height: 1.4;
}

/* ==========================================================================
   Spinners & Loaders
   ========================================================================== */
.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-top-color: var(--primary-cyan);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: inline-block;
}

.spinner-lg {
  width: 40px;
  height: 40px;
  border-width: 3px;
}

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

/* ==========================================================================
   Voucher Preview & Entry Rows
   ========================================================================== */
.entry-row-grid {
  display: grid;
  grid-template-columns: 80px 1fr 110px 36px;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}

@media (max-width: 420px) {
  .entry-row-grid {
    grid-template-columns: 70px 1fr 90px 30px;
    gap: 4px;
  }
}

.balance-indicator {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.3);
  margin: 12px 0;
  font-size: 12.5px;
}

.balance-indicator.balanced {
  border: 1px solid rgba(0, 255, 136, 0.3);
  color: var(--color-success);
}

.balance-indicator.unbalanced {
  border: 1px solid rgba(255, 68, 68, 0.3);
  color: var(--color-danger);
}

.warning-alert-box {
  background: rgba(255, 170, 0, 0.1);
  border: 1px solid rgba(255, 170, 0, 0.35);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  color: #ffcc66;
  font-size: 12.5px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 10px 0;
}

/* Quick AI Suggestion Chips */
.suggestion-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.chip {
  padding: 4px 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-full);
  font-size: 11.5px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition-fast);
}

.chip:hover {
  background: var(--primary-cyan-dim);
  border-color: var(--primary-cyan);
  color: var(--primary-cyan);
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 40px 16px;
  color: var(--text-secondary);
}

.empty-state svg {
  width: 48px;
  height: 48px;
  stroke: var(--text-muted);
  margin-bottom: 12px;
}

.empty-state h4 {
  font-size: 15px;
  color: var(--text-white);
  margin-bottom: 6px;
}

.empty-state p {
  font-size: 12.5px;
  max-width: 320px;
  margin: 0 auto;
}

/* ── 5-Tab Bottom Nav Override ─────────────────────────────── */
#bottom-nav { grid-template-columns: repeat(5, 1fr) !important; }
.nav-btn[data-view="bill-upload"].active { color: #b388ff; }
.nav-btn[data-view="bill-upload"].active svg { filter: drop-shadow(0 0 6px #b388ff); }
