/* ==========================================================================
   SmartDocify — Hotel Bill Generator Stylesheet
   Supports:
   - Modern responsive 2-column workspace (Form Left, Live Preview Right)
   - 3 Hotel Bill Templates: Classic (T1), Modern (T2), Detailed Tax Invoice (T3)
   - Dynamic A4 Preview (Portrait & Landscape)
   - Light & Dark Theme Support
   - High-res Print & PDF Export (@media print)
   ========================================================================== */

:root {
  --primary: #2563EB;
  --primary-hover: #1D4ED8;
  --primary-light: #EFF6FF;
  --primary-glow: rgba(37, 99, 235, 0.15);
  --secondary: #7C3AED;
  --success: #10B981;
  --warning: #F59E0B;
  --danger: #EF4444;
  --info: #0284C7;

  --bg-page: #F8FAFC;
  --bg-card: #FFFFFF;
  --bg-input: #F8FAFC;
  --bg-input-focus: #FFFFFF;
  --border-light: #E2E8F0;
  --border-focus: #3B82F6;

  --text-main: #0F172A;
  --text-muted: #64748B;
  --text-inverse: #FFFFFF;

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
  --shadow-sheet: 0 20px 25px -5px rgba(0, 0, 0, 0.12), 0 8px 10px -6px rgba(0, 0, 0, 0.08);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 18px;

  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

[data-theme="dark"] {
  --bg-page: #0B0F19;
  --bg-card: #131B2E;
  --bg-input: #1E293B;
  --bg-input-focus: #0F172A;
  --border-light: #243048;
  --border-focus: #60A5FA;

  --text-main: #F1F5F9;
  --text-muted: #94A3B8;
  --text-inverse: #0B0F19;

  --primary-light: rgba(37, 99, 235, 0.18);
  --shadow-sheet: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
}

/* Base resets & typography */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

.placeholder-muted {
  color: #94A3B8 !important;
  font-style: italic !important;
  font-weight: 400 !important;
  opacity: 0.85;
}

.toast-notification {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #0F172A;
  color: #FFFFFF;
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.25);
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 8px;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.25s ease, transform 0.25s ease;
  pointer-events: none;
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-page);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

a:hover {
  text-decoration: underline;
}

/* Container */
.container {
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* Header & Navigation */
.site-header {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-light);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(12px);
}

.header-container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0.75rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand-logo {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none !important;
}

.logo-icon-wrapper {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
}

.logo-svg {
  width: 100%;
  height: 100%;
}

.logo-text {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-main);
}

.desktop-nav .nav-list {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  list-style: none;
}

.nav-link {
  font-size: 0.925rem;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none !important;
  transition: color 0.15s ease;
}

.nav-link:hover, .nav-link.active {
  color: var(--primary);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.action-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  color: var(--text-main);
  padding: 0.5rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, border-color 0.15s;
}

.action-btn:hover {
  background: var(--primary-light);
  border-color: var(--primary);
}

.action-btn .ui-icon {
  width: 1.25rem;
  height: 1.25rem;
}

.icon-sun { display: none; }
.icon-moon { display: block; }
[data-theme="dark"] .icon-sun { display: block; }
[data-theme="dark"] .icon-moon { display: none; }

.menu-toggle { display: none; }

/* Mobile nav drawer */
.mobile-nav-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  z-index: 998;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.mobile-nav-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.mobile-nav-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 280px;
  max-width: 85vw;
  background: var(--bg-card);
  z-index: 999;
  transform: translateX(100%);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.15);
  padding: 1.25rem;
}

.mobile-nav-drawer.open {
  transform: translateX(0);
}

.mobile-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.mobile-nav-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.mobile-nav-list a {
  display: block;
  padding: 0.65rem 0.75rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-main);
  border-radius: var(--radius-sm);
  text-decoration: none;
}

.mobile-nav-list a:hover {
  background: var(--primary-light);
  color: var(--primary);
}

/* Breadcrumbs */
.breadcrumb-nav {
  padding: 0.85rem 0;
}

.breadcrumb-list {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  list-style: none;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.breadcrumb-item a {
  color: var(--text-muted);
  text-decoration: none;
}

.breadcrumb-item a:hover {
  color: var(--primary);
  text-decoration: underline;
}

.breadcrumb-item.active {
  color: var(--text-main);
  font-weight: 600;
}

.breadcrumb-sep {
  opacity: 0.5;
}

/* Hero Section */
.hero-section {
  padding: 1.5rem 0 2rem;
  text-align: center;
}

.tool-badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--primary-light);
  color: var(--primary);
  padding: 0.3rem 0.85rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
}

