.hidden { display: none !important; }

/*-----------------------------------*\
  NATARAJA BILLING SYSTEM — STYLE V2
  Design System: "Industrial Elegance"
  Source: Stitch Project 14181904191823586189
\*-----------------------------------*/

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

/* ============================================================
   1. DESIGN TOKENS (Stitch "Harvest Ledger")
   ============================================================ */
:root {
  /* — Primary (Forest Green) — */
  --color-primary: #18402f;
  --color-primary-container: #305846;
  --color-primary-fixed: #c1ecd4;
  --color-primary-fixed-dim: #a5d0b9;
  --color-on-primary: #ffffff;
  --color-on-primary-container: #a1ccb5;
  --color-on-primary-fixed: #002114;

  /* — Secondary (Nataraja Gold / Saffron Ochre) — */
  --color-secondary: #636032;
  --color-secondary-container: #eae5ab;
  --color-secondary-fixed: #eae5ab;
  --color-secondary-fixed-dim: #cdc991;
  --color-on-secondary: #ffffff;
  --color-on-secondary-container: #696638;

  /* — Tertiary (Burnt Saffron / Alert) — */
  --color-tertiary: #642706;
  --color-tertiary-container: #813d1c;
  --color-tertiary-fixed: #ffdbcd;
  --color-tertiary-fixed-dim: #ffb596;
  --color-on-tertiary: #ffffff;
  --color-on-tertiary-fixed: #360f00;

  /* — Surface Hierarchy (Nested Depth Model) — */
  --surface: #f5fcef;
  /* Base canvas */
  --surface-bright: #f5fcef;
  --surface-container-low: #eff6e9;
  /* Sectional groupings */
  --surface-container: #e9f0e4;
  /* Secondary containers */
  --surface-container-high: #e3eade;
  /* Input fills */
  --surface-container-highest: #dee5d8;
  /* Dense input fills */
  --surface-container-lowest: #ffffff;
  /* Active cards / forms */
  --surface-dim: #d5dcd0;
  --surface-tint: #3f6653;

  /* — Text — */
  --on-surface: #171d16;
  /* Never use pure black */
  --on-surface-variant: #42493e;
  --on-background: #171d16;

  /* — Outlines — */
  --outline: #72796e;
  --outline-variant: #c2c9bb;

  /* — Semantic — */
  --color-error: #ba1a1a;
  --color-error-container: #ffdad6;
  --color-success: #2E7D32;
  --color-warning: #E65100;

  /* — Typography — */
  --ff-global: 'Public Sans', sans-serif;
  --ff-display: var(--ff-global);
  --ff-body: var(--ff-global);
  --ff-data: var(--ff-global);

  /* — Radii — */
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-pill: 9999px;

  /* — Shadows (Ambient Glow style) — */
  --shadow-ambient: 0 12px 40px rgba(23, 29, 22, 0.06);
  --shadow-card: 0 4px 20px rgba(23, 29, 22, 0.05);
  --shadow-float: 0 20px 60px rgba(23, 29, 22, 0.10);

  --color-primary-rgb: 24, 64, 47;
  --color-primary-fixed-rgb: 193, 236, 212;

  /* — Primary CTA Gradient — */
  --gradient-primary: linear-gradient(135deg, #18402f 0%, #305846 100%);
  --gradient-gold: linear-gradient(135deg, #636032 0%, #8a7d4a 100%);

  /* — Navigation Specific — */
  --nav-bg: rgba(var(--color-primary-rgb), 1);
  --nav-border: rgba(var(--color-primary-fixed-rgb), 0.2);
  --nav-text: rgba(var(--color-primary-fixed-rgb), 0.6);
  --nav-text-active: #c1ecd4;

  /* — Spacing — */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
}

/* ============================================================
   1b. THEMES (Overridden Variables)
   ============================================================ */
[data-theme="glass-blue"] {
  --color-primary: #0f2e4a;
  --color-primary-container: #1c4e7d;
  --color-primary-fixed: #cfe4ff;
  --color-primary-fixed-dim: #9bcafe;
  --color-on-primary: #ffffff;
  --color-on-primary-container: #b3d4ff;
  --color-on-primary-fixed: #001a35;

  --color-secondary: #38485c;
  --color-secondary-container: #d6e4f7;
  --color-secondary-fixed: #d6e4f7;
  --color-secondary-fixed-dim: #bacce0;
  --color-on-secondary: #ffffff;
  --color-on-secondary-container: #263445;

  --color-tertiary: #483c66;
  --color-tertiary-container: #685891;
  --color-tertiary-fixed: #e3daff;
  --color-tertiary-fixed-dim: #c8bbff;
  --color-on-tertiary: #ffffff;
  --color-on-tertiary-fixed: #22163f;

  --surface: #f2f7fd;
  --surface-bright: #f2f7fd;
  --surface-container-low: #eaf2fa;
  --surface-container: #e1ebf5;
  --surface-container-high: #d7e3ef;
  --surface-container-highest: #cddaea;
  --surface-container-lowest: #ffffff;
  --surface-dim: #c2cfe0;
  --surface-tint: #2d6596;

  --on-surface: #121921;
  --on-surface-variant: #3b4552;
  --on-background: #121921;

  --outline: #657382;
  --outline-variant: #b2c0cc;

  --color-primary-rgb: 15, 46, 74;
  --color-primary-fixed-rgb: 207, 228, 255;

  --nav-bg: rgba(var(--color-primary-rgb), 0.95);
  --nav-border: rgba(var(--color-primary-fixed-rgb), 0.15);
  --nav-text: rgba(var(--color-primary-fixed-rgb), 0.6);
  --nav-text-active: #cfe4ff;

  --gradient-primary: linear-gradient(135deg, #0f2e4a 0%, #1c4e7d 100%);
  --gradient-gold: linear-gradient(135deg, #38485c 0%, #5b718d 100%);
}

[data-theme="obsidian-dark"] {
  --color-primary: #8ec7ab;
  --color-primary-container: #18402f;
  --color-primary-fixed: #18402f;
  --color-primary-fixed-dim: #123122;
  --color-on-primary: #0a2217;
  --color-on-primary-container: #c1ecd4;
  --color-on-primary-fixed: #ffffff;

  --color-secondary: #d0cd9e;
  --color-secondary-container: #49461d;
  --color-secondary-fixed: #49461d;
  --color-secondary-fixed-dim: #373413;
  --color-on-secondary: #1d1c07;
  --color-on-secondary-container: #eae5ab;

  --color-tertiary: #ffb596;
  --color-tertiary-container: #642706;
  --color-tertiary-fixed: #642706;
  --color-tertiary-fixed-dim: #4a1c02;
  --color-on-tertiary: #360f00;
  --color-on-tertiary-fixed: #ffdbcd;

  --surface: #121312;
  --surface-bright: #252724;
  --surface-container-low: #1a1c1a;
  --surface-container: #212320;
  --surface-container-high: #2b2e2a;
  --surface-container-highest: #353834;
  --surface-container-lowest: #0d0e0d;
  --surface-dim: #121312;
  --surface-tint: #8ec7ab;

  --on-surface: #e0e3dd;
  --on-surface-variant: #c2c9bb;
  --on-background: #e0e3dd;

  --outline: #8b9387;
  --outline-variant: #42493e;

  --color-primary-rgb: 24, 64, 47;
  --color-primary-fixed-rgb: 142, 199, 171;

  --nav-bg: rgba(var(--color-primary-rgb), 0.95);
  --nav-border: rgba(var(--color-primary-fixed-rgb), 0.15);
  --nav-text: rgba(var(--color-primary-fixed-rgb), 0.55);
  --nav-text-active: #8ec7ab;

  --gradient-primary: linear-gradient(135deg, #18402f 0%, #225a42 100%);
  --gradient-gold: linear-gradient(135deg, #49461d 0%, #636032 100%);
}

[data-theme="midnight-sky"] {
  /* ── Midnight Sky — "Deep Space Ledger"
     Dark navy canvas, sky-blue accent.
     Ported from mob.html design tokens.           ── */

  /* — Primary: Sky Blue (#38bdf8) — */
  --color-primary: #38bdf8;
  --color-primary-container: #0c4a6e;
  --color-primary-fixed: #0c1c2c;
  --color-primary-fixed-dim: #082032;
  --color-on-primary: #0c1c2c;
  --color-on-primary-container: #bae6fd;
  --color-on-primary-fixed: #ffffff;

  /* — Secondary: Cool Slate — */
  --color-secondary: #94a3b8;
  --color-secondary-container: #1e293b;
  --color-secondary-fixed: #1e293b;
  --color-secondary-fixed-dim: #172032;
  --color-on-secondary: #0f172a;
  --color-on-secondary-container: #cbd5e1;

  /* — Tertiary: Indigo — */
  --color-tertiary: #818cf8;
  --color-tertiary-container: #312e81;
  --color-tertiary-fixed: #312e81;
  --color-tertiary-fixed-dim: #1e1b4b;
  --color-on-tertiary: #1e1b4b;
  --color-on-tertiary-fixed: #e0e7ff;

  /* — Surfaces (dark navy) — */
  --surface: #0f172a;
  --surface-bright: #1e293b;
  --surface-container-low: #1e293b;
  --surface-container: #263348;
  --surface-container-high: #2d3f5a;
  --surface-container-highest: #344b6e;
  --surface-container-lowest: #0a1020;
  --surface-dim: #0f172a;
  --surface-tint: #38bdf8;

  /* — Text — */
  --on-surface: #f1f5f9;
  --on-surface-variant: #94a3b8;
  --on-background: #f1f5f9;

  /* — Outlines — */
  --outline: #475569;
  --outline-variant: #263348;

  /* — RGB tokens — */
  --color-primary-rgb: 56, 189, 248;
  --color-primary-fixed-rgb: 186, 230, 253;

  /* — Navigation — */
  --nav-bg: rgba(15, 23, 42, 0.97);
  --nav-border: rgba(56, 189, 248, 0.12);
  --nav-text: rgba(148, 163, 184, 0.65);
  --nav-text-active: #38bdf8;

  /* — Gradients — */
  --gradient-primary: linear-gradient(135deg, #0ea5e9 0%, #38bdf8 100%);
  --gradient-gold: linear-gradient(135deg, #64748b 0%, #94a3b8 100%);

  /* — Semantic — */
  --color-error: #f87171;
  --color-error-container: rgba(248, 113, 113, 0.15);
  --color-success: #34d399;
  --color-warning: #fbbf24;
}

/* Dark themes: use on-surface for headings so they don't blare in accent color */
[data-theme="midnight-sky"] .section-header h2,
[data-theme="obsidian-dark"] .section-header h2 {
  color: var(--on-surface);
}

[data-theme="royal-blue"] {
  /* Dark Royal Blue — "Sapphire Ledger" */
  --color-primary: #1e3a8a;
  --color-primary-container: #1d4ed8;
  --color-primary-fixed: #bfdbfe;
  --color-primary-fixed-dim: #93c5fd;
  --color-on-primary: #ffffff;
  --color-on-primary-container: #dbeafe;
  --color-on-primary-fixed: #0c1a4a;

  --color-secondary: #b45309;
  --color-secondary-container: #fef3c7;
  --color-secondary-fixed: #fde68a;
  --color-secondary-fixed-dim: #fbbf24;
  --color-on-secondary: #ffffff;
  --color-on-secondary-container: #78350f;

  --color-tertiary: #6d28d9;
  --color-tertiary-container: #7c3aed;
  --color-tertiary-fixed: #ede9fe;
  --color-tertiary-fixed-dim: #c4b5fd;
  --color-on-tertiary: #ffffff;
  --color-on-tertiary-fixed: #2e1065;

  --surface: #f0f4ff;
  --surface-bright: #f0f4ff;
  --surface-container-low: #e8eeff;
  --surface-container: #dde5fb;
  --surface-container-high: #d1dcf8;
  --surface-container-highest: #c5d2f5;
  --surface-container-lowest: #ffffff;
  --surface-dim: #b8c8ef;
  --surface-tint: #1d4ed8;

  --on-surface: #0f172a;
  --on-surface-variant: #334155;
  --on-background: #0f172a;

  --outline: #64748b;
  --outline-variant: #94a3b8;

  --color-primary-rgb: 30, 58, 138;
  --color-primary-fixed-rgb: 191, 219, 254;

  --nav-bg: rgba(var(--color-primary-rgb), 0.95);
  --nav-border: rgba(var(--color-primary-fixed-rgb), 0.15);
  --nav-text: rgba(var(--color-primary-fixed-rgb), 0.6);
  --nav-text-active: #bfdbfe;

  --gradient-primary: linear-gradient(135deg, #1e3a8a 0%, #1d4ed8 100%);
  --gradient-gold: linear-gradient(135deg, #b45309 0%, #d97706 100%);
}



/* ============================================================
   2. GLOBAL RESET & BASE
   ============================================================ */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--ff-global);
  background-color: var(--surface);
  color: var(--on-surface);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Grain texture overlay on body for "high-quality agricultural paper" feel */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9998;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.02'/%3E%3C/svg%3E");
  opacity: 0.3;
}

/* ============================================================
   3. LOGIN SCREEN — "Nataraja Atelier" Login
   ============================================================ */
.login-modal {
  position: fixed;
  inset: 0;
  background: var(--surface);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  background-image:
    radial-gradient(ellipse at 20% 80%, rgba(24, 64, 47, 0.08) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 20%, rgba(99, 96, 50, 0.06) 0%, transparent 60%);
}

.login-container {
  width: 95%;
  max-width: 440px;
  animation: loginSlideUp 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes loginSlideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.login-box {
  background: var(--surface-container-lowest);
  padding: 3rem 2.5rem;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-float);
  position: relative;
  overflow: hidden;
}

/* Heritage accent bar at top */
.login-box::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--gradient-primary);
}

/* Subtle ref code */
.login-box::after {
  content: "REF: NAS-BB";
  position: absolute;
  top: 16px;
  right: 20px;
  font-family: var(--ff-data);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--outline);
  opacity: 0.4;
}

.login-header {
  text-align: center;
  margin-bottom: 2.5rem;
}

.login-header h1 {
  font-family: var(--ff-display);
  font-size: 2.8rem;
  font-weight: 800;
  color: var(--color-primary);
  letter-spacing: -1px;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.login-header .tagline {
  display: block;
  font-family: var(--ff-data);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 3.5px;
  color: var(--on-surface-variant);
  text-transform: uppercase;
}

.login-header .access-title {
  display: inline-block;
  margin-top: 1.5rem;
  font-family: var(--ff-body);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--on-surface-variant);
  padding: 4px 14px;
  background: var(--surface-container-low);
  border-radius: var(--radius-pill);
}

.login-box .form-group {
  margin-bottom: 1.5rem;
}

.login-box label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
  font-family: var(--ff-data);
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--on-surface-variant);
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.login-box label .label-num {
  color: var(--outline);
  margin-right: 6px;
}

.login-box .input-wrapper {
  position: relative;
}

.login-box input {
  width: 100%;
  padding: 14px 16px;
  background-color: var(--surface-container-high);
  border: none;
  border-bottom: 2px solid var(--outline-variant);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  font-size: 0.95rem;
  font-family: var(--ff-body);
  color: var(--on-surface);
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.login-box input:focus {
  outline: none;
  background-color: var(--surface-container-highest);
  border-bottom-color: var(--color-primary);
}

.login-box .btn-initiate {
  width: 100%;
  background: var(--gradient-primary);
  color: var(--color-on-primary);
  border: none;
  padding: 16px;
  font-family: var(--ff-data);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  font-size: 0.78rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  margin-top: 1.5rem;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.login-box .btn-initiate:hover {
  opacity: 0.92;
  transform: translateY(-1px);
}

.login-footer-meta {
  margin-top: 2rem;
  display: flex;
  justify-content: space-between;
  font-family: var(--ff-data);
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--outline);
  opacity: 0.7;
}

.login-footer-meta span {
  display: flex;
  align-items: center;
  gap: 5px;
}

.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

@keyframes pulse {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(255, 165, 0, 0.7);
  }

  70% {
    transform: scale(1);
    box-shadow: 0 0 0 6px rgba(255, 165, 0, 0);
  }

  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(255, 165, 0, 0);
  }
}

.login-footer-meta .status-dot {
  background-color: #2ecc71;
}

.industrial-grid {
  background-image: radial-gradient(#e5e7eb 1px, transparent 1px);
  background-size: 32px 32px;
}

/* ============================================================
   4. APP CONTAINER & LAYOUT
   ============================================================ */
.app-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ============================================================
   5. APPLICATION HEADER (Redesigned Desktop Unified)
   ============================================================ */
.app-header {
  background: var(--nav-bg);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  color: var(--nav-text-active);
  position: sticky;
  top: 0;
  z-index: 1000;
  border-bottom: 1px solid var(--nav-border);
  display: flex;
  flex-direction: column;
}

/* Row 1: Brand Identity & Primary Actions */
.header-top-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 var(--space-xl);
  height: 72px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.brand-section {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  cursor: pointer;
}

.app-brand-logo-container {
  width: 40px;
  height: 40px;
  background: var(--surface-container-high);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.app-brand-logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.brand-icon {
  font-size: 24px;
}

/* Mobile Responsiveness for Redesigned Header */
@media (max-width: 768px) {
  .brand-text { display: block; }
  .brand-text h1 { font-size: 1.1rem !important; }
  .brand-text p { display: none; }
  
  .header-top-row {
    padding: 0 var(--space-md);
    height: 64px;
  }

  .user-details {
    display: none !important;
  }

  .user-profile-capsule {
    padding: 0 !important;
    gap: 0 !important;
    border-radius: 50% !important;
    background: transparent !important;
    border: none !important;
  }

  .avatar-circle-icon {
    width: 36px;
    height: 36px;
    font-size: 16px;
  }

  .header-action-btn span:not(.material-symbols-outlined) {
    display: none !important;
  }

  .header-action-btn {
    width: 36px;
    height: 36px;
    padding: 0 !important;
    justify-content: center;
    border-radius: 50% !important;
    background: rgba(var(--color-primary-rgb), 0.12);
  }

  .header-meta-cluster {
    gap: 8px;
  }
}

.brand-text h1 {
  font-family: var(--ff-display);
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--nav-text-active);
  margin: 0;
}

.brand-text p {
  font-family: var(--ff-data);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--nav-text-active);
  opacity: 0.65;
  margin: 1px 0 0 0;
}

/* Metadata & Actions Cluster */
.header-meta-cluster {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.header-action-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  background: rgba(var(--color-primary-rgb), 0.12);
  border: 1px solid rgba(var(--color-primary-rgb), 0.28);
  border-radius: var(--radius-lg);
  color: var(--nav-text-active);
  font-family: var(--ff-display);
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
}

.header-action-btn:hover {
  background: rgba(var(--color-primary-rgb), 0.22);
  border-color: var(--nav-text-active);
  transform: translateY(-1px);
}

.header-action-btn .material-symbols-outlined {
  font-size: 18px;
  opacity: 0.9;
}

/* User Profile Capsule */
.user-profile-capsule {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 6px 6px 18px;
  background: rgba(var(--color-primary-rgb), 0.12);
  border: 1px solid rgba(var(--color-primary-rgb), 0.25);
  border-radius: var(--radius-pill);
  cursor: pointer;
  position: relative;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.user-profile-capsule:hover {
  background: rgba(var(--color-primary-rgb), 0.18);
  border-color: var(--color-primary-fixed);
  box-shadow: 0 0 15px rgba(var(--color-primary-rgb), 0.2);
  transform: translateY(-1px);
}

.user-details {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
  text-align: right;
}

.user-display-name {
  font-family: var(--ff-display);
  font-size: 13.5px;
  font-weight: 700;
  color: var(--nav-text-active);
  letter-spacing: -0.2px;
}

.user-role-label {
  font-family: var(--ff-data);
  font-size: 9px;
  text-transform: uppercase;
  color: var(--nav-text-active);
  opacity: 0.85;
  letter-spacing: 0.8px;
  font-weight: 700;
}

.avatar-circle-icon {
  width: 32px;
  height: 32px;
  background: var(--color-primary);
  color: var(--color-on-primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 800;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

/* Row 2: Navigation & Status */
.header-nav-row {
  height: 48px;
  padding: 0 var(--space-xl);
  background: rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  justify-content: space-between; /* Split Nav and Status */
}

.nav-modules-scroll {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  flex: 1;
  min-width: 0;
}
.nav-modules-scroll::-webkit-scrollbar { display: none; }

.nav-tab-btn {
  padding: 8px 16px;
  border: none;
  background: transparent;
  color: var(--nav-text);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-family: var(--ff-display);
  font-size: 13.5px;
  font-weight: 600;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
}

.nav-tab-btn:hover {
  color: var(--nav-text-active);
  background: rgba(var(--color-primary-rgb), 0.08);
}

.nav-tab-btn.active {
  background: rgba(var(--color-primary-rgb), 0.15);
  color: var(--nav-text-active);
  box-shadow: inset 0 1px 0 rgba(var(--color-primary-rgb), 0.2);
}

.sync-status-widget {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--nav-border);
  border-radius: var(--radius-pill);
  font-family: var(--ff-data);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--nav-text);
  margin-left: auto;
  flex-shrink: 0;
}

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

/* Dropdown */
.avatar-menu {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  width: 250px;
  background: var(--surface-container-lowest);
  border: 1px solid var(--outline-variant);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-float);
  display: none;
  z-index: 1001;
  overflow: hidden;
}

.avatar-menu.active {
  display: block;
}

.avatar-menu-header {
  padding: 24px 20px;
  background: var(--surface-container-low);
  border-bottom: 1px solid var(--outline-variant);
}

.menu-user-name {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--on-surface);
}

.menu-items {
  padding: 8px;
}

.menu-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border: none;
  background: transparent;
  border-radius: var(--radius-lg);
  color: var(--on-surface-variant);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.menu-item:hover {
  background: var(--surface-container);
  color: var(--color-primary);
}

.logout-btn {
  color: var(--color-error) !important;
}

.menu-footer {
  padding: 16px 20px;
  background: var(--surface-container-low);
  border-top: 1px solid var(--outline-variant);
}

.app-version-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--ff-data);
  font-size: 11px;
  color: var(--on-surface-variant);
  opacity: 0.6;
}

