/* Keepline AI Outreach — matches the approved layout (outreach-canvas Main/Contacts/Patient/Results). */
:root { --ink: #16212C; --muted: #4B5563; --line: #E5E7EB; --line-soft: #F0F1F3; --bg: #F4F6F7; --teal: #17786A; --teal-dark: #0F5A4F; }
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; color: var(--ink); }
a { color: var(--teal); } a:hover { color: var(--teal-dark); }
a.plain { text-decoration: none; }
h1 { margin: 0; font-size: 26px; font-weight: 800; }
h2 { margin: 0 0 10px; font-size: 18px; font-weight: 800; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.muted { color: var(--muted); } .small { font-size: 12px; } .strong { font-weight: 700; }
.ok { color: var(--teal); font-weight: 700; } .info { color: #075985; font-weight: 700; } .warn-text { color: #92400E; font-weight: 700; }
.empty { color: var(--muted); padding: 14px 0; }
.break { word-break: break-all; }

/* Shell */
.shell { display: flex; flex-wrap: wrap; min-height: 100vh; background: var(--bg); }
.nav { flex: 1 1 220px; max-width: 260px; background: #16212C; color: #E5E7EB; padding: 24px 16px; display: flex; flex-direction: column; gap: 4px; }
.nav-brand { font-size: 17px; font-weight: 800; color: #FFFFFF; padding: 0 10px 4px; }
.nav-sub { font-size: 12px; color: #9CA3AF; padding: 0 10px 18px; }
.switcher { padding: 4px 10px 18px; }
.switcher select { width: 100%; min-height: 36px; border-radius: 8px; border: 1px solid #2B3642; background: #1F2B37; color: #E5E7EB; font-size: 13px; padding: 0 8px; }
.nav > a { display: block; padding: 11px 12px; border-radius: 8px; color: #D1D5DB; text-decoration: none; font-size: 14px; }
.nav > a.active { background: var(--teal); color: #FFFFFF; font-weight: 600; }
.nav > a:hover:not(.active) { background: #1F2B37; color: #FFFFFF; }
.nav-foot { margin-top: auto; font-size: 12px; color: #9CA3AF; padding: 18px 10px 0; border-top: 1px solid #2B3642; }
.nav-link { color: #9CA3AF; margin-top: 8px; padding: 0; }
.main { flex: 999 1 560px; min-width: 0; padding: 28px 32px; display: flex; flex-direction: column; gap: 22px; }
.flash { background: #ECFDF5; border: 1px solid #A7F3D0; color: #065F46; border-radius: 10px; padding: 12px 14px; font-size: 14px; }

/* Header */
.page-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; }
.page-head.align-end, .align-end { align-items: flex-end; }
.sub { font-size: 13px; color: var(--muted); margin-top: 4px; }
.row-gap { display: flex; gap: 8px; flex-wrap: wrap; }
.row-gap form { margin: 0; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 16px; border-radius: 9px; border: 1px solid #D1D5DB; background: #FFFFFF; font-size: 14px; font-weight: 600; color: var(--ink); cursor: pointer; text-decoration: none; font-family: inherit; }
.btn:hover { border-color: #9CA3AF; color: var(--ink); }
.btn-primary { border: none; background: var(--teal); color: #FFFFFF; font-weight: 700; }
.btn-primary:hover { background: var(--teal-dark); color: #FFFFFF; }
.btn-danger { border: 1px solid #FECACA; color: #991B1B; }
.btn-sm { min-height: 40px; padding: 0 14px; border-radius: 8px; font-size: 13px; }
.btn-lg { min-height: 46px; border-radius: 10px; }
.btn-block { width: 100%; }
.btn-link { background: none; border: none; color: var(--teal); cursor: pointer; font-size: 13px; padding: 8px 0; font-family: inherit; text-decoration: underline; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible { outline: 3px solid #5EEAD4; outline-offset: 2px; }

/* Cards & KPIs */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.kpi { background: #FFFFFF; border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; }
.kpi-label { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; }
.kpi-value { font-size: 30px; font-weight: 800; margin-top: 6px; }
.kpi-note { font-size: 12px; color: var(--muted); }
.kpi-warn { background: #FFF7ED; border-color: #FED7AA; }
.kpi-warn .kpi-label, .kpi-warn .kpi-value, .kpi-warn .kpi-note { color: #9A3412; }
.kpi-dark { background: #16212C; border-color: #16212C; color: #FFFFFF; border-radius: 14px; }
.kpi-dark .kpi-label { color: #A7F3D0; } .kpi-dark .kpi-note { color: #CBD5E1; }
.card { background: #FFFFFF; border: 1px solid var(--line); border-radius: 12px; padding: 18px 20px; }
.card-table { padding: 6px 18px 12px; } .card-table h2 { margin-top: 14px; }
.card-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; }
.card-head h2 { margin: 0; }

/* Chips & tabs */
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; min-height: 36px; padding: 0 12px; border-radius: 999px; border: 1px solid #D1D5DB; background: #FFFFFF; color: var(--ink); font-size: 13px; text-decoration: none; }
.chip.active { border-color: #16212C; background: #16212C; color: #FFFFFF; font-weight: 600; }
.tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.tab { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border-radius: 10px; border: 1px solid #D1D5DB; background: #FFFFFF; color: var(--ink); font-size: 14px; text-decoration: none; }
.tab.active { border-color: #16212C; background: #16212C; color: #FFFFFF; font-weight: 700; }

/* Badges */
.badge { display: inline-block; font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px; white-space: nowrap; align-self: flex-start; }
.b-red { background: #FEE2E2; color: #991B1B; } .b-blue { background: #E0F2FE; color: #075985; } .b-amber { background: #FEF3C7; color: #92400E; }
.b-violet { background: #EDE9FE; color: #5B21B6; } .b-green { background: #DCFCE7; color: #166534; } .b-teal { background: #CCFBF1; color: #115E59; }
.b-slate { background: #F1F5F9; color: #334155; }

/* Action list */
.list { display: flex; flex-direction: column; }
.task-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; padding: 14px 0; border-top: 1px solid var(--line-soft); }
.task-main { flex: 1 1 320px; min-width: 0; }
.task-title { font-size: 15px; font-weight: 700; }
.task-meta { font-weight: 400; color: var(--muted); font-size: 13px; }
.task-text { font-size: 13px; color: #374151; margin-top: 3px; }
.task-notes { margin: 6px 0 0; padding-left: 18px; font-size: 12px; color: var(--muted); }
.task-actions { display: flex; gap: 8px; align-items: flex-start; flex-wrap: wrap; }
.task-actions form { margin: 0; }
.note-pop { position: relative; }
.note-pop > summary { list-style: none; } .note-pop > summary::-webkit-details-marker { display: none; }
.note-pop[open] > form { position: absolute; right: 0; top: 46px; z-index: 5; width: 280px; background: #FFFFFF; border: 1px solid var(--line); border-radius: 10px; padding: 10px; box-shadow: 0 8px 24px rgba(22,33,44,.12); }
.note-pop.block[open] > form { position: static; width: auto; box-shadow: none; margin-top: 8px; }

/* Tables */
.table-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 640px; }
.tbl-wide { min-width: 820px; }
.tbl th { text-align: left; color: var(--muted); font-size: 12px; padding: 10px 6px; border-bottom: 1px solid var(--line); font-weight: 600; }
.tbl td { padding: 11px 6px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: none; }
.tbl input[type=number] { width: 110px; }

/* Pipeline & funnel */
.pipeline { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.pipe { background: #FFFFFF; border: 1px solid var(--line); border-radius: 12px; padding: 14px; }
.pipe-label { font-size: 12px; font-weight: 700; color: var(--muted); }
.pipe-value { font-size: 26px; font-weight: 800; margin-top: 4px; }
.bar { display: block; width: 100%; margin-top: 10px; }
.funnel { display: flex; flex-direction: column; gap: 10px; }
.funnel-row { display: flex; align-items: center; gap: 12px; }
.funnel-label { width: 110px; font-size: 13px; color: #374151; }
.funnel-bar { flex: 1; } .funnel-bar .bar { margin: 0; }
.funnel-n { width: 56px; text-align: right; font-size: 14px; font-weight: 700; }

/* Patient */
.patient-page { display: flex; flex-wrap: wrap; gap: 20px; align-content: flex-start; }
.back { flex: 1 1 100%; font-size: 13px; text-decoration: none; }
.patient-card { flex: 1 1 300px; border-radius: 16px; padding: 22px; display: flex; flex-direction: column; gap: 14px; align-self: flex-start; }
.patient-card h1 { font-size: 24px; }
.facts { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; font-size: 13px; }
.facts dt { color: var(--muted); } .facts dd { margin: 2px 0 0; font-weight: 700; }
.timeline-card { flex: 2 1 460px; min-width: 0; border-radius: 16px; padding: 22px; }
.timeline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.timeline li { display: flex; gap: 14px; padding-bottom: 18px; }
.timeline li.last { padding-bottom: 0; } .timeline li.last .tl-line { display: none; }
.tl-rail { width: 12px; flex: 0 0 12px; display: flex; flex-direction: column; align-items: center; }
.dot { width: 12px; height: 12px; border-radius: 50%; background: #94A3B8; }
.dot-call { background: var(--teal); } .dot-warn { background: #B45309; } .dot-rule { background: #94A3B8; } .dot-visit { background: #CBD5E1; }
.dot-task { background: #0EA5E9; } .dot-note { background: #64748B; }
.tl-line { flex: 1; width: 2px; background: var(--line); margin-top: 4px; }
.tl-body { flex: 1; min-width: 0; }
.tl-when { font-size: 12px; color: var(--muted); }
.tl-title { font-size: 14px; font-weight: 700; margin-top: 2px; }
.tl-text { font-size: 13px; color: #374151; margin-top: 2px; }
.tl-box { font-size: 13px; color: #374151; margin-top: 2px; background: #F7F8F9; border-radius: 10px; padding: 10px 12px; }
.tl-play { margin-top: 8px; }
.tl-body audio { display: block; margin-top: 8px; width: 100%; max-width: 360px; }

/* Forms */
.stack { display: flex; flex-direction: column; gap: 8px; }
.stack form { margin: 0; }
.stack-lg { display: flex; flex-direction: column; gap: 14px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.field-label, .stack label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 700; color: var(--muted); }
input[type=text], input[type=email], input[type=password], input[type=search], input[type=tel], input[type=number], input[type=time], input:not([type]), select, textarea {
  min-height: 44px; border-radius: 9px; border: 1px solid #D1D5DB; padding: 0 12px; font-size: 14px; background: #FFFFFF; color: var(--ink); font-family: inherit; max-width: 100%; }
textarea { padding: 10px 12px; min-height: 64px; resize: vertical; }
input[type=search] { width: 240px; }
.days { border: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 12px; }
.check { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: var(--ink); font-weight: 400; }
.form-error { background: #FEF2F2; color: #991B1B; border: 1px solid #FECACA; border-radius: 9px; padding: 10px 12px; font-size: 14px; }

/* Auth pages */
.center-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 16px; }
.auth-card { width: 100%; max-width: 400px; background: #FFFFFF; border: 1px solid var(--line); border-radius: 16px; padding: 28px; }
.auth-card h1 { font-size: 22px; margin-bottom: 8px; }
.auth-brand { font-size: 14px; font-weight: 800; color: var(--teal); margin-bottom: 16px; }
.qr { display: flex; justify-content: center; margin: 12px 0; } .qr svg { width: 200px; height: 200px; }
.secret { background: #F1F5F9; padding: 2px 6px; border-radius: 6px; }

@media (max-width: 900px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pipeline { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .nav { max-width: none; flex-basis: 100%; padding: 16px; }
  .nav-foot { margin-top: 12px; }
  .main { padding: 20px 16px; }
  .pipeline { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  input[type=search] { width: 100%; }
}

/* Call list */
.banner { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; background: #ECFDF5; border: 1px solid #A7F3D0; border-radius: 12px; padding: 14px 18px; color: #065F46; text-decoration: none; font-size: 14px; }
.banner:hover { border-color: var(--teal); color: #065F46; }
.cl-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-start; padding: 14px 0; border-top: 1px solid var(--line-soft); }
.cl-check { width: 22px; padding-top: 3px; } .cl-check input { width: 18px; height: 18px; }
.cl-main { flex: 1 1 360px; min-width: 0; }
.cl-main .badge { margin-left: 6px; vertical-align: 1px; }
.cl-facts { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; color: var(--muted); margin-top: 6px; }
.cl-warn { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.cl-warn .badge { margin-left: 0; }
.add-form { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.add-form select, .add-form input { min-height: 40px; font-size: 13px; }
.add-form input[name=staff_note] { width: 220px; }
.add-form > div { flex-basis: 100%; }
.pager { justify-content: flex-end; align-items: center; padding: 10px 0 4px; }
.note-pop label { font-size: 12px; }
.dot-test { background: #F59E0B; }
.flash.full { flex: 1 1 100%; }
.patient-card .note-pop[open] > form { position: static; width: auto; box-shadow: none; margin-top: 8px; }

/* Open Dental agent sync warnings and the one-time token box. */
.banner-warn { background: #FFF7ED; border-color: #FED7AA; color: #9A3412; }
.banner-warn:hover { border-color: #F97316; color: #9A3412; }
.token-box { background: #F8FAFC; border: 1px dashed #94A3B8; border-radius: 10px; padding: 12px 14px; font-size: 14px; }
.token-box code { font-size: 15px; word-break: break-all; }

.tl-highlight { margin-top: 6px; font-size: 14px; }
.num-sm { width: 4.5em; }
.cl-why { margin-bottom: 2px; }
.checklist { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
