:root {
  /* Marca OmAccess: navy #0B1B2B, azul #2563EB, azul claro #60A5FA.
     Los tokens --green* son ahora el azul de marca (se conservan los nombres para no tocar cientos de usos). */
  --brand: #2563EB;
  --navy: #0B1B2B;
  --green: #2563EB;
  --green-600: #1d4ed8;
  --green-700: #1e40af;
  --green-50: #eff4ff;
  --green-100: #dbe6ff;
  --ink: #1e2a38;
  --ink-2: #545b66;
  --ink-3: #8a919c;
  --line: #e2e5ea;
  --line-2: #eef0f3;
  --bg: #f3f4f6;
  --panel: #ffffff;
  --side: #fafbfc;
  --red: #e0464b;
  --red-50: #fdeeee;
  --amber: #e89a1c;
  --amber-50: #fdf5e6;
  --blue: #2f80ed;
  --blue-50: #eaf2fd;
  --gray: #a2a8b1;
  --radius: 6px;
  --shadow: 0 1px 2px rgba(20, 30, 40, .06), 0 2px 8px rgba(20, 30, 40, .05);
  --shadow-lg: 0 10px 40px rgba(20, 30, 40, .18);
  --font: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; font: 13.5px/1.45 var(--font); color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
svg.i { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
button, input, select { font: inherit; color: inherit; }
a { color: var(--green-600); text-decoration: none; }
.muted { color: var(--ink-3); }
.mono { font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------ cabecera */
.top {
  position: fixed; inset: 0 0 auto 0; height: 54px; z-index: 30;
  display: flex; align-items: stretch; background: var(--panel); border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 3px rgba(0, 0, 0, .04);
}
.brand { display: flex; align-items: center; gap: 10px; padding: 0 18px; width: 232px; flex: none; border-right: 1px solid var(--line-2); }
.brand .logo { width: 30px; height: 30px; border-radius: 8px; background: var(--navy); display: grid; place-items: center; color: #fff; box-shadow: 0 2px 6px rgba(11, 27, 43, .35); }
.brand .logo svg { width: 18px; height: 18px; stroke-width: 2.2; }
.brand b { font-size: 15px; letter-spacing: .2px; }
.brand small { display: block; color: var(--ink-3); font-size: 11px; margin-top: -2px; }
.modules { display: flex; align-items: stretch; margin-left: 6px; overflow-x: auto; scrollbar-width: none; }
.modules a {
  display: flex; align-items: center; gap: 7px; padding: 0 16px; color: var(--ink-2); font-weight: 500; white-space: nowrap;
  border-bottom: 3px solid transparent; border-top: 3px solid transparent; transition: color .15s, background .15s;
}
.modules a:hover { color: var(--green-700); background: var(--green-50); }
.modules a.on { color: var(--green-700); border-bottom-color: var(--green); }
.top .spacer { flex: 1; }
.top .right { display: flex; align-items: center; gap: 14px; padding: 0 16px; }
.conn-pill { display: flex; align-items: center; gap: 8px; padding: 5px 12px; border-radius: 99px; background: var(--line-2); font-size: 12.5px; cursor: pointer; white-space: nowrap; }
.conn-pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--gray); }
.conn-pill.online { background: var(--green-50); color: var(--green-700); }
.conn-pill.online .dot { background: var(--green); box-shadow: 0 0 0 3px rgba(37, 99, 235, .2); }
.conn-pill.error { background: var(--red-50); color: var(--red); }
.conn-pill.error .dot { background: var(--red); }
.conn-pill.connecting .dot { background: var(--amber); animation: pulse 1s infinite; }
.clock { color: var(--ink-2); font-variant-numeric: tabular-nums; display: flex; align-items: center; gap: 6px; }
.usr { display: flex; align-items: center; gap: 8px; }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--green-100); color: var(--green-700); display: grid; place-items: center; font-weight: 700; }
/* ------------------------------------------------------------ enrolamiento de huella */
.enroll { display: grid; grid-template-columns: 1fr 260px; gap: 20px; }
.hands { display: flex; justify-content: center; gap: 18px; padding: 8px 0; }
.hand .fg { fill: #eef1f4; stroke: #c3cad2; stroke-width: 1.5; cursor: pointer; transition: fill .15s, stroke .15s; }
.hand .fg:hover { fill: var(--green-100); stroke: var(--green); }
.hand .fg.sel { fill: var(--blue); stroke: #1e5fb8; }
.hand .fg.reg { fill: #8ccf6d; stroke: var(--green-700); }
.hand .palm { fill: #eef1f4; stroke: #c3cad2; stroke-width: 1.5; }
.hand .lbl { font-size: 9px; fill: var(--ink-3); text-anchor: middle; pointer-events: none; }
.hand .caption { font-size: 11px; fill: var(--ink-2); text-anchor: middle; font-weight: 600; }
.enroll-side { display: flex; flex-direction: column; gap: 12px; }
.scanner { border: 1px solid var(--line); border-radius: 12px; padding: 20px; text-align: center; background: #fafbfc; }
.scanner .fp { width: 86px; height: 86px; margin: 0 auto 10px; color: var(--ink-3); }
.scanner.wait .fp { color: var(--green); animation: fppulse 1.3s ease-in-out infinite; }
.scanner.done .fp { color: var(--green-600); }
.scanner.err .fp { color: var(--red); }
.scanner .st { font-weight: 600; }
.scanner .sub { color: var(--ink-3); font-size: 12.5px; margin-top: 4px; }
.scan-line { position: relative; height: 3px; background: linear-gradient(90deg, transparent, var(--green), transparent); border-radius: 3px; margin: 8px auto; width: 70%; animation: scanmove 1.3s linear infinite; }
@keyframes fppulse { 50% { opacity: .35; } }
@keyframes scanmove { 0% { transform: translateY(-34px); } 100% { transform: translateY(34px); } }
@media (max-width: 680px) { .enroll { grid-template-columns: 1fr; } }

/* ------------------------------------------------------------ malla de turnos */
.malla-wrap { overflow: auto; max-height: calc(100vh - 330px); user-select: none; }
table.malla { border-collapse: separate; border-spacing: 0; font-size: 12px; }
.malla th, .malla td { border-right: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2); text-align: center; height: 28px; padding: 0; }
.malla thead th { position: sticky; top: 0; z-index: 3; background: #f5f6f8; font-weight: 600; color: var(--ink-2); }
.malla thead tr:nth-child(2) th { top: 28px; }
.malla .nm { position: sticky; left: 0; z-index: 2; background: #fff; text-align: left; padding: 0 10px; min-width: 190px; max-width: 220px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 500; }
.malla .rl { position: sticky; left: 190px; z-index: 2; background: #fff; min-width: 64px; color: var(--ink-3); font-size: 11px; }
.malla thead .nm, .malla thead .rl { z-index: 4; background: #f5f6f8; }
.malla .day { min-width: 34px; width: 34px; }
.malla th.we, .malla th.hol { color: var(--red); }
.malla th.hol { background: var(--red-50); }
.malla td.c { cursor: cell; font-weight: 600; position: relative; color: #1d2a1f; }
.malla td.c.we { background: #fafafa; }
.malla td.c.sel { outline: 2px solid var(--blue); outline-offset: -2px; }
.malla td.c.remote { color: var(--red); text-decoration: underline; }
.malla td.c.noted::after { content: ""; position: absolute; top: 0; right: 0; border-top: 7px solid var(--amber); border-left: 7px solid transparent; }
.malla .sum { background: #fafbfc; min-width: 30px; font-variant-numeric: tabular-nums; color: var(--ink-2); }
.malla .sum.tot { font-weight: 700; color: var(--ink); min-width: 48px; }
.palette { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 14px; border-bottom: 1px solid var(--line-2); align-items: center; }
.palette .pc { border: 1px solid rgba(0,0,0,.15); border-radius: 5px; min-width: 38px; height: 30px; padding: 0 8px; font-weight: 700; cursor: pointer; font-size: 12.5px; }
.palette .pc:hover { box-shadow: 0 0 0 2px var(--green); }
.palette .lbl { color: var(--ink-3); font-size: 12px; margin: 0 4px 0 8px; }
.menu-pop { position: absolute; top: calc(100% + 10px); right: 0; z-index: 40; min-width: 230px; background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow-lg); padding: 6px; cursor: default; animation: pop .12s ease-out; }
.menu-pop .menu-head { padding: 8px 10px 10px; border-bottom: 1px solid var(--line-2); margin-bottom: 4px; }
.menu-pop .menu-head b { display: block; }
.menu-pop .menu-head span { color: var(--ink-3); font-size: 12px; }
.menu-pop button { display: flex; align-items: center; gap: 10px; width: 100%; border: 0; background: transparent; padding: 8px 10px; border-radius: 5px; cursor: pointer; text-align: left; color: var(--ink-2); }
.menu-pop button:hover { background: var(--green-50); color: var(--green-700); }
.menu-pop button.danger:hover { background: var(--red-50); color: var(--red); }
.menu-pop .menu-sep { height: 1px; background: var(--line-2); margin: 4px 0; }
.side .version { padding: 14px 20px 4px; color: var(--ink-3); font-size: 11.5px; }
.icon-btn { border: 0; background: transparent; width: 32px; height: 32px; border-radius: 6px; display: grid; place-items: center; color: var(--ink-2); cursor: pointer; }
.icon-btn:hover { background: var(--line-2); color: var(--ink); }
.menu-toggle { display: none; }

/* ------------------------------------------------------------ menú lateral */
.side {
  position: fixed; top: 54px; bottom: 0; left: 0; width: 232px; z-index: 20; overflow-y: auto;
  background: var(--side); border-right: 1px solid var(--line); padding: 14px 0;
}
.side h6 { margin: 6px 20px 8px; font-size: 11px; text-transform: uppercase; letter-spacing: .8px; color: var(--ink-3); font-weight: 600; }
.side a { display: flex; align-items: center; gap: 10px; padding: 9px 20px; color: var(--ink-2); border-left: 3px solid transparent; }
.side a:hover { background: #f0f2f4; color: var(--ink); }
.side a.on { background: var(--green-50); color: var(--green-700); border-left-color: var(--green); font-weight: 600; }
.side a .badge { margin-left: auto; }
.side .sep { height: 1px; background: var(--line); margin: 12px 20px; }
/* módulos contraíbles: solo el módulo abierto muestra sus páginas */
.side .side-mod { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 16px 10px 17px; border: 0; border-left: 3px solid transparent;
  background: transparent; color: var(--ink); font: inherit; font-weight: 600; text-align: left; cursor: pointer; }
.side .side-mod:hover { background: #f0f2f4; }
.side .side-mod > span:first-of-type { flex: 1; }
.side .side-mod .badge { margin-left: 0; }
.side .side-mod .chev { display: grid; place-items: center; color: var(--ink-3); transition: transform .18s; }
.side .side-mod .chev svg { width: 14px; height: 14px; }
.side .side-grp.open > .side-mod .chev { transform: rotate(90deg); }
.side .side-grp.cur > .side-mod, .side a.side-mod.on { color: var(--green-700); }
.side a.side-mod.single.on { background: var(--green-50); border-left-color: var(--green); }
.side .side-items { display: none; padding-bottom: 6px; }
.side .side-grp.open > .side-items { display: block; }
.side .side-items a { padding-left: 30px; font-size: 13.5px; }

/* ------------------------------------------------------------ contenido */
main { margin: 54px 0 0 232px; padding: 18px 22px 30px; min-height: calc(100vh - 54px); }
.crumbs { display: flex; align-items: center; gap: 6px; color: var(--ink-3); font-size: 12.5px; margin-bottom: 4px; }
.crumbs svg { width: 12px; height: 12px; }
.page-title { display: flex; align-items: center; gap: 12px; margin: 0 0 14px; }
.page-title h1 { font-size: 19px; font-weight: 600; margin: 0; }
.page-title .sub { color: var(--ink-3); }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.panel-h { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line-2); }
.panel-h h3 { margin: 0; font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.panel-h h3 svg { color: var(--green-600); }
.panel-h .tools { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.panel-b { padding: 16px; }

/* barra de herramientas estilo ZK: icono + texto */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; padding: 8px 10px; border-bottom: 1px solid var(--line-2); background: #fcfcfd; border-radius: var(--radius) var(--radius) 0 0; }
.tb { display: inline-flex; align-items: center; gap: 6px; padding: 6px 11px; border: 0; background: transparent; border-radius: 5px; cursor: pointer; color: var(--ink-2); white-space: nowrap; }
.tb svg { color: var(--green-600); }
.tb:hover:not(:disabled) { background: var(--green-50); color: var(--green-700); }
.tb.danger svg { color: var(--red); }
.tb.danger:hover:not(:disabled) { background: var(--red-50); color: var(--red); }
.tb:disabled { opacity: .45; cursor: default; }
.tb-sep { width: 1px; height: 20px; background: var(--line); margin: 0 6px; }

.filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 14px; padding: 12px 14px; border-bottom: 1px solid var(--line-2); }
.filters label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--ink-3); }
.filters .grow { flex: 1; min-width: 180px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { border: 1px solid var(--line); background: #fff; padding: 5px 11px; border-radius: 99px; cursor: pointer; font-size: 12.5px; color: var(--ink-2); }
.chip:hover { border-color: var(--green); color: var(--green-700); }
.chip.on { background: var(--green); border-color: var(--green); color: #fff; }

/* ------------------------------------------------------------ formularios */
.input, select.input {
  height: 32px; padding: 0 10px; border: 1px solid #d5d9df; border-radius: 5px; background: #fff; outline: none; min-width: 0;
  transition: border-color .15s, box-shadow .15s;
}
.input:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(37, 99, 235, .16); }
.input:disabled { background: var(--line-2); color: var(--ink-3); }
.search { position: relative; display: flex; align-items: center; }
.search svg { position: absolute; left: 9px; color: var(--ink-3); }
.search .input { padding-left: 30px; width: 100%; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 32px; padding: 0 14px;
  border: 1px solid #d5d9df; border-radius: 5px; background: #fff; cursor: pointer; font-weight: 500; white-space: nowrap;
}
.btn:hover:not(:disabled) { border-color: var(--green); color: var(--green-700); }
.btn.primary { background: var(--green); border-color: var(--green); color: #fff; }
.btn.primary:hover:not(:disabled) { background: var(--green-600); border-color: var(--green-600); color: #fff; }
.btn.danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn.danger:hover:not(:disabled) { filter: brightness(.95); color: #fff; }
.btn:disabled { opacity: .55; cursor: default; }
.btn.sm { height: 28px; padding: 0 10px; font-size: 12.5px; }
.btn.busy { pointer-events: none; opacity: .8; }
.btn.busy::before { content: ""; width: 12px; height: 12px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px; }
.form-grid .full { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field > span { font-size: 12.5px; color: var(--ink-2); font-weight: 500; }
.field > span em { color: var(--red); font-style: normal; }
.field small { color: var(--ink-3); font-size: 11.5px; }
.section-t { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; font-weight: 600; color: var(--ink); padding-bottom: 6px; border-bottom: 1px dashed var(--line); margin-top: 4px; }
.section-t svg { color: var(--green-600); }

.switch { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; user-select: none; }
.switch input { display: none; }
.switch i { width: 34px; height: 19px; border-radius: 99px; background: #cfd4da; position: relative; transition: background .2s; flex: none; }
.switch i::after { content: ""; position: absolute; top: 2px; left: 2px; width: 15px; height: 15px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: 0 1px 2px rgba(0, 0, 0, .2); }
.switch input:checked + i { background: var(--green); }
.switch input:checked + i::after { transform: translateX(15px); }

.door-pick { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.door-pick label { border: 1px solid var(--line); border-radius: 6px; padding: 10px; display: flex; flex-direction: column; align-items: center; gap: 6px; cursor: pointer; text-align: center; font-size: 12.5px; transition: all .15s; }
.door-pick label svg { width: 22px; height: 22px; color: var(--ink-3); }
.door-pick input { display: none; }
.door-pick label:has(input:checked) { border-color: var(--green); background: var(--green-50); color: var(--green-700); }
.door-pick label:has(input:checked) svg { color: var(--green-600); }

/* ------------------------------------------------------------ tablas */
.table-wrap { overflow: auto; }
table.grid { width: 100%; border-collapse: collapse; }
.grid th { position: sticky; top: 0; z-index: 1; background: #f5f6f8; color: var(--ink-2); font-weight: 600; text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; font-size: 12.5px; }
.grid th.sort { cursor: pointer; user-select: none; }
.grid th.sort:hover { color: var(--green-700); }
.grid th .arrow { font-size: 10px; color: var(--green-600); margin-left: 3px; }
.grid td { padding: 8px 12px; border-bottom: 1px solid var(--line-2); white-space: nowrap; }
.grid tbody tr:hover td { background: #f7fbf4; }
.grid tr.sel td { background: var(--green-50) !important; }
.grid .ck { width: 34px; padding-right: 0; }
.grid input[type=checkbox] { accent-color: var(--green); width: 15px; height: 15px; cursor: pointer; vertical-align: middle; }
.grid tr.lv-warning td.ev { color: var(--amber); font-weight: 500; }
.grid tr.lv-alarm td { background: var(--red-50); }
.grid tr.lv-alarm td.ev { color: var(--red); font-weight: 600; }
.grid tr.lv-normal td.ev { color: var(--green-700); }
.grid tr.fresh td { animation: flash 1.6s ease-out; }
.empty { padding: 50px 20px; text-align: center; color: var(--ink-3); }
.empty svg { width: 40px; height: 40px; stroke-width: 1.2; color: #c8cdd3; display: block; margin: 0 auto 10px; }
.pager { display: flex; align-items: center; gap: 10px; padding: 10px 14px; color: var(--ink-2); font-size: 12.5px; border-top: 1px solid var(--line-2); flex-wrap: wrap; }
.pager .pages { margin-left: auto; display: flex; gap: 4px; align-items: center; }
.pager button { min-width: 28px; height: 28px; border: 1px solid var(--line); background: #fff; border-radius: 4px; cursor: pointer; }
.pager button.on { background: var(--green); border-color: var(--green); color: #fff; }
.pager button:disabled { opacity: .4; cursor: default; }

.tag { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: 99px; font-size: 11.5px; font-weight: 500; background: var(--line-2); color: var(--ink-2); }
.tag.green { background: var(--green-100); color: var(--green-700); }
.tag.red { background: var(--red-50); color: var(--red); }
.tag.amber { background: var(--amber-50); color: #b5750c; }
.tag.blue { background: var(--blue-50); color: var(--blue); }
.tag svg { width: 12px; height: 12px; }
.badge { background: var(--red); color: #fff; border-radius: 99px; font-size: 11px; padding: 0 6px; font-weight: 600; min-width: 18px; text-align: center; }
.cred { display: inline-flex; gap: 6px; color: var(--ink-3); }
.cred svg { width: 15px; height: 15px; }
.cred .on { color: var(--green-600); }

/* ------------------------------------------------------------ personas: árbol de departamentos */
.split { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 14px; align-items: start; }
.tree a { display: flex; align-items: center; gap: 8px; padding: 8px 14px; color: var(--ink-2); border-left: 3px solid transparent; }
.tree a:hover { background: var(--line-2); }
.tree a.on { color: var(--green-700); background: var(--green-50); border-left-color: var(--green); font-weight: 600; }
.tree a .n { margin-left: auto; color: var(--ink-3); font-size: 12px; }
.tree a svg { color: var(--ink-3); }

/* ------------------------------------------------------------ inicio */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 14px; }
.kpi { padding: 16px 18px; display: flex; gap: 14px; align-items: center; }
.kpi .ico { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; flex: none; }
.kpi .ico svg { width: 23px; height: 23px; }
.kpi .v { font-size: 26px; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.kpi .l { color: var(--ink-3); font-size: 12.5px; }
.ico.g { background: var(--green-50); color: var(--green-600); }
.ico.b { background: var(--blue-50); color: var(--blue); }
.ico.a { background: var(--amber-50); color: var(--amber); }
.ico.r { background: var(--red-50); color: var(--red); }
.dash { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 14px; }
.dash .col { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.chart { padding: 16px 16px 8px; }
.chart svg { width: 100%; height: 210px; display: block; }
.legend { display: flex; gap: 16px; font-size: 12px; color: var(--ink-2); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }
.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: flex; gap: 12px; padding: 10px 16px; border-bottom: 1px solid var(--line-2); align-items: center; }
.feed li:last-child { border-bottom: 0; }
.feed .fi { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; flex: none; }
.feed .fi svg { width: 16px; height: 16px; }
.feed .t { flex: 1; min-width: 0; }
.feed .t b { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feed .t span { color: var(--ink-3); font-size: 12px; }
.feed time { color: var(--ink-3); font-size: 12px; white-space: nowrap; }
.info-list { display: grid; grid-template-columns: auto 1fr; gap: 9px 16px; margin: 0; }
.info-list dt { color: var(--ink-3); }
.info-list dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }

/* ------------------------------------------------------------ puertas / monitoreo */
.doors { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; padding: 16px; }
.door {
  position: relative; border: 1px solid var(--line); border-radius: 10px; padding: 16px 14px 12px; text-align: center; background: #fff;
  transition: box-shadow .2s, border-color .2s; cursor: pointer;
}
.door:hover { box-shadow: var(--shadow); }
.doors.compact { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; padding: 12px; }
.doors.compact .door { padding: 12px 8px 10px; }
.doors.compact .door-art { width: 56px; height: 66px; }
.doors.compact .acts button { font-size: 11.5px; gap: 2px; }
.doors.compact .acts svg { display: none; }
.grid td.wrap { white-space: normal; min-width: 160px; }
.grid td.wrap .tag { margin: 1px 0; }
.door.sel { border-color: var(--green); box-shadow: 0 0 0 3px rgba(37, 99, 235, .18); }
.door .pick { position: absolute; top: 10px; left: 10px; accent-color: var(--green); }
.door .num { position: absolute; top: 9px; right: 11px; font-size: 11px; color: var(--ink-3); font-weight: 600; }
.door-art { width: 74px; height: 86px; margin: 2px auto 8px; display: block; }
.door-art .frame { fill: #eef0f2; stroke: #b7bec6; stroke-width: 2; }
.door-art .leaf { stroke-width: 2; transition: transform .45s ease, fill .3s; transform-origin: 18px 50%; }
.door-art .knob { transition: fill .3s; }
.door.closed .leaf { fill: #8ccf6d; stroke: var(--green-700); }
.door.closed .knob { fill: var(--green-700); }
.door.open .leaf { fill: #9cc6f5; stroke: #2a6bc2; transform: perspective(120px) rotateY(-55deg); }
.door.open .knob { fill: #2a6bc2; }
.door.alarm .leaf { fill: #f39a9c; stroke: #b42328; }
.door.alarm .knob { fill: #b42328; }
.door.alarm { border-color: #f3b7b9; animation: alarm 1s infinite; }
.door.offline .leaf { fill: #d5d9de; stroke: #9aa1aa; }
.door.offline .knob { fill: #9aa1aa; }
.door.nosensor .leaf { fill: #c6e5b6; stroke: var(--green-600); }
.door.nosensor .knob { fill: var(--green-600); }
.door h4 { margin: 0; font-size: 14px; }
.door .st { font-size: 12px; margin: 3px 0 10px; font-weight: 500; }
.door.closed .st, .door.nosensor .st { color: var(--green-700); }
.door.open .st { color: #2a6bc2; }
.door.alarm .st { color: var(--red); }
.door.offline .st { color: var(--ink-3); }
.door .acts { display: flex; gap: 4px; justify-content: center; }
.door .acts button { flex: 1; height: 28px; border: 1px solid var(--line); background: #fff; border-radius: 5px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 4px; font-size: 12px; color: var(--ink-2); }
.door .acts button:hover { border-color: var(--green); color: var(--green-700); }
.door .acts svg { width: 14px; height: 14px; }
.legend-doors { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12px; color: var(--ink-2); }
.legend-doors span::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; background: var(--c); }
.counters { display: flex; gap: 8px; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); animation: pulse 1.2s infinite; display: inline-block; }
.live-dot.paused { background: var(--gray); animation: none; }
.monitor-events { max-height: 430px; }

/* ------------------------------------------------------------ dispositivo */
.dev-card { display: grid; grid-template-columns: auto 1fr; gap: 22px; align-items: center; padding: 18px; }
.dev-art { width: 96px; height: 120px; border-radius: 10px; background: linear-gradient(160deg, #3d434c, #22262b); position: relative; box-shadow: inset 0 0 0 2px #4a515b, var(--shadow); }
.dev-art::before { content: ""; position: absolute; left: 14px; right: 14px; top: 16px; height: 34px; border-radius: 4px; background: repeating-linear-gradient(90deg, #2a2f35 0 6px, #343a41 6px 9px); }
.dev-art::after { content: "inBio"; position: absolute; bottom: 12px; left: 0; right: 0; text-align: center; color: #cfd4da; font-size: 11px; letter-spacing: 1px; }
.dev-art .led { position: absolute; top: 62px; width: 7px; height: 7px; border-radius: 50%; background: #5c636c; }
.dev-art .led.l1 { left: 18px; } .dev-art .led.l2 { left: 32px; } .dev-art .led.l3 { left: 46px; }
.dev-art.on .led.l1 { background: #6fe05b; box-shadow: 0 0 6px #6fe05b; }
.dev-art.on .led.l2 { background: #ffb43a; animation: pulse 1s infinite; }
.dev-art.err .led.l1 { background: #ff5a5f; box-shadow: 0 0 6px #ff5a5f; }
.dev-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px 20px; }
.dev-grid div span { display: block; color: var(--ink-3); font-size: 12px; }
.dev-grid div b { font-weight: 600; overflow-wrap: anywhere; }
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 10px 14px; border-radius: 6px; font-size: 13px; }
.alert svg { margin-top: 2px; }
.alert.red { background: var(--red-50); color: #a52a2e; }
.alert.amber { background: var(--amber-50); color: #8f5c08; }
.alert.green { background: var(--green-50); color: var(--green-700); }
.alert.blue { background: var(--blue-50); color: #1e5fb8; }
.ops { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; padding: 16px; }
.op { border: 1px solid var(--line); border-radius: 8px; padding: 14px; display: flex; gap: 12px; align-items: flex-start; background: #fff; cursor: pointer; text-align: left; transition: all .15s; }
.op:hover:not(:disabled) { border-color: var(--green); box-shadow: var(--shadow); }
.op:disabled { opacity: .5; cursor: default; }
.op .ico { width: 38px; height: 38px; border-radius: 9px; display: grid; place-items: center; flex: none; }
.op .ico svg { width: 19px; height: 19px; }
.op b { display: block; margin-bottom: 2px; }
.op span { color: var(--ink-3); font-size: 12px; }

/* ------------------------------------------------------------ modal, toasts */
.backdrop { position: fixed; inset: 0; background: rgba(25, 30, 36, .45); z-index: 50; display: grid; place-items: center; padding: 16px; animation: fade .15s; }
.modal { background: #fff; border-radius: 8px; box-shadow: var(--shadow-lg); width: 100%; max-width: 640px; max-height: calc(100vh - 32px); display: flex; flex-direction: column; animation: pop .18s ease-out; }
.modal.small { max-width: 420px; }
.modal-h { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); background: #fafbfc; border-radius: 8px 8px 0 0; }
.modal-h h3 { margin: 0; font-size: 15px; display: flex; align-items: center; gap: 8px; }
.modal-h h3 svg { color: var(--green-600); width: 18px; height: 18px; }
.modal-h .icon-btn { margin-left: auto; }
.modal-b { padding: 18px; overflow-y: auto; }
.modal-f { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--line); background: #fafbfc; border-radius: 0 0 8px 8px; }
#toasts { position: fixed; right: 18px; bottom: 18px; z-index: 60; display: flex; flex-direction: column; gap: 8px; }
.toast { min-width: 260px; max-width: 380px; background: #fff; border-radius: 7px; box-shadow: var(--shadow-lg); padding: 11px 14px; display: flex; gap: 10px; align-items: flex-start; border-left: 4px solid var(--green); animation: slide .2s ease-out; }
.toast.err { border-left-color: var(--red); }
.toast.err svg { color: var(--red); }
.toast svg { color: var(--green-600); margin-top: 1px; }

/* ------------------------------------------------------------ login */
.login { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); background: #fff; }
.login .art {
  background: radial-gradient(circle at 20% 15%, rgba(255, 255, 255, .16), transparent 45%), linear-gradient(150deg, #1d4ed8 0%, #163a9e 55%, #0B1B2B 100%);
  color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden;
}
.login .art h2 { font-size: 30px; margin: 0 0 10px; font-weight: 700; max-width: 420px; line-height: 1.2; }
.login .art p { opacity: .9; max-width: 420px; margin: 0; font-size: 14.5px; }
.login .art .brand-l { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 16px; }
.login .art .brand-l .logo { width: 34px; height: 34px; border-radius: 9px; background: rgba(255, 255, 255, .2); display: grid; place-items: center; }
.login .art svg.big { position: absolute; right: -40px; bottom: -30px; width: 380px; height: 380px; opacity: .14; stroke: #fff; stroke-width: .7; fill: none; }
.login .feat { display: flex; gap: 22px; flex-wrap: wrap; font-size: 13px; opacity: .95; }
.login .feat span { display: flex; align-items: center; gap: 7px; }
.login .form { display: grid; place-items: center; padding: 32px; }
.login form { width: 100%; max-width: 340px; display: flex; flex-direction: column; gap: 16px; }
.login form h1 { margin: 0; font-size: 22px; }
.login form .input { height: 40px; }
.login form .btn { height: 40px; }
.login .err-msg { color: var(--red); font-size: 13px; min-height: 18px; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 50% { opacity: .35; } }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }
@keyframes slide { from { opacity: 0; transform: translateX(20px); } }
@keyframes flash { from { background: #fff7d1; } }
@keyframes alarm { 50% { box-shadow: 0 0 0 4px rgba(224, 70, 75, .25); } }

/* ------------------------------------------------------------ pantallas angostas */
@media (max-width: 1100px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash { grid-template-columns: minmax(0, 1fr); }
  .clock { display: none; }
}
@media (max-width: 860px) {
  .menu-toggle { display: grid; margin-left: 6px; align-self: center; }
  .brand { width: auto; border-right: 0; padding: 0 10px; }
  .brand small { display: none; }
  .modules { display: none; }
  .side { transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow-lg); }
  body.side-open .side { transform: none; }
  main { margin-left: 0; padding: 14px 16px 24px; }
  .split { grid-template-columns: minmax(0, 1fr); }
  .login { grid-template-columns: minmax(0, 1fr); }
  .login .art { display: none; }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .door-pick { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .conn-pill .txt { display: none; }
  .usr .name { display: none; }
}
@media (max-width: 520px) {
  .doors { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; padding: 12px; }
  .door { padding: 12px 8px 10px; }
  .door-art { width: 56px; height: 66px; }
  .door .acts { flex-wrap: wrap; }
  .door .acts svg { display: none; }
  .legend-doors { margin-left: 0 !important; padding: 4px 8px; }
  .brand b { font-size: 14px; }
  .kpis { grid-template-columns: minmax(0, 1fr); }
  .dev-card { grid-template-columns: minmax(0, 1fr); }
}

/* ------------------------------------------------------------ permisos y vacaciones */
[hidden] { display: none !important; }
.nov-dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; border: 1px solid rgba(0, 0, 0, .15); vertical-align: -1px; }
textarea.input { font: inherit; height: auto; padding-top: 7px; padding-bottom: 7px; resize: vertical; }
.icon-btn.just-btn { display: inline-grid; width: 26px; height: 26px; vertical-align: middle; color: var(--green-600); }
.modal.large { max-width: 980px; width: 96vw; }
.vac-sum { display: flex; flex-wrap: wrap; gap: 10px; }
.vac-k { border: 1px solid var(--line); border-radius: 8px; padding: 8px 14px; min-width: 110px; background: #fff; }
.vac-k small { display: block; color: var(--ink-3); font-size: 11.5px; }
.vac-k b { font-size: 18px; font-variant-numeric: tabular-nums; }
.vac-k.pos b { color: var(--green-700); }
.vac-k.neg b, b.neg { color: var(--red); }
.modal.large .table-wrap { overflow: auto; }
tr.inactive td { color: var(--ink-3); background: #fafafa; }
/* configuración en tarjetas */
.cfg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.cfg-card { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; text-align: left; padding: 16px; border: 1px solid var(--line); border-radius: 10px;
  background: #fff; cursor: pointer; font: inherit; color: var(--ink); min-height: 150px; }
.cfg-card:hover { border-color: var(--green); box-shadow: 0 2px 8px rgba(0,0,0,.06); }
.cfg-card.on { border-color: var(--green); background: var(--green-50); }
.cfg-ic { width: 38px; height: 38px; border-radius: 9px; background: var(--green-50); display: grid; place-items: center; color: var(--green-700); }
.cfg-ic svg.i { width: 20px; height: 20px; }
.cfg-t { display: flex; flex-direction: column; gap: 3px; flex: 1; }
.cfg-t small { color: var(--ink-3); font-size: 12.5px; line-height: 1.35; }
.sso-sep { display: flex; align-items: center; gap: 10px; color: var(--ink-3); font-size: 12px; margin: 4px 0; }
.sso-sep::before, .sso-sep::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.btn.sso { width: 100%; justify-content: center; gap: 10px; text-decoration: none; margin-top: 8px; }
.vis-ph { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; background: var(--line-2); display: inline-grid; place-items: center; color: var(--ink-3); flex: none; }
a.kpi.link { color: inherit; text-decoration: none; cursor: pointer; transition: border-color .15s, box-shadow .15s; }
a.kpi.link:hover { border-color: var(--green); box-shadow: 0 2px 10px rgba(37, 99, 235, .12); }
/* fichas superpuestas, migas y pestañas */
.modal.xl { max-width: 1120px; width: 94vw; max-height: calc(100vh - 48px); }
.modal.xl .modal-b { background: var(--bg, #f3f4f6); }
.sub-modal #cfgDetail > .panel + .panel { margin-top: 14px; }
.crumbs a { color: var(--ink-3); text-decoration: none; }
.crumbs a:hover { color: var(--green-700); text-decoration: underline; }
.crumbs span { color: var(--ink-2); }
.tabs-bar { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 4px 0 14px; overflow-x: auto; }
.tabs-bar .tab { padding: 9px 14px; color: var(--ink-2); text-decoration: none; border-bottom: 2px solid transparent; white-space: nowrap; font-weight: 500; }
.tabs-bar .tab:hover { color: var(--green-700); }
.tabs-bar .tab.on { color: var(--green-700); border-bottom-color: var(--green); }
.modal-h h3 a.sub-crumb { color: var(--ink-3); text-decoration: none; font-weight: 500; }
.modal-h h3 a.sub-crumb:hover { color: var(--green-700); text-decoration: underline; }
.modal-h h3 svg.i + span, .modal-h h3 > svg.i:nth-of-type(2) { color: var(--ink-3); }

/* 1.22.1 — doble clic para abrir y barra de herramientas fija al desplazarse */
.dbl-edit tbody tr { cursor: pointer; }
main .panel > .toolbar { position: sticky; top: 54px; z-index: 6; }

/* 1.22.2 — clic afuera de una ventana: no cierra, solo la resalta */
@keyframes nudge { 0%,100% { transform: scale(1); } 40% { transform: scale(1.015); } }
.modal.nudge { animation: nudge .18s ease; box-shadow: 0 0 0 3px rgba(37,99,235,.35), 0 20px 50px rgba(0,0,0,.25); }

/* 1.22.3 — entrada de inactivos al final del árbol de departamentos */
.tree a.tree-inact { margin-top: 8px; border-top: 1px dashed var(--line); color: var(--muted, #6b7280); }

/* 1.22.4 — indicador compacto de equipos (controladora + relojes) con detalle al pasar el mouse */
.conn-pill { position: relative; gap: 6px; padding: 6px 10px; }
.conn-pill > svg { width: 16px; height: 16px; }
.conn-pill .txt { display: none; }
.conn-pill.online { background: #eaf1fe; color: var(--brand, #2563eb); }
.conn-pill.online > .dot { background: var(--brand, #2563eb); box-shadow: 0 0 0 3px rgba(37,99,235,.18); }
.conn-pill.warn { background: #fff6e5; color: #b45309; }
.conn-pill.warn > .dot { background: var(--amber, #f59e0b); animation: pulse 1.4s infinite; }
.conn-pill.error { background: var(--red-50); color: var(--red); }
.conn-pill.error > .dot { background: var(--red); animation: pulse 1.4s infinite; }
.conn-pop { display: none; position: absolute; top: calc(100% + 8px); right: 0; z-index: 40; width: 320px; cursor: default;
  background: #fff; color: var(--text, #1f2937); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 12px 30px rgba(0,0,0,.14); padding: 6px 0; white-space: normal; }
.conn-pill:hover .conn-pop, .conn-pill:focus-within .conn-pop { display: block; }
.conn-pop::before { content: ""; position: absolute; top: -10px; left: 0; right: 0; height: 10px; }
.cp-h { font-size: 11px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted, #6b7280); padding: 4px 14px 6px; }
.cp-row { display: grid; grid-template-columns: 10px 1fr auto; gap: 10px; align-items: center; padding: 7px 14px; }
.cp-row b { display: block; font-size: 13px; font-weight: 600; }
.cp-row small { display: block; font-size: 11.5px; color: var(--muted, #6b7280); }
.cp-row .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--gray); }
.cp-row .dot.online { background: var(--brand, #2563eb); } .cp-row .dot.warn { background: var(--amber, #f59e0b); } .cp-row .dot.error { background: var(--red); }
.cp-st { font-size: 11.5px; font-weight: 600; } .cp-st.online { color: var(--brand, #2563eb); } .cp-st.warn { color: #b45309; } .cp-st.error { color: var(--red); }
.cp-f { border-top: 1px solid var(--line-2); margin-top: 4px; padding: 7px 14px 3px; font-size: 11.5px; color: var(--muted, #6b7280); }

/* 1.23.0 — listas para marcar personas */
.pick-row { display: flex; gap: 8px; align-items: center; padding: 6px 10px; border-bottom: 1px solid var(--line-2); cursor: pointer; }
.pick-row:last-child { border-bottom: 0; }
.pick-row input { accent-color: var(--brand); }
.pick-row[hidden] { display: none; }
.input.sm { height: 30px; padding: 2px 8px; font-size: 12.5px; width: auto; }

/* 1.24.0 — horarios de acceso, configuración de puertas, presentes */
.wk { display: grid; gap: 3px; min-width: 260px; }
.wk.compact { gap: 2px; min-width: 180px; }
.wk-row { display: grid; grid-template-columns: 30px 1fr; align-items: center; gap: 6px; font-size: 11px; color: var(--ink-3); }
.wk.compact .wk-row { grid-template-columns: 24px 1fr; font-size: 10px; }
.wk-bar { position: relative; height: 10px; background: var(--line-2); border-radius: 3px; overflow: hidden; }
.wk.compact .wk-bar { height: 6px; }
.wk-bar i { position: absolute; top: 0; bottom: 0; background: var(--brand); border-radius: 2px; }
.wk-axis > div { display: flex; justify-content: space-between; font-size: 10px; }
.wk-axis b { font-weight: 500; }
.sch-days { display: grid; gap: 6px; }
.sch-day { display: grid; grid-template-columns: 150px 1fr; gap: 10px; align-items: center; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.sch-day.off { background: var(--side); }
.sch-ranges { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.sch-range { display: inline-flex; align-items: center; gap: 6px; padding: 3px 4px 3px 6px; background: var(--green-50); border-radius: 8px; }
.sch-range .input { width: 132px; height: 32px; }
.sch-range .icon-btn { width: 26px; height: 26px; }
.num-unit { display: flex; align-items: center; gap: 8px; }
.num-unit .input { width: 110px; }
.num-unit span { color: var(--ink-2); font-size: 13px; }
.sw-list { display: grid; gap: 8px; }
.kpis + .panel { margin-top: 14px; }
@media (max-width: 720px) { .sch-day { grid-template-columns: 1fr; } }

/* 1.24.1 — celdas de la malla con novedad aprobada (vacaciones, permisos): bloqueadas */
table.malla td.c.locked { cursor: not-allowed; position: relative; }
table.malla td.c.locked::after { content: ""; position: absolute; right: 2px; top: 2px; width: 6px; height: 6px; border-radius: 50%; background: rgba(11, 27, 43, .45); }

/* 1.24.2 — panel principal en cuadrícula: las tarjetas de cada fila empiezan y terminan a la misma altura */
.dash { align-items: stretch; }
.dash > .panel { display: flex; flex-direction: column; min-width: 0; margin: 0; }
.dash > .panel > :last-child { flex: 1; }
.dash-feed { contain: size; min-height: 300px; }          /* su alto lo pone la gráfica de la misma fila */
.dash-feed .feed { min-height: 0; overflow: auto; }
.dash > .panel > .panel-h { min-height: 53px; }

/* 1.24.3 — enrolar: elegir el equipo y el lector */
.en-dev { margin-top: 14px; border-top: 1px solid var(--line-2); padding-top: 12px; display: grid; gap: 8px; }
.en-dev-t { display: flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.en-dev-t svg { width: 15px; height: 15px; }
.en-devs { display: grid; gap: 6px; }
.en-devc { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; background: #fff; }
.en-devc svg { width: 18px; height: 18px; color: var(--ink-3); flex: none; }
.en-devc b { display: block; font-size: 13px; }
.en-devc small { display: block; font-size: 11.5px; color: var(--ink-3); }
.en-devc.on { border-color: var(--brand); background: var(--blue-50, #eef3fe); box-shadow: 0 0 0 1px var(--brand) inset; }
.en-devc.on svg { color: var(--brand); }
.en-devc.off { opacity: .6; }
#lfVac .chip svg { width: 14px; height: 14px; margin-right: 6px; vertical-align: -2px; }

/* ---------- Roles y permisos ---------- */
.roles-wrap { display: grid; grid-template-columns: 250px 1fr; gap: 14px; align-items: start; }
.roles-list #rList { padding: 6px; display: flex; flex-direction: column; gap: 2px; }
.role-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 0; background: none; border-radius: 8px; text-align: left; cursor: pointer; font: inherit; color: var(--ink); }
.role-item:hover { background: var(--line-2); }
.role-item.on { background: var(--green-100); }
.ri-ic { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: var(--line-2); color: var(--ink-2); flex: none; }
.ri-ic svg { width: 16px; height: 16px; }
.ri-ic.admin { background: var(--green-100); color: var(--green-700); }
.ri-ic.supervisor { background: var(--amber-50); color: #b5750c; }
.ri-ic.empleado { background: var(--blue-50); color: var(--blue); }
.ri-t { display: flex; flex-direction: column; min-width: 0; }
.ri-t small { color: var(--ink-3, #8a94a6); font-size: 11.5px; }
.perm-head { display: flex; justify-content: space-between; font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-3, #8a94a6); margin: 14px 0 4px; padding: 0 4px; }
.perm-g { font-weight: 600; font-size: 12.5px; color: var(--green-700); margin: 12px 0 2px; padding: 0 4px; }
.perm-row { display: flex; align-items: center; gap: 14px; padding: 8px 4px; border-top: 1px solid var(--line-2); }
.perm-t { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.perm-t small { color: var(--ink-3, #8a94a6); font-size: 12px; }
.perm-row:not(.has) .perm-t b { color: var(--ink-2); font-weight: 500; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; flex: none; }
.seg button { border: 0; background: #fff; padding: 5px 12px; font: inherit; font-size: 12.5px; cursor: pointer; color: var(--ink-2); min-width: 64px; }
.seg button + button { border-left: 1px solid var(--line); }
.seg button:hover:not(:disabled) { background: var(--line-2); }
.seg button.on.l-no { background: var(--line-2); color: var(--ink); font-weight: 600; }
.seg button.on.l-ver { background: var(--blue-50); color: var(--blue); font-weight: 600; }
.seg button.on.l-editar { background: var(--green); color: #fff; font-weight: 600; }
.seg.ro button { cursor: default; }
.perm-foot { display: flex; align-items: center; gap: 12px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); flex-wrap: wrap; }
@media (max-width: 860px) { .roles-wrap { grid-template-columns: 1fr; } .perm-row { flex-wrap: wrap; } }

/* ---------- Mi malla de turnos ---------- */
.mm-cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.mm-w { font-size: 11.5px; text-transform: uppercase; color: var(--ink-3, #8a94a6); text-align: center; padding-bottom: 2px; }
.mm-d { min-height: 86px; border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; display: flex; flex-direction: column; gap: 3px; background: #fff; }
.mm-d.pad { border: 0; background: none; }
.mm-d.we { background: #fafbfc; }
.mm-d.hol { background: var(--red-50); }
.mm-d.today { border-color: var(--green); box-shadow: 0 0 0 1px var(--green); }
.mm-n { font-weight: 600; font-size: 12.5px; display: flex; align-items: center; gap: 4px; }
.mm-n svg { width: 11px; height: 11px; color: var(--ink-3, #8a94a6); }
.mm-hol { color: var(--red); font-size: 11px; line-height: 1.2; }
.mm-code { align-self: flex-start; background: var(--c); color: #fff; font-weight: 700; font-size: 12px; padding: 1px 8px; border-radius: 6px; }
.mm-code.rest { background: var(--line-2); color: var(--ink-2); }
.mm-h { font-size: 12px; }
.mm-d small { font-size: 11px; color: var(--ink-2); line-height: 1.25; }
@media (max-width: 640px) { .mm-cal { gap: 3px; } .mm-d { min-height: 64px; padding: 4px; } .mm-h, .mm-d small:not(.mm-hol) { display: none; } }
