/* ═══════════════════════════════════════════════════════════
   SITEMEASURE — ENTERPRISE STYLESHEET
   ═══════════════════════════════════════════════════════════ */

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

:root {
  --navy:       #0f2744;
  --navy-light: #1a3a5c;
  --brand:      #2563eb;
  --brand-dark: #1d4ed8;
  --brand-light:#dbeafe;
  --brand-pale: #eff6ff;
  --bg:         #f1f5f9;
  --surface:    #ffffff;
  --border:     #e2e8f0;
  --border-md:  #cbd5e1;
  --text:       #0f172a;
  --text-sec:   #475569;
  --text-muted: #94a3b8;
  --success:    #059669;
  --success-bg: #d1fae5;
  --success-bd: #6ee7b7;
  --warning:    #d97706;
  --warning-bg: #fef3c7;
  --danger:     #dc2626;
  --danger-bg:  #fee2e2;
  --danger-bd:  #fca5a5;
  --topnav-h:   56px;
  --sidebar-w:  264px;
  --radius:     8px;
  --radius-lg:  12px;
  --shadow:     0 1px 3px rgba(0,0,0,.1), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md:  0 4px 6px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.06);
  --shadow-lg:  0 10px 15px rgba(0,0,0,.1), 0 4px 6px rgba(0,0,0,.05);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-size: 14px;
  line-height: 1.5;
}

