/* AV Agenda · sistema visual de «Facturas · Ferval» y el Monitor (Iris, 30-nov-2026).
   Carbón y oro; fuentes del sistema; serif solo en la marca. */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --bg: #F7F7F5; --surface: #FFF; --line: #E7E5E0; --line-2: #D6D3CC; --line-3: #EFEEEA;
  --ink: #1C1B19; --ink-2: #5B5852; --ink-3: #6F6B63;
  --carbon: #1C1B19; --oro: #B08A2E; --oro-soft: #F6EEDA; --oro-ink: #7A5C14;
  --verde-f: #E7F4EC; --verde: #1E6B3F; --verde-p: #2E9E5E;
  --ambar-f: #FDF1DC; --ambar: #8A5A00; --ambar-p: #D98A00;
  --rojo-f: #FBE9E7; --rojo: #A32A1F; --rojo-p: #D6453A;
  --azul-f: #E8F0FA; --azul: #214E8A; --azul-p: #3B7BD1;
  --gris-f: #EFEEEA; --gris: #5B5852; --gris-p: #A39F96;
  --r-sm: 6px; --r-md: 10px;
  --sh-1: 0 1px 2px rgba(28,27,25,.06); --sh-2: 0 4px 16px rgba(28,27,25,.08);
  --sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
}
html { -webkit-text-size-adjust: 100%; }
body { background: var(--bg); color: var(--ink); font: 14.5px/1.45 var(--sans); }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--oro); outline-offset: 2px; }
.hidden { display: none !important; }
[hidden] { display: none !important; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.num { text-align: right; font-variant-numeric: tabular-nums; }
h1 { font-size: 26px; line-height: 1.2; font-weight: 600; letter-spacing: -.01em; }
h2 { font-size: 16px; font-weight: 600; }
.sub { color: var(--ink-2); margin-top: 2px; }
.ico { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.enlace { background: none; border: 0; text-decoration: underline; padding: 0; color: inherit; }
.tenue-txt { color: var(--ink-3); font-size: 13px; }

/* ── Entrar ── */
.login-screen { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login-card { width: 100%; max-width: 380px; background: var(--surface); border: 1px solid var(--line); border-top: 3px solid var(--oro); border-radius: var(--r-md); padding: 32px 30px; box-shadow: var(--sh-2); }
.login-marca { color: var(--ink) !important; padding: 0 0 22px !important; }
.login-error { background: var(--rojo-f); color: #7d2a22; border-left: 4px solid var(--rojo-p); border-radius: var(--r-sm); padding: 10px 14px; margin-bottom: 14px; font-size: 13.5px; }
.btn-login { width: 100%; height: 44px; justify-content: center; }
.field { margin-bottom: 14px; }
.field-label { display: block; font-size: 13px; font-weight: 500; color: var(--ink-2); margin-bottom: 5px; }
.field-wrap { position: relative; }
.field-wrap .field-input { padding-right: 84px; }
.toggle-pw { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); background: none; border: 0; color: var(--ink-2); font-size: 13px; padding: 6px; }
.field-input { width: 100%; height: 38px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: 8px; background: #fff; }
.login-card .field-input { height: 44px; }
.field-input:focus { outline: 2px solid var(--oro); outline-offset: -1px; border-color: var(--oro); }

/* ── Estructura ── */
.app { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100vh; }
.side { background: var(--carbon); color: #CFCBC2; padding: 22px 14px; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.marca { font: 600 22px/1.05 Georgia, "Times New Roman", serif; color: #fff; padding: 0 10px 22px; text-decoration: none; display: block; }
.marca b { color: var(--oro); font-weight: 600; display: block; font-size: 17px; margin-top: 4px; }
.login-marca b { color: #8A6A1C; }
.nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav .grupo { font: 600 11px/1 var(--sans); letter-spacing: .12em; text-transform: uppercase; color: #8B8579; padding: 12px 12px 6px; }
.nav .grupo:first-child { padding-top: 0; }
.nav a, .nav .nav-a { display: flex; gap: 10px; align-items: center; padding: 9px 12px; border-radius: 8px; color: #CFCBC2; text-decoration: none; font-weight: 500; border: 0; border-left: 3px solid transparent; background: none; text-align: left; width: 100%; }
.nav a:hover, .nav .nav-a:hover { color: #fff; background: rgba(255,255,255,.05); }
.nav a.activo { background: rgba(255,255,255,.08); color: #fff; border-left-color: var(--oro); }
.nav .nav-a:disabled { opacity: .6; cursor: progress; }
.nav svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.nav .tecla { margin-left: auto; border: 1px solid rgba(255,255,255,.2); border-radius: 4px; font-size: 11px; padding: 0 6px; color: #A39F96; }
.nav .pie { margin-top: auto; border-top: 1px solid rgba(255,255,255,.1); padding: 8px 0; }
.usuario { padding: 12px 10px 0; border-top: 1px solid rgba(255,255,255,.1); font-size: 13px; color: #A39F96; overflow-wrap: anywhere; }
.usuario .enlace { color: #CFCBC2; }
.btn.menu-movil { display: none; }
.col { min-width: 0; }
.app-main { padding: 26px 32px 96px; max-width: 1560px; }
body.con-ayuda .app-main { padding-right: 432px; }
.cabecera { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; }
.cabecera-der { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.cabecera-der .field-input { width: auto; }
.cabecera-der input[type=search] { width: 220px; }
.banda { background: var(--ambar-f); color: #5e4100; border-bottom: 1px solid var(--ambar-p); padding: 10px 32px; font-size: 13.5px; display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.banda.oro { background: var(--oro-soft); color: var(--oro-ink); border-color: #DCC68C; }

/* ── Botones y píldoras ── */
.btn { display: inline-flex; align-items: center; gap: 7px; height: 38px; padding: 0 14px; border-radius: 8px; font-weight: 500; font-size: 14px; border: 1px solid var(--line-2); background: #fff; text-decoration: none; white-space: nowrap; color: var(--ink); }
.btn:hover { background: #F2F1ED; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-sm { height: 32px; padding: 0 10px; font-size: 13px; }
.btn-ico { padding: 0; width: 38px; justify-content: center; } .btn-ico.btn-sm { width: 32px; }
.btn-primary { background: var(--carbon); border-color: var(--carbon); color: #fff; }
.btn-primary:hover { background: #000; }
.btn-oro { background: #8A6A1C; border-color: #8A6A1C; color: #fff; } .btn-oro:hover { background: #775A14; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: #ECEAE4; color: var(--ink); }
.btn-danger { color: var(--rojo); border-color: #E3B4AE; } .btn-danger:hover { background: var(--rojo-f); }
.status-badge, .role-badge, .badge-inactive { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 999px; font-size: 12.5px; font-weight: 500; white-space: nowrap; background: var(--gris-f); color: var(--gris); }
.status-badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--gris-p); }
.status-badge.azul { background: var(--azul-f); color: var(--azul); } .status-badge.azul::before { background: var(--azul-p); }
.status-badge.verde { background: var(--verde-f); color: var(--verde); } .status-badge.verde::before { background: var(--verde-p); }
.status-badge.ambar { background: var(--ambar-f); color: var(--ambar); } .status-badge.ambar::before { background: var(--ambar-p); }
.status-badge.rojo { background: var(--rojo-f); color: var(--rojo); } .status-badge.rojo::before { background: var(--rojo-p); }
.role-admin { background: var(--oro-soft); color: var(--oro-ink); }
.doctor { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-2); white-space: nowrap; }
.doctor i, .pild i { width: 8px; height: 8px; border-radius: 50%; flex: none; display: inline-block; }
.filtros { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.filtros:empty { display: none; }
.filtros .sep { width: 1px; height: 20px; background: var(--line-2); margin: 0 4px; }
.pild { display: inline-flex; align-items: center; gap: 6px; background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; font-size: 13px; color: var(--ink-2); white-space: nowrap; }
.pild b { color: var(--ink); font-variant-numeric: tabular-nums; }
.pild:hover { border-color: var(--line-2); color: var(--ink); }
.pild.activo { border-color: var(--oro); background: var(--oro-soft); color: var(--oro-ink); } .pild.activo b { color: var(--oro-ink); }

/* ── Días ── */
.dias { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 16px; }
.dias:empty { display: none; }
.dia { text-align: left; background: #fff; border: 1px solid var(--line); border-radius: var(--r-md); padding: 10px 14px; box-shadow: var(--sh-1); display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; align-items: baseline; }
.dia:hover { box-shadow: var(--sh-2); }
.dia.activo { border-color: var(--oro); background: var(--oro-soft); }
.dia-f { font-weight: 600; white-space: nowrap; }
.dia-n { font-size: 13px; color: var(--ink-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.dia-c { grid-column: 1 / -1; display: flex; gap: 4px 12px; flex-wrap: wrap; font-size: 12.5px; color: var(--ink-3); }
.c-azul { color: var(--azul); font-weight: 600; } .c-ambar { color: var(--ambar); font-weight: 600; }

/* ── Citas ── */
.sel-todas { display: inline-flex; gap: 8px; align-items: center; font-size: 13px; color: var(--ink-2); margin: 0 0 8px 18px; cursor: pointer; }
input[type=checkbox], input[type=radio] { accent-color: var(--carbon); width: 17px; height: 17px; cursor: pointer; }
.appt-list { display: flex; flex-direction: column; gap: 6px; }
.appt-card { --est: var(--gris-p); position: relative; display: grid; align-items: center; column-gap: 14px; min-height: 72px; padding: 8px 14px 8px 12px; background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--est); border-radius: var(--r-md);
  grid-template-columns: 20px 70px minmax(200px, 1.15fr) minmax(190px, 1.4fr) 166px 340px; }
.appt-card.e-azul { --est: var(--azul-p); } .appt-card.e-verde { --est: var(--verde-p); } .appt-card.e-rojo { --est: var(--rojo-p); }
.appt-card:hover { box-shadow: var(--sh-2); }
.appt-card.is-selected { background: #FCF9F0; border-color: var(--oro); border-left-color: var(--est); }
.appt-card.is-activa { outline: 2px solid var(--oro); outline-offset: -1px; }
.is-cancelled { opacity: .62; } .is-cancelled .card-name { text-decoration: line-through; }
.card-time { font-size: 16px; font-weight: 600; font-variant-numeric: tabular-nums; } .card-time small { display: block; font-size: 12px; font-weight: 400; color: var(--ink-3); white-space: nowrap; }
.card-name { font-weight: 600; font-size: 15px; line-height: 1.25; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-meta { display: flex; gap: 2px 10px; flex-wrap: wrap; align-items: center; }
.tto { font-size: 12.5px; color: var(--ink-3); display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.card-motivo { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 13.5px; line-height: 1.35; color: var(--ink-2); }
.card-motivo.falta { display: inline-block; background: var(--ambar-f); color: var(--ambar); border: 1px dashed var(--ambar-p); border-radius: var(--r-sm); padding: 3px 9px; font-size: 13px; }
.senal { font-size: 12px; color: var(--ink-3); margin-top: 3px; line-height: 1.35; }
.ent-ok { color: var(--azul); } .ent-fail { color: var(--rojo); font-weight: 600; } .ent-warn { color: var(--ambar); font-weight: 600; }
.seg-table .entrega { font-size: 12.5px; color: var(--ink-3); } .seg-table .ent-ok { color: var(--azul); } .seg-table .ent-fail { color: var(--rojo); }
.tag-primera { background: var(--azul-f); color: var(--azul); font: 600 11.5px/1 var(--sans); padding: 4px 9px; border-radius: 999px; white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.tag-llamar { display: inline-block; background: var(--rojo-f); color: var(--rojo); font-weight: 600; padding: 2px 9px; border-radius: 999px; white-space: nowrap; margin-top: 2px; }
.env { display: flex; flex-direction: column; gap: 4px; } .env-lbl { font: 600 11px/1 var(--sans); color: var(--ink-2); }
.btn-wa { border-color: var(--carbon); } .btn-wa:hover { background: var(--carbon); color: #fff; }
.dia-f small { font-weight: 400; font-size: 13px; color: var(--ink-2); }
.nav .actualizado { margin-left: auto; font-size: 12px; color: #A39F96; }
.c-acc { display: flex; gap: 6px; align-items: center; justify-content: flex-end; }
.c-acc > :first-child:not(.mark-wrap) { margin-right: auto; }
.grupo-wa { display: flex; } .grupo-wa .btn:first-child { border-radius: 8px 0 0 8px; border-right: 0; } .grupo-wa .btn:last-child { border-radius: 0 8px 8px 0; }
.sin-tel { color: var(--rojo); font-size: 12.5px; font-weight: 500; line-height: 1.25; } .pasada, .enviando { color: var(--ink-3); font-size: 13px; }
.card-error { grid-column: 3 / -1; margin-top: 6px; background: var(--rojo-f); color: #7d2a22; border-left: 4px solid var(--rojo-p); border-radius: var(--r-sm); padding: 6px 12px; font-size: 13px; }
.mark-wrap { position: relative; }
.mark-menu { position: absolute; right: 0; top: calc(100% + 4px); z-index: 30; width: 190px; background: #fff; border: 1px solid var(--line-2); border-radius: 8px; box-shadow: var(--sh-2); overflow: hidden; }
.mark-menu button { display: flex; gap: 9px; align-items: center; width: 100%; padding: 10px 14px; border: 0; background: none; text-align: left; }
.mark-menu button:hover, .mark-menu button:focus-visible { background: #F2F1ED; outline: none; }
.mark-menu i { width: 8px; height: 8px; border-radius: 50%; } .p-verde { background: var(--verde-p); } .p-rojo { background: var(--rojo-p); } .p-gris { background: var(--gris-p); }
.mark-menu button:last-child { border-top: 1px solid var(--line); color: var(--rojo); }
.btn-spinner, .loading-spinner { display: inline-block; width: 12px; height: 12px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: gira .7s linear infinite; margin-right: 6px; vertical-align: -1px; }
.loading-spinner { width: 26px; height: 26px; color: var(--oro); }
@keyframes gira { to { transform: rotate(360deg); } }
.loading-state { display: flex; justify-content: center; padding: 72px 0; }
.empty-state { text-align: center; padding: 56px 20px; background: #fff; border: 1px solid var(--line); border-radius: var(--r-md); display: flex; flex-direction: column; gap: 10px; align-items: center; }
.empty-title { font-size: 17px; font-weight: 600; } .empty-sub { color: var(--ink-2); max-width: 520px; }
.bulk-bar { position: fixed; left: calc(50% + 116px); bottom: 20px; transform: translateX(-50%); z-index: 40; background: var(--carbon); color: #fff; border-radius: 12px; padding: 10px 12px 10px 18px; display: flex; gap: 12px; align-items: center; box-shadow: 0 8px 30px rgba(0,0,0,.25); white-space: nowrap; }
.bulk-bar .btn-ghost { color: #CFCBC2; } .bulk-bar .btn-ghost:hover { background: rgba(255,255,255,.1); color: #fff; }

/* ── Diálogo y avisos ── */
.modal-overlay { position: fixed; inset: 0; z-index: 100; background: rgba(28,27,25,.5); display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal-box { background: #fff; border-radius: 12px; width: 100%; max-width: 560px; max-height: calc(100vh - 32px); display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(0,0,0,.25); outline: none; }
.modal-title { font-size: 18px; padding: 20px 24px 0; }
.modal-body { padding: 12px 24px; overflow-y: auto; min-height: 0; } .modal-body p { margin-bottom: 10px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; padding: 12px 24px 20px; } .modal-actions:empty { display: none; }
.send-warning { background: var(--ambar-f); color: #5e4100; border-left: 4px solid var(--ambar-p); border-radius: var(--r-sm); padding: 10px 14px; font-size: 13.5px; margin-bottom: 12px; }
.todos-tipo { display: flex; gap: 6px; align-items: center; font-size: 13px; color: var(--ink-2); justify-content: flex-end; margin-bottom: 4px; } .todos-tipo .btn { border-color: var(--line-2); }
.bulk-lista { list-style: none; border-top: 1px solid var(--line); }
.bulk-lista li { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line-3); }
.b-nom { min-width: 0; overflow-wrap: anywhere; } .b-nom b { font-variant-numeric: tabular-nums; margin-right: 4px; } .b-nom small { display: block; color: var(--ink-3); }
.tipos { display: inline-flex; flex: none; border: 1px solid var(--line-2); border-radius: 8px; overflow: hidden; vertical-align: middle; }
.tipos label { position: relative; cursor: pointer; } .tipos label + label { border-left: 1px solid var(--line-2); }
.tipos input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; }
.tipos span { display: block; padding: 5px 12px; font-size: 13px; color: var(--ink-2); }
.tipos input:checked + span { background: var(--carbon); color: #fff; } .tipos input:focus-visible + span { outline: 2px solid var(--oro); outline-offset: -2px; }
.faltan { color: var(--rojo); font-size: 13px; font-weight: 500; min-height: 20px; margin: 8px 0 0 !important; text-align: right; }
#toasts { position: fixed; right: 20px; bottom: 20px; z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; max-width: min(420px, calc(100vw - 32px)); }
.toast { background: var(--carbon); color: #fff; border-left: 4px solid var(--verde-p); border-radius: 8px; padding: 11px 16px; font-size: 14px; box-shadow: var(--sh-2); opacity: 0; transform: translateY(8px); transition: .2s; display: flex; gap: 14px; align-items: center; }
.toast-show { opacity: 1; transform: none; } .toast-error { border-left-color: var(--rojo-p); }
.toast button { background: none; border: 0; color: #E4C878; font-weight: 600; text-decoration: underline; }

/* ── Calendario ── */
.calendar-nav-label { min-width: 170px; text-align: center; font-weight: 600; }
.calendar-grid { display: grid; grid-template-columns: repeat(var(--n, 5), minmax(0, 1fr)); gap: 10px; align-items: start; }
.cal-day-col { background: #fff; border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; }
.cal-day-col.is-today { border-color: var(--oro); }
.cal-day-header { width: 100%; display: flex; gap: 8px; align-items: baseline; padding: 10px 14px; border: 0; border-bottom: 1px solid var(--line); background: #FAFAF8; text-align: left; }
.cal-day-header:hover { background: #F2F1ED; } .is-today .cal-day-header { background: var(--oro-soft); }
.cal-day-name { text-transform: uppercase; font-size: 12px; font-weight: 600; color: var(--ink-3); } .cal-day-num { font-size: 18px; font-weight: 600; } .cal-day-count { margin-left: auto; font-size: 12.5px; color: var(--ink-2); }
.cal-day-body { padding: 8px; display: flex; flex-direction: column; gap: 4px; }
.cal-appt-chip { border-left: 3px solid var(--gris-p); background: #FAFAF8; border-radius: 4px; padding: 4px 8px; font-size: 13px; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .cal-appt-chip b { font-variant-numeric: tabular-nums; }
.cal-empty { color: var(--ink-3); font-size: 13px; padding: 8px; }

/* ── Tablas y listas ── */
.tabla-caja { background: #fff; border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--sh-1); }
.seg-table { width: 100%; border-collapse: collapse; }
.seg-table th { text-align: left; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-3); padding: 11px 16px; background: #FAFAF8; border-bottom: 1px solid var(--line); }
.seg-table th:first-child { border-top-left-radius: var(--r-md); } .seg-table th:last-child { border-top-right-radius: var(--r-md); }
.seg-table td { padding: 8px 16px; border-bottom: 1px solid var(--line-3); height: 50px; vertical-align: middle; font-variant-numeric: tabular-nums; }
.seg-table th.num { text-align: right; }
.seg-table tbody tr:last-child td { border-bottom: 0; } .seg-table tbody tr:hover { background: #FAFAF8; }
.seg-table .col-acc { text-align: right; white-space: nowrap; } .seg-table .col-acc .btn { vertical-align: middle; margin-left: 4px; } .seg-nom { font-weight: 600; }
.seg-empty { text-align: center; color: var(--ink-2); }
.seg-dias { display: inline-flex; gap: 6px; align-items: center; color: var(--ink-2); } .seg-dias input { width: 62px !important; }
.resp-wrap { position: relative; display: inline-block; cursor: pointer; }
.resp-pop { display: none; position: absolute; left: 0; top: calc(100% + 6px); z-index: 30; width: 300px; background: #fff; border: 1px solid var(--line-2); border-radius: 8px; box-shadow: var(--sh-2); padding: 10px 14px; font-size: 13px; }
.resp-wrap:hover .resp-pop, .resp-wrap:focus .resp-pop, .resp-wrap.open .resp-pop { display: block; }
.resp-msg + .resp-msg { border-top: 1px solid var(--line-3); margin-top: 6px; padding-top: 6px; } .resp-time { display: block; font-size: 12px; color: var(--ink-3); } .resp-more { color: var(--ink-3); margin-top: 6px; }
.admin-container { max-width: 1000px; display: flex; flex-direction: column; gap: 14px; }
.admin-header { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; } .admin-title { font-size: 26px; }
.user-list { background: #fff; border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--sh-1); }
.user-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 16px; border-bottom: 1px solid var(--line-3); flex-wrap: wrap; } .user-row:last-child { border-bottom: 0; }
.user-inactive .user-info { opacity: .55; }
.user-info { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; } .user-name { font-weight: 600; overflow-wrap: anywhere; } .user-actions { display: flex; gap: 6px; }

/* ── Puntos y ficha ── */
.fp-patient { font-weight: 600; font-size: 16px; } .fp-patient-id { margin-left: 8px; font-size: 12.5px; font-weight: 400; color: var(--ink-3); }
.fp-balance { padding: 2px 0 12px; border-bottom: 1px solid var(--line); margin-bottom: 14px; } .fp-balance-num { font-size: 34px; font-weight: 600; color: var(--oro-ink); font-variant-numeric: tabular-nums; } .fp-balance-lbl { color: var(--ink-2); }
.fp-section { margin-bottom: 16px; } .fp-row, .fp-btns { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; } .fp-row .field-input { flex: 1; min-width: 100px; }
.fp-mov { display: flex; justify-content: space-between; gap: 10px; align-items: center; font-size: 13px; padding: 5px 0; border-bottom: 1px solid var(--line-3); } .fp-mov:last-child { border-bottom: 0; }
.ficha-proto { font-size: 13px; color: var(--ink-2); background: var(--gris-f); border-radius: var(--r-sm); padding: 8px 12px; }
.ficha-res { border-radius: 8px; padding: 10px 14px; margin: 12px 0; font-size: 13.5px; } .ficha-res p { margin: 4px 0 0; }
.ficha-res--crear { background: var(--verde-f); } .ficha-res--enlazar { background: var(--azul-f); } .ficha-res--revisar { background: var(--ambar-f); } .ficha-res--corregir { background: var(--rojo-f); }
.ficha-avisos, .ficha-lista { margin: 6px 0 0; padding-left: 18px; font-size: 13.5px; } .ficha-dato { display: flex; gap: 10px; padding: 4px 0; border-bottom: 1px solid var(--line-3); font-size: 13.5px; } .ficha-dato span { min-width: 80px; color: var(--ink-2); }
#ficha-comprobar { justify-content: center; }

/* ── Campañas ── */
.camp { max-width: 820px; } .camp-intro { color: var(--ink-2); }
.camp-drop { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 32px 16px; border: 1.5px dashed var(--line-2); border-radius: var(--r-md); background: #fff; cursor: pointer; }
.camp-drop:hover, .camp-drop-over, .camp-drop:focus-within { border-color: var(--oro); background: #FCF9F0; } .camp-drop-title { font-weight: 600; } .camp-drop-sub, .camp-file { font-size: 13px; color: var(--ink-3); }
.camp-file { margin-bottom: 10px; } .camp-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 16px; }
.camp-stat { background: #fff; border: 1px solid var(--line); border-top: 3px solid var(--gris-p); border-radius: var(--r-md); padding: 12px 16px; font-size: 13px; color: var(--ink-2); } .camp-stat span { display: block; font-size: 28px; font-weight: 600; color: var(--ink); line-height: 1.2; font-variant-numeric: tabular-nums; } .camp-stat-ok { border-top-color: var(--verde-p); }
.camp-aviso { background: var(--ambar-f); border-left: 4px solid var(--ambar-p); border-radius: var(--r-sm); padding: 12px 16px; margin-bottom: 14px; font-size: 13.5px; } .camp-aviso p { margin: 4px 0 10px; } .camp-aviso-title { font-weight: 600; }
.camp-table { width: 100%; border-collapse: collapse; font-size: 13px; } .camp-table th, .camp-table td { text-align: left; padding: 5px 6px; border-bottom: 1px solid #EAD7B0; } .camp-mono { font-variant-numeric: tabular-nums; }
.camp-block-title { font-size: 13px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
.camp-det { background: #fff; border: 1px solid var(--line); border-radius: 8px; margin-bottom: 8px; font-size: 13.5px; } .camp-det summary { display: flex; justify-content: space-between; padding: 10px 14px; cursor: pointer; } .camp-det ul { padding: 0 14px 12px 32px; color: var(--ink-2); line-height: 1.7; }
.camp-btn { margin-top: 12px; width: 100%; justify-content: center; height: 46px; }

/* ── Ayuda ── */
.ayuda { position: fixed; right: 0; top: 0; bottom: 0; width: 400px; max-width: 100vw; z-index: 60; background: #fff; border-left: 1px solid var(--line-2); box-shadow: -8px 0 30px rgba(28,27,25,.08); padding: 22px 24px 40px; overflow-y: auto; }
.ayuda-cab { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; } .ayuda-cab h2 { font-size: 20px; }
.ayuda h3 { font-size: 14px; margin: 12px 0 2px; } .ayuda p { color: var(--ink-2); } .ayuda ol { padding-left: 20px; } .ayuda li { margin: 6px 0; }
.ayuda details { border-top: 1px solid var(--line); margin-top: 14px; padding-top: 12px; } .ayuda summary { cursor: pointer; font-weight: 600; } .ayuda details[open] summary { margin-bottom: 6px; }
.ayuda dl { display: grid; grid-template-columns: 70px 1fr; gap: 6px; } .ayuda dt { font-weight: 600; } .ayuda dd { color: var(--ink-2); }

/* ── Ajustes por ancho ── */
@media (min-width: 1700px) { .appt-card { grid-template-columns: 20px 72px minmax(240px, 1fr) minmax(320px, 1.7fr) 176px 344px; } }
@media (max-width: 1380px) {
  .appt-card { grid-template-columns: 20px 62px minmax(0, 1fr) 150px auto; row-gap: 4px; }
  .c-motivo { grid-column: 3 / -1; grid-row: 2; } .c-motivo:empty { display: none; }
  .card-error { grid-row: 3; }
}
body.con-ayuda .appt-card { grid-template-columns: 20px 62px minmax(0, 1fr) 150px auto; row-gap: 4px; }
body.con-ayuda .c-motivo { grid-column: 3 / -1; grid-row: 2; } body.con-ayuda .card-error { grid-row: 3; }
@media (max-width: 900px) {
  .app { display: block; } body.con-ayuda .app-main { padding-right: 14px; }
  .side { position: static; height: auto; padding: 12px 14px; display: grid; grid-template-columns: 1fr auto; align-items: center; }
  .marca { padding: 0; font-size: 18px; } .marca b { display: inline; font-size: 15px; margin-left: 4px; } .login-marca b { display: block; margin: 4px 0 0; }
  .btn.menu-movil { display: inline-flex; } .nav, .usuario { display: none; grid-column: 1 / -1; } .side.abierto .nav, .side.abierto .usuario { display: flex; gap: 2px; margin-top: 10px; }
  .app-main { padding: 16px 14px 110px; } .banda { padding: 8px 14px; } .banda.oro { gap: 10px; flex-wrap: nowrap; font-size: 13px; } .banda.oro .largo { display: none; }
  .cabecera-der { width: 100%; } .cabecera-der input[type=search] { flex: 1 1 100%; } #dia-fecha { flex: 1; min-width: 0; }
  .dias { grid-auto-flow: column; grid-template-columns: none; grid-auto-columns: 216px; overflow-x: auto; scroll-snap-type: x mandatory; margin: 0 -14px 12px; padding: 2px 14px; } .dia { scroll-snap-align: center; }
  .filtros { flex-wrap: nowrap; overflow-x: auto; margin: 0 -14px 12px; padding: 2px 14px; } .pild { flex: none; }
  .appt-card, body.con-ayuda .appt-card { grid-template-columns: 20px auto 1fr; row-gap: 6px; padding: 12px; }
  .c-estado { grid-column: 3; grid-row: 1; text-align: right; } .c-sel, .card-time { grid-row: 1; } .c-id { grid-column: 1 / -1; grid-row: 2; }
  .c-motivo, body.con-ayuda .c-motivo { grid-column: 1 / -1; grid-row: 3; } .c-acc { grid-column: 1 / -1; grid-row: 4; flex-wrap: wrap; justify-content: flex-start; } .c-acc:empty { display: none; }
  .c-acc .btn { height: 40px; } .c-acc .btn-ico { width: 40px; } .c-acc > :first-child:not(.mark-wrap) { margin-right: 0; } .env { flex: 1 1 100%; } .grupo-wa .btn { flex: 1; justify-content: center; } .appt-card.sin-cb { grid-template-columns: 0 auto 1fr; } .appt-card.sin-cb .card-time { margin-left: -14px; }
  .card-error, body.con-ayuda .card-error { grid-column: 1 / -1; grid-row: 5; }
  .mark-menu { right: auto; left: 0; }
  .bulk-bar { left: 14px; right: 14px; transform: none; bottom: 14px; flex-wrap: wrap; justify-content: space-between; } #toasts { left: 14px; right: 14px; bottom: 84px; align-items: stretch; max-width: none; }
  .calendar-grid { grid-template-columns: 1fr; } .calendar-nav-label { flex: 1; min-width: 0; }
  .seg-table thead { display: none; } .seg-table tr { display: block; padding: 10px 14px; border-bottom: 1px solid var(--line); } .seg-table td { display: block; border: 0; padding: 2px 0; height: auto; text-align: left !important; } .seg-table tr { position: relative; } .seg-table .col-acc { margin-top: 6px; } .seg-table .col-acc .btn { margin-left: 0; } .seg-table .col-acc .btn-puntos { position: absolute; right: 8px; top: 6px; } .seg-table .resp-pop { width: min(300px, 80vw); }
  .bulk-lista li { flex-direction: column; align-items: flex-start; gap: 6px; } .modal-actions { flex-direction: column-reverse; } .modal-actions .btn { justify-content: center; height: 44px; }
  .camp-stats { grid-template-columns: 1fr; } .admin-header { flex-direction: column; }
}
@media print { .side, .banda, .ayuda-cab .btn { display: none; } }
