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

    :root {
      --bg: #f5f4f0; --surface: #ffffff; --surface-2: #f0efe9;
      --border: rgba(0,0,0,0.10); --border-md: rgba(0,0,0,0.18);
      --text: #1a1a18; --text-2: #6b6b66; --text-3: #9a9a94;
      --accent: #2b4fff; --accent-bg: #eef0ff; --accent-text: #1a31cc;
      --radius-sm: 6px; --radius-md: 10px; --radius-lg: 14px;
      --shadow-sm: 0 1px 3px rgba(0,0,0,0.07); --shadow-md: 0 4px 16px rgba(0,0,0,0.10);
    }
    html.dark {
      --bg: #0d0f14;
      --surface: #161820;
      --surface-2: #1e2130;
      --border: rgba(120,130,200,0.12);
      --border-md: rgba(120,130,200,0.22);
      --text: #e8eaf2;
      --text-2: #8890b0;
      --text-3: #4e5570;
      --accent: #6b82ff;
      --accent-bg: #1a2048;
      --accent-text: #a0b0ff;
      --shadow-sm: 0 1px 4px rgba(0,0,0,0.40);
      --shadow-md: 0 4px 20px rgba(0,0,0,0.55);
    }
    html {
      scrollbar-gutter: stable; /* reserva el espacio del scrollbar siempre, sin importar el tema */
    }
    body {
      font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
      background: var(--bg); color: var(--text);
      font-size: 14px; line-height: 1.6; min-height: 100vh;
      transition: background 0.2s, color 0.2s;
      overflow-y: scroll;
    }

    /* HEADER */
    /* ── SIDEBAR VERTICAL ── */
    .sidebar {
      position: fixed; top: 0; left: 0; bottom: 0;
      width: 220px; z-index: 50;
      background: var(--surface);
      border-right: 1px solid var(--border);
      display: flex; flex-direction: column;
      overflow: hidden;
    }
    .sidebar-brand {
      display: flex; align-items: center; justify-content: center;
      padding: 10px 16px;
      flex-shrink: 0;
      border-bottom: 1px solid var(--border);
    }
    .sidebar-logo { width: 80px; height: 65px; object-fit: contain; flex-shrink: 0; }
    .sidebar-brand-name { display: none; }
    .sidebar-nav {
      flex: 1; min-height: 0; overflow-y: auto; padding: 8px 8px;
      display: flex; flex-direction: column; gap: 2px;
      scrollbar-width: thin;
    }
    .nav-btn {
      width: 100%; padding: 9px 12px; border-radius: var(--radius-sm);
      border: none; background: transparent; cursor: pointer;
      font-size: 13px; font-weight: 500; color: var(--text-2);
      display: flex; align-items: center; gap: 10px;
      transition: background .12s, color .12s;
      text-align: left; white-space: nowrap;
    }
    .nav-btn:hover { background: var(--surface-2); color: var(--text); }
    .nav-btn.active {
      background: rgba(43,79,255,0.12); color: var(--accent); font-weight: 700;
      border-left: 3px solid var(--accent); padding-left: 9px;
    }
    .nav-btn i { font-size: 17px; flex-shrink: 0; }
    .sidebar-footer {
      padding: 10px 8px; border-top: 1px solid var(--border);
      display: flex; flex-direction: column; gap: 6px; flex-shrink: 0;
    }
    .sidebar-user {
      display: flex; align-items: center; gap: 8px;
      padding: 6px 8px; border-radius: var(--radius-sm);
      background: var(--surface-2); min-width: 0;
    }
    .sidebar-user .header-user-clickable {
      display: flex; align-items: center; gap: 8px;
      flex: 1; min-width: 0; cursor: pointer;
    }
    .sidebar-user .header-user-name { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; }
    .sidebar-user .header-user-name strong { display: block; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text); max-width: 100%; }
    .sidebar-user .header-user-avatar {
      width: 32px; height: 32px; border-radius: 50%; background: var(--accent-bg);
      color: var(--accent); display: flex; align-items: center; justify-content: center;
      font-size: 12px; font-weight: 700; flex-shrink: 0;
    }
    .sidebar-user .header-user-role {
      display: block; font-size: 10px; font-weight: 600; color: var(--text-3);
      text-transform: uppercase; letter-spacing: .3px; margin-top: 1px;
      background: none; padding: 0; align-self: flex-start;
    }
    .dark-toggle {
      width: 100%; height: 34px; border-radius: var(--radius-sm);
      border: 1px solid var(--border-md); background: var(--surface);
      color: var(--text-2); display: flex; align-items: center;
      justify-content: center; cursor: pointer; font-size: 17px;
      transition: background .12s, color .12s; gap: 8px; font-size: 13px;
    }
    .dark-toggle:hover { background: var(--surface-2); color: var(--text); }
    .btn-logout {
      background: transparent; border: none; cursor: pointer;
      color: var(--text-3); padding: 4px; border-radius: var(--radius-sm);
      font-size: 16px; transition: color .12s; flex-shrink: 0;
    }
    .btn-logout:hover { color: #ef4444; }

    /* ── MAIN CONTENT (desplazado a la derecha de la sidebar) ── */
    .main-content {
      margin-left: 220px;
      min-height: 100vh;
      background: var(--bg);
    }

    /* LAYOUT */
    .page { display: none; }
    .page.active { display: block; }
    .container { max-width: 900px; margin: 0 auto; padding: 2rem 1.5rem; }
    .page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.5rem; gap: 1rem; flex-wrap: wrap; }
    .page-title { font-size: 20px; font-weight: 600; letter-spacing: -0.3px; }
    .page-subtitle { font-size: 13px; color: var(--text-2); margin-top: 2px; }
    .card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }

    /* SEARCH */
    .search-bar { padding: 1rem 1.25rem; border-bottom: 1px solid var(--border); position: relative; }
    .search-input-wrap { position: relative; }
    .search-input-wrap i { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--text-3); font-size: 16px; pointer-events: none; }
    .search-input-wrap input { width: 100%; padding: 8px 12px 8px 34px; border: 1px solid var(--border-md); border-radius: var(--radius-sm); font-size: 13px; background: var(--surface); color: var(--text); outline: none; transition: border-color 0.12s; }
    .search-input-wrap input:focus { border-color: var(--accent); }
    /* Variante: icono + input como hijos directos de .search-bar (sin .search-input-wrap anidado) */
    .search-bar > i { position: absolute; left: calc(1.25rem + 10px); top: 50%; transform: translateY(-50%); color: var(--text-3); font-size: 16px; pointer-events: none; }
    .search-bar > input { width: 100%; padding: 8px 12px 8px 34px; border: 1px solid var(--border-md); border-radius: var(--radius-sm); font-size: 13px; background: var(--surface); color: var(--text); outline: none; transition: border-color 0.12s; }
    .search-bar > input:focus { border-color: var(--accent); }

    /* EMPLOYEE LIST */
    .emp-list { list-style: none; }
    .emp-item { display: flex; align-items: center; gap: 14px; padding: 14px 1.25rem; border-bottom: 1px solid var(--border); cursor: pointer; transition: background 0.1s; }
    .emp-item:last-child { border-bottom: none; }
    .emp-item:hover { background: var(--surface-2); }
    .avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--accent-bg); color: var(--accent-text); display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600; flex-shrink: 0; }
    .emp-info { flex: 1; min-width: 0; }
    .emp-name { font-weight: 500; font-size: 14px; }
    .emp-meta { font-size: 12px; color: var(--text-2); margin-top: 1px; }
    .emp-badge { display: flex; align-items: center; gap: 4px; font-size: 12px; color: var(--text-3); white-space: nowrap; }
    .emp-badge i { font-size: 14px; }
    .emp-actions { display: flex; gap: 6px; }

    /* BUTTONS */
    .btn { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: var(--radius-sm); border: 1px solid var(--border-md); background: var(--surface); color: var(--text); font-size: 13px; font-weight: 500; cursor: pointer; transition: background 0.12s, border-color 0.12s; white-space: nowrap; }
    .btn:hover { background: var(--surface-2); }
    .btn i { font-size: 15px; }
    .btn-primary { background: var(--accent); color: #fff; border-color: var(--accent); }
    .btn-primary:hover { opacity: 0.88; }
    .btn-sm { padding: 5px 10px; font-size: 12px; }
    .btn-ghost { border-color: transparent; background: transparent; }
    .btn-ghost:hover { background: var(--surface-2); border-color: var(--border); }
    .btn-danger { color: #ef4444; }
    .btn-danger:hover { background: rgba(239,68,68,0.08); border-color: rgba(239,68,68,0.3); }

    /* BADGE */
    .badge { display: inline-block; padding: 2px 8px; border-radius: 20px; font-size: 11px; font-weight: 500; border: 1px solid transparent; }
    .badge-blue   { background: #dbeafe; color: #1e40af; }
    .badge-green  { background: #dcfce7; color: #166534; }
    .badge-amber  { background: #fef3c7; color: #92400e; }
    .badge-red    { background: #fee2e2; color: #991b1b; }
    .badge-purple { background: #ede9fe; color: #5b21b6; }
    .badge-teal   { background: #ccfbf1; color: #0f766e; }
    .badge-gray   { background: #f3f4f6; color: #374151; }
    html.dark .badge-blue   { background: #172554; color: #93c5fd; border: 1px solid #1e3a8a44; }
    html.dark .badge-green  { background: #14532d; color: #86efac; border: 1px solid #16653244; }
    html.dark .badge-amber  { background: #422006; color: #fbbf24; border: 1px solid #92400e44; }
    html.dark .badge-red    { background: #450a0a; color: #f87171; border: 1px solid #7f1d1d44; }
    html.dark .badge-purple { background: #2e1065; color: #c084fc; border: 1px solid #4c1d9544; }
    html.dark .badge-teal   { background: #134e4a; color: #2dd4bf; border: 1px solid #0f766e44; }
    html.dark .badge-gray   { background: #1e2538; color: #94a3b8; border: 1px solid #33415544; }

    /* ── Dark mode: sidebar ── */
    html.dark .sidebar {
      background: #12141c;
      border-right-color: rgba(100,120,220,0.18);
    }
    html.dark .sidebar-brand { border-bottom-color: rgba(100,120,200,0.18); }
    html.dark .sidebar-footer { border-top-color: rgba(100,120,200,0.18); }
    html.dark .sidebar-user { background: #1e2130; }
    html.dark .nav-btn:hover { background: rgba(107,130,255,0.12); color: var(--accent-text); }
    html.dark .nav-btn.active {
      background: rgba(107,130,255,0.18);
      color: var(--accent-text); font-weight: 700;
      border-left: 3px solid var(--accent); padding-left: 9px;
    }

    /* Cards con borde levemente azulado */
    html.dark .card {
      border-color: rgba(100,120,220,0.14);
      background: #161820;
    }

    /* Inputs: fondo más oscuro, borde con tinte */
    html.dark .form-input {
      background: #0d0f14;
      border-color: rgba(100,120,200,0.22);
      color: #e0e4f0;
    }
    html.dark .form-input:focus {
      border-color: var(--accent);
      box-shadow: 0 0 0 3px rgba(107,130,255,0.15);
    }
    html.dark select.form-input { background: #0d0f14; }

    /* Modal con fondo más distinguible */
    html.dark .modal {
      background: #181a24;
      border-color: rgba(100,120,220,0.20);
      box-shadow: 0 8px 40px rgba(0,0,0,0.65), 0 0 0 1px rgba(107,130,255,0.08);
    }
    html.dark .modal-overlay { background: rgba(5,6,12,0.75); }

    /* Botón primario más vibrante */
    html.dark .btn-primary {
      background: #3d5aff;
      box-shadow: 0 2px 8px rgba(61,90,255,0.30);
    }
    html.dark .btn-primary:hover { background: #5570ff; }

    /* Timeline: línea y dots más vibrantes */
    html.dark .tl-dot.blue   { background: #3b82f6; box-shadow: 0 0 0 3px rgba(59,130,246,0.20); }
    html.dark .tl-dot.green  { background: #22c55e; box-shadow: 0 0 0 3px rgba(34,197,94,0.20); }
    html.dark .tl-dot.amber  { background: #f59e0b; box-shadow: 0 0 0 3px rgba(245,158,11,0.20); }
    html.dark .tl-dot.red    { background: #ef4444; box-shadow: 0 0 0 3px rgba(239,68,68,0.20); }
    html.dark .tl-dot.purple { background: #a855f7; box-shadow: 0 0 0 3px rgba(168,85,247,0.20); }
    html.dark .tl-dot.teal   { background: #14b8a6; box-shadow: 0 0 0 3px rgba(20,184,166,0.20); }
    html.dark .tl-dot.gray   { background: #64748b; box-shadow: 0 0 0 3px rgba(100,116,139,0.20); }
    html.dark .tl-card {
      background: #1a1d2a;
      border: 1px solid rgba(100,120,220,0.14);
    }
    html.dark .tl-card-header { border-bottom-color: rgba(100,120,220,0.10); }

    /* Toast más contrastado */
    html.dark .toast {
      background: #2a2d3e;
      color: #e0e4f0;
      border: 1px solid rgba(107,130,255,0.25);
      box-shadow: 0 4px 20px rgba(0,0,0,0.50);
    }

    /* Página de empleo: cabecera */
    html.dark .legajo-header { background: linear-gradient(135deg, #161824 0%, #1a1d2e 100%); }

    /* Search bar */
    html.dark .search-bar {
      background: #0d0f14;
      border-color: rgba(100,120,200,0.22);
    }
    html.dark .search-bar input { color: #e0e4f0; }

    /* Filas de empleados con hover más visible */
    html.dark .emp-row:hover { background: rgba(107,130,255,0.06); }

    /* Confirm modal botón de peligro */
    html.dark .btn-danger { color: #f87171; }
    html.dark .btn-danger:hover { background: rgba(239,68,68,0.12); }

    /* Scrollbar temática (Webkit) */
    /* Scrollbar consistente en ambos modos — evita el salto de layout al cambiar tema */
    ::-webkit-scrollbar { width: 7px; height: 7px; }
    ::-webkit-scrollbar-track { background: transparent; }
    ::-webkit-scrollbar-thumb { background: #c0c0c0; border-radius: 4px; }
    ::-webkit-scrollbar-thumb:hover { background: #a0a0a0; }
    html { scrollbar-width: thin; scrollbar-color: #c0c0c0 transparent; }

    html.dark ::-webkit-scrollbar-thumb { background: #2a2d40; }
    html.dark ::-webkit-scrollbar-thumb:hover { background: #3d4260; }
    html.dark { scrollbar-color: #2a2d40 transparent; }


    .modal-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.45); z-index: 1100; align-items: center; justify-content: center; padding: 1rem; overflow-y: auto; }
    .modal-overlay.open { display: flex; }
    .modal { background: var(--surface); border-radius: var(--radius-lg); border: 1px solid var(--border); box-shadow: var(--shadow-md); width: 100%; max-width: 560px; padding: 1.5rem; margin: auto; }
    .modal-title { font-size: 15px; font-weight: 600; margin-bottom: 1.25rem; }
    .modal-footer { display: flex; gap: 8px; justify-content: flex-end; margin-top: 1.25rem; }

    /* FORMS */
    .form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
    .form-group { display: flex; flex-direction: column; gap: 5px; }
    .form-group.full { grid-column: 1 / -1; }
    .form-group.third { grid-column: span 1; }
    .form-label { font-size: 12px; font-weight: 500; color: var(--text-2); }
    .form-input { width: 100%; box-sizing: border-box; padding: 8px 10px; border: 1px solid var(--border-md); border-radius: var(--radius-sm); font-size: 13px; font-family: inherit; color: var(--text); background: var(--surface); outline: none; transition: border-color 0.12s; }
    .form-input:focus { border-color: var(--accent); }
    textarea.form-input { resize: vertical; min-height: 80px; }
    .form-section-title { font-size: 11px; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.6px; grid-column: 1 / -1; margin-top: 6px; padding-top: 12px; border-top: 1px solid var(--border); }
    .form-hint { font-size: 11px; color: var(--text-3); margin-top: 2px; }

    /* EMPTY */
    .empty { text-align: center; padding: 3rem 2rem; color: var(--text-3); }
    .empty i { font-size: 36px; display: block; margin-bottom: 0.75rem; }
    .empty p { font-size: 13px; }

    /* TOAST */
    .toast { position: fixed; bottom: 1.5rem; right: 1.5rem; background: var(--text); color: var(--bg); border: 1px solid transparent; padding: 10px 16px; border-radius: var(--radius-md); font-size: 13px; font-weight: 500; box-shadow: var(--shadow-md); z-index: 2000; opacity: 0; transform: translateY(8px); transition: opacity 0.2s, transform 0.2s; pointer-events: none; }
    .toast.show { opacity: 1; transform: translateY(0); }

    /* LEGAJO */
    .back-btn { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-2); background: none; border: none; cursor: pointer; padding: 0; margin-bottom: 1.25rem; transition: color 0.1s; }
    .back-btn:hover { color: var(--text); }
    .back-btn i { font-size: 16px; }
    .legajo-profile { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1.5rem; margin-bottom: 1.5rem; box-shadow: var(--shadow-sm); }
    .legajo-profile-top { display: flex; align-items: center; gap: 16px; margin-bottom: 1.25rem; }
    .legajo-avatar { width: 52px; height: 52px; border-radius: 50%; background: var(--accent-bg); color: var(--accent-text); display: flex; align-items: center; justify-content: center; font-size: 16px; font-weight: 600; flex-shrink: 0; }
    .legajo-name { font-size: 18px; font-weight: 600; letter-spacing: -0.2px; }
    .legajo-dni { font-size: 13px; color: var(--text-2); margin-top: 2px; }
    .legajo-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
    .stat-item { background: var(--surface-2); border-radius: var(--radius-md); padding: 12px 14px; }
    .stat-label { font-size: 11px; color: var(--text-2); font-weight: 500; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 4px; }
    .stat-value { font-size: 15px; font-weight: 600; }
    .legajo-extra { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--border); display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 8px 20px; }
    .legajo-extra-item { font-size: 12px; color: var(--text-2); }
    .legajo-extra-item span { color: var(--text); font-weight: 500; display: block; margin-top: 1px; }

    .section-header-obs { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; gap: 1rem; flex-wrap: wrap; }
    .section-label { font-size: 13px; font-weight: 600; color: var(--text-2); text-transform: uppercase; letter-spacing: 0.5px; }

    /* TIMELINE */
    .timeline { position: relative; padding-left: 24px; }
    .timeline::before { content: ''; position: absolute; left: 7px; top: 8px; bottom: 8px; width: 1px; background: var(--border-md); }
    .tl-item { position: relative; margin-bottom: 1.25rem; }
    .tl-item:last-child { margin-bottom: 0; }
    .tl-dot { position: absolute; left: -20px; top: 6px; width: 10px; height: 10px; border-radius: 50%; background: var(--border-md); border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--border-md); }
    .tl-dot.blue   { background: #3b82f6; box-shadow: 0 0 0 1px #93c5fd; }
    .tl-dot.green  { background: #22c55e; box-shadow: 0 0 0 1px #86efac; }
    .tl-dot.amber  { background: #f59e0b; box-shadow: 0 0 0 1px #fcd34d; }
    .tl-dot.red    { background: #ef4444; box-shadow: 0 0 0 1px #fca5a5; }
    .tl-dot.purple { background: #8b5cf6; box-shadow: 0 0 0 1px #c4b5fd; }
    .tl-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 12px 14px; box-shadow: var(--shadow-sm); }
    .tl-card-header { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; flex-wrap: wrap; }
    .tl-meta { display: flex; align-items: center; gap: 8px; }
    .tl-date { font-size: 11px; color: var(--text-3); }
    .tl-body { font-size: 13px; color: var(--text); line-height: 1.6; }
    .tl-actions { display: flex; gap: 4px; opacity: 0; transition: opacity 0.15s; }
    .tl-card:hover .tl-actions { opacity: 1; }

    /* OBS FILTER */
    .obs-filters { display: flex; gap: 8px; flex-wrap: wrap; }
    .filter-chip { padding: 4px 12px; border-radius: 20px; border: 1px solid var(--border-md); background: var(--surface); font-size: 12px; cursor: pointer; transition: all 0.1s; color: var(--text-2); }
    .filter-chip:hover { border-color: var(--accent); color: var(--accent-text); }
    .filter-chip.active { background: var(--accent-bg); border-color: var(--accent); color: var(--accent-text); font-weight: 500; }

    /* PDF MODAL */
    .pdf-modal .modal { max-width: 580px; }
    .pdf-info-box { background: var(--surface-2); border-radius: var(--radius-md); padding: 12px 14px; font-size: 13px; border: 1px solid var(--border); }
    .pdf-info-row { display: flex; gap: 6px; margin-bottom: 4px; }
    .pdf-info-row:last-child { margin-bottom: 0; }
    .pdf-info-label { color: var(--text-2); min-width: 90px; font-size: 12px; }
    .pdf-info-value { color: var(--text); font-weight: 500; font-size: 12px; }
    textarea.form-input.tall { min-height: 160px; }

    /* LLAMADOS EN APERCIBIMIENTO */
    .llamados-panel { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 10px 12px; }
    .llamados-panel-title { font-size: 11px; font-weight: 600; color: var(--text-2); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 8px; display: flex; align-items: center; gap: 6px; }
    .llamado-check-item { display: flex; align-items: flex-start; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--border); cursor: pointer; }
    .llamado-check-item:last-child { border-bottom: none; padding-bottom: 0; }
    .llamado-check-item input[type=checkbox] { margin-top: 2px; flex-shrink: 0; accent-color: var(--accent); width: 14px; height: 14px; cursor: pointer; }
    .llamado-check-info { flex: 1; min-width: 0; }
    .llamado-check-fecha { font-size: 11px; color: var(--text-3); margin-bottom: 1px; }
    .llamado-check-detalle { font-size: 12px; color: var(--text); line-height: 1.4; }
    .llamado-usado { opacity: 0.45; }
    .llamado-usado .llamado-check-fecha::after { content: ' · Ya incluido en apercibimiento anterior'; color: var(--text-3); }

    /* CONFIRM */
    .confirm-dialog .modal { max-width: 360px; text-align: center; }
    .confirm-icon { font-size: 32px; color: #ef4444; margin-bottom: 0.75rem; }
    .confirm-title { font-size: 15px; font-weight: 600; margin-bottom: 0.5rem; }
    .confirm-msg { font-size: 13px; color: var(--text-2); margin-bottom: 1.25rem; }

    /* FOTO DE PERFIL */
    .photo-upload-wrap { display: flex; align-items: center; gap: 16px; padding: 12px 0 16px; border-bottom: 1px solid var(--border); margin-bottom: 4px; }
    .photo-preview {
      width: 72px; height: 72px; border-radius: 50%;
      background: var(--accent-bg); color: var(--accent-text);
      display: flex; align-items: center; justify-content: center;
      font-size: 22px; font-weight: 700; flex-shrink: 0;
      overflow: hidden; border: 2px solid var(--border-md);
      cursor: pointer; position: relative;
    }
    .photo-preview img { width: 100%; height: 100%; object-fit: cover; }
    .photo-preview .photo-overlay {
      position: absolute; inset: 0; background: rgba(0,0,0,0.45);
      display: flex; align-items: center; justify-content: center;
      opacity: 0; transition: opacity 0.15s; border-radius: 50%;
      color: #fff; font-size: 18px;
    }
    .photo-preview:hover .photo-overlay { opacity: 1; }
    .photo-upload-info { flex: 1; }
    .photo-upload-info p { font-size: 12px; color: var(--text-2); margin-top: 4px; }
    .btn-remove-photo { font-size: 11px; color: #ef4444; background: none; border: none; cursor: pointer; padding: 0; margin-top: 6px; display: none; }
    .btn-remove-photo.visible { display: inline; }
    #emp-foto-input { display: none; }
    .avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
    .lp-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

    /* FAMILIARES */
    .fam-table { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 4px; }
    .fam-table th { text-align: left; font-size: 11px; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: .5px; padding: 6px 8px; border-bottom: 1px solid var(--border); }
    .fam-table td { padding: 6px 4px; border-bottom: 1px solid var(--border); vertical-align: middle; }
    .fam-table tr:last-child td { border-bottom: none; }
    .fam-table .form-input { padding: 5px 8px; font-size: 12px; }
    .fam-empty { text-align: center; color: var(--text-3); font-size: 12px; padding: 1.5rem 0; }
#familiares-list { overflow-x: auto; }
.fam-table { min-width: 480px; }

    /* MODAL EMPLEADO — TABS */
    .modal-overlay:has(.modal-emp).open { align-items: flex-start; padding: 20px; }
    .modal-emp {
      max-width: none !important;
      width: min(1100px, 96vw) !important;
      max-height: calc(100vh - 40px);
      display: flex; flex-direction: column; overflow: hidden;
      margin: auto;
    }
    .modal-emp .modal-title { flex-shrink: 0; }
    .modal-emp .modal-tabs { flex-shrink: 0; }
    .modal-emp .modal-footer { flex-shrink: 0; }
    .modal-emp .modal-tab-pane.active { overflow-y: auto; flex: 1; padding-right: 2px; }
    .modal-tabs { display: flex; gap: 0; border-bottom: 1px solid var(--border); margin-bottom: 1rem; }
    .modal-tab-btn { padding: 8px 18px; font-size: 13px; font-weight: 500; border: none; background: transparent; cursor: pointer; color: var(--text-2); border-bottom: 2px solid transparent; margin-bottom: -1px; transition: color 0.12s, border-color 0.12s; white-space: nowrap; }
    .modal-tab-btn:hover { color: var(--text); }
    .modal-tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
    .modal-tab-pane { display: none; }
    .modal-tab-pane.active { display: block; }
    .modal-section-title { font-size: 11px; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: .6px; padding: 8px 0 5px; border-bottom: 1px solid var(--border); margin-bottom: 2px; }

    /* FIELD ROW — etiqueta izq (fija), input der */
    .field-row {
      display: flex; align-items: center; gap: 8px;
      padding: 5px 0; border-bottom: 1px solid var(--border);
    }
    .field-row:last-child { border-bottom: none; }
    .field-row-label {
      font-size: 12px; font-weight: 500; color: var(--text-2);
      text-align: right; white-space: nowrap;
      flex: 0 0 100px; padding-right: 6px;
    }
    .field-row-label.req::after { content: ' *'; color: var(--accent); }
    .field-row-input { flex: 1; display: flex; gap: 6px; align-items: center; min-width: 0; }
    .field-row-input .form-input { flex: 1; min-width: 0; }

    /* FIELD GRID — dos field-row por línea (default) */
    .field-grid {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 0 16px;
    }
    .field-grid.cols-3 { grid-template-columns: 1fr 1fr 1fr; }
    .field-grid .field-row { border-bottom: 1px solid var(--border); }
    .field-grid .field-row:nth-last-child(-n+2) { border-bottom: none; }
    .field-grid.cols-3 .field-row:nth-last-child(-n+2) { border-bottom: 1px solid var(--border); }
    .field-grid.cols-3 .field-row:nth-last-child(-n+3) { border-bottom: none; }
    /* fila que ocupa todo el ancho */
    .field-row.full { grid-column: 1 / -1; }

    /* LEGAJO PROFILE — nuevo diseño horizontal con tabs */
    .lp-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); margin-bottom: 1.5rem; overflow: hidden; }
    .lp-header { display: flex; align-items: center; gap: 16px; padding: 1.25rem 1.5rem; border-bottom: 1px solid var(--border); background: var(--accent-bg); flex-wrap: wrap; }
    .lp-header > div:not(.lp-avatar):not(.lp-header-actions) { flex: 1; min-width: 0; }
    .lp-avatar { width: 52px; height: 52px; border-radius: 50%; background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 17px; font-weight: 700; flex-shrink: 0; }
    .lp-name { font-size: 17px; font-weight: 700; letter-spacing: -0.2px; color: var(--text); }
    .lp-sub { font-size: 12px; color: var(--text-2); margin-top: 2px; }
    .lp-header-actions { margin-left: auto; display: flex; gap: 6px; }

    .lp-tabs { display: flex; padding: 0 1.5rem; border-bottom: 1px solid var(--border); background: var(--surface); overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .lp-tab-btn { padding: 10px 14px; font-size: 12px; font-weight: 500; border: none; background: transparent; cursor: pointer; color: var(--text-2); border-bottom: 2px solid transparent; margin-bottom: -1px; transition: color 0.12s, border-color 0.12s; white-space: nowrap; flex-shrink: 0; }
    .lp-tab-btn:hover { color: var(--text); }
    .lp-tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
    .lp-tab-pane { display: none; padding: 1rem 1.5rem; }
    .lp-tab-pane.active { display: block; }

    .lp-field-grid { display: flex; flex-direction: column; gap: 0; }
    .lp-field {
      display: flex; flex-direction: row; align-items: baseline;
      gap: 8px; padding: 7px 0;
      border-bottom: 1px solid var(--border);
    }
    .lp-field:last-child { border-bottom: none; }
    .lp-field-label {
      font-size: 11.5px; font-weight: 600; color: var(--text-3);
      white-space: nowrap; flex-shrink: 0; width: 170px; min-width: 130px;
    }
    .lp-field-value { font-size: 13px; color: var(--text); font-weight: 500; flex: 1; }
    .lp-field-value.empty { color: var(--text-3); font-weight: 400; font-style: italic; padding: 0; text-align: left; }
    .lp-field-grid + div { margin-top: 18px; }   /* aire antes de cada sección (Domicilio, Contacto…) */
    .lp-tab-btn:focus { outline: none; }
    .lp-tab-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: 4px; }

    @media (max-width: 768px) {
      .sidebar { width: 64px; }
      .sidebar-brand-name { display: none; }
      .sidebar-brand { padding: 10px 4px; }
      .sidebar-logo { width: 40px; height: 34px; }
      #sidebar-empresa-nombre { display: none !important; }
      .nav-btn span { display: none; }
      .nav-btn { justify-content: center; padding: 10px; }
      .sidebar-footer { padding: 8px 4px; }
      .sidebar-user {
        flex-direction: column; gap: 6px; padding: 8px 2px; background: none;
      }
      .sidebar-user .header-user-clickable { flex: none; }
      .sidebar-user .header-user-name { display: none; }
      .dark-toggle { font-size: 11px; }
      .main-content { margin-left: 64px; }
    }
    @media (max-width: 600px) {
      .container { padding: 1rem; }
      .form-grid { grid-template-columns: 1fr; }
      .field-row { grid-template-columns: 1fr; }
      .field-row-label { text-align: left; }
      .field-grid { grid-template-columns: 1fr; }
      .lp-field-label { width: 120px; min-width: 100px; font-size: 11px; }

      .emp-item { flex-wrap: wrap; row-gap: 8px; padding: 12px 1rem; }
      .emp-info { flex: 1 1 calc(100% - 54px); }
      .emp-meta { white-space: normal; overflow: visible; text-overflow: clip; }
      .emp-badge { order: 3; margin-left: 54px; }
      .emp-actions { order: 4; margin-left: auto; }

      .modal { padding: 1.25rem 1rem; }
      .modal-footer {
        flex-wrap: wrap; justify-content: stretch;
      }
      .modal-footer .btn {
        flex: 1 1 auto; justify-content: center; white-space: normal;
      }

      .field-grid.cols-3 { grid-template-columns: 1fr !important; }
      .field-grid.cols-3 .field-row { border-bottom: 1px solid var(--border) !important; }
      .field-grid.cols-3 .field-row:last-child { border-bottom: none !important; }
      .modal-tabs {
        overflow-x: auto; flex-wrap: nowrap; -webkit-overflow-scrolling: touch;
      }
      .modal-tab-btn { padding: 8px 12px; font-size: 12px; flex-shrink: 0; }
      .modal-emp { padding: 1rem !important; }
    }
    /* ── Turno médico: imágenes en observación ── */
    .obs-img-dropzone {
      display: flex; flex-direction: column; align-items: center; justify-content: center;
      border: 2px dashed var(--border-md); border-radius: var(--radius-md);
      padding: 20px; cursor: pointer; gap: 4px;
      transition: border-color .15s, background .15s;
      user-select: none;
    }
    .obs-img-dropzone:hover,
    .obs-img-dropzone.drag-over {
      border-color: var(--accent);
      background: var(--accent-bg);
    }
    .obs-img-dropzone.drag-over {
      border-style: solid;
      transform: scale(1.01);
    }
    .obs-imgs-preview {
      display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px;
    }
    .obs-img-thumb {
      position: relative; width: 88px; height: 88px; border-radius: var(--radius-sm);
      overflow: hidden; border: 1px solid var(--border);
    }
    .obs-img-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; cursor: pointer; }
    .obs-img-thumb .btn-rm-img {
      position: absolute; top: 3px; right: 3px; width: 20px; height: 20px;
      background: rgba(0,0,0,.55); color: #fff; border: none; border-radius: 50%;
      font-size: 12px; cursor: pointer; display: flex; align-items: center; justify-content: center;
      line-height: 1;
    }
    .obs-img-thumb .btn-rm-img:hover { background: #ef4444; }

    /* Galería en el timeline */
    .tl-imgs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
    .tl-img-thumb {
      width: 80px; height: 80px; border-radius: var(--radius-sm);
      overflow: hidden; border: 1px solid var(--border); cursor: pointer;
      transition: transform .12s;
    }
    .tl-img-thumb:hover { transform: scale(1.05); }
    .tl-img-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

    /* Lightbox */
    .lightbox-overlay {
      position: fixed; inset: 0; background: rgba(0,0,0,.85); z-index: 9999;
      display: flex; align-items: center; justify-content: center; padding: 20px;
    }
    .lightbox-overlay img { max-width: 90vw; max-height: 90vh; border-radius: 8px; object-fit: contain; }
    .lightbox-close {
      position: absolute; top: 16px; right: 20px; color: #fff; font-size: 32px;
      cursor: pointer; background: none; border: none; line-height: 1;
    }

/* v230: servicios que realiza el empleado */
.emp-servicios { display: flex; flex-wrap: wrap; gap: 6px; }
.emp-srv-chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border: 1px solid var(--border-md); border-radius: 999px; font-size: 12.5px; cursor: pointer; color: var(--text); }
.emp-srv-chip:has(input:checked) { background: var(--accent-bg); border-color: var(--accent); color: var(--accent-text); }
.emp-srv-chip input { accent-color: var(--accent); }
.emp-srv-tag { display: inline-block; font-size: 11.5px; padding: 1px 8px; border-radius: 999px; background: var(--accent-bg); color: var(--accent-text); margin: 1px 2px 1px 0; }
