/* ============================================================
   PSE Quote Tool — Application Stylesheet
   Design: GitHub-dark | IBM Plex Mono + IBM Plex Sans
   Updated: 2026-03-14
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500;600&family=IBM+Plex+Sans:wght@300;400;500;600&display=swap');

/* ── CSS Custom Properties ── */
:root {
  --bg:        #0d1117;
  --s1:        #161b22;
  --s2:        #1c2128;
  --s3:        #21262d;
  --s4:        #2d333b;
  --border:    #30363d;
  --border2:   #444c56;
  --blue:      #388bfd;
  --blue-bg:   rgba(56,139,253,.12);
  --green:     #3fb950;
  --green-bg:  rgba(63,185,80,.12);
  --yellow:    #d29922;
  --yellow-bg: rgba(210,153,34,.12);
  --red:       #f85149;
  --red-bg:    rgba(248,81,73,.12);
  --orange:    #db6d28;
  --text:      #e6edf3;
  --t2:        #8b949e;
  --t3:        #484f58;
  --mono:      'IBM Plex Mono', monospace;
  --sans:      'IBM Plex Sans', sans-serif;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg:        #ffffff;
    --s1:        #f6f8fa;
    --s2:        #eaeef2;
    --s3:        #d0d7de;
    --s4:        #b1bac4;
    --border:    #d0d7de;
    --border2:   #b1bac4;
    --blue:      #0969da;
    --blue-bg:   rgba(9,105,218,.08);
    --green:     #1a7f37;
    --green-bg:  rgba(26,127,55,.08);
    --yellow:    #9a6700;
    --yellow-bg: rgba(154,103,0,.08);
    --red:       #d1242f;
    --red-bg:    rgba(209,36,47,.08);
    --orange:    #bc4c00;
    --text:      #1f2328;
    --t2:        #57606a;
    --t3:        #b1bac4;
  }
}

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

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  font-size: 13px;
  line-height: 1.5;
}

/* ── App Shell ── */
.app-shell {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ── Sidebar ── */
.sidebar {
  width: 210px;
  flex-shrink: 0;
  background: var(--s1);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  height: 100vh;
}

.sidebar-logo {
  padding: 14px 14px 12px;
  border-bottom: 1px solid var(--border);
}
.sidebar-logo-mark {
  font-family: var(--mono);
  font-size: 17px;
  font-weight: 600;
  color: var(--blue);
}
.sidebar-logo-sub {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  color: var(--t3);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-top: 3px;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
}

.nav-section-label {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  color: var(--t3);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 10px 14px 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  margin: 1px 6px;
  border-radius: 6px;
  border: 1px solid transparent;
  font-size: 13px;
  font-family: var(--sans);
  font-weight: 500;
  color: var(--t2);
  cursor: pointer;
  text-decoration: none;
  transition: all .1s;
}
.nav-item:hover { background: var(--s2); color: var(--text); }
.nav-item.active {
  background: var(--blue-bg);
  color: var(--blue);
  border-color: rgba(56,139,253,.2);
}
.nav-icon { font-size: 13px; width: 16px; text-align: center; flex-shrink: 0; }

.sidebar-version {
  padding: 6px 14px;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--muted);
  text-align: center;
}

