/* ============================================================
   SIMPLE TRAVEL — E-TICKET GENERATOR
   style.css — Sidebar + Preview Layout
   Brand: Simple Travel (#F5A623)
   ============================================================ */

:root {
  --brand-primary: #F5A623;
  --brand-dark: #D4891A;
  --brand-light: #FDF3E0;
  --brand-surface: #FAF7F2;
  --brand-text: #1C1917;
  --brand-muted: #78716C;
  --brand-border: #E8E0D5;
  --brand-white: #FFFFFF;
  --sidebar-w: 350px;
  --header-h: 56px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.06);
  --shadow-md: 0 4px 16px rgba(0,0,0,.08);
  --shadow-lg: 0 8px 32px rgba(0,0,0,.12);
  --transition: .2s ease;
}

/* ─── Reset ──────────────────────────────────────────────── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: #f4f1ec;
  color: var(--brand-text);
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}
button { cursor: pointer; font-family: inherit; }
input, textarea, select { font-family: inherit; }

/* ─── Header ─────────────────────────────────────────────── */
.header {
  height: var(--header-h);
  background: var(--brand-white);
  border-bottom: 1px solid var(--brand-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  flex-shrink: 0;
  z-index: 100;
}
.header__brand {
  display: flex;
  align-items: center;
  gap: 10px;
}
.header__logo {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--brand-primary), var(--brand-dark));
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: white;
}
.header__title {
  font-size: 16px;
  font-weight: 700;
  color: var(--brand-text);
  line-height: 1.2;
}
.header__subtitle {
  font-size: 11px;
  color: var(--brand-muted);
  font-weight: 400;
}
.badge {
  background: var(--brand-light);
  color: var(--brand-dark);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
  letter-spacing: .3px;
}

/* ─── App Layout (2 columns) ─────────────────────────────── */
.app-layout {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* ─── Sidebar ────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  overflow-y: auto;
  overflow-x: hidden;
  background: var(--brand-white);
  border-right: 1px solid var(--brand-border);
}
.sidebar::-webkit-scrollbar { width: 5px; }
.sidebar::-webkit-scrollbar-thumb { background: var(--brand-border); border-radius: 4px; }

