/* Cleburne Leads: staff app for website appointment requests. Brand matches cleburnedentist.co. */
:root {
  --teal: #0B6060; --teal-2: #0E7A7A; --teal-soft: #E3F0EE; --ink: #1B1C18; --muted: #5B615F; --line: #E4DED2;
  --bg: #F6F3EC; --card: #FFFEFA; --danger: #A63A2B; --shadow: 0 1px 2px rgba(27,28,24,.06), 0 6px 18px rgba(27,28,24,.06);
  --r: 14px; --safe-b: env(safe-area-inset-bottom, 0px); --safe-t: env(safe-area-inset-top, 0px);
  --st-new: #1F6FB2; --st-called: #9A6A12; --st-no_answer: #B4531D; --st-confirmed: #2F7D4F; --st-in_weave: #0B6060; --st-not_interested: #6B7280; --st-cancelled: #8E3B33;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--ink); font: 15px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--teal); }
h1, h2, h3 { margin: 0; font-weight: 650; letter-spacing: -.01em; }
.hide { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

.boot { min-height: 100vh; display: grid; place-items: center; }
.boot__logo { width: 72px; height: 72px; border-radius: 18px; opacity: .9; animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(.94); opacity: .6; } }

/* ---------- buttons & fields ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--line); background: var(--card); border-radius: 10px;
  padding: 9px 14px; font-weight: 600; cursor: pointer; text-decoration: none; color: var(--ink); min-height: 40px; white-space: nowrap; }
.btn:hover { border-color: #cfc7b8; }
.btn:disabled { opacity: .55; cursor: default; }
.btn--primary { background: var(--teal); border-color: var(--teal); color: #fff; }
.btn--primary:hover { background: var(--teal-2); border-color: var(--teal-2); }
.btn--ghost { background: transparent; border-color: transparent; }
.btn--danger { color: var(--danger); }
.btn--block { width: 100%; }
.btn--sm { padding: 6px 10px; min-height: 32px; font-size: 13px; }
.btn svg { width: 18px; height: 18px; flex: none; }
.field { display: block; margin: 0 0 14px; }
.field > span { display: block; font-size: 13px; font-weight: 600; margin: 0 0 6px; color: var(--muted); }
.input { width: 100%; border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 11px 12px; min-height: 44px; outline: none; }
.input:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(11,96,96,.15); }
textarea.input { min-height: 80px; resize: vertical; }
.err { color: var(--danger); font-size: 14px; margin: 0 0 12px; min-height: 0; }
.err:empty { display: none; }

/* ---------- login ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px calc(24px + var(--safe-b)); }
.auth__card { width: 100%; max-width: 400px; background: var(--card); border-radius: 20px; box-shadow: var(--shadow); padding: 28px 24px; }
.auth__brand { display: flex; align-items: center; gap: 12px; margin: 0 0 22px; }
.auth__brand img { width: 44px; height: 44px; border-radius: 12px; }
.auth__brand b { display: block; font-size: 19px; }
.auth h2 { font-size: 20px; margin: 0 0 6px; }
.auth p { margin: 0 0 16px; }
.auth__links { margin-top: 14px; text-align: center; }
.auth__links button { background: none; border: 0; color: var(--teal); cursor: pointer; font-weight: 600; padding: 6px; }
.pw { position: relative; display: block; }
.pw .input { padding-right: 68px; }
.pw__eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: none; color: var(--teal); font-weight: 700; font-size: 13px; padding: 8px 10px; cursor: pointer; border-radius: 8px; }
.pw__eye:hover { background: var(--teal-soft); }
.qr { display: block; margin: 6px auto 12px; width: 180px; height: 180px; image-rendering: pixelated; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.secret { font-family: ui-monospace, Consolas, monospace; font-size: 13px; word-break: break-all; background: var(--bg); border-radius: 8px; padding: 8px 10px; margin: 0 0 14px; }
.steps { margin: 0 0 14px; padding-left: 20px; } .steps li { margin: 0 0 6px; }
.code-input { letter-spacing: .35em; font-size: 22px; text-align: center; font-variant-numeric: tabular-nums; }

/* ---------- shell ---------- */
.top { position: sticky; top: 0; z-index: 20; background: rgba(246,243,236,.92); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line); padding: calc(10px + var(--safe-t)) 16px 10px; display: flex; align-items: center; gap: 14px; }
.top__brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 16px; }
.top__brand img { width: 30px; height: 30px; border-radius: 8px; }
.tabs { display: flex; gap: 4px; margin-left: 12px; }
.tab { border: 0; background: none; padding: 8px 12px; border-radius: 9px; font-weight: 600; color: var(--muted); cursor: pointer; display: inline-flex; gap: 7px; align-items: center; }
.tab svg { width: 18px; height: 18px; }
.tab.on { background: var(--teal-soft); color: var(--teal); }
.tab .count { background: var(--st-new); color: #fff; border-radius: 99px; font-size: 11px; padding: 1px 7px; font-weight: 700; }
.top__right { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.iconbtn { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 10px; border: 1px solid transparent; background: none; cursor: pointer; color: var(--ink); position: relative; }
.iconbtn:hover { background: #fff; border-color: var(--line); }
.iconbtn svg { width: 20px; height: 20px; }
.iconbtn .dot { position: absolute; top: 8px; right: 8px; width: 8px; height: 8px; border-radius: 50%; background: #D9822B; }
.who { font-size: 13px; color: var(--muted); margin-right: 4px; }
.main { max-width: 1240px; margin: 0 auto; padding: 18px 16px calc(28px + var(--safe-b)); }
.bottom { display: none; }

/* ---------- requests ---------- */
.split { display: grid; grid-template-columns: minmax(320px, 400px) 1fr; gap: 18px; align-items: start; }
.listhead { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 12px; }
.chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { border: 1px solid var(--line); background: var(--card); border-radius: 99px; padding: 6px 12px; font-weight: 600; font-size: 13px; cursor: pointer; white-space: nowrap; }
.chip.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip i { font-style: normal; opacity: .7; margin-left: 4px; }
.search { flex: 1 1 100%; }
.list { display: flex; flex-direction: column; gap: 8px; }
.lead { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; text-align: left; width: 100%; background: var(--card); border: 1px solid var(--line);
  border-radius: 12px; padding: 12px 14px; cursor: pointer; position: relative; box-shadow: 0 1px 1px rgba(0,0,0,.02); }
.lead:hover { border-color: #cfc7b8; }
.lead.on { border-color: var(--teal); box-shadow: 0 0 0 2px rgba(11,96,96,.18); }
.lead__name { font-weight: 650; font-size: 15.5px; display: flex; align-items: center; gap: 8px; min-width: 0; }
.lead__name span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lead__new { width: 9px; height: 9px; border-radius: 50%; background: var(--st-new); flex: none; }
.lead__when { font-size: 12.5px; color: var(--muted); text-align: right; white-space: nowrap; }
.lead__slot { font-size: 13.5px; color: var(--ink); }
.lead__slot.off { color: var(--muted); text-decoration: line-through; }
.lead__meta { grid-column: 1 / -1; font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 99px; white-space: nowrap;
  color: var(--c); background: color-mix(in srgb, var(--c) 12%, white); }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--c); }
.st-new { --c: var(--st-new); } .st-called { --c: var(--st-called); } .st-no_answer { --c: var(--st-no_answer); } .st-confirmed { --c: var(--st-confirmed); }
.st-in_weave { --c: var(--st-in_weave); } .st-not_interested { --c: var(--st-not_interested); } .st-cancelled { --c: var(--st-cancelled); }
.empty { text-align: center; padding: 40px 16px; color: var(--muted); background: var(--card); border: 1px dashed var(--line); border-radius: 14px; }
.empty b { display: block; color: var(--ink); font-size: 16px; margin-bottom: 4px; }

/* ---------- detail ---------- */
.panel { background: var(--card); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); padding: 22px; position: sticky; top: 80px; max-height: calc(100vh - 100px); overflow: auto; }
.panel__back { display: none; }
.d-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin: 0 0 4px; }
.d-head h2 { font-size: 24px; }
.d-sub { color: var(--muted); font-size: 13.5px; margin: 0 0 16px; }
.actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 0 0 18px; }
.actions .btn { min-height: 46px; }
.slotbox { background: var(--teal-soft); border-radius: 12px; padding: 12px 14px; margin: 0 0 18px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.slotbox b { font-size: 16px; display: block; }
.slotbox .k { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--teal); font-weight: 700; }
.slotbox.off { background: #F1EEE8; }
.slotbox__btns { margin-left: auto; display: flex; gap: 6px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 18px; margin: 0 0 20px; }
.kv .k { font-size: 12px; color: var(--muted); font-weight: 600; }
.kv .v { font-weight: 600; word-break: break-word; }
.kv.wide { grid-column: 1 / -1; }
.sec { margin: 0 0 20px; }
.sec h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 0 0 10px; }
.statuses { display: flex; flex-wrap: wrap; gap: 6px; }
.sbtn { border: 1px solid var(--line); background: #fff; border-radius: 99px; padding: 7px 12px; font-weight: 600; font-size: 13px; cursor: pointer; display: inline-flex; gap: 6px; align-items: center; }
.sbtn::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
.sbtn.on { background: var(--c); border-color: var(--c); color: #fff; }
.sbtn.on::before { background: #fff; }
.listcol > .hint { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin: 0 0 12px; }
.hint { background: #FFF6E5; border: 1px solid #F3DDB0; border-radius: 10px; padding: 10px 12px; font-size: 13.5px; margin: 10px 0 0; }
.note { border-left: 3px solid var(--teal); background: #fff; border-radius: 0 10px 10px 0; padding: 8px 12px; margin: 0 0 8px; }
.note .meta, .hist .meta { font-size: 12px; color: var(--muted); }
.note p { margin: 2px 0 0; white-space: pre-wrap; }
.notebar { display: flex; gap: 8px; align-items: flex-end; margin: 0 0 10px; }
.notebar textarea { min-height: 46px; height: 46px; overflow: hidden; resize: none; }
.hist { list-style: none; margin: 0; padding: 0; }
.hist li { padding: 6px 0 6px 16px; position: relative; font-size: 13.5px; }
.hist li::before { content: ""; position: absolute; left: 3px; top: 13px; width: 6px; height: 6px; border-radius: 50%; background: #C9C1B2; }
.placeholder { display: grid; place-items: center; text-align: center; color: var(--muted); min-height: 300px; }
.placeholder img { width: 64px; opacity: .5; margin: 0 auto 10px; display: block; }

/* ---------- calendar ---------- */
.calhead { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 0 0 14px; }
.calhead h2 { font-size: 18px; margin-right: auto; }
.week { display: grid; grid-template-columns: 64px repeat(4, 1fr); background: var(--card); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.week > div { border-bottom: 1px solid var(--line); border-left: 1px solid var(--line); min-height: 58px; padding: 6px; }
.week .wh { min-height: 0; font-weight: 700; font-size: 13px; text-align: center; background: #FBF9F4; padding: 10px 6px; }
.week .wh.today { color: var(--teal); }
.week .wh small { display: block; font-weight: 500; color: var(--muted); }
.week .hr { border-left: 0; font-size: 12px; color: var(--muted); text-align: right; padding-right: 10px; }
.week .lunch { background: repeating-linear-gradient(45deg, #FBF9F4, #FBF9F4 6px, #F4F0E7 6px, #F4F0E7 12px); min-height: 26px; }
.week .past { background: #FAF8F3; }
.appt { width: 100%; text-align: left; border: 0; border-left: 4px solid var(--c); background: color-mix(in srgb, var(--c) 10%, white); border-radius: 8px;
  padding: 6px 8px; cursor: pointer; font-size: 13px; line-height: 1.3; }
.appt b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.appt span { color: var(--muted); font-size: 12px; }
.agenda { display: none; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 12px 0 0; font-size: 12.5px; color: var(--muted); }
.legend .pill { background: none; padding: 0; color: var(--muted); font-weight: 600; }

/* ---------- team / activity / settings ---------- */
.cardbox { background: var(--card); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); padding: 20px; margin: 0 0 16px; }
.cardbox h2 { font-size: 18px; margin: 0 0 4px; }
.cardbox > p { margin: 0 0 14px; }
.row3 { display: grid; grid-template-columns: 1.2fr 1.4fr .8fr auto; gap: 10px; align-items: end; }
.row3 .field { margin: 0; }
.people { display: flex; flex-direction: column; }
.person { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.person:first-child { border-top: 0; }
.avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--teal-soft); color: var(--teal); display: grid; place-items: center; font-weight: 700; flex: none; }
.person__who { flex: 1 1 200px; min-width: 0; }
.person__who b { display: block; }
.person__who span { font-size: 13px; color: var(--muted); word-break: break-all; }
.person__btns { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 99px; background: #EEE9DF; color: var(--muted); }
.tag.admin { background: var(--teal-soft); color: var(--teal); }
.tag.off { background: #F6E3E0; color: var(--danger); }
.tag.pending { background: #FFF1D6; color: #8A5A00; }
.acts { list-style: none; margin: 0; padding: 0; }
.acts li { display: grid; grid-template-columns: 150px 140px 1fr; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line); font-size: 14px; }
.acts li:first-child { border-top: 0; }
.acts .lk { background: none; border: 0; padding: 0; color: var(--teal); cursor: pointer; font-weight: 600; text-align: left; }
.status-line { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 10px; background: var(--bg); margin: 0 0 12px; font-weight: 600; }
.status-line .d { width: 10px; height: 10px; border-radius: 50%; background: #C9C1B2; flex: none; }
.status-line.ok .d { background: var(--st-confirmed); }
.status-line.warn .d { background: #D9822B; }
.btnrow { display: flex; flex-wrap: wrap; gap: 8px; }
.share { display: inline-block; vertical-align: -4px; width: 18px; height: 18px; }

/* ---------- modal ---------- */
.modal { position: fixed; inset: 0; z-index: 60; background: rgba(27,28,24,.45); display: grid; place-items: center; padding: 16px; }
.modal__box { background: var(--card); border-radius: 18px; width: 100%; max-width: 640px; max-height: calc(100vh - 32px); overflow: auto; padding: 20px; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.modal__head { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; }
.modal__head h2 { font-size: 18px; margin-right: auto; }
.picker { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.picker__day { text-align: center; font-weight: 700; font-size: 13px; padding: 4px 0 2px; }
.picker__day small { display: block; color: var(--muted); font-weight: 500; }
.picker__day.closed small { color: #B9B2A5; }
.ps { border: 1px solid var(--line); background: #fff; border-radius: 9px; padding: 8px 4px; font-weight: 600; font-size: 13px; cursor: pointer; }
.ps:hover:not(:disabled) { border-color: var(--teal); color: var(--teal); }
.ps:disabled { background: #F3F0EA; color: #B9B2A5; cursor: default; text-decoration: line-through; }
.ps.cur { background: var(--teal); border-color: var(--teal); color: #fff; text-decoration: none; }

/* ---------- toast ---------- */
.toast { position: fixed; left: 50%; bottom: calc(24px + var(--safe-b)); transform: translate(-50%, 20px); background: var(--ink); color: #fff; padding: 11px 16px;
  border-radius: 12px; font-weight: 600; opacity: 0; pointer-events: none; transition: .2s; z-index: 80; max-width: calc(100vw - 32px); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.alert { background: var(--st-new); }

/* ---------- phones ---------- */
@media (max-width: 860px) {
  .tabs { display: none; }
  .who { display: none; }
  .top { padding-left: 12px; padding-right: 8px; }
  .main { padding: 12px 12px calc(84px + var(--safe-b)); }
  .bottom { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; position: fixed; bottom: 0; left: 0; right: 0; z-index: 30;
    background: rgba(255,254,250,.96); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-top: 1px solid var(--line); padding: 6px 4px calc(6px + var(--safe-b)); }
  .bottom .tab { flex-direction: column; gap: 2px; font-size: 11px; padding: 6px 2px; margin: 0; position: relative; }
  .bottom .tab svg { width: 22px; height: 22px; }
  .bottom .tab.on { background: none; }
  .bottom .tab .count { position: absolute; top: 0; left: 50%; margin-left: 6px; }
  .split { grid-template-columns: 1fr; }
  .split.detail-open .listcol { display: none; }
  .split:not(.detail-open) .panel { display: none; }
  .panel { position: static; max-height: none; padding: 16px; border-radius: 14px; }
  .panel__back { display: inline-flex; margin: -4px 0 10px -8px; }
  .d-head h2 { font-size: 21px; }
  .grid2 { grid-template-columns: 1fr; gap: 10px; }
  .slotbox__btns { margin-left: 0; width: 100%; }
  .slotbox__btns .btn { flex: 1; }
  .week { display: none; }
  .agenda { display: block; }
  .agenda h3 { font-size: 14px; margin: 16px 0 8px; }
  .agenda h3.today { color: var(--teal); }
  .agenda .appt { margin: 0 0 6px; padding: 10px 12px; font-size: 14px; }
  .row3 { grid-template-columns: 1fr; }
  .acts li { grid-template-columns: 1fr; gap: 2px; }
  .modal { padding: 0; align-items: end; }
  .modal__box { border-radius: 18px 18px 0 0; max-height: 92vh; padding-bottom: calc(20px + var(--safe-b)); }
  .picker { gap: 6px; }
}