.sidebar-user {
  border-top: 1px solid var(--border);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
}
.sidebar-user:hover .user-name { color: var(--blue); }
.user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--blue-bg);
  border: 1px solid var(--blue);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--blue);
  flex-shrink: 0;
}
.user-info { flex: 1; min-width: 0; }
.user-name {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color .1s;
}
.user-role {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  color: var(--t3);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* ── Main Column ── */
.main-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

/* ── Top Bar ── */
.topbar {
  height: 50px;
  flex-shrink: 0;
  background: var(--s1);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 18px;
  gap: 12px;
}
.topbar-titles { flex: 1; min-width: 0; }
.topbar-title {
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.2;
  display: flex;
  align-items: center;
  gap: 8px;
}
.topbar-crumb {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  color: var(--t3);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-top: 1px;
}
.topbar-actions { display: flex; align-items: center; gap: 8px; }

/* ── Content Area ── */
.content {
  flex: 1;
  overflow-y: auto;
  padding: 18px;
  scrollbar-width: thin;
  scrollbar-color: var(--border2) transparent;
}
.content::-webkit-scrollbar { width: 5px; }
.content::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 3px; }

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  font-family: var(--sans);
  border: 1px solid var(--border2);
  background: var(--s2);
  color: var(--t2);
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: all .1s;
  line-height: 1.4;
}
.btn:hover { background: var(--s3); color: var(--text); }
.btn-primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn-primary:hover { background: #1f6feb; border-color: #1f6feb; color: #fff; }
.btn-danger { background: var(--red-bg); border-color: var(--red); color: var(--red); }
.btn-danger:hover { background: var(--red); color: #fff; }
.btn-sm  { padding: 4px 9px;  font-size: 11px; }
.btn-xs  { padding: 2px 7px;  font-size: 11px; }

/* ── Status Badges ── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  padding: 2px 7px;
  border-radius: 4px;
  white-space: nowrap;
}
.badge::before { content: '●'; font-size: 7px; line-height: 1; }
.b-gr { background: var(--green-bg); color: var(--green); }
.b-yw { background: var(--yellow-bg); color: var(--yellow); }
.b-rd { background: var(--red-bg); color: var(--red); }
.b-bl { background: var(--blue-bg); color: var(--blue); }
.b-gy { background: var(--s2); color: var(--t2); border: 1px solid var(--border); }

/* Role badges (no dot) */
.role-badge {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  padding: 2px 7px;
  border-radius: 4px;
  white-space: nowrap;
  display: inline-block;
}
.role-admin  { background: var(--blue-bg);  color: var(--blue);  border: 1px solid rgba(56,139,253,.3); }
.role-sales  { background: var(--green-bg); color: var(--green); border: 1px solid rgba(63,185,80,.3); }
.role-viewer { background: var(--s2);       color: var(--t2);    border: 1px solid var(--border); }

/* ── Table Wrapper ── */
.table-wrap {
  background: var(--s1);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: visible;
}

table { width: 100%; border-collapse: collapse; font-size: 12px; }
thead tr { background: var(--s2); }
thead th {
  padding: 9px 12px;
  text-align: left;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  color: var(--t3);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  white-space: nowrap;
}
tbody tr { border-bottom: 1px solid var(--border); transition: background .1s; }
tbody tr:last-child { border-bottom: none; }
tbody tr.clickable { cursor: pointer; }
tbody tr.clickable:hover { background: var(--s2); }
td { padding: 9px 12px; vertical-align: middle; }
td.mn  { font-family: var(--mono); font-size: 11px; color: var(--t2); }
td.pr  { color: var(--text); font-weight: 500; }
td.num { text-align: right; font-family: var(--mono); font-size: 11px; white-space: nowrap; }

/* ── Form Inputs ── */
.finp {
  width: 100%;
  background: var(--s2);
  border: 1px solid var(--border2);
  border-radius: 6px;
  padding: 6px 9px;
  color: var(--text);
  font-size: 13px;
  font-family: var(--sans);
  outline: none;
  transition: border-color .1s;
}
.finp:focus { border-color: var(--blue); }
.finp::placeholder { color: var(--t3); }
select.finp { cursor: pointer; }
textarea.finp { resize: vertical; }
.finp[readonly], .finp:read-only { background: var(--s3); color: var(--t2); }

.flabel {
  display: block;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  color: var(--t3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 4px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.form-grid .full { grid-column: 1 / -1; }
.form-group { display: flex; flex-direction: column; }

/* ── Input with Prefix ── */
.input-prefix { display: flex; }
.input-prefix-sym {
  background: var(--s3);
  border: 1px solid var(--border2);
  border-right: none;
  border-radius: 6px 0 0 6px;
  padding: 6px 8px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--t2);
  line-height: 1.5;
  flex-shrink: 0;
}
.input-prefix .finp { border-radius: 0 6px 6px 0; }

/* ── Stat Cards ── */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}
.stat-card {
  background: var(--s1);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 13px 15px;
}
.stat-card.blue  { border-color: var(--blue);  background: var(--blue-bg); }
.stat-card.green { border-color: var(--green); background: var(--green-bg); }
.stat-value { font-family: var(--mono); font-size: 24px; font-weight: 600; color: var(--text); }
.stat-card.blue  .stat-value { color: var(--blue); }
.stat-card.green .stat-value { color: var(--green); }
.stat-label { font-family: var(--mono); font-size: 10px; font-weight: 600; color: var(--t3); text-transform: uppercase; letter-spacing: 0.1em; margin-top: 2px; }
.stat-sub   { font-size: 11px; color: var(--t3); margin-top: 3px; }

/* ── Section Divider ── */
.section-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 14px 0 12px;
}
.section-divider::before,
.section-divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.section-divider span {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  color: var(--t3);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  white-space: nowrap;
}

/* ── Search Row ── */
.search-row {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  flex-wrap: wrap;
  background: var(--s1);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 14px;
}
.search-row .form-group { flex-shrink: 0; }

/* ── Pagination ── */
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-top: 1px solid var(--border);
  font-family: var(--mono);
  font-size: 11px;
  color: var(--t3);
}
.page-btns { display: flex; gap: 4px; }
.page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 28px;
  padding: 0 6px;
  border: 1px solid var(--border2);
  border-radius: 5px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--t2);
  background: var(--s2);
  cursor: pointer;
  text-decoration: none;
  transition: all .1s;
}
.page-btn:hover { background: var(--s3); color: var(--text); }
.page-btn.active { background: var(--blue); border-color: var(--blue); color: #fff; }
.page-btn.disabled { opacity: 0.35; pointer-events: none; }

/* ── Split View ── */
.split-view {
  display: flex;
  background: var(--s1);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  height: calc(100vh - 106px);
}
.split-list {
  width: 260px;
  flex-shrink: 0;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
}
.split-list-search { padding: 10px; border-bottom: 1px solid var(--border); }
.split-list-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 10px;
  border-bottom: 1px solid var(--border);
  font-family: var(--mono);
  font-size: 10px;
  color: var(--t3);
}
.split-list-scroll { flex: 1; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--border2) transparent; }
.split-list-scroll::-webkit-scrollbar { width: 4px; }
.split-list-scroll::-webkit-scrollbar-thumb { background: var(--border2); }

