/* Clover CRM — brand tokens from clover-hospitality.com. Light backgrounds, dark text, one accent. */
:root {
  --white: #FFFFFF; --porcelain: #F6F3F2; --blush: #F5E7E5; --rose-gold: #B76E79; --deep-rose: #8A4652;
  --charcoal: #292629; --text-2: #625C60; --border: #E7DDDA;
  --rose-light: #FBEDEF; --rose-mid: #E5B8BE; --rose-dark: #7A3C47; --red: #A8323F;
  --sage-bg: #E4ECE2; --sage: #476B47; --amber-bg: #F7ECD8; --amber: #7C5A1E; --grey-bg: #EEEBEA;
  --serif: Georgia, "Times New Roman", serif; --sans: Inter, Arial, Helvetica, sans-serif;
  --r-btn: 12px; --r-card: 18px; --shadow: 0 1px 2px rgba(41,38,41,.04), 0 8px 24px rgba(41,38,41,.05);
  --gutter: 20px; --tab-h: 64px; --side-w: 240px;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--white); color: var(--charcoal); font: 16px/1.5 var(--sans); -webkit-tap-highlight-color: transparent; }
h1, h2, h3 { font-family: var(--serif); font-weight: 400; line-height: 1.15; margin: 0; letter-spacing: -.01em; }
h1 { font-size: 30px; } h2 { font-size: 22px; } h3 { font-size: 18px; }
p { margin: 0 0 12px; }
a { color: var(--deep-rose); text-underline-offset: 3px; }
button { font: inherit; color: inherit; }
input, select, textarea { font: inherit; color: var(--charcoal); }
.muted { color: var(--text-2); }
.small { font-size: 14px; }
.loading { padding: 40px; text-align: center; color: var(--text-2); }

/* layout */
.app { min-height: 100dvh; }
.topbar { position: sticky; top: 0; z-index: 20; background: rgba(255,255,255,.94); backdrop-filter: blur(8px); border-bottom: 1px solid var(--border);
  padding: calc(env(safe-area-inset-top) + 10px) var(--gutter) 10px; display: flex; align-items: center; gap: 12px; min-height: 58px; }
.topbar img { width: 30px; height: auto; }
.topbar .title { font-family: var(--serif); font-size: 20px; }
.topbar .spacer { flex: 1; }
main { padding: 16px var(--gutter) calc(var(--tab-h) + env(safe-area-inset-bottom) + 24px); max-width: 720px; margin: 0 auto; }
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: var(--white); border-top: 1px solid var(--border);
  display: flex; padding-bottom: env(safe-area-inset-bottom); height: calc(var(--tab-h) + env(safe-area-inset-bottom)); }
.tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; text-decoration: none; color: var(--text-2); font-size: 12px; font-weight: 500; }
.tabbar a svg { width: 24px; height: 24px; }
.tabbar a.active { color: var(--deep-rose); }
.tabbar a.log { color: var(--white); }
.tabbar a.log span.ic { width: 46px; height: 46px; border-radius: 50%; background: var(--deep-rose); display: grid; place-items: center; margin-top: -22px; box-shadow: 0 6px 16px rgba(138,70,82,.25); }
.tabbar a.log span.ic svg { width: 26px; height: 26px; }
.tabbar a.log small { color: var(--deep-rose); font-size: 12px; font-weight: 500; }
.sidebar { display: none; }
@media (min-width: 900px) {
  .tabbar, .topbar { display: none; }
  .sidebar { display: flex; flex-direction: column; gap: 6px; position: fixed; left: 0; top: 0; bottom: 0; width: var(--side-w); padding: 24px 16px; border-right: 1px solid var(--border); background: var(--porcelain); }
  .sidebar .brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 20px; font-family: var(--serif); font-size: 20px; }
  .sidebar .brand img { width: 34px; }
  .sidebar a { display: flex; align-items: center; gap: 10px; padding: 11px 12px; border-radius: var(--r-btn); text-decoration: none; color: var(--charcoal); font-weight: 500; }
  .sidebar a svg { width: 20px; height: 20px; color: var(--text-2); }
  .sidebar a.active { background: var(--white); color: var(--deep-rose); box-shadow: var(--shadow); }
  .sidebar a.active svg { color: var(--deep-rose); }
  .sidebar a.btn svg { color: inherit; }
  .sidebar .log { margin-top: 12px; }
  .sidebar .foot { margin-top: auto; font-size: 13px; color: var(--text-2); padding: 8px; }
  main { margin-left: var(--side-w); max-width: 860px; padding: 32px 40px 60px; }
}