/* Sidebar Panel */
.panel {
  padding: 18px 16px;
  border-bottom: 1px solid var(--brand-border);
}
.panel:last-child { border-bottom: none; }
.panel__header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.panel__step {
  width: 26px; height: 26px;
  background: var(--brand-primary);
  color: white;
  font-size: 11px;
  font-weight: 700;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.panel__title {
  font-size: 13px;
  font-weight: 700;
  color: var(--brand-text);
}
.panel__desc {
  font-size: 11px;
  color: var(--brand-muted);
  margin-top: 2px;
  line-height: 1.4;
}

/* Collapsible Panels */
.panel--collapsible .panel__header {
  cursor: pointer;
  user-select: none;
  transition: opacity var(--transition);
}
.panel--collapsible .panel__header:hover {
  opacity: 0.8;
}
.panel__chevron {
  margin-left: auto;
  width: 20px;
  height: 20px;
  color: #64748b;
  transition: transform 0.25s ease, color 0.2s ease;
  flex-shrink: 0;
  display: block;
}
.panel--collapsible .panel__header:hover .panel__chevron {
  color: var(--brand-primary);
}
.panel.collapsed .panel__body {
  display: none;
}
.panel.collapsed .panel__header {
  margin-bottom: 0;
}
.panel.collapsed .panel__chevron {
  transform: rotate(-90deg);
}

/* ─── Upload Zone ────────────────────────────────────────── */
.upload-zone {
  border: 2px dashed var(--brand-border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  background: var(--brand-surface);
}
.upload-zone:hover,
.upload-zone.drag-over {
  border-color: var(--brand-primary);
  background: var(--brand-light);
}
.upload-zone__icon { color: var(--brand-primary); margin-bottom: 4px; display: flex; justify-content: center; }
.upload-zone__icon svg { width: 26px; height: 26px; }
.upload-zone__text { font-size: 12.5px; font-weight: 600; color: var(--brand-text); }
.upload-zone__hint { font-size: 11px; color: var(--brand-muted); margin-top: 2px; }

/* File Info */
.file-info {
  display: none;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--brand-light);
  border-radius: var(--radius-sm);
  margin-top: 10px;
}
.file-info__icon { color: var(--brand-primary); flex-shrink: 0; }
.file-info__details { flex: 1; min-width: 0; }
.file-info__name {
  font-size: 12px;
  font-weight: 600;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.file-info__size { font-size: 10px; color: var(--brand-muted); }
.file-info__remove {
  background: none;
  border: none;
  color: var(--brand-muted);
  padding: 4px;
  border-radius: 4px;
  transition: all var(--transition);
}
.file-info__remove:hover { background: #fee2e2; color: #dc2626; }

/* ─── Color Controls ─────────────────────────────────────── */
.preset-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}
.preset-btn {
  width: 32px; height: 32px;
  border-radius: 50%;
  border: 2px solid transparent;
  background: var(--preset-color);
  position: relative;
  transition: all var(--transition);
}
.preset-btn:hover { transform: scale(1.15); }
.preset-btn.active { border-color: var(--brand-text); box-shadow: 0 0 0 2px white, 0 0 0 4px var(--brand-text); }
.preset-btn__check {
  display: none;
  color: white;
  font-size: 14px;
  font-weight: 700;
  text-shadow: 0 1px 2px rgba(0,0,0,.4);
}
.preset-btn.active .preset-btn__check { display: block; }

.color-picker-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}
.color-picker-input {
  width: 36px; height: 36px;
  border: 2px solid var(--brand-border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  padding: 2px;
  background: none;
}
.color-hex-input {
  width: 80px;
  padding: 7px 10px;
  border: 1px solid var(--brand-border);
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-family: 'SF Mono', 'Fira Code', monospace;
  text-transform: uppercase;
  text-align: center;
  outline: none;
}
.color-hex-input:focus { border-color: var(--brand-primary); }

/* Toggle Switch */
.toggle-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}
.toggle-switch {
  position: relative;
  width: 36px;
  height: 20px;
  flex-shrink: 0;
}
.toggle-switch input { display: none; }
.toggle-slider {
  position: absolute;
  inset: 0;
  background: #ccc;
  border-radius: 20px;
  cursor: pointer;
  transition: var(--transition);
}
.toggle-slider::before {
  content: '';
  position: absolute;
  width: 16px; height: 16px;
  left: 2px; top: 2px;
  background: white;
  border-radius: 50%;
  transition: var(--transition);
}
.toggle-switch input:checked + .toggle-slider { background: var(--brand-primary); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(16px); }
.toggle-label { font-size: 12px; color: var(--brand-muted); }

/* Small label */
.ctrl-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--brand-muted);
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 6px;
  display: block;
}

/* ─── Font Selector ──────────────────────────────────────── */
.font-select {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--brand-border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--brand-text);
  background: var(--brand-white);
  outline: none;
  cursor: pointer;
}
.font-select:focus { border-color: var(--brand-primary); }

/* ─── LƯU Ý ─────────────────────────────────────────────── */
.luu-y-toggle-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--brand-surface);
  border: 1px solid var(--brand-border);
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
}
.luu-y-toggle-text { font-size: 12px; font-weight: 600; }
.luu-y-toggle-hint { font-size: 10px; color: var(--brand-muted); margin-top: 1px; }

/* LƯU Ý Rich Editor */
.luu-y-toolbar {
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 4px 6px;
  background: var(--brand-surface);
  border: 1px solid var(--brand-border);
  border-bottom: none;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}
.luu-y-tb-btn {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 4px;
  padding: 2px 7px;
  font-size: 11px;
  color: var(--brand-text);
  cursor: pointer;
  transition: all var(--transition);
}
.luu-y-tb-btn:hover {
  background: #fff;
  border-color: var(--brand-border);
}
.luu-y-editor {
  width: 100%;
  min-height: 140px;
  max-height: 260px;
  overflow-y: auto;
  padding: 10px;
  font-size: 11.5px;
  line-height: 1.6;
  color: var(--brand-text);
  background: var(--brand-white);
  border: 1px solid var(--brand-border);
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  outline: none;
  transition: border-color var(--transition);
}
.luu-y-editor:focus { border-color: var(--brand-primary); }
.luu-y-editor p { margin: 0 0 6px 0; }
.luu-y-editor ul, .luu-y-editor ol { padding-left: 18px; margin: 4px 0 6px; }

