/* ====================================================================
   Tour & Travel Management ERP (TTMB) - Modern Responsive Design System
   Optimized for Desktop, Tablet, and Mobile Touchscreens
   ==================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:wght@500;600;700;800&family=Figtree:wght@400;500;600;700&display=swap');

:root {
  --font-heading: 'Bricolage Grotesque', system-ui, -apple-system, sans-serif;
  --font-body: 'Figtree', system-ui, -apple-system, sans-serif;

  /* Color Palette - Vibrant Indigo / Ocean / Teal */
  --bg: #0f172a;
  --surface: #1e293b;
  --surface-alt: #243447;
  --surface-hover: #2d3f54;
  --border: #334155;
  --border-focus: #38bdf8;
  
  --ink: #f8fafc;
  --ink-muted: #94a3b8;
  --ink-faint: #64748b;

  --primary: #0284c7;
  --primary-hover: #0369a1;
  --primary-light: #0284c720;
  --primary-ink: #ffffff;

  --accent: #f59e0b;
  --accent-light: #f59e0b20;
  --accent-ink: #ffffff;

  --success: #10b981;
  --success-light: #10b98118;
  --success-ink: #34d399;

  --warning: #f59e0b;
  --warning-light: #f59e0b18;
  --warning-ink: #fbbf24;

  --danger: #ef4444;
  --danger-light: #ef444418;
  --danger-ink: #f87171;

  --wa-color: #25d366;
  --wa-ink: #ffffff;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.15);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.25), 0 2px 4px -2px rgb(0 0 0 / 0.2);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.35), 0 4px 6px -4px rgb(0 0 0 / 0.3);

  --header-height: 64px;
  --bottom-nav-height: 62px;
}

[data-theme="light"] {
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-alt: #f1f5f9;
  --surface-hover: #e2e8f0;
  --border: #cbd5e1;
  --border-focus: #0284c7;
  
  --ink: #0f172a;
  --ink-muted: #475569;
  --ink-faint: #94a3b8;

  --primary: #0284c7;
  --primary-hover: #0369a1;
  --primary-light: #e0f2fe;
  --primary-ink: #ffffff;

  --success-light: #dcfce7;
  --success-ink: #15803d;

  --warning-light: #fef3c7;
  --warning-ink: #b45309;

  --danger-light: #fee2e2;
  --danger-ink: #b91c1c;

  --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.07);
  --shadow-lg: 0 10px 20px -3px rgb(0 0 0 / 0.08);
}

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  background-color: var(--bg);
  -webkit-font-smoothing: antialiased;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + 12px);
}

body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--ink);
  margin-top: 0;
  letter-spacing: -0.015em;
  line-height: 1.25;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.15s ease;
}

a:hover {
  text-decoration: underline;
}

/* Touch-friendly Inputs & Form Controls */
button, input, select, textarea {
  font-family: inherit;
  font-size: 15px;
  color: inherit;
}

input, select, textarea {
  width: 100%;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 11px 14px;
  min-height: 46px;
  color: var(--ink);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  -webkit-appearance: none;
  appearance: none;
}

input[type="date"], input[type="time"] {
  min-height: 46px;
  -webkit-appearance: none;
  appearance: none;
  text-align: left;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.25);
}

/* Header & Navigation Bar */
.app-header {
  height: var(--header-height);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: var(--shadow-sm);
}

.header-container {
  max-width: 1380px;
  margin: 0 auto;
  padding: 0 16px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  min-width: 0;
}

.brand-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #0284c7, #06b6d4);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 18px;
  flex-shrink: 0;
  box-shadow: 0 4px 10px rgba(2, 132, 199, 0.4);
}

.brand-text {
  min-width: 0;
}

.brand-text h1 {
  font-size: 17px;
  margin: 0;
  line-height: 1.1;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand-text span {
  font-size: 11px;
  color: var(--ink-muted);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  display: block;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-item a {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  color: var(--ink-muted);
  font-weight: 600;
  font-size: 13.5px;
  transition: all 0.15s ease;
  text-decoration: none;
}

.nav-item a:hover {
  color: var(--ink);
  background: var(--surface-hover);
}

.nav-item.active a {
  color: var(--primary-ink);
  background: var(--primary);
}

.user-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.theme-toggle-btn {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  color: var(--ink);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  cursor: pointer;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
}

.user-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  font-size: 12.5px;
  font-weight: 600;
}

.role-pill {
  font-size: 10px;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: var(--radius-full);
  font-weight: 700;
}
.role-admin { background: var(--accent-light); color: var(--accent-ink); border: 1px solid var(--accent); }
.role-manager { background: var(--primary-light); color: var(--primary-ink); border: 1px solid var(--primary); }
.role-agent { background: var(--surface-hover); color: var(--ink-muted); }

/* Main Container */
.main-wrapper {
  max-width: 1380px;
  width: 100%;
  margin: 0 auto;
  padding: 20px 16px 80px;
  flex: 1;
}

/* Page Header & Actions */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 20px;
}