/* ── TOP NAV ─────────────────────────────────────────────── */
.topnav {
  background: var(--navy);
  height: var(--topnav-h);
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 32px;
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 200;
  box-shadow: 0 1px 0 rgba(255,255,255,.06);
}
.topnav-brand { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.brand-icon { font-size: 1.25rem; }
.brand-name { font-size: 1.05rem; font-weight: 700; color: #fff; letter-spacing: -.3px; }
.brand-tag  { font-size: 0.6rem; font-weight: 600; background: rgba(37,99,235,.5); color: #93c5fd; padding: 2px 7px; border-radius: 20px; text-transform: uppercase; letter-spacing: .5px; }
.topnav-links { display: flex; gap: 2px; flex: 1; }
.topnav-links a {
  color: rgba(255,255,255,.65); font-size: .85rem; font-weight: 500;
  padding: 6px 14px; border-radius: 6px; text-decoration: none; transition: all .15s;
}
.topnav-links a:hover  { color: #fff; background: rgba(255,255,255,.08); }
.topnav-links a.active { color: #fff; background: rgba(255,255,255,.12); }
.topnav-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.app-ver { font-size: .72rem; color: rgba(255,255,255,.35); font-family: monospace; }

/* ── APP SHELL ───────────────────────────────────────────── */
.app-shell { margin-top: var(--topnav-h); min-height: calc(100vh - var(--topnav-h)); }

/* ── SIDEBAR LAYOUT ──────────────────────────────────────── */
.sidebar-layout { display: flex; min-height: calc(100vh - var(--topnav-h)); }
.sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  position: sticky;
  top: var(--topnav-h);
  height: calc(100vh - var(--topnav-h));
}
.sidebar-hdr {
  padding: 16px 16px 10px;
  font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .8px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}
.sidebar-search {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}
.sidebar-search input {
  width: 100%; padding: 6px 10px; border: 1.5px solid var(--border);
  border-radius: 6px; font-size: .82rem; background: var(--bg);
}
.sidebar-search input:focus { outline: none; border-color: var(--brand); }

/* Catalog tree */
.tree-class { margin-bottom: 2px; }
.tree-class-hdr {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 16px; font-size: .82rem; font-weight: 700; color: var(--text);
  cursor: pointer; user-select: none; transition: background .1s;
}
.tree-class-hdr:hover { background: var(--bg); }
.tree-class-hdr .ico { font-size: 1rem; }
.tree-class-hdr .chevron { margin-left: auto; font-size: .65rem; color: var(--text-muted); transition: transform .2s; }
.tree-class-hdr.open .chevron { transform: rotate(90deg); }

.tree-categories { display: none; }
.tree-categories.open { display: block; }

.tree-cat-hdr {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 16px 6px 28px; font-size: .8rem; font-weight: 600;
  color: var(--text-sec); cursor: pointer; user-select: none; transition: background .1s;
}
.tree-cat-hdr:hover { background: var(--bg); color: var(--text); }
.tree-cat-hdr .chevron { margin-left: auto; font-size: .62rem; color: var(--text-muted); transition: transform .2s; }
.tree-cat-hdr.open .chevron { transform: rotate(90deg); }

.tree-subs { display: none; }
.tree-subs.open { display: block; }

.tree-sub {
  display: flex; align-items: center; justify-content: space-between;
  padding: 5px 16px 5px 38px; font-size: .78rem; color: var(--text-sec);
  cursor: pointer; transition: background .1s; border-radius: 0;
}
.tree-sub:hover  { background: var(--brand-pale); color: var(--brand); }
.tree-sub.active { background: var(--brand-pale); color: var(--brand); font-weight: 600; border-right: 3px solid var(--brand); }
.tree-sub .count { font-size: .68rem; background: var(--border); color: var(--text-muted); padding: 1px 5px; border-radius: 8px; }
.tree-sub.active .count { background: var(--brand-light); color: var(--brand); }

.main-content { flex: 1; overflow: auto; padding: 24px; }

/* ── PAGE HEADER ─────────────────────────────────────────── */
.page-hdr { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 20px; gap: 16px; flex-wrap: wrap; }
.page-hdr-left {}
.breadcrumb { font-size: .75rem; color: var(--text-muted); margin-bottom: 4px; }
.breadcrumb span { color: var(--text-sec); }
.breadcrumb span:last-child { color: var(--text); font-weight: 500; }
.page-title { font-size: 1.35rem; font-weight: 700; color: var(--text); letter-spacing: -.3px; }
.page-sub   { font-size: .82rem; color: var(--text-sec); margin-top: 2px; }
.page-hdr-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ── STAT CARDS ──────────────────────────────────────────── */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; margin-bottom: 24px; }
.stat-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 18px; box-shadow: var(--shadow);
}
.stat-card .sc-label { font-size: .7rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 6px; }
.stat-card .sc-val   { font-size: 2rem; font-weight: 700; color: var(--text); line-height: 1; }
.stat-card .sc-sub   { font-size: .75rem; color: var(--text-sec); margin-top: 4px; }
.stat-card.accent    { background: var(--brand); border-color: var(--brand); }
.stat-card.accent .sc-label, .stat-card.accent .sc-val, .stat-card.accent .sc-sub { color: #fff; }
.stat-card.accent .sc-label { opacity: .75; }

/* ── DATA TABLE ──────────────────────────────────────────── */
.table-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow); overflow: hidden; margin-bottom: 20px;
}
.table-toolbar {
  display: flex; align-items: center; gap: 10px; padding: 14px 16px;
  border-bottom: 1px solid var(--border); flex-wrap: wrap;
}
.table-toolbar .tt-title { font-size: .85rem; font-weight: 700; color: var(--text); flex-shrink: 0; }
.table-toolbar .tt-count { font-size: .75rem; color: var(--text-muted); flex-shrink: 0; }
.tt-search {
  display: flex; align-items: center; gap: 6px; background: var(--bg);
  border: 1.5px solid var(--border); border-radius: 6px; padding: 5px 10px;
  flex: 1; min-width: 180px; max-width: 300px;
}
.tt-search input { border: none; background: none; font-size: .82rem; outline: none; width: 100%; color: var(--text); }
.tt-search input::placeholder { color: var(--text-muted); }
.tt-spacer { flex: 1; }
.tt-filter select {
  border: 1.5px solid var(--border); border-radius: 6px; padding: 5px 10px;
  font-size: .8rem; background: var(--bg); color: var(--text); appearance: none;
  padding-right: 24px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%2394a3b8'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 8px center;
}

.data-table { width: 100%; border-collapse: collapse; }
.data-table thead { background: var(--bg); }
.data-table th {
  padding: 10px 14px; text-align: left; font-size: .7rem; font-weight: 700;
  color: var(--text-sec); text-transform: uppercase; letter-spacing: .5px;
  border-bottom: 1px solid var(--border); white-space: nowrap;
}
.data-table th.r { text-align: right; }
.data-table td { padding: 10px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.data-table td.r { text-align: right; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover { background: var(--brand-pale); }
.data-table .mono { font-family: 'SF Mono', 'Fira Code', monospace; font-size: .8rem; color: var(--text-sec); }
.data-table .dim  { color: var(--text-muted); font-size: .8rem; }
.data-table .fw   { font-weight: 600; }
.tbl-actions { display: flex; gap: 4px; justify-content: flex-end; }

.empty-table { text-align: center; padding: 48px 20px; }
.empty-table .ico { font-size: 2.5rem; margin-bottom: 12px; opacity: .4; }
.empty-table p    { font-size: .85rem; color: var(--text-muted); }

/* ── PROJECT CARDS ───────────────────────────────────────── */
.project-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.project-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 20px; box-shadow: var(--shadow); cursor: pointer;
  transition: all .15s; text-decoration: none; display: block; color: inherit;
}
.project-card:hover { border-color: var(--brand); box-shadow: var(--shadow-md); transform: translateY(-2px); }
.pc-icon { font-size: 1.8rem; margin-bottom: 12px; }
.pc-name { font-size: 1rem; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.pc-addr { font-size: .78rem; color: var(--text-muted); margin-bottom: 12px; }
.pc-meta { display: flex; gap: 12px; flex-wrap: wrap; }
.pc-stat { font-size: .75rem; color: var(--text-sec); }
.pc-stat strong { color: var(--text); font-weight: 600; }
.pc-date { font-size: .72rem; color: var(--text-muted); margin-top: 12px; }
.new-project-card {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 160px; border: 2px dashed var(--border); border-radius: var(--radius-lg);
  cursor: pointer; transition: all .15s; color: var(--text-muted); text-align: center; padding: 24px;
}
.new-project-card:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-pale); }
.new-project-card .plus { font-size: 2rem; margin-bottom: 8px; }
.new-project-card span  { font-size: .85rem; font-weight: 600; }

/* ── PROJECT EDITOR ──────────────────────────────────────── */
.editor-layout { display: flex; flex-direction: column; }
.editor-topbar {
  background: var(--surface); border-bottom: 1px solid var(--border);
  padding: 0 24px; display: flex; align-items: center; gap: 0; position: sticky;
  top: var(--topnav-h); z-index: 100; box-shadow: var(--shadow);
}
.editor-back {
  display: flex; align-items: center; gap: 6px; color: var(--text-sec);
  font-size: .8rem; font-weight: 500; text-decoration: none; padding: 16px 0;
  margin-right: 20px; transition: color .15s; flex-shrink: 0;
}
.editor-back:hover { color: var(--brand); }
.editor-title { font-size: .95rem; font-weight: 700; color: var(--text); margin-right: 24px; flex-shrink: 0; }
.editor-tabs  { display: flex; gap: 0; flex: 1; overflow-x: auto; scrollbar-width: none; }
.editor-tabs::-webkit-scrollbar { display: none; }
.etab {
  padding: 16px 18px; font-size: .82rem; font-weight: 600; color: var(--text-muted);
  border: none; background: none; cursor: pointer; border-bottom: 3px solid transparent;
  transition: all .15s; white-space: nowrap;
}
.etab:hover  { color: var(--text); }
.etab.active { color: var(--brand); border-bottom-color: var(--brand); }
.editor-body { padding: 24px; }

/* ── FORM ELEMENTS ───────────────────────────────────────── */
.form-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px; box-shadow: var(--shadow); margin-bottom: 16px; }
.form-card-title { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .8px; color: var(--brand); margin-bottom: 16px; }