/* cards & lists */
.card { background: var(--porcelain); border-radius: var(--r-card); padding: 16px; margin: 0 0 14px; }
.card h2 { margin-bottom: 10px; }
.card h2 .count { color: var(--text-2); font-family: var(--sans); font-size: 14px; margin-left: 6px; }
.card.white { background: var(--white); border: 1px solid var(--border); }
.rows { display: flex; flex-direction: column; }
.row { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-top: 1px solid var(--border); text-decoration: none; color: inherit; }
.row:first-child { border-top: 0; padding-top: 4px; }
.row .main { flex: 1; min-width: 0; }
.row .name { font-weight: 600; }
.row .sub { color: var(--text-2); font-size: 14px; margin-top: 2px; }
.row .next { font-size: 14px; margin-top: 4px; }
.row .side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex: none; }
.pill { display: inline-block; font-size: 12px; font-weight: 600; line-height: 1; padding: 6px 9px; border-radius: 999px; white-space: nowrap; background: var(--grey-bg); color: var(--text-2); }
.pill.target { background: var(--grey-bg); color: var(--text-2); }
.pill.followup { background: var(--blush); color: var(--deep-rose); }
.pill.walkthrough, .pill.quoted { background: var(--rose-mid); color: var(--rose-dark); }
.pill.won { background: var(--sage-bg); color: var(--sage); }
.pill.later { background: var(--amber-bg); color: var(--amber); }
.pill.lost { background: #F1DEE0; color: var(--red); }
.pill.overdue, .pill.quote_overdue { background: #F1DEE0; color: var(--red); }
.pill.today { background: var(--blush); color: var(--deep-rose); }
.pill.weblead { background: var(--deep-rose); color: #fff; }
.weblead-row .request { color: var(--text-2); margin-top: 4px; white-space: pre-wrap; }
.weblead-row .contact a { margin-right: 10px; }
.pill.upcoming { background: var(--grey-bg); color: var(--text-2); }
.empty { padding: 18px 4px; color: var(--text-2); }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 12px 22px; border-radius: var(--r-btn); border: 1px solid transparent;
  font: 600 16px/1.2 var(--sans); text-decoration: none; cursor: pointer; background: var(--white); color: var(--deep-rose); border-color: var(--rose-gold); }
.btn.primary { background: var(--deep-rose); color: var(--white); border-color: var(--deep-rose); box-shadow: 0 6px 16px rgba(138,70,82,.18); }
.btn.primary:hover { background: var(--rose-dark); }
.btn.block { width: 100%; }
.btn.big { min-height: 56px; font-size: 17px; }
.btn.quiet { border-color: transparent; background: transparent; color: var(--deep-rose); padding: 8px 10px; min-height: 44px; }
.btn.danger { color: var(--red); border-color: var(--red); }
.btn[disabled] { opacity: .6; cursor: progress; }
.btn svg { width: 20px; height: 20px; flex: none; }
.btn.sm { min-height: 40px; padding: 8px 14px; font-size: 14px; }
.iconbtn { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--border); background: var(--white); display: grid; place-items: center; cursor: pointer; color: var(--text-2); flex: none; }
.iconbtn svg { width: 20px; height: 20px; }
.iconbtn.done { border-color: var(--rose-gold); color: var(--deep-rose); }
.tel { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; color: var(--deep-rose); font-weight: 500; min-height: 44px; }
.tel svg { width: 16px; height: 16px; }

/* forms */
[hidden] { display: none !important; } /* author display rules must never un-hide a hidden element */
.field { display: block; margin: 0 0 12px; }
/* iPhone: date and time inputs have their own minimum width and push past the screen edge */
input[type=date], input[type=time] { min-width: 0; max-width: 100%; box-sizing: border-box; -webkit-appearance: none; appearance: none; text-align: left; }
input[type=date]::-webkit-date-and-time-value, input[type=time]::-webkit-date-and-time-value { text-align: left; }
.grid2 > * { min-width: 0; }
.field > span { display: block; font-size: 13px; font-weight: 500; color: var(--text-2); margin-bottom: 4px; }
.field input, .field select, .field textarea { width: 100%; min-height: 46px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--r-btn); background: var(--white); outline: none; }
.field textarea { min-height: 84px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--rose-gold); box-shadow: 0 0 0 3px rgba(183,110,121,.15); }
.field input.saved, .field select.saved, .field textarea.saved { border-color: var(--rose-gold); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
@media (max-width: 420px) { .grid2.tight { grid-template-columns: 1fr; } }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.chip { min-height: 44px; padding: 10px 14px; border-radius: 999px; border: 1px solid var(--border); background: var(--white); cursor: pointer; font-weight: 500; font-size: 15px; }
.chip.on { background: var(--deep-rose); color: var(--white); border-color: var(--deep-rose); }
.chip.filter.on { background: var(--blush); color: var(--deep-rose); border-color: var(--rose-gold); }
.chip.sm { min-height: 38px; padding: 6px 12px; font-size: 14px; }
.label { font-size: 13px; font-weight: 500; color: var(--text-2); margin: 0 0 6px; }
.search { position: relative; margin-bottom: 12px; }
.search input { width: 100%; min-height: 50px; padding: 12px 14px 12px 42px; border: 1px solid var(--border); border-radius: var(--r-btn); background: var(--white); font-size: 16px; }
.search svg { position: absolute; left: 14px; top: 16px; width: 18px; height: 18px; color: var(--text-2); }
.results { border: 1px solid var(--border); border-radius: var(--r-card); background: var(--white); overflow: hidden; margin-bottom: 14px; }
.results button { display: block; width: 100%; text-align: left; padding: 12px 14px; border: 0; border-top: 1px solid var(--border); background: var(--white); cursor: pointer; }
.results button:first-child { border-top: 0; }
.results button small { display: block; color: var(--text-2); }
.picked { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; border: 1px solid var(--rose-gold); background: var(--blush); border-radius: var(--r-card); margin-bottom: 14px; }
.picked b { font-weight: 600; }

/* page bits */
.pagehead { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 4px 0 16px; }
.pagehead .sub { color: var(--text-2); font-size: 14px; }
.back { display: inline-flex; align-items: center; gap: 4px; text-decoration: none; color: var(--text-2); font-size: 14px; margin-bottom: 8px; min-height: 32px; }
.meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 10px 0 14px; font-size: 14px; color: var(--text-2); }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.stats div { background: var(--white); border-radius: var(--r-btn); padding: 10px 8px; text-align: center; }
.stats b { display: block; font-family: var(--serif); font-size: 24px; font-weight: 400; line-height: 1.1; }
.stats span { font-size: 12px; color: var(--text-2); }
.touch { padding: 12px 0; border-top: 1px solid var(--border); }
.touch:first-child { border-top: 0; }
.touch .head { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; }
.touch .head b { font-weight: 600; }
.touch .notes { margin-top: 4px; white-space: pre-wrap; }
.touch .ns { margin-top: 4px; font-size: 14px; color: var(--text-2); }
.touch .del { border: 0; background: none; color: var(--text-2); font-size: 13px; cursor: pointer; padding: 4px 0; }
.inline-add { display: flex; gap: 8px; align-items: flex-end; margin-top: 8px; }
.inline-add .field { flex: 1; margin: 0; }
.inline-add .field.date { flex: 0 0 150px; }
.login { min-height: 100dvh; display: grid; place-items: center; padding: 24px; }
.login form { width: 100%; max-width: 360px; text-align: center; }
.login img { width: 96px; margin: 0 auto 16px; }
.login h1 { margin-bottom: 4px; }
.login p { color: var(--text-2); margin-bottom: 20px; }
.login .err { color: var(--red); font-size: 14px; min-height: 20px; margin-top: 8px; }
.status { position: fixed; left: 50%; bottom: calc(var(--tab-h) + env(safe-area-inset-bottom) + 14px); transform: translate(-50%, 20px); opacity: 0; transition: .2s; z-index: 30;
  background: var(--charcoal); color: var(--white); padding: 10px 16px; border-radius: 999px; font-size: 14px; pointer-events: none; max-width: 90vw; }
