    *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

    :root {
      --bg:        #0d1117;
      --surface:   #161b22;
      --surface2:  #1c2128;
      --border:    #30363d;
      --text:      #e6edf3;
      --muted:     #8b949e;
      --accent:    #1f6feb;
      --accent-h:  #388bfd;
      --green:     #238636;
      --green-t:   #3fb950;
      --red:       #da3633;
      --red-t:     #f85149;
      --yellow:    #9e6a03;
      --yellow-t:  #e3b341;
    }

    body {
      font-family: 'Segoe UI', sans-serif;
      background: var(--bg);
      color: var(--text);
      min-height: 100vh;
      display: flex;
      flex-direction: column;
    }

    /* ══════════ LOGIN ══════════ */
    #loginScreen {
      position: fixed; inset: 0;
      background: var(--bg);
      display: flex; align-items: center; justify-content: center;
      z-index: 9999;
    }
    #loginScreen.hidden { display: none; }

    .login-card {
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: 16px;
      padding: 48px 40px;
      width: 100%; max-width: 380px;
      display: flex; flex-direction: column; gap: 20px;
    }
    .login-card .brand { text-align: center; margin-bottom: 8px; }
    .login-card .brand h1 { font-size: 1.6rem; font-weight: 800; letter-spacing: 4px; }
    .login-card .brand p  { font-size: 0.75rem; color: var(--muted); letter-spacing: 2px; text-transform: uppercase; margin-top: 4px; }
    .login-field { display: flex; flex-direction: column; gap: 6px; }
    .login-field label { font-size: 0.7rem; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; }
    .login-field input {
      padding: 12px 16px;
      background: var(--bg); border: 1px solid var(--border); border-radius: 8px;
      color: var(--text); font-size: 1rem; outline: none; transition: border-color .2s;
    }
    .login-field input:focus { border-color: var(--accent); }
    .login-error { font-size: 0.8rem; color: var(--red-t); text-align: center; min-height: 16px; }

    /* ══════════ LAYOUT ══════════ */
    #app { display: flex; flex: 1; min-height: 100vh; }

    .sidebar {
      width: 220px; background: var(--surface);
      border-right: 1px solid var(--border);
      display: flex; flex-direction: column; padding: 24px 0;
      flex-shrink: 0;
      transition: width .25s ease, padding .25s ease;
      overflow: hidden;
    }
    .sidebar.collapsed { width: 0; padding: 0; border-right: none; }

    .sidebar-toggle {
      position: fixed; top: 50%; left: 220px;
      transform: translateY(-50%);
      width: 18px; height: 48px;
      background: var(--surface); border: 1px solid var(--border);
      border-left: none; border-radius: 0 8px 8px 0;
      cursor: pointer; display: flex; align-items: center; justify-content: center;
      z-index: 100; transition: left .25s ease; color: var(--muted);
    }
    .sidebar-toggle:hover { color: var(--text); background: var(--surface2); }
    .sidebar-toggle svg { width: 10px; height: 10px; stroke: currentColor; fill: none; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; transition: transform .25s; }
    .sidebar-toggle.collapsed-btn { left: 0; }
    .sidebar-toggle.collapsed-btn svg { transform: rotate(180deg); }

    .sidebar-brand { padding: 0 24px 28px; border-bottom: 1px solid var(--border); white-space: nowrap; }
    .sidebar-brand h1 { font-size: 1.1rem; font-weight: 800; letter-spacing: 3px; }
    .sidebar-brand p  { font-size: 0.65rem; color: var(--muted); letter-spacing: 1px; text-transform: uppercase; margin-top: 2px; }
    .sidebar-brand .version { font-size: 0.62rem; color: #444d56; margin-top: 4px; display: block; letter-spacing: 1px; }

    .sidebar-nav { display: flex; flex-direction: column; gap: 2px; padding: 16px 12px; flex: 1; }
    .nav-item {
      display: flex; align-items: center; gap: 10px;
      padding: 10px 14px; border-radius: 8px; cursor: pointer;
      font-size: 0.88rem; color: var(--muted);
      transition: all .15s; border: none; background: none;
      width: 100%; text-align: left; white-space: nowrap;
    }
    .nav-item:hover { background: var(--surface2); color: var(--text); }
    .nav-item.active { background: var(--surface2); color: var(--text); font-weight: 600; }
    .nav-item .nav-icon { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }

    .sidebar-footer { padding: 16px 12px 0; border-top: 1px solid var(--border); }
    .btn-logout {
      display: flex; align-items: center; gap: 10px;
      padding: 10px 14px; border-radius: 8px; cursor: pointer;
      font-size: 0.82rem; color: var(--muted);
      border: none; background: none; width: 100%; text-align: left;
      transition: all .15s; white-space: nowrap;
    }
    .btn-logout:hover { color: var(--red-t); }

    .main { flex: 1; display: flex; flex-direction: column; overflow: hidden; }

    .topbar {
      height: 60px; border-bottom: 1px solid var(--border);
      display: flex; align-items: center; justify-content: space-between;
      padding: 0 28px; flex-shrink: 0;
    }
    .topbar .page-title { font-size: 0.85rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; }
    .topbar-actions { display: flex; align-items: center; gap: 16px; }
    .btn-fullscreen {
      display: flex; align-items: center; gap: 6px;
      padding: 6px 12px; background: transparent;
      border: 1px solid var(--border); border-radius: 6px;
      color: var(--muted); font-size: 0.78rem; cursor: pointer; transition: all .2s;
    }
    .btn-fullscreen svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
    .btn-fullscreen:hover { border-color: var(--accent); color: var(--accent); }
    .topbar .clock-block { text-align: right; }
    .topbar .clock-block #reloj { font-size: 1.4rem; font-weight: 700; font-family: monospace; letter-spacing: 2px; display: block; }
    .topbar .clock-block #fecha { font-size: 0.82rem; color: var(--muted); font-family: monospace; text-transform: capitalize; }

    /* ══════════ PANELS ══════════ */
    .panel { display: none; flex: 1; overflow-y: auto; padding: 28px; }
    .panel.active { display: flex; flex-direction: column; gap: 20px; }

    /* ══════════ BOTONES COMUNES ══════════ */
    .btn-primary {
      padding: 13px; background: var(--accent); border: none; border-radius: 8px;
      color: #fff; font-size: 0.95rem; font-weight: 700; cursor: pointer;
      letter-spacing: 1px; transition: background .2s;
    }
    .btn-primary:hover { background: var(--accent-h); }
    .btn-secondary {
      padding: 11px 16px; background: #21262d; border: 1px solid var(--border);
      border-radius: 8px; color: var(--muted); font-size: 0.85rem;
      cursor: pointer; display: flex; align-items: center; justify-content: center;
      gap: 8px; transition: all .2s; width: 100%;
    }
    .btn-secondary:hover { border-color: var(--accent); color: var(--accent); }
    .btn-secondary:disabled { opacity: .4; cursor: not-allowed; }
    .btn-new {
      padding: 9px 18px; background: var(--accent); border: none; border-radius: 6px;
      color: #fff; font-size: 0.85rem; font-weight: 600; cursor: pointer;
      transition: background .2s; white-space: nowrap;
    }
    .btn-new:hover { background: var(--accent-h); }
    .btn-cancel {
      padding: 9px 18px; background: transparent; border: 1px solid var(--border);
      border-radius: 6px; color: var(--muted); font-size: 0.88rem; cursor: pointer; transition: all .15s;
    }
    .btn-cancel:hover { border-color: var(--text); color: var(--text); }
    .btn-save {
      padding: 9px 22px; background: var(--accent); border: none; border-radius: 6px;
      color: #fff; font-size: 0.88rem; font-weight: 600; cursor: pointer; transition: background .2s;
    }
    .btn-save:hover { background: var(--accent-h); }

    .spin { display: inline-block; animation: spin .8s linear infinite; }
    @keyframes spin { to { transform: rotate(360deg); } }

    /* ══════════ STAT CARDS ══════════ */
    .stat-card {
      background: var(--surface); border: 1px solid var(--border);
      border-radius: 10px; padding: 18px 16px;
      display: flex; flex-direction: column; align-items: center; gap: 4px;
    }
    .stat-card .num { font-size: 2.2rem; font-weight: 700; font-family: monospace; line-height: 1; }
    .stat-card .lbl { font-size: 0.68rem; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; }
    .stat-card.green { border-color: var(--green); }
    .stat-card.green .num { color: var(--green-t); }
    .stat-card.red   { border-color: var(--red); }
    .stat-card.red   .num { color: var(--red-t); }

    /* ══════════ TABLA COMUN ══════════ */
    .table-card { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
    .table-card .table-header { padding: 14px 20px; border-bottom: 1px solid var(--border); font-size: 0.7rem; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; font-weight: 600; }
    table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
    thead th { text-align: left; padding: 10px 20px; border-bottom: 1px solid var(--border); color: var(--muted); font-weight: 500; font-size: 0.72rem; text-transform: uppercase; letter-spacing: .5px; }
    tbody td { padding: 11px 20px; border-bottom: 1px solid var(--surface2); vertical-align: middle; }
    tbody tr:last-child td { border-bottom: none; }
    tbody tr:hover td { background: var(--surface2); }
    .empty-state { text-align: center; color: var(--muted); font-size: 0.85rem; padding: 28px 0; }

    .badge { display: inline-block; padding: 2px 10px; border-radius: 20px; font-size: 0.72rem; font-weight: 700; letter-spacing: .5px; }
    .badge.ingreso    { background: #0d2818; color: var(--green-t); border: 1px solid var(--green); }
    .badge.salida     { background: #2d1216; color: var(--red-t);   border: 1px solid var(--red); }
    .badge.break_out  { background: #2d2214; color: var(--yellow-t);border: 1px solid var(--yellow); }
    .badge.break_in   { background: #0d1e38; color: #7dd3fc;        border: 1px solid var(--accent); }

    .status-dot { display: inline-flex; align-items: center; gap: 6px; font-size: 0.8rem; font-weight: 600; }
    .status-dot::before { content: ''; width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
    .status-dot.activo   { color: var(--green-t); }
    .status-dot.activo::before   { background: var(--green-t); }
    .status-dot.inactivo { color: var(--muted); }
    .status-dot.inactivo::before { background: var(--muted); }

    /* ══════════ SCANNER ══════════ */
    .presentes-bar { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }

    .scan-card {
      background: var(--surface); border: 1px solid var(--border);
      border-radius: 10px; padding: 24px;
      display: flex; flex-direction: column; gap: 14px;
      position: relative; overflow: hidden;
    }
    .scan-card > * { position: relative; z-index: 1; }
    .scan-card label { font-size: 0.7rem; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; }

    #codigoInput {
      width: 100%; font-size: 2rem; font-weight: 700; font-family: monospace;
      letter-spacing: 6px; text-align: center; padding: 18px 20px;
      background: var(--bg); border: 2px solid var(--border); border-radius: 8px;
      color: var(--text); outline: none; transition: border-color .2s; caret-color: var(--accent);
    }
    #codigoInput:focus { border-color: var(--accent); }
    #codigoInput.scanner-active { animation: borderPulse 1.8s ease-in-out infinite; }
    @keyframes borderPulse {
      0%, 100% { border-color: #1f6feb55; }
      50%       { border-color: #388bfd; box-shadow: 0 0 0 3px #388bfd22; }
    }

    #mensaje {
      min-height: 56px; border-radius: 8px;
      display: flex; align-items: center; justify-content: center;
      font-size: 1rem; font-weight: 600; padding: 14px 20px;
      text-align: center; transition: all .25s;
    }
    #mensaje.idle    { color: var(--muted); border: 1px solid var(--border); }
    #mensaje.ok      { background: #0d2818; border: 1px solid var(--green); color: var(--green-t); }
    #mensaje.error   { background: #2d1216; border: 1px solid var(--red);   color: var(--red-t); }
    #mensaje.warn    { background: #2d2214; border: 1px solid var(--yellow); color: var(--yellow-t); }
    #mensaje.pending { background: #0d1e38; border: 1px solid var(--accent); color: #7dd3fc; }
    .msg-timer { display: inline-block; font-size: 0.78rem; opacity: .7; margin-left: 8px; font-family: monospace; }

    .scan-label-wrap { display: flex; align-items: center; gap: 8px; }
    .led-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green-t); box-shadow: 0 0 6px var(--green-t); flex-shrink: 0; opacity: 0; transition: opacity .3s; }
    .led-dot.active { opacity: 1; animation: ledPulse 1.8s ease-in-out infinite; }
    @keyframes ledPulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }

    #statusEmpleados { text-align: center; font-size: 0.72rem; color: var(--muted); }
    #statusEmpleados.loaded { color: var(--green-t); }

    /* Matrix canvas */
    #matrixCanvas { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 10px; opacity: 0; transition: opacity .6s; pointer-events: none; z-index: 0; }
    #matrixCanvas.active { opacity: .06; }

    /* Scanline */
    .scanline-wrap { position: relative; }
    .scanline {
      position: absolute; left: 0; right: 0; height: 2px;
      background: linear-gradient(90deg, transparent 0%, #388bfd 30%, #7dd3fc 50%, #388bfd 70%, transparent 100%);
      border-radius: 2px; opacity: 0; pointer-events: none; z-index: 2;
      box-shadow: 0 0 8px #388bfd;
    }
    .scanline.active { opacity: 1; animation: scanlineMove 2s ease-in-out infinite; }
    @keyframes scanlineMove { 0% { top: 0%; opacity: 0; } 10% { opacity: 1; } 90% { opacity: 1; } 100% { top: 100%; opacity: 0; } }

    /* ══════════ EMPLEADOS ══════════ */
    .emp-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
    .emp-toolbar-left { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
    .search-input {
      padding: 9px 14px; background: var(--surface); border: 1px solid var(--border);
      border-radius: 6px; color: var(--text); font-size: 0.88rem; outline: none;
      width: 220px; transition: border-color .2s;
    }
    .search-input:focus { border-color: var(--accent); }
    .filter-select {
      padding: 9px 12px; background: var(--surface); border: 1px solid var(--border);
      border-radius: 6px; color: var(--text); font-size: 0.85rem; outline: none; cursor: pointer;
    }
    .filter-select option { background: var(--surface); }

    .emp-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
    .rstat { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 16px 18px; }
    .rstat .rnum { font-size: 1.8rem; font-weight: 700; font-family: monospace; color: var(--text); }
    .rstat .rlbl { font-size: 0.68rem; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; margin-top: 2px; }

    .action-btn { padding: 4px 8px; border-radius: 5px; font-size: 0.7rem; font-weight: 600; cursor: pointer; border: 1px solid; transition: all .15s; white-space: nowrap; }
    .action-btn.edit  { background: transparent; border-color: var(--accent); color: var(--accent); }
    .action-btn.edit:hover  { background: var(--accent); color: #fff; }
    .action-btn.cred  { background: transparent; border-color: var(--yellow); color: var(--yellow-t); }
    .action-btn.cred:hover  { background: var(--yellow); color: #fff; }
    .action-btn.baja  { background: transparent; border-color: var(--red); color: var(--red-t); }
    .action-btn.baja:hover  { background: var(--red); color: #fff; }
    .action-btn.alta  { background: transparent; border-color: var(--green); color: var(--green-t); }
    .action-btn.alta:hover  { background: var(--green); color: #fff; }

    /* ══════════ MODALES ══════════ */
    .modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.6); display: none; align-items: center; justify-content: center; z-index: 500; overflow-y: auto; padding: 20px; }
    .modal-overlay.visible { display: flex; }

    .modal {
      background: var(--surface); border: 1px solid var(--border);
      border-radius: 12px; padding: 28px 28px 24px;
      width: 100%; max-width: 560px;
      display: flex; flex-direction: column; gap: 18px;
      max-height: 90vh; overflow-y: auto;
    }
    .modal h3 { font-size: 1rem; font-weight: 700; border-bottom: 1px solid var(--border); padding-bottom: 14px; }
    .modal-fields { display: flex; flex-direction: column; gap: 14px; }
    .modal-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
    .modal-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }
    .modal-field { display: flex; flex-direction: column; gap: 6px; }
    .modal-field label { font-size: 0.7rem; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; }
    .modal-field input, .modal-field select, .modal-field textarea {
      padding: 10px 14px; background: var(--bg); border: 1px solid var(--border);
      border-radius: 6px; color: var(--text); font-size: 0.92rem; outline: none;
      transition: border-color .2s; font-family: inherit;
    }
    .modal-field input:focus, .modal-field select:focus, .modal-field textarea:focus { border-color: var(--accent); }
    .modal-field select option { background: var(--surface); }
    .modal-field textarea { resize: vertical; min-height: 70px; }
    .modal-actions { display: flex; gap: 10px; justify-content: flex-end; padding-top: 4px; }
    .modal-section-title { font-size: 0.72rem; color: var(--accent); text-transform: uppercase; letter-spacing: 1px; font-weight: 700; padding: 4px 0; border-bottom: 1px solid var(--border); margin-top: 4px; }

    .modal-confirm p { font-size: 0.92rem; color: var(--muted); line-height: 1.5; }
    .modal-confirm strong { color: var(--text); }

    /* ══════════ LEGAJO (drawer lateral) ══════════ */
    .legajo-overlay {
      position: fixed; inset: 0; background: rgba(0,0,0,.5);
      display: none; z-index: 400;
    }
    .legajo-overlay.visible { display: block; }
    .legajo-drawer {
      position: fixed; top: 0; right: -680px; width: 660px; height: 100vh;
      background: var(--surface); border-left: 1px solid var(--border);
      display: flex; flex-direction: column;
      transition: right .3s ease; z-index: 401; overflow: hidden;
    }
    .legajo-drawer.open { right: 0; }
    .legajo-header {
      padding: 20px 28px; border-bottom: 1px solid var(--border);
      display: flex; align-items: center; justify-content: space-between;
      flex-shrink: 0;
    }
    .legajo-header-left { display: flex; flex-direction: column; gap: 2px; }
    .legajo-nombre { font-size: 1.1rem; font-weight: 700; }
    .legajo-meta   { font-size: 0.75rem; color: var(--muted); }
    .legajo-close {
      width: 32px; height: 32px; border-radius: 6px;
      background: transparent; border: 1px solid var(--border);
      color: var(--muted); cursor: pointer; display: flex; align-items: center; justify-content: center;
      transition: all .15s;
    }
    .legajo-close:hover { border-color: var(--red); color: var(--red-t); }
    .legajo-close svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

    .legajo-tabs { display: flex; gap: 0; border-bottom: 1px solid var(--border); padding: 0 28px; flex-shrink: 0; }
    .legajo-tab {
      padding: 10px 16px; font-size: 0.82rem; color: var(--muted);
      cursor: pointer; border: none; background: none;
      border-bottom: 2px solid transparent; margin-bottom: -1px;
      transition: all .15s;
    }
    .legajo-tab:hover { color: var(--text); }
    .legajo-tab.active { color: var(--text); border-bottom-color: var(--accent); font-weight: 600; }

    .legajo-body { flex: 1; overflow-y: auto; padding: 24px 28px; }
    .legajo-tab-content { display: none; flex-direction: column; gap: 20px; }
    .legajo-tab-content.active { display: flex; }

    .legajo-section { display: flex; flex-direction: column; gap: 14px; }
    .legajo-section-title { font-size: 0.7rem; color: var(--accent); text-transform: uppercase; letter-spacing: 1px; font-weight: 700; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
    .legajo-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
    .legajo-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
    .legajo-field { display: flex; flex-direction: column; gap: 3px; }
    .legajo-field .lf-label { font-size: 0.65rem; color: var(--muted); text-transform: uppercase; letter-spacing: .8px; }
    .legajo-field .lf-value { font-size: 0.88rem; color: var(--text); }
    .legajo-field .lf-value.mono { font-family: monospace; }
    .legajo-field.full { grid-column: 1 / -1; }

    .legajo-footer {
      padding: 16px 28px; border-top: 1px solid var(--border);
      display: flex; gap: 10px; flex-shrink: 0;
    }
    .btn-legajo-edit {
      flex: 1; padding: 10px; background: var(--accent); border: none;
      border-radius: 6px; color: #fff; font-size: 0.85rem; font-weight: 600;
      cursor: pointer; transition: background .2s;
    }
    .btn-legajo-edit:hover { background: var(--accent-h); }

    /* Secciones legajo — sanciones / vacaciones / etc */
    .legajo-list-item {
      background: var(--bg); border: 1px solid var(--border); border-radius: 8px;
      padding: 14px 16px; display: flex; flex-direction: column; gap: 6px;
    }
    .legajo-list-item .li-header { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
    .legajo-list-item .li-title  { font-size: 0.88rem; font-weight: 600; }
    .legajo-list-item .li-meta   { font-size: 0.75rem; color: var(--muted); }
    .legajo-list-item .li-desc   { font-size: 0.82rem; color: var(--muted); line-height: 1.4; }
    .legajo-list-empty { text-align: center; color: var(--muted); font-size: 0.82rem; padding: 24px 0; }
    .btn-add-item {
      padding: 8px 16px; background: transparent;
      border: 1px dashed var(--border); border-radius: 6px;
      color: var(--muted); font-size: 0.82rem; cursor: pointer;
      transition: all .15s; display: flex; align-items: center; justify-content: center; gap: 6px;
    }
    .btn-add-item:hover { border-color: var(--accent); color: var(--accent); }

    /* Badge tipo sancion */
    .badge-sancion { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 0.68rem; font-weight: 700; }
    .badge-sancion.llamado     { background: #2d2214; color: var(--yellow-t); border: 1px solid var(--yellow); }
    .badge-sancion.apercibimiento { background: #2d2214; color: #fb923c; border: 1px solid #c2410c; }
    .badge-sancion.suspension  { background: #2d1216; color: var(--red-t); border: 1px solid var(--red); }

    /* Turnos grid */
    .turnos-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
    .turno-card {
      background: var(--bg); border: 1px solid var(--border); border-radius: 8px;
      padding: 14px 16px; display: flex; flex-direction: column; gap: 8px;
    }
    .turno-card .tc-dia { font-size: 0.7rem; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; }
    .turno-card .tc-hora { font-size: 1.1rem; font-weight: 700; font-family: monospace; }
    .turno-card .tc-break { font-size: 0.72rem; color: var(--muted); }
    .turno-card.libre .tc-hora { color: var(--muted); font-size: 0.88rem; }

    /* Badge estado vacaciones */
    .badge-vac { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 0.68rem; font-weight: 700; }
    .badge-vac.pendiente  { background: #2d2214; color: var(--yellow-t); border: 1px solid var(--yellow); }
    .badge-vac.aprobada   { background: #0d1e38; color: #7dd3fc; border: 1px solid var(--accent); }
    .badge-vac.tomada     { background: #0d2818; color: var(--green-t); border: 1px solid var(--green); }

    /* ══════════ CREDENCIAL ══════════ */
    .modal-cred {
      background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
      padding: 28px 28px 24px; width: 100%; max-width: 380px;
      display: flex; flex-direction: column; gap: 18px;
    }
    .modal-cred h3 { font-size: 1rem; font-weight: 700; border-bottom: 1px solid var(--border); padding-bottom: 14px; }
    .cred-preview { display: flex; justify-content: center; }
    #carnetCanvas { border-radius: 12px; box-shadow: 0 8px 32px rgba(0,0,0,.5); max-width: 100%; }
    .cred-actions { display: flex; gap: 8px; flex-wrap: wrap; }
    .btn-cred-dl { flex: 1; padding: 9px 14px; background: var(--accent); border: none; border-radius: 6px; color: #fff; font-size: 0.82rem; font-weight: 600; cursor: pointer; transition: background .2s; }
    .btn-cred-dl:hover { background: var(--accent-h); }
    .btn-cred-wa { flex: 1; padding: 9px 14px; background: #1a472a; border: 1px solid var(--green); border-radius: 6px; color: var(--green-t); font-size: 0.82rem; font-weight: 600; cursor: pointer; transition: all .2s; }
    .btn-cred-wa:hover { background: var(--green); color: #fff; }

    /* ══════════ REPORTES ══════════ */
    .report-filters {
      background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
      padding: 20px 24px; display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-end;
    }
    .filter-group { display: flex; flex-direction: column; gap: 6px; flex: 1; min-width: 140px; }
    .filter-group label { font-size: 0.68rem; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; }
    .filter-group input, .filter-group select {
      padding: 9px 12px; background: var(--bg); border: 1px solid var(--border);
      border-radius: 6px; color: var(--text); font-size: 0.88rem; outline: none; transition: border-color .2s;
    }
    .filter-group input:focus, .filter-group select:focus { border-color: var(--accent); }
    .filter-group select option { background: var(--surface); }
    .btn-filter { padding: 9px 20px; background: var(--accent); border: none; border-radius: 6px; color: #fff; font-size: 0.85rem; font-weight: 600; cursor: pointer; transition: background .2s; align-self: flex-end; }
    .btn-filter:hover { background: var(--accent-h); }

    .report-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }

    .tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); }
    .tab { padding: 9px 18px; font-size: 0.82rem; color: var(--muted); cursor: pointer; border: none; background: none; border-bottom: 2px solid transparent; margin-bottom: -1px; transition: all .15s; }
    .tab:hover { color: var(--text); }
    .tab.active { color: var(--text); border-bottom-color: var(--accent); font-weight: 600; }
    .tab-content { display: none; }
    .tab-content.active { display: block; }

    /* ══════════ VISTA EN VIVO ══════════ */
    .vivo-toolbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
    .vivo-toolbar-left { display: flex; flex-direction: column; gap: 2px; }
    .vivo-title  { font-size: 1rem; font-weight: 700; }
    .vivo-update-info { font-size: 0.72rem; color: var(--muted); }
    .vivo-toolbar-right { display: flex; align-items: center; gap: 10px; }
    .btn-vivo-refresh {
      display: flex; align-items: center; gap: 8px;
      padding: 9px 20px; background: var(--accent); border: none; border-radius: 6px;
      color: #fff; font-size: 0.85rem; font-weight: 600; cursor: pointer; transition: background .2s;
    }
    .btn-vivo-refresh:hover { background: var(--accent-h); }
    .btn-vivo-refresh:disabled { opacity: .5; cursor: not-allowed; }
    .btn-vivo-refresh svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
    .btn-vivo-refresh.loading svg { animation: spin .7s linear infinite; }

    .vivo-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
    .vivo-stat { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 16px 18px; display: flex; flex-direction: column; align-items: center; gap: 4px; }
    .vivo-stat.green { border-color: var(--green); }
    .vivo-stat.green .vivo-num { color: var(--green-t); }
    .vivo-stat.red   { border-color: var(--red); }
    .vivo-stat.red   .vivo-num { color: var(--red-t); }
    .vivo-stat.yellow { border-color: var(--yellow); }
    .vivo-stat.yellow .vivo-num { color: var(--yellow-t); }
    .vivo-num { font-size: 2rem; font-weight: 700; font-family: monospace; line-height: 1; }
    .vivo-lbl { font-size: 0.68rem; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; }

    .vivo-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; flex: 1; }
    .vivo-col { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; display: flex; flex-direction: column; }
    .vivo-col-header { display: flex; align-items: center; gap: 8px; padding: 14px 20px; border-bottom: 1px solid var(--border); font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; }
    .vivo-col-header svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
    .vivo-col-header.green { color: var(--green-t); border-bottom-color: var(--green); }
    .vivo-col-header.red   { color: var(--red-t);   border-bottom-color: var(--red); }
    .vivo-list { flex: 1; overflow-y: auto; max-height: 520px; }
    .vivo-empty { text-align: center; color: var(--muted); font-size: 0.82rem; padding: 32px 20px; }
    .vivo-item { display: flex; align-items: center; gap: 12px; padding: 11px 20px; border-bottom: 1px solid var(--surface2); transition: background .15s; }
    .vivo-item:last-child { border-bottom: none; }
    .vivo-item:hover { background: var(--surface2); }
    .vivo-avatar { width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 0.78rem; font-weight: 700; flex-shrink: 0; }
    .vivo-avatar.presente { background: #0d2818; border: 1px solid var(--green); color: var(--green-t); }
    .vivo-avatar.ausente  { background: var(--surface2); border: 1px solid var(--border); color: var(--muted); }
    .vivo-info { flex: 1; min-width: 0; }
    .vivo-nombre { font-size: 0.85rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .vivo-sector { font-size: 0.7rem; color: var(--muted); margin-top: 1px; }
    .vivo-hora { font-size: 0.75rem; font-family: monospace; color: var(--green-t); flex-shrink: 0; }
    .vivo-hora.ausente { color: var(--muted); }

    /* ══════════ MODAL SANCIÓN / VACACIONES / ETC ══════════ */
    .modal-sm { max-width: 420px; }