.form-grid { display: grid; gap: 14px; margin-bottom: 14px; }
.form-grid.c2 { grid-template-columns: 1fr 1fr; }
.form-grid.c3 { grid-template-columns: 1fr 1fr 1fr; }

.field label { display: block; font-size: .72rem; font-weight: 600; color: var(--text-sec); margin-bottom: 4px; text-transform: uppercase; letter-spacing: .4px; }
.field input, .field select, .field textarea {
  width: 100%; padding: 8px 11px; border: 1.5px solid var(--border);
  border-radius: 6px; font-size: .88rem; color: var(--text); background: var(--surface);
  transition: border-color .15s; appearance: none; -webkit-appearance: none;
}
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(37,99,235,.1); }
.field select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%2394a3b8'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; padding-right: 28px; }
.field input[type=number] { text-align: center; font-weight: 600; }

/* ── ROOM BLOCK ──────────────────────────────────────────── */
.room-block {
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  margin-bottom: 14px; overflow: hidden; background: var(--surface);
}
.room-block-hdr {
  display: flex; align-items: center; gap: 10px; padding: 12px 16px;
  background: var(--bg); border-bottom: 1px solid var(--border);
}
.room-name-inp { font-weight: 700; font-size: .92rem; border: none; background: transparent; flex: 1; color: var(--text); }
.room-name-inp:focus { outline: none; border-bottom: 1.5px solid var(--brand); }
.room-block-body { padding: 14px 16px; }

