/* Omkar BillCraft - Billing & Quotation Software Stylesheet */
:root {
  --bg-primary: #0b0f19;
  --bg-secondary: #131b2e;
  --bg-card: #1a233a;
  --bg-card-hover: #222e4d;
  --border-color: #2b395b;
  --border-focus: #3b82f6;
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  
  --accent-primary: #3b82f6;
  --accent-primary-hover: #2563eb;
  --accent-quotation: #8b5cf6;
  --accent-quotation-hover: #7c3aed;
  --accent-invoice: #059669;
  --accent-invoice-hover: #047857;
  --accent-danger: #ef4444;
  --accent-danger-hover: #dc2626;
  --accent-warning: #f59e0b;

  --paper-font: 'Times New Roman', Times, Georgia, serif;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.2), 0 2px 4px -2px rgba(0, 0, 0, 0.2);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.5);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
}

[data-theme="light"] {
  --bg-primary: #f1f5f9;
  --bg-secondary: #ffffff;
  --bg-card: #f8fafc;
  --bg-card-hover: #f1f5f9;
  --border-color: #e2e8f0;
  --border-focus: #2563eb;
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
}

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

body {
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.5;
  transition: background-color 0.2s ease, color 0.2s ease;
  overflow-x: hidden;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* App Header */
.app-header {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(12px);
}

.header-container {
  max-width: 1600px;
  width: 100%;
  margin: 0 auto;
  padding: 0.6rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: nowrap;
}

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
}

.brand-logo-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, #c02828 0%, #dc2626 50%, #f97316 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 800;
  font-size: 1.15rem;
  box-shadow: 0 4px 12px rgba(192, 40, 40, 0.4);
  flex-shrink: 0;
}

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

.brand-info h1 {
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  line-height: 1.2;
}

.brand-badge {
  font-size: 0.62rem;
  padding: 1px 6px;
  border-radius: 9999px;
  background: rgba(59, 130, 246, 0.15);
  color: var(--accent-primary);
  border: 1px solid rgba(59, 130, 246, 0.3);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.brand-sub {
  font-size: 0.72rem;
  color: var(--text-secondary);
  white-space: nowrap;
  line-height: 1.2;
}

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

/* Button System */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0.55rem 1.1rem;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.18s ease-in-out;
  text-decoration: none;
}

.btn-sm {
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
  border-radius: var(--radius-sm);
}

.btn-lg {
  padding: 0.85rem 1.6rem;
  font-size: 1rem;
  border-radius: var(--radius-lg);
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-primary-hover));
  color: white;
  box-shadow: 0 4px 14px rgba(59, 130, 246, 0.35);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(59, 130, 246, 0.45);
}

.btn-quotation {
  background: linear-gradient(135deg, #7c3aed, #6d28d9);
  color: white;
  box-shadow: 0 4px 14px rgba(124, 58, 237, 0.35);
}
.btn-quotation:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(124, 58, 237, 0.45);
}

.btn-invoice {
  background: linear-gradient(135deg, #059669, #047857);
  color: white;
  box-shadow: 0 4px 14px rgba(5, 150, 105, 0.35);
}
.btn-invoice:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(5, 150, 105, 0.45);
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}
.btn-secondary:hover {
  background: var(--bg-card-hover);
  border-color: var(--text-muted);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}
.btn-ghost:hover {
  background: var(--bg-card);
  color: var(--text-primary);
}

.btn-danger-ghost {
  background: transparent;
  color: var(--accent-danger);
}
.btn-danger-ghost:hover {
  background: rgba(239, 68, 68, 0.1);
}

/* Icon Buttons */
.icon-btn {
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
}
.icon-btn:hover {
  color: var(--text-primary);
  border-color: var(--text-muted);
  background: var(--bg-card-hover);
}

/* Cloud Sync Pill & Action Elements */
.cloud-sync-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px;
  border-radius: 9999px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}
.cloud-sync-pill:hover {
  border-color: var(--text-muted);
  background: var(--bg-card-hover);
}
.cloud-icon-symbol {
  font-size: 0.85rem;
  line-height: 1;
}
.sync-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  display: inline-block;
  flex-shrink: 0;
}

/* Main Container */
.main-wrapper {
  width: 100%;
  max-width: 1400px;
  min-width: 0;
  margin: 0 auto;
  padding: 1.5rem;
  box-sizing: border-box;
}

/* View Switcher */
.view-container {
  display: none;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}
.view-container.active {
  display: block;
}

/* Dashboard Styles */
.dashboard-hero {
  margin-bottom: 2rem;
}

.hero-header {
  margin-bottom: 1.5rem;
}
.hero-header h2 {
  font-size: 1.85rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 0.35rem;
}
.hero-header p {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

/* Primary Action Cards ("Below ask Quotation or Invoice") */
.creation-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2.25rem;
}

.creation-card {
  position: relative;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: var(--shadow-md);
}

.creation-card:hover {
  transform: translateY(-4px);
  border-color: var(--card-accent);
  box-shadow: 0 16px 30px -10px var(--card-glow);
}

.creation-card.quotation-card {
  --card-accent: #8b5cf6;
  --card-glow: rgba(139, 92, 246, 0.25);
  border-top: 4px solid #8b5cf6;
}

.creation-card.invoice-card {
  --card-accent: #10b981;
  --card-glow: rgba(16, 185, 129, 0.25);
  border-top: 4px solid #10b981;
}

.creation-card-body {
  margin-bottom: 1.5rem;
}

.card-icon-tag {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.card-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.quotation-card .card-icon {
  background: rgba(139, 92, 246, 0.15);
  color: #a78bfa;
}

.invoice-card .card-icon {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
}

.card-tag {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 4px 10px;
  border-radius: 9999px;
}
.quotation-card .card-tag {
  background: rgba(139, 92, 246, 0.12);
  color: #c4b5fd;
  border: 1px solid rgba(139, 92, 246, 0.3);
}
.invoice-card .card-tag {
  background: rgba(16, 185, 129, 0.12);
  color: #6ee7b7;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.creation-card h3 {
  font-size: 1.4rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
}

.creation-card p {
  color: var(--text-secondary);
  font-size: 0.88rem;
  line-height: 1.5;
  margin-bottom: 1rem;
}

.feature-bullets {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--text-muted);
}
.feature-bullets li {
  display: flex;
  align-items: center;
  gap: 8px;
}
.feature-bullets li span.check {
  color: #10b981;
  font-weight: bold;
}

/* KPI Summary Bar */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.kpi-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.kpi-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  background: var(--bg-card);
  color: var(--accent-primary);
}

.kpi-meta .kpi-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

.kpi-meta .kpi-value {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-primary);
}

/* Documents Table Section */
.docs-section {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  box-shadow: var(--shadow-md);
}

.section-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.section-title-wrap {
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.section-title-wrap h3 {
  font-size: 1.2rem;
  font-weight: 700;
}
.section-title-wrap span {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.filter-tabs {
  display: flex;
  background: var(--bg-card);
  padding: 3px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.filter-tab {
  padding: 5px 12px;
  font-size: 0.8rem;
  font-weight: 600;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
}
.filter-tab.active {
  background: var(--accent-primary);
  color: white;
}

.search-input-wrap {
  position: relative;
  min-width: 240px;
}
.search-input-wrap input {
  width: 100%;
  padding: 0.5rem 0.8rem 0.5rem 2.2rem;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  font-size: 0.85rem;
}
.search-input-wrap input:focus {
  outline: none;
  border-color: var(--border-focus);
}
.search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

/* Modern Data Table */
.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.85rem;
}

.data-table th {
  padding: 0.75rem 1rem;
  background: var(--bg-card);
  color: var(--text-secondary);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border-color);
}

.data-table td {
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-primary);
  vertical-align: middle;
}

.data-table tr:hover td {
  background: var(--bg-card-hover);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  font-size: 0.72rem;
  font-weight: 700;
  border-radius: 9999px;
  text-transform: uppercase;
}

.badge-quotation {
  background: rgba(139, 92, 246, 0.15);
  color: #a78bfa;
  border: 1px solid rgba(139, 92, 246, 0.3);
}

.badge-invoice {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-paid {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
}

.table-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ============================================================
   EDITOR / CREATOR VIEW & SPLIT PREVIEW LAYOUT
   ============================================================ */
.editor-layout {
  display: grid;
  grid-template-columns: minmax(400px, 1fr) minmax(560px, 1.25fr);
  gap: 1.5rem;
  align-items: start;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.form-column,
.preview-pane {
  min-width: 0;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.form-card {
  min-width: 0;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

@media (max-width: 1200px) and (min-width: 901px) {
  .editor-layout {
    grid-template-columns: minmax(360px, 1fr) minmax(480px, 1.15fr);
    gap: 1.25rem;
  }
}

@media (max-width: 900px) {
  .editor-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 1.25rem;
  }
}

.editor-bar {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

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

.type-toggle-pill {
  display: flex;
  background: var(--bg-card);
  padding: 4px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
}

.type-toggle-btn {
  padding: 6px 16px;
  font-size: 0.85rem;
  font-weight: 700;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.15s ease;
}

.type-toggle-btn.active.quotation {
  background: #7c3aed;
  color: white;
}
.type-toggle-btn.active.invoice {
  background: #059669;
  color: white;
}

.editor-bar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Editor Form Panels */
.form-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow-sm);
}

.form-card-title {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.75rem;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.35rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 1.35rem;
}

.form-group:last-child {
  margin-bottom: 0;
}

.form-group label {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
  display: block;
}

.form-control {
  width: 100%;
  padding: 0.7rem 1rem;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  font-size: 0.9rem;
  font-family: inherit;
  transition: all 0.18s ease;
  line-height: 1.45;
}

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

textarea.form-control {
  resize: vertical;
  min-height: 75px;
  line-height: 1.45;
}


/* Line Items Editor in Form */
.item-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  margin-bottom: 1.25rem;
  position: relative;
  transition: border-color 0.15s ease;
}


.item-card:hover {
  border-color: var(--text-muted);
}

.item-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.item-index-badge {
  font-size: 0.75rem;
  font-weight: 800;
  background: var(--border-color);
  color: var(--text-primary);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
}

.calc-tag {
  font-size: 0.72rem;
  color: var(--accent-primary);
  background: rgba(59, 130, 246, 0.1);
  padding: 2px 6px;
  border-radius: 4px;
}

/* Item Metrics Grid - Responsive 2x2 on Mobile/Tablet, 4-col on Large screens */
.item-metrics-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 0.75rem;
}

@media (min-width: 1300px) {
  .item-metrics-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.item-totals-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 0.85rem;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 8px 12px;
}

[data-theme="light"] .item-totals-strip {
  background: rgba(0, 0, 0, 0.03);
}

.item-total-col {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.item-total-col .tot-lbl {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
}

.item-total-col .tot-val {
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--text-primary);
}

.item-total-col.item-total-highlight .tot-val {
  color: var(--accent-primary);
  font-weight: 800;
}

/* Live Paper Preview Column */
.preview-pane {
  position: sticky;
  top: 76px;
  height: calc(100vh - 88px);
  min-height: 680px;
  display: flex;
  flex-direction: column;
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
}

.preview-controls {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 0.75rem;
  padding: 0.25rem 0;
  box-sizing: border-box;
}

.preview-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

/* ============================================================
   A4 PAPER REPLICA - EXACT RENDERING OF USER IMAGES
   ============================================================ */
.paper-scroll-wrapper {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  box-sizing: border-box;
  background: #141b2e;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 24px 20px;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.35);
  scrollbar-width: thin;
  scrollbar-color: rgba(59, 130, 246, 0.4) transparent;
}
[data-theme="light"] .paper-scroll-wrapper {
  background: #edf2f7;
  border-color: #cbd5e1;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.06);
  scrollbar-color: #94a3b8 transparent;
}

.invoice-paper {
  width: 210mm;
  min-height: 295mm;
  background: #ffffff !important;
  color: #000000 !important;
  font-family: var(--paper-font);
  font-size: 11.5px;
  line-height: 1.28;
  padding: 8mm 14mm 8mm 14mm;
  margin: 0 auto;
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  box-sizing: border-box;
  position: relative;
  -webkit-font-smoothing: antialiased;
  text-align: left;
}

/* Quotation Style Top Title */
.doc-main-title {
  text-align: center;
  font-size: 22px;
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 3px;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
  color: #000000;
}

/* Document Header Area */
.doc-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 6px;
}

.company-title {
  color: #c02828 !important;
  font-size: 21px;
  font-weight: 800;
  margin-bottom: 2px;
  letter-spacing: -0.2px;
  font-family: var(--paper-font);
}

.company-details-block {
  font-size: 11.5px;
  line-height: 1.38;
  color: #1c2850 !important;
  font-weight: 700;
}
.company-details-block span.strong {
  font-weight: 800;
  color: #1c2850 !important;
}

.doc-meta-right {
  text-align: right;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.38;
  color: #111111;
}

.doc-meta-right .doc-number {
  font-size: 14px;
  font-weight: 800;
  color: #000000;
}

.paper-divider {
  border: none;
  border-top: 1.2px solid #000000;
  margin: 6px 0 7px 0;
}

/* Tax Invoice Specific Centered Title */
.tax-invoice-title {
  text-align: center;
  font-size: 24px;
  font-weight: 600;
  letter-spacing: 0.3px;
  margin: 4px 0 10px 0;
  color: #000000;
  font-family: var(--paper-font);
}

/* Bill To / Recipient Block - Compact Matching Reference Quotation */
.recipient-block {
  margin-top: 4px;
  margin-bottom: 8px;
  padding: 0;
  font-size: 12px;
  line-height: 1.35;
  text-align: left;
}

.recipient-block .to-label {
  font-size: 13px;
  font-weight: 800;
  color: #1c2850 !important;
  margin: 0;
  padding: 0;
  line-height: 1.25;
  display: block;
}

.recipient-block .client-name {
  color: #1c2850 !important;
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  margin: 1px 0 0 0;
  padding: 0;
  line-height: 1.25;
  display: block;
}

.recipient-block .client-gst {
  color: #1c2850 !important;
  font-size: 12px;
  font-weight: 800;
  margin: 2px 0 0 0;
  padding: 0;
  line-height: 1.25;
  display: block;
}

/* Space after business name before Office Address */
.recipient-block .office-address-wrapper {
  margin-top: 8px;
  margin-bottom: 0;
  padding: 0;
}

.recipient-block .office-address-label {
  font-weight: 700;
  color: #1c2850 !important;
  font-size: 12px;
  line-height: 1.25;
  display: block;
  margin: 0 0 1px 0;
  padding: 0;
}

.recipient-block .client-address {
  color: #1c2850 !important;
  font-weight: 800;
  font-size: 12px;
  line-height: 1.35;
  display: block;
  margin: 0;
  padding: 0;
  white-space: pre-line;
}

/* Space after address before Dear Sir/Mam and space after thank you before table */
.inquiry-salutation {
  color: #5a0e38;
  font-weight: 700;
  font-size: 11.5px;
  line-height: 1.35;
  margin-top: 8px;
  margin-bottom: 8px;
  padding: 0;
}

.inquiry-salutation .inquiry-note-text {
  padding-left: 14px;
  margin-top: 1px;
}

/* Paper Table (Identical to reference image) */
.paper-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 8px;
  margin-bottom: 6px;
  font-size: 11.5px;
  font-family: var(--paper-font);
}

.paper-table th {
  border-top: 1.5px solid #000000;
  border-bottom: 1.5px solid #000000;
  padding: 5px 4px;
  font-weight: 800;
  color: #000000;
  font-size: 12px;
}

.paper-table td {
  padding: 3.5px 4px;
  vertical-align: top;
  color: #000000;
  font-weight: 700;
  font-size: 11.5px;
}

.paper-table .text-center { text-align: center; }
.paper-table .text-right { text-align: right; }
.paper-table .text-left { text-align: left; }
.paper-table .fw-bold { font-weight: 700; }

