/* =========================================================================
   Wachsen Internal Portal — design tokens
   Palette: Blue #220042, Red #ED1D24, White #FFFFFF, Black #000000.
   Light theme is the default; a dark theme is layered on top via
   [data-theme="dark"].
   ========================================================================= */

:root {
  --brand-navy: #220042;
  --brand-red: #ED1D24;
  --brand-white: #FFFFFF;
  --brand-black: #000000;

  /* Light theme (default) */
  --bg: #FFFFFF;
  --surface: #FFFFFF;
  --surface-alt: #F5F3FA;
  --sidebar-bg: #220042;
  --sidebar-text: #FFFFFF;
  --sidebar-text-muted: #C8BFE0;
  --text: #000000;
  --text-muted: #4A4A4A;
  --border: #E3DEF0;
  --accent: #ED1D24;
  --accent-contrast: #FFFFFF;
  --primary: #220042;
  --primary-contrast: #FFFFFF;
  --table-header-bg: #F5F3FA;
  --table-header-text: #6B6478;
  --success: #1B7A3D;
  --warning: #B4790E;
  --danger: #ED1D24;
  --shadow: 0 2px 10px rgba(34, 0, 66, 0.08);
  --radius: 14px;
  --font-sans: "Inter", "Calibri", "Helvetica Neue", Helvetica, Arial, sans-serif;
}

[data-theme="dark"] {
  --bg: #14001F;
  --surface: #1C0630;
  --surface-alt: #24093D;
  --sidebar-bg: #12001C;
  --sidebar-text: #FFFFFF;
  --sidebar-text-muted: #B39FD8;
  --text: #F2EEFA;
  --text-muted: #B9AFD1;
  --border: #35205A;
  --accent: #E23B3B;
  --accent-contrast: #FFFFFF;
  --primary: #7C4DD8;
  --primary-contrast: #FFFFFF;
  --table-header-bg: #24093D;
  --table-header-text: #B9AFD1;
  --shadow: 0 2px 14px rgba(0, 0, 0, 0.45);
}

* { box-sizing: border-box; }

/* Every icon in this app is an inline <svg viewBox="0 0 24 24"> with no
   width/height attributes, so without this, browsers fall back to an
   oversized default replaced-element box (very visible once a button or
   nav row is asked to stretch full-width, e.g. on mobile). Give all icons
   a sane default size; specific contexts below override where needed. */
svg { width: 20px; height: 20px; flex-shrink: 0; display: inline-block; vertical-align: middle; }

body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  transition: background .2s ease, color .2s ease;
}

a { color: inherit; text-decoration: none; }

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

.sidebar {
  width: 240px;
  flex-shrink: 0;
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  padding: 20px 0;
}

.sidebar__brand {
  padding: 0 20px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.12);
  margin-bottom: 12px;
}
.sidebar__brand img { display: block; max-width: 150px; height: auto; }
.sidebar__brand .brand-subtitle { font-weight: 400; font-size: .7rem; opacity: .8; margin-top: 6px; }

.sidebar nav { display: flex; flex-direction: column; gap: 2px; }

.sidebar a.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 20px;
  color: var(--sidebar-text-muted);
  font-size: 0.93rem;
  font-weight: 500;
  border-left: 3px solid transparent;
}
.sidebar a.nav-link svg { width: 19px; height: 19px; }
.sidebar a.nav-link:hover { color: var(--sidebar-text); background: rgba(255,255,255,0.06); }
.sidebar a.nav-link.active {
  color: var(--sidebar-text);
  background: rgba(196,18,18,0.18);
  border-left-color: var(--brand-red);
}

.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 28px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.topbar h1 { font-size: 1.15rem; margin: 0; font-weight: 700; flex: 1; min-width: 0; }

.content { padding: 26px 28px; flex: 1; min-width: 0; }

/* ---------- Topbar: hamburger, search, user ---------- */
.hamburger {
  display: none;
  border: 1px solid var(--border);
  background: var(--surface-alt);
  color: var(--text);
  border-radius: 8px;
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}
.sidebar-close { display: none; }
.sidebar-backdrop { display: none; }

.topbar-search { flex: 1; max-width: 360px; }
.topbar-search form { position: relative; display: flex; align-items: center; }
.topbar-search .search-icon { position: absolute; left: 12px; width: 16px; height: 16px; color: var(--text-muted); pointer-events: none; }
.topbar-search input { padding-left: 34px; }