.grid-hdr { display: grid; gap: 6px; margin-bottom: 4px; }
.grid-hdr span { font-size: .65rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .4px; }
.grid-hdr span.r { text-align: center; }

.door-row { display: grid; grid-template-columns: 1fr 54px 54px 60px 60px 28px; gap: 6px; align-items: end; margin-bottom: 6px; }
.trim-row { display: grid; grid-template-columns: 1fr 72px 72px 28px; gap: 6px; align-items: end; margin-bottom: 6px; }
.row-input { padding: 7px 9px; border: 1.5px solid var(--border); border-radius: 6px; font-size: .82rem; width: 100%; appearance: none; -webkit-appearance: none; }
.row-input:focus { outline: none; border-color: var(--brand); }
.row-select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='5'%3E%3Cpath d='M0 0l4 5 4-5z' fill='%2394a3b8'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 8px center; padding-right: 22px; }
.rm-btn { width: 28px; height: 32px; border: none; background: var(--danger-bg); color: var(--danger); border-radius: 6px; cursor: pointer; font-size: .9rem; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.rm-btn:hover { background: var(--danger-bd); }

.sec-divider { font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .7px; color: var(--text-muted); margin: 12px 0 8px; display: flex; align-items: center; gap: 8px; }
.sec-divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }

.btn-add-row { width: 100%; padding: 7px; border: 1.5px dashed var(--border); border-radius: 6px; background: transparent; color: var(--text-muted); font-size: .8rem; font-weight: 500; cursor: pointer; transition: all .15s; margin-top: 4px; }
.btn-add-row:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-pale); }

/* ── UNITS GRID ──────────────────────────────────────────── */
.units-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: 8px; margin-bottom: 14px; }
.unit-chip {
  border: 1.5px solid var(--border); border-radius: 8px; padding: 10px 6px;
  text-align: center; cursor: pointer; transition: all .15s; position: relative;
}
.unit-chip:hover { border-color: var(--brand); background: var(--brand-pale); }
.unit-chip.has-tpl { border-color: var(--brand); background: var(--brand-pale); }
.unit-chip .un  { font-weight: 700; font-size: .88rem; }
.unit-chip .ut  { font-size: .65rem; color: var(--brand); margin-top: 3px; line-height: 1.3; }
.unit-chip .ud  { position: absolute; top: 2px; right: 4px; background: none; border: none; color: var(--border-md); font-size: .8rem; cursor: pointer; line-height: 1; }
.unit-chip .ud:hover { color: var(--danger); }
.unit-chip.add  { border-style: dashed; color: var(--text-muted); display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 60px; }
.unit-chip.add:hover { border-color: var(--brand); color: var(--brand); }
.unit-chip.add .plus { font-size: 1.2rem; margin-bottom: 2px; }
.unit-chip.add span  { font-size: .68rem; font-weight: 600; }