/* Sub-items in Tax Invoice */
.group-header-row td {
  font-weight: 800;
  padding-top: 5px;
  padding-bottom: 2px;
}
.sub-item-row td:first-child {
  padding-left: 4px;
}

/* Table Totals Row */
.table-summary-bar {
  border-top: 1.5px solid #000000;
  border-bottom: 3px double #000000;
  font-weight: 800;
}
.table-summary-bar td {
  padding: 4px 4px;
  font-weight: 800;
  font-size: 12px;
}

/* Breakdown block on bottom right */
.tax-breakdown-wrapper {
  display: flex;
  justify-content: flex-end;
  margin-top: 4px;
  margin-bottom: 8px;
}

.tax-breakdown-table {
  width: 250px;
  border-collapse: collapse;
  font-size: 12px;
  font-family: var(--paper-font);
  color: #000000 !important;
}

.tax-breakdown-table td {
  padding: 1.5px 3px;
  color: #000000 !important;
}

.tax-breakdown-table .label {
  font-weight: 700;
  text-align: left;
}

.tax-breakdown-table .sym {
  font-weight: 700;
  text-align: right;
  width: 16px;
}

.tax-breakdown-table .val {
  font-weight: 700;
  text-align: right;
  white-space: nowrap;
}

.tax-breakdown-table tr.grand-total-row td {
  color: #c02828 !important;
  font-size: 13px;
  font-weight: 800;
  padding-top: 2px;
}

/* Words representation */
.amount-in-words-block {
  margin: 6px 0 10px 0;
  font-size: 12px;
  font-family: var(--paper-font);
  text-align: left;
}

.amount-in-words-block .label {
  font-weight: 800;
  margin-bottom: 2px;
  color: #000000;
}

.amount-in-words-block .words {
  font-weight: 500;
  color: #111111;
  font-style: normal;
}

/* Terms and conditions block */
.terms-conditions-block {
  margin: 10px 0 14px 0;
  font-size: 12px;
  font-family: var(--paper-font);
  text-align: left;
}

.terms-conditions-block .label {
  font-weight: 800;
  margin-bottom: 2px;
  color: #000000;
}

.terms-conditions-block .words {
  font-weight: 500;
  color: #111111;
  font-style: normal;
}

/* Footer Section */
.paper-footer-section {
  margin-top: 14px;
  padding-top: 4px;
}

.paper-note-pink {
  color: #8b135b;
  font-weight: 700;
  font-size: 11px;
  margin-bottom: 4px;
}

.paper-footer-cols {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  border-top: none !important; /* No border in attached reference image */
  padding-top: 2px;
}

.payment-instructions {
  font-size: 11.5px;
  line-height: 1.4;
  font-family: var(--paper-font);
  text-align: left;
}

.payment-instructions .title {
  color: #000000;
  font-weight: 800;
  font-size: 12.5px;
  margin-bottom: 2px;
}

.payment-instructions p {
  margin: 1px 0;
  color: #1c2850 !important;
  font-weight: 700;
}

.payment-instructions span.bank-key {
  color: #000000;
  font-weight: 700;
}

.signature-block {
  text-align: center;
  font-size: 11px;
  font-family: var(--paper-font);
}

.signature-block .for-company {
  font-weight: 800;
  font-size: 11.5px;
  text-transform: uppercase;
  margin-bottom: 2px;
  color: #000000;
}

.signature-graphic-area {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.signature-graphic-area img,
.signature-graphic-area svg {
  max-height: 44px;
  width: auto;
}

.signature-block .auth-title {
  font-weight: 700;
  font-size: 10px;
  letter-spacing: 0.5px;
  color: #000000;
  text-transform: uppercase;
  margin-top: 2px;
}

/* Bottom execution red notice - clearly padded from bottom */
.execution-notice-box {
  margin-top: 6px;
  margin-bottom: 2px;
  border-top: 1.2px solid #000000;
  border-bottom: 1.2px solid #000000;
  padding: 3px 0;
  font-size: 11.5px;
  font-weight: 800;
  color: #c02828;
  display: block !important;
  visibility: visible !important;
  page-break-inside: avoid !important;
}


/* Modals */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
  padding: 1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-box {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  max-width: 600px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 1.75rem;
  box-shadow: var(--shadow-xl);
}

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

.modal-header h3 {
  font-size: 1.25rem;
  font-weight: 800;
}

/* Canvas drawing container */
.signature-canvas-wrap {
  background: #ffffff;
  border: 2px dashed #94a3b8;
  border-radius: var(--radius-md);
  margin: 10px 0;
  display: flex;
  justify-content: center;
}

#signatureCanvas {
  cursor: crosshair;
  background: #ffffff;
}

/* Toast Notification */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #1e293b;
  color: #f8fafc;
  border-left: 4px solid var(--accent-primary);
  padding: 12px 20px;
  border-radius: var(--radius-md);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
  font-size: 0.9rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 1000;
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

/* ============================================================
   WHATSAPP & MODAL STYLES
   ============================================================ */