.topbar-right { display: flex; align-items: center; gap: 14px; flex-shrink: 0; }

.topbar-user { display: flex; align-items: center; gap: 8px; }
.topbar-user .avatar {
  width: 34px; height: 34px; border-radius: 999px;
  background: var(--primary); color: var(--primary-contrast);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .85rem; flex-shrink: 0;
}
.topbar-user .who { line-height: 1.25; }
.topbar-user .name { font-size: .85rem; font-weight: 600; }
.topbar-user .role { font-size: .74rem; color: var(--text-muted); }
.topbar-user .chevron { width: 14px; height: 14px; color: var(--text-muted); }

.theme-toggle svg { width: 17px; height: 17px; }
.hamburger svg { width: 20px; height: 20px; }
.sidebar-close svg { width: 15px; height: 15px; }
.icon-btn svg { width: 14px; height: 14px; }
.row-actions-btn svg { width: 18px; height: 18px; }
.btn-sm svg { width: 16px; height: 16px; }

/* ---------- Page header / toolbar (list pages) ---------- */
.page-header-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-eyebrow { margin: 0; font-size: .78rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--brand-red); }
.page-title { margin: 2px 0 4px; font-size: 1.4rem; font-weight: 800; }
.page-subtitle { margin: 0; color: var(--text-muted); font-size: .92rem; }
.page-actions { display: flex; flex-wrap: wrap; gap: 8px; }

.toolbar-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 18px; }
.filter-form { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.filter-form select, .filter-form input[type=date] { width: auto; }
.search-wrap { position: relative; flex: 1; min-width: 180px; }
.search-wrap svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--text-muted); pointer-events: none; }
.search-wrap input { padding-left: 32px; }
.date-range { display: flex; align-items: center; gap: 6px; }
.date-range input { width: auto; }
.filter-actions { display: flex; gap: 8px; }
.report-actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- Tables: scroll + row actions ---------- */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.sort-icon { opacity: .5; font-size: .75em; }

.row-actions { position: relative; text-align: right; white-space: nowrap; }
.row-actions-btn { border: none; background: transparent; color: var(--text-muted); cursor: pointer; padding: 4px 6px; border-radius: 6px; }
.row-actions-btn:hover { background: var(--surface-alt); color: var(--text); }
.row-actions-menu {
  display: none;
  position: absolute; right: 0; top: 100%; z-index: 20;
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
  box-shadow: var(--shadow); min-width: 160px; padding: 6px; flex-direction: column;
}
.row-actions.open .row-actions-menu { display: flex; }
.row-actions-menu a { padding: 8px 10px; border-radius: 6px; font-size: .88rem; text-align: left; }
.row-actions-menu a:hover { background: var(--surface-alt); }

/* ---------- Pagination ---------- */
.pagination-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding-top: 14px; margin-top: 14px; border-top: 1px solid var(--border); }
.pagination-count { font-size: .85rem; }
.pagination { display: flex; gap: 6px; }
.page-btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 32px; height: 32px; padding: 0 8px; border-radius: 8px;
  border: 1px solid var(--border); font-size: .85rem; font-weight: 600; color: var(--text);
}
.page-btn:hover:not(.disabled):not(.current) { border-color: var(--primary); }
.page-btn.current { background: var(--primary); color: var(--primary-contrast); border-color: var(--primary); }
.page-btn.disabled { opacity: .4; }

.builder-left, .builder-right { min-width: 0; }

/* ---------- Theme toggle ---------- */
.theme-toggle {
  border: 1px solid var(--border);
  background: var(--surface-alt);
  color: var(--text);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 0.85rem;
  cursor: pointer;
  font-family: inherit;
}
.theme-toggle:hover { border-color: var(--primary); }