.sync-status.error .sync-dot {
  background: #ef5350;
  animation: none;
}

.sync-dot.pulse {
  animation: sync-pulse 1s infinite;
}

@keyframes sync-pulse {
  0% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(1.2); }
  100% { opacity: 1; transform: scale(1); }
}

.sync-text {
  color: inherit;
}

@keyframes pulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.4;
  }
}

/* ============================================================
   7. MAIN CONTENT AREA
   ============================================================ */
.main-content {
  flex: 1;
  padding: var(--space-xl);
  max-width: 1280px;
  margin: 0 auto;
  width: 100%;
}

/* Tab Content */
.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
  animation: fadeIn 0.25s ease;
}

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

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ============================================================
   8. SECTION HEADERS — "Heritage Header" style
   ============================================================ */
.section-header {
  margin-bottom: var(--space-lg);
  position: relative;
}

.section-header::after {
  content: '';
  display: block;
  width: 48px;
  height: 4px;
  background: var(--color-primary-fixed);
  border-radius: 2px;
  margin-top: 8px;
  position: absolute;
  bottom: -10px;
  left: 0;
}

/* Ensure spacing when underline is absolute */
.section-header {
  margin-bottom: var(--space-xl);
  padding-bottom: 2px;
}


.section-header h2 {
  font-family: var(--ff-display);
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--color-primary);
  letter-spacing: -0.5px;
}