.status.show { opacity: 1; transform: translate(-50%, 0); }
.status.err { background: var(--red); }
@media (min-width: 900px) { .status { bottom: 24px; } }
.section-label { font-size: 13px; font-weight: 600; color: var(--text-2); margin: 18px 0 6px; letter-spacing: .02em; }
.hint { font-size: 13px; color: var(--text-2); margin: -6px 0 12px; }

/* ===== CRM layout: desktop table, board, toolbar, record page ===== */
.only-desktop { display: none !important; }
.only-phone { display: block; }
@media (min-width: 900px) {
  .only-desktop { display: block !important; }
  a.only-desktop, button.only-desktop { display: inline-flex !important; }
  .only-phone { display: none !important; }
  main.wide { max-width: none; padding: 28px 32px 60px; }
  .narrow { max-width: 640px; }
  h1 { font-size: 32px; }
  .card { padding: 18px 20px; }
}
.row .name { text-decoration: none; color: inherit; }
.due.overdue, .due.quote_overdue { color: var(--red); font-weight: 600; }
.due.today { color: var(--deep-rose); font-weight: 600; }

/* stats strip */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
@media (min-width: 900px) { .stats { grid-template-columns: repeat(6, 1fr); gap: 12px; margin-bottom: 18px; } }
.stats div { background: var(--porcelain); border-radius: var(--r-card); padding: 12px 10px; text-align: center; }
.stats b { display: block; font-family: var(--serif); font-size: 26px; font-weight: 400; line-height: 1.1; }
.stats span { font-size: 12px; color: var(--text-2); }

