/* ==================== GLOBAL CONSTANTS & THEMES ==================== */
:root {
  /* Dark Mode Default Theme Variables */
  --bg-page: #090d16;
  --bg-card: rgba(16, 22, 37, 0.65);
  --bg-sidebar: #0b1120;
  --border: rgba(255, 255, 255, 0.08);
  --border-focus: #3b82f6;
  --text-main: #e2e8f0;
  --text-muted: #94a3b8;
  --primary: #3b82f6;
  --primary-glow: rgba(59, 130, 246, 0.35);
  --accent: #10b981;
  --accent-gradient: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
  --danger: #ef4444;
  --danger-light: rgba(239, 68, 68, 0.15);
  --success-light: rgba(16, 185, 129, 0.15);
  
  --radius-lg: 16px;
  --radius-md: 10px;
  --radius-sm: 6px;
  
  --shadow-glow: 0 0 20px rgba(59, 130, 246, 0.15);
  --shadow-card: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --font-display: 'Outfit', sans-serif;
  --font-text: 'Inter', sans-serif;
}

/* Light Mode variables when active */
body.light-theme {
  --bg-page: #f1f5f9;
  --bg-card: rgba(255, 255, 255, 0.85);
  --bg-sidebar: #ffffff;
  --border: rgba(15, 23, 42, 0.08);
  --border-focus: #2563eb;
  --text-main: #1e293b;
  --text-muted: #64748b;
  --primary: #2563eb;
  --primary-glow: rgba(37, 99, 235, 0.2);
  --shadow-glow: 0 0 15px rgba(37, 99, 235, 0.1);
  --shadow-card: 0 8px 24px 0 rgba(15, 23, 42, 0.06);
}

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

body {
  font-family: var(--font-text);
  background-color: var(--bg-page);
  color: var(--text-main);
  line-height: 1.5;
  transition: var(--transition);
  min-height: 100vh;
  overflow-x: hidden;
}

/* Layout */
.app-layout {
  display: flex;
  min-height: 100vh;
}

/* Sidebar Styling */
.sidebar {
  width: 280px;
  background-color: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  padding: 30px 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: var(--transition);
  flex-shrink: 0;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 40px;
}

.logo-icon {
  width: 38px;
  height: 38px;
  fill: var(--primary);
  filter: drop-shadow(0 0 8px var(--primary));
  transition: var(--transition);
}

.sidebar-brand h2 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 800;
  line-height: 1.1;
  color: var(--text-main);
}

.sidebar-brand span {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.sidebar-menu {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-grow: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: transparent;
  border: none;
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-family: var(--font-text);
  font-size: 0.9375rem;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: var(--transition);
}

.nav-item svg {
  transition: var(--transition);
}

.nav-item:hover, .nav-item.active {
  color: var(--text-main);
  background: rgba(59, 130, 246, 0.1);
}

.nav-item.active {
  background: var(--accent-gradient);
  color: #ffffff;
  box-shadow: 0 4px 14px 0 rgba(37, 99, 235, 0.3);
}

.nav-item.active svg {
  color: #ffffff;
  transform: scale(1.1);
}

.sidebar-footer {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: auto;
}

/* Main Panel Styling */
.main-content {
  flex-grow: 1;
  padding: 40px;
  overflow-y: auto;
  max-width: 1400px;
  margin: 0 auto;
  width: calc(100% - 280px);
}

.tab-panel {
  display: none;
  animation: fadeIn 0.4s ease-out;
}

.tab-panel.active {
  display: block;
}

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

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

.content-header h1 {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.content-header p {
  color: var(--text-muted);
  font-size: 0.9375rem;
  margin-top: 4px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-family: var(--font-text);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  border: 1px solid transparent;
}

.btn-primary {
  background: var(--accent-gradient);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.35);
  opacity: 0.95;
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-main);
}

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--text-muted);
}

.btn-danger {
  background: var(--danger-light);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #fca5a5;
}

.btn-danger:hover {
  background: var(--danger);
  color: #ffffff;
  border-color: var(--danger);
}

.btn-block {
  width: 100%;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.8125rem;
}

.btn-xs {
  padding: 4px 8px;
  font-size: 0.75rem;
  border-radius: var(--radius-sm);
}

/* Cards */
.card {
  background-color: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-card);
  transition: var(--transition);
}

.card:hover {
  border-color: rgba(59, 130, 246, 0.2);
  box-shadow: var(--shadow-glow), var(--shadow-card);
}

/* Filters & Search */
.filter-card {
  padding: 20px;
}

.filter-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 2fr;
  gap: 20px;
}