.section-header h3 {
  font-family: var(--ff-display);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--color-primary);
}

.section-header p {
  font-family: var(--ff-body);
  font-size: 0.875rem;
  color: var(--on-surface-variant);
  margin-top: 4px;
}

/* ============================================================
   9. DASHBOARD — Glassmorphic Stat Cards
   ============================================================ */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: var(--space-lg);
  margin-bottom: var(--space-2xl);
}

.metric-card {
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: var(--radius-xl);
  padding: var(--space-xl);
  box-shadow: var(--shadow-card);
  border: 1px solid rgba(var(--color-primary-fixed-rgb), 0.35);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  cursor: pointer;
  position: relative;
  overflow: visible;
}

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

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

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

.metric-card h3 {
  font-family: var(--ff-data);
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--on-surface-variant);
}

.metric-value {
  font-family: var(--ff-display);
  font-size: 2rem;
  font-weight: 800;
  color: var(--color-primary);
  letter-spacing: -0.5px;
  line-height: 1;
}

.metric-trend {
  font-family: var(--ff-data);
  font-size: 0.7rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--on-surface-variant);
}

.metric-trend.up {
  color: var(--color-success);
}

.metric-trend.down {
  color: var(--color-error);
}

/* Inventory Section */
.inventory-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--space-lg);
  margin-top: var(--space-xl);
}