.btn-whatsapp {
  background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
  color: #ffffff !important;
  font-weight: 600;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 4px 14px rgba(37, 211, 102, 0.3);
  display: inline-flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-whatsapp:hover {
  background: linear-gradient(135deg, #2ae06d 0%, #159f8f 100%);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(37, 211, 102, 0.45);
}

.btn-whatsapp-sm {
  background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
  color: #ffffff !important;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  border: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(37, 211, 102, 0.25);
  transition: all 0.18s ease;
}

.btn-whatsapp-sm:hover {
  background: linear-gradient(135deg, #2ae06d 0%, #159f8f 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(37, 211, 102, 0.38);
}

/* PDF Share Button */
.btn-pdf-share {
  background: linear-gradient(135deg, #7b5ea7 0%, #4c3580 100%);
  color: #ffffff !important;
  font-weight: 600;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 4px 14px rgba(123, 94, 167, 0.35);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-pdf-share:hover {
  background: linear-gradient(135deg, #9270c4 0%, #6245a0 100%);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(123, 94, 167, 0.5);
}

.btn-pdf-share:disabled,
.btn-pdf-share[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* WhatsApp Modal Action Grid - 2 small + 1 wide */
.wa-modal-action-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.wa-modal-action-grid .wa-send-btn {
  grid-column: span 2;
  justify-content: center;
  padding: 0.75rem 1rem;
  font-size: 0.97rem;
}

@media (max-width: 480px) {
  .wa-modal-action-grid {
    grid-template-columns: 1fr;
  }
  .wa-modal-action-grid .wa-send-btn {
    grid-column: span 1;
  }
  .wa-modal-action-grid .btn {
    width: 100%;
    justify-content: center;
    padding: 0.8rem 1rem;
    font-size: 0.95rem;
  }
}

/* Modal System */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(10, 15, 29, 0.78);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 1.5rem;
  opacity: 0;
  transition: opacity 0.22s ease;
}

.modal-overlay.active {
  display: flex;
  opacity: 1;
}

.modal-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 540px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 1.5rem;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.5);
  animation: modalScaleUp 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalScaleUp {
  0% { transform: scale(0.92); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.modal-box-whatsapp {
  max-width: 620px;
  padding: 0 !important;
  overflow: hidden;
  border-radius: 20px;
}

.modal-box-whatsapp .modal-header,
.modal-box-whatsapp .wa-modal-inner {
  padding: 1.25rem 1.4rem;
}

/* WhatsApp Authentic Header */
.wa-chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: linear-gradient(135deg, #008069 0%, #075e54 100%);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  transition: background 0.25s ease;
}

[data-theme="dark"] .wa-chat-header,
.modal-box-whatsapp.wa-theme-dark .wa-chat-header {
  background: linear-gradient(135deg, #1f2c34 0%, #121b22 100%);
}

.modal-box-whatsapp.wa-theme-light .wa-chat-header {
  background: linear-gradient(135deg, #008069 0%, #075e54 100%);
}

.wa-chat-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

/* WhatsApp DP Avatar (Display Picture) */
.wa-dp-container {
  position: relative;
  width: 44px;
  height: 44px;
  cursor: pointer;
  flex-shrink: 0;
  user-select: none;
}

.wa-dp-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  border: 2px solid rgba(255, 255, 255, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.45rem;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s ease, border-color 0.2s ease;
}

.wa-dp-container:hover .wa-dp-avatar {
  transform: scale(1.08);
  border-color: #25D366;
  box-shadow: 0 0 12px rgba(37, 211, 102, 0.5);
}

.wa-dp-status-dot {
  position: absolute;
  bottom: 1px;
  right: 1px;
  width: 12px;
  height: 12px;
  background: #25D366;
  border: 2px solid #ffffff;
  border-radius: 50%;
  box-shadow: 0 0 6px #25D366;
}

.wa-chat-contact-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.wa-chat-contact-name {
  color: #ffffff;
  font-weight: 700;
  font-size: 0.96rem;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wa-verified-badge {
  background: #25D366;
  color: #ffffff;
  border-radius: 50%;
  width: 15px;
  height: 15px;
  font-size: 0.62rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  flex-shrink: 0;
}

.wa-chat-status {
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.85);
  font-weight: 500;
}

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

.wa-header-icon-btn {
  background: rgba(255, 255, 255, 0.12);
  border: none;
  color: #ffffff;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  transition: background 0.15s ease, transform 0.15s ease;
}

.wa-header-icon-btn:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: scale(1.05);
}

.wa-header-icon-btn.wa-close-btn {
  font-size: 0.88rem;
  font-weight: 800;
}

/* Real-Time Emoji Drawer */
.wa-emoji-drawer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.28s ease, padding 0.28s ease;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  padding: 0 16px;
}

.wa-emoji-drawer.active {
  max-height: 180px;
  padding: 12px 16px;
}

.wa-emoji-drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.wa-emoji-drawer-sub {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 500;
}

.wa-emoji-preset-row {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 8px;
  -webkit-overflow-scrolling: touch;
}

.wa-emoji-pill {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 4px 10px;
  font-size: 0.76rem;
  color: var(--text-primary);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
  font-weight: 600;
}

.wa-emoji-pill:hover,
.wa-emoji-pill.active {
  border-color: #25D366;
  background: rgba(37, 211, 102, 0.15);
  color: #25D366;
  font-weight: 700;
  transform: translateY(-1px);
}

.wa-custom-emoji-row {
  margin-top: 4px;
}

.wa-custom-emoji-row input {
  padding: 0.35rem 0.65rem;
  font-size: 0.8rem;
  border-radius: 8px;
}

/* WhatsApp Document Context Badge */
.whatsapp-doc-badge {
  background: rgba(37, 211, 102, 0.12);
  border: 1px solid rgba(37, 211, 102, 0.3);
  color: #25D366;
  border-radius: var(--radius-md);
  padding: 9px 14px;
  font-weight: 600;
  font-size: 0.85rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1rem;
}

.wa-doc-badge-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.wa-doc-badge-amount {
  font-weight: 800;
  font-size: 0.95rem;
  flex-shrink: 0;
}

/* WhatsApp Chat Preview Box (Doodle pattern background) */
.wa-chat-preview-box {
  background-color: #efeae2;
  background-image: radial-gradient(#d6ceb6 0.75px, transparent 0.75px);
  background-size: 14px 14px;
  border-radius: 12px;
  padding: 14px 14px;
  max-height: 180px;
  overflow-y: auto;
  border: 1px solid var(--border-color);
  margin-top: 0.75rem;
  transition: background-color 0.2s ease;
}

[data-theme="dark"] .wa-chat-preview-box,
.modal-box-whatsapp.wa-theme-dark .wa-chat-preview-box {
  background-color: #0b141a;
  background-image: radial-gradient(#1f2c34 0.75px, transparent 0.75px);
}

.modal-box-whatsapp.wa-theme-light .wa-chat-preview-box {
  background-color: #efeae2;
  background-image: radial-gradient(#d6ceb6 0.75px, transparent 0.75px);
}

.wa-chat-bubble.outgoing {
  background: #d9fdd3;
  color: #111b21;
  border-radius: 8px 0px 8px 8px;
  padding: 8px 12px;
  max-width: 92%;
  margin-left: auto;
  box-shadow: 0 1px 1.5px rgba(0, 0, 0, 0.15);
  font-size: 0.82rem;
  line-height: 1.45;
  word-break: break-word;
  position: relative;
}

[data-theme="dark"] .wa-chat-bubble.outgoing,
.modal-box-whatsapp.wa-theme-dark .wa-chat-bubble.outgoing {
  background: #005c4b;
  color: #e9edef;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

.modal-box-whatsapp.wa-theme-light .wa-chat-bubble.outgoing {
  background: #d9fdd3;
  color: #111b21;
}

.wa-bubble-text {
  white-space: pre-wrap;
  font-family: inherit;
}

.wa-bubble-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  margin-top: 4px;
  font-size: 0.68rem;
  color: #667781;
}

[data-theme="dark"] .wa-bubble-meta,
.modal-box-whatsapp.wa-theme-dark .wa-bubble-meta {
  color: rgba(233, 237, 239, 0.6);
}

.wa-bubble-checks {
  color: #53bdeb;
  font-weight: 800;
  font-size: 0.72rem;
}

.wa-textarea {
  font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
  font-size: 0.8rem;
  line-height: 1.45;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  white-space: pre-wrap;
  resize: vertical;
  min-height: 100px;
  padding: 8px 12px;
}

[data-theme="light"] .wa-textarea {
  background: #f8fafc;
  color: #0f172a;
}

/* ============================================================
   MOBILE RESPONSIVENESS & TOUCH ADAPTATION
   ============================================================ */
@media (max-width: 900px) {
  .preview-pane {
    position: static !important;
    height: auto !important;
    max-height: none !important;
    width: 100% !important;
  }

  .paper-scroll-wrapper,
  .a4-preview-viewport {
    height: auto !important;
    max-height: none !important;
    padding: 12px 6px !important;
    overflow-x: hidden !important;
    overflow-y: visible !important;
    border-radius: 12px !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: flex-start !important;
  }
}

@media (max-width: 768px) {
  .header-container {
    padding: 0.6rem 0.85rem;
  }

  .brand-logo-icon {
    width: 36px;
    height: 36px;
    font-size: 1.1rem;
    border-radius: 10px;
  }

  .brand-info h1 {
    font-size: 1rem;
  }

  .brand-sub {
    display: none;
  }

  .main-wrapper {
    padding: 0.75rem;
  }

  .hero-header h2 {
    font-size: 1.45rem;
  }

  .creation-cards-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .creation-card {
    padding: 1.25rem;
  }

  .kpi-grid {
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
  }

  .kpi-card {
    padding: 0.9rem;
  }

  .kpi-card .kpi-val {
    font-size: 1.2rem;
  }

  .dashboard-controls {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }

  .filter-tabs-pill {
    width: 100%;
    overflow-x: auto;
    display: flex;
    justify-content: space-between;
  }

  .search-input-wrap {
    width: 100%;
    min-width: 0;
  }

  .editor-bar {
    padding: 0.85rem;
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }

  .editor-bar-left {
    width: 100%;
    justify-content: space-between;
  }

  .type-toggle-pill {
    width: 100%;
  }

  .type-toggle-btn {
    flex: 1;
    text-align: center;
    padding: 8px 10px;
    font-size: 0.82rem;
  }

  .editor-bar-right {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .editor-bar-right .btn-whatsapp {
    grid-column: span 2;
    justify-content: center;
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
  }

  .editor-bar-right #printDocBtn {
    grid-column: span 1;
  }

  .form-card {
    padding: 1rem;
    border-radius: var(--radius-lg);
  }

  .form-row {
    grid-template-columns: 1fr !important;
    gap: 0.75rem;
  }

  /* Prevent auto-zooming on focus in iOS Safari */
  .form-control, input, select, textarea {
    font-size: 16px !important;
  }

  .modal-overlay {
    padding: 0.75rem;
  }

  .modal-box {
    padding: 1.15rem;
    max-width: 100%;
    border-radius: var(--radius-lg);
  }

  .table-actions {
    flex-wrap: wrap;
    gap: 4px;
  }

  .table-actions .btn {
    padding: 4px 8px;
    font-size: 0.75rem;
  }

  .item-card {
    padding: 1rem;
  }
}

@media (max-width: 480px) {
  .kpi-grid {
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
  }

  .kpi-card .kpi-label {
    font-size: 0.65rem;
  }

  .kpi-card .kpi-val {
    font-size: 1.05rem;
  }

  .editor-bar-right {
    grid-template-columns: 1fr;
  }

  .editor-bar-right button {
    width: 100%;
    justify-content: center;
  }
}

/* ============================================================
   OMKAR BILLCRAFT — UPGRADED BILLING & RECEIVABLES DESIGN SYSTEM
   ============================================================ */

/* Desktop Navigation Links */
.desktop-nav-links {
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-tab-btn {
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.86rem;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.nav-tab-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.nav-tab-btn.active {
  background: rgba(59, 130, 246, 0.15);
  color: var(--accent-primary);
  border-color: rgba(59, 130, 246, 0.3);
}

/* Record Payment Action Button */
.btn-record-pay {
  background: linear-gradient(135deg, #059669 0%, #10b981 100%);
  color: #ffffff;
  font-weight: 700;
  border: none;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.35);
}

.btn-record-pay:hover {
  background: linear-gradient(135deg, #047857 0%, #059669 100%);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.45);
}

/* Cloud Sync Status Pill */
.cloud-sync-pill {
  font-size: 0.78rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.sync-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
}

/* Dashboard Top Header & Periods */
.dashboard-header-section {
  margin-bottom: 1.5rem;
}

.dashboard-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 1.25rem;
}

.dashboard-title-row h2 {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.dashboard-title-row p {
  font-size: 0.88rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

.quick-action-btns-desktop {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

/* Period Filter Bar */
.period-filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}

.period-tabs {
  display: inline-flex;
  gap: 4px;
  background: var(--bg-card);
  padding: 4px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.period-btn {
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 5px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
}

.period-btn:hover {
  color: var(--text-primary);
}

.period-btn.active {
  background: var(--accent-primary);
  color: #ffffff;
}

.custom-date-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* 4 Primary Financial KPI Cards */
.financial-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.fin-card {
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.35rem;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  position: relative;
  overflow: hidden;
  border: none;
  color: #ffffff;
}

.fin-card:hover {
  transform: translateY(-3px);
}

.fin-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 0.65rem;
}

.fin-card-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(4px);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  color: #ffffff;
  flex-shrink: 0;
}

.fin-card-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.95);
  letter-spacing: normal;
  text-transform: capitalize;
}

.fin-card-value {
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #ffffff;
  margin-bottom: 0.35rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}

.fin-card-footer {
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.85);
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Card 1: Purple / Indigo Gradient (Total Invoiced) */
.fin-card-invoiced {
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.28);
}
.fin-card-invoiced:hover {
  box-shadow: 0 12px 28px rgba(99, 102, 241, 0.4);
}

/* Card 2: Pink / Rose Gradient (Amount Received) */
.fin-card-received {
  background: linear-gradient(135deg, #f472b6 0%, #ec4899 50%, #db2777 100%);
  box-shadow: 0 8px 24px rgba(236, 72, 153, 0.28);
}
.fin-card-received:hover {
  box-shadow: 0 12px 28px rgba(236, 72, 153, 0.4);
}

/* Card 3: Cyan / Sky Blue Gradient (Outstanding) */
.fin-card-outstanding {
  background: linear-gradient(135deg, #38bdf8 0%, #06b6d4 100%);
  box-shadow: 0 8px 24px rgba(6, 182, 212, 0.28);
}
.fin-card-outstanding:hover {
  box-shadow: 0 12px 28px rgba(6, 182, 212, 0.4);
}

/* Card 4: Emerald Green Gradient (Pending Invoices) */
.fin-card-pending {
  background: linear-gradient(135deg, #34d399 0%, #10b981 50%, #059669 100%);
  box-shadow: 0 8px 24px rgba(16, 185, 129, 0.28);
}
.fin-card-pending:hover {
  box-shadow: 0 12px 28px rgba(16, 185, 129, 0.4);
}

.fin-card-invoiced .fin-card-value,
.fin-card-received .fin-card-value,
.fin-card-outstanding .fin-card-value,
.fin-card-pending .fin-card-value {
  color: #ffffff !important;
}

/* Secondary Status Counts Strip */
.status-summary-strip {
  display: flex;
  gap: 8px;
  flex-wrap: nowrap;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding: 2px 0 6px 0;
  margin-bottom: 1.25rem;
}
.status-summary-strip::-webkit-scrollbar {
  display: none;
}

.status-chip {
  flex-shrink: 0;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.76rem;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 9999px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.status-chip:hover {
  border-color: var(--text-muted);
  transform: translateY(-1px);
}

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

.chip-paid .chip-dot { background: #10b981; }
.chip-partial .chip-dot { background: #3b82f6; }
.chip-unpaid .chip-dot { background: #f59e0b; }
.chip-overdue .chip-dot { background: #ef4444; }
.chip-quote .chip-dot { background: #8b5cf6; }

/* Status Badges */
.badge-paid {
  background: rgba(16, 185, 129, 0.15) !important;
  color: #10b981 !important;
  border: 1px solid rgba(16, 185, 129, 0.3) !important;
}

.badge-partial {
  background: rgba(59, 130, 246, 0.15) !important;
  color: #3b82f6 !important;
  border: 1px solid rgba(59, 130, 246, 0.3) !important;
}

.badge-unpaid {
  background: rgba(245, 158, 11, 0.15) !important;
  color: #f59e0b !important;
  border: 1px solid rgba(245, 158, 11, 0.3) !important;
}

.badge-overdue {
  background: rgba(239, 68, 68, 0.15) !important;
  color: #ef4444 !important;
  border: 1px solid rgba(239, 68, 68, 0.3) !important;
}

.badge-draft {
  background: rgba(148, 163, 184, 0.15) !important;
  color: #94a3b8 !important;
  border: 1px solid rgba(148, 163, 184, 0.3) !important;
}

.badge-cancelled {
  background: rgba(100, 116, 139, 0.2) !important;
  color: #64748b !important;
}

.badge-hint {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* Mobile Quick Action Bar (Hidden on desktop) */
.mobile-quick-action-bar {
  display: none;
  gap: 8px;
  margin-top: 0.75rem;
}

/* Dashboard Dual Layout */
.dashboard-dual-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: 1.25rem;
  align-items: start;
  width: 100%;
}

.dashboard-dual-grid > section,
.dashboard-dual-grid .docs-section,
.dashboard-dual-grid .recent-payments-section {
  min-width: 0;
  max-width: 100%;
}

.recent-payments-section .table-responsive {
  min-width: 0;
  width: 100%;
  overflow-x: auto;
}

.recent-payments-section .data-table {
  width: 100%;
  table-layout: auto;
}

.recent-payments-section .data-table td,
.recent-payments-section .data-table th {
  white-space: nowrap;
}

.recent-payments-section .data-table td:nth-child(3) {
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.section-tools-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.section-footer-link {
  text-align: center;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  margin-top: 1rem;
}

/* Invoices Management Filter Bar */
.invoices-filter-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}

.flex-grow {
  flex-grow: 1;
}

.filter-status-pills {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.status-filter-pill {
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
}

.status-filter-pill:hover {
  color: var(--text-primary);
  border-color: var(--text-muted);
}

.status-filter-pill.active {
  background: var(--accent-primary);
  color: #ffffff;
  border-color: var(--accent-primary);
}

/* Mini KPI Grid (Used in Payments & Receivables views) */
.kpi-mini-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.85rem;
  margin-bottom: 1.25rem;
}

.kpi-mini-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.kpi-mini-card .label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.kpi-mini-card .value {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-primary);
}

/* Reports Header & Grid */
.reports-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
  gap: 12px;
  flex-wrap: wrap;
}

.reports-header-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.reports-main-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-primary);
  margin: 0;
  letter-spacing: -0.01em;
}

.reports-sub-title {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 0;
}

.report-print-btn {
  padding: 7px 14px;
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.report-sections-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin-top: 1.25rem;
}

.report-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
}

.report-card-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 1rem;
}

/* Debtor Mobile Cards */
.debtor-mobile-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  margin-bottom: 8px;
  gap: 10px;
}

.debtor-mobile-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.debtor-mobile-meta strong {
  font-size: 0.85rem;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.debtor-invoiced-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.debtor-mobile-action {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.debtor-due-badge {
  font-size: 0.82rem;
  font-weight: 800;
  color: #f59e0b;
}

.status-progress-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.progress-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.84rem;
  font-weight: 600;
}

.progress-bar-bg {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.4s ease;
}

/* Responsive Cards for Mobile Lists */
.desktop-view-only {
  display: block;
}

.mobile-view-only {
  display: none !important;
}

.mobile-cards-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

/* Strict Desktop Constraint: Hide all mobile cards lists & mobile controls on screens > 768px */
@media (min-width: 769px) {
  .mobile-view-only,
  .mobile-cards-list,
  #docsMobileCards,
  #recentPaymentsMobileCards,
  #allInvoicesMobileCards,
  #paymentsMobileCards,
  #customersMobileCards,
  .mobile-top-search-nav,
  .mobile-fab-container,
  .mobile-fab-backdrop,
  .mobile-bottom-nav,
  .mobile-cal-circle-btn,
  .mobile-header-plus-btn {
    display: none !important;
  }
}

.mobile-invoice-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.mobile-invoice-card:hover {
  border-color: rgba(59, 130, 246, 0.4);
}

.mobile-card-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
}

.mobile-card-title-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.mobile-card-icon {
  font-size: 0.95rem;
  flex-shrink: 0;
}

.mobile-card-docno {
  font-weight: 800;
  font-size: 0.88rem;
  color: var(--text-primary);
  white-space: nowrap;
}

.mobile-card-po-tag {
  font-size: 0.68rem;
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(59, 130, 246, 0.12);
  color: #60a5fa;
  font-weight: 600;
  white-space: nowrap;
}

.mobile-card-client-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}

.mobile-card-client-name {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

.mobile-card-date {
  font-size: 0.72rem;
  color: var(--text-muted);
  flex-shrink: 0;
}

.mobile-card-fin-block {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(0, 0, 0, 0.18);
  border-radius: var(--radius-sm);
  padding: 7px 10px;
}

.mobile-card-main-amount {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.15;
}

.mobile-card-sub-fin {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  font-size: 0.72rem;
  color: var(--text-secondary);
  line-height: 1.35;
}

.mobile-card-actions {
  display: flex;
  gap: 6px;
  align-items: center;
  margin-top: 2px;
}

.mobile-card-actions .btn {
  flex: 1;
  padding: 6px 8px;
  font-size: 0.76rem;
  border-radius: var(--radius-sm);
}

/* Backward compatibility for original card markup */
.mobile-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.mobile-card-client {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.25;
}

.mobile-card-doc-info {
  font-size: 0.76rem;
  color: var(--text-secondary);
  margin-top: 2px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.mobile-card-financials {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  background: rgba(0, 0, 0, 0.18);
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  text-align: center;
}

.fin-item-lbl {
  font-size: 0.62rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
}

.fin-item-num {
  font-size: 0.85rem;
  font-weight: 800;
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Modals Enhancements */
.modal-box-large {
  max-width: 1100px;
  width: 95vw;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-box-payment {
  max-width: 520px;
  width: 95vw;
}

.payment-snapshot-box {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  margin-bottom: 1rem;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.snapshot-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.snapshot-row.highlight {
  border-top: 1px dashed var(--border-color);
  padding-top: 6px;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
}

.modal-footer-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 1.25rem;
}

/* Two-column Invoice Details Modal (Sections 11 & 26) */
.invoice-details-layout {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 1.25rem;
  margin-top: 1rem;
}

/* Clean, Neutral Document Viewer & Responsive Scaler */
.details-preview-col {
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 0.65rem;
  max-height: 78vh;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-sizing: border-box;
}

.a4-preview-toolbar {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 8px 8px 8px;
  border-bottom: 1px solid #e2e8f0;
  margin-bottom: 8px;
  box-sizing: border-box;
}

.a4-preview-toolbar-title {
  font-size: 0.76rem;
  font-weight: 700;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.a4-zoom-controls {
  display: flex;
  align-items: center;
  gap: 4px;
}

.a4-zoom-btn {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: #334155;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  line-height: 1.2;
}

.a4-zoom-btn:hover {
  background: #f8fafc;
  border-color: #94a3b8;
  color: #0f172a;
}

.a4-zoom-btn.a4-zoom-reset {
  min-width: 36px;
  text-align: center;
}

.a4-preview-viewport {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  background: #141b2e;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 20px 16px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.35);
  scrollbar-width: thin;
  scrollbar-color: rgba(59, 130, 246, 0.4) transparent;
}

[data-theme="light"] .a4-preview-viewport {
  background: #edf2f7;
  border-color: #cbd5e1;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.06);
  scrollbar-color: #94a3b8 transparent;
}

.a4-preview-scaler {
  position: relative;
  margin: 0 auto;
  transform-origin: top center;
  width: calc(794px * var(--a4-scale, 1));
  height: calc(var(--a4-orig-height, 1123px) * var(--a4-scale, 1));
  flex-shrink: 0;
  box-sizing: border-box;
  transition: width 0.1s ease, height 0.1s ease;
}

.a4-preview-scaler .invoice-paper {
  position: absolute;
  top: 0;
  left: 0;
  width: 794px !important;
  min-height: 1123px;
  transform-origin: top left;
  transform: scale(var(--a4-scale, 1));
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.16), 0 2px 8px rgba(0, 0, 0, 0.08);
  border-radius: 4px;
  background: #ffffff !important;
  color: #000000 !important;
  margin: 0 !important;
  box-sizing: border-box;
}

.details-payments-col {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.payment-summary-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
}

.payment-summary-card h4 {
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 0.85rem;
}

.summary-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9rem;
  padding: 6px 0;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.07);
}

.summary-line.highlight-line {
  border-bottom: none;
  font-size: 1.05rem;
  padding-top: 8px;
}

.payment-history-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
}

.history-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.85rem;
}

.history-card-header h4 {
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  text-transform: uppercase;
}

.payment-history-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  max-height: 260px;
  overflow-y: auto;
}

.payment-history-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 9px 12px;
  background: rgba(0, 0, 0, 0.18);
  border-radius: var(--radius-sm);
  border-left: 3px solid #10b981;
  font-size: 0.84rem;
}

.pay-item-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.pay-item-amount {
  font-weight: 800;
  color: #10b981;
}

.pay-item-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}

.mobile-details-tabs {
  display: none;
  background: #0f172a;
  padding: 4px;
  border-radius: 10px;
  border: 1px solid #334155;
  margin-bottom: 0.75rem;
  gap: 4px;
}

.mobile-tab-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: none;
  background: transparent;
  color: #94a3b8;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 7px 10px;
  border-radius: 7px;
  cursor: pointer;
  transition: all 0.2s ease;
  outline: none;
}

.mobile-tab-btn:hover {
  color: #f8fafc;
}

.mobile-tab-btn.active {
  background: var(--accent-primary, #3b82f6);
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(59, 130, 246, 0.35);
}

/* Mobile Dedicated Header, Search, Navigation & FAB Base Styles (Picture 2 Architecture) */
.mobile-header-plus-btn {
  display: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #059669;
  color: #ffffff;
  border: none;
  font-size: 1.25rem;
  font-weight: 700;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  line-height: 1;
  box-shadow: 0 2px 8px rgba(5, 150, 105, 0.35);
  margin-left: 4px;
  transition: transform 0.2s ease;
}

.mobile-header-plus-btn:active {
  transform: scale(0.92);
}

.mobile-top-search-nav {
  display: none;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 0.85rem;
}

.mobile-search-bar {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.mobile-search-bar .search-icon {
  position: absolute;
  left: 14px;
  font-size: 0.95rem;
  color: var(--text-muted);
  pointer-events: none;
}

.mobile-search-bar input {
  width: 100%;
  height: 42px;
  border-radius: 9999px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 0 36px 0 42px;
  font-size: 0.88rem;
  font-family: inherit;
  color: var(--text-primary);
  outline: none;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
}

.mobile-search-bar input:focus {
  border-color: #059669;
  box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.15);
}

.mobile-search-bar .search-clear-btn {
  position: absolute;
  right: 12px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.1);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
}

.mobile-section-nav-scroll {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: 2px;
}

.mobile-section-nav-scroll::-webkit-scrollbar {
  display: none;
}

.sec-nav-pill {
  flex-shrink: 0;
  white-space: nowrap;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-secondary);
  padding: 6px 16px;
  border-radius: 9999px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s ease;
}

.sec-nav-pill.active {
  background: #d1fae5;
  color: #065f46;
  border-color: #a7f3d0;
  font-weight: 700;
}

[data-theme="dark"] .sec-nav-pill.active {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  border-color: rgba(16, 185, 129, 0.4);
}

/* Picture 2 Hero Date Row Styles */
.mobile-cal-circle-btn {
  display: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #065f46;
  color: #ffffff;
  border: none;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(6, 95, 70, 0.3);
  transition: transform 0.2s ease;
}

.mobile-cal-circle-btn:active {
  transform: scale(0.92);
}

.period-tabs-scrollable {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  white-space: nowrap;
}

.period-tabs-scrollable::-webkit-scrollbar {
  display: none;
}

.period-btn {
  flex-shrink: 0;
  white-space: nowrap;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-secondary);
  padding: 6px 14px;
  border-radius: 9999px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s ease;
}

.period-btn.active {
  background: #e0f2fe !important;
  color: #0284c7 !important;
  border-color: #bae6fd !important;
  font-weight: 700 !important;
}

[data-theme="dark"] .period-btn.active {
  background: rgba(56, 189, 248, 0.2) !important;
  color: #38bdf8 !important;
  border-color: rgba(56, 189, 248, 0.4) !important;
}

.status-summary-strip {
  display: flex !important;
  gap: 8px !important;
  flex-wrap: nowrap !important;
  overflow-x: auto !important;
  -webkit-overflow-scrolling: touch !important;
  scrollbar-width: none !important;
  padding-bottom: 4px !important;
  margin-top: 6px !important;
}

.status-summary-strip::-webkit-scrollbar {
  display: none !important;
}

.status-chip {
  flex-shrink: 0 !important;
  white-space: nowrap !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  padding: 5px 11px !important;
  font-size: 0.74rem !important;
  font-weight: 600 !important;
  border-radius: 9999px !important;
  border: 1px solid var(--border-color) !important;
  background: var(--bg-card) !important;
  cursor: pointer !important;
  transition: background 0.15s ease, border-color 0.15s ease !important;
}

.status-chip:hover {
  border-color: rgba(59, 130, 246, 0.4) !important;
}

.chip-dot {
  width: 7px !important;
  height: 7px !important;
  border-radius: 50% !important;
  display: inline-block !important;
}

.chip-paid .chip-dot { background-color: #10b981; }
.chip-partial .chip-dot { background-color: #3b82f6; }
.chip-unpaid .chip-dot { background-color: #f59e0b; }
.chip-overdue .chip-dot { background-color: #ef4444; }
.chip-quote .chip-dot { background-color: #8b5cf6; }

/* Mobile Floating Action Button (FAB) matching Picture 2 */
.mobile-fab-container {
  display: none;
  position: fixed;
  bottom: 74px;
  right: 16px;
  z-index: 90;
  flex-direction: column;
  align-items: flex-end;
  pointer-events: none;
}

.mobile-fab-btn {
  pointer-events: auto;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #065f46;
  border: none;
  color: white;
  font-size: 1.6rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 20px rgba(6, 95, 70, 0.42);
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}

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

.mobile-fab-container.active .mobile-fab-btn {
  transform: rotate(45deg);
  background: #374151;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.mobile-fab-menu {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
  opacity: 0;
  transform: translateY(16px) scale(0.92);
  pointer-events: none;
  transition: opacity 0.2s cubic-bezier(0.16, 1, 0.3, 1), transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.mobile-fab-container.active .mobile-fab-menu {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.mobile-fab-item {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  border-radius: 9999px;
  padding: 8px 16px;
  font-size: 0.82rem;
  font-weight: 700;
  box-shadow: var(--shadow-md);
  cursor: pointer;
  white-space: nowrap;
  font-family: inherit;
  transition: background 0.15s ease;
}

.mobile-fab-item:active {
  background: var(--bg-hover);
}

.mobile-fab-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 85;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  backdrop-filter: blur(2px);
}

.mobile-fab-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

/* Fixed Bottom Navigation (Mobile < 768px) */
.mobile-bottom-nav {
  display: none;
}

/* ============================================================
   RESPONSIVE APP SHELL & TOP HEADER PRIMARY NAVIGATION
   ============================================================ */
.app-shell {
  display: block;
  min-height: 100vh;
  width: 100%;
  background-color: var(--bg-primary);
  position: relative;
}

/* Sidebar is completely decommissioned — Navigation is in Top Header */
.desktop-sidebar {
  display: none !important;
}

.app-main-shell {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background-color: var(--bg-primary);
  box-sizing: border-box;
}

/* Header Brand Group */
.header-brand-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Mobile Menu Hamburger Button (< 768px) */
.mobile-menu-btn {
  display: none;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  font-size: 1.25rem;
  line-height: 1;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}
.mobile-menu-btn:hover {
  background: var(--bg-card-hover);
}
.mobile-menu-btn:active {
  transform: scale(0.92);
}

/* Header User Profile Badge */
.header-business-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px 4px 6px;
  border-radius: 9999px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-primary);
  user-select: none;
}
.hbadge-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  color: white;
  font-size: 0.65rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Desktop Nav Links in Top Header */
.desktop-nav-links {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(0, 0, 0, 0.15);
  padding: 4px 6px;
  border-radius: 12px;
  border: 1px solid var(--border-color);
}
[data-theme="light"] .desktop-nav-links {
  background: rgba(0, 0, 0, 0.04);
}

.nav-tab-btn {
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.84rem;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
}

@media (max-width: 1250px) {
  .brand-sub {
    display: none !important;
  }
  .desktop-nav-links {
    gap: 3px;
    padding: 3px 4px;
  }
  .nav-tab-btn {
    padding: 5px 9px;
    font-size: 0.8rem;
    gap: 5px;
  }
}

@media (max-width: 1120px) {
  .header-business-badge {
    display: none !important;
  }
}

@media (max-width: 1050px) {
  .desktop-only-btn {
    display: none !important;
  }
  .desktop-nav-links {
    gap: 2px;
    padding: 2px 3px;
  }
  .nav-tab-btn {
    padding: 4px 8px;
    font-size: 0.78rem;
    gap: 4px;
  }
}

@media (max-width: 900px) {
  #cloudSyncText {
    display: none !important;
  }
  .cloud-sync-pill {
    padding: 5px 8px !important;
  }
}
.nav-tab-btn .ntab-icon {
  font-size: 0.95rem;
}
.nav-tab-btn:hover {
  color: var(--text-primary);
  background: var(--bg-card);
}
.nav-tab-btn.active {
  background: linear-gradient(135deg, #059669, #047857);
  color: #ffffff !important;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(5, 150, 105, 0.35);
  border-color: rgba(5, 150, 105, 0.5);
}
[data-theme="dark"] .nav-tab-btn.active {
  background: linear-gradient(135deg, #059669, #047857);
  color: #ffffff !important;
}
[data-theme="light"] .nav-tab-btn.active {
  background: #e6f7f2;
  color: #047857 !important;
  border: 1.5px solid #059669;
  box-shadow: 0 2px 6px rgba(5, 150, 105, 0.15);
}

.top-nav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 9999px;
  background: rgba(148, 163, 184, 0.18);
  border: 1px solid rgba(148, 163, 184, 0.3);
  color: var(--text-secondary);
  line-height: 1.2;
  margin-left: 3px;
  transition: all 0.2s ease;
}
.nav-tab-btn.active .top-nav-badge {
  background: rgba(255, 255, 255, 0.25);
  border-color: rgba(255, 255, 255, 0.4);
  color: #ffffff;
}
[data-theme="light"] .nav-tab-btn.active .top-nav-badge {
  background: rgba(5, 150, 105, 0.15);
  border-color: rgba(5, 150, 105, 0.35);
  color: #047857;
}

/* Mobile Slide-In Navigation Drawer */
.mobile-nav-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
  z-index: 998;
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
}
.mobile-nav-backdrop.open {
  display: block;
  opacity: 1;
  pointer-events: auto;
}

.mobile-nav-drawer {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 280px;
  max-width: 82vw;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-color);
  z-index: 999;
  display: flex;
  flex-direction: column;
  transform: translateX(-100%);
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.4);
}
.mobile-nav-drawer.open {
  transform: translateX(0);
}

.mobile-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1rem;
  border-bottom: 1px solid var(--border-color);
}
.drawer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}
.drawer-logo {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, #c02828, #f97316);
  color: white;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}
.drawer-meta {
  display: flex;
  flex-direction: column;
}
.drawer-meta strong {
  font-size: 0.92rem;
  color: var(--text-primary);
}
.drawer-badge {
  font-size: 0.62rem;
  font-weight: 700;
  color: #3b82f6;
  letter-spacing: 0.04em;
}
.drawer-close-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
}

.mobile-drawer-nav {
  padding: 1rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  overflow-y: auto;
}
.mnav-drawer-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0.7rem 0.9rem;
  border-radius: 10px;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
  text-align: left;
  transition: all 0.15s ease;
}
.mnav-drawer-item:hover {
  background: var(--bg-card);
  color: var(--text-primary);
}
.mnav-drawer-item.active {
  background: rgba(5, 150, 105, 0.12);
  color: #059669;
  font-weight: 700;
  border-left: 3px solid #059669;
}
[data-theme="dark"] .mnav-drawer-item.active {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border-left: 3px solid #10b981;
}

.mobile-drawer-footer {
  padding: 1rem;
  border-top: 1px solid var(--border-color);
  background: var(--bg-card);
}
.drawer-user-info {
  display: flex;
  align-items: center;
  gap: 10px;
}
.drawer-avatar {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: rgba(59, 130, 246, 0.15);
  color: #3b82f6;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
}
.drawer-user-meta {
  display: flex;
  flex-direction: column;
}
.drawer-user-meta strong {
  font-size: 0.82rem;
  color: var(--text-primary);
}
.drawer-user-meta span {
  font-size: 0.7rem;
  color: var(--text-muted);
}

@media (min-width: 1024px) {
  .mobile-nav-drawer,
  .mobile-nav-backdrop {
    display: none !important;
  }
}

/* ============================================================
   FOCUSED WHATSAPP SEND MODAL (Recipient, Message, Summary, Send)
   ============================================================ */
.wa-send-modal {
  max-width: 540px !important;
  width: 95vw !important;
  border-radius: 18px !important;
  background: var(--bg-card) !important;
  border: 1px solid var(--border-color) !important;
  overflow: hidden !important;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.45) !important;
  display: flex !important;
  flex-direction: column !important;
  max-height: 90vh !important;
}

.wa-send-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: linear-gradient(135deg, #075e54 0%, #128c7e 100%);
  color: #ffffff;
}
.wa-send-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.wa-send-header-text {
  display: flex;
  flex-direction: column;
}
.wa-send-eyebrow {
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  opacity: 0.85;
  text-transform: uppercase;
  font-weight: 600;
}
.wa-send-title {
  font-size: 1.05rem;
  font-weight: 800;
  margin: 0;
  line-height: 1.2;
}
.wa-send-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.2);
  color: #ffffff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  transition: background 0.15s ease;
}
.wa-send-close:hover {
  background: rgba(0, 0, 0, 0.35);
}