.hero-title {
  font-size: 2.35rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.03em;
  line-height: 1.2;
  margin-bottom: 0.65rem;
}

.hero-subtitle {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 760px;
  margin: 0 auto 1.25rem;
  line-height: 1.55;
}

.hero-features-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1.25rem;
  font-size: 0.875rem;
  color: var(--text-main);
  font-weight: 600;
}

.feature-pill-item {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.feature-pill-item svg {
  color: var(--success);
  width: 16px;
  height: 16px;
}

/* ==========================================================================
   Workspace Layout (Form Left, Live Preview Right)
   ========================================================================== */
.workspace-wrapper {
  display: grid;
  grid-template-columns: 480px 1fr;
  gap: 1.5rem;
  margin-bottom: 3.5rem;
  align-items: start;
}

@media (max-width: 1180px) {
  .workspace-wrapper {
    grid-template-columns: 420px 1fr;
    gap: 1.25rem;
  }
}

@media (max-width: 960px) {
  .workspace-wrapper {
    grid-template-columns: 1fr;
    gap: 1.75rem;
  }
}

/* Left Form Column */
.form-column {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Form Card / Collapsible */
.form-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: border-color 0.15s ease;
}

.form-card:hover {
  border-color: rgba(37, 99, 235, 0.3);
}

.card-header-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 1.15rem;
  background: var(--bg-card);
  border: none;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
}

.card-header-toggle:hover {
  background: var(--primary-light);
}

.toggle-title-wrap {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.toggle-icon {
  width: 20px;
  height: 20px;
  color: var(--primary);
  flex-shrink: 0;
}

.chevron-icon {
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  transition: transform 0.2s ease;
}

.form-card.open .chevron-icon {
  transform: rotate(180deg);
}

.card-body {
  padding: 1.15rem;
  border-top: 1px solid var(--border-light);
  display: none;
}

.form-card.open .card-body {
  display: block;
}

/* Form Elements */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.form-row.row-3 {
  grid-template-columns: 1fr 1fr 1fr;
}

.form-row.row-auto {
  grid-template-columns: auto 1fr;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 0.75rem;
}

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

.form-label {
  font-size: 0.775rem;
  font-weight: 700;
  color: var(--text-main);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.form-control {
  font-family: inherit;
  font-size: 0.875rem;
  color: var(--text-main);
  background: var(--bg-input);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 0.55rem 0.75rem;
  outline: none;
  transition: all 0.15s ease;
  width: 100%;
}

.form-control:focus {
  background: var(--bg-input-focus);
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

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

/* Template Switcher Buttons */
.template-picker-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.tpl-btn {
  background: var(--bg-input);
  border: 2px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 0.65rem 0.5rem;
  cursor: pointer;
  text-align: center;
  font-family: inherit;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  transition: all 0.15s ease;
}

.tpl-btn:hover {
  border-color: var(--primary);
  background: var(--primary-light);
}

.tpl-btn.active {
  border-color: var(--primary);
  background: var(--primary-light);
  box-shadow: 0 0 0 2px var(--primary-glow);
}

.tpl-btn .tpl-name {
  font-size: 0.775rem;
  font-weight: 700;
  color: var(--text-main);
}

.tpl-btn .tpl-sub {
  font-size: 0.7rem;
  color: var(--text-muted);
}

/* Dynamic Rows (Rooms / Extra Charges) */
.dynamic-table-wrap {
  margin-bottom: 0.75rem;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.dynamic-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}

.dynamic-table th {
  background: var(--bg-input);
  padding: 0.45rem 0.5rem;
  text-align: left;
  font-weight: 700;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-light);
}

.dynamic-table td {
  padding: 0.4rem 0.45rem;
  border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
}

.dynamic-table td input,
.dynamic-table td select {
  font-size: 0.8rem;
  padding: 0.35rem 0.45rem;
}

.row-delete-btn {
  background: transparent;
  border: none;
  color: var(--danger);
  cursor: pointer;
  padding: 0.3rem;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.row-delete-btn:hover {
  background: rgba(239, 68, 68, 0.1);
}

.btn-add-row {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--bg-card);
  border: 1px dashed var(--primary);
  color: var(--primary);
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s ease;
  width: 100%;
  justify-content: center;
}

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

/* Logo Upload Area */
.logo-upload-box {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem;
  border: 1px dashed var(--border-light);
  border-radius: var(--radius-sm);
  background: var(--bg-input);
}

.logo-preview-thumb {
  width: 50px;
  height: 50px;
  border-radius: var(--radius-sm);
  object-fit: contain;
  background: #FFF;
  border: 1px solid var(--border-light);
}

.btn-upload-label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--primary);
  cursor: pointer;
  padding: 0.35rem 0.65rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--primary);
}

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