.list-item {
  display: block;
  padding: 9px 12px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  text-decoration: none;
  color: var(--text);
  transition: background .1s;
}
.list-item:last-child { border-bottom: none; }
.list-item:hover { background: var(--s2); }
.list-item.active { background: var(--blue-bg); border-left: 2px solid var(--blue); padding-left: 10px; }
.list-item-title { font-weight: 500; font-size: 13px; }
.list-item.active .list-item-title { color: var(--blue); }
.list-item-sub { font-size: 11px; color: var(--t2); margin-top: 2px; font-family: var(--mono); }
.list-item.inactive { opacity: 0.55; }

.split-form {
  flex: 1;
  overflow-y: auto;
  padding: 18px 20px;
  scrollbar-width: thin;
  scrollbar-color: var(--border2) transparent;
}
.split-form-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.split-form-title { font-family: var(--mono); font-size: 14px; font-weight: 600; color: var(--text); }
.split-form-sub   { font-family: var(--mono); font-size: 10px; color: var(--t3); margin-top: 2px; }
.split-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--t3);
}

/* ── Modal ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.65);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-overlay.hidden { display: none; }
.modal {
  background: var(--s1);
  border: 1px solid var(--border2);
  border-radius: 10px;
  width: 580px;
  max-width: 100%;
  box-shadow: 0 20px 60px rgba(0,0,0,.6);
  overflow: hidden;
}
.modal-sm { width: 440px; }
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}
.modal-title { font-family: var(--mono); font-size: 14px; font-weight: 600; color: var(--text); }
.modal-close { background: none; border: none; color: var(--t2); font-size: 18px; cursor: pointer; padding: 0; line-height: 1; }
.modal-close:hover { color: var(--text); }
.modal-body { padding: 18px; }
.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 18px;
  border-top: 1px solid var(--border);
  background: var(--s2);
}

/* ── Line Items Table ── */
.line-table th { padding: 7px 8px; font-size: 10px; }
.line-table td { padding: 4px 5px; vertical-align: middle; }
.line-table .finp { padding: 4px 7px; font-size: 12px; }
.ext-val { font-family: var(--mono); font-size: 11px; font-weight: 600; text-align: right; white-space: nowrap; padding: 4px 8px; }
.ext-val.gn { color: var(--green); }
.ext-val.bl { color: var(--blue); }
.del-row-btn {
  background: none; border: none; color: var(--t3);
  cursor: pointer; padding: 3px 6px; border-radius: 4px; font-size: 15px; line-height: 1;
}
.del-row-btn:hover { color: var(--red); background: var(--red-bg); }