.inventory-card,
.recent-activity-card {
  background: var(--surface-container-lowest);
  border-radius: var(--radius-xl);
  padding: var(--space-xl);
  box-shadow: var(--shadow-card);
}

.inventory-item {
  margin-bottom: var(--space-md);
}

.inventory-item-header {
  display: flex;
  justify-content: space-between;
  font-family: var(--ff-data);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--on-surface-variant);
  margin-bottom: 6px;
}

.progress-track {
  height: 6px;
  background: var(--surface-container-high);
  border-radius: 10px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--gradient-primary);
  border-radius: 10px;
  transition: width 0.6s ease-out;
}

/* Recent Activity */
.recent-list {
  list-style: none;
}

.recent-item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: 14px 0;
}

.recent-item+.recent-item {
  border-top: 1px solid rgba(194, 201, 187, 0.3);
}

.status-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-pill);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  flex-shrink: 0;
}

.status-icon.success {
  background: rgba(46, 125, 50, 0.12);
  color: var(--color-success);
}

.status-icon.pending {
  background: var(--color-secondary-container);
  color: var(--color-secondary);
}

.recent-details h4 {
  font-family: var(--ff-body);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--on-surface);
}

.recent-details p {
  font-family: var(--ff-data);
  font-size: 0.7rem;
  color: var(--on-surface-variant);
  margin-top: 2px;
}

.recent-amount {
  margin-left: auto;
  font-family: var(--ff-data);
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--color-primary);
  white-space: nowrap;
}

/* ============================================================
   10. BILLING LAYOUT — 2-Column Grid
   ============================================================ */
.billing-grid-container {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: var(--space-xl);
  align-items: start;
}

@media (max-width: 1024px) {
  .billing-grid-container {
    grid-template-columns: 1fr;
  }
}

.billing-main-section {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

.summary-sidebar {
  position: sticky;
  top: 128px;
  z-index: 10;
}

/* ============================================================
   11. FORM CARDS
   ============================================================ */
.form-card {
  background: var(--surface-container-lowest);
  border-radius: var(--radius-xl);
  padding: var(--space-xl);
  margin-bottom: var(--space-lg);
  box-shadow: var(--shadow-card);
}

.form-card h3 {
  font-family: var(--ff-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: var(--space-lg);
  padding-bottom: var(--space-sm);
  border-bottom: 4px solid var(--color-primary-fixed);
  display: inline-block;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--space-md);
}

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

.form-group.full-width {
  grid-column: 1 / -1;
}

.form-group label {
  font-family: var(--ff-data);
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--on-surface-variant);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 6px;
}

.form-group input:not([type="checkbox"]):not([type="radio"]),
.form-group select,
.form-group textarea {
  padding: 12px 14px;
  background: var(--surface-container-high);
  border: none;
  border-bottom: 2px solid var(--outline-variant);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  font-family: var(--ff-body);
  font-size: 0.9rem;
  color: var(--on-surface);
  transition: border-color 0.2s, background-color 0.2s;
  width: 100%;
  box-sizing: border-box;
  -webkit-appearance: none;
  appearance: none;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  background: var(--surface-container-highest);
  border-bottom-color: var(--color-primary);
}

.form-group input[readonly],
.form-group textarea[readonly] {
  background: var(--surface-container-low);
  color: var(--on-surface-variant);
  cursor: not-allowed;
  border-bottom-color: transparent;
}

.form-group input[type="checkbox"],
.form-group input[type="radio"] {
  cursor: pointer;
  -webkit-appearance: checkbox;
  appearance: checkbox;
  width: auto;
}

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

/* ============================================================
   11b. STANDALONE FORM INPUTS (.form-input)
   Used by modal forms (expenses, recurring, etc.) that don't
   wrap fields in .form-group. Must mirror .form-group input.
   ============================================================ */
.form-input {
  padding: 12px 14px;
  background: var(--surface-container-high) !important;
  border: none;
  border-bottom: 2px solid var(--outline-variant);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  font-family: var(--ff-body);
  font-size: 0.9rem;
  color: var(--on-surface) !important;
  transition: border-color 0.2s, background-color 0.2s;
  width: 100%;
  box-sizing: border-box;
  -webkit-appearance: none;
  appearance: none;
}

.form-input:focus {
  outline: none;
  background: var(--surface-container-highest) !important;
  border-bottom-color: var(--color-primary);
}

.form-input[readonly] {
  background: var(--surface-container-low) !important;
  color: var(--on-surface-variant) !important;
  cursor: not-allowed;
  border-bottom-color: transparent;
}

.form-input:-webkit-autofill,
.form-input:-webkit-autofill:hover,
.form-input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0px 1000px var(--surface-container-high) inset !important;
  -webkit-text-fill-color: var(--on-surface) !important;
}

/* ============================================================
   12. BUTTONS
   ============================================================ */
.btn {
  padding: 12px 24px;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-family: var(--ff-data);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  box-sizing: border-box;
}

/* Form block buttons should be full width */
.form-grid > .btn, 
.summary-footer .btn-save,
.btn-full {
  width: 100%;
  grid-column: 1 / -1;
}

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

.btn-primary:hover {
  opacity: 0.9;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(24, 64, 47, 0.3);
}

.btn-secondary {
  background: var(--surface-container-highest);
  color: var(--on-surface);
}

.btn-secondary:hover {
  background: var(--surface-container-high);
  transform: translateY(-1px);
}

.btn-danger {
  background: var(--color-error);
  color: #fff;
}

.btn-danger:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

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

.btn-warning:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.btn-small {
  padding: 7px 14px;
  font-size: 0.72rem;
  width: auto;
  grid-column: auto;
}

#logoutBtn {
  width: auto !important;
  white-space: nowrap;
}

/* Remove row button */
.item-remove-btn {
  padding: 6px 10px !important;
  font-size: 0.8rem !important;
  min-width: 38px;
  width: auto !important;
  grid-column: auto;
  text-align: center;
}

.item-remove-btn .remove-text {
  display: inline;
}

.item-remove-btn .remove-emoji {
  display: none;
}

/* Bill action emoji buttons */
.bill-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}

.emoji-btn {
  font-size: 1.1rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 8px;
  border-radius: var(--radius-md);
  transition: all 0.2s;
  user-select: none;
  border: none;
  background: transparent;
}


.emoji-btn:hover {
  transform: scale(1.2);
}

.emoji-btn.delete-btn {
  background: rgba(186, 26, 26, 0.05);
  color: var(--color-error);
}

.emoji-btn.delete-btn:hover {
  background: rgba(186, 26, 26, 0.1);
}

/* ============================================================
   9. DASHBOARD — Glassmorphic Stat Cards
   ============================================================ */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--space-lg);
  margin-bottom: var(--space-2xl);
}

.metric-card {
  background: var(--surface-container-lowest);
  padding: var(--space-xl);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-ambient);
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s ease;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(var(--color-primary-fixed-rgb), 0.2);
}

.metric-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-float);
  border-color: var(--color-primary-fixed);
}

.metric-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--color-primary);
  opacity: 0.8;
}

.metric-label {
  font-family: var(--ff-data);
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--on-surface-variant);
}

.metric-value {
  font-family: var(--ff-display);
  font-size: 2rem;
  font-weight: 800;
  color: var(--on-surface);
  letter-spacing: -0.5px;
}