/* Form controls */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.form-group label {
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.form-group input,
.form-group select,
.form-group textarea {
  padding: 10px 14px;
  background-color: rgba(9, 13, 22, 0.4);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-family: var(--font-text);
  font-size: 0.9375rem;
  transition: var(--transition);
  outline: none;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

/* Table styling */
.table-card {
  padding: 0;
  overflow: hidden;
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
}

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

.data-table th,
.data-table td {
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
}

.data-table th {
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  background-color: rgba(255, 255, 255, 0.01);
}

.data-table td {
  font-size: 0.875rem;
}

.data-table tbody tr {
  transition: var(--transition);
}

.data-table tbody tr:hover {
  background-color: rgba(255, 255, 255, 0.02);
}

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

.actions-cell {
  text-align: right;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* Invoice number tag */
.invoice-tag {
  font-family: monospace;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: 0.05em;
}

/* Currency tags */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
}

.badge-eur {
  background-color: var(--success-light);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.badge-bgn {
  background-color: var(--primary-glow);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.2);
}

/* Login Wrapper styling */
.login-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 20px;
}

.login-card {
  width: 100%;
  max-width: 440px;
  background-color: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px;
  box-shadow: var(--shadow-card);
  animation: fadeIn 0.5s ease-out;
}

.login-header {
  text-align: center;
  margin-bottom: 30px;
}

.login-header .logo-icon {
  width: 54px;
  height: 54px;
  margin-bottom: 16px;
}

.login-header h1 {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 800;
}

.login-header p {
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-top: 4px;
}

/* Modal form overlay styling */
.modal-wrapper {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(4, 6, 10, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 100;
  padding: 20px;
  overflow-y: auto;
}

.modal-content {
  background-color: #0d1527;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 800px;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  max-height: 90vh;
  animation: modalSlide 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalSlide {
  from { opacity: 0; transform: scale(0.95) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

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

.modal-header h2 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
}

.modal-close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  transition: var(--transition);
}

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

.modal-body {
  padding: 24px;
  overflow-y: auto;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 24px;
  border-top: 1px solid var(--border);
  padding-top: 20px;
}

.checkbox-group {
  margin-top: 10px;
}

.toggle-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-weight: 500;
  font-size: 0.875rem;
}

.company-details-block {
  margin: 20px 0;
  padding: 20px;
  background-color: rgba(255, 255, 255, 0.02);
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
  animation: fadeIn 0.3s ease-out;
}

.company-details-block h3 {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--primary);
}

.info-notice {
  font-size: 0.75rem;
  color: var(--primary);
  margin-top: 4px;
  font-weight: 500;
}

/* Alerts */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 500;
  margin-top: 16px;
}

.alert-danger {
  background-color: var(--danger-light);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fca5a5;
}

.alert-success {
  background-color: var(--success-light);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #a7f3d0;
}

.hidden {
  display: none !important;
}

/* Reports layout */
.reports-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 24px;
}

.report-card h2 {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 10px;
  color: var(--primary);
}

.report-row {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  font-size: 0.9rem;
}

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

.report-row .label {
  color: var(--text-muted);
}

.report-row .value {
  font-weight: 600;
}

.currency-section-title {
  font-weight: bold;
  font-size: 0.8rem;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-top: 12px;
  margin-bottom: 4px;
}

/* Settings configuration */
.settings-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 30px;
  align-items: start;
}

.settings-card h2 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 20px;
  color: var(--primary);
}

/* Batch card */
.batch-card h3 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.batch-card p {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.batch-grid {
  display: grid;
  grid-template-columns: 1.5fr 1.5fr 1fr;
  gap: 20px;
  align-items: flex-end;
}

/* ==================== SINGLE INVOICE PRINT PREVIEW LAYOUT ==================== */
.preview-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #080c14;
  z-index: 150;
  display: flex;
  flex-direction: column;
}

.preview-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 40px;
  background-color: #0b1120;
  border-bottom: 1px solid var(--border);
}

.preview-content-box {
  flex-grow: 1;
  overflow-y: auto;
  padding: 40px 20px;
  display: flex;
  justify-content: center;
  background-color: #070a12;
}

/* ==================== PRINT TEMPLATE (MUST BE PURE WHITE) ==================== */
#printable-area, .batch-print-overlay {
  width: 100%;
  max-width: 850px;
  background-color: #ffffff !important;
  color: #1e293b !important;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
  line-height: 1.4 !important;
  border-radius: 0;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.15);
  transition: none;
  padding: 40px 50px !important; /* Slightly reduced top/bottom padding to fit 1 page */
  position: relative;
  box-sizing: border-box;
}

#printable-area, .batch-print-invoice {
  border-top: 6px solid #2563eb !important;
  padding-top: 25px !important;
}