/* ── Totals Bar ── */
.totals-bar {
  display: flex;
  justify-content: flex-end;
  gap: 24px;
  padding: 10px 14px;
  border-top: 1px solid var(--border);
  background: var(--s2);
}
.total-item { display: flex; align-items: center; gap: 10px; }
.total-label { font-family: var(--mono); font-size: 10px; font-weight: 600; color: var(--t3); text-transform: uppercase; letter-spacing: 0.08em; }
.total-value { font-family: var(--mono); font-size: 16px; font-weight: 600; }
.total-value.gn { color: var(--green); }
.total-value.bl { color: var(--blue); }

/* ── Autocomplete ── */
.ac-wrap { position: relative; }
.ac-list {
  position: absolute;
  top: 100%; left: 0;
  min-width: 500px;
  background: var(--s1);
  border: 1px solid var(--blue);
  border-top: none;
  border-radius: 0 0 6px 6px;
  z-index: 50;
  max-height: 400px;
  overflow-y: auto;
  display: none;
}
.ac-list.open { display: block; }
.ac-item { padding: 8px 10px; cursor: pointer; border-bottom: 1px solid var(--border); }
.ac-item:last-child { border-bottom: none; }
.ac-item:hover, .ac-item.focused { background: var(--s2); }
.ac-main { font-size: 12px; font-weight: 600; color: var(--text); }
.ac-desc { font-size: 12px; color: var(--text); margin-top: 2px; }
.ac-sub  { font-size: 11px; color: var(--t2); font-family: var(--mono); margin-top: 2px; }

/* ── Discount Row ── */
.discount-row { display: flex; align-items: center; gap: 14px; margin-top: 10px; }
.check-group { display: flex; align-items: center; gap: 6px; }
.check-group input[type="checkbox"] { width: 14px; height: 14px; accent-color: var(--blue); flex-shrink: 0; }
.check-group label { font-size: 13px; font-weight: 500; color: var(--text); cursor: pointer; }

/* ── Info Box ── */
.info-box {
  background: var(--blue-bg);
  border: 1px solid rgba(56,139,253,.25);
  border-radius: 6px;
  padding: 10px 14px;
}
.info-box-label { font-family: var(--mono); font-size: 10px; font-weight: 600; color: var(--t3); text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 4px; }
.info-box-value { font-family: var(--mono); font-size: 18px; font-weight: 600; color: var(--blue); }

/* ── Alert Banners ── */
.alert-error {
  background: var(--red-bg);
  border: 1px solid var(--red);
  border-radius: 6px;
  padding: 9px 12px;
  font-size: 12px;
  color: var(--red);
  margin-bottom: 14px;
}
.alert-success {
  background: var(--green-bg);
  border: 1px solid var(--green);
  border-radius: 6px;
  padding: 9px 12px;
  font-size: 12px;
  color: var(--green);
  margin-bottom: 14px;
}

/* ── Login Page ── */
.login-shell {
  min-height: 100vh;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.login-card {
  background: var(--s1);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 36px 32px;
  width: 360px;
  max-width: 100%;
  box-shadow: 0 20px 60px rgba(0,0,0,.4);
}
.login-mark {
  font-family: var(--mono);
  font-size: 20px;
  font-weight: 600;
  color: var(--blue);
  text-align: center;
  margin-bottom: 3px;
}
.login-sub {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  color: var(--t3);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  text-align: center;
  margin-bottom: 28px;
}
.login-fg { margin-bottom: 14px; }
.login-footer {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--t3);
  text-align: center;
  margin-top: 22px;
  line-height: 1.6;
}

/* ── Editor Form Row Grids ──
   Defined as classes so the mobile media query can override them.
   Replaces the inline grid styles on the two header rows in editor.html. */
.editor-row-1 {
  display: grid;
  grid-template-columns: 2fr 100px 130px 130px;
  gap: 12px;
  margin-bottom: 12px;
}
.editor-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr 2fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}