.wa-send-body {
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
}

.wa-send-doc {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  gap: 10px;
}
.wa-send-doc-icon {
  font-size: 1.3rem;
}
.wa-send-doc-meta {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}
.wa-send-doc-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.wa-send-doc-client {
  font-size: 0.74rem;
  color: var(--text-muted);
}
.wa-send-doc-amount {
  font-size: 1.1rem;
  font-weight: 800;
  color: #10b981;
}

.wa-send-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.wa-send-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.wa-send-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.wa-msg-tools {
  display: flex;
  gap: 8px;
}
.wa-link-btn {
  background: none;
  border: none;
  color: #10b981;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
}
.wa-link-btn:hover {
  text-decoration: underline;
}

.wa-phone-wrap {
  display: flex;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  overflow: hidden;
}
.wa-phone-prefix {
  padding: 0 10px;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
  background: rgba(0, 0, 0, 0.1);
  border-right: 1px solid var(--border-color);
  height: 38px;
  display: flex;
  align-items: center;
}
.wa-phone-input {
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
  height: 38px;
  padding: 0 10px !important;
  font-size: 0.88rem;
}
.wa-phone-clear {
  border: none;
  background: transparent;
  color: var(--text-muted);
  padding: 0 12px;
  cursor: pointer;
  height: 38px;
}

.wa-segmented {
  display: flex;
  gap: 8px;
}
.wa-seg-btn {
  flex: 1;
  padding: 8px 10px;
  font-size: 0.78rem;
  font-weight: 600;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: var(--bg-secondary);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
}
.wa-seg-btn.active {
  background: rgba(16, 185, 129, 0.15);
  border-color: #10b981;
  color: #10b981;
  font-weight: 700;
}

.wa-send-textarea {
  min-height: 110px;
  font-size: 0.82rem;
  line-height: 1.45;
}
.wa-hidden-preview {
  display: none;
}

.wa-fin-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 8px 12px;
}
.wa-fin-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.wa-fin-item span {
  font-size: 0.68rem;
  color: var(--text-muted);
  text-transform: uppercase;
}
.wa-fin-item strong {
  font-size: 0.88rem;
  color: var(--text-primary);
}
.wa-fin-received strong {
  color: #10b981;
}
.wa-fin-outstanding strong {
  color: #ef4444;
}

.wa-pdf-status {
  font-size: 0.76rem;
  color: var(--text-secondary);
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: 8px;
  padding: 7px 10px;
}

.wa-send-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 12px 18px;
  border-top: 1px solid var(--border-color);
  background: var(--bg-secondary);
}
.wa-btn-send {
  background: linear-gradient(135deg, #25D366 0%, #128C7E 100%) !important;
  color: #ffffff !important;
  font-weight: 700 !important;
  border: none !important;
  box-shadow: 0 4px 14px rgba(37, 211, 102, 0.35) !important;
  padding: 8px 18px !important;
  font-size: 0.88rem !important;
}
.wa-btn-send:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(37, 211, 102, 0.45) !important;
}

/* Desktop Dashboard Analytics Row Styles */
.dashboard-analytics-row {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 16px;
  margin-bottom: 1.5rem;
}
.dash-trend-card,
.dash-perf-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}
.dash-perf-inner {
  display: flex;
  flex-direction: column;
}
.dash-perf-metrics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.dash-perf-summary-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.dash-pchip {
  font-size: 0.75rem;
  padding: 4px 10px;
  border-radius: 8px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
}
.dash-pchip strong {
  color: var(--text-primary);
}
.dash-pchip.pchip-received strong {
  color: #10b981;
}

/* Desktop Reports Multi-Column Analytics Workspace (>= 1024px) */
@media (min-width: 1024px) {
  .reports-analytics-section {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 18px !important;
  }
  .reports-header-row,
  .reports-filter-bar {
    grid-column: 1 / -1 !important;
  }
}

/* Desktop Tables Styling */
.table-responsive {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  box-sizing: border-box;
  margin-bottom: 1.5rem;
}