.metric-trend {
  font-family: var(--ff-body);
  font-size: 0.75rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
}

.metric-trend.up {
  color: var(--color-success);
}

.metric-trend.down {
  color: var(--color-error);
}

.metric-trend.none {
  color: var(--on-surface-variant);
  opacity: 0.6;
}

/* Inventory Section — Harvesting Progress */
.inventory-grid {
  display: grid;
  grid-template-columns: 1fr 400px;
  gap: var(--space-lg);
  margin-top: var(--space-xl);
}

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

.inventory-card {
  background: var(--surface-container-lowest);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-ambient);
  overflow: hidden;
  border: 1px solid rgba(var(--color-primary-fixed-rgb), 0.1);
}

.card-header {
  padding: var(--space-lg);
  background: var(--surface-container-low);
  border-bottom: 1px solid var(--outline-variant);
}

.card-header h3 {
  font-family: var(--ff-display);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--color-primary);
  letter-spacing: 0.3px;
}

.inventory-body,
.audit-body {
  padding: var(--space-lg);
}

/* Stock Progress Items */
.stock-item {
  margin-bottom: 20px;
}

.stock-item:last-child {
  margin-bottom: 0;
}

.stock-info {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
}

.stock-info span {
  font-family: var(--ff-body);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--on-surface);
}

.stock-pct {
  color: var(--color-primary) !important;
  font-weight: 800 !important;
}

.progress-track {
  height: 8px;
  background: var(--surface-container-highest);
  border-radius: 4px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--color-primary), var(--color-primary-container));
  border-radius: 4px;
  transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Audit Items */
.audit-item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: 12px 10px;
  margin: 0 -10px;
  border-bottom: 1px solid var(--outline-variant);
  transition: all 0.2s ease;
  cursor: pointer;
  border-radius: var(--radius-md);
}

.audit-item:hover {
  background: var(--surface-container-high);
  transform: translateX(4px);
}

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

.audit-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
}

.audit-icon.success {
  background: rgba(56, 107, 49, 0.1);
  color: var(--color-success);
}

.audit-icon.pending {
  background: rgba(186, 149, 26, 0.1);
  color: #b45309;
}

.audit-details {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.audit-title {
  font-family: var(--ff-display);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--on-surface);
}

.audit-sub {
  font-family: var(--ff-body);
  font-size: 0.72rem;
  color: var(--on-surface-variant);
}

.audit-amount {
  font-family: var(--ff-data);
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--color-primary);
}

/* ============================================================
   10. BILLING LINE ITEMS (2-LINE GRID)
   ============================================================ */
.items-container {
  margin-bottom: var(--space-lg);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--outline-variant);
  background: var(--surface-container-lowest);
}

.items-header-grid {
  display: grid;
  grid-template-columns: 2fr 100px 1fr 1fr 1fr 50px;
  /* Default for Yellow/White */
  gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--outline-variant);
  background: var(--surface-container-lowest);
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.filter-select {
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--nav-border);
  background: var(--surface-container-low);
  color: var(--on-surface);
  font-family: var(--ff-data);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.filter-select:hover {
  border-color: var(--color-primary);
  background: var(--surface-container);
}

.filter-select:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px var(--color-primary-fixed-dim);
}


.items-grid-body {
  display: flex;
  flex-direction: column;
}

.item-grid-row {
  display: grid;
  grid-template-columns: 2fr 100px 1fr 1fr 1fr 50px;
  padding: 12px 16px;
  gap: 8px;
  border-bottom: 1px solid var(--outline-variant);
  align-items: center;
}

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

.item-grid-row input,
.item-grid-row select {
  width: 100%;
  background: var(--surface-container-low);
  border: none;
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  font-family: var(--ff-data);
  font-size: 0.82rem;
  color: var(--on-surface);
}

.item-variety,
.item-hsn,
.item-metrics {
  display: contents;
  /* Unwraps children into the parent .item-grid-row template columns */
}

.gst-header-grid,
.gst-item-row {
  grid-template-columns: 2fr 80px 100px 1fr 1fr 1fr 1fr 40px;
}

@media (max-width: 768px) {
  .items-header-grid {
    display: none;
  }

  .item-grid-row {
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
      "variety hsn"
      "metrics metrics"
      "action action";
    padding: var(--space-md);
    gap: 12px;
  }

  .item-variety {
    grid-area: variety;
    display: block;
  }

  .item-hsn {
    grid-area: hsn;
    display: block;
  }

  .item-metrics {
    grid-area: metrics;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }

  .gst-item-row .item-metrics {
    grid-template-columns: repeat(4, 1fr);
  }

  .item-action {
    grid-area: action;
    display: flex;
    justify-content: flex-end;
  }
}

/* ============================================================
   11. BILL RECORDS (GRID-BASED REPORTS)
   ============================================================ */
.bill-records-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: var(--space-md);
  margin-top: var(--space-md);
}

.bill-record-card {
  background: var(--surface-container-lowest);
  border-radius: var(--radius-lg);
  padding: var(--space-md);
  box-shadow: var(--shadow-ambient);
  border: 1px solid rgba(var(--color-primary-fixed-rgb), 0.2);
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: transform 0.2s;
}

.bill-record-card:hover {
  transform: translateY(-4px);
  border-color: var(--color-primary);
}

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

.bill-card-id {
  font-family: var(--ff-display);
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--color-primary);
}

.bill-card-date {
  font-family: var(--ff-data);
  font-size: 0.72rem;
  color: var(--on-surface-variant);
}

.bill-card-customer {
  font-family: var(--ff-display);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--on-surface);
}

.bill-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 8px;
  border-top: 1px dashed var(--outline-variant);
}

.bill-card-amount {
  font-family: var(--ff-data);
  font-size: 1.1rem;
  font-weight: 800;
}

.bill-card-actions {
  display: flex;
  gap: 8px;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  font-family: var(--ff-body);
  font-size: 0.82rem;
  color: var(--on-surface-variant);
}

.summary-row span:last-child,
.summary-row .inline-input {
  font-family: var(--ff-data);
  font-weight: 700;
  color: var(--on-surface);
  text-align: right;
}

.inline-input {
  width: 90px;
  background: var(--surface-container-highest);
  border: none;
  border-bottom: 2px solid var(--outline-variant);
  border-radius: var(--radius-sm);
  padding: 4px 8px;
  font-size: 0.85rem;
  transition: border-color 0.2s;
}

.inline-input:focus {
  outline: none;
  border-bottom-color: var(--color-primary);
  background: var(--surface-container-low);
}

.summary-row.total {
  margin-top: var(--space-md);
  padding-top: var(--space-md);
  border-top: 2px dashed var(--outline-variant);
  font-family: var(--ff-display);
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--color-primary);
}

.summary-row.total span:last-child {
  font-family: var(--ff-display);
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--color-primary);
}

.summary-footer {
  padding: var(--space-md) var(--space-lg);
  background: var(--surface-container-low);
  border-top: 1px solid rgba(var(--color-primary-fixed-rgb), 0.2);
}

.summary-footer .btn-save {
  width: 100%;
  padding: 15px;
  background: var(--gradient-primary);
  color: var(--color-on-primary);
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--ff-data);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 0.75rem;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.2s;
}

.summary-footer .btn-save:hover {
  opacity: 0.9;
  transform: scale(1.01);
}

/* GST rate inputs inside summary */
.summary-row input[type="number"] {
  width: 70px;
  text-align: right;
  background: var(--surface-container-high);
  border: none;
  border-bottom: 2px solid var(--outline-variant);
  border-radius: var(--radius-sm);
  padding: 6px 8px;
  font-family: var(--ff-data);
  font-size: 0.85rem;
  color: var(--on-surface);
  transition: border-color 0.2s;
}

.summary-row input[type="number"]:focus {
  outline: none;
  border-bottom-color: var(--color-primary);
}

/* Advance input */
.summary-row input[type="number"][id*="Advance"] {
  width: 110px;
}