/* toolbar */
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 14px; }
.toolbar .search { margin: 0; flex: 1 1 220px; min-width: 200px; }
.toolbar .search input { min-height: 42px; padding-top: 8px; padding-bottom: 8px; }
.toolbar .search svg { top: 12px; }
.toolbar select { min-height: 42px; padding: 6px 30px 6px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--white); font-size: 14px; color: var(--charcoal);
  appearance: none; -webkit-appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23625C60' stroke-width='2.5'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; max-width: 220px; }
.toolbar .count { margin-left: auto; white-space: nowrap; }
@media (max-width: 899px) { .toolbar select { flex: 1 1 45%; max-width: none; } .toolbar .count { width: 100%; margin: 0; } }

/* data table */
.table-wrap { background: var(--white); border: 1px solid var(--border); border-radius: var(--r-card); overflow: auto; max-height: calc(100dvh - 210px); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { position: sticky; top: 0; z-index: 1; text-align: left; font-weight: 600; font-size: 12px; letter-spacing: .02em; color: var(--text-2); background: var(--porcelain);
  padding: 10px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; cursor: pointer; user-select: none; }
th.dragging { opacity: .45; }
th.drop-before { box-shadow: inset 3px 0 0 var(--deep-rose); } th.drop-after { box-shadow: inset -3px 0 0 var(--deep-rose); }
table.fixed { table-layout: fixed; }
table.fixed th, table.fixed td { overflow: hidden; text-overflow: ellipsis; }
.colgrip { position: absolute; top: 0; right: 0; bottom: 0; width: 13px; cursor: col-resize; touch-action: none; }
.colgrip::after { content: ""; position: absolute; top: 25%; bottom: 25%; right: 3px; width: 2px; border-radius: 2px; background: var(--border); }
.colgrip:hover::after, .colgrip.on::after { background: var(--deep-rose); top: 0; bottom: 0; }
body.resizing { cursor: col-resize; user-select: none; }
th.asc::after { content: " ↑"; color: var(--deep-rose); } th.desc::after { content: " ↓"; color: var(--deep-rose); }
td { padding: 9px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; white-space: nowrap; }
td .sub { font-size: 12px; color: var(--text-2); margin-top: 1px; }
td .name { font-weight: 600; text-decoration: none; color: inherit; }
td.actions { text-align: right; }
tbody tr[data-href] { cursor: pointer; }
tbody tr[data-href]:hover td { background: var(--rose-light); }
tr.group td { background: var(--porcelain); font-weight: 600; cursor: pointer; padding: 8px 12px; }
tr.group td svg { vertical-align: -2px; transform: rotate(90deg); transition: transform .15s; color: var(--text-2); }
tr.group.closed td svg { transform: rotate(0); }
tr.group .count { color: var(--text-2); font-weight: 400; margin-left: 6px; }

/* pipeline board */
.board { display: flex; gap: 12px; overflow-x: auto; align-items: flex-start; padding-bottom: 12px; scroll-snap-type: x proximity; }
.col { flex: 0 0 272px; scroll-snap-align: start; background: var(--porcelain); border-radius: var(--r-card); padding: 10px; max-height: calc(100dvh - 230px); display: flex; flex-direction: column; }
.col h3 { font-family: var(--sans); font-size: 13px; font-weight: 600; display: flex; justify-content: space-between; align-items: center; padding: 4px 6px 10px; }
.col h3 .count { color: var(--text-2); font-weight: 500; }
.col .cards { overflow-y: auto; min-height: 60px; }
.col.over { outline: 2px dashed var(--rose-gold); outline-offset: -2px; }
.kcard { display: block; background: var(--white); border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; margin-bottom: 8px; text-decoration: none; color: inherit; cursor: grab; }
.kcard:hover { border-color: var(--rose-gold); }
.kcard.dragging { opacity: .5; }
.kcard .n { font-weight: 600; font-size: 14px; }
.kcard .s { font-size: 12px; color: var(--text-2); margin-top: 1px; }
.kcard .d { font-size: 12px; margin-top: 6px; line-height: 1.4; }
.col .more { display: block; text-align: center; font-size: 13px; padding: 8px; }
@media (max-width: 899px) { .col { flex: 0 0 82vw; max-height: 70dvh; } }

/* record page */
.rechead { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; flex-wrap: wrap; margin-bottom: 6px; }
.rechead .meta { margin: 8px 0 10px; }
.rechead-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.rec { display: grid; grid-template-columns: 1fr; gap: 0 18px; align-items: start; }
.grid-cards { display: grid; grid-template-columns: 1fr; gap: 0 14px; }
@media (min-width: 700px) { .grid-cards { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1100px) { .rec { grid-template-columns: minmax(0, 1fr) 400px; } .rec-side { position: sticky; top: 24px; } }
@media (max-width: 1099px) and (min-width: 900px) { .rec-side { order: -1; } }
.touchform .chips.compact { margin-bottom: 10px; }
.touchform .field { margin-bottom: 10px; }

/* dialog */
.dlg { border: 0; border-radius: var(--r-card); padding: 20px; box-shadow: var(--shadow); max-width: 360px; width: 90vw; }
.dlg::backdrop { background: rgba(41,38,41,.35); }
.dlg h3 { margin-bottom: 12px; }
.dlg-actions { display: flex; justify-content: flex-end; gap: 8px; }
.dlg select { width: 100%; min-height: 44px; padding: 8px 12px; border: 1px solid var(--border); border-radius: var(--r-btn); }

/* ===== stage 2: targets, import ===== */
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; min-height: 42px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--deep-rose); }
.trow { align-items: center; }
.planbox { display: grid; place-items: center; width: 44px; height: 44px; flex: none; }
.planbox input { width: 22px; height: 22px; accent-color: var(--deep-rose); }
.chips .chip b { font-weight: 600; margin-left: 4px; color: var(--text-2); }
.chips .chip.on b { color: var(--white); }
.filebox { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 64px; border: 2px dashed var(--border); border-radius: var(--r-card); background: var(--white); cursor: pointer; color: var(--deep-rose); font-weight: 600; }
.filebox:hover { border-color: var(--rose-gold); background: var(--blush); }
.filebox svg { width: 22px; height: 22px; }
.notice { background: var(--sage-bg); color: var(--sage); border-radius: var(--r-btn); padding: 10px 14px; margin-bottom: 12px; font-weight: 500; }
details summary::-webkit-details-marker { color: var(--text-2); }
.row .side.h { flex-direction: row; align-items: center; gap: 4px; }