.data-table {
  width: 100%;
  min-width: 780px;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.85rem;
  color: var(--text-primary);
}
.data-table thead th {
  background: var(--bg-secondary);
  color: var(--text-muted);
  font-weight: 700;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.85rem 1rem;
  border-bottom: 2px solid var(--border-color);
  white-space: nowrap;
}
.data-table tbody td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-card);
  transition: background 0.15s ease;
  vertical-align: middle;
}
.data-table tbody tr:hover td {
  background: var(--bg-card-hover);
}
.data-table tbody tr:last-child td {
  border-bottom: none;
}

/* Mobile cards fin-split styling */
.modern-doc-fin-split {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 8px 10px;
  margin: 4px 0 6px 0;
}
.doc-fin-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.doc-fin-lbl {
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.doc-fin-val {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.modern-doc-primary-action {
  font-size: 0.74rem !important;
  font-weight: 700 !important;
  padding: 4px 10px !important;
  border-radius: 6px !important;
  white-space: nowrap !important;
}
.btn-xs {
  padding: 3px 8px;
  font-size: 0.72rem;
}
.modern-pay-notes {
  margin-top: -2px;
}

/* Desktop Breakpoints (1280px+) */
@media (min-width: 1280px) {
  .financial-summary-grid {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 16px !important;
    margin-bottom: 1.5rem !important;
  }
  .main-wrapper {
    max-width: 1600px;
    margin: 0 auto;
    padding: 1.5rem 2rem;
  }
}

/* Large Displays (1920px+) */
@media (min-width: 1920px) {
  .main-wrapper {
    max-width: 1680px;
  }
}

/* ============================================================
   RESPONSIVE BREAKPOINT RULES
   ============================================================ */

/* Large Tablets & Small Laptops (769px - 1200px) */
@media (max-width: 1200px) {
  .financial-summary-grid {
    grid-template-columns: repeat(2, 1fr);
  }

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

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

  .report-sections-grid {
    grid-template-columns: 1fr;
  }

  .invoice-details-layout {
    grid-template-columns: 1fr;
  }
}

/* Mobile & Tablets (< 768px) - EXACT PICTURE 2 UX & VISUAL DESIGN */
@media (max-width: 768px) {
  .desktop-sidebar {
    display: none !important;
  }
  .app-shell {
    display: block !important;
    width: 100% !important;
  }
  .app-main-shell {
    width: 100% !important;
    max-width: 100vw !important;
    overflow-x: hidden !important;
  }
  .app-header {
    width: 100% !important;
    max-width: 100vw !important;
    overflow-x: hidden !important;
  }
  .app-header .brand-wrapper {
    display: flex !important;
    min-width: 0 !important;
    flex-shrink: 1 !important;
    overflow: hidden !important;
  }

  body {
    padding-bottom: calc(80px + env(safe-area-inset-bottom, 0px)) !important;
    overflow-x: hidden !important;
  }

  .header-container {
    padding: 0.55rem 0.75rem !important;
    gap: 8px !important;
    width: 100% !important;
    max-width: 100vw !important;
    box-sizing: border-box !important;
    justify-content: space-between !important;
  }

  .brand-logo-icon {
    width: 32px !important;
    height: 32px !important;
    font-size: 0.95rem !important;
    border-radius: 8px !important;
    flex-shrink: 0 !important;
  }

  .brand-info {
    min-width: 0 !important;
    overflow: hidden !important;
  }

  .brand-info h1 {
    font-size: 0.92rem !important;
    gap: 4px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  .brand-badge {
    font-size: 0.55rem !important;
    padding: 1px 4px !important;
    flex-shrink: 0 !important;
  }

  .brand-sub {
    display: none !important;
  }

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

  .cloud-sync-pill {
    width: 34px !important;
    height: 34px !important;
    min-width: 34px !important;
    padding: 0 !important;
    border-radius: 50% !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    position: relative !important;
    background: var(--bg-card) !important;
    border: 1px solid var(--border-color) !important;
    cursor: pointer !important;
    box-shadow: var(--shadow-sm) !important;
    transition: transform 0.15s ease, background 0.15s ease !important;
  }
  .cloud-sync-pill:active {
    transform: scale(0.92) !important;
  }
  .cloud-sync-pill #cloudSyncText {
    display: none !important;
  }
  .cloud-sync-pill .cloud-icon-symbol {
    font-size: 0.95rem !important;
    display: inline-block !important;
    line-height: 1 !important;
  }
  .cloud-sync-pill .sync-dot {
    position: absolute !important;
    top: 3px !important;
    right: 3px !important;
    width: 8px !important;
    height: 8px !important;
    border-radius: 50% !important;
    border: 1.5px solid var(--bg-secondary) !important;
  }

  #themeToggleBtn {
    width: 34px !important;
    height: 34px !important;
    min-width: 34px !important;
    border-radius: 50% !important;
    padding: 0 !important;
    font-size: 0.95rem !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: var(--bg-card) !important;
    border: 1px solid var(--border-color) !important;
    box-shadow: var(--shadow-sm) !important;
    transition: transform 0.15s ease, background 0.15s ease !important;
  }
  #themeToggleBtn:active {
    transform: scale(0.92) !important;
  }

  .mobile-header-plus-btn {
    width: 34px !important;
    height: 34px !important;
    min-width: 34px !important;
    border-radius: 50% !important;
    padding: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 1.3rem !important;
    font-weight: 700 !important;
    margin-left: 0 !important;
    background: linear-gradient(135deg, #059669, #047857) !important;
    border: none !important;
    color: #ffffff !important;
    box-shadow: 0 2px 8px rgba(5, 150, 105, 0.4) !important;
    transition: transform 0.15s ease, box-shadow 0.15s ease !important;
  }
  .mobile-header-plus-btn:active {
    transform: scale(0.92) !important;
  }

  @media (max-width: 380px) {
    .header-container {
      padding: 0.45rem 0.5rem !important;
      gap: 4px !important;
    }
    .brand-info h1 {
      font-size: 0.85rem !important;
    }
  }

  .main-wrapper {
    padding: 0.75rem 0.75rem 0 0.75rem !important;
    padding-bottom: calc(95px + env(safe-area-inset-bottom, 0px)) !important;
    max-width: 100vw !important;
    overflow-x: hidden !important;
    box-sizing: border-box !important;
  }

  .desktop-nav-links,
  .desktop-only-btn,
  .quick-action-btns-desktop {
    display: none !important;
  }

  .desktop-view-only {
    display: none !important;
  }

  .mobile-view-only {
    display: flex !important;
  }

  .mobile-header-plus-btn {
    display: none !important;
  }

  .mobile-top-search-nav {
    display: flex !important;
  }

  .mobile-cal-circle-btn {
    display: flex !important;
  }

  .mobile-fab-container {
    display: flex !important;
  }

  .mobile-fab-backdrop {
    display: block !important;
  }

  .dashboard-header-section {
    padding: 0 !important;
  }

  .dashboard-title-row {
    margin-bottom: 0.65rem !important;
    align-items: center !important;
  }

  .dashboard-title-info h2 {
    font-size: 1.35rem !important;
    font-weight: 800 !important;
    letter-spacing: -0.02em !important;
  }

  /* ============================================================
     PICTURE 2: 2 × 2 VIBRANT GRADIENT CARDS GRID
     ============================================================ */
  .financial-summary-grid {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 12px !important;
    margin-bottom: 1rem !important;
  }

  .fin-card {
    border-radius: 18px !important;
    padding: 14px 14px 12px 14px !important;
    border: none !important;
    min-height: 110px !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
    color: #ffffff !important;
    position: relative !important;
    overflow: hidden !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12) !important;
  }

  .fin-card-header {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    margin-bottom: 4px !important;
  }

  .fin-card-icon {
    width: 32px !important;
    height: 32px !important;
    border-radius: 9px !important;
    background: rgba(255, 255, 255, 0.22) !important;
    backdrop-filter: blur(4px) !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 0.95rem !important;
    color: #ffffff !important;
    flex-shrink: 0 !important;
  }

  .fin-card-label {
    font-size: 0.78rem !important;
    font-weight: 600 !important;
    color: rgba(255, 255, 255, 0.95) !important;
    letter-spacing: normal !important;
    text-transform: capitalize !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  .fin-card-value {
    font-size: 1.35rem !important;
    font-weight: 800 !important;
    color: #ffffff !important;
    line-height: 1.15 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    letter-spacing: -0.01em !important;
    margin: 2px 0 4px 0 !important;
  }

  .fin-card-footer {
    font-size: 0.65rem !important;
    color: rgba(255, 255, 255, 0.85) !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  /* Card 1: Purple Gradient (Total Invoiced / Total Sales) */
  .fin-card-invoiced {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%) !important;
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.32) !important;
  }

  /* Card 2: Pink/Rose Gradient (Amount Received / Orders) */
  .fin-card-received {
    background: linear-gradient(135deg, #f472b6 0%, #ec4899 50%, #db2777 100%) !important;
    box-shadow: 0 8px 24px rgba(236, 72, 153, 0.32) !important;
  }
  .fin-card-received .fin-card-value {
    color: #ffffff !important;
  }

  /* Card 3: Cyan/Sky Blue Gradient (Outstanding / Cash) */
  .fin-card-outstanding {
    background: linear-gradient(135deg, #38bdf8 0%, #06b6d4 100%) !important;
    box-shadow: 0 8px 24px rgba(6, 182, 212, 0.32) !important;
  }
  .fin-card-outstanding .fin-card-value {
    color: #ffffff !important;
  }

  /* Card 4: Emerald Green Gradient (Pending Invoices / Receivable) */
  .fin-card-pending {
    background: linear-gradient(135deg, #34d399 0%, #10b981 50%, #059669 100%) !important;
    box-shadow: 0 8px 24px rgba(16, 185, 129, 0.32) !important;
  }

  /* Bottom Navigation matching Picture 2 */
  .mobile-bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 58px;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    z-index: 80;
    justify-content: space-around;
    align-items: center;
    backdrop-filter: blur(12px);
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }

  .mobile-nav-item {
    flex: 1 1 0 !important;
    min-width: 0 !important;
    padding: 2px 2px !important;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-family: inherit;
    font-size: 0.65rem;
    font-weight: 600;
    cursor: pointer;
    gap: 2px;
    height: 100%;
    transition: color 0.2s ease;
  }

  .mobile-nav-item .nav-icon {
    font-size: 1.1rem;
    line-height: 1;
  }

  .mobile-nav-item .nav-label {
    font-size: 0.62rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    display: block;
  }

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

  .mobile-details-tabs {
    display: flex;
  }

  .details-preview-col {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 6px;
    max-height: calc(85vh - 110px);
    overflow-y: auto;
    overflow-x: hidden;
    width: 100%;
    box-sizing: border-box;
  }

  .details-preview-col .invoice-paper {
    margin-bottom: 0 !important;
  }
}

/* Extra Small Phones (< 380px down to 320px) - STRICTLY PRESERVE 2 × 2 GRID */
@media (max-width: 380px) {
  .financial-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
  }

  .fin-card {
    border-radius: 14px !important;
    padding: 10px 10px 8px 10px !important;
    min-height: 96px !important;
  }

  .fin-card-icon {
    width: 28px !important;
    height: 28px !important;
    font-size: 0.85rem !important;
  }

  .fin-card-label {
    font-size: 0.68rem !important;
  }

  .fin-card-value {
    font-size: 1.15rem !important;
  }

  .fin-card-footer {
    font-size: 0.6rem !important;
  }

  .main-wrapper {
    padding: 0.5rem 0.65rem !important;
  }
}

/* ============================================================
   REDESIGNED MOBILE SCREENS (Dashboard, Invoices, Payments, Receivables, Reports)
   ============================================================ */

/* 1. Dashboard: Quick Actions */
.mobile-dashboard-quick-actions {
  display: none;
}

@media (max-width: 768px) {
  .mobile-dashboard-quick-actions {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 8px !important;
    margin: 6px 0 14px 0 !important;
    width: 100% !important;
    overflow-x: visible !important;
    padding-bottom: 0 !important;
  }

  .quick-action-pill {
    width: 100% !important;
    min-width: 0 !important;
    flex: none !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 5px !important;
    padding: 10px 4px !important;
    border-radius: 12px !important;
    font-size: 0.78rem !important;
    font-weight: 700 !important;
    border: 1px solid var(--border-color) !important;
    background: var(--bg-card) !important;
    color: var(--text-primary) !important;
    box-shadow: var(--shadow-sm) !important;
    cursor: pointer !important;
    white-space: nowrap !important;
    transition: transform 0.15s ease, background 0.15s ease !important;
  }
  .quick-action-pill:active {
    transform: scale(0.96) !important;
  }
  .qpill-invoice {
    background: rgba(5, 150, 105, 0.08) !important;
    border-color: rgba(5, 150, 105, 0.35) !important;
    color: #059669 !important;
  }
  .qpill-quotation {
    background: rgba(139, 92, 246, 0.08) !important;
    border-color: rgba(139, 92, 246, 0.35) !important;
    color: #8b5cf6 !important;
  }
  .qpill-payment {
    background: rgba(59, 130, 246, 0.08) !important;
    border-color: rgba(59, 130, 246, 0.35) !important;
    color: #3b82f6 !important;
  }
  [data-theme="dark"] .qpill-invoice {
    background: rgba(16, 185, 129, 0.15) !important;
    color: #34d399 !important;
  }
  [data-theme="dark"] .qpill-quotation {
    background: rgba(139, 92, 246, 0.15) !important;
    color: #a78bfa !important;
  }
  [data-theme="dark"] .qpill-payment {
    background: rgba(59, 130, 246, 0.15) !important;
    color: #60a5fa !important;
  }
  .qpill-icon {
    font-size: 0.95rem !important;
  }
}

/* 2. Horizontal Scrollable Filters */
.horizontal-scroll-filters {
  display: flex !important;
  gap: 8px !important;
  overflow-x: auto !important;
  -webkit-overflow-scrolling: touch !important;
  padding: 4px 2px 6px 2px !important;
  scrollbar-width: none !important;
}
.horizontal-scroll-filters::-webkit-scrollbar {
  display: none !important;
}

.horizontal-scroll-filters .status-filter-pill {
  flex-shrink: 0 !important;
  white-space: nowrap !important;
}

/* 3. Invoices: Modern Document Cards */
.mobile-modern-doc-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 13px 15px;
  margin-bottom: 10px;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  box-sizing: border-box;
}
.mobile-modern-doc-card:active {
  transform: scale(0.985);
  background: var(--bg-card-hover);
}
.modern-doc-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.modern-doc-client {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 72%;
}
.modern-doc-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.modern-doc-card-bottom {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 8px;
  margin-top: 2px;
}
.modern-doc-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.74rem;
  color: var(--text-muted);
  flex-wrap: wrap;
}
.modern-doc-num {
  font-weight: 700;
  color: var(--text-secondary);
}
.modern-doc-dot {
  color: var(--text-muted);
  font-size: 0.68rem;
}
.modern-doc-po {
  background: rgba(59, 130, 246, 0.12);
  color: #3b82f6;
  padding: 1px 6px;
  border-radius: 4px;
  font-weight: 600;
  font-size: 0.7rem;
}
.modern-doc-amount {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.01em;
  white-space: nowrap;
}

/* 4. Payments: Mobile Hero & Cards */
.payments-mobile-hero {
  display: none;
}