/* ==========================================================================
   Right Column — Live Preview Panel
   ========================================================================== */
.preview-column {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Sticky Preview Action Toolbar */
.preview-toolbar {
  position: sticky;
  top: 70px;
  z-index: 40;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 0.75rem 1.15rem;
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.toolbar-left, .toolbar-right {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.btn-tool {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  padding: 0.55rem 0.95rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.15s ease;
  border: 1px solid transparent;
}

.btn-tool-secondary {
  background: var(--bg-input);
  border-color: var(--border-light);
  color: var(--text-main);
}

.btn-tool-secondary:hover {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
}

.btn-tool-primary {
  background: var(--primary);
  color: #FFFFFF;
}

.btn-tool-primary:hover {
  background: var(--primary-hover);
  box-shadow: 0 4px 12px var(--primary-glow);
}

.btn-tool-success {
  background: var(--success);
  color: #FFFFFF;
}

.btn-tool-success:hover {
  background: #059669;
}

.select-pill {
  font-family: inherit;
  font-size: 0.825rem;
  font-weight: 600;
  color: var(--text-main);
  background: var(--bg-input);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 0.45rem 0.75rem;
  outline: none;
  cursor: pointer;
}

/* Preview Stage / Wrapper */
.preview-stage {
  background: #64748B22;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  padding: 2rem 1rem;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  overflow-x: auto;
  min-height: 840px;
}

/* ==========================================================================
   A4 Sheet Layout & Print Sizing
   Standard A4: 210mm x 297mm (or 297mm x 210mm landscape)
   In preview: scaled to realistic width in px
   ========================================================================== */
.a4-sheet {
  background: #FFFFFF;
  color: #111827;
  width: 794px; /* ~210mm at 96 DPI */
  min-height: 1123px; /* ~297mm at 96 DPI */
  padding: 32px 36px;
  box-shadow: var(--shadow-sheet);
  border-radius: 2px;
  position: relative;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 12px;
  line-height: 1.45;
  box-sizing: border-box;
  overflow: hidden;
}

.a4-sheet.landscape {
  width: 1123px;
  min-height: 794px;
}

/* ==========================================================================
   TEMPLATE 1 — CLASSIC HOTEL BILL (Traditional Serif / Receipt Layout)
   ========================================================================== */
.tpl-classic {
  border: 2px solid #333333;
  padding: 24px;
}

.tpl-classic .classic-header {
  text-align: center;
  border-bottom: 2px solid #333333;
  padding-bottom: 12px;
  margin-bottom: 14px;
  position: relative;
}

.tpl-classic .classic-hotel-name {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #111;
  margin-bottom: 4px;
}

.tpl-classic .classic-hotel-sub {
  font-size: 11px;
  color: #444;
  margin-bottom: 4px;
}

.tpl-classic .classic-bill-title {
  display: inline-block;
  font-size: 14px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border: 1px solid #111;
  padding: 2px 14px;
  margin-top: 6px;
  background: #F8F9FA;
}

.tpl-classic .classic-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  border-bottom: 1px solid #333;
  padding-bottom: 10px;
  margin-bottom: 14px;
}

.tpl-classic .info-box-classic {
  font-size: 11.5px;
  line-height: 1.5;
}

.tpl-classic .info-row-classic {
  display: flex;
  justify-content: space-between;
  margin-bottom: 3px;
}

.tpl-classic .info-label {
  font-weight: 700;
  color: #333;
}

.tpl-classic .classic-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 14px;
}

.tpl-classic .classic-table th {
  border: 1px solid #333;
  background: #F1F5F9;
  padding: 6px 8px;
  font-size: 11.5px;
  font-weight: 700;
  text-align: left;
  text-transform: uppercase;
}

.tpl-classic .classic-table td {
  border: 1px solid #333;
  padding: 6px 8px;
  font-size: 11px;
}

.tpl-classic .classic-summary-wrap {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.tpl-classic .classic-totals-table {
  width: 100%;
  border-collapse: collapse;
}

.tpl-classic .classic-totals-table td {
  padding: 4px 6px;
  font-size: 11.5px;
}

.tpl-classic .classic-totals-table .total-label {
  font-weight: 600;
  color: #333;
}

.tpl-classic .classic-totals-table .total-val {
  text-align: right;
  font-weight: 700;
}

.tpl-classic .classic-totals-table tr.grand-total {
  border-top: 2px solid #111;
  border-bottom: 2px solid #111;
}

.tpl-classic .classic-totals-table tr.grand-total td {
  font-size: 13px;
  font-weight: 800;
  padding: 6px 6px;
}

.tpl-classic .classic-signatures {
  display: flex;
  justify-content: space-between;
  margin-top: 40px;
  padding-top: 10px;
}

.tpl-classic .classic-sign-col {
  width: 180px;
  text-align: center;
  border-top: 1px dashed #444;
  padding-top: 6px;
  font-size: 11px;
  font-weight: 700;
}

.tpl-classic .classic-footer-note {
  text-align: center;
  margin-top: 24px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #444;
}

/* ==========================================================================
   TEMPLATE 2 — MODERN HOTEL INVOICE (Corporate Accent Banner & Clean Cards)
   ========================================================================== */
.tpl-modern {
  color: #1E293B;
}

.tpl-modern .modern-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  border-bottom: 2px solid #2563EB;
  padding-bottom: 16px;
  margin-bottom: 20px;
}

.tpl-modern .modern-logo-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.tpl-modern .modern-hotel-title {
  font-size: 22px;
  font-weight: 800;
  color: #0F172A;
  letter-spacing: -0.02em;
}

.tpl-modern .modern-hotel-meta {
  font-size: 11px;
  color: #64748B;
  line-height: 1.5;
  margin-top: 3px;
}

.tpl-modern .modern-invoice-badge-wrap {
  text-align: right;
}

.tpl-modern .modern-invoice-title {
  font-size: 24px;
  font-weight: 900;
  color: #2563EB;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.tpl-modern .status-pill-modern {
  display: inline-block;
  padding: 3px 12px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 4px;
}

.tpl-modern .status-paid {
  background: #DCFCE7;
  color: #15803D;
  border: 1px solid #86EFAC;
}

.tpl-modern .status-due {
  background: #FEE2E2;
  color: #B91C1C;
  border: 1px solid #FCA5A5;
}

.tpl-modern .status-partial {
  background: #FEF3C7;
  color: #B45309;
  border: 1px solid #FDE68A;
}

.tpl-modern .modern-meta-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 16px;
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 8px;
  padding: 14px 16px;
  margin-bottom: 20px;
}

