/* FiberOps Sales: same palette, type and sign-in look as Mission Control. */
:root {
  --bg: #F2F5FB; --surface: #FFFFFF; --surface2: #E7ECF7; --ink: #0E1B3D; --muted: #55607A; --line: #DCE3F1;
  --brand: #2F5BFF; --brand-ink: #FFFFFF; --brand-soft: #E8EEFF; --brand-text: #2A50E6;
  --ok: #17603C; --ok-bg: #DDF3E8; --warn: #85470D; --warn-bg: #FBEBD3; --bad: #A32A1E; --bad-bg: #FCE3E0;
  --shadow: 0 1px 2px rgba(14,27,61,.08), 0 4px 14px rgba(14,27,61,.05); --radius: 16px; color-scheme: light;
  --grad: linear-gradient(90deg, #3aa0ff, #3df0e0 55%, #7be04a);
}
:root[data-theme="dark"] {
  --bg: #0A1020; --surface: #131B2F; --surface2: #1B2642; --ink: #E9EEFC; --muted: #9DA9C7; --line: #26314F;
  --brand: #7A97FF; --brand-ink: #0A1024; --brand-soft: #1D2A55; --brand-text: #A9BEFF;
  --ok: #7BE0AC; --ok-bg: #123526; --warn: #FFC680; --warn-bg: #3A2A0C; --bad: #FF9E94; --bad-bg: #421B1B;
  --shadow: 0 1px 2px rgba(0,0,0,.4); color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { font-family: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif; background: var(--bg); color: var(--ink); font-size: 15px; line-height: 1.45; -webkit-text-size-adjust: 100%;
  background-image: radial-gradient(ellipse 900px 520px at 8% -10%, color-mix(in srgb, var(--brand) 14%, transparent), transparent 60%); background-attachment: fixed; }
h1 { font-size: 20px; margin: 0; } h2 { font-size: 17px; margin: 0 0 10px; } h3 { font-size: 14px; margin: 0 0 8px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
a { color: var(--brand-text); text-decoration: none; } a:hover { text-decoration: underline; }
.muted { color: var(--muted); } .small { font-size: 13px; } .tiny { font-size: 12px; }
.wrap { max-width: 1400px; margin: 0 auto; padding: 0 16px 40px; }

/* header */
.top { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 0; }
.top .grow { flex: 1; }
.brandrow { display: flex; align-items: center; gap: 10px; }
.brandrow img { width: 36px; height: 36px; border-radius: 10px; }
.brandrow b { display: block; font-size: 17px; line-height: 1.1; } .brandrow span { font-size: 11px; color: var(--muted); letter-spacing: .1em; text-transform: uppercase; font-weight: 800; }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; background: var(--surface2); padding: 4px; border-radius: 14px; }
.tabs button { background: transparent; border: 0; color: var(--muted); border-radius: 10px; padding: 6px 11px; min-height: 34px; font-size: 14px; }
.tabs button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.tabs .count { display: inline-block; min-width: 20px; padding: 0 6px; margin-left: 4px; border-radius: 99px; background: var(--bad-bg); color: var(--bad); font-size: 12px; }
.search { max-width: 240px; }
.who { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }

/* controls */
button, .btn { font: inherit; font-weight: 700; background: var(--brand); color: var(--brand-ink); border: 1.5px solid var(--brand); border-radius: 12px; padding: 8px 14px; min-height: 40px; cursor: pointer; }
button:hover:not(:disabled) { filter: brightness(1.06); }
button.ghost { background: transparent; color: var(--ink); border-color: var(--line); } button.ghost:hover:not(:disabled) { border-color: var(--brand); }
button.link { background: none; border: 0; color: var(--brand-text); padding: 0 2px; min-height: 0; font-weight: 700; }
button.danger { background: #b42318; border-color: #b42318; color: #fff; }
button.sm { min-height: 32px; padding: 4px 10px; font-size: 13px; border-radius: 10px; }
button:disabled { opacity: .5; cursor: default; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 55%, transparent); outline-offset: 2px; }
input, textarea, select { font: inherit; width: 100%; background: var(--surface2); color: var(--ink); border: 1.5px solid transparent; border-radius: 12px; padding: 9px 12px; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--brand); }
input[type=checkbox] { width: 20px; height: 20px; padding: 0; accent-color: var(--brand); flex: none; }
textarea { min-height: 90px; resize: vertical; }
label { display: block; font-size: 13px; font-weight: 700; color: var(--muted); margin: 10px 0 4px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; } .grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 12px; }
@media (max-width: 760px) { .grid2, .grid3 { grid-template-columns: 1fr; } }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); margin-bottom: 12px; }
.banner { padding: 10px 14px; border-radius: 12px; margin-bottom: 12px; background: var(--surface2); font-weight: 600; }
.banner.bad { background: var(--bad-bg); color: var(--bad); } .banner.ok { background: var(--ok-bg); color: var(--ok); }
.pill { display: inline-block; padding: 1px 9px; border-radius: 99px; font-size: 12px; font-weight: 700; background: var(--surface2); color: var(--muted); white-space: nowrap; }
.pill.ok { background: var(--ok-bg); color: var(--ok); } .pill.bad { background: var(--bad-bg); color: var(--bad); } .pill.warn { background: var(--warn-bg); color: var(--warn); } .pill.brand { background: var(--brand-soft); color: var(--brand-text); }
.loading { display: flex; align-items: center; gap: 12px; color: var(--muted); padding: 24px 4px; }
.spin { width: 18px; height: 18px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--brand); animation: sp .8s linear infinite; } @keyframes sp { to { transform: rotate(360deg); } }
.empty { color: var(--muted); padding: 18px; text-align: center; }