/* ---------- Cards / surfaces ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
}

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 22px; }
.stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; }
.stat-card .label { color: var(--text-muted); font-size: 0.78rem; text-transform: uppercase; letter-spacing: .04em; }
.stat-card .value { font-size: 1.6rem; font-weight: 700; margin-top: 4px; }
.stat-card.accent .value { color: var(--brand-red); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: 8px;
  border: 1px solid transparent;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  font-family: inherit;
}
.btn-primary { background: var(--primary); color: var(--primary-contrast); }
.btn-primary:hover { filter: brightness(1.1); }
.btn-accent { background: var(--brand-red); color: #fff; }
.btn-accent:hover { filter: brightness(1.1); }
.btn-outline { background: transparent; border-color: var(--border); color: var(--text); }
.btn-outline:hover { border-color: var(--primary); }
.btn-sm { padding: 5px 10px; font-size: 0.8rem; }

/* ---------- Forms ---------- */
.form-row { margin-bottom: 14px; }
.form-row label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 5px; color: var(--text-muted); }
.input, input[type=text], input[type=email], input[type=password], input[type=number], input[type=date],
select, textarea {
  width: 100%;
  padding: 9px 12px;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: 0.92rem;
}
.input:focus, input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); }

/* ---------- Tables ---------- */
table.data-table { width: 100%; border-collapse: collapse; border-radius: 10px; overflow: hidden; }
table.data-table th {
  background: var(--table-header-bg);
  color: var(--table-header-text);
  text-align: left;
  padding: 12px 14px;
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  border-bottom: 1px solid var(--border);
}
table.data-table th:first-child { border-top-left-radius: 10px; }
table.data-table th:last-child { border-top-right-radius: 10px; }
table.data-table td { padding: 14px; border-bottom: 1px solid var(--border); font-size: 0.92rem; }
table.data-table tr:last-child td { border-bottom: none; }
table.data-table tr:hover td { background: var(--surface-alt); }
table.data-table .sort-icon { opacity: .6; }
table.data-table .row-actions { text-align: right; }

/* ---------- Badges ---------- */
.badge { display: inline-block; padding: 4px 12px; border-radius: 999px; font-size: 0.75rem; font-weight: 700; }
.badge-paid, .badge-converted { background: rgba(27,122,61,0.14); color: var(--success); }
.badge-confirmed { background: rgba(34,0,66,0.10); color: var(--primary); }
.badge-partial { background: rgba(180,121,14,0.15); color: var(--warning); }
.badge-unpaid { background: rgba(196,18,18,0.15); color: var(--danger); }
.badge-draft { background: var(--surface-alt); color: var(--text-muted); }