.tpl-modern .modern-meta-col h4 {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  color: #2563EB;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}

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

.tpl-modern .modern-table th {
  background: #2563EB;
  color: #FFFFFF;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 8px 10px;
  text-align: left;
}

.tpl-modern .modern-table td {
  padding: 8px 10px;
  font-size: 11.5px;
  border-bottom: 1px solid #E2E8F0;
}

.tpl-modern .modern-table tbody tr:nth-child(even) {
  background: #F8FAFC;
}

.tpl-modern .modern-summary-wrap {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 20px;
  margin-bottom: 24px;
}

.tpl-modern .modern-summary-box {
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 8px;
  padding: 12px 16px;
}

.tpl-modern .summary-row-mod {
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
  font-size: 11.5px;
}

.tpl-modern .summary-row-mod.grand-mod {
  border-top: 2px solid #2563EB;
  padding-top: 8px;
  font-size: 13px;
  font-weight: 800;
  color: #2563EB;
}

.tpl-modern .modern-sign-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-top: 36px;
  padding-top: 14px;
  border-top: 1px solid #E2E8F0;
}

/* ==========================================================================
   TEMPLATE 3 — DETAILED PROFESSIONAL HOTEL TAX INVOICE (Sikar Hotel Format)
   Features:
   - Full GST & HSN/SAC compliance (996311, 996331)
   - 10-Column itemized breakdown (SNo, Room, Particular, Night, Price, S.Total, CGST, SGST, Debit, Credit)
   - 5-Column Summary Box (Grand Total, Round off, Payable, Paid, Due)
   - Amount in Words (Indian currency words format)
   - 3 Signature blocks (Guest, FO Associate, FO Manager)
   ========================================================================== */