/* ===== stage 3: walkthrough, quotes, accounts, messages ===== */
.check.big { min-height: 44px; font-size: 16px; }
.boxgrid { display: grid; grid-template-columns: 1fr; gap: 0 12px; }
@media (min-width: 600px) { .boxgrid { grid-template-columns: 1fr 1fr; } }
.calc { display: flex; flex-direction: column; margin-top: 8px; border-top: 1px solid var(--border); }
.calc div { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--border); font-size: 15px; }
.calc div span { color: var(--text-2); }
.calc div b { font-weight: 600; }
.calc .min b { color: var(--deep-rose); }
.calc .warn b { color: var(--red); }
.calc .total { font-size: 17px; } .calc .total b { font-family: var(--serif); font-size: 22px; font-weight: 400; }
.warnbox { margin-top: 10px; background: #F1DEE0; color: var(--red); border-radius: var(--r-btn); padding: 10px 14px; font-weight: 500; }
.bigin { font-size: 22px; font-family: var(--serif); }
.btnrow { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.sumline { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--border); }
.sumline:last-child { border-bottom: 0; } .sumline b { font-family: var(--serif); font-size: 20px; font-weight: 400; }
.dlg.wide { max-width: 520px; }
.dlg .field textarea { width: 100%; min-height: 150px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--r-btn); }
.dlg .field input, .dlg .field select { width: 100%; min-height: 44px; padding: 8px 12px; border: 1px solid var(--border); border-radius: var(--r-btn); }
.dlg .field > span { display: block; font-size: 13px; color: var(--text-2); margin-bottom: 4px; }
.dlg .field { display: block; margin-bottom: 10px; }
.row.small { padding: 6px 0; font-size: 14px; }

