*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  /* 3B Base */
  --bg: #f2f2f7; --surface: #ffffff; --surface2: #e8e8ed;
  --border: #e8e8ed; --border2: #d1d1d6;
  --text: #000000; --text2: #3c3c43; --text3: #8e8e93;
  /* Blue — orders / links */
  --blue: #185FA5; --blue-bg: #E6F1FB; --blue-border: #B5D4F4;
  /* Green — money / approval */
  --green-bg: #EAF3DE; --green-text: #27500A; --green-border: #C0DD97;
  /* Amber — due soon */
  --amber-bg: #FFF7EE; --amber-text: #854F0B; --amber-dark: #633806;
  /* Red — urgent */
  --red-bg: #FEF0F0; --red-text: #E02020; --red-border: #F09595;
  /* Purple — quotes */
  --purple-bg: #EEEDFE; --purple-text: #3C3489; --purple-border: #AFA9EC;
  /* Teal — customer communication */
  --teal: #0E7490; --teal-bg: #ECFEFF; --teal-border: #A5F3FC;
  /* Draft — slate */
  --draft-bg: #F1F5F9; --draft-text: #475569; --draft-border: #CBD5E1;
  /* Gray — future dates */
  --gray-badge: #78716C; --gray-bg: #f5f4f0; --gray-border: #d3d1c7;
  --radius: 8px; --radius-lg: 12px;
}
body { font-family: system-ui,-apple-system,sans-serif; background: var(--bg); color: var(--text); font-size: 14px; height: 100vh; overflow: hidden; display: flex; flex-direction: column; }

/* ── Loading ── */
#loading { position: fixed; inset: 0; background: var(--surface); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; z-index: 9999; }
#loading.hidden { display: none; }
.spinner { width: 32px; height: 32px; border: 3px solid var(--border); border-top-color: var(--blue); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 0%,100%{opacity:1}50%{opacity:.4} }