.tpl-detailed {
  border: 1.5px solid #000000;
  padding: 16px 20px;
  font-family: Arial, "Helvetica Neue", Helvetica, sans-serif;
  color: #000000;
  font-size: 11px;
}

.tpl-detailed .det-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 700;
  font-size: 11px;
  margin-bottom: 6px;
}

.tpl-detailed .det-tax-title {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.tpl-detailed .det-hotel-center {
  text-align: center;
  margin-bottom: 8px;
}

.tpl-detailed .det-hotel-name {
  font-size: 21px;
  font-weight: 900;
  letter-spacing: -0.01em;
  color: #000;
  margin-bottom: 2px;
}

.tpl-detailed .det-hotel-address {
  font-size: 10.5px;
  line-height: 1.4;
  color: #111;
}

.tpl-detailed .det-hsn-row {
  font-size: 10px;
  font-weight: 700;
  margin-top: 3px;
}

/* 2-column or 3-column boxed metadata grid */
.tpl-detailed .det-meta-table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid #000;
  margin-bottom: 8px;
}

.tpl-detailed .det-meta-table td {
  border: 1px solid #000;
  padding: 3.5px 6px;
  font-size: 10px;
  vertical-align: top;
}

.tpl-detailed .det-meta-label {
  font-weight: 700;
}

/* 10-Column Detailed Charge Breakdown Table */
.tpl-detailed .det-item-table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid #000;
  margin-bottom: 8px;
}

.tpl-detailed .det-item-table th {
  border: 1px solid #000;
  background: #E5E7EB;
  padding: 4px 5px;
  font-size: 9.5px;
  font-weight: 800;
  text-align: center;
}

.tpl-detailed .det-item-table td {
  border: 1px solid #000;
  padding: 3.5px 5px;
  font-size: 9.5px;
  vertical-align: middle;
}

.tpl-detailed .det-item-table .td-num {
  text-align: right;
}

.tpl-detailed .det-item-table .td-center {
  text-align: center;
}

.tpl-detailed .det-item-table tr.total-row {
  background: #F3F4F6;
  font-weight: 800;
}

/* 5-Column Summary Box */
.tpl-detailed .det-summary-table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid #000;
  margin-bottom: 6px;
}

.tpl-detailed .det-summary-table th {
  border: 1px solid #000;
  background: #E5E7EB;
  padding: 4px 6px;
  font-size: 9.5px;
  font-weight: 800;
  text-align: center;
}

.tpl-detailed .det-summary-table td {
  border: 1px solid #000;
  padding: 4px 6px;
  font-size: 10.5px;
  font-weight: 700;
  text-align: center;
}

/* Amount in words banner */
.tpl-detailed .det-words-row {
  border: 1px solid #000;
  padding: 4px 8px;
  font-size: 10px;
  font-weight: 700;
  margin-bottom: 6px;
  background: #F9FAFB;
}

.tpl-detailed .det-terms-block {
  font-size: 8.5px;
  line-height: 1.35;
  margin-bottom: 14px;
}

.tpl-detailed .det-signs-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-top: 24px;
  padding-top: 8px;
}

.tpl-detailed .det-sign-box {
  width: 140px;
  text-align: center;
  border-top: 1px solid #000;
  padding-top: 4px;
  font-size: 9.5px;
  font-weight: 700;
}

.tpl-detailed .det-footer-line {
  display: flex;
  justify-content: space-between;
  margin-top: 12px;
  font-size: 9px;
  color: #333;
}

/* ==========================================================================
   SEO Content & FAQ Accordion Section
   ========================================================================== */
.seo-content-section {
  padding: 3rem 0;
  background: var(--bg-card);
  border-top: 1px solid var(--border-light);
}

.seo-content-section h2 {
  font-size: 1.65rem;
  font-weight: 800;
  color: var(--text-main);
  margin: 1.5rem 0 0.75rem;
  letter-spacing: -0.02em;
}

