/* ===================================================================
   Medic Lite — UI v6 (paridad visual con la plataforma base)
   Barra superior azul · menú horizontal · ficha de paciente azul
   Tipografía Open Sans
   =================================================================== */
:root {
    --primary: #008aca; --primary-d: #0165a1; --primary-l: #e6f3fa; --primary-xl: #f3f9fd;
    --primary-grad: linear-gradient(90deg, #0a7fc4 0%, #1a9be8 100%);
    --green: #5bb75b; --green-d: #4a9d4a; --green-l: #eaf6ea;
    --ink: #333333; --text: #4b4b4b; --muted: #777777; --faint: #9a9a9a;
    --bg: #f0f2f4; --surface: #ffffff; --border: #dfe3e8; --border-2: #eceff2;
    --danger: #e0433d; --danger-bg: #fdecea;
    --success: #3d8b3d; --success-bg: #eaf6ea;
    --warning: #c77700; --warning-bg: #fff8e1;
    --topbar-h: 50px; --menubar-h: 46px;
    --radius: 4px; --radius-sm: 3px;
    --shadow-sm: 0 1px 2px rgba(0,0,0,.06);
    --shadow-md: 0 3px 10px rgba(0,0,0,.10);
    --shadow-lg: 0 10px 30px rgba(0,0,0,.18);
    --container: 1100px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
    font-family: 'Open Sans', -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    color: var(--text); background: var(--bg); font-size: 13.5px; line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 24px; font-weight: 300; margin: 0 0 16px; color: var(--ink); }
h2 { font-weight: 600; font-size: 18px; }
h3 { margin: 0 0 12px; font-size: 15px; font-weight: 600; color: var(--ink); }
small { font-size: 12px; }
.muted { color: var(--muted); }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.text-primary { color: var(--primary); }
.right { text-align: right; }
.center { text-align: center; }
.flex { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.flex-between { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.mt0 { margin-top: 0 !important; } .mb0 { margin-bottom: 0 !important; }
.mt10 { margin-top: 10px; } .mb10 { margin-bottom: 10px; } .mt20 { margin-top: 20px; }

/* ---------- Barra superior azul ---------- */
.topnav {
    background: var(--primary); color: #fff; height: var(--topbar-h);
    position: sticky; top: 0; z-index: 60;
}
.topnav-inner { max-width: 1400px; margin: 0 auto; padding: 0 20px; height: 100%; display: flex; align-items: center; gap: 18px; }
.topnav .brand { display: flex; align-items: center; gap: 8px; color: #fff; font-weight: 700; font-size: 20px; letter-spacing: -.01em; white-space: nowrap; }
.topnav .brand:hover { text-decoration: none; }
.topnav .brand .brand-logo { font-size: 20px; }
.topnav .brand small { font-size: 10px; font-weight: 400; opacity: .8; display: block; line-height: 1; margin-top: -2px; }
.topnav-search { flex: 0 1 480px; display: flex; align-items: center; gap: 8px; background: rgba(255,255,255,.18); border-radius: 4px; padding: 0 12px; height: 34px; position: relative; }
.topnav-search span { opacity: .9; font-size: 14px; }
.topnav-search input { border: none; background: none; padding: 0; color: #fff; font-size: 13px; height: 34px; box-shadow: none !important; }
.topnav-search input::placeholder { color: rgba(255,255,255,.8); }
.topnav-search input:focus { outline: none; }
.topnav-spacer { flex: 1; }
.topnav .clinica-nombre { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 260px; }
.topnav .userbox { display: flex; align-items: center; gap: 12px; }
.topnav .userbox a { color: #fff; }
.topnav .user-chip { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; }
.topnav .avatar { width: 26px; height: 26px; border-radius: 50%; background: #fff; color: var(--primary); display: grid; place-items: center; font-weight: 700; font-size: 11px; }
.topnav .rol-chip { background: rgba(255,255,255,.22); padding: 2px 8px; border-radius: 3px; font-size: 11px; font-weight: 600; }
.topnav .btn-icon { background: transparent; border: none; color: #fff; cursor: pointer; font-size: 16px; padding: 4px 6px; border-radius: 3px; }
.topnav .btn-icon:hover { background: rgba(255,255,255,.18); }
.topnav .clinica-logo { width: 46px; height: 46px; background: #fff; border-radius: 3px; display: grid; place-items: center; overflow: hidden; }
.topnav .clinica-logo img { max-width: 100%; max-height: 100%; }
.nav-burger { display: none; font-size: 22px; cursor: pointer; color: #fff; }

/* ---------- Menú horizontal ---------- */
.menubar { background: #fff; border-bottom: 1px solid var(--border); height: var(--menubar-h); position: sticky; top: var(--topbar-h); z-index: 55; }
.menubar-inner { max-width: 1400px; margin: 0 auto; padding: 0 20px; height: 100%; display: flex; align-items: center; gap: 4px; }
.menubar .mi { position: relative; }
.menubar .mi > a, .menubar .mi > button {
    display: flex; align-items: center; gap: 7px; padding: 0 12px; height: var(--menubar-h); color: var(--text);
    font-size: 13.5px; background: none; border: none; cursor: pointer; font-family: inherit; white-space: nowrap;
}
.menubar .mi > a .ic, .menubar .mi > button .ic { font-size: 15px; color: var(--primary); }
.menubar .mi > a:hover, .menubar .mi > button:hover, .menubar .mi.activo > a, .menubar .mi.activo > button { color: var(--primary); text-decoration: none; }
.menubar .mi.activo > a { box-shadow: inset 0 -3px 0 var(--primary); }
.menubar .caret { font-size: 9px; opacity: .6; margin-left: 2px; }
.dropdown { display: none; position: absolute; top: 100%; left: 0; background: #fff; border: 1px solid var(--border); box-shadow: var(--shadow-md); min-width: 240px; padding: 8px 0; z-index: 80; border-radius: 0 0 4px 4px; }
.dropdown.wide { min-width: 520px; display: none; grid-template-columns: 1fr 1fr; padding: 12px 6px; }
.dropdown.wide.abierto { display: grid; }
.mi.abierto > .dropdown { display: block; }
.dropdown .dd-title { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--faint); padding: 6px 16px 4px; font-weight: 600; }
.dropdown a { display: flex; align-items: center; gap: 9px; padding: 7px 16px; color: var(--text); font-size: 13px; }
.dropdown a:hover { background: var(--primary-xl); color: var(--primary); text-decoration: none; }
.dropdown a .ic { width: 18px; text-align: center; color: var(--primary); }
.dropdown .dd-sep { border-top: 1px solid var(--border-2); margin: 6px 0; }
.dropdown .dd-search { padding: 8px 14px; }
.dropdown .dd-search label { font-size: 11px; color: var(--muted); display: block; margin-bottom: 4px; }
.dropdown .badge-nuevo { background: var(--primary-l); color: var(--primary-d); font-size: 9px; padding: 1px 5px; border-radius: 2px; margin-left: 4px; }

/* ---------- Contenido ---------- */
.content { display: block; }
.content-inner { padding: 22px 20px 60px; max-width: var(--container); width: 100%; margin: 0 auto; }
.content-inner.ancho { max-width: 1400px; }
.footer { text-align: center; color: var(--muted); font-size: 12px; padding: 24px 0 30px; }

/* ---------- Encabezado de módulo (barra de pestañas grises) ---------- */
.mod-head { display: flex; align-items: stretch; background: #f6f7f8; border: 1px solid var(--border); border-bottom: none; border-radius: 4px 4px 0 0; min-height: 44px; }
.mod-head .mod-title { display: flex; align-items: center; gap: 8px; padding: 0 16px; font-size: 16px; font-weight: 300; color: var(--muted); }
.mod-head .mod-title .badge { font-size: 10.5px; }
.mod-head .mod-tabs { display: flex; align-items: stretch; }
.mod-head .mod-tabs a { display: flex; align-items: center; gap: 6px; padding: 0 16px; color: var(--text); font-size: 13.5px; border-left: 1px solid var(--border-2); }
.mod-head .mod-tabs a:hover { background: #eef0f2; text-decoration: none; }
.mod-head .mod-tabs a.activo { background: #fff; color: var(--ink); font-weight: 600; box-shadow: inset 0 -2px 0 var(--primary); }
.mod-head .mod-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; padding: 0 10px; }
.mod-body { background: #fff; border: 1px solid var(--border); border-radius: 0 0 4px 4px; padding: 16px; margin-bottom: 20px; }
.mod-body.sin-padding { padding: 0; }
.section-title { font-size: 22px; font-weight: 300; color: var(--primary); margin: 18px 0 10px; display: flex; align-items: center; gap: 12px; }
.section-title::after { content: ''; flex: 1; border-top: 1px solid var(--border); }
.page-title-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: #fff; border: 1px solid var(--border); border-radius: 4px; padding: 12px 16px; margin-bottom: 16px; flex-wrap: wrap; }
.page-title-bar h1 { margin: 0; font-size: 22px; font-weight: 300; }

/* ---------- Cards & grids ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; margin-bottom: 16px; box-shadow: var(--shadow-sm); }
.card.sin-padding { padding: 0; }
.card-title { font-size: 15px; font-weight: 600; color: var(--ink); margin: 0 0 12px; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.card-title .sub { font-size: 12px; font-weight: 400; color: var(--muted); }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin-bottom: 16px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-1-2 { display: grid; grid-template-columns: 300px 1fr; gap: 16px; }
.grid-1-3 { display: grid; grid-template-columns: 1fr 2fr; gap: 16px; }

/* Metric cards */
.metric { position: relative; display: flex; flex-direction: column; gap: 4px; overflow: hidden; }
.metric .metric-icon { width: 38px; height: 38px; border-radius: 4px; display: grid; place-items: center; font-size: 18px; margin-bottom: 4px; background: var(--primary-l); }
.metric-label { color: var(--muted); font-size: 12.5px; font-weight: 500; }
.metric-value { font-size: 26px; font-weight: 600; letter-spacing: -.01em; color: var(--ink); }
.metric.accent-blue .metric-icon { background: #dbeafe; }
.metric.accent-green .metric-icon { background: #dcfce7; }
.metric.accent-amber .metric-icon { background: #fef3c7; }
.metric.accent-violet .metric-icon { background: #ede9fe; }
.kpi { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border-2); }
.kpi:last-child { border-bottom: none; }
.kpi .kpi-val { font-size: 26px; font-weight: 600; color: var(--ink); min-width: 70px; }
.kpi .kpi-label { flex: 1; font-size: 13px; color: var(--text); }
.kpi .kpi-label small { display: block; color: var(--faint); }
.panel-head { text-align: center; text-transform: uppercase; font-size: 12px; letter-spacing: .06em; color: var(--muted); border-bottom: 1px solid var(--border-2); padding-bottom: 8px; margin-bottom: 12px; font-weight: 600; }
.big-money { font-size: 32px; font-weight: 600; color: var(--ink); text-align: center; }
.big-money.orange { color: #ff7f50; }
.delta { font-size: 12px; color: var(--muted); text-align: center; }
.delta.up { color: var(--success); } .delta.down { color: var(--danger); }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border: 1px solid #cfd5db;
    background: linear-gradient(#fff, #f2f4f6); border-radius: var(--radius); cursor: pointer; font-size: 13px; font-weight: 400;
    color: var(--text); font-family: inherit; transition: .12s; line-height: 1.3; white-space: nowrap;
}
.btn:hover { background: #eef0f2; border-color: #b9c0c7; text-decoration: none; color: var(--ink); }
.btn-primary, .btn-green { background: var(--green); border-color: #4fa64f; color: #fff; font-weight: 600; }
.btn-primary:hover, .btn-green:hover { background: var(--green-d); border-color: var(--green-d); color: #fff; }
.btn-blue { background: var(--primary); border-color: #0776ad; color: #fff; font-weight: 600; }
.btn-blue:hover { background: var(--primary-d); border-color: var(--primary-d); color: #fff; }
.btn-danger { background: #e0433d; border-color: #c93b35; color: #fff; }
.btn-danger:hover { background: #c93b35; color: #fff; }
.btn-warning { background: #f0ad4e; border-color: #e09a37; color: #fff; }
.btn-sm { padding: 4px 9px; font-size: 12px; }
.btn-xs { padding: 2px 7px; font-size: 11px; }
.btn-block { width: 100%; justify-content: center; }
.btn-link { background: none; border: none; color: var(--primary); cursor: pointer; padding: 0; font-size: 13px; font-family: inherit; }
.btn-link:hover { text-decoration: underline; }
.btn-group { display: inline-flex; }
.btn-group .btn { border-radius: 0; margin-left: -1px; }
.btn-group .btn:first-child { border-radius: 4px 0 0 4px; margin-left: 0; }
.btn-group .btn:last-child { border-radius: 0 4px 4px 0; }
.btn.activo { background: #e4e8ec; color: var(--ink); }
.btn-icon { width: 32px; height: 32px; border: 1px solid var(--border); background: #fff; border-radius: 3px; cursor: pointer; color: var(--muted); font-size: 14px; transition: .15s; }
.btn-icon:hover { background: var(--danger-bg); color: var(--danger); }
.acciones-mini { display: inline-flex; gap: 4px; }
.acciones-mini .btn { padding: 3px 8px; }

/* Botón menú desplegable genérico */
.dd-wrap { position: relative; display: inline-block; }
.dd-wrap .dd-menu { display: none; position: absolute; right: 0; top: 100%; background: #fff; border: 1px solid var(--border); box-shadow: var(--shadow-md); min-width: 220px; z-index: 50; padding: 6px 0; border-radius: 3px; }
.dd-wrap.abierto .dd-menu { display: block; }
.dd-menu a, .dd-menu button { display: block; width: 100%; text-align: left; padding: 7px 14px; font-size: 13px; color: var(--text); background: none; border: none; cursor: pointer; font-family: inherit; }
.dd-menu a:hover, .dd-menu button:hover { background: var(--primary-xl); color: var(--primary); text-decoration: none; }
.dd-menu .dd-sep { border-top: 1px solid var(--border-2); margin: 5px 0; }
.dd-menu .peligro { color: var(--danger); }

/* ---------- Tables ---------- */
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--border-2); vertical-align: middle; }
.table th { font-size: 12px; color: var(--ink); font-weight: 600; background: #fafbfc; border-bottom: 1px solid var(--border); }
.table.th-azul th { background: var(--primary); color: #fff; }
.table tbody tr { transition: background .12s; }
.table tbody tr:hover { background: #f6f9fc; }
.table td a { font-weight: 500; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table .accion { text-align: right; white-space: nowrap; }
.table-compact th, .table-compact td { padding: 5px 8px; font-size: 12.5px; }
.tabla-scroll { overflow-x: auto; }

/* ---------- Forms ---------- */
.form label, .campo > label { display: block; margin: 10px 0 4px; font-size: 12.5px; font-weight: 600; color: var(--ink); }
input, select, textarea {
    width: 100%; padding: 7px 10px; border: 1px solid #ccd3da; border-radius: var(--radius-sm);
    font-size: 13.5px; font-family: inherit; background: #fff; color: var(--text); transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(0,138,202,.15); }
input::placeholder, textarea::placeholder { color: #aab4c0; }
input[type=checkbox], input[type=radio] { width: auto; }
.form-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.form-row.cols-2 { grid-template-columns: 1fr 1fr; }
.form-row.cols-4 { grid-template-columns: repeat(4, 1fr); }
.form-row.inline-add { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); align-items: end; gap: 10px; }
.form.inline { display: flex; gap: 10px; align-items: center; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 400 !important; margin: 10px 0; color: var(--text); cursor: pointer; }
.check input { width: auto; }
.checks-grid { display: flex; flex-wrap: wrap; gap: 12px 20px; margin-bottom: 8px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; margin-bottom: 16px; flex-wrap: wrap; }
.page-head h1 { margin: 0; }
.searchbar { display: flex; gap: 10px; margin-bottom: 16px; align-items: center; flex-wrap: wrap; }
.searchbar input { max-width: 340px; }
.searchbar label { font-size: 13px; color: var(--muted); }
.form-actions { display: flex; gap: 8px; margin-top: 14px; align-items: center; }
.campo-inline { display: flex; align-items: center; gap: 8px; }
.campo-inline label { margin: 0; white-space: nowrap; }
.hint { font-size: 11.5px; color: var(--faint); }
fieldset { border: 1px solid var(--border); border-radius: 4px; padding: 10px 14px 14px; margin: 0 0 14px; }
legend { font-size: 12px; font-weight: 600; color: var(--primary); padding: 0 6px; }

/* Cajas "Datos requeridos / opcionales" tipo ficha */
.dato-row { display: grid; grid-template-columns: 200px 1fr; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--border-2); }
.dato-row > label { margin: 0; font-size: 13px; font-weight: 600; color: var(--ink); }
.dato-row .na { font-size: 11px; color: var(--faint); white-space: nowrap; }
.dato-row .dato-input { display: flex; align-items: center; gap: 10px; }

/* ---------- Alerts ---------- */
.alert { display: flex; align-items: center; gap: 9px; padding: 10px 14px; border-radius: var(--radius); margin-bottom: 16px; font-size: 13px; border: 1px solid transparent; }
.alert span:first-child { font-size: 15px; }
.alert-success { background: var(--success-bg); color: var(--success); border-color: #bfe3bf; }
.alert-error { background: var(--danger-bg); color: var(--danger); border-color: #f5c6c3; }
.alert-info { background: var(--primary-l); color: var(--primary-d); border-color: #bfe0f2; }
.alert-warning { background: var(--warning-bg); color: var(--warning); border-color: #f5e2b0; }
.aviso { background: #fff8e1; border: 1px solid #f5e2b0; color: #8a6d1f; padding: 8px 12px; border-radius: 3px; font-size: 12.5px; }

/* ---------- Badges ---------- */
.badge { display: inline-block; padding: 2px 8px; border-radius: 3px; font-size: 11px; font-weight: 600; background: #eef2f7; color: #475569; letter-spacing: .01em; }
.badge-azul { background: var(--primary); color: #fff; }
.badge-verde { background: var(--green); color: #fff; }
.badge-rojo { background: var(--danger); color: #fff; }
.badge-gris { background: #e2e8f0; color: #64748b; }
.badge-naranja { background: #f0ad4e; color: #fff; }
.badge-agendada { background: #e2e8f0; color: #475569; }
.badge-confirmada, .badge-confirmado_email { background: #dbeafe; color: #1d4ed8; }
.badge-confirmado_whatsapp { background: #bbf7d0; color: #166534; }
.badge-notificado_whatsapp { background: #dcfce7; color: #15803d; }
.badge-notificado_email, .badge-agenda_online { background: #e0f2fe; color: #0369a1; }
.badge-en_sala { background: #fef9c3; color: #854d0e; }
.badge-atendiendose { background: #dcfce7; color: #15803d; }
.badge-atendida { background: #e5e7eb; color: #374151; }
.badge-no_asistio { background: #ede9fe; color: #6d28d9; }
.badge-cancelada, .badge-cancelada_paciente, .badge-cambio_fecha, .badge-anulada_reprog { background: #fee2e2; color: #b91c1c; }
.badge-pendiente, .badge-propuesto { background: #fef3c7; color: #b45309; }
.badge-realizado, .badge-aceptado, .badge-terminado, .badge-en_progreso { background: #dcfce7; color: #15803d; }
.badge-cancelado, .badge-expirado { background: #e2e8f0; color: #64748b; }
.badge-alternativo { background: #ede9fe; color: #6d28d9; }
.badge-abierta { background: #dcfce7; color: #15803d; }
.badge-cerrada { background: #e2e8f0; color: #64748b; }
.badge-hecha { background: #dcfce7; color: #15803d; }
.dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; border: 1px solid rgba(0,0,0,.15); vertical-align: middle; }
.estado-pill { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 3px; font-size: 11.5px; font-weight: 600; border: 1px solid rgba(0,0,0,.08); color: #333; }

/* ---------- Pagination ---------- */
.pagination { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 12px; }
.pagination a { padding: 5px 10px; border: 1px solid var(--border); border-radius: 3px; background: #fff; font-size: 12.5px; }
.pagination a.activo { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ---------- Tabs (genéricas) ---------- */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 18px; overflow-x: auto; }
.tabs button, .tabs a { background: none; border: none; padding: 10px 14px; cursor: pointer; font-size: 13.5px; color: var(--text); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; transition: .15s; font-family: inherit; }
.tabs button:hover, .tabs a:hover { color: var(--primary); text-decoration: none; }
.tabs button.activo, .tabs a.activo { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }
.tab-panel { display: none; }
.tab-panel.activo { display: block; }

/* ---------- Ficha de paciente (encabezado azul) ---------- */
.pac-header { background: var(--primary-grad); color: #fff; border-radius: 4px 4px 0 0; padding: 16px 20px; display: flex; align-items: center; gap: 18px; box-shadow: var(--shadow-sm); }
.pac-header .pac-avatar { width: 80px; height: 80px; border-radius: 50%; background: #fff; color: var(--primary); display: grid; place-items: center; font-size: 30px; font-weight: 600; flex-shrink: 0; overflow: hidden; }
.pac-header .pac-avatar img { width: 100%; height: 100%; object-fit: cover; }
.pac-header .pac-ids { font-size: 11px; font-weight: 600; opacity: .9; display: flex; gap: 12px; }
.pac-header .pac-nombre { font-size: 22px; font-weight: 600; margin: 2px 0; line-height: 1.2; }
.pac-header .pac-meta { font-size: 12.5px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.pac-header .pac-meta .sep { opacity: .5; }
.pac-header .pac-meta .chip { background: rgba(255,255,255,.22); padding: 2px 8px; border-radius: 3px; font-size: 11px; font-weight: 600; }
.pac-header .pac-meta .chip.deuda { background: #e0433d; }
.pac-header .pac-alertas { margin-left: auto; display: flex; gap: 10px; }
.pac-header .pac-alerta { background: rgba(255,255,255,.18); border-radius: 4px; padding: 10px 12px; min-width: 118px; max-width: 150px; }
.pac-header .pac-alerta .al-ic { font-size: 13px; margin-bottom: 4px; }
.pac-header .pac-alerta .al-t { font-size: 12px; font-weight: 700; }
.pac-header .pac-alerta .al-v { font-size: 11px; opacity: .9; line-height: 1.3; }
.pac-header .pac-alerta.alerta-on { background: #e0433d; }
.pac-tabs { background: #fff; border: 1px solid var(--border); border-top: none; border-radius: 0 0 4px 4px; display: flex; align-items: center; padding: 0 8px; margin-bottom: 16px; }
.pac-tabs a { padding: 12px 12px; color: var(--text); font-size: 13.5px; border-bottom: 2px solid transparent; white-space: nowrap; }
.pac-tabs a:hover { color: var(--primary); text-decoration: none; }
.pac-tabs a.activo { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }
.pac-tabs .pac-tabs-right { margin-left: auto; display: flex; gap: 4px; }
.pac-tabs .pac-tabs-right a { font-size: 12px; padding: 12px 10px; display: flex; align-items: center; gap: 5px; }
.pac-compact { display: none; position: fixed; top: calc(var(--topbar-h) + var(--menubar-h)); left: 0; right: 0; z-index: 50; background: var(--primary); color: #fff; box-shadow: var(--shadow-md); }
.pac-compact .inner { max-width: var(--container); margin: 0 auto; padding: 8px 20px; display: flex; align-items: center; gap: 12px; }
.pac-compact .pac-avatar { width: 34px; height: 34px; font-size: 14px; }
.pac-compact .pac-nombre { font-size: 16px; }
.pac-compact .pac-meta { font-size: 11.5px; }
.pac-compact.visible { display: block; }
.sub-tabs { display: flex; gap: 2px; background: #fff; border: 1px solid var(--border); border-radius: 4px 4px 0 0; padding: 0 8px; overflow-x: auto; }
.sub-tabs a { padding: 11px 9px; color: var(--primary); font-size: 13px; border-bottom: 2px solid transparent; white-space: nowrap; }
.sub-tabs a:hover { text-decoration: none; background: var(--primary-xl); }
.sub-tabs a.activo { color: var(--ink); font-weight: 600; border-bottom-color: var(--primary); }
.sub-body { background: #fff; border: 1px solid var(--border); border-top: none; border-radius: 0 0 4px 4px; padding: 16px; margin-bottom: 16px; }
.sub-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.sub-head h2 { font-size: 22px; font-weight: 300; margin: 0; color: var(--ink); }
.pac-ficha-print { border: 1px solid var(--border); padding: 14px 16px; margin-bottom: 16px; background: #fbfcfd; font-size: 12.5px; }
.pac-ficha-print .clinica-nom { font-weight: 700; font-size: 14px; color: var(--ink); }
.pac-ficha-print .datos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px 16px; margin-top: 8px; }

/* Antecedentes en tarjetas */
.antec-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.antec-card { background: #fff; border: 1px solid var(--border); border-radius: 4px; padding: 14px 16px; }
.antec-card .ac-title { font-weight: 700; font-size: 14px; color: var(--ink); }
.antec-card .ac-grupo { font-size: 12.5px; color: var(--muted); margin-bottom: 8px; }
.antec-card textarea { min-height: 54px; margin-top: 6px; }
.antec-card label { font-size: 12px; font-weight: 600; color: var(--ink); display: block; margin-top: 8px; }
.antec-card.marcado { border-color: #f5b7a0; background: #fffaf8; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.tag { background: var(--primary-l); color: var(--primary-d); padding: 2px 8px; border-radius: 3px; font-size: 12px; display: inline-flex; gap: 6px; align-items: center; }
.tag button { background: none; border: none; cursor: pointer; color: var(--primary-d); padding: 0; font-size: 12px; }

/* ---------- Timeline (historial / evoluciones) ---------- */
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { padding: 12px 0; border-bottom: 1px solid var(--border-2); }
.timeline li:last-child { border-bottom: none; }
.timeline-meta { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.hist-dia { font-size: 12px; font-weight: 700; color: var(--primary); text-transform: uppercase; margin: 18px 0 6px; padding-bottom: 4px; border-bottom: 1px solid var(--border-2); }
.hist-item { display: grid; grid-template-columns: 140px 1fr; gap: 12px; padding: 8px 0; border-bottom: 1px dashed var(--border-2); }
.hist-item .hist-tipo { font-size: 12px; font-weight: 600; color: var(--ink); }
.hist-item .hist-tipo small { display: block; font-weight: 400; color: var(--faint); }
.hist-item .hist-body { font-size: 13px; }
.hist-item .hist-firma { font-size: 11.5px; color: var(--muted); margin-top: 4px; font-style: italic; }
.evo-card { border: 1px solid var(--border); border-radius: 4px; padding: 12px 14px; margin-bottom: 12px; background: #fff; }
.evo-card .evo-head { display: flex; justify-content: space-between; gap: 10px; font-size: 12.5px; color: var(--muted); margin-bottom: 6px; flex-wrap: wrap; }
.evo-card .evo-head strong { color: var(--ink); }
.evo-card .evo-body { white-space: pre-line; }
.evo-card.anulada { opacity: .55; background: #fafafa; }

/* ---------- Planes (estilos heredados) ---------- */
.plan-card { background: #fff; border: 1px solid var(--border); border-radius: 4px; padding: 14px 16px; margin-bottom: 12px; }
.plan-card .plan-nombre { font-size: 17px; color: var(--primary); font-weight: 600; margin-bottom: 8px; display: flex; align-items: center; gap: 10px; }
.plan-card .plan-cols { display: grid; grid-template-columns: 1.4fr 1fr 1fr .8fr 1fr; gap: 12px; align-items: center; }
.plan-card .plan-col small { display: block; font-size: 10px; text-transform: uppercase; letter-spacing: .05em; color: var(--faint); margin-bottom: 3px; }
.plan-card .plan-fin { font-size: 12.5px; color: var(--muted); margin-top: 10px; display: flex; gap: 18px; flex-wrap: wrap; }
.plan-card .plan-fin b { color: var(--ink); }
.progress-ring { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 700; color: var(--ink);
    background: conic-gradient(var(--green) calc(var(--p) * 1%), #e5e7eb 0); position: relative; }
.progress-ring::before { content: ''; position: absolute; inset: 5px; background: #fff; border-radius: 50%; }
.progress-ring span { position: relative; }
.plan-side { background: linear-gradient(160deg, #0a7fc4 0%, #37b4f0 100%); color: #fff; border-radius: 4px; padding: 16px; }
.plan-side .ps-title { font-size: 15px; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.plan-side .ps-nombre { font-size: 20px; font-weight: 600; margin: 8px 0 12px; }
.plan-side .ps-box { background: #fff; color: var(--text); border-radius: 4px; padding: 12px 14px; margin-bottom: 12px; }
.plan-side .ps-box .ps-total { text-align: center; }
.plan-side .ps-box .ps-total small { display: block; color: var(--muted); font-size: 12px; }
.plan-side .ps-box .ps-total b { font-size: 22px; color: var(--primary); }
.plan-side .ps-row { display: flex; justify-content: space-between; font-size: 12.5px; padding: 4px 0; border-bottom: 1px dotted var(--border); }
.plan-side .ps-row:last-child { border-bottom: none; }
.plan-side .ps-row.saldo { font-weight: 700; color: var(--ink); }
.plan-side .ps-label { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; opacity: .85; margin-top: 10px; }
.plan-side .ps-val { font-size: 13.5px; font-weight: 600; }
.plan-side .ps-box .ps-label { color: var(--faint); }
.plan-side .ps-box .ps-val { color: var(--ink); }
.prest-tabla th, .prest-tabla td { font-size: 12.5px; }
.prest-seccion td { background: #f3f6f9; font-weight: 700; color: var(--primary-d); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.prest-tabla tr.realizado td { color: var(--muted); }
.prest-tabla tr.realizado .prest-nombre { text-decoration: line-through; }
.plan-flotante { position: fixed; right: 18px; top: 50%; transform: translateY(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 40; }
.plan-flotante a { width: 42px; height: 42px; border-radius: 50%; background: var(--primary); color: #fff; display: grid; place-items: center; font-size: 18px; box-shadow: var(--shadow-md); }
.plan-flotante a:hover { background: var(--primary-d); text-decoration: none; }

/* ---------- Recetas ---------- */
.receta-item { display: grid; grid-template-columns: 2fr 1fr 1fr .7fr 1fr 1fr .7fr 1fr; gap: 8px; align-items: end; margin-bottom: 8px; }
.receta-print { font-size: 14px; line-height: 1.7; }
.receta-print .rx { font-size: 34px; font-weight: 700; color: var(--primary); font-family: Georgia, serif; }

/* ---------- Auth ---------- */
.auth-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 20px; background: var(--primary); }
.auth-card { background: #fff; padding: 36px; border-radius: 6px; width: 380px; max-width: 100%; box-shadow: var(--shadow-lg); }
.brand-big { font-size: 26px; font-weight: 700; text-align: center; margin-bottom: 4px; color: var(--primary); letter-spacing: -.02em; }
.auth-card h2 { font-size: 17px; margin: 14px 0 16px; }

/* ---------- Form cards (formularios/consentimientos) ---------- */
.form-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.form-card { display: flex; flex-direction: column; gap: 4px; padding: 14px; border: 1px solid var(--border); border-radius: 4px; background: #fff; transition: .15s; }
.form-card:hover { border-color: var(--primary); box-shadow: var(--shadow-md); }
.form-card strong { color: var(--primary); }

/* ---------- Forms engine ---------- */
.campo { margin: 10px 0; }
.radio-row { display: flex; flex-wrap: wrap; gap: 8px 14px; }
.radio { display: inline-flex; align-items: center; gap: 6px; font-weight: 400; padding: 5px 9px; border: 1px solid var(--border); border-radius: 3px; cursor: pointer; transition: .12s; }
.radio:hover { border-color: var(--primary); background: var(--primary-xl); }
.radio input { width: auto; }
.escala .radio-row { flex-direction: column; gap: 6px; }
.score-box { background: var(--primary-l); color: var(--primary-d); padding: 10px 14px; border-radius: 4px; font-size: 16px; font-weight: 600; }
.medida-row { display: grid; grid-template-columns: 2fr 1.2fr 1fr 1.6fr; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--border-2); }
.medida-label { font-weight: 600; font-size: 13px; }
.medida-norma { font-size: 12px; color: var(--muted); }
.medida-clasif { font-size: 12px; font-weight: 600; }
.bilateral { display: flex; align-items: center; gap: 18px; padding: 8px 0; border-bottom: 1px solid var(--border-2); flex-wrap: wrap; }
.bilat-label { font-weight: 600; font-size: 13px; min-width: 160px; }

/* ---------- Consent / signature ---------- */
.consent-text { white-space: pre-line; line-height: 1.6; font-size: 14px; }
.firma-wrap { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
#firma-canvas { border: 2px dashed #cbd5e1; border-radius: 4px; background: #fcfdfe; touch-action: none; max-width: 100%; }

/* ---------- Modal ---------- */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.5); display: flex; align-items: center; justify-content: center; z-index: 100; }
.modal.oculto { display: none; }
.modal-box { background: #fff; padding: 20px 22px; border-radius: 4px; width: 420px; max-width: 94vw; box-shadow: var(--shadow-lg); max-height: 92vh; overflow: auto; }
.modal-box.ancho { width: 760px; }
.modal-box h3 { border-bottom: 1px solid var(--border); padding-bottom: 8px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }

/* ---------- Agenda ---------- */
.agenda-layout { display: grid; grid-template-columns: 210px 1fr; gap: 0; background: #fff; border: 1px solid var(--border); border-top: none; border-radius: 0 0 4px 4px; }
.agenda-side { border-right: 1px solid var(--border); padding: 14px 12px; }
.agenda-side .ag-dia { text-align: center; margin-bottom: 12px; }
.agenda-side .ag-dia .ag-dow { font-size: 15px; color: var(--muted); font-weight: 300; }
.agenda-side .ag-dia .ag-num { font-size: 40px; font-weight: 300; color: var(--ink); line-height: 1; display: flex; align-items: center; justify-content: center; gap: 10px; }
.agenda-side .ag-dia .ag-num a { font-size: 24px; color: var(--ink); }
.agenda-side .ag-dia .ag-mes { font-size: 16px; color: var(--ink); font-weight: 300; }
.agenda-side .ag-estados { margin-top: 12px; border-top: 1px solid var(--border-2); padding-top: 8px; }
.agenda-side .ag-estado { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--primary); padding: 3px 0 3px 8px; border-left: 4px solid transparent; }
.agenda-side .ag-estado input { margin: 0; }
.agenda-main { padding: 12px 14px; min-height: 420px; }
.agenda-main .ag-search { margin-bottom: 10px; }
.ag-lista { width: 100%; border-collapse: collapse; }
.ag-lista th { font-size: 12px; font-weight: 700; color: var(--ink); padding: 8px 10px; border-bottom: 1px solid var(--border); text-align: left; }
.ag-lista td { padding: 10px; border-bottom: 1px solid var(--border-2); font-size: 13px; vertical-align: middle; }
.ag-lista tr.vacia td { height: 44px; }
.ag-lista .ag-hora { font-weight: 700; color: var(--ink); white-space: nowrap; }
.ag-lista .ag-estado-cell { display: flex; align-items: center; gap: 6px; }
.ag-lista select.ag-estado-sel { width: auto; padding: 3px 6px; font-size: 12px; }
.sem-grid { display: grid; border: 1px solid var(--border); border-radius: 3px; overflow: hidden; font-size: 12px; }
.sem-grid .sg-h { background: #fafbfc; font-weight: 600; text-align: center; padding: 8px 4px; border-bottom: 1px solid var(--border); border-right: 1px solid var(--border-2); color: var(--ink); }
.sem-grid .sg-h.hoy { color: var(--primary); }
.sem-grid .sg-t { font-size: 11px; color: var(--muted); text-align: center; padding: 2px; border-bottom: 1px solid var(--border-2); border-right: 1px solid var(--border-2); background: #fafbfc; display: flex; align-items: center; justify-content: center; }
.sem-grid .sg-c { border-bottom: 1px solid var(--border-2); border-right: 1px solid var(--border-2); min-height: 22px; position: relative; }
.sem-grid .sg-c.libre { background: #dff3d9; }
.sem-grid .sg-c.libre a { display: block; height: 100%; min-height: 22px; text-align: right; padding-right: 6px; color: var(--green); font-weight: 700; font-size: 13px; line-height: 22px; }
.sem-grid .sg-c.libre a:hover { background: #cdebc3; text-decoration: none; }
.sem-grid .sg-c.bloq { background: #f2f2f2; background-image: repeating-linear-gradient(45deg, transparent, transparent 4px, #e4e4e4 4px, #e4e4e4 5px); }
.sem-grid .sg-c.cita { padding: 0; }
.sem-grid .sg-ev { display: block; margin: 1px; padding: 3px 6px; border-radius: 3px; font-size: 11.5px; line-height: 1.3; color: #222; border-left: 4px solid rgba(0,0,0,.15); overflow: hidden; }
.sem-grid .sg-ev:hover { text-decoration: none; filter: brightness(.96); }
.sem-grid .sg-ev b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.glob-cols { display: grid; gap: 10px; }
.glob-col { border: 1px solid var(--border); border-radius: 3px; overflow: hidden; }
.glob-col .gc-h { background: var(--primary); color: #fff; padding: 8px 10px; font-weight: 600; font-size: 13px; }
.glob-col .gc-body { min-height: 120px; padding: 6px; }
.glob-col .sg-ev { display: block; margin-bottom: 5px; padding: 5px 8px; border-radius: 3px; font-size: 12px; color: #222; border-left: 4px solid rgba(0,0,0,.15); }
.glob-col .sg-ev small { display: block; color: #555; }
.cal-head { display: flex; align-items: center; justify-content: center; gap: 14px; margin-bottom: 14px; }
.cal-head strong { font-size: 16px; color: var(--ink); }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-dow { text-align: center; font-size: 11px; color: var(--faint); font-weight: 600; text-transform: uppercase; padding: 4px; }
.cal-cell { min-height: 92px; border: 1px solid var(--border-2); border-radius: 3px; padding: 5px; background: #fff; }
.cal-cell.vacio { background: transparent; border: none; }
.cal-dia { font-size: 12px; color: var(--muted); font-weight: 600; }
.cal-ev { display: block; font-size: 10px; padding: 2px 5px; border-radius: 3px; margin-top: 3px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-weight: 500; }
.cal-dia-link { font-size: 12px; color: var(--muted); font-weight: 600; text-decoration: none; display: inline-block; width: 22px; height: 20px; border-radius: 3px; text-align: center; }
.cal-dia-link:hover { background: var(--primary-l); color: var(--primary-d); text-decoration: none; }
.vista-toggle { display: inline-flex; background: #eef2f7; border-radius: 4px; padding: 2px; }
.vista-toggle .btn { border: none; background: none; padding: 5px 12px; }
.vista-toggle .btn.activo { background: #fff; box-shadow: var(--shadow-sm); color: var(--primary-d); }
.dar-cita-semana { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.dar-cita-semana .dc-dia { border: 1px solid var(--border); border-radius: 3px; max-height: 340px; overflow-y: auto; }
.dar-cita-semana .dc-dia h4 { margin: 0; padding: 6px 4px; font-size: 12px; text-align: center; background: #fafbfc; border-bottom: 1px solid var(--border); font-weight: 600; }
.dar-cita-semana .dc-dia h4.hoy { color: var(--primary); }
.dar-cita-semana .dc-slot { display: block; text-align: center; padding: 4px; font-size: 12px; border-bottom: 1px solid var(--border-2); color: var(--green); }
.dar-cita-semana .dc-slot:hover, .dar-cita-semana .dc-slot.sel { background: var(--green); color: #fff; text-decoration: none; }
.dar-cita-semana .dc-slot.ocup { color: var(--faint); background: #f7f7f7; pointer-events: none; }

/* ---------- Charts ---------- */
.barchart { display: flex; align-items: flex-end; gap: 8px; height: 170px; padding-top: 10px; }
.bar { flex: 1; display: flex; flex-direction: column; align-items: center; height: 100%; justify-content: flex-end; }
.bar-fill { width: 64%; background: var(--primary); border-radius: 3px 3px 0 0; min-height: 2px; }
.bar-fill.verde { background: var(--green); }
.bar-label { font-size: 10px; color: var(--muted); margin-top: 5px; }
.hbar { display: grid; grid-template-columns: 160px 1fr 80px; gap: 8px; align-items: center; font-size: 12.5px; padding: 4px 0; }
.hbar .hb-track { background: #eef0f2; height: 14px; border-radius: 2px; overflow: hidden; }
.hbar .hb-fill { height: 100%; background: var(--primary); }
.hbar .hb-val { text-align: right; font-variant-numeric: tabular-nums; }
.leyenda-chart { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); justify-content: center; }
.leyenda-chart i { display: inline-block; width: 12px; height: 12px; margin-right: 4px; vertical-align: middle; }

/* ---------- Foto de paciente ---------- */
.pac-foto { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; box-shadow: var(--shadow-sm); }
.pac-foto-ph { display: grid; place-items: center; font-size: 22px; font-weight: 700; color: #fff; background: var(--primary); }

/* ---------- Archivos / imágenes ---------- */
.archivos-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.archivo-card { border: 1px solid var(--border); border-radius: 4px; overflow: hidden; background: #fff; }
.archivo-thumb { display: grid; place-items: center; height: 170px; background: #f1f5f9; overflow: hidden; }
.archivo-thumb img { width: 100%; height: 100%; object-fit: cover; }
.archivo-thumb span { font-size: 40px; }
.archivo-meta { padding: 8px 10px; display: flex; flex-direction: column; gap: 3px; }

/* ---------- Cajas ---------- */
.caja-resumen { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 14px; }
.caja-resumen .cr { border: 1px solid var(--border); border-radius: 4px; padding: 10px 12px; background: #fafbfc; }
.caja-resumen .cr small { display: block; color: var(--muted); font-size: 11.5px; }
.caja-resumen .cr b { font-size: 18px; color: var(--ink); }

/* ---------- Encuesta pública ---------- */
.encuesta-body { max-width: 640px; margin: 30px auto; padding: 0 16px; }
.encuesta-q { border: 1px solid var(--border); border-radius: 4px; padding: 12px 14px; margin-bottom: 10px; background: #fff; }
.encuesta-q .eq-attr { font-size: 11px; color: var(--primary); text-transform: uppercase; font-weight: 600; }
.escala-5 { display: flex; gap: 6px; margin-top: 8px; }
.escala-5 label { flex: 1; text-align: center; border: 1px solid var(--border); border-radius: 3px; padding: 8px 2px; cursor: pointer; font-size: 13px; }
.escala-5 label:has(input:checked) { background: var(--primary); color: #fff; border-color: var(--primary); }
.escala-5 input { display: none; }
.stars { color: #f0ad4e; letter-spacing: 1px; }

/* ---------- Autocomplete ---------- */
.ac-list { position: absolute; top: 100%; left: 0; right: 0; background: #fff; border: 1px solid var(--border); box-shadow: var(--shadow-md); z-index: 90; max-height: 320px; overflow-y: auto; border-radius: 0 0 4px 4px; }
.ac-list a { display: block; padding: 8px 12px; color: var(--text); font-size: 13px; border-bottom: 1px solid var(--border-2); }
.ac-list a small { color: var(--muted); margin-left: 6px; }
.ac-list a:hover, .ac-list a.sel { background: var(--primary-xl); text-decoration: none; color: var(--primary); }
.ac-wrap { position: relative; }

/* ---------- Impresión ---------- */
@media print {
    .topnav, .menubar, .pac-tabs, .sub-tabs, .footer, .no-print, .plan-flotante, .pac-compact { display: none !important; }
    body { background: #fff; }
    .content-inner { padding: 0; max-width: none; }
    .card, .mod-body, .sub-body { border: none; box-shadow: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
    .grid-1-2, .grid-1-3, .grid-3 { grid-template-columns: 1fr; }
    .plan-card .plan-cols { grid-template-columns: 1fr 1fr; }
    .agenda-layout { grid-template-columns: 1fr; }
    .agenda-side { border-right: none; border-bottom: 1px solid var(--border); }
    .pac-header .pac-alertas { display: none; }
    .topnav .clinica-nombre, .topnav .clinica-logo { display: none; }
}
@media (max-width: 760px) {
    .nav-burger { display: block; }
    .menubar { height: auto; position: static; display: none; }
    #nav-toggle:checked ~ .menubar { display: block; }
    .menubar-inner { flex-direction: column; align-items: stretch; padding: 6px 0; gap: 0; }
    .menubar .mi > a, .menubar .mi > button { height: 40px; width: 100%; }
    .menubar .mi.activo > a { box-shadow: inset 3px 0 0 var(--primary); }
    .dropdown, .dropdown.wide { position: static; box-shadow: none; border: none; min-width: 0; grid-template-columns: 1fr; background: #f7f9fb; }
    .topnav-search { flex: 1; }
    .topnav .user-chip span, .topnav .rol-chip { display: none; }
    .content-inner { padding: 14px 12px 40px; }
    .grid-2, .form-row, .form-row.cols-2, .form-row.cols-4, .antec-grid { grid-template-columns: 1fr; }
    .medida-row { grid-template-columns: 1fr 1fr; }
    .dato-row { grid-template-columns: 1fr; }
    .pac-header { flex-wrap: wrap; }
    .pac-tabs { flex-wrap: wrap; }
    .pac-tabs .pac-tabs-right { margin-left: 0; }
    .mod-head { flex-wrap: wrap; }
    .mod-head .mod-actions { margin-left: 0; padding: 8px 10px; }
    .plan-card .plan-cols { grid-template-columns: 1fr; }
    .receta-item { grid-template-columns: 1fr 1fr; }
    .dar-cita-semana { grid-template-columns: repeat(2, 1fr); }
}
