/* ═══════════════════════════════════════════════════════════
   SIDEC 3.0 · Hoja de estilos unificada — Doc en Casa
   Consolida: _sidec_unificado + _docStyle + _estilos + _grid
   Fuentes: Outfit + DM Mono (Google Fonts, cargadas en <head>)
═══════════════════════════════════════════════════════════ */

/* ─── VARIABLES ──────────────────────────────────────────── */
:root {
  --navy:        #1a3a5c;
  --navy2:       #1e4976;
  --accent:      #4fc3f7;
  --accent2:     #0288d1;
  --bg:          #f0f2f5;
  --text:        #1e293b;
  --muted:       #64748b;
  --border:      #e2e8f0;
  --green:       #16a34a;
  --green-bg:    #dcfce7;
  --yellow:      #b45309;
  --yellow-bg:   #fef9c3;
  --blue:        #0369a1;
  --blue-bg:     #e0f2fe;
  --red:         #be123c;
  --red-bg:      #ffe4e6;
  --c-activa:    #22c55e;
  --c-revision:  #f59e0b;
  --c-completa:  #0ea5e9;
  --c-cancelada: #f87171;
}

/* ─── RESET ──────────────────────────────────────────────── */
* { box-sizing: border-box; margin: 0; padding: 0; }

/* ─── BODY ───────────────────────────────────────────────── */
body {
  font-family: 'Segoe UI', Calibri, sans-serif;
  background: #f0f2f5;
  color: #333;
  font-size: 13px;
  margin-bottom: 40px;
}

a:link { text-decoration: none; }