@media (max-width: 768px) {
  .payments-mobile-hero {
    display: flex;
    flex-direction: column;
    gap: 4px;
    background: linear-gradient(135deg, #059669 0%, #10b981 60%, #34d399 100%);
    border-radius: 18px;
    padding: 16px 18px;
    color: #ffffff;
    margin-bottom: 12px;
    box-shadow: 0 8px 24px rgba(16, 185, 129, 0.28);
    width: 100%;
    box-sizing: border-box;
  }
  .pay-hero-badge {
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    opacity: 0.92;
    text-transform: uppercase;
  }
  .pay-hero-sub {
    font-size: 0.8rem;
    font-weight: 600;
    opacity: 0.95;
  }
  .pay-hero-amount {
    font-size: 1.85rem;
    font-weight: 900;
    letter-spacing: -0.02em;
    line-height: 1.15;
    margin: 2px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .pay-hero-count {
    font-size: 0.74rem;
    opacity: 0.9;
  }
  .payments-period-filter-bar {
    margin-bottom: 10px;
  }
}

.mobile-modern-payment-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 13px 15px;
  margin-bottom: 10px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  box-sizing: border-box;
}
.modern-pay-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.modern-pay-client {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.modern-pay-amount {
  font-size: 1.05rem;
  font-weight: 800;
  color: #10b981;
  white-space: nowrap;
}
.modern-pay-card-mid {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.78rem;
}
.modern-pay-method-pill {
  background: rgba(16, 185, 129, 0.12);
  color: #10b981;
  font-weight: 700;
  font-size: 0.72rem;
  padding: 2px 8px;
  border-radius: 12px;
}
.modern-pay-doc {
  color: var(--text-muted);
  font-size: 0.78rem;
}
.modern-pay-doc strong {
  color: var(--text-secondary);
}
.modern-pay-card-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  border-top: 1px dashed var(--border-color);
  padding-top: 8px;
  font-size: 0.74rem;
  color: var(--text-muted);
}
.modern-pay-ref {
  color: var(--text-muted);
  font-size: 0.72rem;
}
.modern-pay-actions {
  display: flex;
  gap: 4px;
}

/* 5. Receivables: Hero & Cards */
.receivables-mobile-hero {
  display: none;
}

@media (max-width: 768px) {
  .receivables-mobile-hero {
    display: flex;
    flex-direction: column;
    gap: 4px;
    background: linear-gradient(135deg, #f59e0b 0%, #ea580c 100%);
    border-radius: 18px;
    padding: 16px 18px;
    color: #ffffff;
    margin-bottom: 12px;
    box-shadow: 0 8px 24px rgba(234, 88, 12, 0.28);
    width: 100%;
    box-sizing: border-box;
  }
  .rec-hero-badge {
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    opacity: 0.95;
    text-transform: uppercase;
  }
  .rec-hero-label {
    font-size: 0.78rem;
    font-weight: 700;
    opacity: 0.92;
  }
  .rec-hero-amount {
    font-size: 1.85rem;
    font-weight: 900;
    letter-spacing: -0.02em;
    line-height: 1.15;
    margin: 2px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .rec-hero-footer {
    font-size: 0.74rem;
    opacity: 0.9;
  }
}

.mobile-modern-receivable-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 14px 15px;
  margin-bottom: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  box-sizing: border-box;
}
.mobile-modern-receivable-card.has-overdue {
  border-left: 4px solid #ef4444;
}
.mobile-modern-receivable-card.has-due {
  border-left: 4px solid #f59e0b;
}
.mobile-modern-receivable-card.cleared {
  border-left: 4px solid #10b981;
}
.modern-rec-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}
.modern-rec-client-wrap {
  flex: 1;
  min-width: 0;
}
.modern-rec-name {
  font-size: 0.96rem;
  font-weight: 800;
  color: var(--text-primary);
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.modern-rec-phone {
  font-size: 0.74rem;
  color: var(--text-muted);
  margin-top: 2px;
  display: block;
}
.modern-rec-outstanding-box {
  border-radius: 10px;
  padding: 8px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.modern-rec-outstanding-box.box-due {
  background: rgba(245, 158, 11, 0.1);
  color: #d97706;
  border: 1px solid rgba(245, 158, 11, 0.25);
}
[data-theme="dark"] .modern-rec-outstanding-box.box-due {
  color: #f59e0b;
  background: rgba(245, 158, 11, 0.16);
}
.modern-rec-outstanding-box.box-cleared {
  background: rgba(16, 185, 129, 0.1);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.2);
}
.rec-box-lbl {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.rec-box-val {
  font-size: 1.15rem;
  font-weight: 900;
}
.modern-rec-split-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--text-secondary);
}
.modern-rec-prog-bar {
  height: 6px;
  background: var(--border-color);
  border-radius: 3px;
  overflow: hidden;
}
.modern-rec-prog-fill {
  height: 100%;
  background: #10b981;
  border-radius: 3px;
  transition: width 0.3s ease;
}
.modern-rec-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 2px;
}
.btn-whatsapp-sm {
  background: #25D366 !important;
  color: #ffffff !important;
  border: none !important;
  font-weight: 700 !important;
  border-radius: 8px !important;
}

/* 6. Reports: Dedicated Analytics Screen */
.reports-analytics-section {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
}
.reports-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 2px;
}
.reports-main-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}
.reports-sub-title {
  font-size: 0.8rem;
  color: var(--text-muted);
}
.reports-header-actions {
  display: flex;
  gap: 8px;
}
.report-action-btn {
  font-weight: 700;
}
.reports-filter-bar {
  margin-bottom: 4px;
}
.analytics-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  width: 100%;
  box-sizing: border-box;
}
.analytics-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}
.analytics-card-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text-primary);
}
.analytics-period-badge,
.analytics-sub-tag {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 12px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
}