/* ── SUMMARY ─────────────────────────────────────────────── */
.sum-section { margin-bottom: 20px; }
.sum-section-title { font-size: .82rem; font-weight: 700; color: var(--navy); margin-bottom: 10px; padding-bottom: 6px; border-bottom: 2px solid var(--brand-light); display: flex; align-items: center; gap: 8px; }
.grand-total-card { background: var(--navy); color: white; border-radius: var(--radius-lg); padding: 20px; }
.gt-row { display: flex; justify-content: space-between; align-items: center; padding: 5px 0; font-size: .85rem; }
.gt-row.total { border-top: 1px solid rgba(255,255,255,.2); margin-top: 8px; padding-top: 12px; font-size: 1rem; font-weight: 700; }
.gt-dim { opacity: .6; font-size: .78rem; }

/* ── BUTTONS ─────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px;
  border-radius: 6px; font-size: .82rem; font-weight: 600; border: none;
  cursor: pointer; transition: all .15s; text-decoration: none; white-space: nowrap;
}
.btn-primary   { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); }
.btn-secondary { background: var(--surface); color: var(--text); border: 1.5px solid var(--border); }
.btn-secondary:hover { background: var(--bg); border-color: var(--border-md); }
.btn-outline   { background: transparent; color: var(--brand); border: 1.5px solid var(--brand); }
.btn-outline:hover { background: var(--brand-pale); }
.btn-danger    { background: var(--danger-bg); color: var(--danger); border: 1.5px solid var(--danger-bd); }
.btn-danger:hover { background: var(--danger-bd); }
.btn-ghost     { background: transparent; color: var(--text-sec); border: none; padding: 6px 10px; }
.btn-ghost:hover { background: var(--bg); color: var(--text); }
.btn-sm { padding: 5px 11px; font-size: .76rem; }
.btn-xs { padding: 3px 8px; font-size: .7rem; }
.btn-icon-only { padding: 6px 8px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ── BADGES ──────────────────────────────────────────────── */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 20px; font-size: .7rem; font-weight: 600; white-space: nowrap; }
.bdg-green   { background: var(--success-bg); color: var(--success); }
.bdg-yellow  { background: var(--warning-bg); color: var(--warning); }
.bdg-red     { background: var(--danger-bg);  color: var(--danger); }
.bdg-blue    { background: var(--brand-light); color: var(--brand); }
.bdg-gray    { background: var(--bg); color: var(--text-sec); border: 1px solid var(--border); }
.bdg-warn    { background: var(--warning-bg); color: var(--warning); border: 1px solid var(--warning); }
.bdg-dot::before { content: '●'; font-size: .5rem; }

