/* The Best Smile · panel de la clínica */
:root {
  --coral: #FF5C3B;
  --coral-ink: #C4381B;
  --coral-soft: #FFE9E3;
  --carbon: #2B2B2B;
  --carbon-2: #363636;
  --carbon-3: #444;
  --white: #FFFFFF;
  --bg: #EDE6E0;
  --surface-2: #F7F3F0;
  --surface-3: #E5DCD5;
  --muted: #6E6862;
  --muted-2: #9A928B;
  --line: #E0D6CE;
  --line-2: #CFC3B9;
  --chat-bg: #EAE3DD;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow-1: 0 1px 2px rgba(43, 43, 43, .07), 0 2px 8px rgba(43, 43, 43, .05);
  --shadow: 0 1px 3px rgba(43, 43, 43, .08), 0 8px 24px rgba(43, 43, 43, .08);
  --shadow-lift: 0 3px 6px rgba(43, 43, 43, .08), 0 18px 40px rgba(43, 43, 43, .14);
  --font-ui: "Outfit", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-brand: "Fraunces", Georgia, serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--carbon);
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
h1, h2, h3 { margin: 0; font-weight: 600; }
h1 { font-size: 28px; letter-spacing: -.01em; }
h2 { font-size: 17px; }
h3 { font-size: 12.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .07em; color: var(--carbon-3); margin-bottom: 12px; }
p { margin: 0; }
button { font-family: inherit; }
.display { font-family: var(--font-brand); font-weight: 500; font-size: 34px; letter-spacing: -.015em; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.strong { font-weight: 600; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ================= estructura ================= */
.shell { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  background: var(--carbon);
  color: #EDEAE7;
  padding: 22px 14px 18px;
  display: flex; flex-direction: column; gap: 28px;
  position: sticky; top: 0; height: 100vh;
  box-shadow: 4px 0 24px rgba(43, 43, 43, .12);
  z-index: 2;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 4px 8px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name { font-family: var(--font-brand); font-size: 19px; font-weight: 600; color: var(--white); }
.brand-sub { font-size: 12px; color: #9A948F; }
.mark { width: 40px; height: 40px; display: block; object-fit: contain; flex: none; }
.mark-lg { width: 88px; height: 88px; }
.sidebar .mark { width: 42px; height: 42px; padding: 5px; border-radius: 50%; background: var(--white); }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: 11px;
  color: #CFCAC6; font-weight: 500;
  transition: background .15s, color .15s;
}
.nav a:hover { background: var(--carbon-2); color: var(--white); }
.nav a.is-active { color: var(--coral); background: rgba(255, 92, 59, .11); }
.nav svg { width: 19px; height: 19px; }
.nav-badge {
  margin-left: auto; min-width: 22px; height: 22px; padding: 0 7px;
  border-radius: 11px; background: var(--carbon-3); color: #EDEAE7;
  font-size: 12px; font-weight: 600; display: grid; place-items: center;
}
.nav-badge-hot { background: var(--coral); color: var(--white); }
.sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: 14px; padding: 0 8px; }
.bot-status { display: flex; align-items: center; gap: 8px; font-size: 12px; color: #B8B2AD; }
.pulse { width: 8px; height: 8px; border-radius: 50%; background: #4CC38A; box-shadow: 0 0 0 0 rgba(76, 195, 138, .6); animation: pulse 2.4s infinite; flex: none; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(76,195,138,.5); } 70% { box-shadow: 0 0 0 7px rgba(76,195,138,0); } 100% { box-shadow: 0 0 0 0 rgba(76,195,138,0); } }
.logout { display: flex; align-items: center; justify-content: space-between; border-top: 1px solid var(--carbon-3); padding-top: 14px; }
.who { font-size: 13px; color: #CFCAC6; }
.logout button { background: none; border: 0; color: #9A948F; font: inherit; font-size: 13px; cursor: pointer; padding: 0; }
.logout button:hover { color: var(--white); }

.content { padding: 36px 44px 64px; max-width: 1360px; width: 100%; }
.content-flush { padding: 0; max-width: none; }
.page-head { margin-bottom: 28px; padding-bottom: 22px; border-bottom: 1px solid var(--line-2); display: flex; flex-direction: column; gap: 2px; }
.page-head-row { flex-direction: row; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.eyebrow { color: var(--muted); font-size: 13px; display: flex; align-items: center; gap: 4px; }

.eyebrow a { display: inline-flex; align-items: center; gap: 4px; }
.eyebrow a:hover { color: var(--carbon); }
.section-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.section-head h2 { display: flex; align-items: center; gap: 10px; font-size: 18px; }
.section-head h2::before { content: ""; width: 4px; height: 18px; border-radius: 2px; background: var(--coral); flex: none; }
.section-gap { margin-top: 40px; }
.section-link { margin-left: auto; font-size: 13px; font-weight: 500; color: var(--muted); }
.section-link:hover { color: var(--carbon); }
.count {
  min-width: 24px; height: 24px; padding: 0 8px; border-radius: 12px;
  background: var(--carbon); color: var(--white); font-size: 13px; font-weight: 600;
  display: inline-grid; place-items: center;
}

/* ================= piezas ================= */
.avatar {
  display: inline-grid; place-items: center; flex: none;
  border-radius: 50%; font-weight: 600; letter-spacing: .02em; color: var(--carbon);
}
.avatar-sm { width: 32px; height: 32px; font-size: 12px; }
.avatar-md { width: 44px; height: 44px; font-size: 15px; }
.avatar-lg { width: 52px; height: 52px; font-size: 17px; }
.avatar-xl { width: 76px; height: 76px; font-size: 24px; font-family: var(--font-brand); font-weight: 500; }
.tone-0 { background: #F3DDD4; } .tone-1 { background: #E4E0D9; } .tone-2 { background: #DCE5DF; }
.tone-3 { background: #E8DCE6; } .tone-4 { background: #DDE2EA; } .tone-5 { background: #F0E5CF; }

.chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 999px;
  background: var(--white); color: var(--muted); font-size: 12px; font-weight: 500; white-space: nowrap;
}
.chip svg { width: 13px; height: 13px; }
.chip-pending { background: var(--coral-soft); color: var(--coral-ink); }
.time { color: var(--coral); font-weight: 600; font-variant-numeric: tabular-nums; }
.sede-tag {
  display: inline-flex; align-items: center; font-size: 11.5px; font-weight: 600;
  padding: 2px 9px; border-radius: 6px; border: 1px solid var(--carbon); white-space: nowrap; letter-spacing: .01em;
}
.sede-medellin { background: var(--carbon); color: var(--white); }
.sede-cucuta { background: var(--white); color: var(--carbon); }
.tag { font-size: 12px; padding: 3px 10px; border-radius: 999px; background: var(--bg); color: var(--carbon); }

.btn {
  appearance: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid var(--line-2); background: var(--white); color: var(--carbon);
  font: inherit; font-weight: 500; padding: 10px 18px; border-radius: 11px; cursor: pointer;
  transition: border-color .15s, background .15s, transform .1s;
}
.btn:hover { border-color: var(--carbon); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--coral); border-color: var(--coral); color: var(--white); font-weight: 600; }
.btn-primary:hover { background: #F04A28; border-color: #F04A28; }
.btn-ghost { background: transparent; }
.btn-ghost:hover { background: var(--white); }
.btn-sm { padding: 7px 12px; font-size: 13px; border-radius: 9px; }
.btn-block { width: 100%; }

.pcard { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow-1); border: 1px solid var(--line); padding: 16px 18px 18px; }
.pcard h3 { margin: 0 -18px 14px; padding: 0 18px 10px; border-bottom: 1px solid var(--line); }

.empty {
  background: var(--surface-2); border: 1.5px dashed var(--line-2); border-radius: var(--radius);
  padding: 40px 28px; text-align: center;
}
.empty-flat { background: transparent; }
.empty-small { padding: 24px 18px; }
.empty-title { font-family: var(--font-brand); font-size: 20px; margin-bottom: 6px; }
.empty .muted { margin: 0 auto; max-width: 380px; }
.empty-inline { padding: 18px; text-align: center; }
.placeholder-art {
  width: 56px; height: 56px; border-radius: 16px; margin: 0 auto 14px;
  background: var(--bg); color: var(--muted-2); display: grid; place-items: center;
}
.placeholder-art svg { width: 26px; height: 26px; }

.segmented { display: inline-flex; background: var(--white); border: 1px solid var(--line); border-radius: 12px; padding: 4px; gap: 2px; box-shadow: var(--shadow-1); }
.segmented a { padding: 7px 14px; border-radius: 9px; font-size: 14px; font-weight: 500; color: var(--muted); display: inline-flex; gap: 8px; align-items: center; }
.segmented a:hover { color: var(--carbon); }
.segmented a.is-active { background: var(--carbon); color: var(--white); }
.seg-count { font-size: 12px; opacity: .7; }

/* ================= Hoy ================= */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 32px; }
.kpi {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 20px; display: flex; flex-direction: column; gap: 2px;
  box-shadow: var(--shadow-1);
  transition: box-shadow .15s, transform .15s;
}
.kpi:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.kpi-label { font-size: 13px; color: var(--muted); font-weight: 500; }
.kpi-value { font-family: var(--font-brand); font-size: 40px; font-weight: 500; line-height: 1.1; letter-spacing: -.02em; }
.kpi-foot { font-size: 12px; color: var(--muted-2); }
.kpi-hot { border-color: #FFC2B2; background: linear-gradient(180deg, #FFEFEA 0%, var(--white) 75%); box-shadow: inset 0 3px 0 var(--coral), var(--shadow-1); }
.kpi-hot .kpi-value { color: var(--coral); }

.today { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 32px; align-items: start; }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.photo-grid-lg { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 18px; }
.photo-card {
  background: var(--white); border-radius: var(--radius); border: 1px solid var(--line);
  overflow: hidden; display: flex; flex-direction: column; position: relative;
  box-shadow: var(--shadow-1);
  transition: transform .18s ease, box-shadow .18s ease;
}
.photo-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lift); }
.thumb { aspect-ratio: 4 / 3; background: #EEE8E4; overflow: hidden; }
.thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.photo-card:hover .thumb img { transform: scale(1.03); }
.chip-float { position: absolute; top: 12px; left: 12px; box-shadow: 0 2px 6px rgba(0,0,0,.12); }
.photo-meta { padding: 12px 14px 14px; display: flex; align-items: center; gap: 10px; border-top: 1px solid var(--line); }
.photo-name { font-weight: 600; font-size: 15px; line-height: 1.25; }
.photo-sub { color: var(--muted); font-size: 12.5px; }
.drive-mark { margin-left: auto; color: var(--muted-2); }

.recent { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-1); }
.recent-row { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.recent-row:last-child { border-bottom: 0; }
.recent-row:hover { background: var(--surface-2); }
.recent-main { flex: 1; min-width: 0; }

.today-agenda { position: sticky; top: 28px; }
.agenda-card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-1); }
.agenda-sede { padding: 0 18px 14px; }
.agenda-sede + .agenda-sede { border-top: 1px solid var(--line-2); }
.agenda-sede-head {
  display: flex; align-items: center; gap: 8px;
  margin: 0 -18px 8px; padding: 12px 18px;
  background: var(--surface-2); border-bottom: 1px solid var(--line);
}
.agenda { list-style: none; margin: 0; padding: 0; position: relative; }
.agenda li { display: grid; grid-template-columns: 52px 1fr; gap: 10px; padding: 8px 0; align-items: start; }
.agenda .time { font-size: 14px; padding-top: 7px; }
.agenda-item { display: flex; flex-direction: column; padding: 6px 10px; border-radius: 10px; background: var(--surface-2); border-left: 3px solid var(--carbon); }
.agenda-item:hover { background: var(--bg); }
.agenda-name { font-weight: 600; font-size: 14px; }
.agenda-sub { color: var(--muted); font-size: 12.5px; }
.agenda li.is-past { opacity: .5; }
.agenda li.is-past .time { color: var(--muted); }
.agenda-empty { padding: 6px 0 2px; }

/* ================= Pacientes (bandeja) ================= */
.inbox { display: grid; grid-template-columns: 360px minmax(0, 1fr) 360px; height: 100vh; }
.inbox:not(.has-selected) { grid-template-columns: 360px minmax(0, 1fr); }
.inbox-list { background: var(--white); border-right: 1px solid var(--line-2); box-shadow: 2px 0 12px rgba(43, 43, 43, .06); position: relative; z-index: 1; display: flex; flex-direction: column; min-height: 0; }
.inbox-head { padding: 26px 20px 12px; display: flex; align-items: baseline; justify-content: space-between; }
.inbox-head h1 { font-family: var(--font-brand); font-weight: 500; font-size: 28px; }
.search {
  margin: 0 16px; display: flex; align-items: center; gap: 8px;
  background: var(--bg); border-radius: 12px; padding: 0 12px; color: var(--muted);
  border: 1px solid var(--line);
}
.search:focus-within { border-color: var(--line-2); background: var(--white); }
.search input { border: 0; background: transparent; font: inherit; padding: 10px 0; width: 100%; outline: none; color: var(--carbon); }
.filters-row { display: flex; gap: 6px; padding: 12px 16px; flex-wrap: wrap; border-bottom: 1px solid var(--line-2); }
.pill { border: 1px solid var(--line-2); background: var(--white); border-radius: 999px; padding: 5px 12px; font-size: 13px; color: var(--muted); cursor: pointer; }
.pill:hover { color: var(--carbon); }
.pill.is-active { background: var(--carbon); border-color: var(--carbon); color: var(--white); }
.convos { list-style: none; margin: 0; padding: 6px 8px 16px; overflow-y: auto; flex: 1; }
.convos li + li .convo { border-top: 1px solid var(--line); }
.convo { display: flex; gap: 12px; padding: 12px; border-radius: 14px; transition: background .12s; }
.convo:hover { background: var(--surface-2); }
.convo.is-active { background: var(--coral-soft); box-shadow: inset 3px 0 0 var(--coral); }
.convo.is-active, .convo:hover, .convos li:has(.convo:hover) + li .convo, .convos li:has(.convo.is-active) + li .convo { border-top-color: transparent; }
.convo-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.convo-top, .convo-bottom { display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.convo-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.convo-time { font-size: 12px; color: var(--muted-2); white-space: nowrap; }
.convo-preview { font-size: 13.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 4px; min-width: 0; }
.convo-preview svg { width: 15px; height: 15px; }
.preview-bot { color: #53A8E2; display: inline-flex; }
.convo-meta { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.dot-badge { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--coral); color: var(--white); font-size: 11.5px; font-weight: 600; display: grid; place-items: center; }

/* ---- chat ---- */
.chat-pane { display: flex; flex-direction: column; min-height: 0; min-width: 0; background: var(--chat-bg); }
.chat-head {
  display: flex; align-items: center; gap: 12px; padding: 14px 20px;
  background: var(--white); border-bottom: 1px solid var(--line-2); z-index: 1;
  box-shadow: 0 2px 10px rgba(43, 43, 43, .06);
}
.chat-head-text { flex: 1; min-width: 0; }
.chat-head-name { font-weight: 600; font-size: 16px; }
.back-link { display: none; color: var(--muted); }
.chat-body {
  flex: 1; overflow-y: auto; padding: 18px 7% 24px;
  background-color: var(--chat-bg);
  background-image: radial-gradient(rgba(43,43,43,.045) 1px, transparent 1.2px);
  background-size: 18px 18px;
  display: flex; flex-direction: column;
}
.day-sep { display: flex; justify-content: center; margin: 18px 0 8px; }
.day-sep span { background: rgba(255,255,255,.92); backdrop-filter: blur(4px); color: var(--muted); font-size: 12px; font-weight: 500; padding: 4px 12px; border-radius: 8px; box-shadow: var(--shadow-1); }

.msg { display: flex; flex-direction: column; max-width: min(72%, 560px); margin-top: 2px; }
.msg.is-first { margin-top: 10px; }
.msg-in { align-self: flex-start; align-items: flex-start; }
.msg-out { align-self: flex-end; align-items: flex-end; }
.msg-author { font-size: 11.5px; color: var(--muted); display: inline-flex; align-items: center; gap: 4px; margin: 0 6px 3px; }
.msg-author svg { width: 13px; height: 13px; }
.bubble {
  position: relative; padding: 7px 10px 6px 12px; border-radius: 14px;
  box-shadow: 0 1px .5px rgba(43,43,43,.10); font-size: 14.5px; line-height: 1.42;
  min-width: 72px;
}
.msg-in .bubble { background: var(--white); color: var(--carbon); }
.msg-out .bubble { background: var(--carbon); color: #F5F2EF; }
.msg-in.is-first .bubble { border-top-left-radius: 4px; }
.msg-out.is-first .bubble { border-top-right-radius: 4px; }
.msg-in.is-first .bubble::before, .msg-out.is-first .bubble::before {
  content: ""; position: absolute; top: 0; width: 10px; height: 12px;
}
.msg-in.is-first .bubble::before { left: -7px; background: var(--white); clip-path: polygon(100% 0, 0 0, 100% 100%); }
.msg-out.is-first .bubble::before { right: -7px; background: var(--carbon); clip-path: polygon(0 0, 100% 0, 0 100%); }
.bubble-text { white-space: pre-wrap; overflow-wrap: anywhere; display: inline; }
.bubble-meta {
  float: right; margin: 6px 0 -2px 12px; font-size: 11px; line-height: 1; display: inline-flex; align-items: center; gap: 3px;
  color: var(--muted-2); position: relative; top: 4px;
}
.msg-out .bubble-meta { color: rgba(245,242,239,.55); }
.ticks { display: inline-flex; color: #7CC4F2; }
.ticks svg { width: 15px; height: 15px; }
.bubble-photo { display: block; margin: -3px -6px 6px -8px; border-radius: 10px; overflow: hidden; max-width: 300px; }
.bubble-photo img { width: 100%; max-height: 300px; object-fit: cover; }
.has-photo .bubble { padding-top: 6px; }
.is-failed .bubble { box-shadow: 0 0 0 2px var(--coral); }
.is-failed .ticks { color: var(--coral); font-weight: 600; }
.chat-empty { margin: auto; }
.chat-foot {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px; font-size: 12.5px; color: var(--muted); background: var(--white); border-top: 1px solid var(--line-2);
}
.chat-placeholder { margin: auto; text-align: center; padding: 40px; }
.chat-placeholder .muted { max-width: 300px; margin: 0 auto; }

/* ---- ficha ---- */
.profile-pane { background: var(--surface-3); border-left: 1px solid var(--line-2); box-shadow: inset 6px 0 12px -8px rgba(43, 43, 43, .12); overflow-y: auto; padding: 22px 18px 40px; display: flex; flex-direction: column; gap: 14px; }
.profile-hero { text-align: center; padding: 8px 6px 4px; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.profile-hero .avatar { margin-bottom: 8px; box-shadow: 0 0 0 4px var(--white), var(--shadow); }
.profile-name { font-family: var(--font-brand); font-weight: 500; font-size: 23px; }
.profile-tags { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 8px; }
.profile-tags .tag { background: var(--white); }
.demo-note {
  font-size: 11.5px; color: var(--muted); text-align: center;
  border: 1px dashed var(--line-2); border-radius: 8px; padding: 5px 8px; background: var(--surface-2);
}
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stat { background: var(--white); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; box-shadow: var(--shadow-1); }
.stat-value { font-family: var(--font-brand); font-size: 21px; font-weight: 500; letter-spacing: -.01em; display: inline-flex; align-items: center; gap: 4px; line-height: 1.2; }
.stat-value svg { width: 16px; height: 16px; fill: #F2B544; stroke: #F2B544; }
.stat-label { font-size: 12px; color: var(--muted); }
.next-appt { display: flex; gap: 14px; align-items: center; }
.next-appt .time { font-size: 22px; font-family: var(--font-brand); font-weight: 500; }
.plan-top { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; margin-bottom: 10px; }
.progress { height: 8px; background: var(--bg); border-radius: 4px; overflow: hidden; }
.progress span { display: block; height: 100%; background: var(--carbon); border-radius: 4px; }
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before { content: ""; position: absolute; left: 5px; top: 8px; bottom: 8px; width: 2px; background: var(--line); }
.timeline li { display: flex; gap: 12px; padding: 6px 0; position: relative; }
.tl-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--white); border: 2px solid var(--carbon); margin-top: 4px; flex: none; position: relative; z-index: 1; }
.timeline li:first-child .tl-dot { background: var(--carbon); }
.tl-body { flex: 1; min-width: 0; }
.tl-top { display: flex; justify-content: space-between; gap: 8px; font-size: 14px; }
.note { font-size: 14px; line-height: 1.5; padding: 10px 12px; background: var(--surface-2); border-radius: 10px; border-left: 3px solid var(--line-2); margin-bottom: 12px; font-style: italic; }
.facts { margin: 0; display: flex; flex-direction: column; gap: 8px; }
.facts div { display: flex; justify-content: space-between; gap: 10px; font-size: 13.5px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; font-weight: 500; text-align: right; }
.mini-photos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.mini-photo { position: relative; border-radius: 10px; overflow: hidden; aspect-ratio: 1; background: #EEE8E4; }
.mini-photo img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.mini-photo:hover img { transform: scale(1.05); }
.corner-dot { position: absolute; top: 6px; right: 6px; width: 10px; height: 10px; border-radius: 50%; background: var(--coral); box-shadow: 0 0 0 2px var(--white); }

/* ================= Foto ================= */
.photo-detail { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 24px; align-items: start; }
.photo-large {
  background: #1F1F1F; border-radius: 20px; overflow: hidden; display: grid; place-items: center;
  min-height: 480px; box-shadow: var(--shadow);
}
.photo-large img { max-height: 80vh; width: auto; object-fit: contain; }
.photo-side { display: flex; flex-direction: column; gap: 14px; }
.who-card { display: flex; align-items: center; gap: 12px; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow-1); }
.who-card > div { flex: 1; min-width: 0; }
.who-card:hover { box-shadow: var(--shadow); }
.status-line { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.preview-msg { max-width: 100%; margin: 0 0 10px 8px; align-self: stretch; }
.preview-msg .bubble { font-size: 14px; }
.actions { display: flex; flex-direction: column; gap: 8px; }
.link-row { display: flex; gap: 8px; flex-wrap: wrap; }
.mini-photos-3 { grid-template-columns: repeat(3, 1fr); }

/* ================= Citas ================= */
.week { display: flex; align-items: stretch; gap: 8px; margin-bottom: 26px; }
.week-nav { display: grid; place-items: center; width: 40px; border-radius: 12px; color: var(--muted); }
.week-nav:hover { background: var(--white); color: var(--carbon); }
.week-day {
  flex: 1; background: var(--white); border: 1px solid var(--line); border-radius: 14px;
  padding: 10px 6px; text-align: center; display: flex; flex-direction: column; gap: 2px;
  box-shadow: var(--shadow-1);
  transition: border-color .15s, box-shadow .15s;
}
.week-day:hover { border-color: var(--line-2); box-shadow: var(--shadow); }
.wd-name { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.wd-num { font-family: var(--font-brand); font-size: 24px; font-weight: 500; line-height: 1.15; }
.wd-count { font-size: 12px; color: var(--muted-2); }
.week-day.is-today .wd-num { color: var(--coral); }
.week-day.is-sel { background: var(--carbon); border-color: var(--carbon); color: var(--white); }
.week-day.is-sel .wd-name, .week-day.is-sel .wd-count { color: #BDB7B2; }
.day-title { font-family: var(--font-brand); font-weight: 500; font-size: 22px; margin-bottom: 14px; }
.sede-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.sede-cols.is-single { grid-template-columns: minmax(0, 720px); }
.sede-col { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-1); }
.sede-col-head { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line-2); background: var(--surface-2); flex-wrap: wrap; }
.appts { list-style: none; margin: 0; padding: 6px 0; }
.appt { display: flex; align-items: center; gap: 14px; padding: 12px 18px; }
.appt + .appt { border-top: 1px solid var(--line); }
.appt-time { display: flex; flex-direction: column; width: 52px; flex: none; }
.appt-time .time { font-size: 16px; }
.appt-body { flex: 1; display: flex; align-items: center; gap: 10px; min-width: 0; }
.appt-body:hover .strong { text-decoration: underline; text-decoration-color: var(--line-2); }
.appt-link { font-size: 12px; color: var(--muted); border: 1px solid var(--line-2); border-radius: 8px; padding: 4px 9px; }
.appt-link:hover { color: var(--carbon); border-color: var(--carbon); }

/* ================= Login ================= */
.login {
  min-height: 100vh; display: grid; place-items: center; padding: 24px 16px;
  background: radial-gradient(1200px 600px at 80% -10%, #FFE3DA 0%, transparent 60%), var(--bg);
}
.login-card { width: 100%; max-width: 400px; background: var(--white); border-radius: 24px; box-shadow: var(--shadow-lift); padding: 42px 34px; text-align: center; }
.login-card .mark { margin: 0 auto 18px; }
.clinic { font-family: var(--font-brand); font-weight: 500; font-size: 32px; }
.login-card .muted { margin: 4px 0 28px; }
.login-card form { display: flex; flex-direction: column; gap: 8px; text-align: left; }
.login-card label { font-size: 13px; font-weight: 500; margin-top: 6px; }
.login-card input { font: inherit; padding: 12px 14px; border: 1px solid var(--line-2); border-radius: 11px; background: var(--surface-2); }
.login-card input:focus { outline: 2px solid var(--carbon); outline-offset: 1px; background: var(--white); }
.login-card .btn { margin-top: 14px; padding: 12px; }
.error { color: var(--coral-ink); font-size: 14px; margin-top: 4px; }

/* ================= responsive ================= */
@media (max-width: 1360px) {
  .inbox { grid-template-columns: 320px minmax(0, 1fr) 320px; }
  .inbox:not(.has-selected) { grid-template-columns: 320px minmax(0, 1fr); }
}
@media (max-width: 1180px) {
  .inbox.has-selected { grid-template-columns: 320px minmax(0, 1fr); }
  .inbox.has-selected .profile-pane { grid-column: 1 / -1; border-left: 0; border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); align-items: start; }
  .inbox.has-selected { height: auto; }
  .inbox.has-selected .chat-pane, .inbox.has-selected .inbox-list { height: 100vh; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1000px) {
  .today, .photo-detail { grid-template-columns: 1fr; }
  .today-agenda { position: static; }
  .sede-cols { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: sticky; top: 0; z-index: 5; height: auto; flex-direction: row; align-items: center; gap: 8px; padding: 10px 12px; }
  .brand-text, .sidebar-foot { display: none; }
  .nav { flex-direction: row; flex: 1; justify-content: flex-end; }
  .nav a { padding: 8px 10px; gap: 6px; }
  .nav a span:not(.nav-badge) { display: none; }
  .content { padding: 22px 16px 48px; }
  .content-flush { padding: 0; }
  .display { font-size: 28px; }
  .kpis { gap: 10px; }
  .kpi { padding: 14px; }
  .kpi-value { font-size: 32px; }
  .inbox, .inbox:not(.has-selected), .inbox.has-selected { grid-template-columns: 1fr; height: auto; }
  .inbox.has-selected .inbox-list { display: none; }
  .inbox:not(.has-selected) .chat-pane { display: none; }
  .inbox-list, .inbox.has-selected .chat-pane { height: calc(100vh - 58px); }
  .back-link { display: inline-flex; }
  .chat-head .btn { display: none; }
  .chat-body { padding: 14px 12px 20px; }
  .msg { max-width: 86%; }
  .inbox.has-selected .profile-pane { display: flex; }
  .week { gap: 4px; }
  .week-nav { width: 28px; }
  .wd-count { display: none; }
  .segmented { width: 100%; overflow-x: auto; }
}