/* Styles for Year Tabs & Clickable Invoices */
.year-tabs-container {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  overflow-x: auto;
  padding-bottom: 8px;
}
.year-tab {
  padding: 8px 16px;
  background-color: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-family: var(--font-text);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}
.year-tab:hover {
  color: var(--text-main);
  border-color: var(--text-muted);
}
.year-tab.active {
  background-color: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}
.invoice-link {
  font-family: monospace;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-decoration: none;
  transition: var(--transition);
  cursor: pointer;
}
.invoice-link.physical {
  color: #3b82f6 !important;
}
.invoice-link.physical:hover {
  color: #60a5fa !important;
  text-decoration: underline;
}
.invoice-link.company {
  color: #f97316 !important;
}
.invoice-link.company:hover {
  color: #fb923c !important;
  text-decoration: underline;
}

.platform-tag {
  font-weight: 600;
  font-size: 0.875rem;
}
.platform-tag.booking {
  color: #3b82f6 !important;
}
.platform-tag.airbnb {
  color: #ef4444 !important;
}
.platform-tag.other {
  color: #10b981 !important;
}




/* Headers & Details */
.invoice-print-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 25px;
}

.logo-area-print {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-area-print svg {
  width: 40px;
  height: 40px;
  fill: #2563eb !important;
}

.logo-area-print .brand-name {
  font-family: 'Outfit', sans-serif !important;
  font-size: 1.35rem;
  font-weight: 800;
  color: #0f172a !important;
  line-height: 1;
}

.logo-area-print .brand-sub {
  font-size: 0.7rem;
  color: #64748b !important;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.title-area-print {
  text-align: right;
}

.title-area-print h1 {
  font-family: 'Outfit', sans-serif !important;
  font-size: 1.85rem;
  font-weight: 800;
  color: #0f172a !important;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.title-area-print .invoice-type {
  font-size: 0.8rem;
  font-weight: 700;
  color: #2563eb !important;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 2px;
}

.meta-grid-print {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: 15px;
  text-align: right;
}

.meta-item-print label {
  display: block;
  font-size: 0.6875rem;
  text-transform: uppercase;
  color: #64748b !important;
  font-weight: 700;
}

.meta-item-print value {
  display: block;
  font-family: 'Outfit', sans-serif !important;
  font-size: 1rem;
  font-weight: 700;
  color: #0f172a !important;
}

/* Parties */
.parties-grid-print {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
  border-top: 1px solid #e2e8f0 !important;
  border-bottom: 1px solid #e2e8f0 !important;
  padding: 20px 0 !important;
  margin-bottom: 25px;
}

.party-block-print h3 {
  font-family: 'Outfit', sans-serif !important;
  font-size: 0.875rem;
  font-weight: 700;
  color: #0f172a !important;
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  display: flex;
  align-items: center;
  gap: 8px;
}

.party-block-print h3::after {
  content: '';
  flex-grow: 1;
  height: 1px;
  background: #e2e8f0 !important;
}

.party-block-print .party-name {
  font-weight: 700;
  font-size: 1rem;
  color: #0f172a !important;
  margin-bottom: 6px;
}

.party-block-print .party-details {
  font-size: 0.8rem;
  color: #334155 !important;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.party-block-print .party-row {
  display: flex;
  justify-content: space-between;
}

.party-block-print .party-label {
  color: #64748b !important;
  font-weight: 500;
}

.party-block-print .party-value {
  font-weight: 600;
  text-align: right;
}

/* Items Table */
.print-table-container {
  margin-bottom: 20px;
}

.print-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.print-table th {
  font-family: 'Outfit', sans-serif !important;
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.6875rem;
  letter-spacing: 0.05em;
  color: #64748b !important;
  padding: 8px 12px;
  border-bottom: 2px solid #e2e8f0 !important;
}

.print-table td {
  padding: 12px;
  border-bottom: 1px solid #e2e8f0 !important;
  font-size: 0.8rem;
  vertical-align: middle;
}

.print-table .col-num { width: 5%; text-align: center; }
.print-table .col-desc { width: 50%; }
.print-table .col-qty { width: 10%; text-align: center; }
.print-table .col-price { width: 15%; text-align: right; }
.print-table .col-discount { width: 10%; text-align: center; }
.print-table .col-total { width: 10%; text-align: right; font-weight: 700; }

.print-table .item-desc-bg {
  font-weight: 700;
  color: #0f172a !important;
}

.print-table .item-desc-en {
  font-size: 0.7rem;
  color: #64748b !important;
  margin-top: 2px;
  font-style: italic;
}

/* Summary Block */
.summary-grid-print {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 30px;
  margin-bottom: 20px;
}

.payment-info-print {
  background-color: #f8fafc !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 8px;
  padding: 14px;
}

.payment-info-print h4 {
  font-family: 'Outfit', sans-serif !important;
  font-size: 0.8rem;
  font-weight: 700;
  color: #0f172a !important;
  text-transform: uppercase;
  margin-bottom: 10px;
  border-bottom: 1px solid #e2e8f0 !important;
  padding-bottom: 4px;
}

.payment-grid-print {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 10px;
  font-size: 0.75rem;
}

.payment-grid-print dt {
  color: #64748b !important;
  font-weight: 500;
}

.payment-grid-print dd {
  font-weight: 600;
  color: #0f172a !important;
}

.totals-block-print {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.total-row-print {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
}

.total-row-print.grand-total {
  border-top: 2px solid #0f172a !important;
  padding-top: 8px;
  font-size: 1.15rem;
  font-weight: 800;
  color: #0f172a !important;
  font-family: 'Outfit', sans-serif !important;
}

.total-row-print .total-label-bg {
  font-weight: 700;
}

.total-row-print .total-label-en {
  display: block;
  font-size: 0.6875rem;
  color: #64748b !important;
  font-weight: 400;
}

.total-row-print .total-value {
  font-weight: 700;
  text-align: right;
}

.reason-box-print {
  font-size: 0.7rem;
  color: #64748b !important;
  border: 1px dashed #cbd5e1 !important;
  padding: 8px;
  border-radius: 6px;
  line-height: 1.3;
}

.reason-box-print strong {
  color: #334155 !important;
}

/* Dates */
.dates-block-print {
  font-size: 0.75rem;
  margin-bottom: 20px;
  display: flex;
  gap: 30px;
  color: #64748b !important;
}

.dates-block-print strong {
  color: #334155 !important;
}

/* Footer & Legal */
.invoice-footer-print {
  border-top: 1px solid #e2e8f0 !important;
  padding-top: 15px;
  font-size: 0.6875rem;
  color: #64748b !important;
  text-align: center;
  line-height: 1.5;
}

/* Bilingual text control toggles */
.bg-only .en-text,
.bg-only .en-text-block,
.en-only .bg-text,
.en-only .bg-text-block {
  display: none !important;
}

.bg-only .bilingual-separator,
.en-only .bilingual-separator {
  display: none !important;
}

/* ==================== BATCH PRINTING LAYOUT ==================== */
.batch-print-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  background: white;
  z-index: 9999;
  box-shadow: none;
  overflow: visible;
}

.batch-print-invoice {
  width: 100%;
  max-width: 850px;
  margin: 0 auto;
  page-break-after: always;
  box-sizing: border-box;
  padding: 50px 50px !important;
  position: relative;
  background-color: white !important;
  color: #1e293b !important;
  font-family: 'Inter', -apple-system, sans-serif !important;
}

.batch-print-invoice:last-child {
  page-break-after: avoid;
}

/* ==================== RESPONSIVE FOR DASHBOARD INTERFACE ==================== */
@media (max-width: 1024px) {
  .app-layout {
    flex-direction: column;
  }
  .sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 20px;
  }
  .sidebar-menu {
    flex-direction: row;
    overflow-x: auto;
    gap: 12px;
  }
  .main-content {
    width: 100%;
    padding: 20px;
  }
  .settings-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .filter-grid {
    grid-template-columns: 1fr;
  }
  .form-row, .batch-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }
}

/* ==================== PRINT STYLES (CRITICAL) ==================== */
@media print {
  /* When printing single invoice */
  body.print-single-mode > *:not(#preview-container) {
    display: none !important;
  }
  body.print-single-mode #preview-container {
    display: block !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: auto !important;
    background: white !important;
    overflow: visible !important;
    z-index: 99999 !important;
  }
  body.print-single-mode .preview-controls {
    display: none !important;
  }
  body.print-single-mode .preview-content-box {
    padding: 0 !important;
    background: white !important;
    overflow: visible !important;
  }
  body.print-single-mode #printable-area {
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    display: block !important;
  }

  /* When printing batch */
  body.print-batch-mode > *:not(#batch-print-container) {
    display: none !important;
  }
  body.print-batch-mode #batch-print-container {
    display: block !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    background: white !important;
    overflow: visible !important;
    z-index: 99999 !important;
  }
  body.print-batch-mode .batch-print-invoice {
    border: none !important;
    box-shadow: none !important;
    margin: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 0 40px 0 !important;
    display: block !important;
  }

  @page {
    size: A4;
    margin: 10mm 12mm; /* Standard printing margins */
  }

  /* Force colors to print correctly in chrome/safari */
  * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
}