/* Payment type select */
.summary-row select {
  background: var(--surface-container-high);
  border: none;
  border-bottom: 2px solid var(--outline-variant);
  border-radius: var(--radius-sm);
  padding: 6px 8px;
  font-family: var(--ff-data);
  font-size: 0.8rem;
  color: var(--on-surface);
  -webkit-appearance: auto;
  appearance: auto;
}

/* ============================================================
   14. DATA TABLES — "Industrial Grid"
   ============================================================ */
.table-responsive {
  overflow-x: auto;
  margin-top: 0;
  background: var(--surface-container-lowest);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-card);
  -webkit-overflow-scrolling: touch;
  width: 100%;
  border: 1px solid var(--outline-variant);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 100%;
  font-family: var(--ff-body);
}

thead {
  background: var(--surface-container-low);
  border-bottom: 1px solid var(--outline-variant);
}

thead tr th {
  padding: 12px 16px;
  text-align: left;
  font-family: var(--ff-display);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--on-surface-variant);
  white-space: nowrap;
  border: none;
}

td {
  padding: 12px 16px;
  font-family: var(--ff-body);
  font-size: 0.75rem;
  color: var(--on-surface);
  border-bottom: 1px solid var(--outline-variant);
}

/* Currency columns */
td:has(.emoji-btn),
td:last-child {
  white-space: nowrap;
}

tbody tr {
  transition: background-color 0.15s;
}

/* Alternating rows — no dividers, background shifts only */
tbody tr:nth-child(even) {
  background-color: var(--surface-container-low);
}

tbody tr:hover {
  background-color: rgba(var(--color-primary-fixed-rgb), 0.2);
}

/* Row hover reveals action glow */
tbody tr:hover td:last-child .emoji-btn {
  transform: scale(1.1);
}

.text-center {
  text-align: center;
}

.text-right {
  text-align: right;
}

/* Inline table inputs */
table input,
table select {
  width: 100% !important;
  padding: 8px 10px;
  background: var(--surface-container-low) !important;
  border: none;
  border-bottom: 2px solid var(--outline-variant);
  border-radius: var(--radius-sm);
  font-family: var(--ff-body);
  font-size: 0.85rem;
  color: var(--on-surface) !important;
  box-sizing: border-box;
  -webkit-appearance: none;
  appearance: none;
  transition: border-color 0.2s;
}

/* Prevent browser autofill from flashing white in dark themes */
table input:-webkit-autofill,
table input:-webkit-autofill:hover,
table input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0px 1000px var(--surface-container-low) inset !important;
  -webkit-text-fill-color: var(--on-surface) !important;
}

table input:focus,
table select:focus {
  outline: none;
  border-bottom-color: var(--color-primary);
  background: var(--surface-container-highest);
}

table input[readonly] {
  background: transparent;
  border-bottom-color: transparent;
  color: var(--on-surface-variant);
  font-weight: 600;
  cursor: not-allowed;
}

/* ============================================================
   15. VERSION POPUP
   ============================================================ */
.version-popup {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  background: var(--surface-container-lowest);
  color: var(--on-surface);
  border-radius: var(--radius-xl);
  box-shadow: 0 24px 80px rgba(0,0,0,0.35);
  width: 90%;
  max-width: 420px;
  max-height: 85vh;
  z-index: 10001;
  border: 1px solid var(--outline-variant);
  display: none;
  flex-direction: column;
  overflow: hidden;
  animation: modalIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalIn {
  from { transform: translate(-50%, -40%) scale(0.95); opacity: 0; }
  to { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(8px);
  z-index: 10000;
  display: none;
  animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.version-header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--surface-container);
  font-family: var(--ff-display);
  font-weight: 700;
  font-size: 0.875rem;
  color: var(--color-primary);
}

.version-body {
  padding: 16px 20px;
  overflow-y: auto;
  scrollbar-width: thin;
}

.version-body ul {
  list-style: disc;
  margin-left: 16px;
}

.version-body li {
  font-family: var(--ff-body);
  font-size: 0.8rem;
  margin: 4px 0;
  color: var(--on-surface-variant);
}

.version-popup .btn {
  margin: 8px 16px 14px;
  width: calc(100% - 32px);
}

/* ============================================================
   16. REPORT FILTERS
   ============================================================ */
.report-filters-grid {
  margin-top: 8px;
}

.report-filter-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: var(--space-md);
}

.report-filter-actions .btn {
  width: auto;
  grid-column: auto;
}

.report-filter-hint {
  display: block;
  margin-top: 10px;
  color: var(--on-surface-variant);
  font-family: var(--ff-data);
  font-size: 0.78rem;
}

.report-action-buttons {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

/* ============================================================
   17. STATUS BADGES / CHIPS
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-family: var(--ff-data);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}

.badge-gold {
  background: var(--color-secondary-container);
  color: var(--color-secondary);
}

.badge-success {
  background: rgba(46, 125, 50, 0.12);
  color: var(--color-success);
}

.badge-error {
  background: var(--color-error-container);
  color: var(--color-error);
}

/* Text utilities */
.text-success {
  color: var(--color-success);
  font-weight: 600;
}

.text-danger {
  color: var(--color-error);
  font-weight: 600;
}

.text-muted {
  color: var(--on-surface-variant);
}

/* ============================================================
   18. MOBILE BOTTOM NAVIGATION — "Nataraja Bar"
   ============================================================ */
.mobile-bottom-nav {
  display: none;
  /* hidden on desktop */
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 72px;
  /* iOS frosted glass */
  background: var(--nav-bg);
  backdrop-filter: blur(28px) saturate(200%);
  -webkit-backdrop-filter: blur(28px) saturate(200%);
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding: 0;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  border-radius: 20px 20px 0 0;
  box-shadow:
    0 -1px 0 rgba(255, 255, 255, 0.08) inset,
    0 -8px 32px rgba(0, 0, 0, 0.18);
  overflow: visible;
  z-index: 9999;
}

/* Inner top-highlight line for glass look */
.mobile-bottom-nav::before {
  content: '';
  position: absolute;
  top: 0;
  left: 12%;
  width: 76%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.25), transparent);
  pointer-events: none;
}

/* ── APPS GRID OVERLAY ── */
.mobile-apps-grid-overlay {
  position: fixed;
  bottom: 72px;
  left: 0;
  right: 0;
  background: var(--nav-bg);
  backdrop-filter: blur(32px) saturate(220%);
  -webkit-backdrop-filter: blur(32px) saturate(220%);
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 24px 24px 0 0;
  padding: 16px 14px 12px;
  display: none;
  z-index: 9998;
  box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.28);
  animation: slideUpGrid 0.22s cubic-bezier(0.34, 1.4, 0.64, 1);
}

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

.mobile-bottom-nav.apps-grid-active .mobile-apps-grid-overlay {
  display: block;
}

.apps-grid-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  padding: 0 2px;
}

.apps-grid-header > span {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--nav-text-active);
  opacity: 0.7;
}

.apps-grid-close {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 50%;
  width: 28px;
  height: 28px;
  color: var(--nav-text);
  cursor: pointer;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s ease;
}

.apps-grid-close:active {
  background: rgba(255, 255, 255, 0.22);
}