/* Saved Templates Section */
.luu-y-templates-section {
  margin-top: 14px;
  border-top: 1px solid var(--brand-border);
  padding-top: 10px;
}
.luu-y-template-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
  max-height: 190px;
  overflow-y: auto;
}
.luu-y-template-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 8px;
  background: var(--brand-surface);
  border: 1px solid var(--brand-border);
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}
.luu-y-template-item:hover {
  border-color: var(--brand-primary);
  background: #fff;
}
.luu-y-template-item.active {
  border-color: var(--brand-primary);
  background: var(--brand-light);
}
.luu-y-template-name {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--brand-text);
  flex: 1;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding-right: 6px;
}
.luu-y-template-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}
.luu-y-add-template-row {
  display: flex;
  gap: 6px;
  margin-top: 8px;
  align-items: center;
}

/* ─── Buttons ────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  border: none;
  transition: all var(--transition);
  white-space: nowrap;
}
.btn svg { flex-shrink: 0; }
.btn--primary {
  background: var(--brand-primary);
  color: white;
}
.btn--primary:hover { background: var(--brand-dark); }
.btn--outline {
  background: transparent;
  border: 1px solid var(--brand-border);
  color: var(--brand-text);
}
.btn--outline:hover { border-color: var(--brand-primary); color: var(--brand-primary); }
.btn--sm { padding: 5px 8px; font-size: 11px; }
.btn-row { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }

/* ─── Preview Main Area ──────────────────────────────────── */
.preview-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #eae7e1;
  min-width: 0;
}

/* Empty state */
.preview-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--brand-muted);
  gap: 12px;
  padding: 40px;
}
.preview-empty__icon { font-size: 48px; opacity: .4; }
.preview-empty__text { font-size: 15px; font-weight: 500; }
.preview-empty__hint { font-size: 12px; }