/* filters */
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.filters select, .filters input { width: auto; min-width: 140px; }

/* pipeline: every column fits the screen, no sideways scrolling */
.board { display: grid; gap: 8px; align-items: start; }
.col { background: var(--surface2); border-radius: 14px; padding: 6px; min-height: 160px; min-width: 0; }
.col.drop { outline: 2px dashed var(--brand); outline-offset: -2px; }
.col-head { display: flex; justify-content: space-between; align-items: baseline; gap: 4px; padding: 2px 4px 6px; font-size: 13px; font-weight: 800; }
.col-head b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.col-head span { font-size: 11px; color: var(--muted); font-weight: 700; white-space: nowrap; }
.col.won .col-head b { color: var(--ok); } .col.lost .col-head b { color: var(--muted); }
.deal { display: block; width: 100%; text-align: left; background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 10px; padding: 7px 8px; margin-bottom: 6px; cursor: grab; font-weight: 500; min-height: 0; font-size: 13px; }
.deal:hover { border-color: var(--brand); filter: none; }
.deal .dn { display: flex; align-items: center; gap: 6px; min-width: 0; }
.deal .dn b { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.deal .sub { display: block; font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.deal .meta { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 4px; align-items: center; }
.deal .pill { font-size: 10.5px; padding: 0 6px; }
.deal.slim { padding: 5px 7px; margin-bottom: 4px; }
.av { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; border-radius: 50%; background: var(--brand-soft); color: var(--brand-text); font-size: 9px; font-weight: 800; flex: none; }
.due { font-size: 11px; font-weight: 700; color: var(--muted); } .due.late { color: var(--bad); } .due.today { color: var(--warn); }
@media (max-width: 900px) { .board { grid-template-columns: 1fr !important; } .col { min-height: 0; } }

/* home */
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 10px; }
.tile { display: flex; flex-direction: column; gap: 2px; margin: 0; padding: 12px 14px; }
.tile .tl-l { font-size: 12px; color: var(--muted); font-weight: 700; }
.tile b { font-size: 26px; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; } .tile b small { font-size: 13px; color: var(--muted); font-weight: 700; }
.home { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.home .card { margin: 0; } .home .span2 { grid-column: 1 / -1; }
.bars { display: flex; flex-direction: column; gap: 6px; }
.barrow { display: grid; grid-template-columns: 110px 1fr auto; gap: 8px; align-items: center; background: none; border: 0; color: var(--ink); padding: 2px 0; min-height: 28px; font-weight: 600; font-size: 13px; text-align: left; }
.barrow:hover { filter: none; } .barrow:hover .bl { color: var(--brand-text); }
.barrow .bt { height: 10px; background: var(--surface2); border-radius: 6px; overflow: hidden; } .barrow .bt i { display: block; height: 100%; background: var(--grad); border-radius: 6px; min-width: 2px; }
.barrow .bn { font-size: 12px; color: var(--muted); white-space: nowrap; }
.mini { display: flex; flex-direction: column; width: 100%; text-align: left; background: none; border: 0; border-top: 1px solid var(--line); border-radius: 0; color: var(--ink); padding: 7px 0; min-height: 0; font-weight: 500; }
.mini:first-of-type { border-top: 0; } .mini:hover { filter: none; } .mini:hover b { color: var(--brand-text); }
@media (max-width: 900px) { .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } .home { grid-template-columns: 1fr; } }

/* bulk bar */
.bulk { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 8px 12px; border-radius: 12px; background: var(--brand-soft); margin-bottom: 10px; position: sticky; top: 4px; z-index: 5; }
.bulk select, .bulk input { width: auto; min-height: 34px; padding: 5px 10px; }

/* tables: fit the screen; less important columns drop off on narrower screens */
table { width: 100%; border-collapse: collapse; table-layout: auto; }
th, td { text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; font-size: 14px; }
th { font-size: 11px; color: var(--muted); font-weight: 800; text-transform: uppercase; letter-spacing: .04em; white-space: nowrap; }
th button { background: none; border: 0; color: inherit; padding: 0; min-height: 0; font: inherit; text-transform: inherit; letter-spacing: inherit; }
td.clip { max-width: 0; width: 28%; } td.clip > *, td.clip { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
td.c-contact { width: 20%; } .num { text-align: right; white-space: nowrap; } .ck { width: 28px; padding-right: 0; }
td.c-owner, td.c-src, td.c-last { white-space: nowrap; }
tr.click { cursor: pointer; } tr.click:hover td { background: var(--brand-soft); }
@media (max-width: 1150px) { .c-src { display: none; } }
@media (max-width: 900px) { .c-last, .c-owner { display: none; } }
@media (max-width: 640px) { .c-contact, .num { display: none; } td.clip { width: auto; } }
.tlact { display: flex; gap: 10px; margin-top: 2px; }

/* lead panel */
.shade { position: fixed; inset: 0; background: rgba(5,10,24,.45); z-index: 20; }
.panel { position: fixed; top: 0; right: 0; bottom: 0; width: min(760px, 100vw); background: var(--bg); z-index: 21; overflow-y: auto; box-shadow: -20px 0 50px rgba(0,0,0,.25); padding: 18px 20px 40px; }
.panel-head { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 12px; }
.panel-head h2 { margin: 0; font-size: 22px; } .panel-head .grow { flex: 1; min-width: 0; }
.contact { display: flex; gap: 10px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); }
.contact:first-of-type { border-top: 0; } .contact .grow { flex: 1; min-width: 0; }
.task { display: flex; gap: 10px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); }
.task:first-child { border-top: 0; } .task .grow { flex: 1; min-width: 0; } .task.done .t { text-decoration: line-through; color: var(--muted); }
.tl { list-style: none; margin: 0; padding: 0; }
.tl li { position: relative; padding: 0 0 14px 22px; }
.tl li::before { content: ''; position: absolute; left: 5px; top: 6px; width: 9px; height: 9px; border-radius: 50%; background: var(--brand); }
.tl li::after { content: ''; position: absolute; left: 9px; top: 18px; bottom: 0; width: 1px; background: var(--line); }
.tl li.t-stage::before { background: var(--warn); } .tl li.t-web::before, .tl li.t-stripe::before { background: var(--ok); } .tl li.t-email::before, .tl li.t-email_in::before { background: #3aa0ff; }
.tl .h { font-size: 13px; } .tl .h b { font-weight: 800; } .tl .body { white-space: pre-wrap; font-size: 14px; margin-top: 3px; word-break: break-word; }
.custstrip { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; padding: 10px 14px; border-radius: 12px; background: var(--ok-bg); color: var(--ok); font-weight: 700; margin-bottom: 12px; }
.custstrip.warn { background: var(--warn-bg); color: var(--warn); }

/* modal */
.modal { position: fixed; inset: 0; z-index: 30; display: flex; align-items: flex-start; justify-content: center; padding: 6vh 12px; background: rgba(5,10,24,.5); overflow-y: auto; }
.modal .card { width: 100%; max-width: 640px; margin: 0; }
.modal-foot { display: flex; gap: 8px; justify-content: flex-end; margin-top: 14px; flex-wrap: wrap; }
.vars code { font-size: 12px; background: var(--surface2); padding: 1px 5px; border-radius: 6px; margin-right: 4px; }
.toast { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 10px 18px; border-radius: 12px; font-weight: 700; z-index: 40; box-shadow: var(--shadow); max-width: 90vw; }

/* tasks tab */
.group h3 { margin-top: 14px; }

/* sign-in */
.login { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px;
  background: radial-gradient(ellipse 900px 620px at 12% -8%, rgba(47,91,255,.16), transparent 60%), radial-gradient(ellipse 820px 620px at 108% 108%, rgba(23,184,132,.14), transparent 60%), var(--bg); }
.login .card { width: 100%; max-width: 420px; padding: 36px 32px 26px; display: flex; flex-direction: column; gap: 16px; border-radius: 24px; text-align: center; align-items: center; }
.login img { width: 96px; height: 96px; border-radius: 22px; box-shadow: 0 10px 26px rgba(47,91,255,.3); }
.login .title { font-size: 22px; font-weight: 800; margin: 0; }
.login .title span { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
@media (max-width: 640px) { .search { max-width: none; flex-basis: 100%; } .panel { padding: 14px; } }
@media (prefers-reduced-motion: reduce) { .spin { animation: none; } }
.filters input[type=checkbox] { min-width: 0; width: 18px; height: 18px; }

/* v1.2: goal, reports, quotes, custom fields */
.goalbar { display: block; height: 8px; background: var(--surface2); border-radius: 6px; overflow: hidden; margin: 4px 0 2px; } .goalbar i { display: block; height: 100%; background: var(--grad); border-radius: 6px; min-width: 2px; }
.vbars { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; align-items: end; height: 170px; }
.vb { display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; min-width: 0; }
.vb .vt { flex: 1; width: 100%; max-width: 46px; display: flex; align-items: flex-end; background: var(--surface2); border-radius: 6px 6px 2px 2px; overflow: hidden; }
.vb .vt i { display: block; width: 100%; background: linear-gradient(180deg, #3df0e0, #3aa0ff); border-radius: 6px 6px 0 0; min-height: 2px; }
.vb .vn { font-size: 11px; color: var(--muted); font-weight: 700; white-space: nowrap; min-height: 14px; } .vb .vl { font-size: 11px; color: var(--muted); font-weight: 700; }
table.compact th, table.compact td { padding: 5px 6px; font-size: 13px; }
@media (max-width: 640px) { table.compact .num { display: table-cell; } .c-score { display: none; } }
.qhead, .qline { display: grid; grid-template-columns: minmax(0, 1fr) 64px 92px 118px 34px; gap: 6px; align-items: center; }
.qhead { margin-top: 10px; font-weight: 700; } .qline { margin-bottom: 6px; } .qline input, .qline select { margin: 0; }
.qtotal { text-align: right; font-size: 15px; margin: 8px 0 4px; } .qtotal b { font-size: 18px; }
@media (max-width: 640px) { .qhead { display: none; } .qline { grid-template-columns: 1fr 1fr; } .qline .ql-desc { grid-column: 1 / -1; } }
.cfrow { display: grid; grid-template-columns: minmax(0, 1fr) 150px minmax(0, 1fr) 34px; gap: 6px; align-items: center; margin-bottom: 6px; } .cfrow input, .cfrow select { margin: 0; }
.cfrow .cf-opts[hidden] { display: block; visibility: hidden; }
@media (max-width: 640px) { .cfrow { grid-template-columns: 1fr 1fr; } .cfrow .cf-label { grid-column: 1 / -1; } }
@media print { header, nav, .tabs, .filters, #rp-days, #rp-print, .panel, .toast { display: none !important; } body { background: #fff; } .card { box-shadow: none; break-inside: avoid; } }
.tl li.t-open::before { background: #3df0e0; } .tl li.t-quote::before { background: #7be04a; }