.seo-content-section h3 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main);
  margin: 1.25rem 0 0.5rem;
}

.seo-content-section p {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.65;
  margin-bottom: 1rem;
}

.seo-content-section ul, .seo-content-section ol {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.65;
  padding-left: 1.5rem;
  margin-bottom: 1.25rem;
}

.seo-content-section li {
  margin-bottom: 0.4rem;
}

/* FAQ Accordion */
.faq-section {
  padding: 3rem 0;
}

.faq-header {
  text-align: center;
  margin-bottom: 2rem;
}

.faq-header h2 {
  font-size: 1.85rem;
  font-weight: 800;
  color: var(--text-main);
}

.faq-list {
  max-width: 820px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.faq-item {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.faq-question-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  background: transparent;
  border: none;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
  text-align: left;
  cursor: pointer;
}

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

.faq-answer {
  padding: 0 1.25rem 1rem;
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.6;
  display: none;
}

.faq-item.open .faq-answer {
  display: block;
}

.faq-item.open .chevron-icon {
  transform: rotate(180deg);
}

/* Related Tools Grid */
.related-tools-section {
  padding: 3rem 0;
  background: var(--bg-card);
  border-top: 1px solid var(--border-light);
}

.related-tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
  margin-top: 1.5rem;
}

.related-tool-card {
  background: var(--bg-page);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  text-decoration: none !important;
  color: inherit;
  transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
  display: flex;
  flex-direction: column;
}

.related-tool-card:hover {
  transform: translateY(-2px);
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
}

.related-tool-icon {
  width: 40px;
  height: 40px;
  background: var(--primary-light);
  color: var(--primary);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.85rem;
}

.related-tool-icon svg {
  width: 22px;
  height: 22px;
}

.related-tool-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.35rem;
}

.related-tool-desc {
  font-size: 0.825rem;
  color: var(--text-muted);
  line-height: 1.5;
  flex-grow: 1;
  margin-bottom: 0.75rem;
}

.related-tool-link {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--primary);
}

/* Site Footer */
.site-footer {
  background: var(--bg-card);
  border-top: 1px solid var(--border-light);
  padding: 3.5rem 0 2rem;
  margin-top: auto;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr repeat(4, 1fr);
  gap: 2rem;
  margin-bottom: 2.5rem;
}

.footer-heading {
  font-size: 0.85rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-main);
  margin-bottom: 1rem;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.footer-links a {
  font-size: 0.875rem;
  color: var(--text-muted);
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--primary);
  text-decoration: underline;
}

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--border-light);
  padding-top: 1.5rem;
  font-size: 0.825rem;
  color: var(--text-muted);
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-bottom-links {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.footer-bottom-links a {
  color: var(--text-muted);
  text-decoration: none;
}

.footer-bottom-links a:hover {
  color: var(--primary);
}

/* ==========================================================================
   Print & PDF Generation Rules (@media print)
   ========================================================================== */
@media print {
  body {
    background: #FFFFFF !important;
    color: #000000 !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  .site-header,
  .breadcrumb-nav,
  .hero-section,
  .form-column,
  .preview-toolbar,
  .seo-content-section,
  .faq-section,
  .related-tools-section,
  .site-footer,
  .mobile-nav-backdrop,
  .mobile-nav-drawer {
    display: none !important;
  }

  .workspace-wrapper {
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .preview-column {
    width: 100% !important;
  }

  .preview-stage {
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
    overflow: visible !important;
    display: block !important;
  }

  .a4-sheet {
    box-shadow: none !important;
    border: none !important;
    width: 100% !important;
    min-height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  @page {
    size: auto;
    margin: 10mm;
  }
}

/* ==========================================================================
   Mobile & Tablet Responsiveness
   ========================================================================== */
@media (max-width: 768px) {
  .desktop-nav { display: none; }
  .menu-toggle { display: inline-flex; }
  .footer-grid { grid-template-columns: 1fr; gap: 1.5rem; }
  .preview-stage {
    padding: 1rem 0.5rem;
    min-height: auto;
  }
  .a4-sheet {
    width: 100% !important;
    min-width: 320px;
    padding: 16px 12px;
  }
  .hero-title {
    font-size: 1.85rem;
  }
  .tpl-classic .classic-summary-wrap,
  .tpl-modern .modern-summary-wrap,
  .tpl-modern .modern-meta-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
}