/* ===== management ===== */
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: var(--r-btn); overflow: hidden; background: var(--white); }
.seg a { padding: 10px 16px; min-height: 42px; display: inline-flex; align-items: center; text-decoration: none; color: var(--charcoal); font-weight: 500; font-size: 14px; }
.seg a.on { background: var(--deep-rose); color: var(--white); }
.sops { display: grid; grid-template-columns: 1fr; gap: 14px; align-items: start; }
@media (min-width: 900px) { .sops { grid-template-columns: 240px minmax(0, 1fr); } }
.doclist { display: flex; flex-direction: column; gap: 4px; background: var(--porcelain); border-radius: var(--r-card); padding: 10px; }
.doclist a { padding: 10px 12px; border-radius: var(--r-btn); text-decoration: none; color: var(--charcoal); font-weight: 500; }
.doclist a.on { background: var(--white); color: var(--deep-rose); box-shadow: var(--shadow); }
.docview { background: var(--white); border: 1px solid var(--border); border-radius: var(--r-card); padding: 20px 24px; }
.docbar { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.prose h2 { font-size: 26px; margin: 4px 0 12px; } .prose h3 { font-size: 19px; margin: 20px 0 8px; } .prose h4 { font-family: var(--sans); font-size: 15px; font-weight: 600; margin: 16px 0 6px; }
.prose p { margin: 0 0 10px; } .prose ul, .prose ol { margin: 0 0 12px; padding-left: 22px; } .prose li { margin: 4px 0; }
.prose .table-wrap { max-height: none; margin: 8px 0 14px; } .prose td { white-space: normal; }
#docText { width: 100%; font: 14px/1.5 ui-monospace, Menlo, monospace; padding: 12px; border: 1px solid var(--border); border-radius: var(--r-btn); }
.linkbtn { border: 0; background: none; color: var(--deep-rose); cursor: pointer; font: inherit; font-size: 13px; padding: 2px 4px; display: inline-flex; align-items: center; gap: 3px; }
.linkbtn svg { width: 14px; height: 14px; }
.secret { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.secret code { background: var(--porcelain); padding: 6px 10px; border-radius: 8px; font-size: 15px; word-break: break-all; }
.vrow .side .btn.sm { min-height: 40px; padding: 6px 10px; }

/* ===== work mode, add-ons ===== */
.workwrap { max-width: 720px; margin: 0 auto; }
.workbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.workbar .back { margin: 0; }
.progress { height: 4px; background: var(--border); border-radius: 2px; margin-bottom: 14px; overflow: hidden; }
.progress div { height: 100%; background: var(--rose-gold); }
.workcard h1 { font-size: 28px; }
.workfacts { display: grid; grid-template-columns: 1fr; gap: 6px 16px; margin-top: 10px; font-size: 15px; }
@media (min-width: 600px) { .workfacts { grid-template-columns: 1fr 1fr; } }
.workfacts div { display: flex; flex-direction: column; } .workfacts span { font-size: 12px; color: var(--text-2); } .workfacts b { font-weight: 500; }
.mini { min-height: 38px; padding: 4px 8px; border: 1px solid var(--border); border-radius: 8px; background: var(--white); font-size: 14px; }
input.mini { width: 84px; } select.mini { max-width: 120px; }
.row.addon.muted .main { color: var(--text-2); }

/* ===== accounts dashboard ===== */
:root { --h-green: #3E7F3E; --h-yellow: #B8892E; --h-red: #A8323F; }
.dash { display: grid; grid-template-columns: 1fr; gap: 14px; margin-bottom: 14px; }
@media (min-width: 900px) { .dash { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.dash .card { margin: 0; }
.dash-donut { display: flex; align-items: center; gap: 14px; }
.hlegend { display: flex; flex-direction: column; gap: 4px; }
.hleg { display: inline-flex; align-items: center; gap: 8px; border: 1px solid transparent; background: none; border-radius: 8px; padding: 6px 8px; cursor: pointer; font-size: 14px; min-height: 36px; }
.hleg.on { border-color: var(--border); background: var(--porcelain); }
.hleg .sw { width: 12px; height: 12px; border-radius: 3px; }
.hleg b { font-weight: 600; margin-left: auto; }
.dash .row.small { padding: 8px 0; text-decoration: none; color: inherit; }

/* ===== crews ===== */
.docs { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 700px) { .docs { grid-template-columns: repeat(3, 1fr); } }
.doc { border: 1px solid var(--border); border-radius: var(--r-card); padding: 12px; }
.doc.has { background: var(--porcelain); }
.dochead { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 8px; }
label.btn input { display: none; }
.card h2.hrow { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; } .card h2.hrow .grow { flex: 1; } .card h2.hrow .btn { font-family: var(--sans); }

/* ===== bulk actions ===== */
th.selcol, td.selcol { width: 36px; padding-right: 0; }
td.selcol input, th.selcol input { width: 18px; height: 18px; accent-color: var(--deep-rose); cursor: pointer; }
.bulkbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; background: var(--blush); border: 1px solid var(--rose-gold); border-radius: var(--r-btn); padding: 8px 12px; margin-bottom: 10px; }
.bulkbar select { min-height: 38px; padding: 6px 28px 6px 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--white); font-size: 14px; appearance: none; -webkit-appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23625C60' stroke-width='2.5'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 8px center; }
.bulkbar .btn.sm { min-height: 38px; }
tr.group .groupsel { width: 18px; height: 18px; accent-color: var(--deep-rose); vertical-align: -3px; margin-right: 6px; cursor: pointer; }

/* ===== routing ===== */
.startbox { padding-top: 12px; padding-bottom: 10px; }
.stopno { width: 28px; height: 28px; border-radius: 50%; background: var(--deep-rose); color: var(--white); font-weight: 600; font-size: 13px; display: grid; place-items: center; flex: none; margin-top: 2px; }
.suggest { display: inline-flex; align-items: center; gap: 6px; }

/* ===== column chooser ===== */
.colmenu { position: relative; }
.colmenu summary { list-style: none; cursor: pointer; } .colmenu summary::-webkit-details-marker { display: none; }
.colpop { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; background: var(--white); border: 1px solid var(--border); border-radius: var(--r-card); box-shadow: var(--shadow); padding: 10px 14px; min-width: 220px; display: flex; flex-direction: column; }
.colpop .check { min-height: 34px; }
.colpop { max-height: 70vh; overflow-y: auto; }
.chips.need { outline: 2px solid var(--red); outline-offset: 6px; border-radius: 12px; }

/* ===== QA batches: next-step dialog, proposal link ===== */
.dlg .stack { display: flex; flex-direction: column; gap: 8px; } .dlg .stack .btn { width: 100%; }
.linkbox { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.linkbox input { flex: 1 1 240px; min-height: 42px; padding: 8px 12px; border: 1px solid var(--border); border-radius: var(--r-btn); background: var(--porcelain); font-size: 14px; color: var(--charcoal); }

/* bulk email: who gets it */
.picklist { max-height: 170px; overflow: auto; border: 1px solid var(--border); border-radius: 12px; background: var(--white); padding: 6px 10px; display: grid; gap: 2px; }
.picklist .check { min-height: 32px; justify-content: flex-start; text-align: left; }
.picklist .check input { flex: none; }
.pickwrap { margin: 8px 0; } .picktitle { display: block; font-size: 13px; color: var(--text-2); margin-bottom: 4px; }

/* record header: the open next step(s) */
.nextline { margin-top: 6px; } .nextitem { display: inline-flex; align-items: center; gap: 6px; background: var(--rose-light); border-radius: 999px; padding: 4px 6px 4px 12px; font-size: 13px; }
.iconbtn.done.sm { width: 26px; height: 26px; }

/* scope builder */
.section-title { font: 400 22px Georgia, serif; margin: 18px 0 6px; }
.scopearea.off { opacity: .75; } .areahead { min-height: 40px; } .areahead b { font-weight: 600; }
.tasklist { display: grid; gap: 2px; } .tasklist .check { min-height: 34px; align-items: flex-start; } .tasklist .check input { margin-top: 3px; flex: none; }
.levelseg a { flex: 1; text-align: center; }

.okbox { background: var(--sage-bg); color: var(--sage); border-radius: 12px; padding: 10px 14px; font-size: 14px; }

/* record header banners */
.banner { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; background: var(--amber-bg); color: var(--amber); border-radius: 12px; padding: 10px 14px; margin: 8px 0 4px; font-size: 14px; }
.banner.ok { background: var(--sage-bg); color: var(--sage); }

/* caller onboarding */
.welcome { max-width: 520px; margin: 24px auto; padding: 0 16px; } .welcome .brand { display: flex; align-items: center; gap: 8px; font: 400 20px Georgia, serif; color: var(--deep-rose); margin-bottom: 10px; } .welcome .brand img { width: 28px; }
.welcome h1 { font: 400 28px Georgia, serif; margin: 0 0 14px; }
.wsteps { display: flex; gap: 6px; margin-bottom: 16px; } .wstep { flex: 1; text-align: center; font-size: 12px; color: var(--text-2); } .wstep b { display: block; width: 28px; height: 28px; line-height: 28px; border-radius: 50%; margin: 0 auto 4px; background: var(--grey-bg); color: var(--text-2); font-weight: 600; } .wstep.on b { background: var(--deep-rose); color: #fff; } .wstep.done b { background: var(--sage-bg); color: var(--sage); }
.chips-sm { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; } .chips-sm .pill { font-size: 11px; }

.wstep[data-step] { cursor: pointer; } .wstep[data-step]:hover b { outline: 2px solid var(--rose-mid); }

/* phone select mode on Leads */
.pselbar { position: sticky; top: 0; z-index: 5; background: var(--blush); border: 1px solid var(--rose-gold); border-radius: var(--r-btn); padding: 8px 10px; margin-bottom: 10px; }
.pselhead { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; } .pselhead b { flex: 1; font-size: 14px; }
.pselacts { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px; } .pselacts select { min-height: 40px; padding: 6px 8px; border: 1px solid var(--border); border-radius: 10px; background: var(--white); font-size: 13px; min-width: 0; }
.selrow { cursor: pointer; } .selrow .pcheck { width: 22px; height: 22px; accent-color: var(--deep-rose); margin-right: 10px; flex: none; } .selrow.picked { background: var(--rose-light); }
@media (max-width: 420px) { .pselacts { grid-template-columns: 1fr; } }

/* quote line items */
.items-edit { display: grid; gap: 6px; } .irow { display: grid; grid-template-columns: 1fr 64px 84px 110px 80px 32px; gap: 6px; align-items: center; } .irow input, .irow select { min-height: 40px; padding: 6px 8px; border: 1px solid var(--border); border-radius: 10px; font-size: 14px; min-width: 0; } .irow .isub { text-align: right; font-size: 14px; }
@media (max-width: 640px) { .irow { grid-template-columns: 1fr 56px 76px; } .irow select { grid-column: 1 / 2; } .irow .isub { grid-column: 2 / 3; } .irow .iconbtn { grid-column: 3 / 4; justify-self: end; } }

.irow.inv { grid-template-columns: 1fr 64px 92px 84px 32px; } @media (max-width: 640px) { .irow.inv { grid-template-columns: 1fr 56px 80px; } .irow.inv .isub { grid-column: 1 / 2; text-align: left; } .irow.inv .iconbtn { grid-column: 3 / 4; } }