.page-title h2 {
  font-size: 24px;
  margin: 0 0 4px;
}

.page-subtitle {
  color: var(--ink-muted);
  font-size: 13.5px;
}

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

/* Cards & Containers */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 16px;
}

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

.card-title {
  font-size: 17px;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Stats / KPI Tiles */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.stat-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--stat-accent, var(--primary));
}

.stat-card.accent-emerald { --stat-accent: #10b981; }
.stat-card.accent-sky { --stat-accent: #0284c7; }
.stat-card.accent-amber { --stat-accent: #f59e0b; }
.stat-card.accent-rose { --stat-accent: #ef4444; }
.stat-card.accent-purple { --stat-accent: #8b5cf6; }

.stat-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-muted);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.stat-value {
  font-family: var(--font-heading);
  font-size: 24px;
  font-weight: 800;
  color: var(--ink);
  line-height: 1.1;
  word-break: break-word;
}

.stat-subtext {
  font-size: 11.5px;
  color: var(--ink-faint);
  margin-top: 5px;
}

/* Forms & Responsive Grids */
.form-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 14px;
}

.col-12 { grid-column: span 12; }
.col-8  { grid-column: span 8; }
.col-6  { grid-column: span 6; }
.col-4  { grid-column: span 4; }
.col-3  { grid-column: span 3; }
.col-2  { grid-column: span 2; }
.col-1  { grid-column: span 1; }

.form-group {
  margin-bottom: 10px;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-muted);
  margin-bottom: 5px;
}

.form-label .required {
  color: var(--danger);
  margin-left: 2px;
}

.form-control {
  font-size: 15px;
}

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

/* Money Input with Rupee symbol */
.money-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.money-symbol {
  position: absolute;
  left: 12px;
  color: var(--ink-muted);
  font-weight: 700;
  pointer-events: none;
  font-size: 15px;
}

.money-input-wrap .form-control {
  padding-left: 28px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  min-height: 44px;
  text-decoration: none !important;
  transition: all 0.15s ease;
  user-select: none;
  touch-action: manipulation;
}

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

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

.btn-secondary {
  background: var(--surface-alt);
  color: var(--ink);
  border-color: var(--border);
}

.btn-secondary:hover {
  background: var(--surface-hover);
}

.btn-success {
  background: #10b981;
  color: #fff;
  border-color: #10b981;
}

.btn-whatsapp {
  background: #25d366;
  color: #fff;
  border-color: #25d366;
}

.btn-danger {
  background: var(--danger-light);
  color: var(--danger-ink);
  border-color: var(--danger);
}

.btn-sm {
  min-height: 36px;
  padding: 6px 10px;
  font-size: 12.5px;
}

.btn-lg {
  min-height: 48px;
  padding: 12px 20px;
  font-size: 15px;
  border-radius: var(--radius-md);
}

/* Quick Select Chips */
.chips-wrapper {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.chip {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  color: var(--ink-muted);
  border-radius: var(--radius-full);
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  transition: all 0.15s ease;
}

.chip:hover, .chip.active {
  background: var(--primary-light);
  color: var(--primary);
  border-color: var(--primary);
}

/* Sticky Calculation Panel */
.calculation-panel {
  background: linear-gradient(145deg, var(--surface), var(--surface-alt));
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  position: sticky;
  top: calc(var(--header-height) + 12px);
}

.calc-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 8px 0;
  border-bottom: 1px dashed var(--border);
  font-size: 13.5px;
}

.calc-row.highlight {
  background: var(--primary-light);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  border-bottom: none;
  margin: 8px 0;
}

.calc-row.grand-total {
  border-top: 2px solid var(--border);
  border-bottom: none;
  padding-top: 12px;
  margin-top: 8px;
}

.calc-row.grand-total .calc-value {
  font-family: var(--font-heading);
  font-size: 22px;
  font-weight: 800;
  color: var(--ink);
}

.calc-row.advance-row {
  color: var(--success);
  font-weight: 600;
}

.calc-row.balance-row {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid var(--danger);
  border-radius: var(--radius-md);
  padding: 12px;
  margin-top: 10px;
}

.calc-row.balance-row .calc-label {
  font-weight: 700;
  color: var(--danger-ink);
  font-size: 14px;
}

.calc-row.balance-row .calc-value {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 800;
  color: var(--danger-ink);
}

/* Mobile Sticky Action Bar for Booking */
.mobile-action-bar {
  display: none;
  position: fixed;
  left: 0;
  right: 0;
  bottom: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom, 0px));
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 10px 14px;
  z-index: 80;
  box-shadow: 0 -4px 15px rgba(0,0,0,0.3);
}