/* ── Header ── */
.app-header { padding: 0 16px; background: #ffffff; border-bottom: 1px solid #e5e5ea; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; flex-shrink: 0; height: 48px; }
.header-left { display: flex; align-items: center; gap: 8px; }
.header-center { display: flex; justify-content: center; }
.header-right { display: flex; align-items: center; gap: 8px; justify-content: flex-end; }
.sync-indicator { font-size: 11px; color: var(--text3); display: flex; align-items: center; gap: 5px; }
.sync-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--green-text); }
.sync-dot.syncing { background: #BA7517; animation: pulse 1s ease-in-out infinite; }
.nav-btn { font-size: 12px; padding: 6px 14px; border-radius: var(--radius); cursor: pointer; font-family: inherit; transition: all .15s; white-space: nowrap; border: 1px solid #d1d1d6; background: #ffffff; color: #3c3c43; font-weight: 500; }
.nav-btn:hover { background: #f2f2f7; color: #000; }
.nav-btn.active { background: var(--blue-bg); border-color: var(--blue-border); color: var(--blue); font-weight: 600; }
.nav-btn.primary { background: var(--blue-bg); border-color: var(--blue-border); color: var(--blue); font-weight: 600; }
.nav-btn.primary:hover { background: var(--blue-border); }
.nav-btn.quote { background: var(--purple-bg); border-color: var(--purple-border); color: var(--purple-text); font-weight: 600; }
.nav-btn.quote:hover { background: #CECBF6; }
.nav-btn.order { background: var(--green-bg); border-color: var(--green-border); color: var(--green-text); font-weight: 600; }
.nav-btn.order:hover { background: var(--green-border); }
.nav-divider { width: 1px; height: 24px; background: var(--border); margin: 0 4px; }

/* ── Notification bar ── */


/* ── Views ── */
#view-jobboard, #view-quotes, #view-orders, #view-customers { flex: 1; overflow: hidden; display: none; flex-direction: column; }
#view-jobboard.active, #view-quotes.active, #view-orders.active, #view-customers.active { display: flex; }

/* ── Orders view ── */
.orders-list-panel { width: 280px; flex-shrink: 0; background: #f9f9fb; border-right: 1px solid #e8e8ed; display: flex; flex-direction: column; overflow: hidden; }
.orders-scroll { flex: 1; overflow-y: auto; padding-top: 7px; }
.order-row { background: #ffffff; border: 1px solid #e8e8ed; border-radius: 8px; padding: 8px 10px; margin: 0 7px 5px; cursor: pointer; transition: border-color .1s, box-shadow .1s; }
.order-row:hover { border-color: #c7c7cc; }
.order-row.active { border-color: #007AFF; border-width: 1.5px; background: #EDF5FF; }
.or-top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 3px; }
.or-num { font-size: 10px; font-weight: 700; color: #185FA5; }
.or-total { font-size: 13px; font-weight: 600; color: var(--green-text); }
.or-customer { font-size: 12px; font-weight: 700; color: #000; margin-bottom: 3px; }
.or-meta { display: flex; align-items: center; gap: 10px; }
.or-progress-wrap { display: flex; align-items: center; gap: 6px; flex: 1; }
.or-progress-bar { height: 4px; background: var(--border); border-radius: 2px; overflow: hidden; width: 70px; }
.or-progress-fill { height: 100%; border-radius: 2px; background: var(--blue); }
.or-progress-fill.complete { background: var(--green-text); }
.or-progress-txt { font-size: 11px; color: var(--text3); }
.orders-detail { flex: 1; overflow-y: auto; padding: 24px; display: flex; flex-direction: column; gap: 16px; }
.orders-detail.empty { align-items: center; justify-content: center; color: var(--text3); font-size: 13px; }
.od-header { display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 12px; }
.od-num { font-size: 12px; color: var(--text3); margin-bottom: 4px; }
.od-customer { font-size: 22px; font-weight: 600; }
.od-meta { font-size: 13px; color: var(--text2); margin-top: 4px; display: flex; gap: 16px; flex-wrap: wrap; }
.od-job-card { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 13px; margin-bottom: 8px; display: flex; align-items: center; gap: 12px; cursor: pointer; }
.od-job-card:last-child { margin-bottom: 0; }
.od-job-card:hover { border-color: var(--border2); }
.od-job-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.od-job-info { flex: 1; }
.od-job-name { font-size: 13px; font-weight: 600; }
.od-job-sub { font-size: 11px; color: var(--text2); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.od-status-pill { font-size: 10px; padding: 3px 8px; border-radius: 8px; white-space: nowrap; }

/* ══ JOB BOARD ══ */
.jb-toolbar { padding: 8px 16px; background: var(--surface); border-bottom: 1px solid var(--border); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; flex-shrink: 0; }
.filter-select, .search-input { font-size: 12px; padding: 5px 10px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--text); cursor: pointer; font-family: inherit; }
.search-input { width: 200px; cursor: text; }
.filter-select:focus, .search-input:focus { outline: none; border-color: var(--blue); }
.clear-btn { font-size: 11px; color: var(--blue); cursor: pointer; background: none; border: none; padding: 0; display: none; }
.clear-btn.visible { display: inline; }
.view-toggle-btn { font-size: 12px; padding: 5px 13px; border: 1px solid var(--border2); border-radius: var(--radius); cursor: pointer; background: transparent; color: var(--text2); transition: all .15s; }
.view-toggle-btn.active, .view-toggle-btn:hover { background: var(--surface2); color: var(--text); }

#jb-main { flex: 1; overflow: hidden; display: flex; }
.board-wrap { flex: 1; overflow-x: auto; overflow-y: hidden; padding: 12px 16px; background: #f2f2f7; }
.board { display: flex; gap: 10px; height: 100%; }
.col { flex: 1; min-width: 186px; max-width: 280px; background: #ffffff; border-radius: var(--radius-lg); padding: 10px; border: none; box-shadow: 0 1px 4px rgba(0,0,0,.06); display: flex; flex-direction: column; }
.col-header { font-size: 9px; font-weight: 700; color: #8e8e93; text-transform: uppercase; letter-spacing: .07em; margin-bottom: 8px; display: flex; justify-content: space-between; align-items: center; flex-shrink: 0; padding-bottom: 7px; border-bottom: 1px solid #f2f2f7; }
.col-count { background: #f2f2f7; border: none; border-radius: 20px; padding: 1px 6px; font-size: 9px; color: #8e8e93; }
.col-cards { overflow-y: auto; flex: 1; padding-bottom: 4px; }
.col-cards.drag-over { background: var(--blue-bg); border-radius: var(--radius); outline: 2px dashed var(--blue-border); outline-offset: -2px; }
.card { background: #ffffff; border: 1px solid #e8e8ed; border-radius: var(--radius); padding: 9px 10px; margin-bottom: 6px; cursor: grab; transition: border-color .15s, box-shadow .15s; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.card:hover { border-color: #c7c7cc; box-shadow: 0 2px 8px rgba(0,0,0,.1); }
.card.red { background: #FEF0F0; border-color: #F09595; }
.card.amb { background: #FFF7EE; border-color: #F5C97E; }
.card.hold { border-left: 3px solid #BA7517; }
.card.dragging { opacity: .4; cursor: grabbing; }
.card-name { font-size: 12px; font-weight: 600; margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-meta { font-size: 11px; color: var(--text2); display: flex; flex-direction: column; gap: 3px; }
.card-row { display: flex; justify-content: space-between; align-items: center; gap: 4px; }
.badge { font-size: 10px; padding: 2px 7px; border-radius: 10px; white-space: nowrap; line-height: 1.4; }
.due-green  { background: #3D8B2F; color: #fff; font-weight: 600; }
.due-yellow { background: #EAB000; color: #fff; font-weight: 600; }
.due-orange { background: #EAB000; color: #fff; font-weight: 600; }
.due-red    { background: #E02020; color: #fff; font-weight: 600; }
.due-gray   { background: #78716C; color: #fff; font-weight: 600; }
.badge-hold { background: var(--amber-bg); color: var(--amber-text); }
.avatar { width: 16px; height: 16px; border-radius: 50%; font-size: 8px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.av-iris { background: #6D3D91; color: #fff; }
.av-jack { background: #EA6C1A; color: #fff; }
.av-0 { background: #185FA5; color: #fff; }
.list-wrap { flex: 1; overflow: auto; padding: 12px 16px; display: none; }
.list-table { width: 100%; border-collapse: collapse; background: var(--surface); border-radius: var(--radius-lg); overflow: hidden; border: 1px solid var(--border); font-size: 13px; }
.list-table th { font-size: 11px; font-weight: 600; color: var(--text2); text-align: left; padding: 8px 12px; border-bottom: 1px solid var(--border); background: var(--bg); white-space: nowrap; cursor: pointer; user-select: none; }
.list-table th:hover { color: var(--text); }
.list-table td { padding: 9px 12px; border-bottom: 1px solid var(--surface2); vertical-align: middle; }
.list-table tr:last-child td { border-bottom: none; }
.list-table tr:hover td { background: var(--bg); cursor: pointer; }
.status-pill { font-size: 10px; padding: 3px 8px; border-radius: 10px; white-space: nowrap; background: var(--surface2); color: var(--text2); }

/* Job detail panel */
.detail-panel { display: none; position: fixed; inset: 0; z-index: 300; align-items: center; justify-content: center; background: rgba(0,0,0,0.32); }
.dp-hdr { padding: 12px 13px 9px; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.dp-hdr-top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 4px; }
.dp-customer { font-size: 15px; font-weight: 600; color: var(--text1); }
.dp-tiles { display: flex; gap: 5px; margin-bottom: 6px; }
.dp-tile-product { background: var(--bg); border-radius: var(--radius); padding: 5px 8px; flex: 1; min-width: 0; }
.dp-tile-qty { background: var(--bg); border-radius: var(--radius); padding: 5px 8px; width: 52px; flex-shrink: 0; }
.dp-tile-price { background: var(--bg); border-radius: var(--radius); padding: 5px 8px; flex-shrink: 0; }
.dp-tile-label { font-size: 9px; color: var(--text3); margin-bottom: 1px; }
.dp-tile-val { font-size: 12px; font-weight: 600; color: var(--text1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dp-badges { display: flex; gap: 5px; flex-wrap: wrap; align-items: center; }
.dp-status-row { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.dp-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.dp-chip { background: var(--bg); border: 1px solid var(--border); border-radius: 5px; padding: 3px 7px; }
.dp-chip-label { font-size: 9px; color: var(--text3); line-height: 1; margin-bottom: 1px; }
.dp-chip-val { font-size: 11px; font-weight: 500; color: var(--text1); line-height: 1.2; }
.dp-notes { width: 100%; font-size: 12px; padding: 7px 9px; border: 1px solid var(--border); border-radius: var(--radius); font-family: inherit; resize: none; min-height: 34px; overflow: hidden; line-height: 1.5; background: var(--surface); color: var(--text1); }
.dp-activity { display: flex; flex-direction: column; gap: 4px; }
.dp-act-item { display: flex; gap: 7px; font-size: 11px; color: var(--text2); align-items: flex-start; }
.dp-act-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--border2); flex-shrink: 0; margin-top: 3px; }
.dp-linked-expand { background: var(--blue-bg); border: 1px solid var(--blue-border); border-radius: var(--radius); padding: 6px 10px; margin-top: 4px; display: flex; flex-direction: column; gap: 3px; }
.dp-linked-job { font-size: 11px; color: var(--blue); cursor: pointer; padding: 3px 0; border-bottom: 1px solid var(--blue-border); display: flex; align-items: center; gap: 5px; }
.dp-linked-job:last-child { border-bottom: none; }
.dp-linked-job:hover { text-decoration: underline; }
.dp-linked-current { font-weight: 600; color: var(--blue); background: var(--blue-bg); border-radius: 4px; padding: 3px 5px; }
.detail-panel.open { display: flex; } .dp-inner { background: var(--surface); border-radius: 12px; border: 1px solid var(--border); width: 440px; max-width: calc(100vw - 32px); height: 560px; max-height: calc(100vh - 64px); display: flex; flex-direction: column; overflow: hidden; box-shadow: 0 8px 32px rgba(0,0,0,0.18); }
.detail-header { padding: 14px 16px; border-bottom: 1px solid var(--border); display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; flex-shrink: 0; }
.detail-title { font-size: 15px; font-weight: 600; }
.detail-sub { font-size: 12px; color: var(--text2); margin-top: 2px; }
.close-btn { font-size: 20px; line-height: 1; cursor: pointer; color: var(--text3); background: none; border: none; padding: 2px; flex-shrink: 0; }
.close-btn:hover { color: var(--text); }
.detail-body { flex: 1; overflow-y: auto; padding: 14px 16px; display: flex; flex-direction: column; gap: 16px; }
.detail-section { display: flex; flex-direction: column; gap: 6px; }
.section-label { font-size: 10px; font-weight: 600; color: var(--text3); text-transform: uppercase; letter-spacing: .06em; }
.detail-select, .detail-input, .detail-textarea { font-size: 12px; padding: 7px 10px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--text); width: 100%; font-family: inherit; }
.detail-select:focus, .detail-input:focus, .detail-textarea:focus { outline: none; border-color: var(--blue); }
.detail-textarea { resize: vertical; min-height: 56px; }
.spec-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.spec-item { background: var(--bg); border-radius: var(--radius); padding: 7px 10px; border: 1px solid var(--border); }
.spec-key { font-size: 10px; color: var(--text3); margin-bottom: 2px; }
.spec-val { font-size: 12px; font-weight: 600; }
.approval-badge { font-size: 12px; padding: 4px 12px; border-radius: var(--radius); display: inline-block; }
.approved { background: var(--green-bg); color: var(--green-text); }
.pending-approval { background: var(--amber-bg); color: var(--amber-text); }
.note-item { background: var(--bg); border-radius: var(--radius); padding: 8px 10px; border: 1px solid var(--border); }
.note-text { font-size: 12px; line-height: 1.5; }
.activity-item { display: flex; gap: 8px; font-size: 12px; }
.activity-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--border2); margin-top: 4px; flex-shrink: 0; }
.activity-text { color: var(--text2); line-height: 1.5; }
.detail-footer { padding: 10px 13px; border-top: 1px solid var(--border); display: flex; flex-shrink: 0; align-items: center; }

/* ══ QUOTE BUILDER ══ */
.qb-toolbar { padding: 8px 16px; background: var(--surface); border-bottom: 1px solid var(--border); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; flex-shrink: 0; }
.count-label { font-size: 12px; color: var(--text3); margin-left: auto; }
#qb-main { flex: 1; overflow: hidden; display: flex; }
.list-panel { width: 280px; flex-shrink: 0; border-right: 1px solid #e8e8ed; display: flex; flex-direction: column; overflow: hidden; background: #f9f9fb; }
.list-scroll { flex: 1; overflow-y: auto; padding-top: 7px; }
.quote-row { background: #ffffff; border: 1px solid #e8e8ed; border-radius: 8px; padding: 8px 10px; margin: 0 7px 5px; cursor: pointer; transition: border-color .1s; }
.quote-row:hover { border-color: #c7c7cc; }
.quote-row.active { border-color: #007AFF; border-width: 1.5px; background: #EDF5FF; }
.qr-number { font-size: 10px; font-weight: 700; color: #3C3489; margin-bottom: 2px; display: flex; justify-content: space-between; align-items: center; }
.qr-customer { font-size: 12px; font-weight: 700; color: #000; margin-bottom: 2px; }
.qr-meta { font-size: 11px; color: var(--text2); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.q-status-badge { font-size: 10px; padding: 2px 7px; border-radius: 8px; white-space: nowrap; }
.s-draft { background: #F1F5F9; color: #475569; border: 1px solid #CBD5E1; }
.s-sent { background: #ECFEFF; color: #0E7490; border: 1px solid #A5F3FC; }
.s-approved { background: var(--green-bg); color: var(--green-text); }
.s-declined { background: var(--red-bg); color: var(--red-text); }
.s-expired { background: var(--amber-bg); color: var(--amber-text); }
.s-converted { background: var(--green-bg); color: var(--green-text); }
.t-badge { font-size: 10px; padding: 2px 6px; border-radius: 6px; }
.t-quote { background: var(--purple-bg); color: var(--purple-text); }
.t-order { background: var(--green-bg); color: var(--green-text); }
.empty-list { padding: 32px 16px; text-align: center; color: var(--text3); font-size: 13px; }
.qb-detail { flex: 1; overflow-y: auto; padding: 20px 24px 40px; display: flex; flex-direction: column; gap: 16px; }
.qb-detail.empty { align-items: center; justify-content: center; color: var(--text3); font-size: 13px; }
.section-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.section-title { font-size: 11px; font-weight: 600; color: var(--text3); text-transform: uppercase; letter-spacing: .06em; }
.item-card { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 13px; display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.item-card-left { display: flex; flex-direction: column; gap: 3px; flex: 1; min-width: 0; }
.item-card-name { font-size: 13px; font-weight: 600; }
.item-card-specs { font-size: 11px; color: var(--text2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item-card-actions { display: flex; gap: 6px; align-items: center; flex-shrink: 0; }
.item-card-price { font-size: 13px; font-weight: 600; color: var(--green-text); white-space: nowrap; }
.item-edit-btn { font-size: 11px; padding: 3px 9px; border-radius: var(--radius); border: 1px solid var(--border2); background: var(--surface); color: var(--text2); cursor: pointer; }
.item-edit-btn:hover { background: var(--surface2); }
.item-del-btn { font-size: 17px; line-height: 1; color: var(--text3); cursor: pointer; background: none; border: none; padding: 2px 4px; }
.item-del-btn:hover { color: var(--red-text); }
.add-item-btn { display: flex; align-items: center; justify-content: center; padding: 9px; border: 1.5px dashed var(--border2); border-radius: var(--radius); cursor: pointer; color: var(--text3); font-size: 12px; background: none; width: 100%; font-family: inherit; transition: all .15s; }
.add-item-btn:hover { border-color: var(--blue); color: var(--blue); background: var(--blue-bg); }
.totals-row { display: flex; justify-content: space-between; align-items: center; font-size: 13px; padding: 3px 0; }
.totals-row.grand { font-size: 15px; font-weight: 600; border-top: 1px solid var(--border); margin-top: 4px; padding-top: 10px; }
.approved-bar { background: var(--green-bg); border: 1px solid var(--green-border); border-radius: var(--radius); padding: 10px 14px; font-size: 13px; color: var(--green-text); }

/* ── Shared buttons ── */
.action-btn { font-size: 12px; padding: 7px 14px; border-radius: var(--radius); cursor: pointer; font-family: inherit; transition: all .15s; white-space: nowrap; }
.btn-primary { background: var(--blue-bg); color: var(--blue); border: 1px solid var(--blue-border); font-weight: 600; }
.btn-primary:hover { background: var(--blue-border); }
.btn-secondary { background: var(--surface); color: var(--text2); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--bg); }
.btn-success { background: var(--green-bg); color: var(--green-text); border: 1px solid var(--green-border); font-weight: 600; }
.btn-success:hover { background: var(--green-border); }
.btn-danger { background: var(--red-bg); color: var(--red-text); border: 1px solid #F7C1C1; }
.btn-danger:hover { background: #F7C1C1; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }

/* ── Modals ── */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.35); display: none; align-items: center; justify-content: center; z-index: 1000; }
.modal-overlay.open { display: flex; }
.modal { background: var(--surface); border-radius: var(--radius-lg); width: 540px; max-width: 95vw; max-height: 96vh; display: flex; flex-direction: column; overflow: hidden; }
.modal-header { padding: 14px 20px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; flex-shrink: 0; }
.modal-title { font-size: 15px; font-weight: 600; }
.modal-body { padding: 18px 20px; overflow-y: auto; display: flex; flex-direction: column; gap: 13px; flex: 1; }
.modal-footer { padding: 12px 20px; border-top: 1px solid var(--border); display: flex; gap: 8px; justify-content: flex-end; flex-shrink: 0; }
.form-row { display: flex; flex-direction: column; gap: 4px; }
.form-row label { font-size: 11px; font-weight: 600; color: var(--text2); }
.form-row input, .form-row select, .form-row textarea { font-size: 13px; padding: 7px 10px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--text); font-family: inherit; width: 100%; }
.form-row input:focus, .form-row select:focus, .form-row textarea:focus { outline: none; border-color: var(--blue); }
.form-row textarea { resize: vertical; min-height: 60px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.form-section-label { font-size: 10px; font-weight: 600; color: var(--text3); text-transform: uppercase; letter-spacing: .06em; padding-top: 6px; border-top: 1px solid var(--surface2); }
.custom-size-wrap { margin-top: 6px; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 12px; display: flex; align-items: center; gap: 8px; }
.custom-size-wrap input[type=number] { width: 80px; flex-shrink: 0; font-size: 13px; padding: 6px 8px; border: 1px solid var(--border); border-radius: var(--radius); font-family: inherit; color: var(--text); background: var(--surface); }
.custom-size-wrap input[type=number]:focus { outline: none; border-color: var(--blue); }
.custom-size-wrap span { font-size: 13px; color: var(--text3); flex-shrink: 0; }
.custom-size-wrap select { font-size: 12px; padding: 6px 8px; border: 1px solid var(--border); border-radius: var(--radius); font-family: inherit; color: var(--text); background: var(--surface); }
/* Searchable product dropdown */
/* ── Item modal — 3B style ── */
.prod-search-wrap { position: relative; }
.prod-search-input { width: 100%; font-size: 12px; padding: 7px 30px 7px 10px; border: 1px solid #e8e8ed; border-radius: 8px; background: #fff; color: #000; font-family: inherit; }
.prod-search-input.dd-open { border-radius: 8px 8px 0 0; border-bottom-color: transparent; }
.prod-search-input:focus { outline: none; border-color: #007AFF; }
.prod-search-clear { position: absolute; right: 9px; top: 50%; transform: translateY(-50%); font-size: 15px; color: #8e8e93; cursor: pointer; background: none; border: none; line-height: 1; display: none; }
.prod-search-clear.visible { display: block; }
/* Dropdown */
.prod-dropdown { display: none; background: #fff; border: 1px solid #e8e8ed; border-top: none; border-radius: 0 0 8px 8px; max-height: 280px; overflow-y: auto; margin-top: -1px; box-shadow: 0 6px 20px rgba(0,0,0,.1); }
.prod-dropdown.open { display: block; }
/* Category rows */
.prod-cat-row { display: flex; align-items: center; justify-content: space-between; padding: 9px 12px; cursor: pointer; border-bottom: 1px solid #e5e5ea; font-size: 12px; font-weight: 600; color: #3c3c43; user-select: none; }
.prod-cat-row:hover { background: #f2f2f7; }
.prod-cat-row.open { background: #E6F1FB; color: #185FA5; }
.prod-cat-right { display: flex; align-items: center; gap: 8px; }
.prod-cat-count { font-size: 10px; color: #8e8e93; font-weight: 400; }
.prod-cat-chev { font-size: 11px; color: #8e8e93; transition: transform .15s; }
.prod-cat-row.open .prod-cat-chev { transform: rotate(90deg); color: #185FA5; }
/* Products within a category */
.prod-cat-items { background: #fafafa; }
.prod-cat-item { display: flex; align-items: center; padding: 7px 12px 7px 22px; font-size: 12px; color: #3c3c43; cursor: pointer; border-bottom: 1px solid #e5e5ea; }
.prod-cat-item:last-child { border-bottom: none; }
.prod-cat-item::before { content: "›"; margin-right: 8px; color: #8e8e93; font-size: 11px; }
.prod-cat-item:hover { background: #E6F1FB; color: #185FA5; }
/* Flat filtered results */
.prod-flat-item { display: flex; align-items: baseline; justify-content: space-between; padding: 8px 12px; font-size: 12px; color: #3c3c43; border-bottom: 1px solid #e5e5ea; cursor: pointer; }
.prod-flat-item:last-child { border-bottom: none; }
.prod-flat-item:hover { background: #E6F1FB; color: #185FA5; }
.prod-flat-cat { font-size: 10px; color: #8e8e93; flex-shrink: 0; margin-left: 8px; }
.prod-flat-item:hover .prod-flat-cat { color: #185FA5; opacity: .6; }
.prod-flat-item mark { background: none; color: #185FA5; font-weight: 600; }
/* Custom / Other pinned */
.prod-custom-row { display: flex; align-items: center; padding: 8px 12px; font-size: 12px; font-weight: 600; color: #185FA5; cursor: pointer; border-top: 1px solid #e5e5ea; background: #E6F1FB; }
.prod-custom-row:hover { background: #B5D4F4; }
/* Selected badge */
.prod-selected-badge { display: inline-flex; align-items: center; gap: 6px; background: #E6F1FB; border: 1px solid #B5D4F4; border-radius: 20px; padding: 3px 8px 3px 10px; margin-top: 5px; }
.prod-selected-badge span { font-size: 11px; font-weight: 600; color: #185FA5; }
.prod-selected-badge button { background: none; border: none; cursor: pointer; color: #185FA5; font-size: 14px; line-height: 1; padding: 0; margin-left: 2px; opacity: .7; }
.prod-no-results { padding: 12px; font-size: 12px; color: #8e8e93; text-align: center; }
/* Assign to buttons */
.av-assign-group { display: flex; gap: 5px; }
.av-assign-btn { display: flex; align-items: center; gap: 5px; padding: 5px 10px; border-radius: 20px; border: 1px solid #e8e8ed; background: #f2f2f7; cursor: pointer; font-family: inherit; font-size: 11px; color: #3c3c43; font-weight: 500; white-space: nowrap; }
.av-assign-btn.sel-jack { background: #FFF1E8; border-color: #EA6C1A; color: #A04A0E; }
.av-assign-btn.sel-iris { background: #F3EEF9; border-color: #6D3D91; color: #4B2863; }
/* Price suggest card */
.im-price-card { display: flex; align-items: center; justify-content: space-between; background: var(--green-bg); border: 1px solid var(--green-border); border-radius: var(--radius); padding: 8px 12px; cursor: pointer; }
.im-price-card-left { display: flex; flex-direction: column; gap: 2px; }
.im-price-card-label { font-size: 10px; font-weight: 700; color: var(--green-text); text-transform: uppercase; letter-spacing: .04em; }
.im-price-card-detail { font-size: 10px; color: var(--green-text); opacity: .7; }
.im-price-card-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.im-price-card-amt { font-size: 16px; font-weight: 800; color: var(--green-text); }
.im-price-card-apply { font-size: 10px; font-weight: 700; background: #C0DD97; color: var(--green-text); border: none; border-radius: 20px; padding: 3px 10px; cursor: pointer; font-family: inherit; white-space: nowrap; }
/* Section card modal — 3B */
.section-card-modal { background: #fff; border: 1px solid #e8e8ed; border-radius: 10px; padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; }
/* Tier rows */
.tier-mode-toggle { display: flex; gap: 6px; }
.tier-mode-btn { font-size: 11px; padding: 4px 10px; border-radius: var(--radius); cursor: pointer; font-family: inherit; border: 1px solid var(--border); background: var(--surface); color: var(--text2); }
.tier-mode-btn.active { background: var(--blue-bg); color: var(--blue); border-color: var(--blue-border); font-weight: 600; }
.tier-row { display: flex; gap: 8px; align-items: center; }
.tier-row input { flex: 1; font-size: 12px; padding: 6px 8px; border: 1px solid var(--border); border-radius: var(--radius); font-family: inherit; color: var(--text); background: var(--surface); }
.tier-row input:focus { outline: none; border-color: var(--blue); }
.remove-tier { font-size: 14px; color: var(--text3); cursor: pointer; background: none; border: none; }
.remove-tier:hover { color: var(--red-text); }
.add-tier-btn { font-size: 12px; color: var(--blue); cursor: pointer; background: none; border: none; padding: 0; font-family: inherit; }
/* Customer search */
.cust-search-wrap { position: relative; }
.cust-dropdown { display: none; position: absolute; top: 100%; left: 0; right: 0; background: var(--surface); border: 1px solid var(--border); border-top: none; border-radius: 0 0 var(--radius) var(--radius); max-height: 180px; overflow-y: auto; z-index: 100; box-shadow: 0 4px 12px rgba(0,0,0,.1); }
.cust-opt { padding: 8px 12px; cursor: pointer; border-bottom: 1px solid var(--surface2); font-size: 13px; }
.cust-opt:hover { background: var(--bg); }
.cust-opt:last-child { border-bottom: none; }
.cust-opt-name { font-weight: 600; }
.cust-opt-sub { font-size: 11px; color: var(--text3); }
.selected-cust-bar { display: none; background: var(--blue-bg); border: 1px solid var(--blue-border); border-radius: var(--radius); padding: 7px 12px; font-size: 12px; align-items: center; justify-content: space-between; }
.selected-cust-bar.show { display: flex; }
/* Job modal form */
.outsource-fields { display: none; flex-direction: column; gap: 14px; }
.outsource-fields.show { display: flex; }

/* ── Customers view — 3B style ── */
/* Sidebar */
.cust-list-panel { width: 280px; flex-shrink: 0; background: #f9f9fb; border-right: 1px solid #e8e8ed; display: flex; flex-direction: column; overflow: hidden; }
.cust-list-scroll { flex: 1; overflow-y: auto; padding-top: 7px; }
/* List rows — 3B card style */
.cust-row { background: #ffffff; border: 1px solid #e8e8ed; border-radius: 8px; padding: 9px 11px; margin: 0 7px 5px; cursor: pointer; transition: border-color .1s; }
.cust-row:hover { border-color: #c7c7cc; }
.cust-row.active { border-color: #007AFF; border-width: 1.5px; background: #EDF5FF; }
.cust-row-r1 { font-size: 12px; font-weight: 700; color: #000; margin-bottom: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cust-row-r2 { font-size: 10px; color: #8e8e93; margin-bottom: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cust-row-flags { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 2px; }
/* Detail panel */
.cust-detail { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.cust-detail.empty { align-items: center; justify-content: center; color: var(--text3); font-size: 13px; }
/* Detail header */
.cust-det-hdr { background: #fff; border-bottom: 1px solid #e5e5ea; padding: 12px 16px; flex-shrink: 0; }
.cust-det-name { font-size: 19px; font-weight: 800; color: #000; letter-spacing: -.02em; margin-bottom: 3px; }
.cust-det-sub  { font-size: 11px; color: #8e8e93; margin-bottom: 8px; }
.cust-det-pills { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.cust-det-pill-group { display: flex; gap: 5px; flex-wrap: wrap; }
/* Detail body */
.cust-det-body { flex: 1; overflow-y: auto; padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; background: #f2f2f7; }
/* History rows */
.cust-history-row { display: flex; align-items: center; justify-content: space-between; padding: 7px 0; border-bottom: 1px solid #e5e5ea; cursor: pointer; font-size: 12px; }
.cust-history-row:hover { opacity: .75; }
.cust-history-row:last-child { border-bottom: none; }
/* Contact rows */
.cust-contact-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; padding: 8px 0; border-bottom: 1px solid #e5e5ea; }
.cust-contact-row:last-of-type { border-bottom: none; }
.cust-contact-main { flex: 1; min-width: 0; }
.cust-contact-name { font-size: 12px; font-weight: 600; color: #000; display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.cust-contact-primary { font-size: 10px; font-weight: 700; color: #27500A; }
.cust-contact-meta  { font-size: 10px; color: #8e8e93; margin-top: 2px; }
.cust-contact-email { color: #185FA5; }
.cust-sta-badge { background: #E6F1FB; color: #185FA5; border: 1px solid #B5D4F4; font-size: 9px; font-weight: 700; padding: 1px 5px; border-radius: 20px; }
/* Flag pills in list */
.cust-flag-pill { display: inline-flex; font-size: 9px; font-weight: 600; padding: 1px 6px; border-radius: 20px; border: 1px solid transparent; }
.cfp-teal { background: #ECFEFF; color: #0E7490; border-color: #A5F3FC; }
.cfp-gray { background: #f5f4f0; color: #78716C; border-color: #d3d1c7; }
.cfp-blu  { background: #E6F1FB; color: #185FA5; border-color: #B5D4F4; }

.section-card-modal { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 12px 13px; display: flex; flex-direction: column; gap: 9px; }

/* ── Finishing UI ── */
.finishing-section { display:flex; flex-direction:column; gap:8px; }
.finishing-label { font-size:10px; font-weight:600; color:var(--text3); text-transform:uppercase; letter-spacing:.06em; }
.checkbox-grid { display:flex; flex-wrap:wrap; gap:6px 14px; padding:6px 0; }
.checkbox-item { display:flex; align-items:center; gap:6px; font-size:13px; cursor:pointer; }
.checkbox-item input[type=checkbox], .checkbox-item input[type=radio] { width:15px; height:15px; cursor:pointer; accent-color:var(--blue); flex-shrink:0; }
.sub-options { background:var(--bg); border:1px solid var(--border); border-radius:var(--radius); padding:10px 12px; margin-top:4px; display:flex; flex-direction:column; gap:8px; }
.sub-options-label { font-size:11px; font-weight:600; color:var(--text2); }
.banner-finishing-row { display:grid; grid-template-columns:120px 1fr; gap:8px; align-items:start; padding:6px 0; border-bottom:1px solid var(--surface2); }
.banner-finishing-row:last-child { border-bottom:none; }
.banner-finishing-name { font-size:12px; font-weight:600; color:var(--text2); padding-top:6px; }
.seq-num-wrap { display:flex; align-items:center; gap:8px; margin-top:4px; font-size:12px; color:var(--text2); }
.seq-num-wrap input { width:90px; font-size:12px; padding:5px 8px; border:1px solid var(--border); border-radius:var(--radius); font-family:inherit; }

/* ══ 3B SIDEBAR HEADERS ══ */
.side-hdr { background: #ffffff; border-bottom: 1px solid #e5e5ea; padding: 10px 12px; flex-shrink: 0; }
.side-hdr-title { font-size: 14px; font-weight: 800; color: #000; letter-spacing: -.02em; margin-bottom: 6px; display: flex; align-items: center; justify-content: space-between; }
.side-hdr-count { font-size: 11px; font-weight: 500; color: #8e8e93; }
.side-hdr-search { width: 100%; height: 26px; background: #f2f2f7; border: 1px solid #e5e5ea; border-radius: 7px; padding: 0 9px; font-size: 11px; color: #8e8e93; font-family: inherit; }

/* ══ 3B DETAIL HEADER — ORDERS & QUOTES ══ */
.det-hdr { background: #ffffff; border-bottom: 1px solid #e5e5ea; padding: 12px 16px; flex-shrink: 0; }
.det-hdr-name { font-size: 19px; font-weight: 800; color: #000; letter-spacing: -.02em; }

/* Metadata pill system */
.meta-pill { display: inline-flex; align-items: center; font-size: 10px; font-weight: 600; padding: 2px 8px; border-radius: 20px; white-space: nowrap; border: 1px solid transparent; }
.mp-ord    { background: #E6F1FB; color: #185FA5; border-color: #B5D4F4; }
.mp-q      { background: #EEEDFE; color: #3C3489; border-color: #AFA9EC; }
.mp-red    { background: #FEF0F0; color: #E02020; border-color: #F09595; }
.mp-amb    { background: #FFF7EE; color: #854F0B; border-color: #F5C97E; }
.mp-grn    { background: #EAF3DE; color: #27500A; border-color: #C0DD97; }
.mp-gray   { background: #f5f4f0; color: #78716C; border-color: #d3d1c7; }
.mp-draft  { background: #F1F5F9; color: #475569; border-color: #CBD5E1; }
.mp-sent   { background: #ECFEFF; color: #0E7490; border-color: #A5F3FC; }

/* Detail action buttons */
.btn-det-send    { font-size: 10px; padding: 3px 8px; border-radius: 6px; background: #ECFEFF; color: #0E7490; border: 1px solid #0E7490; font-weight: 700; font-family: inherit; cursor: pointer; white-space: nowrap; }
.btn-det-approve { font-size: 10px; padding: 3px 8px; border-radius: 6px; background: #EAF3DE; color: #27500A; border: 1px solid #C0DD97; font-weight: 700; font-family: inherit; cursor: pointer; white-space: nowrap; }
.btn-det-edit    { font-size: 10px; padding: 3px 8px; border-radius: 6px; background: #f2f2f7; color: #3c3c43; border: 1px solid #e5e5ea; font-weight: 600; font-family: inherit; cursor: pointer; white-space: nowrap; }

/* Add Item button */
.btn-add-item { display: flex; align-items: center; justify-content: center; width: 100%; margin-top: 5px; font-size: 11px; font-weight: 700; color: #007AFF; background: #E6F1FB; border: 1.5px solid #007AFF; border-radius: 8px; padding: 7px 12px; cursor: pointer; font-family: inherit; }

/* Order list row sub-elements */
.or-row-items { font-size: 10px; color: #8e8e93; }
.or-row-total { font-size: 10px; font-weight: 700; color: #27500A; }

/* Expiry text (no bubble) */
.q-expiry-text { font-size: 11px; font-weight: 600; color: #854F0B; margin-bottom: 5px; }

/* ══ INTERNAL STATUS PILLS ══ */
/* Hold — Amber */
.is-hold { background: #FFF7EE; color: #854F0B; border: 1px solid #F5C97E; font-size: 9px; font-weight: 700; padding: 1px 6px; border-radius: 20px; white-space: nowrap; display: inline-block; }
/* Outsource — Indigo */
.is-out  { background: #EEF2FF; color: #3730A3; border: 1px solid #C7D2FE; font-size: 9px; font-weight: 700; padding: 1px 6px; border-radius: 20px; white-space: nowrap; display: inline-block; }
/* Production — Teal */
.is-prod { background: #ECFEFF; color: #0E7490; border: 1px solid #A5F3FC; font-size: 9px; font-weight: 700; padding: 1px 6px; border-radius: 20px; white-space: nowrap; display: inline-block; }

/* ── Login ── */
#login-screen { position: fixed; inset: 0; background: var(--bg); display: flex; align-items: center; justify-content: center; z-index: 10000; font-family: system-ui,-apple-system,sans-serif; }
#login-screen.hidden { display: none; }
.login-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 28px 28px 24px; width: 320px; box-shadow: 0 4px 20px rgba(0,0,0,0.04); }
.login-title { font-size: 18px; font-weight: 600; margin-bottom: 4px; text-align: center; color: var(--text); }
.login-sub { font-size: 12px; color: var(--text3); margin-bottom: 18px; text-align: center; }
.login-field { margin-bottom: 10px; }
.login-label { font-size: 11px; color: var(--text2); font-weight: 500; margin-bottom: 4px; display: block; }
.login-input { width: 100%; font-size: 14px; padding: 8px 10px; border: 1px solid var(--border2); border-radius: var(--radius); background: var(--surface); color: var(--text); font-family: inherit; }
.login-input:focus { outline: none; border-color: var(--blue); }
.login-btn { width: 100%; font-size: 13px; padding: 9px; margin-top: 10px; border: 1px solid var(--blue-border); background: var(--blue-bg); color: var(--blue); font-weight: 600; border-radius: var(--radius); cursor: pointer; font-family: inherit; }
.login-btn:hover:not(:disabled) { background: var(--blue-border); }
.login-btn:disabled { opacity: 0.6; cursor: not-allowed; }
.login-error { font-size: 12px; color: var(--red-text); background: var(--red-bg); border: 1px solid var(--red-border); padding: 6px 8px; border-radius: var(--radius); margin-top: 10px; display: none; }
.login-error.show { display: block; }