/* Toolbar */
.preview-toolbar {
  padding: 10px 16px;
  background: var(--brand-white);
  border-bottom: 1px solid var(--brand-border);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  flex-wrap: wrap;
}
.toolbar-divider {
  width: 1px;
  height: 24px;
  background: var(--brand-border);
  margin: 0 4px;
}
.btn--pdf { background: #dc2626; color: white; }
.btn--pdf:hover { background: #b91c1c; }
.btn--img { background: #059669; color: white; }
.btn--img:hover { background: #047857; }
.btn--copy { background: #7c3aed; color: white; }
.btn--copy:hover { background: #6d28d9; }
.btn--save-booking { background: #0284c7; color: white; }
.btn--save-booking:hover { background: #0369a1; }
.btn--edit { background: transparent; border: 1px solid var(--brand-border); color: var(--brand-text); }
.btn--edit:hover { border-color: var(--brand-primary); color: var(--brand-primary); }
.btn--edit.active {
  background: var(--brand-light);
  border-color: var(--brand-primary);
  color: var(--brand-dark);
}

/* Font scale inline */
.fontscale-inline {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}
.fontscale-inline__label { font-size: 11px; color: var(--brand-muted); white-space: nowrap; }
.fontscale-inline__btn {
  width: 24px; height: 24px;
  border: 1px solid var(--brand-border);
  border-radius: 4px;
  background: white;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--brand-text);
}
.fontscale-inline__btn:hover { border-color: var(--brand-primary); }
.fontscale-inline__slider {
  width: 80px;
  accent-color: var(--brand-primary);
}
.fontscale-inline__value {
  font-size: 11px;
  font-weight: 600;
  color: var(--brand-primary);
  min-width: 32px;
  text-align: center;
}
.fontscale-inline__reset {
  background: none;
  border: none;
  font-size: 14px;
  color: var(--brand-muted);
  padding: 2px;
}
.fontscale-inline__reset:hover { color: var(--brand-primary); }

/* Airline Upload Zone */
.airline-upload-zone {
  border: 1.5px dashed var(--brand-border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  background: var(--brand-surface);
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: all var(--transition);
}
.airline-upload-zone:hover {
  border-color: var(--brand-primary);
  background: var(--brand-light);
}

/* Preview Container — Only THIS container scrolls on the right side */
.preview-container {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 24px 20px 80px;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}
.preview-container::-webkit-scrollbar { width: 8px; }
.preview-container::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }
.preview-container::-webkit-scrollbar-track { background: transparent; }

/* Iframe: Auto-height, NO internal scrollbar, Centered */
.preview-iframe {
  width: 800px;
  max-width: 100%;
  height: 600px;
  border: none;
  background: var(--brand-white);
  box-shadow: 0 4px 24px rgba(0,0,0,0.12);
  border-radius: var(--radius-sm);
  display: block;
  margin: 0 auto;
  overflow: hidden !important;
  transition: height 0.2s ease;
}

/* Editing banner */
.editing-banner {
  display: none;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: #fef3c7;
  border-bottom: 1px solid #fbbf24;
  font-size: 12px;
  font-weight: 500;
  color: #92400e;
}
.editing-banner.visible { display: flex; }

/* ─── Edit Toolbar (floating) ────────────────────────────── */
.edit-toolbar {
  display: none;
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--brand-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(0,0,0,.06);
  padding: 6px 10px;
  gap: 2px;
  align-items: center;
  z-index: 1000;
}
.edit-toolbar__btn {
  background: none;
  border: none;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--brand-text);
  transition: all var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}
.edit-toolbar__btn:hover { background: var(--brand-surface); }
.edit-toolbar__btn--done {
  background: var(--brand-primary);
  color: white;
  font-weight: 600;
}
.edit-toolbar__btn--done:hover { background: var(--brand-dark); }
.edit-toolbar__divider {
  width: 1px;
  height: 20px;
  background: var(--brand-border);
  margin: 0 4px;
}

/* ─── Toast ──────────────────────────────────────────────── */
.toast-container {
  position: fixed;
  top: 12px;
  right: 12px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.toast {
  background: var(--brand-white);
  color: var(--brand-text);
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  font-size: 13px;
  font-weight: 500;
  border-left: 3px solid var(--brand-primary);
  animation: toastIn .3s ease;
  pointer-events: auto;
}
.toast--success { border-left-color: #059669; }
.toast--error   { border-left-color: #dc2626; }
.toast.out { animation: toastOut .3s ease forwards; }
@keyframes toastIn  { from { transform: translateX(100%); opacity: 0; } }
@keyframes toastOut { to   { transform: translateX(100%); opacity: 0; } }

/* ─── Loading ────────────────────────────────────────────── */
.preview-loading {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(255,255,255,.8);
  z-index: 2000;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-size: 14px;
  color: var(--brand-muted);
}
.spinner {
  width: 32px; height: 32px;
  border: 3px solid var(--brand-border);
  border-top-color: var(--brand-primary);
  border-radius: 50%;
  animation: spin .6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── Responsive ─────────────────────────────────────────── */
@media (max-width: 900px) {
  .app-layout { flex-direction: column; }
  .sidebar {
    width: 100%;
    max-height: 40vh;
    border-right: none;
    border-bottom: 1px solid var(--brand-border);
  }
  .preview-iframe { width: 100%; }
  .preview-container { padding: 10px; }
  .fontscale-inline { margin-left: 0; }
}

/* ─── Button: Mobile 9:16 & QR ──────────────────────────── */
.btn--mobile-qr {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  color: #ffffff !important;
  font-weight: 600;
  border: none;
  box-shadow: 0 2px 6px rgba(5, 150, 105, 0.25);
  transition: all var(--transition);
}
.btn--mobile-qr:hover {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(5, 150, 105, 0.35);
}

/* ─── Modal: Mobile 9:16 & QR ───────────────────────────── */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: modalFadeIn 0.2s ease-out;
}
@keyframes modalFadeIn {
  from { opacity: 0; transform: scale(0.98); }
  to { opacity: 1; transform: scale(1); }
}

.modal-card {
  background: #ffffff;
  border-radius: 16px;
  width: 940px;
  max-width: 100%;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 50px rgba(0,0,0,0.3);
  overflow: hidden;
}

.modal-header {
  padding: 16px 24px;
  border-bottom: 1px solid var(--brand-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--brand-surface);
}
.modal-title {
  display: flex;
  align-items: center;
  gap: 12px;
}
.modal-title h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--brand-dark);
}
.modal-title p {
  margin: 2px 0 0;
  font-size: 12px;
  color: var(--brand-muted);
}
.modal-close {
  background: none;
  border: none;
  font-size: 18px;
  color: var(--brand-muted);
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 8px;
  transition: all 0.15s;
}
.modal-close:hover {
  background: #e2e8f0;
  color: #0f172a;
}

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

/* Two-column layout for Mobile & QR Modal */
.modal-body--two-col {
  display: flex;
  gap: 24px;
  align-items: stretch;
}

/* Left: Mobile Ticket Preview Frame & Actions */
.mobile-preview-col {
  width: 330px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.mobile-preview-frame {
  width: 100%;
  height: 500px;
  border: 1.5px solid var(--brand-border);
  border-radius: 16px;
  overflow: hidden;
  background: #ffffff;
  box-shadow: 0 4px 16px rgba(0,0,0,0.07);
}
.mobile-preview-screen {
  width: 100%;
  height: 100%;
  border: none;
  background: #f8fafc;
}
.mobile-preview-actions {
  display: flex;
  gap: 10px;
  width: 100%;
}
.mobile-preview-actions .btn {
  padding: 9px 12px;
  font-size: 13px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Right: Actions Column */
.modal-actions-col {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.modal-section-card {
  padding: 16px;
  background: var(--brand-surface);
  border: 1px solid var(--brand-border);
  border-radius: 12px;
}

/* QR Code Section Card */
.qr-section-card {
  display: flex;
  gap: 18px;
  align-items: center;
}
.qr-col-left {
  width: 140px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
}
.qr-canvas-wrap {
  width: 140px;
  height: 140px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(0,0,0,0.04);
}
.qr-canvas-wrap canvas,
.qr-canvas-wrap img {
  width: 100% !important;
  height: 100% !important;
  object-fit: contain;
}
.qr-section-details {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  justify-content: center;
}
.qr-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--brand-dark);
  display: block;
}
.qr-desc {
  font-size: 11.5px;
  color: var(--brand-text);
  line-height: 1.45;
}

.a4-qr-toggle-inline {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: #ffffff;
  border: 1px solid var(--brand-border);
  border-radius: 8px;
}

/* Share & Flight Summary Section Card */
.share-section-card {
  flex: 1;
  display: flex;
  flex-direction: column;
}
.share-link-row {
  display: flex;
  gap: 8px;
}
.share-link-input {
  flex: 1;
  min-width: 0;
  background: #ffffff;
  border: 1px solid var(--brand-border);
  border-radius: var(--radius-sm);
  padding: 7px 10px;
  font-size: 12px;
  color: var(--brand-dark);
  font-family: monospace;
}
.flight-summary-box {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.flight-summary-textarea {
  width: 100%;
  flex: 1;
  min-height: 180px;
  padding: 10px 12px;
  border: 1px solid var(--brand-border);
  border-radius: var(--radius-sm);
  background: #ffffff;
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--brand-dark);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  resize: none;
  box-sizing: border-box;
  outline: none;
}
.flight-summary-textarea:focus {
  border-color: var(--brand-primary);
}

/* A4 Ticket Embedded QR Badge */
.a4-ticket-qr-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.04);
}
.a4-ticket-qr-badge canvas,
.a4-ticket-qr-badge img {
  width: 58px !important;
  height: 58px !important;
}
.a4-ticket-qr-text {
  font-size: 10px;
  color: #475569;
  line-height: 1.3;
}
.a4-ticket-qr-text strong {
  color: #0f172a;
  display: block;
}

@media (max-width: 840px) {
  .modal-body--two-col {
    flex-direction: column;
    align-items: center;
  }
  .mobile-preview-col {
    width: 100%;
    max-width: 360px;
  }
}

/* History Table Styles */
.history-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.history-table th {
  background: #f8fafc;
  color: var(--brand-dark);
  font-weight: 700;
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--brand-border);
  position: sticky;
  top: 0;
  z-index: 1;
}
.history-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
}
.history-table tr:hover {
  background: #f8fafc;
}
.history-pnr-badge {
  background: #fef3c7;
  color: #92400e;
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 0.5px;
  padding: 3px 8px;
  border-radius: 6px;
  display: inline-block;
  font-family: monospace;
}
.history-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}

/* ============================================================
   AUTH LOGIN OVERLAY & GATEKEEPER
   ============================================================ */
html.auth-locked .header,
html.auth-locked .app-layout {
  display: none !important;
}

.auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: #0B0F19;
  background-image: 
    radial-gradient(at 0% 0%, rgba(245, 166, 35, 0.12) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(30, 41, 59, 0.8) 0px, transparent 50%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 1;
  transition: opacity 0.3s ease, visibility 0.3s;
}

html:not(.auth-locked) .auth-overlay {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.auth-card {
  width: 100%;
  max-width: 400px;
  background: #1E293B;
  border: 1px solid #334155;
  border-radius: 20px;
  padding: 36px 28px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.05);
  text-align: center;
  animation: auth-slide-up 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes auth-slide-up {
  from { opacity: 0; transform: translateY(20px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.auth-logo-badge {
  width: 54px;
  height: 54px;
  background: linear-gradient(135deg, #F5A623 0%, #D4891A 100%);
  color: #FFFFFF;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  margin-bottom: 16px;
  box-shadow: 0 8px 16px rgba(245, 166, 35, 0.3);
}

.auth-title {
  font-size: 20px;
  font-weight: 800;
  color: #F8FAFC;
  margin-bottom: 6px;
  letter-spacing: -0.3px;
}

.auth-subtitle {
  font-size: 13px;
  color: #94A3B8;
  margin-bottom: 24px;
}

.auth-form {
  text-align: left;
}

.auth-field {
  margin-bottom: 16px;
}

.auth-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #CBD5E1;
  margin-bottom: 8px;
}

.auth-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.auth-input-icon {
  position: absolute;
  left: 14px;
  font-size: 16px;
  pointer-events: none;
  opacity: 0.8;
}

.auth-input {
  width: 100%;
  background: #0F172A;
  border: 1.5px solid #334155;
  border-radius: 10px;
  padding: 12px 42px 12px 40px;
  color: #F8FAFC;
  font-size: 14px;
  transition: all 0.2s;
  outline: none;
}

.auth-input:focus {
  border-color: #F5A623;
  box-shadow: 0 0 0 3px rgba(245, 166, 35, 0.2);
}

.btn-toggle-pwd {
  position: absolute;
  right: 12px;
  background: transparent;
  border: none;
  color: #94A3B8;
  cursor: pointer;
  padding: 4px;
  font-size: 15px;
}

.btn-toggle-pwd:hover {
  color: #F8FAFC;
}

.auth-error {
  margin-top: 8px;
  font-size: 12px;
  color: #F87171;
  background: rgba(239, 68, 68, 0.1);
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.auth-remember-row {
  margin-bottom: 20px;
}

.auth-remember-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: #94A3B8;
  cursor: pointer;
  user-select: none;
}

.auth-remember-label input[type="checkbox"] {
  accent-color: #F5A623;
  width: 16px;
  height: 16px;
}

.auth-btn-submit {
  width: 100%;
  padding: 12px;
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: #F5A623;
  color: #0F172A;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
}

.auth-btn-submit:hover {
  background: #E0951C;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(245, 166, 35, 0.35);
}

.auth-btn-submit:active {
  transform: translateY(0);
}

.auth-shake {
  animation: auth-shake 0.4s ease-in-out;
}

@keyframes auth-shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-8px); }
  40%, 80% { transform: translateX(8px); }
}