/* Collection Performance Grid */
.collection-perf-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.perf-metric-item {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.perf-lbl {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.perf-val {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.2;
}
.perf-val.text-green {
  color: #10b981;
}
.perf-val.text-amber {
  color: #f59e0b;
}
.perf-sub {
  font-size: 0.68rem;
  color: var(--text-muted);
}
.perf-rate-box {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 12px;
}
.perf-rate-val {
  font-size: 1.25rem;
  font-weight: 900;
  color: #10b981;
}
.perf-progress-track {
  height: 8px;
  background: var(--border-color);
  border-radius: 4px;
  overflow: hidden;
}
.perf-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #10b981, #059669);
  border-radius: 4px;
  transition: width 0.3s ease;
}

/* Revenue Trend Chart */
.revenue-chart-container {
  width: 100%;
}
.revenue-trend-bars {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 8px;
  height: 155px;
  padding: 8px 4px 4px 4px;
}
.revenue-bar-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  justify-content: flex-end;
  gap: 6px;
}
.revenue-bar-amt {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-align: center;
  white-space: nowrap;
}
.revenue-bar-track {
  width: 100%;
  max-width: 38px;
  height: 95px;
  background: var(--bg-secondary);
  border-radius: 8px;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  border: 1px solid var(--border-color);
}
.revenue-bar-fill {
  width: 100%;
  background: linear-gradient(180deg, #3b82f6 0%, #1d4ed8 100%);
  border-radius: 6px 6px 0 0;
  transition: height 0.3s ease;
}
.revenue-bar-col.zero-data .revenue-bar-fill {
  background: var(--border-color);
  height: 6% !important;
}
.revenue-bar-month {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
}

/* Aging Grid */
.aging-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.aging-bucket {
  padding: 12px;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  border: 1px solid var(--border-color);
  background: var(--bg-secondary);
}
.bucket-0-30 {
  border-left: 4px solid #10b981;
}
.bucket-31-60 {
  border-left: 4px solid #3b82f6;
}
.bucket-61-90 {
  border-left: 4px solid #f59e0b;
}
.bucket-90-plus {
  border-left: 4px solid #ef4444;
  background: rgba(239, 68, 68, 0.05);
}
.aging-bucket-lbl {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
}
.aging-bucket-amt {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.2;
}
.aging-bucket-count {
  font-size: 0.68rem;
  color: var(--text-muted);
}

/* Status Breakdown */
.status-segmented-bar {
  height: 12px;
  width: 100%;
  background: var(--bg-secondary);
  border-radius: 6px;
  overflow: hidden;
  display: flex;
  margin-bottom: 12px;
  border: 1px solid var(--border-color);
}
.seg-fill {
  height: 100%;
  transition: width 0.3s ease;
}
.seg-paid { background: #10b981; }
.seg-partial { background: #3b82f6; }
.seg-unpaid { background: #f59e0b; }
.seg-overdue { background: #ef4444; }

.status-items-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.status-stat-chip {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.status-stat-header {
  display: flex;
  align-items: center;
  gap: 6px;
}
.status-dot-icon {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.dot-paid { background: #10b981; }
.dot-partial { background: #3b82f6; }
.dot-unpaid { background: #f59e0b; }
.dot-overdue { background: #ef4444; }
.status-stat-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
}
.status-stat-val {
  font-size: 1.25rem;
  font-weight: 900;
  color: var(--text-primary);
  line-height: 1.2;
}
.status-stat-footer {
  font-size: 0.68rem;
  color: var(--text-secondary);
}

/* Top Clients */
.top-clients-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.top-client-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.top-client-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.top-client-rank {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: rgba(59, 130, 246, 0.15);
  color: #3b82f6;
  font-size: 0.72rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.top-client-name {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-primary);
  cursor: pointer;
  flex-grow: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.top-client-bills {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 600;
  flex-shrink: 0;
}
.top-client-fin-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.74rem;
}
.top-client-lbl {
  display: block;
  color: var(--text-muted);
  font-size: 0.68rem;
}
.top-client-val {
  font-weight: 700;
}
.top-client-track {
  height: 5px;
  background: var(--border-color);
  border-radius: 3px;
  overflow: hidden;
}
.top-client-progress {
  height: 100%;
  background: #10b981;
  border-radius: 3px;
}

/* Category Breakdown */
.category-breakdown-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.category-item-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.category-item-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
}
.category-item-name {
  font-weight: 700;
  color: var(--text-primary);
}
.category-item-amt {
  font-weight: 800;
  color: var(--text-secondary);
  font-size: 0.76rem;
}
.category-item-track {
  height: 6px;
  background: var(--border-color);
  border-radius: 3px;
  overflow: hidden;
}
.category-item-bar {
  height: 100%;
  background: linear-gradient(90deg, #3b82f6, #8b5cf6);
  border-radius: 3px;
}

/* ============================================================
   PRINT STYLING (@media print) - CRITICAL FOR CLEAN A4 EXPORT
   ============================================================ */
@media print {
  body.printing-business-report {
    width: 100% !important;
    height: auto !important;
    max-height: none !important;
    padding: 15mm !important;
    background: #ffffff !important;
    color: #000000 !important;
    overflow: visible !important;
  }
  body.printing-business-report #reportsView {
    display: block !important;
    visibility: visible !important;
  }
  body.printing-business-report .reports-header-actions,
  body.printing-business-report .reports-filter-bar,
  body.printing-business-report .mobile-bottom-nav,
  body.printing-business-report .mobile-fab-container {
    display: none !important;
  }

  @page {
    size: A4 portrait;
    margin: 0 !important; /* Completely removes browser URL, timestamp, date, and page title */
  }

  *, *:before, *:after {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
    box-sizing: border-box !important;
  }

  html, body {
    width: 210mm !important;
    height: 297mm !important;
    max-height: 297mm !important;
    margin: 0 !important;
    padding: 0 !important;
    background: #ffffff !important;
    color: #000000 !important;
    overflow: hidden !important;
    text-align: left !important;
  }

  /* Completely hide all UI elements during print */
  header,
  .app-header,
  #dashboardView,
  #invoicesView,
  #paymentsView,
  #customersView,
  #reportsView,
  .mobile-bottom-nav,
  .desktop-nav-links,
  .editor-bar,
  .form-column,
  .preview-controls,
  .toast,
  .modal-overlay,
  .btn,
  .icon-btn {
    display: none !important;
    visibility: hidden !important;
  }

  .main-wrapper,
  .editor-layout,
  .preview-pane,
  .paper-scroll-wrapper,
  .a4-preview-viewport,
  .a4-preview-scaler {
    display: block !important;
    width: 210mm !important;
    max-width: 210mm !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    border: none !important;
    overflow: visible !important;
    position: static !important;
    transform: none !important;
    text-align: left !important;
  }

  .a4-preview-toolbar {
    display: none !important;
  }

  .a4-preview-scaler .invoice-paper {
    position: static !important;
    transform: none !important;
  }

  /* The A4 paper in print matches the Live Document Preview EXACTLY */
  .invoice-paper {
    box-sizing: border-box !important;
    width: 210mm !important;
    max-width: 210mm !important;
    min-height: 297mm !important;
    max-height: 297mm !important;
    height: 297mm !important;
    margin: 0 auto !important;
    padding: 10mm 15mm 12mm 15mm !important;
    box-shadow: none !important;
    border: none !important;
    page-break-inside: avoid !important;
    page-break-after: avoid !important;
    text-align: left !important;
    background: #ffffff !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: flex-start !important;
  }

  .paper-footer-section {
    margin-top: 14px !important;
  }

  /* Ensure text alignment in print strictly matches live preview */
  .recipient-block,
  .amount-in-words-block,
  .terms-conditions-block,
  .payment-instructions {
    text-align: left !important;
  }

  .tax-invoice-title,
  .doc-main-title {
    text-align: center !important;
  }

  .signature-block {
    text-align: center !important;
  }
}

/* ============================================================
   OMKAR BILLCRAFT AUTHENTICATION & SIGN IN PAGE SYSTEM
   ============================================================ */

/* Authentication Visibility State Gates & Viewport Lock */
html:has(body.unauthenticated),
body.unauthenticated {
  height: 100vh !important;
  height: 100dvh !important;
  max-height: 100vh !important;
  max-height: 100dvh !important;
  overflow: hidden !important;
  position: fixed !important;
  width: 100% !important;
  inset: 0 !important;
  overscroll-behavior: none !important;
}

body.unauthenticated .app-shell,
body.unauthenticated .mobile-bottom-nav,
body.unauthenticated .mobile-fab-container,
body.unauthenticated .mobile-nav-backdrop,
body.unauthenticated .mobile-nav-drawer {
  display: none !important;
}

body.unauthenticated .auth-view-wrapper {
  display: flex !important;
}

body.authenticated .auth-view-wrapper {
  display: none !important;
}

/* ============================================================
   OMKAR BILLCRAFT — PROFESSIONAL GST BILLING AUTHENTICATION VIEW
   ============================================================ */

.auth-view-wrapper {
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  height: 100dvh !important;
  max-height: 100vh !important;
  max-height: 100dvh !important;
  background-color: #f8fafc;
  overflow: hidden !important;
  overscroll-behavior: none !important;
  box-sizing: border-box !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: space-between !important;
  padding: clamp(8px, 1.6vh, 18px) clamp(16px, 2.5vw, 36px) clamp(6px, 1.2vh, 14px) clamp(16px, 2.5vw, 36px) !important;
  z-index: 100 !important;
  transition: background-color 0.25s ease;
}

[data-theme="dark"] .auth-view-wrapper {
  background-color: #0b1220;
}

/* Background Subtle Grid Texture */
.auth-bg-grid {
  position: fixed;
  inset: 0;
  background-image: 
    linear-gradient(to right, rgba(15, 23, 42, 0.035) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(15, 23, 42, 0.035) 1px, transparent 1px);
  background-size: 32px 32px;
  pointer-events: none;
  z-index: 0;
}

[data-theme="dark"] .auth-bg-grid {
  background-image: 
    linear-gradient(to right, rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
}

/* Ambient Radial Glows (Subtle, refined financial tone) */
.auth-ambient-glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(100px);
  pointer-events: none;
  z-index: 0;
  opacity: 0.15;
  transition: opacity 0.3s ease;
}

.auth-ambient-glow.glow-1 {
  width: 440px;
  height: 440px;
  background: radial-gradient(circle, rgba(239, 68, 68, 0.16) 0%, rgba(239, 68, 68, 0) 70%);
  top: -80px;
  left: -60px;
}

.auth-ambient-glow.glow-2 {
  width: 480px;
  height: 480px;
  background: radial-gradient(circle, rgba(37, 99, 235, 0.14) 0%, rgba(37, 99, 235, 0) 70%);
  bottom: -100px;
  right: -60px;
}

[data-theme="dark"] .auth-ambient-glow {
  opacity: 0.25;
}

/* Auth Top Action Bar */
.auth-top-bar {
  width: 100%;
  max-width: 1260px;
  margin: 0 auto clamp(4px, 1vh, 12px) auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  z-index: 10;
  box-sizing: border-box;
  flex-shrink: 0;
}

.auth-top-security {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: clamp(0.72rem, 0.82vw, 0.78rem);
  font-weight: 600;
  color: #475569;
  letter-spacing: 0.02em;
  background: #ffffff;
  padding: 4px 12px;
  border-radius: 20px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

[data-theme="dark"] .auth-top-security {
  background: #111c30;
  border-color: #1e293b;
  color: #94a3b8;
  box-shadow: none;
}

.auth-top-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 6px #10b981;
}

.auth-theme-toggle {
  width: clamp(32px, 3.8vh, 38px);
  height: clamp(32px, 3.8vh, 38px);
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: #0f172a;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: clamp(0.95rem, 1.1vw, 1.05rem);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

[data-theme="dark"] .auth-theme-toggle {
  background: #162238;
  border-color: #334155;
  color: #f8fafc;
  box-shadow: none;
}

.auth-theme-toggle:hover {
  transform: translateY(-1px);
  border-color: #ef4444;
}

/* ============================================================
   MAIN CENTER CONTAINER (SPLIT LAYOUT)
   ============================================================ */
.auth-container {
  width: 100%;
  max-width: 1260px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: clamp(20px, 3.2vw, 44px);
  position: relative;
  z-index: 10;
  box-sizing: border-box;
  flex: 1 1 auto;
  min-height: 0;
}

/* ============================================================
   LEFT SECTION: OMKAR BILLING BRANDING
   ============================================================ */
.auth-branding-section {
  flex: 1 1 54%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: 720px;
  box-sizing: border-box;
}

.auth-brand-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: clamp(14px, 2vh, 22px);
  flex-shrink: 0;
}

.auth-brand-logo-box {
  width: clamp(34px, 3.8vh, 40px);
  height: clamp(34px, 3.8vh, 40px);
  flex-shrink: 0;
  filter: drop-shadow(0 4px 10px rgba(239, 68, 68, 0.3));
}

.brand-o-icon {
  width: 100%;
  height: 100%;
  display: block;
}

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

.auth-brand-title {
  font-size: clamp(1.35rem, 1.75vw, 1.55rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #0f172a;
  margin: 0;
  line-height: 1.15;
}

[data-theme="dark"] .auth-brand-title {
  color: #ffffff;
}

.auth-brand-gst-badge {
  font-size: 0.625rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  padding: 2px 7px;
  border-radius: 5px;
  background: #ecfdf5;
  color: #059669;
  border: 1px solid #a7f3d0;
  text-transform: uppercase;
}

[data-theme="dark"] .auth-brand-gst-badge {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border-color: rgba(16, 185, 129, 0.35);
}

/* Kicker Badge */
.auth-kicker-badge {
  font-size: clamp(0.68rem, 0.75vw, 0.75rem);
  font-weight: 750;
  color: #ef4444;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 12px;
  display: inline-block;
}

/* Hero Headline & Description */
.auth-brand-hero {
  margin-bottom: clamp(20px, 2.5vh, 28px);
  flex-shrink: 0;
}

.auth-hero-heading {
  font-size: clamp(1.65rem, 2.2vw, 2.25rem);
  font-weight: 850;
  letter-spacing: -0.025em;
  color: #0f172a;
  margin: 0 0 16px 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  line-height: 1.18;
}

[data-theme="dark"] .auth-hero-heading {
  color: #ffffff;
}

.auth-heading-line {
  display: block;
}

.auth-hero-highlight {
  color: #ef4444;
}

.auth-hero-desc {
  font-size: clamp(0.88rem, 0.95vw, 0.96rem);
  line-height: 1.6;
  color: #475569;
  margin: 0;
  max-width: 520px;
}

[data-theme="dark"] .auth-hero-desc {
  color: #94a3b8;
}

/* Middle Showcase: 4 Features + Floating Visual Preview */
.auth-brand-showcase-split {
  display: flex;
  align-items: center;
  gap: clamp(14px, 1.8vw, 22px);
  margin-bottom: clamp(14px, 1.8vh, 20px);
  min-height: 0;
  flex-shrink: 0;
}

.auth-features-grid {
  flex: 1 1 54%;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: clamp(8px, 1.1vh, 12px);
}

.auth-feature-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: clamp(8px, 1.1vh, 12px) clamp(10px, 1vw, 14px);
  display: flex;
  align-items: center;
  gap: clamp(10px, 1vw, 12px);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.auth-feature-card:hover {
  transform: translateY(-1px);
  border-color: #cbd5e1;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.04);
}

[data-theme="dark"] .auth-feature-card {
  background: #111c30;
  border-color: #1e293b;
  box-shadow: none;
}

[data-theme="dark"] .auth-feature-card:hover {
  border-color: #334155;
}

.feat-icon-box {
  width: clamp(26px, 3.2vh, 30px);
  height: clamp(26px, 3.2vh, 30px);
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.feat-icon-box svg {
  width: clamp(14px, 1.7vh, 16px);
  height: clamp(14px, 1.7vh, 16px);
}

.feat-icon-box.icon-red {
  background: #fef2f2;
  color: #ef4444;
  border: 1px solid #fecaca;
}

.feat-icon-box.icon-emerald {
  background: #ecfdf5;
  color: #10b981;
  border: 1px solid #a7f3d0;
}

.feat-icon-box.icon-blue {
  background: #eff6ff;
  color: #3b82f6;
  border: 1px solid #bfdbfe;
}

.feat-icon-box.icon-amber {
  background: #fffbeb;
  color: #f59e0b;
  border: 1px solid #fde68a;
}

[data-theme="dark"] .feat-icon-box.icon-red {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.3);
}

[data-theme="dark"] .feat-icon-box.icon-emerald {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.3);
}

[data-theme="dark"] .feat-icon-box.icon-blue {
  background: rgba(59, 130, 246, 0.15);
  border-color: rgba(59, 130, 246, 0.3);
}

[data-theme="dark"] .feat-icon-box.icon-amber {
  background: rgba(245, 158, 11, 0.15);
  border-color: rgba(245, 158, 11, 0.3);
}

.feat-content {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.feat-title {
  font-size: clamp(0.78rem, 0.85vw, 0.84rem);
  font-weight: 700;
  color: #0f172a;
  line-height: 1.25;
}

[data-theme="dark"] .feat-title {
  color: #ffffff;
}

.feat-desc {
  font-size: clamp(0.66rem, 0.72vw, 0.72rem);
  color: #64748b;
  line-height: 1.35;
}

[data-theme="dark"] .feat-desc {
  color: #94a3b8;
}

/* Floating Visual Preview Mockup */
.auth-visual-preview {
  flex: 1 1 46%;
  position: relative;
  min-height: clamp(105px, 12vh, 135px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  pointer-events: none;
}

.visual-invoice-sheet {
  width: clamp(120px, 10.5vw, 140px);
  height: clamp(86px, 10vh, 110px);
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: clamp(7px, 0.85vh, 9px);
  box-shadow: 0 8px 20px -3px rgba(15, 23, 42, 0.07);
  transform: rotate(-2deg);
  box-sizing: border-box;
  position: relative;
}

[data-theme="dark"] .visual-invoice-sheet {
  background: #111c30;
  border-color: #1e293b;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.4);
}

.vi-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: clamp(4px, 0.6vh, 7px);
}

.vi-tag {
  font-size: 0.52rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: #475569;
}

[data-theme="dark"] .vi-tag {
  color: #94a3b8;
}

.vi-check-circle {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #10b981;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
}

.vi-check-circle svg {
  width: 9px;
  height: 9px;
}

.vi-lines {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-bottom: 5px;
}

.vi-line {
  height: 3px;
  border-radius: 2px;
  background: #e2e8f0;
}

[data-theme="dark"] .vi-line {
  background: rgba(255, 255, 255, 0.1);
}

.vi-line.l1 { width: 85%; }
.vi-line.l2 { width: 65%; }
.vi-line.l3 { width: 45%; }

.vi-currency-symbol {
  font-size: clamp(1.4rem, 1.8vh, 1.75rem);
  font-weight: 800;
  color: rgba(15, 23, 42, 0.07);
  position: absolute;
  right: 6px;
  bottom: 5px;
  line-height: 1;
}

[data-theme="dark"] .vi-currency-symbol {
  color: rgba(255, 255, 255, 0.15);
}

.vi-chip-status {
  position: absolute;
  bottom: clamp(5px, 0.7vh, 7px);
  left: clamp(6px, 0.8vh, 8px);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: clamp(0.52rem, 0.6vw, 0.58rem);
  font-weight: 700;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #059669;
  padding: 2px 5px;
  border-radius: 16px;
}

[data-theme="dark"] .vi-chip-status {
  background: rgba(16, 185, 129, 0.2);
  border-color: rgba(16, 185, 129, 0.4);
  color: #10b981;
}

.vi-chip-check {
  width: 8px;
  height: 8px;
}

.visual-receivables-pill {
  position: absolute;
  top: clamp(2px, 0.5vh, 6px);
  right: -6px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  padding: clamp(3px, 0.5vh, 5px) clamp(6px, 0.8vw, 9px);
  border-radius: 9px;
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  transform: rotate(2deg);
}

[data-theme="dark"] .visual-receivables-pill {
  background: #111c30;
  border-color: #1e293b;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
}

.vr-icon-wrap {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: #eff6ff;
  color: #3b82f6;
  display: flex;
  align-items: center;
  justify-content: center;
}

[data-theme="dark"] .vr-icon-wrap {
  background: rgba(59, 130, 246, 0.15);
}

.vr-icon-wrap svg {
  width: 12px;
  height: 12px;
}

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

.vr-label {
  font-size: 0.54rem;
  color: #64748b;
  font-weight: 600;
  line-height: 1.1;
}

[data-theme="dark"] .vr-label {
  color: #94a3b8;
}

.vr-value {
  font-size: 0.72rem;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.15;
}

[data-theme="dark"] .vr-value {
  color: #ffffff;
}

.vr-trend {
  color: #10b981;
}

.visual-whatsapp-pill {
  position: absolute;
  bottom: -2px;
  right: -4px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  padding: clamp(3px, 0.5vh, 5px) clamp(6px, 0.8vw, 9px);
  border-radius: 9px;
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] .visual-whatsapp-pill {
  background: #111c30;
  border-color: #1e293b;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
}

.vwa-icon {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #25d366;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
}

.vwa-icon svg {
  width: 11px;
  height: 11px;
}

.vwa-info {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.vwa-title {
  font-size: 0.62rem;
  font-weight: 700;
  color: #0f172a;
}

[data-theme="dark"] .vwa-title {
  color: #ffffff;
}

.vwa-sub {
  font-size: 0.52rem;
  color: #64748b;
}

[data-theme="dark"] .vwa-sub {
  color: #94a3b8;
}

.auth-branding-footer {
  font-size: clamp(0.7rem, 0.78vw, 0.76rem);
  color: #64748b;
  margin-top: clamp(14px, 1.8vh, 22px);
  flex-shrink: 0;
}

[data-theme="dark"] .auth-branding-footer {
  color: #94a3b8;
}

/* ============================================================
   RIGHT SECTION: PROFESSIONAL AUTH CARD
   ============================================================ */
.auth-form-section {
  flex: 0 0 clamp(450px, 34vw, 480px);
  width: 100%;
  max-width: 480px;
  display: flex;
  justify-content: center;
  align-items: center;
  box-sizing: border-box;
  min-height: 0;
}

.auth-card {
  width: 100%;
  max-width: 470px;
  padding: 34px 36px 26px 36px;
  box-sizing: border-box;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 18px;
  box-shadow: 0 16px 40px -8px rgba(15, 23, 42, 0.08), 0 3px 8px rgba(15, 23, 42, 0.04);
  display: flex;
  flex-direction: column;
  position: relative;
  transition: all 0.25s ease;
}

[data-theme="dark"] .auth-card {
  background: #111c30;
  border-color: #1e293b;
  box-shadow: 0 16px 36px -8px rgba(0, 0, 0, 0.5);
}

/* Card Brand Header */
.auth-card-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  flex-shrink: 0;
}

.auth-card-logo-box {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  filter: drop-shadow(0 3px 8px rgba(239, 68, 68, 0.25));
}

.brand-o-icon-sm {
  width: 100%;
  height: 100%;
  display: block;
}

.auth-card-brand-info {
  display: flex;
  align-items: center;
  gap: 8px;
}

.auth-card-brand-name {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #0f172a;
  line-height: 1.2;
}

[data-theme="dark"] .auth-card-brand-name {
  color: #ffffff;
}

.auth-card-badge {
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  padding: 2.5px 7px;
  border-radius: 5px;
  background: #ecfdf5;
  color: #059669;
  border: 1px solid #a7f3d0;
  text-transform: uppercase;
}

[data-theme="dark"] .auth-card-badge {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border-color: rgba(16, 185, 129, 0.35);
}

/* Mobile Compact Visual is hidden on desktop/tablet */
.auth-mobile-compact-visual {
  display: none;
}

/* Auth Card Title & Subtitle */
.auth-card-header {
  margin-bottom: 18px;
  flex-shrink: 0;
}

.auth-card-title {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.025em;
  color: #0f172a;
  margin: 0 0 5px 0;
  line-height: 1.2;
}

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

.auth-card-subtitle {
  font-size: 16px;
  color: #64748b;
  line-height: 1.4;
  margin: 0;
}

[data-theme="dark"] .auth-card-subtitle {
  color: #94a3b8;
}

/* Alert Notifications */
.auth-alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 0.84rem;
  line-height: 1.35;
  margin-bottom: 14px;
  box-sizing: border-box;
  animation: authFadeIn 0.25s ease-out;
}

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

.auth-alert.alert-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
}

[data-theme="dark"] .auth-alert.alert-error {
  background: rgba(239, 68, 68, 0.14);
  border-color: rgba(239, 68, 68, 0.35);
  color: #fca5a5;
}

.auth-alert.alert-success {
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #047857;
}

[data-theme="dark"] .auth-alert.alert-success {
  background: rgba(16, 185, 129, 0.14);
  border-color: rgba(16, 185, 129, 0.35);
  color: #6ee7b7;
}

.auth-alert.alert-info {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1d4ed8;
}

[data-theme="dark"] .auth-alert.alert-info {
  background: rgba(59, 130, 246, 0.14);
  border-color: rgba(59, 130, 246, 0.35);
  color: #93c5fd;
}

.auth-alert-icon {
  font-size: 0.95rem;
  flex-shrink: 0;
  margin-top: 1px;
}

.auth-alert-text {
  flex: 1;
}

/* Auth Form Fields */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
  flex-shrink: 0;
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.auth-label {
  font-size: 14px;
  font-weight: 750;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #475569;
}

[data-theme="dark"] .auth-label {
  color: #94a3b8;
}

.auth-input-wrapper {
  position: relative;
  width: 100%;
}

.auth-input-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: #94a3b8;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  transition: color 0.2s ease;
}

[data-theme="dark"] .auth-input-icon {
  color: #64748b;
}

.auth-input-wrapper:focus-within .auth-input-icon {
  color: #ef4444;
}

.auth-input {
  width: 100% !important;
  height: 52px !important;
  padding-left: 42px !important;
  padding-right: 44px !important;
  border-radius: 10px !important;
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  color: #0f172a !important;
  font-size: 16px !important;
  font-family: inherit !important;
  box-sizing: border-box !important;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease !important;
}

.auth-input::placeholder {
  color: #94a3b8;
}

[data-theme="dark"] .auth-input {
  background: #091122 !important;
  border-color: #1e293b !important;
  color: #f8fafc !important;
}

[data-theme="dark"] .auth-input::placeholder {
  color: #64748b;
}

.auth-input:focus {
  border-color: #ef4444 !important;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.16) !important;
  outline: none !important;
  background: #ffffff !important;
}

[data-theme="dark"] .auth-input:focus {
  background: #0b152a !important;
  border-color: #ef4444 !important;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2) !important;
}

.auth-input.is-invalid {
  border-color: var(--accent-danger) !important;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.18) !important;
}

.auth-pwd-toggle {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  border-radius: 6px;
  background: none;
  border: none;
  color: #94a3b8;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: color 0.2s ease, background-color 0.2s ease;
  padding: 0;
}

.auth-pwd-toggle:hover {
  color: #0f172a;
  background-color: rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] .auth-pwd-toggle {
  color: #64748b;
}

[data-theme="dark"] .auth-pwd-toggle:hover {
  color: #f8fafc;
  background-color: rgba(255, 255, 255, 0.06);
}

.eye-svg {
  width: 18px;
  height: 18px;
}

/* Primary Omkar Red Submit Button */
.auth-submit-wrap {
  margin-top: 4px;
}

.auth-submit-btn {
  width: 100% !important;
  height: 52px !important;
  border-radius: 10px !important;
  font-size: 16.5px !important;
  font-weight: 750 !important;
  letter-spacing: 0.01em !important;
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%) !important;
  border: none !important;
  color: #ffffff !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
  box-shadow: 0 4px 14px rgba(239, 68, 68, 0.3) !important;
}

.auth-submit-btn:hover:not(:disabled) {
  transform: translateY(-1px) !important;
  box-shadow: 0 6px 18px rgba(239, 68, 68, 0.4) !important;
  background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%) !important;
}

.auth-submit-btn:active:not(:disabled) {
  transform: translateY(0) !important;
}

.auth-submit-btn:disabled {
  opacity: 0.75 !important;
  cursor: not-allowed !important;
  transform: none !important;
}

/* Spinner Animation inside Submit Button */
.btn-spinner {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.spinner-ring {
  width: 15px;
  height: 15px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: authSpin 0.7s linear infinite;
  display: inline-block;
}

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

.spinner-label {
  font-size: 0.9rem;
  font-weight: 600;
}

/* Footer / Security Notice */
.auth-card-footer {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid #f1f5f9;
  text-align: center;
  flex-shrink: 0;
}

[data-theme="dark"] .auth-card-footer {
  border-top-color: rgba(255, 255, 255, 0.08);
}

.auth-security-notice {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-size: 14px;
  color: #64748b;
  font-weight: 550;
}

[data-theme="dark"] .auth-security-notice {
  color: #94a3b8;
}

.sec-lock-svg {
  width: 15px;
  height: 15px;
}

.auth-mobile-footer-text {
  display: none;
  font-size: 0.7rem;
  color: #64748b;
  text-align: center;
  margin-top: 8px;
}

/* ============================================================
   ACCOUNT PROFILE MENU DROPDOWN & LOGOUT SYSTEM
   ============================================================ */
.header-user-menu-wrapper {
  position: relative;
  display: inline-block;
  flex-shrink: 0;
}

.header-business-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  border-radius: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
  white-space: nowrap;
  flex-shrink: 0;
}

.header-business-badge:hover {
  border-color: var(--accent-primary);
  background: var(--bg-card-hover);
}

.hbadge-chevron {
  font-size: 0.75rem;
  color: var(--text-muted);
  transition: transform 0.2s ease;
}

.user-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 270px;
  max-width: calc(100vw - 24px);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xl);
  padding: 8px 0;
  z-index: 1000;
  animation: authFadeIn 0.2s ease-out;
  box-sizing: border-box;
}

[data-theme="light"] .user-dropdown-menu {
  background: #ffffff;
  border-color: #cbd5e1;
  box-shadow: 0 15px 35px -5px rgba(0, 0, 0, 0.12);
}

.user-dropdown-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
}

.ud-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
  color: #ffffff;
  font-size: 0.8125rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.ud-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.ud-info strong {
  font-size: 0.875rem;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ud-info span {
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-dropdown-status {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 16px 8px 16px;
  font-size: 0.72rem;
  color: #10b981;
  font-weight: 600;
}

.ud-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10b981;
}

.user-dropdown-divider {
  height: 1px;
  background: var(--border-color);
  margin: 6px 0;
}

.user-dropdown-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border: none;
  background: none;
  color: var(--text-primary);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: background-color 0.15s ease;
}

.user-dropdown-item:hover {
  background-color: var(--bg-card-hover);
}

[data-theme="light"] .user-dropdown-item:hover {
  background-color: #f1f5f9;
}

.user-dropdown-item.text-danger {
  color: var(--accent-danger);
}

.user-dropdown-item.text-danger:hover {
  background-color: rgba(239, 68, 68, 0.1);
}

.ud-item-icon {
  font-size: 1rem;
}

/* Mobile Drawer Logout Button */
.mobile-drawer-logout-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 8px;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #ef4444;
  font-size: 0.8125rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-left: auto;
}