.mobile-action-bar .bar-inner {
  max-width: 600px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.mobile-action-bar .bar-tot {
  line-height: 1.15;
  flex: 1;
}

.mobile-action-bar .bar-tot small {
  display: block;
  font-size: 11px;
  color: var(--ink-muted);
  font-weight: 600;
  text-transform: uppercase;
}

.mobile-action-bar .bar-tot strong {
  font-family: var(--font-heading);
  font-size: 20px;
  color: var(--ink);
}

.mobile-action-bar .bar-rem {
  font-size: 12px;
  color: var(--danger-ink);
  font-weight: 700;
  display: block;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.badge-paid {
  background: var(--success-light);
  color: var(--success-ink);
  border: 1px solid #10b98140;
}

.badge-partial {
  background: var(--warning-light);
  color: var(--warning-ink);
  border: 1px solid #f59e0b40;
}

.badge-unpaid {
  background: var(--danger-light);
  color: var(--danger-ink);
  border: 1px solid #ef444440;
}

/* Mobile Record Cards (Native App Style) */
.mobile-record-card {
  display: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
}

.rec-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 6px;
}

.rec-header .rec-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
}

.rec-sub {
  color: var(--ink-muted);
  font-size: 13px;
  margin-bottom: 8px;
}

.rec-financials {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 8px 0;
  border-top: 1px dashed var(--border);
  border-bottom: 1px dashed var(--border);
  margin-bottom: 10px;
}

.rec-financials .rec-tot {
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 800;
  color: var(--ink);
}

.rec-financials .rec-rem {
  font-size: 13px;
  color: var(--danger-ink);
  font-weight: 700;
}

.rec-actions {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.rec-actions .btn {
  min-height: 40px;
  padding: 6px 4px;
  font-size: 12px;
}

/* Tables */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

.data-table th {
  background: var(--surface-alt);
  color: var(--ink-muted);
  font-weight: 700;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 10px 14px;
  border-bottom: 2px solid var(--border);
  text-align: left;
  white-space: nowrap;
}

.data-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--ink);
  vertical-align: middle;
}

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

.data-table .text-right { text-align: right; }
.data-table .text-center { text-align: center; }

/* Alerts */
.flash-alert {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  border: 1px solid;
  margin-bottom: 16px;
  font-weight: 500;
  font-size: 14px;
}

.close-alert {
  background: none;
  border: none;
  font-size: 20px;
  color: inherit;
  cursor: pointer;
  line-height: 1;
}

/* Printable Proforma Invoice & Voucher */
.invoice-container {
  max-width: 900px;
  margin: 0 auto;
  background: #ffffff;
  color: #1e293b;
  border-radius: var(--radius-lg);
  padding: 36px;
  box-shadow: var(--shadow-lg);
  border: 1px solid #cbd5e1;
}

.invoice-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  border-bottom: 2px solid #0284c7;
  padding-bottom: 18px;
  margin-bottom: 20px;
}

.invoice-title h2 {
  color: #0284c7;
  font-size: 26px;
  margin: 0 0 4px;
}

.invoice-meta {
  color: #64748b;
  font-size: 12.5px;
  line-height: 1.5;
}

.invoice-agency-info {
  text-align: right;
  max-width: 320px;
  font-size: 12.5px;
  color: #475569;
}

.invoice-agency-info h3 {
  font-size: 17px;
  color: #0f172a;
  margin: 0 0 3px;
}

.invoice-parties-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-bottom: 20px;
  padding: 14px;
  background: #f8fafc;
  border-radius: var(--radius-md);
  border: 1px solid #e2e8f0;
}

.party-box h4 {
  font-size: 11.5px;
  text-transform: uppercase;
  color: #64748b;
  margin: 0 0 5px;
}

.party-box .party-name {
  font-size: 15px;
  font-weight: 700;
  color: #0f172a;
}

.invoice-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 20px;
}

.invoice-table th {
  background: #f1f5f9;
  color: #334155;
  padding: 9px 10px;
  font-size: 11.5px;
  text-transform: uppercase;
  border-bottom: 2px solid #0284c7;
  text-align: left;
}

.invoice-table td {
  padding: 11px 10px;
  border-bottom: 1px solid #e2e8f0;
  font-size: 13px;
  color: #1e293b;
}

.invoice-summary-box {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 20px;
}

.invoice-summary-table {
  width: 360px;
  border-collapse: collapse;
}

.invoice-summary-table td {
  padding: 6px 8px;
  font-size: 13px;
}

.invoice-summary-table tr.total-row td {
  font-size: 16px;
  font-weight: 800;
  border-top: 2px solid #0f172a;
  border-bottom: 2px solid #0f172a;
  color: #0284c7;
}

