/* =========================================================
   CRM Cental Clínica Dental
   Antipasto (títulos) + Poppins (texto) · café, crema y dorado
   ========================================================= */
:root {
  --noir: #0E0A07; --espresso: #1A120D; --cafe-deep: #2E2019; --cafe: #71503B; --crema: #F3D5B6;
  --bg: #F6F0E8; --card: #FFFDFA; --ink: #221812; --muted: #8A7868; --line: rgba(34,24,18,.11);
  --gold-1: #A8792E; --gold-2: #D2AA62; --gold-3: #F0D9A0;
  --gold: linear-gradient(115deg, #A8792E 0%, #D2AA62 35%, #F3DDA2 55%, #C9973F 80%, #A8792E 100%);
  --wa: #25D366; --wa-deep: #1DA851; --bad: #B3392B; --ok: #1C9A6C; --warn: #C98A1B;
  --display: "Antipasto", "Poppins", system-ui, sans-serif;
  --sans: "Poppins", system-ui, -apple-system, "Segoe UI", sans-serif;
  --r: 14px; --shadow: 0 1px 2px rgba(34,24,18,.05), 0 10px 30px -18px rgba(34,24,18,.25);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 400 14px/1.55 var(--sans); color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3 { margin: 0; font-family: var(--display); font-weight: 400; line-height: 1.12; }
h1 { font-size: clamp(26px, 3.2vw, 36px); }
h2 { font-size: 20px; }
h3 { font-size: 18px; }
.muted { color: var(--muted); } .small { font-size: 12px; } .block { display: block; }
.text-bad { color: var(--bad); } .text-warn { color: var(--warn); }
.icon-btn.only-mobile { display: none; }
[hidden] { display: none !important; }
.ico { width: 18px; height: 18px; flex: none; }
.link { color: var(--cafe); font-weight: 500; text-decoration: underline; text-decoration-color: rgba(113,80,59,.3); text-underline-offset: 3px; }
.link:hover { text-decoration-color: var(--gold-1); }
.link-btn { background: none; border: 0; padding: 4px 0; color: var(--cafe); font-weight: 500; font-size: 13px; text-decoration: underline; }

/* ---------- Estructura ---------- */
.shell { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.side { background: var(--espresso); color: var(--crema); display: flex; flex-direction: column; padding: 22px 14px; position: sticky; top: 0; height: 100vh; z-index: 60; }
.brand { display: flex; flex-direction: column; gap: 6px; padding: 4px 10px 22px; border-bottom: 1px solid rgba(243,213,182,.12); margin-bottom: 14px; }
.brand img { width: 150px; }
.brand small { font-size: 10px; letter-spacing: .36em; color: var(--gold-2); text-transform: uppercase; }
.nav { display: grid; gap: 2px; flex: 1; align-content: start; overflow-y: auto; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 10px; color: rgba(243,213,182,.72); font-weight: 400; transition: background .2s, color .2s; }
.nav a:hover { background: rgba(243,213,182,.07); color: var(--crema); }
.nav a.is-active { background: linear-gradient(90deg, rgba(210,170,98,.22), rgba(210,170,98,.06)); color: var(--gold-3); box-shadow: inset 2px 0 0 var(--gold-2); }
.nav-count { margin-left: auto; font-style: normal; font-size: 11px; padding: 1px 8px; border-radius: 99px; background: var(--gold-2); color: var(--noir); font-weight: 600; }
.side-foot { display: flex; align-items: center; gap: 8px; padding-top: 14px; border-top: 1px solid rgba(243,213,182,.12); }
.me { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; padding: 6px; border-radius: 10px; }
.me:hover { background: rgba(243,213,182,.07); }
.me span { display: grid; min-width: 0; line-height: 1.25; }
.me strong { font-weight: 500; font-size: 13px; color: var(--crema); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me small { font-size: 11px; color: var(--gold-2); }
.logout { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 10px; color: rgba(243,213,182,.6); }
.logout:hover { background: rgba(243,213,182,.08); color: var(--crema); }
.scrim { display: none; }
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 40; display: flex; align-items: center; gap: 14px; padding: 14px 32px; background: rgba(246,240,232,.88); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.content { padding: 28px clamp(16px, 2.2vw, 40px) 90px; max-width: none; width: 100%; flex: 1; }
.gsearch { position: relative; flex: 1; max-width: 520px; display: flex; align-items: center; gap: 10px; background: var(--card); border: 1px solid var(--line); border-radius: 99px; padding: 0 16px; color: var(--muted); }
.gsearch input { flex: 1; border: 0; background: none; outline: 0; padding: 11px 0; font-size: 13px; color: var(--ink); min-width: 0; }
.gsearch-res, .pac-res { position: absolute; left: 0; right: 0; top: calc(100% + 6px); background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 20px 40px -20px rgba(34,24,18,.4); z-index: 80; overflow: hidden; display: none; }
.gsearch-res.on, .pac-res.on { display: block; }
.res-item { display: flex; align-items: center; gap: 10px; padding: 10px 14px; width: 100%; background: none; border: 0; text-align: left; cursor: pointer; }
.res-item:hover, .res-item.hl { background: #F6EEE2; }
.res-item small { color: var(--muted); display: block; }
.res-empty { padding: 12px 14px; color: var(--muted); }
.top-actions { display: flex; gap: 8px; margin-left: auto; }
.icon-btn { width: 40px; height: 40px; display: inline-grid; place-items: center; border-radius: 10px; border: 1px solid var(--line); background: var(--card); }
.icon-btn:hover { border-color: var(--gold-2); }
.icon-btn.small { width: 30px; height: 30px; border: 0; background: none; color: var(--muted); }
.icon-btn.small:hover { color: var(--bad); }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head p { margin: 4px 0 0; }
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.back { display: inline-block; margin-bottom: 12px; font-size: 13px; }

/* ---------- Botones ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 20px; border-radius: 10px; border: 1px solid transparent; font-weight: 500; font-size: 13px; line-height: 1.2; white-space: nowrap; transition: .2s; }
.btn-sm { padding: 8px 14px; font-size: 12.5px; }
.btn-lg { padding: 15px 26px; font-size: 14px; }
.btn-block { width: 100%; }
.btn-gold { background: var(--gold); background-size: 200% 100%; color: var(--noir); box-shadow: 0 8px 20px -10px rgba(168,121,46,.7); }
.btn-gold:hover { background-position: 100% 0; }
.btn-dark { background: var(--ink); color: var(--bg); }
.btn-dark:hover { background: var(--cafe); }
.btn-ghost { background: var(--card); border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { border-color: var(--gold-2); }
.btn-wa { background: var(--wa); color: #fff; }
.btn-wa:hover { background: var(--wa-deep); }
.btn-wa-soft { background: rgba(37,211,102,.12); color: var(--wa-deep); }
.btn-danger-ghost { background: none; color: var(--bad); border-color: rgba(179,57,43,.3); }
.btn-danger-ghost:hover { background: rgba(179,57,43,.08); }
.btn:disabled { opacity: .6; cursor: wait; }

/* ---------- Tarjetas y listas ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 22px; box-shadow: var(--shadow); margin-bottom: 18px; }
.card-flush { padding: 0; overflow: hidden; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.card-head.pad { padding: 20px 22px 0; }
.stack > .card:last-child { margin-bottom: 0; }
.cols-2-1 { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
.cols-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.cols-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.cols-2-1 { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.cols-2 > .card, .cols-3 > .card, .cols-2-1 > .card { margin-bottom: 18px; }
.empty { color: var(--muted); padding: 10px 0; text-align: center; }
td.empty { padding: 28px; }
.count { font-family: var(--sans); font-size: 12px; background: var(--bg); padding: 1px 9px; border-radius: 99px; color: var(--muted); margin-left: 6px; }
.big-num { font-family: var(--display); font-size: 54px; margin: 0; line-height: 1; color: var(--cafe); }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 22px; }
.stats-3 { grid-template-columns: repeat(3, 1fr); }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 18px 20px; box-shadow: var(--shadow); display: grid; gap: 2px; }
.stat-n { font-family: var(--display); font-size: clamp(26px, 2.6vw, 36px); line-height: 1.1; color: var(--ink); }
.stat-l { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-weight: 500; }
.stat small { color: var(--muted); font-size: 12px; }
.stat-gold { background: linear-gradient(150deg, #2E2019, #1A120D); border-color: rgba(210,170,98,.35); }
.stat-gold .stat-n { background: var(--gold); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stat-gold .stat-l, .stat-gold small { color: rgba(243,213,182,.7); }

.list-simple { list-style: none; margin: 0; padding: 0; }
.list-simple > li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.list-simple > li:last-child { border-bottom: 0; }
.row-r { display: flex; align-items: center; gap: 8px; flex: none; }
.list-citas { list-style: none; margin: 0; padding: 0; }
.row-cita { display: grid; grid-template-columns: 78px minmax(0, 1fr) auto auto; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.row-cita:last-child { border-bottom: 0; }
.rc-time { display: grid; line-height: 1.25; } .rc-time small { color: var(--muted); font-size: 11px; }
.rc-main { min-width: 0; } .rc-main strong { font-weight: 500; } .rc-main small { display: block; color: var(--muted); }
.rc-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }

.badge { display: inline-block; padding: 3px 11px; border-radius: 99px; font-size: 11.5px; font-weight: 500; background: color-mix(in srgb, var(--c, #8A7868) 14%, white); color: var(--c, #8A7868); border: 1px solid color-mix(in srgb, var(--c, #8A7868) 28%, white); white-space: nowrap; }
.score { display: inline-grid; place-items: center; min-width: 30px; height: 22px; padding: 0 7px; border-radius: 99px; font-size: 11px; font-weight: 600; color: #fff; background: var(--c); }
.pill { display: inline-block; padding: 2px 10px; border-radius: 99px; font-size: 11.5px; background: var(--bg); color: var(--muted); white-space: nowrap; }
.pill-bad { background: rgba(179,57,43,.12); color: var(--bad); } .pill-warn { background: rgba(201,138,27,.15); color: #9A6A10; }
.chip-btn { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 8px; border: 1px solid var(--line); background: var(--card); font-size: 12px; font-weight: 500; line-height: 1.2; }
.chip-btn:hover { border-color: var(--gold-2); }
.chip-btn.ok { color: var(--ok); } .chip-btn.bad { color: var(--bad); }
.chip-btn.wa { color: #fff; background: var(--wa); border-color: var(--wa); } .chip-btn.wa:hover { background: var(--wa-deep); }
.chip-btn .ico { width: 15px; height: 15px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { padding: 7px 13px; border-radius: 99px; background: var(--bg); border: 1px solid var(--line); font-size: 12.5px; }
.chip:hover { border-color: var(--wa); color: var(--wa-deep); }

.avatar { width: 38px; height: 38px; border-radius: 50%; display: inline-grid; place-items: center; flex: none; background: linear-gradient(145deg, #3B2A1F, #1A120D); color: var(--gold-3); font-family: var(--display); font-size: 14px; border: 1px solid rgba(210,170,98,.4); }
.avatar-lg { width: 72px; height: 72px; font-size: 24px; }
.cell-user { display: flex; align-items: center; gap: 12px; } .cell-user span { display: grid; line-height: 1.3; } .cell-user small { color: var(--muted); font-size: 11.5px; }

.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th { text-align: left; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 500; padding: 14px 16px; border-bottom: 1px solid var(--line); background: #FBF6EF; white-space: nowrap; }
.table td { padding: 13px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: #FBF6EF; }
.table-compact td, .table-compact th { padding: 10px 14px; }
.num { text-align: right; white-space: nowrap; }
.row-void td { opacity: .5; }
.in-cell { width: 100%; min-width: 80px; padding: 7px 9px; border: 1px solid transparent; border-radius: 8px; background: transparent; }
.in-cell:hover, .in-cell:focus { border-color: var(--line); background: var(--card); outline: 0; }
.w-xs { width: 70px !important; } .w-sm { width: 120px !important; } .w-md { width: 150px !important; }
.inline { display: inline; }

/* ---------- Formularios ---------- */
.field { display: grid; gap: 5px; margin: 0; position: relative; }
.field > span, .field > label { font-size: 11.5px; letter-spacing: .06em; color: var(--muted); font-weight: 500; text-transform: uppercase; }
input[type=text], input[type=search], input[type=email], input[type=tel], input[type=password], input[type=number], input[type=date], input[type=time], select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); outline: 0; transition: border-color .2s, box-shadow .2s; }
input:focus, select:focus, textarea:focus { border-color: var(--gold-1); box-shadow: 0 0 0 3px rgba(210,170,98,.2); }
textarea { resize: vertical; }
input[type=checkbox], input[type=radio] { width: 16px; height: 16px; accent-color: var(--cafe); }
input[type=color] { width: 38px; height: 30px; padding: 0; border: 1px solid var(--line); border-radius: 8px; background: none; }
.check { display: flex; align-items: flex-start; gap: 10px; font-size: 13.5px; cursor: pointer; }
.check input { margin-top: 3px; }
.form-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.form-grid h2 { padding-top: 8px; border-top: 1px solid var(--line); margin-top: 6px; } .form-grid h2:first-child { border: 0; margin: 0; padding: 0; }
.span-all { grid-column: 1 / -1; } .span-2 { grid-column: span 2; }
.form-stack { display: grid; gap: 14px; } .form-stack h2 { margin-top: 6px; }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; padding-top: 6px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; } .grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.inline-form { display: flex; gap: 10px; align-items: center; } .inline-form.wrap { flex-wrap: wrap; }
.inline-form input[type=text] { flex: 1; min-width: 160px; } .inline-form input[type=date], .inline-form select { width: auto; }
.add-item { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 14px; }
.add-item input, .add-item select { width: auto; flex: 1; min-width: 120px; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 18px; }
.filters input[type=search], .filters input[type=text] { width: 260px; max-width: 100%; } .filters select { width: auto; max-width: 100%; } .filters input[type=date] { width: auto; }
.pager { display: flex; align-items: center; justify-content: center; gap: 16px; margin-top: 18px; color: var(--muted); }
.copy-box { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 12px; background: var(--bg); border-radius: 10px; margin: 10px 0; }
.copy-box code { flex: 1; min-width: 200px; word-break: break-all; font-size: 13px; }

.flash { padding: 12px 16px; border-radius: 10px; margin-bottom: 16px; font-weight: 500; border: 1px solid; word-break: break-word; }
.flash-ok { background: rgba(28,154,108,.1); border-color: rgba(28,154,108,.3); color: #11694a; }
.flash-err { background: rgba(179,57,43,.1); border-color: rgba(179,57,43,.3); color: #8d2b20; }
.flash-warn { background: rgba(201,138,27,.12); border-color: rgba(201,138,27,.35); color: #7a540c; }

/* ---------- Embudo ---------- */
.board { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 14px; align-items: stretch; min-height: calc(100vh - 270px); scroll-snap-type: x proximity; }
.col { flex: 1 0 268px; display: flex; flex-direction: column; background: #EFE6D9; border-radius: var(--r); padding: 12px; scroll-snap-align: start; }
.col-head { display: flex; align-items: center; justify-content: space-between; padding: 4px 6px 8px; font-weight: 500; }
.col-head span { display: flex; align-items: center; gap: 8px; } .col-head b { font-size: 12px; background: var(--card); padding: 1px 9px; border-radius: 99px; color: var(--muted); }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--c); display: inline-block; }
.col-total { padding: 0 6px 8px; font-size: 12px; color: var(--muted); }
.col-body { display: grid; gap: 10px; flex: 1; min-height: 160px; align-content: start; border-radius: 10px; transition: background .2s; }
.col-body.is-over { background: rgba(210,170,98,.2); outline: 2px dashed var(--gold-2); }
.col-empty { text-align: center; color: var(--muted); font-size: 12px; padding: 30px 8px; border: 1px dashed rgba(34,24,18,.15); border-radius: 10px; }
.deal { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px; cursor: grab; box-shadow: var(--shadow); border-top: 3px solid var(--c, var(--gold-2)); }
.col .deal { --c: inherit; }
.deal.is-dragging { opacity: .4; }
.deal:hover { border-color: var(--gold-2); }
.deal-top { display: flex; align-items: center; gap: 10px; } .deal-top > div { flex: 1; min-width: 0; line-height: 1.3; }
.deal-top strong { display: block; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .deal-top small { color: var(--muted); font-size: 11.5px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.deal .avatar { width: 32px; height: 32px; font-size: 12px; }
.deal-val { font-family: var(--display); font-size: 17px; color: var(--cafe); margin-top: 8px; }
.deal-meta { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); margin-top: 6px; } .deal-meta .ico { width: 14px; height: 14px; }
.deal-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; font-size: 11.5px; color: var(--muted); }

/* ---------- Ficha de paciente ---------- */
.patient-head { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 22px; box-shadow: var(--shadow); margin-bottom: 18px; }
.ph-main { flex: 1; min-width: 240px; } .ph-main p { margin: 4px 0 10px; }
.ph-badges { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ph-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.etapa-select { width: auto; padding: 5px 30px 5px 12px; border-radius: 99px; font-size: 12.5px; font-weight: 500; color: var(--c); background-color: color-mix(in srgb, var(--c) 12%, white); border-color: color-mix(in srgb, var(--c) 35%, white); }
.alert-allergy { background: rgba(179,57,43,.1); border: 1px solid rgba(179,57,43,.35); color: #8d2b20; padding: 12px 16px; border-radius: 12px; margin-bottom: 14px; }
.tabs { display: flex; gap: 4px; margin-bottom: 20px; border-bottom: 1px solid var(--line); overflow-x: auto; overflow-y: hidden; }
.tabs a { padding: 11px 16px; font-weight: 500; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; margin-bottom: -1px; }
.tabs a:hover { color: var(--ink); } .tabs a.is-active { color: var(--ink); border-color: var(--gold-1); }
.next-appt { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; } .next-appt > div { flex: 1; display: grid; min-width: 180px; } .next-appt span { color: var(--muted); }
.timeline { list-style: none; margin: 0; padding: 0 0 0 4px; }
.timeline li { display: flex; gap: 14px; padding: 0 0 16px; position: relative; }
.timeline li::before { content: ""; position: absolute; left: 5px; top: 14px; bottom: 0; width: 1px; background: var(--line); } .timeline li:last-child::before { display: none; }
.tl-dot { width: 11px; height: 11px; border-radius: 50%; background: var(--gold-2); margin-top: 5px; flex: none; box-shadow: 0 0 0 3px rgba(210,170,98,.2); }
.timeline strong { font-weight: 500; display: block; } .timeline small { color: var(--muted); font-size: 11.5px; } .timeline p { margin: 4px 0; color: var(--ink); }
.dl { display: grid; grid-template-columns: 110px 1fr; gap: 8px 12px; margin: 0; } .dl dt { color: var(--muted); font-size: 12px; } .dl dd { margin: 0; word-break: break-word; }
.mini-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; } .mini-stats div { background: var(--bg); border-radius: 10px; padding: 10px 12px; display: grid; } .mini-stats small { color: var(--muted); font-size: 11px; } .mini-stats strong { font-family: var(--display); font-weight: 400; font-size: 17px; } .mini-stats .warn strong { color: var(--bad); }

.plan-b-borrador { --c: #8A7868; } .plan-b-presentado { --c: #C98A1B; } .plan-b-aceptado, .plan-b-en_curso { --c: #1C9A6C; } .plan-b-completado { --c: #0E6B4D; } .plan-b-rechazado { --c: #B3392B; }
.badge[class*="plan-b-"] { background: color-mix(in srgb, var(--c) 14%, white); color: var(--c); border: 1px solid color-mix(in srgb, var(--c) 30%, white); }
.select-sm { width: auto; padding: 5px 26px 5px 10px; font-size: 12px; border-radius: 8px; }
.st-realizado { color: var(--ok); font-weight: 500; } .st-en_curso { color: var(--warn); font-weight: 500; }
.plan-foot { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.plan-disc { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; flex: 1; } .plan-disc label { display: grid; gap: 4px; font-size: 11.5px; color: var(--muted); } .plan-disc input[type=number] { width: 90px; } .plan-disc input[type=text] { flex: 1; min-width: 180px; }
.plan-total { text-align: right; } .plan-total small { display: block; color: var(--muted); } .plan-total strong { font-family: var(--display); font-weight: 400; font-size: 32px; color: var(--cafe); }
.plan-states { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 14px; } .plan-states form { display: inline; }

.gallery-files { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; }
.file { margin: 0; position: relative; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--bg); }
.file-thumb { display: grid; place-items: center; aspect-ratio: 4/3; background: #E9DCCD; overflow: hidden; } .file-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; } .file:hover .file-thumb img { transform: scale(1.05); }
.file .pdf { display: grid; justify-items: center; gap: 6px; color: var(--cafe); font-weight: 600; } .file .pdf .ico { width: 34px; height: 34px; }
.file figcaption { padding: 9px 12px; display: grid; font-size: 12.5px; } .file figcaption small { color: var(--muted); }
.file-del { position: absolute; top: 6px; right: 6px; background: rgba(255,253,250,.9) !important; border-radius: 50% !important; }

/* Odontograma */
.odo { display: grid; gap: 22px; }
.odo-arch { display: grid; grid-template-columns: repeat(16, minmax(0, 1fr)); gap: 4px; }
.odo-gap { grid-column: span 16; height: 1px; }
.tooth { display: grid; justify-items: center; gap: 4px; padding: 6px 0; border-radius: 8px; border: 1px solid transparent; background: none; cursor: pointer; }
.tooth:hover { background: #F6EEE2; }
.tooth svg { width: 100%; max-width: 34px; height: auto; }
.tooth svg path { fill: #fff; stroke: #9a8776; stroke-width: 1.4; transition: fill .2s; }
.tooth small { font-size: 10px; color: var(--muted); }
.tooth[data-s="caries"] path { fill: #E36B5B; } .tooth[data-s="obturado"] path { fill: #5B8DD6; } .tooth[data-s="endodoncia"] path { fill: #9B6BCB; }
.tooth[data-s="corona"] path { fill: #E5B84F; } .tooth[data-s="implante"] path { fill: #7CC4B5; } .tooth[data-s="ausente"] path { fill: #D8D2CB; stroke-dasharray: 3 3; }
.tooth[data-s="fractura"] path { fill: #F29B5A; } .tooth[data-s="protesis"] path { fill: #C7A4DE; } .tooth[data-s="sano"] path { fill: #fff; }
.odo-legend { display: flex; flex-wrap: wrap; gap: 8px; }
.odo-opt { display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px; border-radius: 99px; border: 1px solid var(--line); background: var(--card); font-size: 12.5px; }
.odo-opt i { width: 12px; height: 12px; border-radius: 50%; border: 1px solid rgba(0,0,0,.2); }
.odo-opt.on { border-color: var(--ink); box-shadow: 0 0 0 2px rgba(34,24,18,.15); font-weight: 500; }
.odo-status { font-size: 12px; color: var(--muted); min-height: 1em; }

/* ---------- Agenda ---------- */
.agenda-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }
.agenda-bar select, .agenda-bar input[type=date] { width: auto; }
.seg { display: inline-flex; gap: 4px; align-items: center; } .seg-toggle { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 3px; }
.seg-toggle button { border: 0; background: none; padding: 7px 14px; border-radius: 8px; font-weight: 500; color: var(--muted); } .seg-toggle button.is-on { background: var(--ink); color: var(--bg); }
.legend { display: flex; gap: 14px; flex-wrap: wrap; margin-left: auto; font-size: 12px; color: var(--muted); } .legend span { display: inline-flex; align-items: center; gap: 6px; } .legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.lg-block { background: repeating-linear-gradient(45deg, #D9CFC2, #D9CFC2 3px, #EFE6D9 3px, #EFE6D9 6px); }
.agenda { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); overflow: auto; height: calc(100vh - 235px); min-height: 480px; margin-bottom: 18px; position: relative; }
.ag-inner { display: grid; grid-template-columns: 56px repeat(var(--cols), minmax(120px, 1fr)); min-width: calc(56px + var(--cols) * 120px); }
.ag-head { position: sticky; top: 0; z-index: 6; background: #FBF6EF; border-bottom: 1px solid var(--line); padding: 10px 6px; text-align: center; line-height: 1.2; }
.ag-head small { display: block; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .1em; } .ag-head strong { font-family: var(--display); font-weight: 400; font-size: 20px; }
.ag-head.today strong { background: var(--ink); color: var(--gold-3); border-radius: 99px; padding: 0 10px; display: inline-block; }
.ag-corner { position: sticky; left: 0; top: 0; z-index: 8; background: #FBF6EF; border-bottom: 1px solid var(--line); }
.ag-hours { position: sticky; left: 0; z-index: 5; background: var(--card); border-right: 1px solid var(--line); }
.ag-hour { height: var(--hh); font-size: 11px; color: var(--muted); text-align: right; padding: 0 8px; transform: translateY(-8px); }
.ag-col { position: relative; border-left: 1px solid var(--line); cursor: cell; background-image: linear-gradient(var(--line) 1px, transparent 1px); background-size: 100% var(--hh); }
.ag-off { position: absolute; left: 0; right: 0; background: repeating-linear-gradient(135deg, rgba(34,24,18,.045), rgba(34,24,18,.045) 5px, transparent 5px, transparent 10px); pointer-events: none; }
.ag-ev { position: absolute; left: 3px; right: 3px; border-radius: 8px; padding: 4px 8px; font-size: 12px; line-height: 1.25; overflow: hidden; cursor: pointer; background: color-mix(in srgb, var(--c) 16%, white); border-left: 4px solid var(--c); color: var(--ink); box-shadow: 0 2px 6px -3px rgba(34,24,18,.4); transition: transform .15s, box-shadow .15s; z-index: 3; }
.ag-ev:hover { transform: translateY(-1px); box-shadow: 0 8px 18px -8px rgba(34,24,18,.5); z-index: 4; }
.ag-ev strong { display: block; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .ag-ev span { color: var(--muted); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.ag-ev.web::after { content: "web"; position: absolute; right: 6px; top: 4px; font-size: 9px; text-transform: uppercase; letter-spacing: .08em; background: var(--ink); color: var(--gold-3); padding: 0 5px; border-radius: 4px; }
.ag-block { position: absolute; left: 0; right: 0; background: repeating-linear-gradient(45deg, #D9CFC2, #D9CFC2 4px, #EFE6D9 4px, #EFE6D9 8px); font-size: 11px; color: var(--muted); padding: 4px 8px; z-index: 2; pointer-events: none; overflow: hidden; }
.ag-now { position: absolute; left: 0; right: 0; height: 2px; background: var(--bad); z-index: 5; pointer-events: none; } .ag-now::before { content: ""; position: absolute; left: -4px; top: -3px; width: 8px; height: 8px; border-radius: 50%; background: var(--bad); }

/* ---------- Modal ---------- */
.modal { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 20px; background: rgba(14,10,7,.55); backdrop-filter: blur(4px); }
.modal-card { background: var(--card); border-radius: 18px; width: 100%; max-width: 560px; max-height: calc(100vh - 40px); overflow-y: auto; padding: 24px; box-shadow: 0 40px 100px -30px rgba(0,0,0,.6); }
.modal-sm { max-width: 460px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.modal-card form { display: grid; gap: 14px; }
.modal-foot { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; padding-top: 4px; }
.modal-warn { background: rgba(201,138,27,.12); border: 1px solid rgba(201,138,27,.4); color: #7a540c; padding: 10px 14px; border-radius: 10px; }
.modal-warn button { margin-left: 8px; }
.pac-pick { position: relative; } .pac-sel { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border-radius: 10px; background: #F6EEE2; border: 1px solid var(--gold-2); } .pac-sel button { background: none; border: 0; color: var(--muted); }
.quick-pac { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; } .quick-pac input:last-child { grid-column: span 2; }
.slots-box small { color: var(--muted); }
.slots { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.slot { padding: 7px 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--card); font-size: 13px; transition: .15s; }
.slot:hover { border-color: var(--gold-2); } .slot.on { background: var(--ink); color: var(--gold-3); border-color: var(--ink); }

/* ---------- Ajustes ---------- */
.week-hours { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; margin-bottom: 8px; }
.wh-day { background: var(--bg); border-radius: 10px; padding: 10px; display: grid; gap: 6px; align-content: start; font-size: 13px; }
.wh-slot { display: flex; align-items: center; justify-content: space-between; gap: 4px; background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 2px 4px 2px 10px; }
.days { display: flex; gap: 6px; flex-wrap: wrap; } .chip-check input { display: none; } .chip-check span { display: inline-block; padding: 7px 12px; border-radius: 8px; border: 1px solid var(--line); cursor: pointer; font-size: 12.5px; } .chip-check input:checked + span { background: var(--ink); color: var(--gold-3); border-color: var(--ink); }
.bars { display: flex; align-items: flex-end; gap: 8px; height: 180px; padding-top: 10px; }
.bar-col { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 6px; } .bar-col i { width: 100%; max-width: 34px; border-radius: 6px 6px 2px 2px; background: var(--gold); } .bar-col small { font-size: 10.5px; color: var(--muted); }
.funnel { display: grid; gap: 10px; } .funnel-row { display: grid; grid-template-columns: 140px 1fr 30px; align-items: center; gap: 10px; font-size: 13px; } .funnel-bar { height: 10px; background: var(--bg); border-radius: 99px; overflow: hidden; } .funnel-bar i { display: block; height: 100%; border-radius: 99px; } .funnel-row b { text-align: right; font-weight: 600; }
.tasks .check { flex: 1; } .tasks.done .check span { text-decoration: line-through; color: var(--muted); }
.check:has(input:checked) > span { text-decoration: line-through; color: var(--muted); }

/* ---------- Login ---------- */
.login-body { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(900px 600px at 20% 0%, #3b2a1f 0%, transparent 60%), var(--noir); position: relative; overflow: hidden; }
.login-glow { position: absolute; width: 700px; height: 700px; right: -200px; bottom: -250px; border-radius: 50%; background: radial-gradient(circle, rgba(210,170,98,.22), transparent 65%); }
.login-card { position: relative; width: 100%; max-width: 400px; background: rgba(255,253,250,.97); border-radius: 22px; padding: 38px 34px; display: grid; gap: 16px; box-shadow: 0 50px 120px -40px rgba(0,0,0,.8); }
.login-logo { width: 170px; margin: 0 auto; filter: brightness(0) saturate(100%) invert(31%) sepia(15%) saturate(1200%) hue-rotate(345deg); }
.login-sub { text-align: center; margin: -6px 0 4px; color: var(--muted); }
.login-foot { text-align: center; font-size: 11.5px; color: var(--muted); margin: 0; }

/* ---------- Reserva pública ---------- */
.book-body { min-height: 100vh; background: radial-gradient(1000px 500px at 50% -10%, #3b2a1f, transparent 60%), var(--noir); color: var(--crema); position: relative; padding-bottom: 40px; }
.book-glow { position: fixed; right: -200px; bottom: -200px; width: 600px; height: 600px; border-radius: 50%; background: radial-gradient(circle, rgba(210,170,98,.14), transparent 65%); pointer-events: none; }
.book-head { display: flex; justify-content: center; padding: 28px 16px 6px; } .book-head img { width: 150px; }
.book { max-width: 680px; margin: 0 auto; padding: 14px 16px; position: relative; }
.book-card { background: var(--card); color: var(--ink); border-radius: 22px; padding: 34px 30px; box-shadow: 0 50px 120px -40px rgba(0,0,0,.8); }
.book-card.center { text-align: center; display: grid; gap: 16px; justify-items: center; }
.book-eyebrow { font-size: 11px; letter-spacing: .3em; text-transform: uppercase; color: var(--gold-1); font-weight: 500; margin: 0 0 8px; }
.book-card h1 { font-size: clamp(30px, 6vw, 42px); margin-bottom: 6px; }
.book-step { margin-top: 28px; display: block; } .book-step h2 { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; font-size: 21px; }
.book-step h2 span { width: 28px; height: 28px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--ink); color: var(--gold-3); font-family: var(--sans); font-size: 13px; font-weight: 500; }
.radio-cards { display: grid; gap: 10px; } .radio-card { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; transition: .15s; } .radio-card:has(input:checked) { border-color: var(--gold-1); background: #FBF3E4; box-shadow: 0 0 0 3px rgba(210,170,98,.2); } .radio-card strong { display: block; font-weight: 500; } .radio-card small { color: var(--muted); } .radio-card input { margin-top: 3px; }
#days { display: flex; flex-wrap: nowrap; gap: 8px; overflow-x: auto; padding: 4px 2px 12px; scroll-snap-type: x proximity; scrollbar-width: thin; }
.day { flex: 0 0 66px; display: grid; justify-items: center; gap: 0; padding: 10px 4px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); scroll-snap-align: start; transition: .15s; } .day small { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; } .day strong { font-family: var(--display); font-weight: 400; font-size: 24px; line-height: 1.2; } .day:hover { border-color: var(--gold-2); } .day.on { background: var(--ink); border-color: var(--ink); } .day.on small, .day.on strong { color: var(--gold-3); }
.slots-wrap h3 { margin: 6px 0 10px; font-size: 19px; } .slots.big .slot { padding: 11px 16px; font-size: 14px; border-radius: 10px; }
.chosen { display: grid; gap: 2px; padding: 14px 16px; background: #FBF3E4; border: 1px solid var(--gold-2); border-radius: 12px; margin-bottom: 16px; } .chosen span { color: var(--cafe); }
.book-step form, form.book-step .grid2 { margin-bottom: 0; } form.book-step { display: grid; gap: 14px; }
.hp { position: absolute !important; left: -9999px !important; opacity: 0; height: 0; }
.book-error { background: rgba(179,57,43,.1); border: 1px solid rgba(179,57,43,.35); color: #8d2b20; padding: 11px 14px; border-radius: 10px; }
.book-done { text-align: center; display: grid; gap: 16px; justify-items: center; padding: 10px 0; }
.done-icon { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; font-size: 30px; background: var(--gold); color: var(--noir); }
.book-summary { display: grid; gap: 12px; width: 100%; text-align: left; background: var(--bg); border-radius: 14px; padding: 18px 20px; } .book-summary small { display: block; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .1em; } .book-summary strong { font-weight: 500; }
.done-actions { display: grid; gap: 10px; width: 100%; justify-items: center; } .done-actions .btn { width: 100%; max-width: 320px; }
.book-help { text-align: center; margin-top: 18px; color: rgba(243,213,182,.7); } .book-help .link { color: var(--gold-3); }
.book-foot { text-align: center; font-size: 12px; color: rgba(243,213,182,.5); padding: 18px 16px; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) { .stats { grid-template-columns: repeat(2, 1fr); } .cols-3 { grid-template-columns: 1fr 1fr; } .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .icon-btn.only-mobile { display: inline-grid; }
  .side { position: fixed; left: 0; top: 0; bottom: 0; width: 270px; transform: translateX(-102%); transition: transform .3s; height: 100%; }
  .side.open { transform: none; box-shadow: 0 0 60px rgba(0,0,0,.5); }
  .scrim.show { display: block; position: fixed; inset: 0; background: rgba(14,10,7,.5); z-index: 55; }
  .topbar { padding: 10px 16px; gap: 10px; } .content { padding: 20px 16px 80px; }
  .top-actions .btn:not(.btn-gold) { display: none; } .top-actions .btn-gold { padding: 9px 12px; }
  .cols-2, .cols-2-1, .cols-3 { grid-template-columns: 1fr; }
  .row-cita { grid-template-columns: 64px 1fr auto; } .rc-actions { grid-column: 1 / -1; justify-content: flex-start; }
  .week-hours { grid-template-columns: repeat(2, 1fr); } .legend { margin-left: 0; }
  .patient-head { padding: 16px; } .avatar-lg { width: 56px; height: 56px; font-size: 20px; }
  .odo-arch { grid-template-columns: repeat(8, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  .stats, .stats-3 { grid-template-columns: 1fr 1fr; } .form-grid, .grid2, .grid3 { grid-template-columns: 1fr; } .span-2 { grid-column: auto; }
  .gsearch input { font-size: 12.5px; } .top-actions .btn-gold span { display: none; }
  .card { padding: 16px; } .modal-card { padding: 18px; } .book-card { padding: 24px 18px; } .funnel-row { grid-template-columns: 100px 1fr 24px; }
  .dl { grid-template-columns: 90px 1fr; } .mini-stats { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ---------- Inbox de WhatsApp ---------- */
.nav-wa { background: var(--wa) !important; color: #fff !important; }
.content:has(.inbox) { padding: 0; }
.inbox { display: grid; grid-template-columns: 350px minmax(0, 1fr); height: calc(100vh - 67px); border-top: 1px solid var(--line); background: var(--card); }
.ib-list { border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; background: #FBF6EF; }
.ib-tools { padding: 14px; display: flex; gap: 8px; align-items: center; position: relative; }
.ib-search { flex: 1; display: flex; align-items: center; gap: 8px; background: var(--card); border: 1px solid var(--line); border-radius: 99px; padding: 0 14px; color: var(--muted); }
.ib-search input { border: 0; background: none; padding: 10px 0; box-shadow: none !important; }
.ib-newbox { position: absolute; left: 14px; right: 14px; top: 60px; z-index: 20; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px; box-shadow: 0 24px 50px -20px rgba(34,24,18,.45); }
.ib-newres { margin-top: 6px; max-height: 260px; overflow-y: auto; }
.ib-newres .res-item { display: flex; align-items: center; gap: 10px; padding: 8px; border: 0; background: none; width: 100%; text-align: left; border-radius: 8px; }
.ib-newres .res-item:hover { background: #F6EEE2; } .ib-newres small { display: block; color: var(--muted); }
.ib-filters { display: flex; gap: 6px; padding: 0 14px 12px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.ib-filters button { padding: 5px 12px; border-radius: 99px; border: 1px solid var(--line); background: var(--card); font-size: 12px; font-weight: 500; color: var(--muted); }
.ib-filters button.on { background: var(--ink); color: var(--gold-3); border-color: var(--ink); }
.ib-items { overflow-y: auto; flex: 1; }
.ib-item { display: flex; gap: 12px; width: 100%; padding: 13px 14px; background: none; border: 0; border-bottom: 1px solid var(--line); text-align: left; align-items: center; }
.ib-item:hover { background: #F6EEE2; } .ib-item.on { background: #F1E3CF; box-shadow: inset 3px 0 0 var(--gold-2); }
.ib-item-main { flex: 1; min-width: 0; display: grid; gap: 3px; }
.ib-item-top { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; } .ib-item-top strong { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .ib-item-top small { color: var(--muted); font-size: 11px; flex: none; }
.ib-item.unread .ib-item-top strong { font-weight: 700; } .ib-item.unread .ib-prev { color: var(--ink); font-weight: 500; }
.ib-item-bot { display: flex; align-items: center; gap: 6px; } .ib-prev { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 12.5px; }
.tag { font-size: 10px; padding: 1px 7px; border-radius: 99px; font-weight: 600; flex: none; } .tag-ia { background: rgba(28,154,108,.14); color: #11694a; } .tag-warn { background: rgba(179,57,43,.14); color: #8d2b20; }
.ib-badge { background: var(--wa); color: #fff; border-radius: 99px; font-size: 11px; padding: 0 7px; min-width: 20px; text-align: center; font-weight: 600; flex: none; }
.ib-chat { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: #EDE3D4; }
.ib-empty { margin: auto; text-align: center; max-width: 380px; padding: 24px; display: grid; gap: 8px; justify-items: center; }
.ib-empty-ico { width: 74px; height: 74px; border-radius: 50%; display: grid; place-items: center; background: var(--wa); color: #fff; } .ib-empty-ico .ico { width: 38px; height: 38px; }
.ib-head { display: flex; align-items: center; gap: 12px; padding: 12px 18px; background: var(--card); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.ib-who { flex: 1; min-width: 160px; display: grid; line-height: 1.3; } .ib-who strong { font-weight: 500; font-size: 15px; } .ib-who small { color: var(--muted); }
.ib-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.ia-switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 12px; font-weight: 500; padding: 5px 10px; border: 1px solid var(--line); border-radius: 99px; background: var(--card); }
.ia-switch input { display: none; } .ia-switch .sw { width: 34px; height: 20px; border-radius: 99px; background: #CFC6B9; position: relative; transition: .2s; flex: none; }
.ia-switch .sw::after { content: ""; position: absolute; left: 2px; top: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: .2s; box-shadow: 0 1px 2px rgba(0,0,0,.3); }
.ia-switch input:checked + .sw { background: var(--ok); } .ia-switch input:checked + .sw::after { transform: translateX(14px); } .ia-switch em { font-style: normal; } .ia-switch.off { opacity: .55; }
.ib-banner { padding: 8px 18px; font-size: 12.5px; background: #FBF3E4; color: #7a540c; border-bottom: 1px solid var(--line); } .ib-banner.warn { background: rgba(179,57,43,.1); color: #8d2b20; }
.ib-msgs { flex: 1; overflow-y: auto; padding: 18px clamp(14px, 5vw, 70px); display: flex; flex-direction: column; gap: 6px; }
.ib-day { text-align: center; margin: 12px 0 6px; } .ib-day span { background: rgba(255,253,250,.9); padding: 3px 12px; border-radius: 99px; font-size: 11.5px; color: var(--muted); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.ib-msg { max-width: min(72%, 560px); padding: 8px 12px 5px; border-radius: 14px; font-size: 14px; line-height: 1.45; position: relative; box-shadow: 0 1px 1px rgba(0,0,0,.08); overflow-wrap: anywhere; }
.ib-msg.in { align-self: flex-start; background: #fff; border-top-left-radius: 4px; }
.ib-msg.out { align-self: flex-end; background: #DEF4CD; border-top-right-radius: 4px; }
.ib-msg.by-ia { background: #E7F3DA; box-shadow: 0 1px 1px rgba(0,0,0,.08), inset 3px 0 0 var(--gold-2); }
.ib-by { display: block; font-size: 10.5px; font-weight: 600; color: var(--cafe); margin-bottom: 2px; } .ib-by.ia { color: #1a7f4b; }
.ib-time { display: flex; justify-content: flex-end; gap: 5px; font-size: 10.5px; color: var(--muted); margin-top: 2px; align-items: center; }
.tick { letter-spacing: -3px; font-size: 12px; } .tick.read { color: #34B7F1; } .tick.err { color: var(--bad); letter-spacing: 0; cursor: help; }
.ib-img { max-width: 260px; max-height: 300px; border-radius: 10px; display: block; margin-bottom: 4px; } .ib-msg audio { max-width: 240px; height: 38px; display: block; }
.ib-doc { display: inline-block; padding: 6px 0; font-weight: 500; text-decoration: underline; }
.ib-composer { padding: 10px 14px; background: var(--card); border-top: 1px solid var(--line); position: relative; }
.ib-composer form { display: flex; align-items: flex-end; gap: 8px; }
.ib-composer textarea { flex: 1; resize: none; border-radius: 20px; padding: 10px 16px; max-height: 140px; line-height: 1.4; }
.ib-quick { position: absolute; bottom: calc(100% + 6px); left: 14px; width: min(440px, calc(100% - 28px)); background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 24px 50px -20px rgba(34,24,18,.5); max-height: 320px; overflow: auto; z-index: 15; }
.ib-quick button { display: grid; width: 100%; text-align: left; padding: 10px 14px; border: 0; border-bottom: 1px solid var(--line); background: none; gap: 2px; } .ib-quick button:hover { background: #F6EEE2; } .ib-quick small { color: var(--muted); }
.ib-tpl { padding: 14px 18px; background: var(--card); border-top: 1px solid var(--line); } .ib-tpl-head { display: grid; margin-bottom: 10px; }
.ib-tpl-body { display: grid; gap: 8px; } .tpl-prev { background: var(--bg); border-radius: 10px; padding: 10px 12px; white-space: pre-wrap; font-size: 13px; } .tpl-params { display: grid; gap: 8px; }

/* ---------- Integraciones ---------- */
.int-status { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 18px; }
.int-status > div { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; align-items: center; box-shadow: var(--shadow); }
.int-status small { grid-column: 2; color: var(--muted); }
.st-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; } .st-dot.ok { background: var(--ok); box-shadow: 0 0 0 3px rgba(28,154,108,.2); } .st-dot.no { background: #C9BFB2; }
.hook-box { display: grid; gap: 12px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); } .hook-box small { color: var(--muted); }
.guide { margin-top: 16px; background: var(--bg); border-radius: 12px; padding: 12px 16px; } .guide summary { cursor: pointer; font-weight: 500; color: var(--cafe); }
.guide ol { padding-left: 20px; line-height: 1.75; margin: 10px 0 0; } .guide code { background: var(--card); padding: 1px 6px; border-radius: 6px; font-size: 12px; }
.int-result { align-self: center; font-size: 13px; } .int-result.ok { color: var(--ok); } .int-result.bad { color: var(--bad); }
.field small.muted { text-transform: none; letter-spacing: 0; font-weight: 400; }

@media (max-width: 900px) {
  .inbox { grid-template-columns: 1fr; height: calc(100vh - 62px); }
  .inbox .ib-chat { display: none; } .inbox.chat-open .ib-chat { display: flex; } .inbox.chat-open .ib-list { display: none; }
  .ib-msg { max-width: 86%; } .int-status { grid-template-columns: 1fr; }
}
/* Ajuste: el buscador superior no debe mostrar un segundo borde interno */
.gsearch input[type=search], .gsearch input[type=text] { border: 0 !important; background: none !important; box-shadow: none !important; border-radius: 0; }
.gsearch input[type=search]::-webkit-search-cancel-button { display: none; }
/* Contactos */
.bulkbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 10px 16px; background: #FBF6EF; border-bottom: 1px solid var(--line); }
.bulkbar[hidden] { display: none; }
.gcal-box { background: #FBF6EF; border: 1px dashed var(--line); border-radius: 10px; padding: 12px 14px; }

/* Contactos (tabla estilo Propulse) */
.ct-filters { flex-wrap: wrap; align-items: center; }
.ct-filters input[type=search] { min-width: 240px; flex: 1 1 240px; }
.ct-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin: 4px 0 12px; font-size: 13px; }
.ct-per select { margin: 0 6px; padding: 5px 8px; }
.ct-pager { display: flex; gap: 6px; align-items: center; }
.ct-pager a { padding: 6px 11px; border-radius: 8px; border: 1px solid var(--line); background: var(--card); font-weight: 500; }
.ct-pager a.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.ct-table td { padding: 16px; vertical-align: middle; }
.ct-name { display: grid; gap: 2px; color: inherit; }
.ct-name strong { font-size: 14.5px; } .ct-name small { color: var(--muted); font-size: 12px; }
.ct-tags { margin-top: 6px; display: flex; gap: 6px; flex-wrap: wrap; }
.ct-wa { display: inline-flex; align-items: center; gap: 6px; color: #1C9A6C; font-weight: 600; }
.ct-wa .ico { width: 14px; height: 14px; }
.ct-cat { display: inline-block; padding: 3px 11px; border-radius: 99px; color: #fff; font-size: 12px; font-weight: 600; white-space: nowrap; }
.ct-list { display: inline-block; padding: 3px 10px; border-radius: 99px; background: rgba(28,154,108,.12); color: #137a53; font-size: 11.5px; font-weight: 500; }
/* Listas y campañas */
.ls-wrap { display: grid; grid-template-columns: 300px 1fr; gap: 20px; align-items: start; }
.ls-side { padding: 10px 8px; position: sticky; top: 76px; max-height: calc(100vh - 100px); overflow: auto; }
.ls-group { margin-bottom: 10px; }
.ls-group h3 { margin: 10px 10px 6px; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-weight: 500; }
.ls-group h3 small { text-transform: none; letter-spacing: 0; opacity: .7; font-weight: 400; }
.ls-item { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 10px; color: inherit; font-size: 13.5px; }
.ls-item:hover { background: #FBF6EF; } .ls-item.on { background: #F3E7D6; font-weight: 500; }
.ls-item i { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.ls-item span { flex: 1; min-width: 0; line-height: 1.25; } .ls-item small { display: block; color: var(--muted); font-size: 11px; }
.ls-item b { font-weight: 500; color: var(--muted); font-size: 12px; }
.ls-dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; margin-right: 10px; }
.ls-main > .card { margin-bottom: 16px; }
.ls-checks { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.ct-q { display: inline-block; padding: 3px 10px; border-radius: 99px; background: #F3E7D6; color: #5a4030; font-size: 11.5px; line-height: 1.35; }
@media (max-width: 980px) { .ls-wrap { grid-template-columns: 1fr; } .ls-side { position: static; max-height: 260px; } }

/* Negociaciones */
.board.hide-perdidos .col--perdido { display: none; }
.col--en_tratamiento { background: #E3EFE7; } .col--on_hold { background: #E6E6EE; } .col--perdido { background: #F1E3E0; }
.deal-val { display: block; border: 0; background: none; padding: 0; cursor: pointer; text-align: left; font-family: var(--display); font-size: 18px; color: var(--cafe); margin-top: 8px; }
.deal-val.is-empty { font-family: var(--sans); font-size: 12px; color: var(--muted); border-bottom: 1px dashed var(--line); display: inline-block; }
.deal-val:hover { color: var(--gold-1); }
.deal-info { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 4px; }
.deal-info li { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--ink); min-width: 0; }
.deal-info li .ico { width: 14px; height: 14px; color: var(--muted); flex: none; }
.deal-info li span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.deal-info li.is-cita { color: #2E6FB8; font-weight: 500; }
.deal-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 9px; }
.deal-tags .badge { font-size: 10.5px; padding: 2px 8px; }

/* Cotizador */
.cz-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; align-items: start; }
.cz-main > .card { margin-bottom: 18px; }
.cz-side { position: sticky; top: 76px; }
.cz-total { background: linear-gradient(145deg, #2E2019, #150E0A); color: #F6F0E8; border-color: rgba(210, 170, 98, .35); padding: 24px; display: grid; gap: 10px; }
.cz-total small { letter-spacing: .2em; text-transform: uppercase; font-size: 11px; color: #D2AA62; }
.cz-total__n { font-family: var(--display); font-size: 44px; line-height: 1.05; background: var(--gold); -webkit-background-clip: text; background-clip: text; color: transparent; }
.cz-total__r { display: flex; justify-content: space-between; font-size: 13.5px; color: rgba(246, 240, 232, .75); }
.cz-total hr { border: 0; border-top: 1px solid rgba(243, 213, 182, .15); margin: 6px 0; width: 100%; }
.cz-total .btn { width: 100%; }
.cz-item { border: 1px solid var(--line); border-radius: 12px; padding: 14px; margin-bottom: 12px; background: #FBF6EF; }
.cz-item__top { display: grid; grid-template-columns: minmax(0, 2.2fr) minmax(0, 1fr) 70px minmax(0, 1.1fr) 100px 30px; gap: 10px; align-items: end; margin-bottom: 8px; }
.cz-sub { text-align: right; } .cz-sub small { display: block; font-size: 10.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; } .cz-sub b { font-family: var(--display); font-weight: 400; font-size: 16px; color: var(--cafe); }
.cz-x { border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 16px; padding: 8px 0; } .cz-x:hover { color: var(--bad); }
.cz-add { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.cz-add select { max-width: 340px; }
.cz-vig { padding: 12px 0; font-size: 13px; color: #1C9A6C; font-weight: 500; } .cz-vig.bad { color: var(--bad); }
.cz-sent { display: flex; gap: 18px; align-items: center; margin-bottom: 18px; border-color: #1C9A6C; background: #F1F8F4; }
.cz-sent__ico { width: 54px; height: 54px; border-radius: 50%; background: #1C9A6C; color: #fff; display: grid; place-items: center; font-size: 26px; flex: none; }
@media (max-width: 1000px) { .cz-wrap { grid-template-columns: 1fr; } .cz-side { position: static; order: -1; } .cz-item__top { grid-template-columns: 1fr 1fr; } .cz-sub { text-align: left; } }

/* Barra inferior de Negociaciones: soltar en Ganado / Perdido sin desplazar el tablero */
.dock { position: sticky; bottom: 10px; z-index: 30; display: flex; align-items: stretch; gap: 12px; margin-top: 10px; padding: 10px; background: rgba(255,255,255,.94); backdrop-filter: blur(6px); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 8px 28px rgba(34,24,18,.14); }
.dock-lbl { align-self: center; font-size: 12px; color: var(--muted); flex: 0 1 190px; line-height: 1.3; }
.dock-zone { flex: 1; display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: 12px; border: 2px dashed transparent; transition: transform .15s, border-color .15s, background .15s; }
.dock-zone .ico { width: 20px; height: 20px; flex: none; }
.dock-zone strong { font-weight: 600; } .dock-zone small { color: inherit; opacity: .75; font-size: 11.5px; margin-left: auto; text-align: right; }
.dock-zone--ganado { background: #E3EFE7; color: #1C7A58; } .dock-zone--perdido { background: #F1E3E0; color: #B3392B; }
.dock-zone.is-over { transform: scale(1.03); border-color: currentColor; }
@media (max-width: 640px) { .dock-lbl, .dock-zone small { display: none; } }
.btn-danger { color: #B3392B; } .btn-danger:hover { background: #F1E3E0; }
.chip-danger:hover { background: #F1E3E0; }

/* Contactos: casilla «Llamado» */
.ct-call { text-align: center; } .ct-call small { font-size: 10.5px; line-height: 1.2; }
.chk-call { width: 22px; height: 22px; accent-color: #1C9A6C; cursor: pointer; }
.ct-table tr.is-llamado td { background: #F1F8F3; }
.ct-table tr.is-llamado .ct-name strong { color: #5f7a6a; }