/* ── Split-View Outer Wrapper ──
   Replaces the inline style="flex:1; overflow:hidden; padding:14px;"
   on the split-view container in customers, items, and users pages. */
.split-outer {
  flex: 1;
  overflow: hidden;
  padding: 14px;
}

/* ── Mobile Navigation ── */

/* Hamburger button — hidden on desktop, shown via media query on mobile */
.mob-menu-btn {
  display: none;
  background: none;
  border: none;
  color: var(--text);
  font-size: 20px;
  cursor: pointer;
  padding: 4px 6px;
  line-height: 1;
  flex-shrink: 0;
}

/* Backdrop overlay behind the open sidebar drawer */
.mob-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  z-index: 99;
  cursor: pointer;
}
.mob-backdrop.open { display: block; }

/* ── Responsive: ≤768px ── */
@media (max-width: 768px) {

  /* Show hamburger button */
  .mob-menu-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  /* Sidebar: slide-in drawer from left */
  .sidebar {
    position: fixed;
    top: 0;
    left: -220px;
    height: 100vh;
    z-index: 100;
    transition: left .2s ease;
  }
  .sidebar.mob-open {
    left: 0;
    box-shadow: 4px 0 20px rgba(0,0,0,.5);
  }

  /* Topbar: allow buttons to wrap to a second row */
  .topbar {
    height: auto;
    min-height: 50px;
    padding: 8px 12px;
    flex-wrap: wrap;
    gap: 6px;
  }
  .topbar-actions { flex-wrap: wrap; gap: 6px; }

  /* Content: tighter padding */
  .content { padding: 12px; }

  /* Table wrap: horizontal scroll for wide tables */
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

  /* Autocomplete: positioning and sizing handled by JS on mobile so the dropdown
     escapes the overflow-x scroll container. CSS sets z-index, height cap,
     and improves readability of part number / description / model lines. */
  .ac-list { z-index: 200; max-height: 55vh; }
  .ac-item { padding: 12px 14px; }
  .ac-main { font-size: 14px; }
  .ac-desc { font-size: 13px; margin-top: 4px; }
  .ac-sub  { font-size: 12px; margin-top: 3px; }

  /* Line-items table: wider Model and Description columns on mobile */
  .line-table thead th:nth-child(2) { width: 160px !important; }
  .line-table thead th:nth-child(3) { min-width: 240px; }

  /* Form grids: single column */
  .form-grid { grid-template-columns: 1fr; }

  /* Editor header rows: 2-column on mobile */
  .editor-row-1 { grid-template-columns: 1fr 1fr; }
  .editor-row-2 { grid-template-columns: 1fr 1fr; }

  /* Search row: stack inputs vertically */
  .search-row { flex-direction: column; align-items: stretch; }
  .search-row .form-group { min-width: 0 !important; width: 100%; }

  /* Split-view outer: switch from hidden to scrollable */
  .split-outer { overflow-y: auto; }

  /* Split view: stack list above form */
  .split-view { flex-direction: column; height: auto; }
  .split-list {
    width: 100% !important;
    height: 220px;
    flex-shrink: 0;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  .split-form { min-height: 300px; }

  /* Pagination: stack info above buttons */
  .pagination { flex-direction: column; gap: 8px; align-items: center; }

  /* Totals bar: stack totals vertically */
  .totals-bar { flex-direction: column; gap: 10px; align-items: flex-end; }

  /* Touch targets — minimum 36px height for buttons, 40px for inputs */
  .btn-sm  { min-height: 36px; padding: 7px 12px; }
  .page-btn { min-width: 36px; height: 36px; }
  .nav-item { min-height: 44px; padding: 10px 12px; }
  .finp    { min-height: 40px; }
}

/* ── Utilities ── */
.hidden  { display: none !important; }
.mb-10   { margin-bottom: 10px; }
.mb-14   { margin-bottom: 14px; }
.mt-10   { margin-top: 10px; }
.mt-14   { margin-top: 14px; }
.required { color: var(--red); }
.text-gn  { color: var(--green); }
.text-bl  { color: var(--blue); }
.text-t2  { color: var(--t2); }
.text-t3  { color: var(--t3); }
.text-mono { font-family: var(--mono); }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-8 { gap: 8px; }
.w-full { width: 100%; }