.apps-grid-content {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.app-grid-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px 4px 10px;
  border: none;
  background: rgba(255, 255, 255, 0.07);
  border-radius: 16px;
  cursor: pointer;
  color: var(--nav-text);
  transition: all 0.18s ease;
  -webkit-tap-highlight-color: transparent;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.app-grid-item:active {
  background: rgba(255, 255, 255, 0.18);
  transform: scale(0.93);
}

.app-grid-icon {
  font-size: 1.55rem;
  line-height: 1;
  display: block;
}

.app-grid-label {
  font-size: 9.5px;
  font-weight: 600;
  text-align: center;
  line-height: 1.25;
  color: var(--nav-text);
  letter-spacing: 0.1px;
}

/* ── Base Nav Bars — hidden by default ── */
.bottom-nav-landing,
.bottom-nav-clients,
.bottom-nav-bill,
.bottom-nav-purchase,
.bottom-nav-simple {
  display: none;
  width: 100%;
  height: 100%;
  justify-content: space-around;
  align-items: center;
}

/* ── State Visibility ── */
.mobile-bottom-nav:not([class*="-active"]) .bottom-nav-landing { display: flex; }
.mobile-bottom-nav.apps-grid-active .bottom-nav-landing       { display: flex; }
.mobile-bottom-nav.bill-active .bottom-nav-bill               { display: flex; }
.mobile-bottom-nav.clients-active .bottom-nav-clients         { display: flex; }
.mobile-bottom-nav.purchase-active .bottom-nav-purchase       { display: flex; }
.mobile-bottom-nav.simple-active .bottom-nav-simple           { display: flex; }

/* Each nav item */
.nav-item-circle {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  cursor: pointer;
  color: var(--nav-text);
  padding: 8px 2px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  border: none;
  background: none;
  -webkit-tap-highlight-color: transparent;
  position: relative;
  min-width: 0;
}

/* Active pill indicator */
.nav-item-circle.active::before {
  content: '';
  position: absolute;
  top: 6px;
  left: 50%;
  transform: translateX(-50%);
  width: 44px;
  height: 32px;
  background: rgba(255, 255, 255, 0.13);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  pointer-events: none;
}

.nav-item-circle i {
  font-size: 1.35rem;
  display: block;
  line-height: 1;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  z-index: 1;
}

.nav-item-circle span {
  font-family: var(--ff-primary);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.2px;
  text-transform: capitalize;
  line-height: 1.2;
  position: relative;
  z-index: 1;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.nav-item-circle:hover,
.nav-item-circle.active {
  color: var(--nav-text-active);
}

/* Bill-active special items */
.nav-item-circle.bill-home {
  opacity: 0.9;
}

.nav-item-circle.active span {
  color: var(--nav-text-active);
  font-weight: 700;
}

.nav-item-circle.active i {
  transform: translateY(-2px) scale(1.05);
}

/* ============================================================
   19. MOBILE HEADER — Logo + Brand only on mobile
   ============================================================ */
.mobile-header-row {
  display: none;
  /* only shows on mobile */
}

/* ============================================================
   19b. RESPONSIVE — MEDIUM SCREENS (tablets / small laptops)
   ============================================================ */
@media (max-width: 1100px) and (min-width: 769px) {
  .app-header h1 {
    font-size: 1.2rem;
  }
}

/* ============================================================
   20. RESPONSIVE — MOBILE
   ============================================================ */
@media (max-width: 768px) {

  /* ── Mobile bottom nav: show the wrapper ── */
  .mobile-bottom-nav {
    position: fixed;
    display: block;
    overflow: visible;
  }

  /* Landing bar always fills the nav wrapper by default */
  .bottom-nav-landing {
    display: flex;
    width: 100%;
    height: 100%;
  }

  body {
    padding-bottom: 110px !important;
    /* increased from 80px to prevent occlusion */
    overflow-x: hidden;
  }

  /* HIDE top desktop nav on mobile */
  .main-nav {
    display: none;
  }

  /* MOBILE HEADER: Logo + Brand Name ONLY — hide all other controls */
  .app-header {
    padding: 0 var(--space-md);
  }

  .app-header>div:first-child {
    height: auto;
    min-height: 64px;
    padding: 12px 0;
    gap: 16px !important;
    position: relative;
  }

  /* Hide settings menu, version label, and sub-header on mobile */
  .header-actions,
  #settingsMenu,
  #subHeader {
    display: none !important;
  }

  /* Float badge & stock button to top-right on mobile */
  .header-right-meta {
    position: absolute !important;
    right: 0 !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    padding: 2px;
    background: transparent;
    border: none;
    z-index: 1001;
    display: flex !important;
    align-items: center;
    gap: 8px;
  }

  #navUserBadge {
    position: static !important;
    transform: none !important;
    padding: 0 !important;
    background: transparent !important;
    border: none !important;
    display: flex !important;
  }

  #navUserBadge .nav-user-name {
    display: none;
  }

  #navUserBadge .nav-user-avatar {
    width: 32px;
    height: 32px;
    font-size: 14px;
    border: 2px solid rgba(255, 255, 255, 0.25);
  }

  /* Only logo + title remain — clamp to available width */
  .app-header h1 {
    font-size: 0.95rem;
    line-height: 1.2;
    white-space: normal;
    word-break: break-word;
    max-width: 62vw;
    text-align: left;
  }

  #appLogo {
    display: block !important;
    height: 36px;
  }

  /* Main content */
  .main-content {
    padding: var(--space-md) var(--space-sm);
    max-width: 100%;
    overflow: hidden;
  }

  /* Form cards */
  .form-card {
    padding: var(--space-md);
    border-radius: var(--radius-lg);
  }

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

  /* Inputs — prevent iOS zoom */
  .form-group input:not([type="checkbox"]):not([type="radio"]),
  .form-group select,
  .form-group textarea {
    font-size: 16px;
  }

  /* Billing layout to single col */
  .billing-grid-container {
    grid-template-columns: 1fr;
    gap: var(--space-md);
  }

  .summary-sidebar {
    position: static;
  }

  /* Section headers */
  .section-header h2 {
    font-size: 1.35rem;
  }

  .section-header h3 {
    font-size: 1.05rem;
  }

  /* Table cells */
  th {
    padding: 10px 8px;
    font-size: 0.62rem;
  }

  td {
    padding: 10px 8px;
    font-size: 0.82rem;
  }

  /* Table inputs */
  table input,
  table select {
    padding: 6px 8px !important;
    font-size: 0.8rem !important;
  }

  /* Buttons */
  .btn {
    padding: 12px 16px;
    font-size: 0.78rem;
  }

  .btn-small {
    padding: 7px 10px;
    font-size: 0.68rem;
  }

  .item-remove-btn .remove-text {
    display: none;
  }

  .item-remove-btn .remove-emoji {
    display: inline;
  }

  .settings-dropdown {
    position: fixed;
    top: 64px;
    right: 10px;
    min-width: 180px;
    max-width: calc(100vw - 20px);
    z-index: 3000;
  }

  .report-filter-actions {
    flex-direction: column;
  }

  .report-filter-actions .btn {
    width: 100%;
  }
}

/* ============================================================
   21. RESPONSIVE — SMALL MOBILE (< 480px)
   ============================================================ */
@media (max-width: 480px) {

  html,
  body {
    width: 100%;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
  }

  .app-header h1 {
    font-size: 0.9rem;
    max-width: 50vw;
  }

  .main-content {
    padding: 12px 8px;
  }

  .form-card {
    padding: 12px;
  }

  .form-card h3 {
    font-size: 0.95rem;
  }

  .section-header h2 {
    font-size: 1.1rem;
  }

  /* Card table layout for extreme mobile */
  .table-responsive {
    border-radius: var(--radius-lg);
  }

  #gstItemsTable th:nth-child(2),
  #gstItemsTable td:nth-child(2),
  #gstItemsTable th:nth-child(4),
  #gstItemsTable td:nth-child(4) {
    display: none;
  }

  .settings-dropdown {
    top: 58px;
    right: 8px;
  }

  .report-action-buttons {
    flex-direction: column;
  }

  .report-action-buttons .btn {
    width: 100%;
  }

  #logoutBtn {
    padding: 0.3rem 0.5rem !important;
    font-size: 0.62rem !important;
  }
}

/* ============================================================
   22. GST BILL TABLE MOBILE FIXES
   ============================================================ */
@media (max-width: 768px) {
  #gstItemsTable thead {
    font-size: 0.6rem;
  }

  #gstItemsTable th,
  #gstItemsTable td {
    padding: 6px 4px;
  }

  #gstItemsTable input,
  #gstItemsTable select {
    font-size: 0.72rem !important;
    padding: 4px !important;
  }

  #yellowItemsTable thead,
  #whiteItemsTable thead {
    font-size: 0.6rem;
  }

  #yellowItemsTable th,
  #yellowItemsTable td,
  #whiteItemsTable th,
  #whiteItemsTable td {
    padding: 6px 4px;
  }
}

/* ============================================================
   23. PRINT STYLES
   ============================================================ */