.mobile-drawer-logout-btn:hover {
  background: rgba(239, 68, 68, 0.2);
}

/* ============================================================
   RESPONSIVE DESIGN BREAKPOINTS & COMPACT ADAPTATIONS
   ============================================================ */

/* WIDE DESKTOP SCREENS (1440px – 1920px+) */
@media (min-width: 1440px) {
  .auth-container {
    max-width: 1360px;
    gap: 60px;
  }
  .auth-form-section {
    flex: 0 0 480px;
    width: 480px;
    max-width: 480px;
  }
  .auth-card {
    max-width: 480px;
    padding: 38px 40px 28px 40px;
  }
  .auth-card-title {
    font-size: 30px;
  }
  .auth-card-subtitle {
    font-size: 16.5px;
  }
  .auth-input {
    height: 54px !important;
  }
  .auth-submit-btn {
    height: 54px !important;
    font-size: 17px !important;
  }
}

/* LAPTOP / MEDIUM DESKTOP (1025px – 1439px) */
@media (min-width: 1025px) and (max-width: 1439px) {
  .auth-container {
    gap: 36px;
    max-width: 1260px;
  }
  .auth-form-section {
    flex: 0 0 460px;
    width: 460px;
    max-width: 470px;
  }
  .auth-card {
    max-width: 460px;
    padding: 32px 34px 24px 34px;
  }
}

/* TABLET (768px – 1024px): Responsive card width without cramping */
@media (min-width: 768px) and (max-width: 1024px) {
  .auth-container {
    gap: 24px;
  }
  .auth-branding-section {
    flex: 1 1 54%;
  }
  .auth-form-section {
    flex: 0 0 clamp(360px, 42vw, 420px);
    width: clamp(360px, 42vw, 420px);
    max-width: 420px;
  }
  .auth-card {
    max-width: 420px;
    padding: 24px 26px 20px 26px;
  }
  .auth-card-brand {
    margin-bottom: 12px;
    gap: 10px;
  }
  .auth-card-logo-box {
    width: 32px;
    height: 32px;
  }
  .auth-card-brand-name {
    font-size: 1.15rem;
  }
  .auth-card-header {
    margin-bottom: 14px;
  }
  .auth-card-title {
    font-size: 24px;
    margin-bottom: 3px;
  }
  .auth-card-subtitle {
    font-size: 15px;
  }
  .auth-form {
    gap: 14px;
  }
  .auth-field {
    gap: 4px;
  }
  .auth-label {
    font-size: 13px;
  }
  .auth-input {
    height: 48px !important;
    font-size: 15px !important;
  }
  .auth-submit-btn {
    height: 48px !important;
    font-size: 15.5px !important;
  }
  .auth-card-footer {
    margin-top: 12px;
    padding-top: 10px;
  }
  .auth-security-notice {
    font-size: 13px;
  }
  .auth-visual-preview {
    display: flex;
    transform: scale(0.85);
    transform-origin: center right;
  }
}

/* EXTREME COMPACT HEIGHT ON DESKTOP (<= 580px: only for heavily resized windows) */
@media (min-width: 1025px) and (max-height: 580px) {
  .auth-view-wrapper {
    padding: 4px 24px 4px 24px !important;
  }
  .auth-top-bar {
    margin-bottom: 2px;
  }
  .auth-card {
    padding: 20px 28px 16px 28px;
  }
  .auth-card-brand {
    margin-bottom: 10px;
  }
  .auth-card-header {
    margin-bottom: 10px;
  }
  .auth-card-title {
    font-size: 24px;
  }
  .auth-form {
    gap: 12px;
  }
  .auth-input {
    height: 46px !important;
  }
  .auth-submit-btn {
    height: 46px !important;
  }
  .auth-card-footer {
    margin-top: 10px;
    padding-top: 8px;
  }
}

/* COMPACT HEIGHT ON TABLET & MOBILE (<= 640px) */
@media (max-width: 1024px) and (max-height: 640px) {
  .auth-view-wrapper {
    padding: 6px 16px 4px 16px !important;
  }
  .auth-top-bar {
    margin-bottom: 2px;
  }
  .auth-hero-heading {
    font-size: 1.4rem;
  }
  .auth-visual-preview {
    min-height: 85px;
    transform: scale(0.75);
  }
  .auth-card {
    padding: 14px 18px 10px 18px !important;
  }
  .auth-card-brand {
    margin-bottom: 6px !important;
  }
  .auth-card-header {
    margin-bottom: 6px !important;
  }
  .auth-form {
    gap: 8px !important;
  }
  .auth-input {
    height: 40px !important;
  }
  .auth-submit-btn {
    height: 42px !important;
  }
}

/* MOBILE VIEWPORT (<= 767px: Fixed full viewport lock) */
@media (max-width: 767px) {
  html:has(body.unauthenticated),
  body.unauthenticated {
    position: fixed !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100vh !important;
    height: 100dvh !important;
    max-height: 100vh !important;
    max-height: 100dvh !important;
    overflow: hidden !important;
    overscroll-behavior: none !important;
    touch-action: none !important;
  }

  .auth-view-wrapper {
    position: fixed !important;
    inset: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    height: 100dvh !important;
    max-height: 100vh !important;
    max-height: 100dvh !important;
    overflow: hidden !important;
    overscroll-behavior: none !important;
    touch-action: pan-y !important;
    padding: clamp(8px, 1.8vh, 14px) clamp(12px, 3.5vw, 18px) clamp(6px, 1.4vh, 12px) clamp(12px, 3.5vw, 18px) !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
  }

  .auth-top-bar {
    max-width: 100% !important;
    margin: 0 auto clamp(3px, 0.8vh, 8px) auto !important;
    flex-shrink: 0 !important;
  }

  .auth-top-security {
    font-size: 0.7rem !important;
    padding: 3px 10px !important;
  }

  .auth-theme-toggle {
    width: 32px !important;
    height: 32px !important;
    font-size: 0.95rem !important;
  }

  .auth-container {
    width: 100% !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0 !important;
    margin: 0 auto !important;
    flex: 1 1 auto !important;
    min-height: 0 !important;
  }

  /* Compact branding on mobile */
  .auth-branding-section {
    display: none !important;
  }

  .auth-form-section {
    flex: 1 1 auto !important;
    width: 100% !important;
    max-width: 400px !important;
    margin: 16px auto !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 0 !important;
  }

  .auth-card {
    width: 100% !important;
    max-width: 400px !important;
    margin: 0 auto !important;
    padding: clamp(14px, 2vh, 18px) 20px clamp(12px, 1.5vh, 16px) 20px !important;
    border-radius: 16px !important;
    box-sizing: border-box !important;
  }

  .auth-card-brand {
    margin-bottom: clamp(5px, 0.9vh, 8px) !important;
    gap: 8px !important;
  }

  .auth-card-logo-box {
    width: 28px !important;
    height: 28px !important;
  }

  .auth-card-brand-name {
    font-size: 1.05rem !important;
  }

  .auth-card-badge {
    font-size: 0.56rem !important;
    padding: 2px 5px !important;
  }

  /* Compact billing visual strip on mobile */
  .auth-mobile-compact-visual {
    display: block !important;
    margin-bottom: clamp(6px, 1vh, 10px) !important;
    background: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 9px !important;
    padding: clamp(5px, 0.8vh, 8px) clamp(8px, 2.5vw, 12px) !important;
  }

  [data-theme="dark"] .auth-mobile-compact-visual {
    background: #111c30 !important;
    border-color: #1e293b !important;
  }

  .amv-inner {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 8px !important;
  }

  .amv-mini-doc {
    display: flex !important;
    align-items: center !important;
    gap: 5px !important;
  }

  .amv-doc-label {
    font-size: 0.68rem !important;
    font-weight: 750 !important;
    color: #475569 !important;
  }

  [data-theme="dark"] .amv-doc-label {
    color: #94a3b8 !important;
  }

  .amv-doc-lines {
    display: flex !important;
    flex-direction: column !important;
    gap: 2px !important;
    width: 20px !important;
  }

  .amv-line {
    height: 2.5px !important;
    border-radius: 2px !important;
    background: #cbd5e1 !important;
  }

  [data-theme="dark"] .amv-line {
    background: rgba(255, 255, 255, 0.15) !important;
  }

  .amv-line.short {
    width: 60% !important;
  }

  .amv-currency {
    font-size: 1.05rem !important;
    font-weight: 800 !important;
    color: #ef4444 !important;
  }

  .amv-badges {
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
  }

  .amv-rec-badge {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-end !important;
  }

  .amv-rec-label {
    font-size: 0.52rem !important;
    color: #64748b !important;
  }

  .amv-rec-amount {
    font-size: 0.72rem !important;
    font-weight: 800 !important;
    color: #0f172a !important;
  }

  [data-theme="dark"] .amv-rec-amount {
    color: #ffffff !important;
  }

  .amv-trend {
    color: #10b981 !important;
  }

  .amv-status-badge {
    display: inline-flex !important;
    align-items: center !important;
    gap: 2px !important;
    font-size: 0.6rem !important;
    font-weight: 700 !important;
    background: rgba(16, 185, 129, 0.15) !important;
    border: 1px solid rgba(16, 185, 129, 0.35) !important;
    color: #10b981 !important;
    padding: 1px 6px !important;
    border-radius: 10px !important;
  }

  .auth-card-header {
    margin-bottom: clamp(6px, 1vh, 10px) !important;
  }

  .auth-card-title {
    font-size: clamp(1.15rem, 4.2vw, 1.3rem) !important;
    margin-bottom: 2px !important;
  }

  .auth-card-subtitle {
    font-size: clamp(0.72rem, 2.6vw, 0.78rem) !important;
  }

  .auth-form {
    gap: clamp(6px, 1vh, 9px) !important;
  }

  .auth-field {
    gap: 2px !important;
  }

  .auth-label {
    font-size: 0.72rem !important;
  }

  .auth-input {
    height: 46px !important;
    font-size: 16px !important; /* Prevents auto-zoom on iOS */
    padding-left: 38px !important;
    padding-right: 38px !important;
  }

  .auth-input-icon {
    left: 11px !important;
    width: 16px !important;
    height: 16px !important;
  }

  .auth-pwd-toggle {
    right: 5px !important;
    width: 30px !important;
    height: 30px !important;
  }

  .eye-svg {
    width: 16px !important;
    height: 16px !important;
  }

  .auth-submit-wrap {
    margin-top: 4px !important;
  }

  .auth-submit-btn {
    height: 46px !important;
    font-size: 15.5px !important;
  }

  .auth-card-footer {
    margin-top: clamp(5px, 0.9vh, 8px) !important;
    padding-top: clamp(4px, 0.7vh, 7px) !important;
  }

  .auth-security-notice {
    font-size: 0.66rem !important;
  }

  .auth-mobile-footer-text {
    display: block !important;
    margin-top: clamp(4px, 0.7vh, 8px) !important;
    font-size: 0.65rem !important;
    color: #64748b;
    text-align: center;
  }
}

/* ULTRA-COMPACT MOBILE VIEWPORT (<= 340px: e.g. iPhone SE 320px) */
@media (max-width: 340px) {
  .auth-view-wrapper {
    padding: 6px 8px 6px 8px !important;
  }
  .auth-card {
    padding: 10px 12px 8px 12px !important;
  }
  .auth-card-brand-name {
    font-size: 0.98rem !important;
  }
  .auth-card-title {
    font-size: 1.15rem !important;
  }
  .auth-input {
    height: 36px !important;
  }
  .auth-submit-btn {
    height: 38px !important;
  }
}