/* ---------- Live preview / doc surface ---------- */
.doc-preview {
  background: #fff;
  color: #000;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px;
}
.doc-preview .doc-header { display: flex; justify-content: space-between; border-bottom: 3px solid var(--brand-navy); padding-bottom: 14px; margin-bottom: 18px; }
.doc-preview .doc-type { color: var(--brand-navy); font-weight: 800; font-size: 1.3rem; text-decoration: underline; }
.doc-preview table.doc-table { width: 100%; border-collapse: collapse; margin: 14px 0; }
.doc-preview table.doc-table th { background: #000; color: #fff; padding: 8px 10px; text-align: left; font-size: .8rem; }
.doc-preview table.doc-table td { padding: 8px 10px; border-bottom: 1px solid #ddd; }
.doc-preview .doc-total-block { background: #000; color: #fff; padding: 12px 16px; text-align: right; font-weight: 700; border-radius: 6px; }

/* ---------- Document builder (quotation / invoice form) ---------- */
.builder-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.builder-right { position: sticky; top: 16px; }
.preview-bar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.pdf-frame { width: 100%; height: 78vh; border: 1px solid var(--border); border-radius: var(--radius); background: #fff; }
.builder-right .pdf-frame { height: calc(100vh - 130px); min-height: 480px; }
.form-error { color: var(--brand-red); font-size: .85rem; margin: 0 0 12px; }

.block-card { border: 1px solid var(--border); border-left: 4px solid var(--primary); border-radius: 8px; padding: 10px 12px 12px; margin-bottom: 10px; background: var(--surface); }
.block-card.block-heading { border-left-color: var(--brand-red); }
.block-card.block-pagebreak { border-left-color: var(--text-muted); }
.block-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.block-actions { display: inline-flex; gap: 4px; }
.block-hint { margin: 0 0 8px; font-size: .78rem; color: var(--text-muted); }
.empty-note { color: var(--text-muted); font-size: .88rem; padding: 14px; border: 1px dashed var(--border); border-radius: 8px; margin: 0 0 12px; }
.add-row { margin-top: 6px; }
.add-row select { font-weight: 600; }
textarea.input, .block-card textarea { resize: vertical; }

.icon-btn { border: 1px solid var(--border); background: transparent; color: var(--text); border-radius: 6px; width: 28px; height: 26px; font-size: .72rem; cursor: pointer; font-family: inherit; }
.icon-btn:hover:not(:disabled) { border-color: var(--primary); }
.icon-btn.danger:hover:not(:disabled) { border-color: var(--brand-red); color: var(--brand-red); }
.icon-btn:disabled { opacity: .35; cursor: default; }

.grid-scroll { overflow-x: auto; }
table.grid-editor { border-collapse: separate; border-spacing: 4px; width: 100%; }
table.grid-editor td, table.grid-editor th { padding: 0; min-width: 90px; }
table.grid-editor td.row-tools, table.grid-editor th:last-child { min-width: 30px; width: 30px; }
table.grid-editor th.col-tools { text-align: center; }
table.grid-editor tr.head-row input { font-weight: 700; }
.table-buttons { display: flex; gap: 8px; margin-top: 8px; }

.pricing-item { border: 1px solid var(--border); border-radius: 8px; padding: 8px; margin-bottom: 8px; background: var(--surface-alt); }
.pricing-item-top { display: flex; gap: 6px; margin-bottom: 6px; }
.pricing-nums { display: grid; grid-template-columns: 1fr 1.4fr 1.4fr; gap: 8px; margin-top: 6px; }
.pricing-nums label { font-size: .75rem; color: var(--text-muted); font-weight: 600; }
.pricing-nums label span { display: block; margin-bottom: 3px; }
.line-amount { display: block; padding: 9px 0; font-weight: 700; color: var(--text); }
.pricing-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.check { display: inline-flex; align-items: center; gap: 6px; font-size: .85rem; }
.check input { width: auto; }
.pricing-summary { margin-top: 10px; text-align: right; font-size: .88rem; color: var(--text-muted); }
.pricing-total { color: var(--text); font-weight: 800; font-size: 1rem; margin-top: 2px; }

@media (max-width: 1100px) {
  .builder-grid { grid-template-columns: 1fr; }
  .builder-right { position: static; }
  .builder-right .pdf-frame { height: 70vh; }
}

/* ---------- Misc ---------- */
.muted { color: var(--text-muted); }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.messages { list-style: none; padding: 0; margin: 0 0 18px; }
.messages li { padding: 10px 14px; border-radius: 8px; margin-bottom: 8px; background: var(--surface-alt); border: 1px solid var(--border); }
.line-items-table input { width: 100%; }
.line-items-table td { padding: 6px; }
.search-input { max-width: 320px; }

.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--brand-navy);
}
.login-card { width: 360px; background: var(--surface); border-radius: var(--radius); padding: 32px; box-shadow: var(--shadow); }
.login-logo { text-align: center; margin-bottom: 18px; }
.login-logo img { max-width: 220px; height: auto; }
.login-logo .logo-dark { display: none; }
[data-theme="dark"] .login-logo .logo-light { display: none; }
[data-theme="dark"] .login-logo .logo-dark { display: inline; }

/* =====================================================================
   Templates, duplicate & file import
   ===================================================================== */
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.btn-danger-text { color: var(--brand-red); }
.btn-danger-text:hover { border-color: var(--brand-red); }
.form-error ul { list-style: none; margin: 0; padding: 0; }

.help-callout {
  border: 1px solid var(--border);
  border-left: 4px solid var(--brand-red);
  background: var(--surface-alt);
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 16px;
  font-size: .86rem;
  line-height: 1.55;
  color: var(--text-muted);
}
.help-callout strong { color: var(--text); }
.help-callout code { background: var(--surface); border: 1px solid var(--border); border-radius: 4px; padding: 1px 5px; font-size: .82rem; color: var(--text); }

.start-faster {
  display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center;
  font-size: .84rem; margin: 0 0 14px; color: var(--text-muted);
}
.start-faster a { color: var(--primary); font-weight: 600; text-decoration: underline; }

.prefill-banner {
  border: 1px solid var(--primary);
  border-left-width: 4px;
  background: var(--surface-alt);
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 16px;
  font-size: .86rem;
  line-height: 1.5;
}
.prefill-banner__title { font-weight: 700; margin-bottom: 4px; }
.prefill-banner__note { color: var(--text); margin-bottom: 4px; }
.prefill-banner__warnings { margin: 6px 0 6px 18px; padding: 0; color: var(--warning); }
.prefill-banner__warnings li { margin-bottom: 4px; }
.prefill-banner__hint { color: var(--text-muted); font-size: .8rem; margin-top: 6px; }

.check-row { display: flex; align-items: flex-start; gap: 10px; margin: 6px 0 4px; font-size: .9rem; cursor: pointer; }
.check-row input { margin-top: 3px; }

.choice-group { display: flex; flex-wrap: wrap; gap: 8px 22px; }
.choice-group--stack { flex-direction: column; gap: 8px; }
.choice { display: inline-flex; align-items: flex-start; gap: 8px; font-weight: 400 !important; color: var(--text) !important; cursor: pointer; margin: 0 !important; }
.choice input { margin-top: 3px; }
input[type=file] { font-family: inherit; font-size: .9rem; color: var(--text); }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 14px; }
.tab { padding: 8px 14px; font-size: .88rem; font-weight: 600; color: var(--text-muted); border-bottom: 2px solid transparent; margin-bottom: -1px; text-decoration: none; }
.tab:hover { color: var(--text); }
.tab.active { color: var(--primary); border-bottom-color: var(--brand-red); }

.empty-state { padding: 18px 20px; border: 1px dashed var(--border); border-radius: 10px; background: var(--surface-alt); line-height: 1.55; }
.empty-state p { margin: 8px 0; }
.empty-state ol { margin: 6px 0 0 20px; padding: 0; }
.empty-state li { margin-bottom: 6px; }

/* =========================================================================
   Mobile view
   ========================================================================= */
@media (max-width: 880px) {
  .hamburger { display: inline-flex; }

  /* Off-canvas sidebar */
  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 100;
    width: 82%;
    max-width: 300px;
    transform: translateX(-100%);
    transition: transform .25s ease;
    box-shadow: var(--shadow);
  }
  body.sidebar-open .sidebar { transform: translateX(0); }

  .sidebar-close {
    display: inline-flex;
    align-items: center; justify-content: center;
    position: absolute; top: 14px; right: 14px;
    width: 30px; height: 30px; border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.25);
    background: transparent; color: var(--sidebar-text);
    cursor: pointer;
  }

  .sidebar-backdrop {
    display: none;
    position: fixed; inset: 0; z-index: 90;
    background: rgba(0,0,0,0.5);
  }
  body.sidebar-open .sidebar-backdrop { display: block; }
  body.sidebar-open { overflow: hidden; }

  /* Topbar */
  .topbar { padding: 12px 14px; gap: 10px; flex-wrap: wrap; }
  .topbar h1 { font-size: 1.02rem; order: 1; }
  .hamburger { order: 0; }
  .topbar-right { order: 2; margin-left: auto; gap: 10px; }
  .topbar-search { order: 3; flex-basis: 100%; max-width: none; }
  .topbar-user .who { display: none; }
  .topbar-user .chevron { display: none; }

  .content { padding: 16px 14px; }

  /* Page headers & toolbars stack */
  .page-header-row { flex-direction: column; align-items: stretch; }
  .page-actions { width: 100%; }
  .page-actions .btn { flex: 1; justify-content: center; }

  .filter-form { flex-direction: column; align-items: stretch; }
  .filter-form select, .filter-form input[type=date], .search-wrap { width: 100%; }
  .date-range { flex-wrap: wrap; }
  .filter-actions { width: 100%; }
  .filter-actions .btn { flex: 1; }
  .report-actions .btn { flex: 1; justify-content: center; }

  .pagination-bar { flex-direction: column; align-items: stretch; text-align: center; }
  .pagination { justify-content: center; }

  /* Cards & grids */
  .card { padding: 14px; }
  .stat-grid { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
  .builder-grid { grid-template-columns: 1fr; gap: 14px; }
  .pricing-nums { grid-template-columns: 1fr; }
  .pricing-item-top { flex-wrap: wrap; }

  .login-card { width: 100%; max-width: 340px; padding: 24px 20px; }

  /* Doc preview / builder tighten up */
  .doc-preview { padding: 16px; }
  .doc-preview .doc-header { flex-direction: column; gap: 8px; }
  .pdf-frame, .builder-right .pdf-frame { height: 60vh; }
}