@media print {

  .app-header,
  .mobile-bottom-nav,
  .nav-btn,
  .btn,
  .settings-menu {
    display: none !important;
  }

  .main-content {
    padding: 0;
  }

  .form-card {
    box-shadow: none;
    page-break-inside: avoid;
    border: 1px solid #ccc;
  }

  body {
    background: white !important;
    padding-bottom: 0 !important;
    font-family: 'Public Sans', 'Inter', sans-serif !important;
  }
}

/* ============================================================
   24. DASHBOARD ACTIONS
   ============================================================ */
.dashboard-actions {
  display: flex;
  gap: var(--space-md);
  flex-wrap: wrap;
  margin-bottom: var(--space-xl);
}

/* ============================================================
   25. APP LOGO
   ============================================================ */
#appLogo {
  display: block;
  height: 70px;
  width: auto;
  object-fit: contain;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
  cursor: pointer;
}

#appTitle {
  cursor: pointer;
}

/* Floating Save Button in Settings */
.floating-save-container {
  position: fixed;
  bottom: 100px;
  /* Above mobile bottom nav */
  right: 24px;
  z-index: 2100;
  display: none;
  /* Only show in settings tab */
}

.floating-save-btn {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--color-primary);
  color: white;
  border: none;
  box-shadow: var(--shadow-float);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.floating-save-btn i {
  font-size: 1.5rem;
  line-height: 1;
  font-style: normal;
}

.floating-save-btn:hover {
  transform: scale(1.1) rotate(15deg);
  background: var(--color-primary-container);
}

.floating-save-btn:active {
  transform: scale(0.95);
}



/* --- Refined Mobile Adjustments --- */
@media (max-width: 1023px) {
  /* Hide desktop-specific sub-navigation sidebars */
  #customers aside:not(.summary-sidebar),
  #gst-bill > .flex > aside:not(.summary-sidebar),
  #purchase aside:not(.summary-sidebar),
  #yellow-bill aside:not(.summary-sidebar),
  #white-bill aside:not(.summary-sidebar) {
    display: none !important;
  }

  /* Adjust floating buttons to sit above the bottom nav */
  .floating-save-container {
    bottom: 90px !important;
    right: 16px !important;
  }
}

/* Ensure no overlap in bottom nav states */
.mobile-bottom-nav .bottom-nav-landing,
.mobile-bottom-nav .bottom-nav-clients,
.mobile-bottom-nav .bottom-nav-bill,
.mobile-bottom-nav .bottom-nav-purchase,
.mobile-bottom-nav .bottom-nav-simple {
  position: relative !important;
  top: auto !important;
  left: auto !important;
}


/* --- Styles extracted from index.html inline declarations --- */

/* Indicator Badge Pulse */
.indicator-pulse {
  background: var(--color-warning);
  animation: badge-pulse 1.5s infinite;
  display: inline-flex;
  border-radius: 50%;
  width: 8px;
  height: 8px;
}

@keyframes badge-pulse {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(251, 191, 36, 0.4); }
  70% { transform: scale(1.1); box-shadow: 0 0 0 6px rgba(251, 191, 36, 0); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(251, 191, 36, 0); }
}

/* Common Layout Utilities */
.flex-center-gap-2 { display: flex; align-items: center; gap: 8px; }
.min-w-100 { min-width: 100px; }
.divider-h { height: 1px; background: var(--nav-border); margin: 8px 0; }
.text-danger-sm { margin-top: 4px; font-weight: 600; font-size: 0.75rem; color: var(--color-error); }
.badge-surface {
  padding: 4px 8px;
  border-radius: 4px;
  border: 1px solid var(--nav-border);
  background: var(--color-surface-container);
  font-size: 0.75rem;
}

/* Harden Mobile Nav Visibility */
.mobile-bottom-nav #bottomNavLanding,
.mobile-bottom-nav #bottomNavClients,
.mobile-bottom-nav #bottomNavBill,
.mobile-bottom-nav #bottomNavPurchase,
.mobile-bottom-nav #bottomNavSimple {
  display: none !important;
}

.mobile-bottom-nav:not([class*="-active"]) #bottomNavLanding  { display: flex !important; }
.mobile-bottom-nav.apps-grid-active #bottomNavLanding         { display: flex !important; }
.mobile-bottom-nav.clients-active #bottomNavClients           { display: flex !important; }
.mobile-bottom-nav.bill-active #bottomNavBill                 { display: flex !important; }
.mobile-bottom-nav.purchase-active #bottomNavPurchase         { display: flex !important; }
.mobile-bottom-nav.simple-active #bottomNavSimple             { display: flex !important; }


/* --- Additional Utilities from Inline Styles --- */
.total-amount-large { font-weight: 800; font-size: 1.2rem; color: var(--color-primary); }
.summary-row-bold { font-weight: 600; }
.input-right { text-align: right; border: 1px solid var(--nav-border); padding: 4px; border-radius: 4px; background: var(--color-surface-container-low); }
.input-right-readonly { text-align: right; border: 1px solid var(--nav-border); padding: 4px; border-radius: 4px; background: var(--color-surface-container-low); color: var(--color-on-surface-variant); cursor: default; }
.toast-container-fixed { position: fixed; top: 16px; right: 16px; z-index: 99999; display: flex; flex-direction: column; gap: 8px; max-width: 320px; pointer-events: none; }
.divider-dashed { margin-top: 10px; border-top: 1px dashed var(--nav-border); padding-top: 10px; }
.divider-heavy { margin-top: 10px; padding-top: 10px; border-top: 2px solid var(--color-on-surface); }

/* --- Customer Directory Redesign Styles (Pill-Row Layout) --- */
#customersListUnified {
    margin-top: 10px;
}

.customer-pill-row {
    animation: fadeInRow 0.3s ease-out forwards;
}

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

/* Ensure no nested borders/pills inside the row labels */
.customer-pill-row div {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0;
}

/* But keep the specific account type label background */
.customer-pill-row span[class*="bg-"] {
    background: inherit !important; /* Resetting the broad transparent rule */
    padding: inherit;
}

/* Explicitly re-enabling backgrounds for specific status pills inside the row */
.customer-pill-row .bg-primary\/10 { background-color: rgba(var(--color-primary-rgb), 0.1) !important; }
.customer-pill-row .bg-gray-100 { background-color: #f3f4f6 !important; }

/* Mobile Card spacing */
@media (max-width: 768px) {
    #cust-list .form-card {
        background: transparent !important;
        box-shadow: none !important;
        border: none !important;
    }
    
    .customer-pill-row {
        margin-bottom: 4px;
    }
}

/* ============================================================
   GST BILL — Custom B2B/B2C Customer Dropdown
   ============================================================ */
.gst-cust-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0; right: 0;
  z-index: 500;
  background: var(--surface-container);
  border: 1px solid var(--outline-variant);
  border-radius: 12px;
  box-shadow: 0 8px 28px rgba(0,0,0,0.16), 0 2px 8px rgba(0,0,0,0.10);
  max-height: 272px;
  overflow-y: auto;
  scrollbar-width: thin;
  padding: 6px 4px;
}
.gst-cust-opt-group {
  padding: 6px 10px 3px;
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: var(--on-surface-variant);
  opacity: .55;
  pointer-events: none;
  user-select: none;
}
.gst-cust-opt {
  padding: 8px 10px;
  cursor: pointer;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  transition: background 0.12s;
}
.gst-cust-opt:hover {
  background: var(--color-primary);
  color: var(--color-on-primary);
}
.gst-cust-opt:hover .gst-cust-opt-sub { opacity: .85; }
.gst-cust-opt-name { font-size: 13px; font-weight: 600; }
.gst-cust-opt-sub  { font-size: 10px; opacity: .55; }
.gst-cust-no-results {
  padding: 14px;
  text-align: center;
  font-size: 12px;
  opacity: .45;
}

/* Payment status error highlight */
select.input-error { border-color: var(--color-error) !important; }

/* Customer balance chip in form */
.gst-balance-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 99px;
  font-size: 13px;
  font-weight: 700;
}
.gst-balance-chip.debit  { background: rgba(220,38,38,0.10); color: #dc2626; }
.gst-balance-chip.credit { background: rgba(22,163,74,0.10);  color: #16a34a; }
.gst-balance-chip.zero   { background: var(--surface-container-low); color: var(--on-surface-variant); opacity: .6; }

