/* Avalon Studio — tracker styles. Mobile first. */
:root {
  --ink: #132a45; --ink2: #4b5563; --muted: #6b7280; --line: #d3dce2; --bg: #f2f5f7; --card: #fff;
  --accent: #146897; --accent-d: #1e3a5f; --good: #1b7f5a; --good-bg: #d5f1e4; --warn: #1e3a5f; --warn-bg: #dce9f3;
  --bad: #b91c1c; --bad-bg: #fdeaea; --info-bg: #eef2f7; --r: 14px; --tap: 44px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 16px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; color: var(--ink); background: var(--bg); }
a { color: var(--accent-d); }
h1 { font-size: 1.55rem; margin: 0; line-height: 1.2; }
h2 { font-size: 1.08rem; margin: 0 0 .6rem; }
h2.inline { display: inline; }
h3 { font-size: .98rem; margin: 0; }
.muted { color: var(--muted); }
.small { font-size: .86rem; }
.pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.break { overflow-wrap: anywhere; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.req { color: var(--bad); }
.loading { padding: 2rem; color: var(--muted); }

/* top bar + nav */
.topbar { position: sticky; top: 0; z-index: 20; background: var(--ink); color: #fff; display: flex; align-items: center; justify-content: space-between; padding: .55rem 1rem; padding-top: calc(.55rem + env(safe-area-inset-top, 0px)); }
.brand { color: #fff; text-decoration: none; display: flex; flex-direction: column; line-height: 1.1; }
.brand-name { font-weight: 700; letter-spacing: .06em; text-transform: uppercase; font-size: 1.02rem; }
.brand-sub { font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; opacity: .75; }
.nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: grid; grid-template-columns: repeat(5, 1fr); background: #fff; border-top: 1px solid var(--line); padding-bottom: var(--safe-b); box-shadow: 0 -2px 10px rgba(0,0,0,.05); }
.nav a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 58px; text-decoration: none; color: var(--ink2); font-size: .74rem; font-weight: 600; }
.nav a .ico { font-size: 1.25rem; line-height: 1; }
.nav a.active { color: var(--accent-d); }
.nav a.active .ico { transform: scale(1.1); }
.nav-add .ico { background: var(--accent); color: #fff; border-radius: 50%; width: 30px; height: 30px; display: grid; place-items: center; font-size: 1.1rem; }
.app { max-width: 1200px; margin: 0 auto; padding: 1rem .85rem calc(84px + var(--safe-b)); }
body.is-login .app { padding-bottom: 1rem; }

@media (min-width: 900px) {
  .nav { position: static; display: flex; gap: .25rem; background: transparent; border: 0; box-shadow: none; padding: 0; }
  .nav a { flex-direction: row; min-height: 40px; padding: 0 .8rem; color: #e5e7eb; font-size: .95rem; border-radius: 10px; gap: .4rem; }
  .nav a .ico { font-size: 1rem; }
  .nav a.active { color: #fff; background: rgba(255,255,255,.14); }
  .nav-add .ico { width: 22px; height: 22px; font-size: .9rem; }
  .app { padding: 1.4rem 1.5rem 3rem; }
}

/* layout */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: .75rem; flex-wrap: wrap; margin: .2rem 0 1rem; }
.card { background: var(--card); border-radius: var(--r); padding: 1rem; box-shadow: 0 1px 2px rgba(0,0,0,.06), 0 0 0 1px rgba(0,0,0,.03); margin-bottom: .9rem; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .5rem; flex-wrap: wrap; }
.card-head h2, .card-head h3 { margin: 0; }
.grid-2 { display: grid; gap: 0 .9rem; grid-template-columns: 1fr; }
.grid-2 > .card { min-width: 0; }
@media (min-width: 900px) {
  .grid-2 { grid-template-columns: 1fr 1fr; align-items: start; }
  .grid-2 .wide { grid-column: 1 / -1; }
  .client-grid { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
}
.col { min-width: 0; }
.count { display: inline-block; min-width: 1.6em; padding: 0 .45em; border-radius: 999px; background: var(--info-bg); color: var(--ink2); font-size: .8rem; text-align: center; font-weight: 600; vertical-align: middle; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .35rem; min-height: var(--tap); padding: 0 1rem; border-radius: 11px; border: 1px solid var(--line); background: #fff; color: var(--ink); font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; white-space: nowrap; }
.btn:hover { border-color: #cbd5e1; }
.btn.small { min-height: 40px; padding: 0 .8rem; font-size: .9rem; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-d); }
.btn.ghost { background: transparent; }
.btn.danger { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .6; }
.danger-t { color: var(--bad) !important; }
.good-t { color: var(--good); font-weight: 600; }
.warn-t { color: var(--warn); font-weight: 600; }
.bad-t { color: var(--bad); font-weight: 600; }
.btn-row { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.icon-btn { width: var(--tap); height: var(--tap); border: 0; background: transparent; font-size: 1.2rem; cursor: pointer; border-radius: 10px; color: var(--ink2); }
.link-btn { border: 0; background: none; color: var(--accent-d); font: inherit; font-size: .88rem; font-weight: 600; padding: .45rem .3rem; min-height: 36px; cursor: pointer; text-decoration: underline; }
.back { display: inline-block; text-decoration: none; font-weight: 600; padding: .3rem 0; margin-bottom: .2rem; }

/* badges + flags */
.badge { display: inline-block; padding: .14rem .55rem; border-radius: 999px; font-size: .78rem; font-weight: 600; background: var(--info-bg); color: var(--ink2); white-space: nowrap; vertical-align: middle; }
.badge.good { background: var(--good-bg); color: var(--good); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.bad { background: var(--bad-bg); color: var(--bad); }
.badge.src { background: #eef4f7; color: var(--accent-d); }
.badge.ph-lead { background: #e8effc; color: #1d4ed8; }
.badge.ph-proposal { background: #f3e8fd; color: #7e22ce; }
.badge.ph-job { background: var(--good-bg); color: var(--good); }
.badge.ph-closed { background: #eceff3; color: #374151; }
.badge.ph-archived { background: #eceff3; color: #6b7280; }
.badge.ph-lost { background: var(--bad-bg); color: var(--bad); }
.flag { border-radius: 10px; padding: .55rem .75rem; margin: .4rem 0 .6rem; font-size: .92rem; font-weight: 600; }
.flag.bad { background: var(--bad-bg); color: var(--bad); }
.flag.warn { background: var(--warn-bg); color: var(--warn); }

/* lists */
.list { display: flex; flex-direction: column; }
.item { border-top: 1px solid var(--line); padding: .55rem 0; }
.item:first-child { border-top: 0; padding-top: 0; }
.item.sub { display: flex; justify-content: space-between; gap: .5rem; align-items: flex-start; flex-wrap: wrap; }
.item.sub .row-main { flex: 1 1 200px; }
.item.done { opacity: .6; }
.item.flag-red { background: var(--bad-bg); border-left: 4px solid var(--bad); padding-left: .6rem; border-radius: 6px; }
.row-link { display: flex; align-items: center; gap: .5rem; text-decoration: none; color: inherit; min-height: var(--tap); padding: .15rem 0; }
.row-main { flex: 1; min-width: 0; }
.row-title { font-weight: 650; }
.row-sub { color: var(--ink2); font-size: .9rem; margin-top: .12rem; overflow-wrap: anywhere; }
.chev { font-size: 1.5rem; color: #9ca3af; }
.item-actions { display: flex; gap: .4rem; flex-wrap: wrap; margin-top: .35rem; }
.item.sub .item-actions { margin-top: 0; }

/* leads */
.filters input[type=search] { width: 100%; }
.filter-row { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; margin-top: .6rem; align-items: center; }
.filter-row select { width: 100%; }
@media (min-width: 900px) { .filter-row { grid-template-columns: repeat(3, minmax(0, 1fr)) auto auto; } }
.chk { display: flex; align-items: center; gap: .45rem; min-height: var(--tap); font-size: .92rem; font-weight: 600; }
.chk input { width: 22px; height: 22px; }
.count-line { margin: .2rem .2rem .6rem; }
.cards { display: block; background: var(--card); border-radius: var(--r); box-shadow: 0 1px 2px rgba(0,0,0,.06), 0 0 0 1px rgba(0,0,0,.03); overflow: hidden; }
.lead-card { display: block; text-decoration: none; color: inherit; margin: 0; border-radius: 0; box-shadow: none; padding: .7rem 1rem; border-bottom: 1px solid var(--line); }
.lead-card:last-child { border-bottom: 0; }
.lead-card:hover, .lead-card:active { background: #fbfaf8; }
.lead-top { display: flex; justify-content: space-between; gap: .5rem; align-items: flex-start; }
.lead-name { font-weight: 700; font-size: 1.05rem; }
.lead-badges { display: flex; flex-wrap: wrap; gap: .3rem; margin: .35rem 0; }
.lead-sum { color: var(--ink2); font-size: .92rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.lead-meta { display: flex; flex-wrap: wrap; gap: .25rem .8rem; margin-top: .4rem; font-size: .83rem; color: var(--muted); }
.lead-meta .hl { color: var(--accent-d); font-weight: 600; }

/* client */
.client-head h1 { font-size: 1.6rem; }
.quick .btn { min-width: 64px; }
.kv { display: grid; grid-template-columns: 7.2rem 1fr; gap: .5rem; padding: .42rem 0; border-top: 1px solid var(--line); }
.kv:first-of-type { border-top: 0; }
.kv .k { color: var(--muted); font-size: .88rem; }
.kv .v { overflow-wrap: anywhere; }
.kv a { font-weight: 600; }
details summary { cursor: pointer; font-weight: 600; min-height: 36px; display: flex; align-items: center; gap: .4rem; list-style: none; }
details summary::-webkit-details-marker { display: none; }
details summary::before { content: '▸'; color: var(--muted); }
details[open] summary::before { content: '▾'; }
.notes-box { margin-top: .5rem; border-top: 1px solid var(--line); padding-top: .4rem; }
.notes-box .pre { font-size: .9rem; color: var(--ink2); max-height: 22rem; overflow: auto; }
.sub-card { border: 1px solid var(--line); border-radius: 12px; padding: .75rem; margin-top: .6rem; }
.sub-card.project { background: #fcfbf9; }
.sub-head { display: flex; justify-content: space-between; gap: .5rem; }
.dates { display: flex; flex-wrap: wrap; gap: .2rem .9rem; font-size: .86rem; color: var(--ink2); margin: .35rem 0; }
.co-wrap { margin-top: .7rem; border-top: 1px dashed #d6d3cd; padding-top: .6rem; }
.co-list { display: flex; flex-direction: column; gap: .45rem; }
.co { display: grid; grid-template-columns: 1fr auto; gap: .2rem .6rem; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: .55rem .65rem; }
.co-desc { font-weight: 600; overflow-wrap: anywhere; }
.co-amt { font-weight: 700; text-align: right; white-space: nowrap; }
.co .item-actions { grid-column: 1 / -1; margin-top: .1rem; }
.proj-tot { display: flex; flex-wrap: wrap; gap: .3rem 1rem; margin: .7rem 0 .3rem; font-size: .92rem; }
.danger-zone { text-align: center; background: transparent; box-shadow: none; }

/* timeline */
.timeline { list-style: none; margin: 0; padding: 0 0 0 .2rem; }
.timeline li { position: relative; padding: 0 0 .9rem 1.3rem; border-left: 2px solid var(--line); }
.timeline li:last-child { border-left-color: transparent; }
.timeline li::before { content: ''; position: absolute; left: -7px; top: .25rem; width: 12px; height: 12px; border-radius: 50%; background: #9ca3af; border: 2px solid #fff; box-shadow: 0 0 0 1px #d1d5db; }
.timeline .tl-inquiry::before { background: #2563eb; }
.timeline .tl-contact::before { background: var(--accent); }
.timeline .tl-appointment::before { background: #7c3aed; }
.timeline .tl-proposal::before { background: #db2777; }
.timeline .tl-project::before, .timeline .tl-change_order::before { background: var(--good); }
.timeline .tl-followup::before { background: var(--warn); }
.tl-date { font-size: .8rem; color: var(--muted); font-weight: 600; }
.tl-title { font-weight: 600; overflow-wrap: anywhere; }
.tl-body .pre { color: var(--ink2); margin-top: .15rem; }
.tl-actions { display: flex; gap: .4rem; }
.history { list-style: none; margin: .5rem 0 0; padding: 0; }
.history li { border-top: 1px solid var(--line); padding: .5rem 0; overflow-wrap: anywhere; }

/* totals */
.tot-grid { display: grid; grid-template-columns: 1fr; gap: .6rem; }
.totals .tot-grid { grid-template-columns: 1fr 1fr; }
.totals .tot-grid .tot:last-child { grid-column: 1 / -1; }
@media (min-width: 700px) { .tot-grid.big { grid-template-columns: repeat(3, 1fr); } }
.tot { border-radius: 12px; padding: .75rem .85rem; background: var(--info-bg); }
.tot.good { background: var(--good-bg); }
.tot.warn { background: var(--warn-bg); }
.tot .tl { font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; font-weight: 700; color: var(--ink2); }
.tot .tv { font-size: 1.5rem; font-weight: 750; margin: .1rem 0; }
.tot.good .tv { color: var(--good); }
.tot.warn .tv { color: var(--warn); }
.tot-grid.big { margin-bottom: .5rem; }
.tot-grid.big .tot { background-clip: padding-box; box-shadow: 0 0 0 1px rgba(0,0,0,.03); }

/* pipeline bars + tables */
.bars { display: flex; flex-direction: column; gap: .35rem; }
.bar-row { display: grid; grid-template-columns: 6.5rem 1fr 2.2rem; gap: .6rem; align-items: center; text-decoration: none; color: inherit; min-height: 38px; }
.bar-label { font-weight: 600; font-size: .92rem; }
.bar { height: 14px; background: var(--info-bg); border-radius: 999px; overflow: hidden; }
.bar span { display: block; height: 100%; width: 0; background: var(--accent); border-radius: 999px; }
.bar.src span { background: #2f6f8f; }
.bar-n { text-align: right; font-weight: 700; }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -1rem; padding: 0 1rem; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; min-width: 520px; }
th, td { text-align: left; padding: .5rem .45rem; border-top: 1px solid var(--line); vertical-align: top; }
th { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); border-top: 0; }
.num { text-align: right; white-space: nowrap; }

/* forms */
.fields { display: flex; flex-wrap: wrap; gap: 0 .75rem; }
.field { flex: 1 1 100%; margin-bottom: .75rem; min-width: 0; }
.field.half { flex: 1 1 calc(50% - .75rem); min-width: 130px; }
.field label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: .25rem; }
.field.check label { display: flex; align-items: center; gap: .55rem; min-height: var(--tap); font-weight: 600; }
.field.check input { width: 22px; height: 22px; }
.hint { font-size: .8rem; color: var(--muted); margin-top: .2rem; }
input[type=text], input[type=search], input[type=tel], input[type=email], input[type=password], input[type=date], input[type=time], input[type=number], input:not([type]), select, textarea {
  width: 100%; min-height: var(--tap); padding: .55rem .7rem; border: 1px solid #d1d5db; border-radius: 10px; background: #fff; color: var(--ink);
  font: inherit; font-size: 16px; /* 16px stops iPhone from zooming in */ -webkit-appearance: none; appearance: none;
}
select { background-image: linear-gradient(45deg, transparent 50%, #6b7280 50%), linear-gradient(135deg, #6b7280 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 2rem; }
textarea { min-height: 90px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.money-in { display: flex; align-items: center; border: 1px solid #d1d5db; border-radius: 10px; background: #fff; padding-left: .7rem; }
.money-in span { color: var(--muted); font-weight: 600; }
.money-in input { border: 0; outline-offset: 0; }
.err { background: var(--bad-bg); color: var(--bad); border-radius: 10px; padding: .6rem .8rem; font-weight: 600; margin-bottom: .75rem; }
.err[hidden] { display: none; }
.form-card { max-width: 720px; }

/* dialog */
.dlg { border: 0; padding: 0; border-radius: 16px; width: min(640px, calc(100vw - 1.2rem)); max-height: calc(100dvh - 1.5rem); box-shadow: 0 20px 50px rgba(0,0,0,.3); color: var(--ink); }
.dlg::backdrop { background: rgba(17, 24, 39, .5); }
.dlg form { display: flex; flex-direction: column; max-height: calc(100dvh - 1.5rem); }
.dlg-head { display: flex; justify-content: space-between; align-items: center; padding: .7rem .7rem .4rem 1rem; border-bottom: 1px solid var(--line); }
.dlg-head h2 { margin: 0; }
.dlg-body { padding: 1rem; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.dlg-foot { display: flex; justify-content: flex-end; gap: .5rem; padding: .7rem 1rem calc(.7rem + var(--safe-b)); border-top: 1px solid var(--line); background: #fafafa; }
.intro { margin-top: 0; }
@media (max-width: 600px) {
  .dlg { width: 100vw; max-width: 100vw; margin: auto 0 0; border-radius: 16px 16px 0 0; max-height: 92dvh; }
  .dlg form { max-height: 92dvh; }
  .dlg-foot .btn { flex: 1; }
}

/* login */
.login { min-height: calc(100dvh - 2rem); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1.2rem; }
.login-brand { text-align: center; color: var(--ink); }
.login-brand .brand-name { font-size: 1.7rem; }
.login-brand .brand-sub { font-size: .8rem; opacity: .7; margin-top: .25rem; }
.login-card { width: min(420px, 100%); padding: 1.4rem; }
.login-card h1 { margin-bottom: 1rem; font-size: 1.3rem; }

/* toast */
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(76px + var(--safe-b)); z-index: 100; background: var(--ink); color: #fff; padding: .7rem 1.1rem; border-radius: 12px; font-weight: 600; box-shadow: 0 6px 20px rgba(0,0,0,.25); max-width: calc(100vw - 2rem); }
.toast.bad { background: var(--bad); }
.toast[hidden] { display: none; }
@media (min-width: 900px) { .toast { bottom: 1.5rem; } }
[hidden] { display: none !important; }

/* calendar v2 (read-only) */
.nav { grid-template-columns: repeat(6, 1fr); }
.cv { --cv-lead:#2563eb; --cv-appt:#16a34a; --cv-apptd:#86c49b; --cv-cx:#9ca3af; --cv-contact:#dc2626; --cv-todo:#4d7c0f; --cv-job:#7c3aed; --cv-line:var(--line,#e5e7eb); --cv-tap:var(--tap,44px); }
.cv button, .cv a.cv-btn, .cv select, .cv input { font: inherit; }
.cv-tabs { display:flex; gap:4px; flex-wrap:wrap; margin:0 0 .6rem; }
.cv-tab { flex:1 1 0; min-height:var(--cv-tap); min-width:64px; border:1px solid var(--cv-line); background:#fff; border-radius:10px; font-weight:600; cursor:pointer; padding:0 .5rem; }
.cv-tab.on { background:#1f2937; color:#fff; border-color:#1f2937; }
.cv-nav { display:flex; align-items:center; gap:6px; margin-bottom:.6rem; }
.cv-title { flex:1; margin:0; text-align:center; font-size:1.05rem; }
.cv-btn { display:inline-flex; align-items:center; justify-content:center; min-height:var(--cv-tap); min-width:var(--cv-tap); padding:0 .8rem; border:1px solid var(--cv-line); border-radius:10px; background:#fff; color:#111827; text-decoration:none; font-weight:600; cursor:pointer; vertical-align:middle; }
.cv-btn.primary { background:#1f2937; color:#fff; border-color:#1f2937; }
.cv-btn.ghost { background:#f9fafb; }
.cv-grid { display:grid; grid-template-columns:repeat(7,minmax(0,1fr)); gap:3px; }
.cv-dow { text-align:center; font-size:.75rem; font-weight:700; color:#6b7280; padding:2px 0; }
.cv-cell { min-height:62px; border:1px solid var(--cv-line); border-radius:8px; background:#fff; padding:3px; display:flex; flex-direction:column; align-items:stretch; gap:2px; cursor:pointer; text-align:start; overflow:hidden; }
.cv-cell.out { opacity:.4; }
.cv-cell.today { outline:2px solid #1f2937; outline-offset:-2px; }
.cv-cell.sel { box-shadow:inset 0 0 0 2px #2563eb; }
.cv-cell.busy1 { background:#fff4e5; border-color:#f3c98b; }
.cv-cell.busy2 { background:#ffe2c2; border-color:#e59a3c; border-width:2px; }
.cv-num { font-weight:700; font-size:.85rem; }
.cv-dots { display:flex; flex-wrap:wrap; gap:2px; align-items:center; }
.cv-dot { display:inline-flex; align-items:center; justify-content:center; border-radius:999px; color:#fff; font-weight:700; line-height:1; font-size:.62rem; min-width:15px; height:15px; padding:0 3px; vertical-align:middle; }
.cv-dot.lv2 { min-width:19px; height:19px; font-size:.7rem; }
.cv-dot.lv3 { min-width:24px; height:24px; font-size:.78rem; box-shadow:0 0 0 2px rgba(0,0,0,.12); }
.k-lead { background:var(--cv-lead); }
.k-client { background:#fff; color:var(--cv-lead); border:2px solid var(--cv-lead); }
.k-appt { background:var(--cv-appt); }
.k-apptdone { background:var(--cv-apptd); }
.k-apptcx { background:var(--cv-cx); text-decoration:line-through; }
.k-contact { background:var(--cv-contact); }
.k-todo { background:var(--cv-todo); }
.k-todo.red { background:var(--cv-contact); box-shadow:0 0 0 2px #fecaca; }
.k-job { background:var(--cv-job); }
.cv-legend { display:flex; flex-wrap:wrap; gap:.3rem .8rem; font-size:.8rem; margin:.6rem 0 .2rem; }
.cv-sec { background:#fff; border:1px solid var(--cv-line); border-radius:12px; padding:.7rem; margin:.7rem 0; }
.cv-sec h3 { margin:0 0 .5rem; font-size:1rem; }
.cv-count { display:inline-block; background:#eef2f7; border-radius:999px; padding:0 .5rem; font-size:.8rem; }
.cv-item { display:block; width:100%; text-align:start; border-top:1px solid var(--cv-line); padding:.55rem 0; background:none; border-left:0; border-right:0; border-bottom:0; }
.cv-item:first-of-type { border-top:0; }
button.cv-item { min-height:var(--cv-tap); cursor:pointer; }
.cv-row { display:flex; flex-wrap:wrap; align-items:center; gap:.5rem; margin-top:.25rem; }
.cv-addr { margin-top:.25rem; display:flex; flex-wrap:wrap; align-items:center; gap:.4rem; }
.cv-lbl { font-size:.78rem; font-weight:700; color:#6b7280; }
.cv-small { font-size:.85rem; }
.cv-muted { color:#6b7280; }
.cv-bad, .cv .bad { color:#b91c1c; }
.cv-name { font-weight:700; }
.cv-tag { display:inline-block; background:#dce9f3; color:#1e3a5f; border-radius:6px; padding:0 .35rem; font-size:.78rem; font-weight:700; }
.cv-badge { display:inline-block; padding:.1rem .5rem; border-radius:999px; font-size:.75rem; font-weight:600; background:#eef2f7; color:#374151; white-space:nowrap; vertical-align:middle; }
.cv-badge.ph-lead { background:#e8effc; color:#1d4ed8; } .cv-badge.ph-proposal { background:#f3e8fd; color:#7e22ce; } .cv-badge.ph-job { background:#e7f6ec; color:#15803d; }
.cv-badge.ph-closed, .cv-badge.ph-archived { background:#eceff3; color:#6b7280; } .cv-badge.ph-lost { background:#fde8e8; color:#b91c1c; }
.cv-badge.src { background:#eef4f7; color:#1e3a5f; } .cv-badge.warn { background:#dce9f3; color:#1e3a5f; } .cv-badge.bad { background:#fde8e8; color:#b91c1c; }
.cv-badge.st-sched { background:#e7f6ec; color:#15803d; } .cv-badge.st-done { background:#eef7f1; color:#4d8a63; } .cv-badge.st-cx { background:#eceff3; color:#6b7280; text-decoration:line-through; }
.cv-badge.k-job-b { background:#efe7fd; color:#6d28d9; }
.cv-appt.st-sched { border-inline-start:4px solid var(--cv-appt); padding-inline-start:.5rem; }
.cv-appt.st-done { border-inline-start:4px solid var(--cv-apptd); padding-inline-start:.5rem; opacity:.85; }
.cv-appt.st-cx { border-inline-start:4px solid var(--cv-cx); padding-inline-start:.5rem; color:#6b7280; }
.cv-appt.st-cx .cv-name { text-decoration:line-through; }
.cv .flag-red { background:#fde8e8; border-inline-start:4px solid var(--cv-contact); padding-inline-start:.5rem; }
.cv-done { opacity:.6; }
.cv-visits { margin-top:.35rem; padding-inline-start:.6rem; border-inline-start:2px solid #dbeafe; }
.cv-lead { border-inline-start:4px solid var(--cv-lead); padding-inline-start:.5rem; }
.cv-week { display:grid; grid-template-columns:1fr; gap:8px; }
.cv-wday { border:1px solid var(--cv-line); border-radius:10px; background:#fff; padding:4px; }
.cv-wday.today { outline:2px solid #1f2937; }
.cv-wh { display:flex; flex-wrap:wrap; gap:4px; align-items:center; width:100%; min-height:var(--cv-tap); border:0; background:#f3f4f6; border-radius:8px; font-weight:700; cursor:pointer; padding:0 .4rem; }
.cv-slots { display:grid; gap:2px; margin-top:4px; }
.cv-slot { display:flex; gap:.4rem; align-items:flex-start; border-radius:6px; padding:.25rem .4rem; font-size:.82rem; min-height:28px; }
.cv-slot.free { background:#f9fafb; color:#6b7280; }
.cv-slot.taken { background:var(--cv-appt); color:#fff; } .cv-slot.taken a, .cv-slot.taken b { color:#fff; }
.cv-h { flex:0 0 3.6rem; font-weight:700; }
.cv-notime { font-size:.82rem; margin-top:4px; background:#dce9f3; border-radius:6px; padding:.25rem .4rem; }
.cv-fc-row { display:flex; flex-wrap:wrap; gap:.5rem; align-items:flex-end; }
.cv-fc-row label { display:flex; flex-direction:column; gap:2px; }
.cv-fc-row input, .cv-fc-row select { min-height:var(--cv-tap); border:1px solid var(--cv-line); border-radius:10px; padding:0 .5rem; background:#fff; font-size:16px; }
.cv-fc-res { margin-top:.5rem; border-radius:10px; padding:.6rem; }
.cv-fc-res.free { background:#e7f6ec; color:#14532d; } .cv-fc-res.taken { background:#fde8e8; color:#7f1d1d; } .cv-fc-res.bad { background:#dce9f3; }
.cv-dayhead { margin-bottom:.4rem; } .cv-counts { margin:.3rem 0; font-size:.88rem; }
.cv-daygrid { display:grid; grid-template-columns:1fr; gap:0 12px; }
.cv-over h3 { color:#b91c1c; }
.cv-heavy { font-size:.9rem; }
.cv-ltr { unicode-bidi:isolate; }
.cv-big { margin:.4rem 0; font-size:1.05rem; } .cv-bign { font-size:2rem; font-weight:800; color:var(--cv-lead); vertical-align:middle; }
.cv-range { margin:.4rem 0 0; font-weight:600; }
.cv-tw { overflow-x:auto; -webkit-overflow-scrolling:touch; margin:.5rem 0; }
.cv-rep, .cv-mx { border-collapse:collapse; width:100%; font-size:.88rem; }
.cv-rep th, .cv-rep td, .cv-mx th, .cv-mx td { border:1px solid var(--cv-line); padding:.2rem .4rem; text-align:center; }
.cv-rep th[scope=row], .cv-mx th[scope=row] { text-align:start; white-space:nowrap; }
.cv-rep tr.cv-tot { background:#f3f4f6; font-weight:700; }
.cv-cnt { min-height:var(--cv-tap); min-width:var(--cv-tap); border:1px solid #bfdbfe; background:#eff6ff; color:#1d4ed8; border-radius:10px; font-weight:700; cursor:pointer; }
.cv-cnt.on { background:#1d4ed8; color:#fff; }
.cv-zero { color:#9ca3af; }
.cv-mx.days td, .cv-mx.days th { padding:.15rem .25rem; min-width:1.4rem; font-size:.78rem; }
.cv-mx td.lv1 { background:#dbeafe; } .cv-mx td.lv2 { background:#93c5fd; } .cv-mx td.lv3 { background:#2563eb; color:#fff; }
@media (max-width:420px) { .cv-cell { min-height:54px; padding:2px; } .cv-dot { min-width:13px; height:13px; font-size:.58rem; padding:0 2px; } .cv-dot.lv2 { min-width:16px; height:16px; } .cv-dot.lv3 { min-width:20px; height:20px; } }
@media (min-width:900px) { .cv-week { grid-template-columns:repeat(7,minmax(0,1fr)); gap:4px; } .cv-week .cv-slot { flex-direction:column; gap:0; font-size:.75rem; } .cv-week .cv-h { flex:none; } .cv-cell { min-height:84px; } .cv-daygrid { grid-template-columns:minmax(260px,1fr) 2fr; } }
/* end calendar v2 */

/* header logo */
.brand-logo { display:block; height:34px; width:auto; max-width:140px; }
/* end header logo */

/* add-lead green */
.nav-add .ico { background: #1f9d55; }
a.btn.primary[href="#/add"] { background: #1f9d55; border-color: #1f9d55; color: #fff; }
a.btn.primary[href="#/add"]:hover { background: #17803f; border-color: #17803f; }
/* end add-lead green */

/* login logo */
.login-logo { background:#1e3a5f; border-radius:14px; padding:.9rem 1.2rem; display:inline-block; }
.login-logo img { display:block; height:64px; width:auto; max-width:240px; }
/* end login logo */

/* back button */
.back-btn { flex: none; border: 1px solid rgba(255,255,255,.35); background: transparent; color: #fff; font: inherit; font-size: .9rem; font-weight: 600; padding: .3rem .8rem; min-height: 34px; border-radius: 999px; cursor: pointer; margin-right: .6rem; }
.back-btn:hover { background: rgba(255,255,255,.14); }
.back-btn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.back-btn[hidden] { display: none; }
/* end back button */

/* today border */
.today-grid > .card { border: 3px solid #20c494; box-shadow: none; }
/* end today border */

/* contacts dividers */
.lead-card { border-bottom: 3px solid #20c494; }
.lead-card:last-child { border-bottom: 0; }
/* end contacts dividers */

/* today client dividers */
.today-grid .list:has(> .item:nth-child(3)) > .item { padding: .8rem 0; }
.today-grid .list:has(> .item:nth-child(3)) > .item + .item { border-top: 3px solid #20c494; }
.today-grid .list:has(> .item:nth-child(3)) > .item:first-child { padding-top: 0; }
.today-grid .list:has(> .item:nth-child(3)) > .item:last-child { padding-bottom: 0; }
.today-grid .list:has(> .item:nth-child(3)) > .item.flag-red { padding: .8rem .6rem; }
.today-grid .list:has(> .item:nth-child(3)) > .item.flag-red:first-child { padding-top: .8rem; }
/* end today client dividers */