/* ── MODAL ───────────────────────────────────────────────── */
.modal-backdrop { display: none; position: fixed; inset: 0; background: rgba(15,23,42,.45); z-index: 400; backdrop-filter: blur(2px); }
.modal-backdrop.open { display: block; }
.modal-container { display: none; position: fixed; inset: 0; z-index: 401; pointer-events: none; align-items: flex-start; justify-content: center; padding: 40px 16px; overflow-y: auto; }
.modal-container.open { display: flex; pointer-events: auto; }
.modal {
  background: var(--surface); border-radius: var(--radius-lg); width: 100%;
  max-width: 520px; margin: auto; box-shadow: var(--shadow-lg); pointer-events: auto;
  border: 1px solid var(--border);
}
.modal.wide { max-width: 760px; }
.modal-hdr { padding: 18px 20px 14px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.modal-hdr h3 { font-size: .95rem; font-weight: 700; color: var(--text); }
.modal-close { background: none; border: none; color: var(--text-muted); font-size: 1.1rem; cursor: pointer; padding: 4px 6px; border-radius: 4px; line-height: 1; }
.modal-close:hover { background: var(--bg); color: var(--text); }
.modal-body { padding: 20px; }
.modal-foot { padding: 14px 20px; border-top: 1px solid var(--border); display: flex; gap: 8px; justify-content: flex-end; }

/* Upload zone */
.upload-zone {
  border: 2px dashed var(--border); border-radius: var(--radius); padding: 32px 20px;
  text-align: center; cursor: pointer; transition: all .15s; margin-bottom: 14px;
}
.upload-zone:hover, .upload-zone.drag { border-color: var(--brand); background: var(--brand-pale); }
.upload-zone .uz-ico { font-size: 2rem; margin-bottom: 8px; }
.upload-zone p { font-size: .82rem; color: var(--text-muted); }
.upload-zone input[type=file] { display: none; }

/* Import preview table */
.preview-wrap { max-height: 240px; overflow-y: auto; border: 1px solid var(--border); border-radius: 6px; }
.preview-table { width: 100%; border-collapse: collapse; font-size: .75rem; }
.preview-table th { background: var(--bg); padding: 6px 10px; text-align: left; font-weight: 600; color: var(--text-sec); position: sticky; top: 0; border-bottom: 1px solid var(--border); }
.preview-table td { padding: 5px 10px; border-bottom: 1px solid var(--border); color: var(--text-sec); }
.preview-table td:first-child { font-family: monospace; font-size: .72rem; }
.import-result { border-radius: 6px; padding: 12px 14px; font-size: .82rem; }
.import-ok  { background: var(--success-bg); color: var(--success); }
.import-err { background: var(--danger-bg); color: var(--danger); margin-top: 8px; }

/* ── INFO CALLOUT ────────────────────────────────────────── */
.callout { border-left: 3px solid var(--brand); border-radius: 6px; padding: 10px 14px; background: var(--brand-pale); font-size: .8rem; color: var(--text-sec); margin-bottom: 14px; }
.callout.warn { border-color: var(--warning); background: var(--warning-bg); }

/* ── SPINNER ─────────────────────────────────────────────── */
.spinner { display: inline-block; width: 16px; height: 16px; border: 2.5px solid rgba(255,255,255,.35); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.spinner.dark { border-color: rgba(37,99,235,.2); border-top-color: var(--brand); }

/* ── TOAST ───────────────────────────────────────────────── */
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--navy); color: #fff; padding: 10px 20px; border-radius: 20px; font-size: .82rem; font-weight: 500; z-index: 600; opacity: 0; transition: opacity .2s; pointer-events: none; white-space: nowrap; box-shadow: var(--shadow-md); }
.toast.show { opacity: 1; }

/* ── MISC ────────────────────────────────────────────────── */
.divider { border: none; border-top: 1px solid var(--border); margin: 16px 0; }
.label-section { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .7px; color: var(--text-muted); margin: 16px 0 8px; }
.info-note { font-size: .78rem; color: var(--text-muted); margin-top: 4px; }
.toggle-row { display: flex; align-items: center; gap: 8px; font-size: .82rem; color: var(--text-sec); margin-bottom: 14px; }
.toggle-row input[type=checkbox] { width: auto; accent-color: var(--brand); }

/* ── RESPONSIVE ──────────────────────────────────────────── */
@media (max-width: 768px) {
  :root { --sidebar-w: 0px; }
  .sidebar { display: none; }
  .main-content { padding: 16px; }
  .form-grid.c2, .form-grid.c3 { grid-template-columns: 1fr; }
  .door-row { grid-template-columns: 1fr 48px 48px 48px 48px 28px; }
  .page-hdr { flex-direction: column; }
}

@media print {
  .topnav, .editor-topbar, .sidebar, .page-hdr-actions, .btn-add-row,
  .rm-btn, .tbl-actions, .table-toolbar { display: none !important; }
  .app-shell { margin-top: 0; }
  .main-content { padding: 0; }
}