/* ─── GRID LAYOUTS (legacy pages) ───────────────────────── */
.encabezado {
  display: grid;
  grid-gap: 10px;
  grid-template-columns: repeat(8, 1fr);
  width: 100%;
  max-width: 90%;
  margin: auto;
  font-size: 40px;
  padding: 10px 0;
}
.encabezado > div { display: block; }
.encabezado .menuicon {
  display: grid;
  grid-gap: 0;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  grid-column: -2/-1;
  justify-items: center;
}
.encabezado .menuicon > div { display: block; height: 35px; border: 1px solid gray; background: #fff; }
.encabezado .menuicon img { display: block; height: 90%; width: auto; }
.menuicon .campana, .whatsapp, .lapiz, .home { display: block; height: auto; }
.encabezado .logo { grid-column: 1/2; grid-row: 2/4; display: block; width: 60%; align-self: center; }
.encabezado .logo img { width: 100%; }
.encabezado .bienvenida, .encabezado .bienvTerap { grid-column: 2/-1; font-size: 55%; }
.encabezado .tiempo { grid-column: 2/7; font-size: 18px; }

.estadisticas {
  display: grid;
  grid-gap: 2%;
  grid-template-columns: repeat(2, 1fr) 20px repeat(2, 1fr);
  max-width: 90%;
  margin: auto;
  padding: 20px 0;
  font-size: 15px;
}
.estadisticas > div { box-shadow: 2px 2px 10px rgba(0,0,0,.25); }
.estadisticas table { border: none; }
.tabla1 { grid-column: 1/3; }
.tabla2 { grid-column: 4/-1; }
.tabla2 > table { height: 50%; }

.ModuloContenido {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.ModuloContenido > div { box-shadow: 2px gray; }

.contenidoPerfil { display: grid; grid-template-columns: 1fr 3fr; }
.contenidoPerfil .foto { display: block; grid-column: 1/2; grid-row: 1/-1; }
.datosPerfil { display: grid; grid-gap: 20px; grid-template-columns: 1fr 2fr; }
.datosPerfil div { display: block; padding: 5px; color: #fff; background: #9aa3ab; border-radius: 5px; }

/* ─── ENCABEZADO / HEADER ────────────────────────────────── */
.header {
  background: #1a3a5c;
  color: white;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
.header-logo { display: flex; align-items: center; gap: 10px; }
.logo-img { height: 44px; width: auto; display: block; }
.header .logo-sub { font-size: 15px; opacity: 0.9; }
.header .bienvenida { font-size: 16px; opacity: 0.9; }
.header .bienvenida b { color: #4fc3f7; }
.header .acciones { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.header .acciones a {
  color: #ccc; text-decoration: none; font-size: 12px;
  background: rgba(255,255,255,0.1); padding: 5px 10px; border-radius: 4px;
}
.header .acciones a:hover { background: rgba(255,255,255,0.2); color: white; }
.header .acciones a img { height: 16px; width: auto; vertical-align: middle; }

/* ─── BARRA DE ESTADÍSTICAS ──────────────────────────────── */
.statsbar {
  background: #1e4976;
  color: white;
  padding: 7px 24px;
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  font-size: 12px;
}
.statsbar .stat { display: flex; align-items: center; gap: 6px; }
.statsbar .stat .num {
  background: #4fc3f7; color: #1a3a5c;
  font-weight: bold; border-radius: 10px; padding: 1px 8px; font-size: 12px;
}

/* ─── CONTENIDO PRINCIPAL ────────────────────────────────── */
.main { max-width: 1140px; margin: 20px auto; padding: 0 16px; }
.section-main { font-size: 18px; color: #1a3a5c; margin-bottom: 16px; padding-bottom: 8px; border-bottom: 2px solid #4fc3f7; }

/* ─── TABS ───────────────────────────────────────────────── */
.tab {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 16px;
  border-bottom: 2px solid #dde3ea;
}
.tab button {
  background: white; color: #555;
  border: 1.5px solid #dde3ea; border-bottom: none;
  padding: 8px 18px; border-radius: 6px 6px 0 0;
  font-size: 13px; cursor: pointer; transition: 0.2s;
  font-family: inherit; margin-bottom: -2px;
}
.tab button:hover { background: #f0f5ff; color: #1a3a5c; }
.tab button.active { background: #1a3a5c; color: white; border-color: #1a3a5c; font-weight: 600; }

.tabcontent { display: none; padding: 16px 0; }

/* ─── BUSCADOR ───────────────────────────────────────────── */
.buscador-ordenes { margin: 10px 0 12px; }
.buscador-ordenes input {
  width: 100%; padding: 9px 14px; font-size: 14px;
  border: 1px solid #cdd5e0; border-radius: 8px; outline: none;
}
.buscador-ordenes input:focus { border-color: #4a90d9; box-shadow: 0 0 0 3px rgba(74,144,217,.15); }

/* ─── TABLA DE ÓRDENES ───────────────────────────────────── */
.tabla-ordenes {
  width: 100%; border-collapse: collapse;
  background: white; border-radius: 8px; overflow: hidden;
  box-shadow: 0 1px 6px rgba(0,0,0,0.1);
}
.tabla-ordenes thead { background: #1a3a5c; color: white; }
.tabla-ordenes thead th { padding: 10px 14px; font-size: 11px; text-align: left; letter-spacing: 0.5px; font-weight: 600; }
.tabla-ordenes tbody tr { border-bottom: 1px solid #eef0f3; }
.tabla-ordenes tbody tr:last-child { border-bottom: none; }
.tabla-ordenes tbody tr:hover { background: #e8edf3; }
.tabla-ordenes td { padding: 10px 14px; font-size: 13px; vertical-align: middle; }
.tabla-ordenes td form { margin: 0; }

/* ─── TABLA GENÉRICA ─────────────────────────────────────── */
.ModuloContenido{
    max-width:1150px;
    margin:auto;
    padding:20px;
}
.titMod{
    max-width:1150px;
    margin:auto;
}
table {
  border-collapse: collapse; width: 100%;
  background: white; border-radius: 8px;
  overflow: hidden; box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  margin-bottom: 12px;
}
table thead, table tr:first-child th { background: #1a3a5c; color: white; }
table th { padding: 9px 12px; font-size: 11px; text-align: left; letter-spacing: 0.3px; }
table td { padding: 9px 12px; font-size: 13px; border-bottom: 1px solid #eef0f3; }
table tr:last-child td { border-bottom: none; }
table tr:hover { background: #e8edf3; }
table td label { font-size: 13px; }
table td input[type="submit"] {
  background: white; border: 1.5px solid #ccc; color: #555;
  font-size: 12px; cursor: pointer; padding: 4px 10px; border-radius: 4px;
}
table td input[type="submit"]:hover { background: #f0f5ff; border-color: #1a3a5c; color: #1a3a5c; }
table tr td { text-align: left; }

/* ─── BADGES ─────────────────────────────────────────────── */
.badge { display: inline-block; padding: 3px 10px; border-radius: 12px; font-size: 11px; font-weight: 600; }
.badge-activa    { background: #d4f4e0; color: #1a7a3c; }
.badge-revision  { background: #fff3cd; color: #856404; }
.badge-completa  { background: #d1ecf1; color: #0c5460; }
.badge-cerrada   { background: #e2e3e5; color: #495057; }
.badge-cancelada { background: #f8d7da; color: #721c24; }
.badge-revisado  { background: #e8f0fe; color: #3b5bdb; }
.badge-facturado { background: #fff3cd; color: #6d4c00; }

/* ─── CHIPS DE ESPECIALIDAD ──────────────────────────────── */
.especialidad-chip { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 11px; background: #e8f0fe; color: #3b5bdb; font-weight: 500; }
.especialidad-chip.resp { background: #e0f7f4; color: #00796b; }

/* ─── BOTONES ────────────────────────────────────────────── */
.btn-abrir { background: #1a3a5c; color: white; border: none; padding: 6px 14px; border-radius: 5px; font-size: 12px; cursor: pointer; font-weight: 600; font-family: inherit; }
.btn-abrir:hover { background: #25527a; }

.btn-ver { background: white; color: #666; border: 1.5px solid #ccc; padding: 5px 14px; border-radius: 5px; font-size: 12px; cursor: pointer; font-family: inherit; }
.btn-ver:hover { background: #f5f5f5; }

.btn-guardar { background: #1a7a3c; color: white; border: none; padding: 8px 22px; border-radius: 5px; font-size: 13px; cursor: pointer; font-weight: 600; margin-top: 10px; font-family: inherit; }
.btn-guardar:hover { background: #23a052; }

.btn-incluir { background: #2ecc71; color: #fff; border: none; padding: 4px 10px; border-radius: 4px; cursor: pointer; font-size: 12px; }

/* ─── INPUTS ─────────────────────────────────────────────── */
input[type="submit"] { border: 2px solid #ccc; font-family: inherit; font-size: 12px; padding: 5px 14px; border-radius: 5px; cursor: pointer; background: white; color: #444; }
input[type="submit"]:hover { border-color: #1a3a5c; color: #1a3a5c; }

input[type="text"], input[type="password"], input[type="email"],
input[type="number"], input[type="date"], input[type="month"],
textarea, select { border: 1.5px solid #ddd; border-radius: 5px; padding: 6px 10px; font-size: 13px; font-family: inherit; color: #333; }
input:focus, textarea:focus, select:focus { outline: none; border-color: #1a3a5c; background: #f8faff; }
textarea { display: block; min-height: 70px; width: 100%; box-sizing: border-box; resize: vertical; }

/* ─── FILTROS ────────────────────────────────────────────── */
.filtros-estado { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.filtro-btn { text-decoration: none; padding: 5px 13px; border-radius: 20px; font-size: 12px; font-weight: 500; border: 1.5px solid #ccc; color: #555; background: white; transition: all .15s; }
.filtro-btn:hover { border-color: #1a3a5c; color: #1a3a5c; }
.filtro-activo { background: #1a3a5c; color: white !important; border-color: #1a3a5c; }

/* ─── AUTOCOMPLETE ───────────────────────────────────────── */
.ac-wrap { position: relative; display: inline-block; width: 100%; max-width: 420px; }
.ac-input { width: 100%; padding: 8px 12px; font-size: 14px; font-family: inherit; border: 1.5px solid #ccc; border-radius: 6px; box-sizing: border-box; }
.ac-input:focus { outline: none; border-color: #1a3a5c; }
.ac-list { position: absolute; top: 100%; left: 0; right: 0; z-index: 100; background: white; border: 1.5px solid #1a3a5c; border-top: none; border-radius: 0 0 6px 6px; list-style: none; margin: 0; padding: 0; box-shadow: 0 4px 12px rgba(0,0,0,0.12); max-height: 260px; overflow-y: auto; }
.ac-list li { padding: 9px 14px; font-size: 13px; cursor: pointer; border-bottom: 1px solid #f0f0f0; }
.ac-list li:last-child { border-bottom: none; }
.ac-list li:hover, .ac-list li.ac-hover { background: #f0f5ff; color: #1a3a5c; }

/* ─── DETALLE DE ORDEN ───────────────────────────────────── */
.detalle-panel { background: white; border-radius: 8px; box-shadow: 0 1px 6px rgba(0,0,0,0.1); overflow: hidden; margin-bottom: 24px; }
.detalle-header { background: #1a3a5c; color: white; padding: 12px 20px; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
.detalle-header .orden-id { font-size: 18px; font-weight: bold; }
.detalle-header .paciente-nombre { font-size: 12px; opacity: 0.8; margin-top: 2px; }
.detalle-header .acciones-orden { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.detalle-header .btn-revision { background: #e67e22; color: white; border: none; padding: 6px 14px; border-radius: 5px; font-size: 12px; cursor: pointer; font-family: inherit; }
.detalle-header .btn-revision:hover { background: #cf6d17; }
.detalle-header .btn-volver { background: rgba(255,255,255,0.15); color: white; border: 1px solid rgba(255,255,255,0.3); padding: 5px 12px; border-radius: 5px; font-size: 12px; cursor: pointer; text-decoration: none; font-family: inherit; }
.detalle-header .btn-volver:hover { background: rgba(255,255,255,0.25); }

/* ─── TABS DE DETALLE ────────────────────────────────────── */
.tabs-detalle { display: flex; border-bottom: 2px solid #e0e0e0; padding: 0 16px; background: #fafafa; flex-wrap: wrap; }
.tabs-detalle button { padding: 10px 18px; font-size: 13px; cursor: pointer; color: #666; border: none; border-bottom: 2px solid transparent; margin-bottom: -2px; background: transparent; font-family: inherit; transition: 0.15s; }
.tabs-detalle button:hover { color: #1a3a5c; }
.tabs-detalle button.active { color: #1a3a5c; font-weight: 600; border-bottom-color: #1a3a5c; }
.od-tabcontent { padding: 16px 20px; }
.spec-filter-btn { color: #fff; border: 2px solid transparent; padding: 4px 12px; border-radius: 14px; font-size: 11px; font-weight: 600; cursor: pointer; opacity: 0.55; transition: opacity 0.15s; }
.spec-filter-btn:hover { opacity: 0.85; }
.spec-filter-btn.active { opacity: 1; border-color: #fff; }
.spec-filter-btn.todas-btn { background: rgba(255,255,255,0.2); }

/* ─── FORM COMPONENTS ────────────────────────────────────── */
.orden-section { padding: 14px 0 10px; border-bottom: 1px solid #e8edf2; margin-bottom: 4px; }
.orden-section:last-of-type { border-bottom: none; }
.orden-section-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: #7a8fa6; margin: 0 0 10px; }
.form-row { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: flex-end; }
.field-group { display: flex; flex-direction: column; gap: 3px; min-width: 100px; }
.field-group.fg-grow { flex: 1; min-width: 160px; }
.field-group label { font-size: 11px; font-weight: 600; color: #7a8fa6; text-transform: uppercase; letter-spacing: .04em; }
.field-group input, .field-group select, .field-group textarea { font-size: 13px; padding: 5px 8px; border: 1px solid #d0d8e4; border-radius: 5px; background: #f9fbfd; color: #2c3e50; }
.field-group textarea { min-height: 60px; resize: vertical; }
.form-actions { display: flex; gap: 10px; padding: 14px 0 4px; justify-content: flex-end; }
.form-actions input[type="button"], .form-actions input[type="submit"] { padding: 7px 20px; border-radius: 6px; font-size: 13px; font-weight: 600; cursor: pointer; border: none; }
.form-actions input[type="button"] { background: #ecf0f1; color: #5d6d7e; }
.form-actions input[type="submit"] { background: #2c6fad; color: #fff; }

/* ─── TERAPIAS TABLE ─────────────────────────────────────── */
.terapias-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.terapias-table th { text-align: left; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: #7a8fa6; padding: 6px 8px; border-bottom: 2px solid #e8edf2; }
.terapias-table td { padding: 7px 8px; border-bottom: 1px solid #f0f4f8; vertical-align: middle; }
.terapias-table tr:last-child td { border-bottom: none; }
.terapias-table td input[type="text"], .terapias-table td select { width: 100%; }
.terapias-table tr.terapia-inactiva td { opacity: 0.4; }

/* ─── FIELDSETS ──────────────────────────────────────────── */
fieldset { border: 1px solid var(--border); border-radius: 12px; padding: 20px 24px; margin-bottom: 16px; background: white; box-shadow: 0 1px 4px rgba(0,0,0,.07); }
fieldset legend { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; padding: 0 8px; letter-spacing: .7px; }
fieldset h4 { font-size: 12px; font-weight: 600; color: #1a3a5c; text-transform: uppercase; }
.fieldset-bloque { border: 1.5px solid #e0e0e0; border-radius: 7px; padding: 14px 16px; margin-bottom: 14px; }

/* ─── CAMPO GRID ─────────────────────────────────────────── */
.campo-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.campo label { font-size: 11px; color: #888; text-transform: uppercase; letter-spacing: 0.4px; display: block; margin-bottom: 3px; }
.campo .valor { font-size: 14px; font-weight: 500; color: #333; }
.campo input[type=text], .campo input[type=date], .campo textarea, .campo select { width: 100%; border: 1.5px solid #ddd; border-radius: 5px; padding: 7px 10px; font-size: 13px; color: #333; font-family: inherit; }
.campo input:focus, .campo textarea:focus, .campo select:focus { outline: none; border-color: #1a3a5c; }

/* ─── MISC ───────────────────────────────────────────────── */
.Resp { display: inline-block; margin-right: 16px; margin-bottom: 8px; vertical-align: top; }
.callout { background: #fff8e1; border-left: 4px solid #f9a825; padding: 10px 16px; font-size: 12px; color: #6d4c00; border-radius: 0 6px 6px 0; margin-bottom: 16px; }
.mayus { text-transform: uppercase; }
label h1 { color: #c0392b; font-size: 14px; font-weight: 600; padding: 10px 0; }
.nota { font-size: 12px; color: #888; margin-top: 6px; font-style: italic; }
.cumple { position: fixed; width: 100%; z-index: -2; }
.cumple img { height: 300px; }
.money::before { content: '$'; }
.resultados { overflow-x: auto; }
.terapContenido { max-width: 1200px; margin: 0 auto; }
#Terapeuta .ModuloContenido { max-width: 1200px; }

/* ─── NOTIFICACIONES ─────────────────────────────────────── */
.NotifModif { background: #d4f4e0; color: #1a7a3c; border: 1px solid #1a7a3c; border-radius: 5px; display: block; position: fixed; right: 2%; top: 80px; padding: 8px 14px; font-size: 13px; z-index: 999; }
.notifica { border: 1px solid green; border-radius: 3px; display: block; position: fixed; right: 5%; top: 2px; padding: 5px; background: #C1DEDE; z-index: 999; }

/* ─── POPUP ──────────────────────────────────────────────── */
fieldset .overlay, details .overlay { position: fixed; top: 0; bottom: 0; left: 0; right: 0; background: rgba(0,0,0,0.6); transition: opacity 300ms; visibility: hidden; opacity: 0; z-index: 1000; }
fieldset .overlay.active, details .overlay.active { visibility: visible; opacity: 1; }
.popup { margin: 70px auto; padding: 24px; background: white; border-radius: 8px; width: 40%; max-width: 520px; position: relative; box-shadow: 0 4px 20px rgba(0,0,0,0.3); }
.popup h2 { color: #1a3a5c; margin-bottom: 12px; font-size: 16px; }
.popup .close { position: absolute; top: 16px; right: 20px; font-size: 24px; font-weight: bold; color: #888; text-decoration: none; }
.popup .close:hover { color: #c0392b; }
.popup .content { font-size: 13px; color: #555; line-height: 1.6; }

/* ─── LOGIN ──────────────────────────────────────────────── */
.contenedor { width: 95%; margin: auto; box-sizing: border-box; }
.login { display: block; padding: 32px 28px 28px; background: #1a3a5c; border-radius: 10px; margin: 8% auto; max-width: 380px; }
.login img { display: block; margin: 0 auto 20px; max-width: 180px; }
.login label { display: block; color: white; font-size: 12px; margin-bottom: 4px; }
.login input[type="text"], .login input[type="password"] { display: block; width: 100%; margin-bottom: 12px; background: rgba(255,255,255,0.15); border: 1px solid rgba(255,255,255,0.3); color: white; border-radius: 5px; padding: 8px 12px; font-size: 13px; }
.login input[type="submit"] { display: block; width: 100%; background: #4fc3f7; color: #1a3a5c; border: none; border-radius: 5px; padding: 10px; font-size: 14px; font-weight: 700; cursor: pointer; margin-top: 8px; }
.login input[type="submit"]:hover { background: #81d4fa; }

/* ─── EMPLOYEE CARD ──────────────────────────────────────── */
.emp-card { background: white; border-radius: 8px; box-shadow: 0 1px 6px rgba(0,0,0,0.1); margin-bottom: 16px; }
.verOrdenes table { min-width: 960px; }
.emp-card-header { background: #1a3a5c; color: white; padding: 14px 20px; display: flex; align-items: center; gap: 16px; cursor: pointer; list-style: none; border-radius: 8px 8px 0 0; overflow: hidden; }
.emp-card-header::-webkit-details-marker { display: none; }
.emp-card-header::after { content: '▸'; margin-left: auto; font-size: 12px; opacity: .6; flex-shrink: 0; }
.emp-card[open] > .emp-card-header::after { content: '▾'; }
.emp-card-foto { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; border: 2px solid rgba(255,255,255,0.4); flex-shrink: 0; }
.emp-card-nombre { font-weight: 700; font-size: 15px; }
.emp-card-esp { font-size: 12px; opacity: 0.8; margin-top: 2px; }
.emp-card-body { padding: 16px 20px; }
.emp-card-actions { padding: 10px 20px 14px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; border-top: 1px solid #eef0f3; }

/* ─── FORM HELPERS ───────────────────────────────────────── */
.campo-full { grid-column: 1 / -1; }
.campo textarea { min-height: 72px; resize: vertical; }

/* ─── SPECIALTY CHECKBOXES ───────────────────────────────── */
.esp-checks { display: flex; flex-wrap: wrap; gap: 8px; }
.esp-check-label {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12px; color: #333; padding: 4px 10px;
  border: 1.5px solid #dde4ee; border-radius: 20px;
  background: #f5f8fb; cursor: default;
}
.esp-check-label input[type="checkbox"] { accent-color: #1a3a5c; cursor: pointer; }
.esp-check-label:has(input:checked) { background: #e2eaf6; border-color: #2c6fad; color: #1a3a5c; font-weight: 600; }
.esp-check-label:has(input:not(:disabled)) { cursor: pointer; }
.esp-check-label.esp-locked { opacity: .5; cursor: not-allowed; }
.esp-check-label.esp-locked input { cursor: not-allowed; }

/* ─── HISTORIA CLINICA ───────────────────────────────────── */
.hclin-card { margin-top: 18px; border-radius: 6px; overflow: hidden; }
.hclin-card-summary {
  padding: 10px 14px; background: #1a3a5c; color: #fff;
  font-size: 13px; font-weight: 600; cursor: pointer;
  list-style: none; display: flex; align-items: center; justify-content: space-between;
  user-select: none;
}
.hclin-card-summary::-webkit-details-marker { display: none; }
.hclin-card-summary::after { content: '▸'; font-size: 11px; opacity: 0.7; }
.hclin-card[open] > .hclin-card-summary::after { content: '▾'; }
.hclin-card-summary:hover { background: #24507a; }
.hclin-card[open] > :not(summary):not(.overlay) { padding: 14px 16px 6px; }
.hclin-section-title {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.6px; color: #2c6fad;
  border-bottom: 1px solid #d0e3f5; margin: 14px 0 10px; padding-bottom: 4px;
}
.hclin-info {
  font-size: 14px; color: #2c6fad; text-decoration: none;
  vertical-align: middle; opacity: 0.7;
}
.hclin-info:hover { opacity: 1; }
.hclin-antec-list { display: flex; flex-direction: column; gap: 6px; }
.hclin-antec { border: 1px solid #dde4ee; border-radius: 6px; overflow: hidden; }
.hclin-antec summary {
  padding: 8px 12px; background: #f0f4fa; cursor: pointer;
  font-size: 12px; font-weight: 600; color: #1a3a5c;
  list-style: none; display: flex; align-items: center; justify-content: space-between;
  user-select: none;
}
.hclin-antec summary::-webkit-details-marker { display: none; }
.hclin-antec summary::after { content: '▸'; font-size: 11px; color: #888; }
.hclin-antec[open] summary::after { content: '▾'; }
.hclin-antec:not([open]) textarea { display: none; }
.hclin-antec summary:hover { background: #e2eaf6; }
.hclin-antec textarea {
  display: block; width: 100%; box-sizing: border-box;
  border: none; border-top: 1px solid #dde4ee;
  padding: 10px 12px; font-size: 13px; font-family: inherit;
  min-height: 80px; resize: vertical; background: #fff; color: #333;
}

/* ─── THERAPIST CARD BUTTONS ─────────────────────────────── */
.emp-btn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 6px 12px; border-radius: 5px; border: none;
  font-size: 12px; font-weight: 600; cursor: pointer;
  line-height: 1.4; white-space: nowrap; transition: opacity .15s, box-shadow .15s;
  text-decoration: none;
}
.emp-btn:hover { opacity: .85; box-shadow: 0 2px 6px rgba(0,0,0,.18); }
.emp-btn:disabled, .emp-btn[disabled] { opacity: .4; cursor: not-allowed; box-shadow: none; }
.emp-btn-edit     { background: #e8f0fe; color: #1a56db; }
.emp-btn-edit:hover { background: #d0e2ff; }
.emp-btn-save     { background: #d1fae5; color: #065f46; }
.emp-btn-save:hover { background: #a7f3d0; }
.emp-btn-orders   { background: #f3f4f6; color: #374151; }
.emp-btn-orders:hover { background: #e5e7eb; }
.emp-btn-inactive { background: #fee2e2; color: #991b1b; }
.emp-btn-inactive:hover { background: #fecaca; }
.emp-btn-reactivate { background: #ecfdf5; color: #065f46; border: 1px solid #6ee7b7; }
.emp-btn-reactivate:hover { background: #d1fae5; }

/* ─── PROFILE ────────────────────────────────────────────── */
.perfil-header { display: flex; align-items: center; gap: 16px; padding: 16px 0 12px; }
.perfil-foto img { width: 80px; height: 80px; border-radius: 50%; object-fit: cover; border: 3px solid #1a3a5c; }
.perfil-nombre { font-size: 18px; font-weight: 700; color: #1a3a5c; text-transform: uppercase; }

/* ─── SS CONFIG TABLE ────────────────────────────────────── */
.ss-config-table { width: 100%; max-width: 520px; }
.ss-config-table thead th { background: #1a3a5c; color: white; padding: 8px 12px; font-size: 11px; text-transform: uppercase; letter-spacing: 0.4px; }
.ss-config-table td { padding: 8px 12px; font-size: 13px; }
.ss-config-table tr:nth-child(even) td { background: #f5f8fb; }

/* ─── LEGACY (announcements, old cards) ─────────────────── */
.anuncio { display: block; border: 1px solid black; padding: 20px; color: white; background: rgba(50,111,168,0.8); border-radius: 10px; margin-bottom: 10px; }
.anuncioleido { display: block; border: 1px solid black; padding: 20px; color: white; background: rgba(50,111,168,0.3); border-radius: 10px; margin-bottom: 10px; }
#anunEncab { float: left; text-align: left; }
#anunFecha { text-align: right; }
.grupoalerta { background: #F5C0B5; }
.info { background: hsla(218,70%,93%,1); border: 1px solid #ccc; border-radius: 5px; padding: 5% 3%; width: 50%; display: block; margin: 0 auto; }
.foto { display: block; height: auto; width: 80%; align-self: center; justify-self: center; }
.foto img { display: block; width: 100%; border-radius: 5px; }

/* ─── MÓDULO / SECCIONES ─────────────────────────────────── */
.botones { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.botones button { background: #1a3a5c; color: white; border: none; padding: 8px 16px; border-radius: 6px; font-size: 12px; cursor: pointer; font-family: inherit; font-weight: 500; }
.botones button:hover { background: #25527a; }
.ClasePago { display: flex; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.ClasePago > div { flex: 1; min-width: 140px; text-align: center; font-size: 13px; padding: 10px; border-radius: 6px; border: 2px solid #c0cfe0; cursor: pointer; background: white; font-weight: 600; color: #1a3a5c; transition: 0.2s; }
.ClasePago > div:hover { background: #1a3a5c; color: white; border-color: #1a3a5c; }
.RecAnul { column-count: 4; }
.grupo  { background: #f5f8fb; }
.grupo2 { background: #edf7f3; }
.grupo3 { background: #e6f0e9; }
.finanzas .valores { padding-right: 20px; }
.formCont { padding: 10px; }
.formCont > fieldset { margin-top: 10px; }

/* ─── NUEVA ORDEN — THERAPY CARDS ───────────────────────── */
.nv-terap-grid { display:flex; flex-direction:column; gap:8px; }
.nv-terap-card { border:1px solid #d0d8e4; border-radius:8px; overflow:hidden; background:#f9fbfd; }
.nv-terap-label { display:flex; align-items:center; gap:10px; padding:10px 16px; color:#fff; font-weight:600; font-size:13px; cursor:pointer; margin:0; user-select:none; transition:opacity .15s; }
.nv-terap-label:hover { opacity:.9; }
.nv-terap-label input[type="checkbox"] { width:16px; height:16px; cursor:pointer; accent-color:rgba(255,255,255,.8); flex-shrink:0; }
.nv-terap-fields { padding:14px 16px; }

/* ─── TIPOGRAFÍA ─────────────────────────────────────────── */
h1 { color: #1a3a5c; font-size: 18px; margin: 10px 0; }
h2 { color: #1a3a5c; font-size: 16px; margin: 8px 0; }
h3 {
  display: block; text-align: center; padding: 10px;
  width: 100%; margin: 12px 0 8px;
  background: #1a3a5c; color: white;
  border-radius: 6px; font-size: 14px;
}

/* ═══════════════════════════════════════════════════════════
   RESUMEN TAB — prefijado con #Resumen para máxima
   especificidad, anula cualquier regla global anterior.
═══════════════════════════════════════════════════════════ */
#Resumen {
  font-family: 'Outfit', 'Segoe UI', sans-serif;
  animation: fadeUpRes .35s ease;
}
@keyframes fadeUpRes { from { opacity:0; transform:translateY(10px); } to { opacity:1; transform:none; } }

/* Neutralizar conflictos globales dentro de #Resumen */
#Resumen h3 {
  display: inline-block; text-align: left; padding: 0;
  width: auto; margin: 0; background: none !important;
  color: var(--navy) !important; border-radius: 0;
  font-size: 13px; font-weight: 600;
}
#Resumen table { box-shadow: none; border-radius: 0; margin-bottom: 0; background: transparent; border: none; }
#Resumen table thead,
#Resumen table tr:first-child th { background: var(--bg) !important; color: var(--muted) !important; }
#Resumen .btn-ver { background: var(--navy); color: white; border: none; padding: 6px 14px; border-radius: 6px; font-size: 11px; cursor: pointer; font-family: inherit; font-weight: 600; }
#Resumen .btn-ver:hover { background: var(--navy2); }

/* Header del resumen */
#Resumen .resumen-header { display:flex; align-items:center; justify-content:space-between; margin-bottom:20px; flex-wrap:wrap; gap:10px; }
#Resumen .resumen-title { font-size:20px; font-weight:600; color:var(--navy); display:flex; align-items:center; gap:10px; }
#Resumen .resumen-title::before { content:''; display:block; width:4px; height:22px; background:var(--accent); border-radius:2px; }
#Resumen .resumen-fecha { font-family:'DM Mono','Courier New',monospace; font-size:12px; color:var(--muted); background:white; padding:6px 14px; border-radius:20px; border:1px solid var(--border); }

/* KPI Cards */
#Resumen .kpi-grid { display:grid; grid-template-columns:repeat(4,1fr); gap:14px; margin-bottom:20px; }
#Resumen .kpi-card { background:white; border-radius:12px; padding:18px 20px; box-shadow:0 1px 4px rgba(0,0,0,.07); border:1px solid var(--border); position:relative; overflow:hidden; transition:transform .2s,box-shadow .2s; }
#Resumen .kpi-card:hover { transform:translateY(-2px); box-shadow:0 6px 18px rgba(0,0,0,.1); }
#Resumen .kpi-card::after { content:''; position:absolute; bottom:0; left:0; right:0; height:3px; }
#Resumen .kpi-card.total::after    { background:var(--navy); }
#Resumen .kpi-card.activa::after   { background:var(--c-activa); }
#Resumen .kpi-card.revision::after { background:var(--c-revision); }
#Resumen .kpi-card.completa::after { background:var(--c-completa); }
#Resumen .kpi-label { font-size:10px; font-weight:600; letter-spacing:.8px; text-transform:uppercase; color:var(--muted); margin-bottom:8px; }
#Resumen .kpi-value { font-size:40px; font-weight:700; line-height:1; margin-bottom:6px; font-family:'DM Mono','Courier New',monospace; }
#Resumen .kpi-card.total    .kpi-value { color:var(--navy); }
#Resumen .kpi-card.activa   .kpi-value { color:var(--c-activa); }
#Resumen .kpi-card.revision .kpi-value { color:var(--c-revision); }
#Resumen .kpi-card.completa .kpi-value { color:var(--c-completa); }
#Resumen .kpi-sub  { font-size:11px; color:var(--muted); display:flex; align-items:center; gap:5px; }
#Resumen .kpi-pct  { font-size:11px; font-weight:600; padding:2px 7px; border-radius:10px; }
#Resumen .kpi-card.activa   .kpi-pct { background:var(--green-bg);  color:var(--green); }
#Resumen .kpi-card.revision .kpi-pct { background:var(--yellow-bg); color:var(--yellow); }
#Resumen .kpi-card.completa .kpi-pct { background:var(--blue-bg);   color:var(--blue); }
#Resumen .kpi-icon { position:absolute; top:14px; right:16px; font-size:26px; opacity:.1; }

/* Charts */
#Resumen .charts-row { display:grid; grid-template-columns:320px 1fr; gap:16px; margin-bottom:20px; }
#Resumen .chart-card { background:white; border-radius:12px; padding:20px 22px; border:1px solid var(--border); box-shadow:0 1px 4px rgba(0,0,0,.07); }
#Resumen .chart-card-header { display:flex; align-items:baseline; justify-content:space-between; margin-bottom:16px; }
#Resumen .chart-card-title { font-size:13px; font-weight:600; color:var(--navy); }
#Resumen .chart-card-sub   { font-size:11px; color:var(--muted); }
#Resumen .donut-wrap { position:relative; display:flex; justify-content:center; align-items:center; height:200px; }
#Resumen .donut-center { position:absolute; text-align:center; pointer-events:none; }
#Resumen .donut-center-num { font-family:'DM Mono','Courier New',monospace; font-size:30px; font-weight:700; color:var(--navy); line-height:1; }
#Resumen .donut-center-label { font-size:10px; color:var(--muted); text-transform:uppercase; letter-spacing:.6px; margin-top:2px; }
#Resumen .donut-legend { display:grid; grid-template-columns:1fr 1fr; gap:8px 12px; margin-top:14px; }
#Resumen .dl-item { display:flex; align-items:center; gap:7px; font-size:12px; }
#Resumen .dl-dot  { width:10px; height:10px; border-radius:3px; flex-shrink:0; }
#Resumen .dl-name { color:var(--muted); flex:1; }
#Resumen .dl-val  { font-weight:600; color:var(--text); font-family:'DM Mono','Courier New',monospace; font-size:12px; }
#Resumen .bar-chart-wrap { height:236px; position:relative; }
#Resumen .period-pills { display:flex; gap:4px; }
#Resumen .pill { font-size:10px; padding:3px 10px; border-radius:20px; border:1.5px solid var(--border); background:white; color:var(--muted); cursor:pointer; font-family:inherit; transition:.15s; }
#Resumen .pill.active { border-color:var(--navy); background:var(--navy); color:white; }

/* Quick-search input bar — global, used in multiple tabs */
.quick-search-section { margin-bottom:20px; }
.quick-search-wrap { display:flex; align-items:center; gap:10px; background:white; border-radius:10px; border:1px solid #e2e8f0; box-shadow:0 1px 4px rgba(0,0,0,.07); padding:0 16px; transition:box-shadow .15s,border-color .15s; }
.quick-search-wrap:focus-within { box-shadow:0 0 0 2px rgba(79,195,247,.35); border-color:#4fc3f7; }
.quick-search-icon { color:#64748b; font-size:15px; flex-shrink:0; }
.quick-search-input { flex:1; border:none; outline:none; padding:13px 0; font-size:14px; font-family:inherit; background:transparent; color:#1a3a5c; min-width:0; }
.quick-search-input::placeholder { color:#94a3b8; }
.quick-search-clear { color:#94a3b8; cursor:pointer; font-size:14px; display:none; line-height:1; flex-shrink:0; padding:4px; }
.quick-search-clear.visible { display:block; }

/* Quick-search floating dropdown — appended to body, position:fixed via JS */
.qs-dropdown { position:fixed; background:white; border:1px solid #e2e8f0; border-radius:10px; box-shadow:0 8px 28px rgba(0,0,0,.15); z-index:9999; max-height:380px; overflow-y:auto; font-family:'Outfit','Segoe UI',sans-serif; }
.qs-dropdown .qs-item { display:flex; align-items:center; gap:12px; padding:10px 16px; cursor:pointer; border-bottom:1px solid #f1f5f9; transition:background .1s; }
.qs-dropdown .qs-item:last-child { border-bottom:none; }
.qs-dropdown .qs-item:hover { background:#f7f9fc; }
.qs-dropdown .qs-left { flex-shrink:0; }
.qs-dropdown .qs-num { display:block; font-family:'DM Mono','Courier New',monospace; font-size:11px; color:#94a3b8; min-width:44px; }
.qs-dropdown .qs-body { flex:1; min-width:0; }
.qs-dropdown .qs-name { font-weight:600; color:#1a3a5c; font-size:13px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.qs-dropdown .qs-sub { display:flex; align-items:center; gap:5px; margin-top:3px; flex-wrap:wrap; }
.qs-dropdown .qs-doc { font-family:'DM Mono','Courier New',monospace; font-size:10px; color:#94a3b8; margin-right:2px; }
.qs-dropdown .qs-chip { font-size:10px; background:#e8f0fe; color:#1a4f9c; border-radius:4px; padding:1px 6px; white-space:nowrap; }
.qs-dropdown .qs-badge { font-size:10px; background:#f0fdf4; color:#166534; border-radius:4px; padding:1px 6px; white-space:nowrap; }
.qs-dropdown .qs-empty { padding:18px 16px; text-align:center; color:#94a3b8; font-size:13px; }

/* Sortable table headers */
.sortable-th { cursor:pointer; user-select:none; white-space:nowrap; }
.sortable-th::after { content:' ⇅'; color:#aaa; font-size:10px; }
.sortable-th.sort-asc::after { content:' ↑'; color:#1a3a5c; }
.sortable-th.sort-desc::after { content:' ↓'; color:#1a3a5c; }

/* Bottom row */
#Resumen .bottom-row { display:grid; grid-template-columns:1fr 1fr 300px; gap:16px; align-items:start; }

/* Pending evolutions widget */
#Resumen .pendientes-card { background:white; border-radius:12px; border:1px solid var(--border); box-shadow:0 1px 4px rgba(0,0,0,.07); padding:18px 20px; }
#Resumen .pend-row { display:flex; align-items:center; gap:12px; padding:10px 0; border-bottom:1px solid #f1f5f9; }
#Resumen .pend-row:last-child { border-bottom:none; }
#Resumen .pend-rank { width:22px; height:22px; border-radius:50%; background:var(--navy); color:white; font-size:11px; font-weight:700; display:flex; align-items:center; justify-content:center; flex-shrink:0; }
#Resumen .pend-foto { width:44px; height:44px; border-radius:50%; object-fit:cover; border:2px solid var(--border); flex-shrink:0; }
#Resumen .pend-info { flex:1; min-width:0; }
#Resumen .pend-nombre { font-weight:600; font-size:13px; color:#1e293b; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
#Resumen .pend-meta { display:flex; gap:8px; flex-wrap:wrap; margin-top:4px; align-items:center; }
#Resumen .pend-badge { background:#fef3c7; color:#92400e; border-radius:20px; padding:2px 10px; font-size:11px; font-weight:700; }
#Resumen .pend-fecha { font-size:11px; color:#64748b; }
#Resumen .ordest-card { background:white; border-radius:12px; border:1px solid var(--border); box-shadow:0 1px 4px rgba(0,0,0,.07); padding:18px 20px; margin-top:16px; }
#Resumen .ordest-card th { background:#1a3a5c !important; color:white !important; padding:9px 12px; font-size:11px; letter-spacing:.4px; white-space:nowrap; }
#Resumen .ordest-card th:hover { background:#2c5282 !important; }
#Resumen .tabla-section { background:white; border-radius:12px; border:1px solid var(--border); box-shadow:0 1px 4px rgba(0,0,0,.07); overflow:hidden; }
#Resumen .tabla-section-head { padding:14px 20px; display:flex; align-items:center; justify-content:space-between; border-bottom:1px solid var(--border); flex-wrap:wrap; gap:8px; }
#Resumen .filtro-row { display:flex; gap:5px; flex-wrap:wrap; align-items:center; }
#Resumen .filtro-chip { border:1.5px solid var(--border); background:white; color:#555; padding:4px 12px; border-radius:20px; font-size:11px; cursor:pointer; font-family:inherit; transition:.15s; font-weight:500; }
#Resumen .filtro-chip:hover  { border-color:var(--navy); color:var(--navy); }
#Resumen .filtro-chip.active { border-color:var(--navy); background:var(--navy); color:white; }
#Resumen .resumen-tabla { width:100%; border-collapse:collapse; }
#Resumen .resumen-tabla thead th { padding:9px 16px; font-size:10px; text-align:left; letter-spacing:.6px; color:var(--muted); font-weight:600; text-transform:uppercase; background:var(--bg) !important; }
#Resumen .resumen-tabla tbody tr { border-bottom:1px solid var(--border); }
#Resumen .resumen-tabla tbody tr:last-child { border-bottom:none; }
#Resumen .resumen-tabla tbody tr:hover { background:#f7f9fc; cursor:pointer; }
#Resumen .resumen-tabla td { padding:10px 16px; font-size:13px; vertical-align:middle; }
#Resumen .td-paciente { font-weight:600; color:var(--navy); }
#Resumen .td-mono { font-family:'DM Mono','Courier New',monospace; font-size:11px; color:var(--muted); }
#Resumen .badge-activa  { background:var(--green-bg);  color:var(--green);  display:inline-block; padding:3px 9px; border-radius:20px; font-size:11px; font-weight:600; }
#Resumen .badge-revision{ background:var(--yellow-bg); color:var(--yellow); display:inline-block; padding:3px 9px; border-radius:20px; font-size:11px; font-weight:600; }
#Resumen .badge-chip    { background:#f1f5f9; color:var(--muted); font-size:10px; display:inline-block; padding:2px 7px; border-radius:20px; font-weight:600; }

/* Side panel */
#Resumen .side-panel { display:flex; flex-direction:column; gap:14px; }
#Resumen .semaforo-card { background:white; border-radius:12px; padding:18px 20px; border:1px solid var(--border); box-shadow:0 1px 4px rgba(0,0,0,.07); }
#Resumen .resumen-card-title { font-size:11px; font-weight:600; text-transform:uppercase; letter-spacing:.7px; color:var(--muted); margin-bottom:12px; }
#Resumen .semaforo-row { display:flex; align-items:center; gap:10px; padding:8px 0; border-bottom:1px solid var(--border); }
#Resumen .semaforo-row:last-child { border-bottom:none; }
#Resumen .semaforo-emoji { font-size:18px; }
#Resumen .semaforo-desc  { flex:1; font-size:12px; color:var(--text); line-height:1.4; }
#Resumen .semaforo-count { font-family:'DM Mono','Courier New',monospace; font-size:16px; font-weight:700; color:var(--navy); }
#Resumen .acciones-card { background:var(--navy); border-radius:12px; padding:18px 20px; }
#Resumen .acciones-card .resumen-card-title { color:rgba(255,255,255,.45); }
#Resumen .accion-btn { display:flex; align-items:center; gap:10px; width:100%; padding:9px 12px; margin-bottom:6px; background:rgba(255,255,255,.08); color:white; border:1px solid rgba(255,255,255,.12); border-radius:7px; cursor:pointer; font-family:inherit; font-size:12px; text-align:left; transition:background .15s; }
#Resumen .accion-btn:hover { background:rgba(255,255,255,.17); }
#Resumen .accion-btn:last-child { margin-bottom:0; }
#Resumen .accion-btn .icon  { font-size:14px; }
#Resumen .accion-btn .label { flex:1; }
#Resumen .accion-btn .arrow { opacity:.35; font-size:12px; }

/* ─── RESPONSIVE ─────────────────────────────────────────── */
@media screen and (max-width: 900px) {
  #Resumen .charts-row { grid-template-columns: 1fr; }
  #Resumen .bottom-row { grid-template-columns: 1fr; }
}
@media screen and (max-width: 700px) {
  #Resumen .kpi-grid  { grid-template-columns: repeat(2, 1fr); }
  #Resumen .kpi-value { font-size: 28px; }
}
@media screen and (max-width: 768px) {
  .header { padding: 10px 14px; }
  .header .bienvenida { display: none; }
  .main { padding: 0 10px; }
  .statsbar { gap: 12px; padding: 6px 14px; }
  .campo-grid { grid-template-columns: 1fr; }
  .tabla-ordenes thead { display: none; }
  .tabla-ordenes tbody tr { display: block; margin-bottom: 10px; border: 2px solid #eee; border-radius: 6px; }
  .tabla-ordenes td { display: block; text-align: right; padding: 8px 12px; border-bottom: 1px solid #f0f0f0; }
  .tabla-ordenes td::before { content: attr(data-label); float: left; font-weight: 600; color: #555; }
  .ClasePago { flex-direction: column; }
  .botones { flex-direction: column; }
  .RecAnul { column-count: 2; }
  .popup { width: 90%; }
  .tab button { padding: 7px 12px; font-size: 12px; }
  .estadisticas { display: block; width: 100%; }
  .ModuloContenido { flex-direction: column; }
  .contenidoPerfil { grid-template-columns: 1fr; }
  .datosPerfil { grid-template-columns: 1fr; }
}

/* ── Permisos tab ──────────────────────────────────────────────────── */
.tab-lock {
  background: #0f2540; color: #4fc3f7;
  border-color: #4fc3f7;
}
.tab-lock.active { background: #4fc3f7; color: #1a3a5c; border-color: #4fc3f7; }

.permisos-wrap {
  background: white; border-radius: 8px;
  box-shadow: 0 1px 6px rgba(0,0,0,0.08);
  overflow: hidden; margin-bottom: 16px;
}
.permisos-tabla { width: 100%; border-collapse: collapse; }
.permisos-tabla thead tr { background: #1a3a5c; color: white; }
.permisos-tabla thead th {
  padding: 10px 12px; font-size: 11px; text-align: center;
  font-weight: 600; letter-spacing: 0.4px;
  border-right: 1px solid rgba(255,255,255,0.1);
}
.permisos-tabla thead th.th-usuario { text-align: left; min-width: 200px; }
.permisos-tabla thead th:last-child { border-right: none; }
.permisos-tabla tbody tr { border-bottom: 1px solid #e2e8f0; }
.permisos-tabla tbody tr:last-child { border-bottom: none; }
.permisos-tabla tbody tr:hover { background: #f8faff; }
.permisos-tabla tbody tr.row-super { background: #f0f4f8; }
.permisos-tabla tbody tr.row-super:hover { background: #e8edf5; }
.permisos-tabla td {
  padding: 10px 12px; font-size: 13px;
  text-align: center; vertical-align: middle;
  border-right: 1px solid #e2e8f0;
}
.permisos-tabla td:last-child { border-right: none; }
.permisos-tabla td.td-usuario { text-align: left; }
.permisos-tabla tr.group-label td {
  background: #f0f4f8; color: #64748b; font-size: 11px;
  font-weight: 600; letter-spacing: 0.5px; padding: 6px 12px;
  text-align: left; text-transform: uppercase;
}
.usuario-cell { display: flex; align-items: center; gap: 10px; }
.avatar {
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600; flex-shrink: 0;
}
.avatar-coord { background: #e0f2fe; color: #0369a1; }
.avatar-super { background: #1a3a5c; color: #4fc3f7; }
.u-nombre { font-size: 13px; font-weight: 600; color: #1e293b; }
.u-badge {
  display: inline-block; padding: 2px 8px; border-radius: 10px;
  font-size: 10px; font-weight: 600; margin-top: 2px;
}
.badge-coord { background: #e0f2fe; color: #0369a1; }
.badge-super { background: #1a3a5c; color: #4fc3f7; }
.perm-check { width: 16px; height: 16px; accent-color: #1a3a5c; cursor: pointer; }
.lock-icon { font-size: 14px; opacity: 0.35; display: block; }
.lock-label { font-size: 10px; color: #64748b; margin-top: 2px; }
.permisos-footer {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 4px; flex-wrap: wrap; gap: 10px;
}
.legend { display: flex; gap: 16px; flex-wrap: wrap; }
.legend-item { display: flex; align-items: center; gap: 6px; font-size: 11px; color: #64748b; }
.legend-dot { width: 10px; height: 10px; border-radius: 2px; flex-shrink: 0; }

/* ── Estadísticas extra del Resumen ───────────────────────── */
.stats-extra-label {
  font-size: 11px; font-weight: 600; color: #64748b;
  letter-spacing: 0.6px; text-transform: uppercase;
  margin: 24px 0 10px; padding-bottom: 6px;
  border-bottom: 1px solid #e2e8f0;
}
.stats-extra-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.9fr 1.4fr;
  gap: 14px;
  margin-bottom: 24px;
}
.stat-card {
  background: white; border-radius: 10px;
  box-shadow: 0 1px 6px rgba(0,0,0,0.08);
  padding: 16px 18px; position: relative; overflow: hidden;
}
.stat-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
}
.card-visitas-mes::before { background: #4fc3f7; }
.card-apertura::before    { background: #f59e0b; }
.card-tendencia::before   { background: #22c55e; }
.card-esp6                { grid-column: 1 / -1; }
.card-esp6::before        { background: #7c3aed; }

.stat-card-title {
  font-size: 11px; font-weight: 600; color: #64748b;
  letter-spacing: 0.4px; margin-bottom: 10px;
}
.stat-card-footer {
  margin-top: 12px; padding-top: 10px;
  border-top: 1px solid #e2e8f0;
  font-size: 10px; color: #94a3b8;
}

/* Card 1 */
.visitas-total-num { font-size: 32px; font-weight: 700; color: #1a3a5c; line-height: 1; margin-bottom: 4px; }
.visitas-total-sub { font-size: 11px; color: #64748b; margin-bottom: 14px; }
.esp-bars          { display: flex; flex-direction: column; gap: 6px; }
.esp-row-st        { display: flex; align-items: center; gap: 8px; }
.esp-lbl           { font-size: 11px; color: #1e293b; width: 46px; flex-shrink: 0; }
.esp-bar-wrap-st   { flex: 1; background: #f0f2f5; border-radius: 4px; height: 7px; overflow: hidden; }
.esp-bar-st        { height: 7px; border-radius: 4px; background: #4fc3f7; }
.esp-cnt           { font-size: 11px; font-weight: 600; color: #1a3a5c; width: 28px; text-align: right; flex-shrink: 0; }

/* Card 2 */
.apertura-num     { font-size: 42px; font-weight: 700; color: #1a3a5c; line-height: 1; margin-bottom: 2px; }
.apertura-unit    { font-size: 13px; color: #64748b; margin-bottom: 12px; }
.apertura-insight {
  font-size: 11px; color: #64748b; line-height: 1.5;
  background: #f8faff; border-radius: 6px; padding: 8px 10px;
}
.apertura-insight b { color: #1e4976; }

/* Card 3 */
.chart-bars {
  display: flex; align-items: flex-end; gap: 8px;
  height: 90px; margin-bottom: 10px; padding: 0 2px;
}
.chart-bar-col     { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.chart-bar-col .cb { width: 100%; border-radius: 4px 4px 0 0; background: #4fc3f7; min-height: 4px; }
.chart-bar-col .cv { font-size: 10px; font-weight: 600; color: #1a3a5c; }
.chart-bar-col .cm { font-size: 10px; color: #64748b; }
.chart-totrow {
  font-size: 11px; color: #64748b;
  display: flex; justify-content: space-between; align-items: center;
}
.chart-totrow b { color: #1a3a5c; font-size: 13px; }

/* ── Mapa de asignación en orden ───────────────────────────── */
.orden-terapias-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 16px;
  align-items: start;
}
.orden-terapias-form { min-width: 0; }
.orden-mapa-panel    { display: flex; flex-direction: column; gap: 10px; }

.om-tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.om-tab {
  padding: 5px 12px; border-radius: 5px; font-size: 11px; font-weight: 600;
  cursor: pointer; border: 1.5px solid #e2e8f0; background: white; color: #64748b;
  font-family: inherit; transition: 0.15s;
}
.om-tab:hover { opacity: 0.8; }

.om-legend {
  display: flex; gap: 12px; flex-wrap: wrap;
  background: white; border-radius: 7px;
  box-shadow: 0 1px 5px rgba(0,0,0,0.07);
  padding: 8px 12px;
}
.om-leg-item { display: flex; align-items: center; gap: 5px; font-size: 11px; color: #64748b; }
.om-leg-dot  { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; border: 1.5px solid white; box-shadow: 0 1px 3px rgba(0,0,0,0.2); }

/* Responsive: stack vertically on narrow screens */
@media screen and (max-width: 900px) {
  .orden-terapias-grid { grid-template-columns: 1fr; }
}

/* ── Grid perfil terapeuta + mapa ── */
.emp-body-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  align-items: start;
  margin-bottom: 16px;
}
@media screen and (max-width: 900px) {
  .emp-body-grid { grid-template-columns: 1fr; }
}