.invoice-summary-table tr.advance-row td {
  color: #15803d;
  font-weight: 700;
}

.invoice-summary-table tr.balance-row td {
  background: #fef2f2;
  color: #b91c1c;
  font-weight: 800;
  font-size: 15px;
}

.amount-words-banner {
  background: #f0fdf4;
  border-left: 4px solid #10b981;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 600;
  color: #166534;
  margin-bottom: 20px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.invoice-bank-details {
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-md);
  padding: 14px;
  background: #f8fafc;
  margin-bottom: 20px;
  font-size: 12.5px;
  line-height: 1.5;
}

.invoice-footer {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-top: 30px;
  padding-top: 16px;
  border-top: 1px solid #e2e8f0;
  font-size: 11.5px;
  color: #64748b;
}

.signatory-box {
  text-align: right;
  min-width: 180px;
}

.sign-line {
  border-bottom: 1px dashed #94a3b8;
  height: 42px;
  margin-bottom: 4px;
}

/* Mobile Bottom Navigation Bar */
.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--bottom-nav-height);
  background: var(--surface);
  border-top: 1px solid var(--border);
  z-index: 100;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  box-shadow: 0 -2px 10px rgba(0,0,0,0.2);
}

.mobile-bottom-nav ul {
  display: flex;
  margin: 0;
  padding: 0;
  list-style: none;
  height: 100%;
}

.mobile-bottom-nav li {
  flex: 1;
}

.mobile-bottom-nav a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--ink-muted);
  font-size: 11px;
  font-weight: 600;
  text-decoration: none;
  gap: 2px;
  touch-action: manipulation;
  border-top: 2px solid transparent;
}

.mobile-bottom-nav a.active {
  color: var(--primary);
  border-top-color: var(--primary);
  background: rgba(2, 132, 199, 0.06);
}

.mobile-bottom-nav a span.icon {
  font-size: 17px;
  line-height: 1;
}

/* ====================================================================
   MOBILE & TABLET RESPONSIVE OVERRIDES
   ==================================================================== */

@media (max-width: 900px) {
  .col-8, .col-4 {
    grid-column: span 12;
  }
  
  .mobile-action-bar {
    display: block;
  }
  
  body.has-action-bar .main-wrapper {
    padding-bottom: calc(var(--bottom-nav-height) + 85px + env(safe-area-inset-bottom, 0px));
  }
  
  .calculation-panel {
    position: static;
    margin-top: 12px;
  }
}

@media (max-width: 768px) {
  :root {
    --header-height: 58px;
  }

  .nav-links {
    display: none;
  }

  .mobile-bottom-nav {
    display: block;
  }

  .main-wrapper {
    padding-top: 14px;
    padding-bottom: calc(var(--bottom-nav-height) + 20px + env(safe-area-inset-bottom, 0px));
  }

  .user-badge span:first-child {
    display: none;
  }

  .brand-text h1 {
    font-size: 15px;
  }

  .brand-text span {
    font-size: 10px;
  }

  .page-header {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .page-actions {
    width: 100%;
  }

  .page-actions .btn {
    flex: 1;
  }

  /* Switch desktop tables to mobile cards */
  .desktop-table-view {
    display: none;
  }

  .mobile-record-card {
    display: block;
  }

  /* Proforma on Mobile */
  .invoice-container {
    padding: 18px 14px;
    border-radius: 12px;
  }

  .invoice-header {
    flex-direction: column;
    gap: 12px;
  }

  .invoice-agency-info {
    text-align: left;
    max-width: 100%;
  }

  .invoice-parties-grid {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 12px;
  }

  .invoice-summary-box {
    justify-content: stretch;
  }

  .invoice-summary-table {
    width: 100%;
  }

  .invoice-footer {
    flex-direction: column;
    align-items: stretch;
    gap: 18px;
  }

  .signatory-box {
    text-align: left;
  }
}

@media (max-width: 640px) {
  .col-6, .col-4, .col-3, .col-2, .col-1 {
    grid-column: span 12;
  }

  .form-grid {
    gap: 10px;
  }

  .card {
    padding: 14px;
    border-radius: 14px;
  }

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

  .stat-card {
    padding: 12px;
  }

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

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

/* Print Styles */
@media print {
  body {
    background: #ffffff !important;
    color: #000000 !important;
  }
  .app-header, .page-header, .page-actions, .mobile-bottom-nav, .mobile-action-bar, .theme-toggle-btn, .btn, .no-print {
    display: none !important;
  }
  .main-wrapper {
    padding: 0 !important;
    max-width: 100% !important;
  }
  .invoice-container {
    box-shadow: none !important;
    border: none !important;
    padding: 0 !important;
    max-width: 100% !important;
  }
}
