/* ═══════════════════════════════════════════════════════
   SISTEMA DE ASISTENCIA — UGEL LAURICOCHA
   Diseño moderno · Inter · Modo claro/oscuro
═══════════════════════════════════════════════════════ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* ── Variables modo claro ── */
:root {
  --accent:        #1e3a5f;
  --accent-mid:    #2563eb;
  --accent-light:  #dbeafe;
  --accent-text:   #1e40af;
  --green:         #0f766e;
  --green-light:   #ccfbf1;
  --green-dark:    #115e59;
  --red:           #dc2626;
  --red-light:     #fee2e2;
  --amber:         #d97706;
  --amber-light:   #fef3c7;
  --ink:           #0f172a;
  --ink-mid:       #1e293b;
  --muted:         #64748b;
  --subtle:        #94a3b8;
  --line:          #e2e8f0;
  --line-soft:     #f1f5f9;
  --bg:            #f1f5f9;
  --bg-alt:        #e8edf5;
  --panel:         #ffffff;
  --panel-soft:    #f8fafc;
  --shadow-sm:     0 1px 3px rgba(0,0,0,.06);
  --shadow-md:     0 4px 16px rgba(0,0,0,.08);
  --radius-sm:     6px;
  --radius-md:     10px;
  --radius-lg:     14px;
  --radius-xl:     20px;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 14px;
  color-scheme: light;
}

/* ── Variables modo oscuro ── */
[data-theme="dark"] {
  --accent:        #3b82f6;
  --accent-mid:    #60a5fa;
  --accent-light:  #1e3a5f;
  --accent-text:   #93c5fd;
  --green:         #10b981;
  --green-light:   #064e3b;
  --green-dark:    #34d399;
  --red:           #f87171;
  --red-light:     #450a0a;
  --amber:         #fbbf24;
  --amber-light:   #451a03;
  --ink:           #f1f5f9;
  --ink-mid:       #e2e8f0;
  --muted:         #94a3b8;
  --subtle:        #64748b;
  --line:          #1e293b;
  --line-soft:     #0f172a;
  --bg:            #0a0f1e;
  --bg-alt:        #0f172a;
  --panel:         #111827;
  --panel-soft:    #1e293b;
  --shadow-sm:     0 1px 3px rgba(0,0,0,.3);
  --shadow-md:     0 4px 16px rgba(0,0,0,.4);
  color-scheme: dark;
}
[data-theme="dark"] .flatpickr-calendar {
  background: var(--panel);
  border-color: var(--line);
  color: var(--ink);
  box-shadow: var(--shadow-md);
}
[data-theme="dark"] .flatpickr-day {
  color: var(--ink);
}
[data-theme="dark"] .flatpickr-day:hover {
  background: var(--panel-soft);
}
[data-theme="dark"] .flatpickr-months,
[data-theme="dark"] .flatpickr-weekdays,
[data-theme="dark"] span.flatpickr-weekday {
  background: var(--panel);
  color: var(--muted);
}
[data-theme="dark"] .flatpickr-current-month input.cur-year,
[data-theme="dark"] .flatpickr-current-month .flatpickr-monthDropdown-months {
  color: var(--ink);
}
[data-theme="dark"] .flatpickr-day.today {
  border-color: var(--accent-mid);
}
[data-theme="dark"] .flatpickr-calendar {
  background: var(--panel) !important;
  border-color: var(--line) !important;
  color: var(--ink) !important;
}
[data-theme="dark"] .flatpickr-day {
  color: var(--ink) !important;
}
[data-theme="dark"] .flatpickr-months,
[data-theme="dark"] .flatpickr-weekdays,
[data-theme="dark"] span.flatpickr-weekday {
  background: var(--panel) !important;
  color: var(--muted) !important;
}
[data-theme="dark"] .flatpickr-current-month input.cur-year,
[data-theme="dark"] .flatpickr-current-month .flatpickr-monthDropdown-months {
  color: var(--ink) !important;
}

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

body {
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
  transition: background .3s, color .3s;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 14px;
  line-height: 1.5;
}

body:not(.is-logged-in) .app-content { display: none !important; }
body.is-logged-in .login-screen      { display: none !important; }

button, input, select, textarea { font: inherit; }

/* ═══════════════════════════════════════════════════════
   TOGGLE DARK/LIGHT MODE
═══════════════════════════════════════════════════════ */
.theme-toggle {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9990;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1.5px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  transition: all .2s;
  line-height: 1;
}
.theme-toggle:hover {
  transform: scale(1.08);
  border-color: var(--accent-mid);
}

/* ═══════════════════════════════════════════════════════
   LOGIN — fondo + glassmorphism
═══════════════════════════════════════════════════════ */
.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
  background: #0a1628;
}
.login-bg {
  position: absolute; inset: 0;
  background-image: url('foto-lauricocha.jpg');
  background-size: cover;
  background-position: center 30%;
  opacity: 0.65;
  filter: saturate(1.1) brightness(0.85);
}
.login-bg-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to bottom, rgba(5,15,35,.3) 0%, rgba(5,15,35,.55) 60%, rgba(5,15,35,.75) 100%);
}
.login-card {
  position: relative; z-index: 2;
  width: min(440px, calc(100% - 32px));
  padding: 32px 30px 28px;
  background: rgba(255,255,255,.10);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(255,255,255,.22);
  border-radius: var(--radius-xl);
  box-shadow: 0 25px 60px rgba(0,0,0,.45);
  text-align: center;
}
.login-brand {
  display: flex; flex-direction: column;
  align-items: center; gap: 10px;
  margin-bottom: 20px;
}
.login-logo-official {
  width: 100px; height: 100px;
  object-fit: contain; border-radius: 50%;
  border: 2px solid rgba(255,255,255,.35);
  background: rgba(255,255,255,.1);
}
.login-rrhh-logo {
  display: block;
  width: min(280px, 85%); height: auto; max-height: 60px;
  object-fit: contain;
  filter: brightness(0) invert(1); opacity: .9;
}
.login-card h1 { font-size: 20px; font-weight: 700; color: #fff; margin-bottom: 4px; }
.login-card .eyebrow {
  font-size: 11px; font-weight: 600;
  color: rgba(255,255,255,.55);
  text-transform: uppercase; letter-spacing: .08em; margin-bottom: 6px;
}
.login-subtitle { font-size: 12px; color: rgba(255,255,255,.45); margin-bottom: 22px; line-height: 1.5; }

.access-grid { display: grid; gap: 10px; }
.access-grid label {
  display: grid; gap: 5px;
  color: rgba(255,255,255,.6);
  font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .05em; text-align: left;
}
.access-grid input,
.access-grid select {
  width: 100%; min-height: 42px; padding: 10px 14px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255,255,255,.2);
  background: rgba(255,255,255,.1);
  color: #fff; font-size: 13px; outline: none;
  transition: border-color .2s, background .2s;
}
.access-grid input::placeholder { color: rgba(255,255,255,.3); }
.access-grid input:focus { border-color: rgba(37,99,235,.7); background: rgba(255,255,255,.15); }
.access-grid input option, .access-grid select option { background: #1e293b; color: #fff; }

#userSchoolWrap  { display: none !important; }
#userRoleWrap    { display: none; }
#adminUserWrap, #adminPasswordWrap,
#rrhhUserWrap,  #rrhhPasswordWrap  { display: none !important; }
body.show-internal-login #userRoleWrap { display: grid !important; }

#applySessionBtn {
  min-height: 44px; width: 100%;
  border-radius: var(--radius-md); border: none;
  background: linear-gradient(135deg, #1e3a5f, #2563eb);
  color: #fff; font-size: 14px; font-weight: 600;
  cursor: pointer; letter-spacing: .02em;
  transition: opacity .2s, transform .1s; margin-top: 4px;
}
#applySessionBtn:hover  { opacity: .9; }
#applySessionBtn:active { transform: scale(.98); }

.link-button {
  background: transparent; border: none;
  color: rgba(255,255,255,.4); font-size: 11px;
  cursor: pointer; text-decoration: underline;
  min-height: auto; padding: 2px 0;
}
.link-button:hover { color: rgba(255,255,255,.7); }
#sessionInfo { font-size: 11px; color: rgba(255,255,255,.35); }

/* ═══════════════════════════════════════════════════════
   APP ROOT
═══════════════════════════════════════════════════════ */
.app-root {
  display: flex; flex-direction: column;
  height: 100vh; overflow: hidden;
  background: var(--bg);
}

/* ═══════════════════════════════════════════════════════
   TOPBAR
═══════════════════════════════════════════════════════ */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 7px 16px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  flex-shrink: 0; gap: 12px; z-index: 10;
  transition: background .3s, border-color .3s;
}
.topbar-left  { display: flex; align-items: center; gap: 10px; }
.topbar-brand { display: flex; align-items: center; gap: 8px; }
.tb-logo-ugel { width: 34px; height: 34px; border-radius: 50%; object-fit: contain; }
.tb-logo-rrhh { width: 105px; height: auto; max-height: 32px; object-fit: contain; }
.tb-titles    { display: grid; gap: 1px; }
.tb-system    { font-size: 11px; font-weight: 700; color: var(--ink); letter-spacing: -.01em; }
.tb-sub       { font-size: 10px; color: var(--muted); }

.topbar-center { flex: 1; display: flex; justify-content: center; }
.user-chip {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 12px; border-radius: 20px;
  background: var(--panel-soft); border: 1px solid var(--line);
  transition: background .3s;
}
.user-avatar {
  width: 26px; height: 26px; border-radius: 50%;
  background: linear-gradient(135deg, #1e3a5f, #2563eb);
  display: flex; align-items: center; justify-content: center;
  font-size: 9px; font-weight: 700; color: #fff; flex-shrink: 0;
}
.user-name { font-size: 12px; font-weight: 600; color: var(--ink); display: block; }
.user-sub  { font-size: 10px; color: var(--muted); display: block; }

.topbar-right { display: flex; align-items: center; gap: 5px; }
.tb-status { font-size: 10px; color: var(--subtle); margin-right: 4px; white-space: nowrap; }

/* Botones topbar */
.tb-btn {
  padding: 5px 11px; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: var(--panel);
  color: var(--ink); font-size: 11px; font-weight: 600;
  cursor: pointer; transition: all .15s; white-space: nowrap;
  min-height: 30px;
}
.tb-btn:hover { border-color: var(--accent-mid); background: var(--accent-light); color: var(--accent-text); }
.tb-btn-primary { background: var(--accent-mid); border-color: var(--accent-mid); color: #fff; }
.tb-btn-primary:hover { opacity: .88; background: var(--accent-mid); color: #fff; }
.tb-btn-exit { border-color: var(--red-light); color: var(--red); }
.tb-btn-exit:hover { background: var(--red-light); border-color: var(--red); }
#submitBtn:disabled { background: var(--subtle); border-color: var(--subtle); cursor: not-allowed; opacity: .7; color: #fff; }

/* ═══════════════════════════════════════════════════════
   STEPS BAR
═══════════════════════════════════════════════════════ */
.steps-bar {
  display: flex; align-items: center;
  padding: 6px 14px;
  background: var(--panel); border-bottom: 1px solid var(--line);
  flex-shrink: 0; gap: 0; overflow-x: auto;
  transition: background .3s;
}
.step-item {
  display: flex; align-items: center; gap: 7px;
  padding: 5px 10px; border-radius: var(--radius-sm);
  cursor: pointer; transition: background .15s; flex-shrink: 0;
}
.step-item.active  { background: var(--accent-light); border: 1px solid #bfdbfe; }
.step-item.done    { opacity: .8; }
.step-item:hover   { background: var(--panel-soft); }
.step-circle {
  width: 24px; height: 24px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700; flex-shrink: 0;
}
.step-item.active  .step-circle { background: linear-gradient(135deg, #1e3a5f, #2563eb); color: #fff; }
.step-item.done    .step-circle { background: var(--green-light); color: var(--green-dark); }
.step-item.pending .step-circle { background: var(--panel-soft); color: var(--subtle); }
.step-title { font-size: 11px; font-weight: 600; display: block; }
.step-item.active  .step-title { color: var(--accent-text); }
.step-item.done    .step-title { color: var(--green); }
.step-item.pending .step-title { color: var(--subtle); }
.step-desc { font-size: 9px; color: var(--subtle); display: block; }
.step-arrow { color: var(--line); margin: 0 2px; font-size: 15px; flex-shrink: 0; }

/* ═══════════════════════════════════════════════════════
   LAYOUT
═══════════════════════════════════════════════════════ */
.app-layout { display: flex; flex: 1; overflow: hidden; }

/* ═══════════════════════════════════════════════════════
   SIDEBAR
═══════════════════════════════════════════════════════ */
.sidebar {
  width: 185px; background: var(--panel);
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column;
  flex-shrink: 0; overflow-y: auto;
  transition: background .3s, border-color .3s;
}
.nav-group  { padding: 8px 0; flex: 1; }
.nav-separator { height: 1px; background: var(--line); margin: 5px 0; }
.nav-item {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 12px; cursor: pointer;
  transition: background .15s;
  border-left: 3px solid transparent;
}
.nav-item:hover  { background: var(--panel-soft); }
.nav-item.active { background: var(--accent-light); border-left-color: var(--accent-mid); }
.nav-icon  { font-size: 14px; width: 22px; text-align: center; flex-shrink: 0; }
.nav-label { font-size: 12px; font-weight: 500; flex: 1; }
.nav-item.active .nav-label     { color: var(--accent-text); font-weight: 600; }
.nav-item:not(.active) .nav-label { color: var(--muted); }
.nav-badge {
  padding: 1px 6px; border-radius: 10px;
  font-size: 10px; font-weight: 700;
  background: var(--green-light); color: var(--green);
}
.sidebar-status {
  padding: 10px 12px; border-top: 1px solid var(--line);
  background: var(--panel-soft);
}
.status-title { font-size: 9px; font-weight: 700; color: var(--subtle); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 6px; }
.status-row   { display: flex; align-items: center; gap: 6px; padding: 2px 0; font-size: 11px; color: var(--muted); }
.status-dot   { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.dot-ok       { background: #22c55e; }
.dot-pending  { background: var(--line); }

/* ═══════════════════════════════════════════════════════
   CONTENT AREA
═══════════════════════════════════════════════════════ */
.content-area { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; }
.content-panel { display: none; flex-direction: column; gap: 10px; }
.content-panel.active { display: flex; }

/* Panel header */
.panel-header {
  display: flex; align-items: center; gap: 12px;
  padding-bottom: 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px;
}
.panel-header-icon {
  width: 38px; height: 38px; border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 17px; flex-shrink: 0;
}
.panel-title    { font-size: 15px; font-weight: 700; color: var(--ink); }
.panel-subtitle { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* Info banner */
.info-banner {
  padding: 8px 12px; border-radius: var(--radius-sm);
  background: var(--accent-light); border: 1px solid #bfdbfe;
  color: var(--accent-text); font-size: 12px; font-weight: 500;
}

/* Panel footer */
.panel-footer {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 14px; background: var(--panel);
  border: 1px solid var(--line); border-radius: var(--radius-md); margin-top: 4px;
}
.panel-footer-info { font-size: 11px; color: var(--subtle); }

/* ═══════════════════════════════════════════════════════
   FORMULARIOS
═══════════════════════════════════════════════════════ */
label {
  display: grid; gap: 4px;
  color: var(--muted); font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .04em;
}
.field-label { display: grid; gap: 4px; font-size: 10px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.field-label.span2 { grid-column: span 2; }
.required-star { color: var(--red); font-weight: 700; }

input, select {
  width: 100%; min-height: 36px;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  color: var(--ink); background: var(--panel);
  padding: 7px 10px; font-size: 12px;
  text-transform: none; transition: border-color .15s, background .2s;
}
input:focus, select:focus { outline: none; border-color: var(--accent-mid); }
input[readonly] { background: var(--panel-soft); color: var(--muted); }

.field-input {
  padding: 7px 10px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--panel); color: var(--ink); font-size: 12px;
  transition: border-color .15s; text-transform: none; width: 100%; min-height: 34px;
}
.field-input:focus { outline: none; border-color: var(--accent-mid); }
.field-input[readonly] { background: var(--panel-soft); color: var(--muted); }

/* Grids de formulario */
.form-grid-4    { display: grid; grid-template-columns: repeat(4, minmax(130px,1fr)); gap: 10px; }
.form-grid-staff {
  display: grid;
  grid-template-columns: 95px minmax(170px,2fr) repeat(5, minmax(105px,1fr));
  align-items: end; gap: 10px;
}
.send-form-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; }
.send-form-grid .span2 { grid-column: span 2; }

/* ═══════════════════════════════════════════════════════
   BOTONES
═══════════════════════════════════════════════════════ */
button {
  min-height: 36px; border: 1px solid var(--line);
  border-radius: var(--radius-sm); background: var(--panel);
  color: var(--ink); cursor: pointer; font-weight: 600;
  padding: 6px 14px; font-size: 12px;
  transition: border-color .15s, background .15s;
}
button:hover { border-color: var(--accent-mid); background: var(--accent-light); color: var(--accent-text); }

.btn-action {
  padding: 6px 13px; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: var(--panel);
  color: var(--ink); font-size: 12px; font-weight: 600;
  cursor: pointer; white-space: nowrap;
}
.btn-action:hover { border-color: var(--green); background: var(--green-light); color: var(--green); }

.btn-prev {
  padding: 6px 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: var(--panel);
  color: var(--muted); font-size: 12px; font-weight: 600; cursor: pointer;
}
.btn-next {
  padding: 6px 14px; border-radius: var(--radius-sm); border: none;
  background: linear-gradient(135deg, #1e3a5f, #2563eb);
  color: #fff; font-size: 12px; font-weight: 600; cursor: pointer;
}
.btn-send-final {
  padding: 8px 22px; border-radius: var(--radius-sm); border: none;
  background: linear-gradient(135deg, #1e3a5f, #2563eb);
  color: #fff; font-size: 13px; font-weight: 700; cursor: pointer;
}
.btn-send-final:hover { opacity: .9; }
.btn-pdf {
  padding: 8px 18px; border-radius: var(--radius-sm);
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
  border: none; color: #fff; font-size: 13px; font-weight: 700; cursor: pointer;
}
.btn-pdf:hover { opacity: .9; }
.btn-save-final {
  padding: 7px 16px; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: var(--panel);
  color: var(--ink); font-size: 12px; font-weight: 600; cursor: pointer;
}

/* Botones RRHH */
.btn-rrhh-ok {
  padding: 3px 8px; border-radius: 5px; border: 1px solid #bbf7d0;
  background: var(--green-light); color: var(--green);
  font-size: 10px; font-weight: 700; cursor: pointer; margin-right: 4px;
}
.btn-rrhh-obs {
  padding: 3px 8px; border-radius: 5px; border: 1px solid var(--amber-light);
  background: var(--amber-light); color: var(--amber);
  font-size: 10px; font-weight: 700; cursor: pointer;
}

/* ═══════════════════════════════════════════════════════
   TABLAS
═══════════════════════════════════════════════════════ */
.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.dashboard-table { max-height: 360px; }

.data-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.data-table th {
  padding: 7px 9px; background: var(--panel-soft); color: var(--muted);
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
  border-bottom: 1px solid var(--line); text-align: left;
}
.data-table td { padding: 7px 9px; border-bottom: 1px solid var(--line-soft); color: var(--ink); }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--panel-soft); }

/* Personal por nivel */
.staff-level-section { margin-bottom: 14px; border: 1px solid var(--line); border-radius: var(--radius-md); overflow: hidden; }
.staff-level-header {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 14px; background: var(--panel-soft);
  border-bottom: 1px solid var(--line);
}
.staff-level-name  { font-weight: 700; font-size: 13px; color: var(--ink); flex: 1; }
.staff-level-code  { font-size: 11px; color: var(--muted); }
.staff-level-code strong { color: var(--green); font-weight: 700; }
.staff-level-count {
  font-size: 11px; color: var(--subtle);
  background: var(--panel-soft); padding: 2px 8px;
  border-radius: 10px; border: 1px solid var(--line);
}

/* Tabla oficial staff */
.official-staff-wrap { max-height: calc(100vh - 210px); overflow-y: auto; }
#officialStaffTable { font-size: 12px; }
#officialStaffTable th { padding: 6px 8px; font-size: 10px; }
#officialStaffTable td { padding: 5px 8px; border-bottom: 1px solid var(--line-soft); }
#officialStaffTable tr:hover td { background: var(--panel-soft); }

/* Tabla RRHH y director */
#directorAccessTable, #rrhhTable {
  width: 100%; min-width: 1080px;
  border-collapse: collapse; font-size: 12px;
}
#directorAccessTable th, #directorAccessTable td,
#rrhhTable th, #rrhhTable td {
  border: 1px solid var(--line); padding: 6px 8px; text-align: left;
}
#directorAccessTable th, #rrhhTable th {
  background: var(--panel-soft); font-weight: 700; color: var(--muted);
  font-size: 10px; text-transform: uppercase; letter-spacing: .04em;
}

/* ═══════════════════════════════════════════════════════
   TARJETA DE ASISTENCIA
═══════════════════════════════════════════════════════ */
.attendance-table {
  width: 100%; min-width: 1180px;
  border-collapse: collapse; font-size: 11px;
}
.annex04-table {
  width: 100%; min-width: 1120px;
  border-collapse: collapse; font-size: 10px;
}
.annex04-table thead {
  display: table-header-group;
}
.annex04-table tbody {
  display: table-row-group;
}
.attendance-table th, .attendance-table td,
.annex04-table th, .annex04-table td {
  border: 1px solid var(--line); padding: 4px;
  text-align: center; vertical-align: middle; white-space: pre-line;
}
.attendance-table th, .annex04-table th { background: var(--panel-soft); font-weight: 700; }
.num-col      { width: 30px; }
.dni-col      { width: 78px; }
.name-col     { min-width: 200px; text-align: left !important; white-space: normal; word-break: break-word; }
.role-col     { min-width: 120px; text-align: left !important; }
.condition-col, .hours-col { width: 75px; }
.note-col     { color: var(--ink); font-weight: 700; text-align: left !important; }

.attendance-table select {
  min-width: 34px; width: 34px; min-height: 28px;
  border-radius: 4px; padding: 2px; text-align: center;
  background: var(--panel); color: var(--ink);
}
.weekend        { background: var(--amber-light) !important; }
.weekend-locked { background: var(--panel-soft) !important; pointer-events: none; }
.weekend-locked select { background: var(--panel-soft); color: var(--subtle); border-color: var(--line); }

/* Celda tardanza */
td.has-tardanza { background: #fef9c3 !important; }
[data-theme="dark"] td.has-tardanza { background: #451a03 !important; }

/* ═══════════════════════════════════════════════════════
   PANEL BIENVENIDA
═══════════════════════════════════════════════════════ */
.welcome-card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 20px;
  box-shadow: var(--shadow-sm);
}
.welcome-header {
  display: flex; align-items: center; gap: 14px;
  padding-bottom: 14px; border-bottom: 1px solid var(--line); margin-bottom: 14px;
}
.welcome-avatar {
  width: 50px; height: 50px; border-radius: 50%;
  background: linear-gradient(135deg, #1e3a5f, #2563eb);
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 700; color: #fff; flex-shrink: 0;
}
.welcome-name   { font-size: 15px; font-weight: 700; color: var(--ink); }
.welcome-ie     { font-size: 12px; color: var(--accent-mid); font-weight: 600; margin-top: 2px; }
.welcome-period { font-size: 11px; color: var(--subtle); margin-top: 2px; }
.welcome-title  { font-size: 13px; font-weight: 700; color: var(--ink); margin-bottom: 12px; }

/* Timeline */
.timeline { display: grid; gap: 0; }
.tl-item {
  display: flex; gap: 12px;
  padding-bottom: 16px; position: relative;
}
.tl-item:not(:last-child)::before {
  content: ''; position: absolute;
  left: 12px; top: 27px; bottom: 0;
  width: 2px; background: var(--line);
}
.tl-dot {
  width: 26px; height: 26px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700; z-index: 1;
  background: var(--panel-soft); color: var(--subtle);
  border: 2px solid var(--line);
}
.tl-item.tl-done .tl-dot { background: var(--green-light); color: var(--green); border-color: var(--green); }
.tl-item.tl-active .tl-dot { background: linear-gradient(135deg,#1e3a5f,#2563eb); color: #fff; border-color: var(--accent-mid); }
.tl-content { flex: 1; padding-top: 3px; }
.tl-title   { font-size: 13px; font-weight: 700; color: var(--ink); margin-bottom: 3px; }
.tl-item.tl-done .tl-title { color: var(--green); }
.tl-desc    { font-size: 12px; color: var(--muted); line-height: 1.4; margin-bottom: 8px; }
.tl-btn {
  padding: 5px 13px; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: var(--panel);
  color: var(--ink); font-size: 11px; font-weight: 600; cursor: pointer;
}
.tl-btn:hover { border-color: var(--accent-mid); color: var(--accent-text); }
.tl-btn-primary {
  background: linear-gradient(135deg, #1e3a5f, #2563eb);
  border-color: var(--accent-mid); color: #fff;
}
.tl-btn-primary:hover { opacity: .9; }
.tl-item.tl-done .tl-btn { display: none; }
.tl-item.tl-done .tl-desc { color: var(--subtle); }

/* ═══════════════════════════════════════════════════════
   PERSONAL — FORMULARIO AGREGAR + RETIRAR
═══════════════════════════════════════════════════════ */
.staff-add-form {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius-md); padding: 14px; margin-top: 10px;
}
.add-staff-title {
  font-size: 13px; font-weight: 700; color: var(--ink);
  margin-bottom: 10px; padding-bottom: 8px; border-bottom: 1px solid var(--line);
}

/* Botón retirar trabajador */
.btn-retirar {
  padding: 4px 10px; border: none; border-radius: var(--radius-sm);
  font-size: 11px; font-weight: 700; cursor: pointer;
  background: var(--red-light); color: var(--red);
  transition: all .15s; white-space: nowrap;
}
.btn-retirar:hover   { background: var(--red); color: #fff; }
.btn-retirar.restaurar { background: var(--amber-light); color: var(--amber); }
.btn-retirar.restaurar:hover { background: var(--amber); color: #fff; }

/* Fila retirada */
tr.row-retirado td { opacity: .45; text-decoration: line-through; }
tr.row-retirado td:last-child { opacity: 1; text-decoration: none; }

/* ═══════════════════════════════════════════════════════
   KPIs
═══════════════════════════════════════════════════════ */
.kpi-row { display: grid; grid-template-columns: repeat(3, minmax(110px,1fr)); gap: 10px; margin-bottom: 12px; }
.kpi-card {
  padding: 11px 14px; border: 1px solid var(--line);
  border-radius: var(--radius-md); background: var(--panel-soft);
}
.kpi-card.kpi-accent { background: var(--green-light); border-color: #bbf7d0; }
.kpi-card strong { display: block; font-size: 22px; font-weight: 700; color: var(--ink); margin-bottom: 2px; }
.kpi-card.kpi-accent strong { color: var(--green); }
.kpi-card span { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }

/* ═══════════════════════════════════════════════════════
   RRHH CONTROLES
═══════════════════════════════════════════════════════ */
.rrhh-controls {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap;
  padding: 9px 12px; background: var(--panel-soft);
  border: 1px solid var(--line); border-radius: var(--radius-md); margin-bottom: 10px;
}
.rrhh-controls-left { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.filter-group { display: flex; align-items: center; gap: 6px; }
.filter-btns  { display: flex; gap: 4px; flex-wrap: wrap; }
.filter-btn {
  padding: 3px 11px; border-radius: 20px;
  border: 1px solid var(--line); background: var(--panel);
  color: var(--muted); font-size: 11px; font-weight: 600; cursor: pointer;
}
.filter-btn:hover  { border-color: var(--green); color: var(--green); }
.filter-btn.active { background: var(--green); border-color: var(--green); color: #fff; }

.rrhh-progress { display: flex; align-items: center; gap: 8px; }
.progress-bar-wrap { width: 110px; height: 7px; border-radius: 4px; background: var(--line); overflow: hidden; }
.progress-bar-fill { height: 100%; border-radius: 4px; background: linear-gradient(90deg,#1e3a5f,#2563eb); transition: width .4s ease; }
.progress-label { font-size: 11px; font-weight: 700; color: var(--accent-mid); white-space: nowrap; }

.rrhh-view-toggle { display: flex; gap: 5px; margin-bottom: 8px; }
.view-toggle-btn {
  padding: 4px 12px; border-radius: var(--radius-sm); font-size: 11px; font-weight: 700;
  border: 1px solid var(--line); background: var(--panel); color: var(--muted); cursor: pointer;
}
.view-toggle-btn.active { background: var(--accent-mid); border-color: var(--accent-mid); color: #fff; }

.rrhh-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(235px,1fr));
  gap: 10px;
}
.rrhh-card { transition: box-shadow .15s; }
.rrhh-card:hover { box-shadow: var(--shadow-md); }

/* ═══════════════════════════════════════════════════════
   CONFIG ROWS
═══════════════════════════════════════════════════════ */
.config-row {
  display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap;
  padding: 11px; border: 1px solid var(--line); border-radius: var(--radius-md);
  background: var(--panel-soft); margin-bottom: 10px;
}
.info-text { font-size: 11px; color: var(--muted); font-weight: 600; align-self: center; }

/* Import box */
.import-box {
  display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap;
  padding: 11px; border: 1px solid #bddbd8; border-radius: var(--radius-md);
  background: var(--green-light); margin-top: 8px;
}

/* ═══════════════════════════════════════════════════════
   PANEL ENVIAR
═══════════════════════════════════════════════════════ */
.send-block {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius-md); padding: 14px 16px; margin-bottom: 10px;
}
.send-block-title {
  font-size: 13px; font-weight: 700; color: var(--ink);
  margin-bottom: 11px; padding-bottom: 8px; border-bottom: 1px solid var(--line);
}
.send-block-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.send-hint  { font-size: 11px; color: var(--subtle); }
.send-warning {
  font-size: 11px; color: var(--amber);
  background: var(--amber-light); border: 1px solid #fde68a;
  border-radius: var(--radius-sm); padding: 6px 10px; margin-top: 8px;
}
.send-form-error {
  color: var(--amber); font-size: 11px; margin-top: 8px;
  background: var(--amber-light); border: 1px solid #fde68a;
  border-radius: var(--radius-sm); padding: 6px 10px;
}

/* Checklist */
.send-checklist { display: grid; gap: 5px; margin-bottom: 10px; }
.check-row {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 10px; border-radius: var(--radius-sm);
  background: var(--panel-soft); border: 1px solid var(--line); font-size: 12px;
}
.check-row span:first-child { font-size: 14px; }
.check-row span:nth-child(2){ flex: 1; color: var(--muted); }
.check-row strong { color: var(--ink); font-size: 11px; }

/* CONEI pill */
.conei-status-pill {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 20px;
  background: var(--panel-soft); border: 1px solid var(--line);
  font-size: 12px; font-weight: 600; white-space: nowrap;
}
.conei-status-pill.ok { background: var(--green-light); border-color: var(--green); color: var(--green); }
.conei-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }

/* ═══════════════════════════════════════════════════════
   MODAL
═══════════════════════════════════════════════════════ */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.5);
  display: flex; align-items: center; justify-content: center; z-index: 9999;
  backdrop-filter: blur(4px);
}
.modal-card {
  background: var(--panel); border-radius: var(--radius-lg);
  padding: 28px 28px 22px;
  width: min(430px, 92vw);
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
  border: 1px solid var(--line);
  display: flex; flex-direction: column; align-items: center;
  gap: 10px; text-align: center;
}
.modal-icon { font-size: 36px; margin-bottom: 2px; }
.modal-card h2 { font-size: 17px; font-weight: 700; color: var(--ink); margin: 0; }
.modal-desc  { font-size: 13px; color: var(--muted); margin: 0; line-height: 1.5; }
.modal-fields { width: 100%; display: flex; flex-direction: column; gap: 10px; text-align: left; }
.modal-error  { color: var(--red); font-size: 12px; margin: 0; }
.modal-actions { display: flex; gap: 10px; width: 100%; }
.modal-actions button { flex: 1; }

/* Modal éxito */
.success-modal  { gap: 14px; }
.success-icon   { font-size: 50px; }
.success-modal h2 { color: var(--green); font-size: 19px; }
.success-actions { display: flex; flex-direction: column; align-items: center; gap: 8px; width: 100%; }
.success-actions .btn-pdf { width: 100%; }

/* ═══════════════════════════════════════════════════════
   SELLO CONEI
═══════════════════════════════════════════════════════ */
.visado-stamp {
  display: none;
  min-width: 108px; min-height: 108px;
  border: 3px double var(--green); border-radius: 50%;
  color: var(--green); text-align: center;
  transform: rotate(-8deg); padding: 12px 8px;
  font-weight: 700; text-transform: uppercase;
  flex-direction: column; align-items: center; justify-content: center;
}
.visado-stamp.is-visible { display: flex; }
.visado-stamp strong { font-size: 15px; line-height: 1; }
.visado-stamp span, .visado-stamp small { display: block; font-size: 9px; }
.visado-stamp .stamp-ie { font-size: 8px; margin-top: 2px; font-weight: 700; }

/* ═══════════════════════════════════════════════════════
   LEYENDA + FIRMA — FORMATOS
═══════════════════════════════════════════════════════ */
.legend-sign-wrap { margin-top: 6px; }
.legend-two-col {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 4px 16px; margin-bottom: 8px;
  font-size: 10px; line-height: 1.6;
}
.legend-two-col > div { display: flex; flex-direction: column; }
.legend-two-col b { color: var(--green); }

.double-sign {
  display: grid; grid-template-columns: 1fr auto 1fr;
  align-items: flex-end; gap: 10px; margin-top: 12px;
  page-break-inside: avoid;
}
.sign-block { display: flex; flex-direction: column; align-items: center; text-align: center; }
.sign-box {
  width: 100%; min-height: 68px;
  border-bottom: 1px solid var(--ink);
  display: flex; align-items: flex-end; justify-content: center;
  margin-bottom: 4px; overflow: visible; position: relative;
}
.sign-box .signature-img[src] {
  max-height: 63px; width: auto; max-width: 200px;
  object-fit: contain; margin-bottom: 2px;
}
.sign-block p    { font-weight: 700; font-size: 10px; margin: 3px 0 1px; }
.sign-block span { font-size: 9px; color: var(--muted); }
.sign-center {
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; color: var(--ink); text-align: center; padding-bottom: 18px;
}
.conei-box { display: flex; align-items: center; justify-content: center; }
.conei-box .visado-stamp { position: static; transform: none; margin-bottom: 2px; }

/* Notas Anexo 04 */
.annex04-notes { margin: 5px 0; font-size: 9px; color: var(--muted); }
.annex04-notes p { margin: 1px 0; }

/* ═══════════════════════════════════════════════════════
   ENCABEZADO FORMATO OFICIAL (tabla)
═══════════════════════════════════════════════════════ */
.fmt-header-table { width: 100%; border-collapse: collapse; margin-bottom: 5px; font-size: 10px; }
.fmt-header-table td { border: 1px solid #444; padding: 2px 5px; vertical-align: middle; }
.fmt-header-table .fmt-lbl { background: var(--panel-soft); font-weight: 700; font-size: 9px; white-space: nowrap; color: var(--ink-mid); }
.fmt-header-table .fmt-val { font-size: 10px; font-weight: 500; color: var(--ink); }

/* ═══════════════════════════════════════════════════════
   FORMATOS DE IMPRESIÓN (oficio)
═══════════════════════════════════════════════════════ */
.report-page {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius-sm); margin-bottom: 16px; padding: 22px;
}
.office-page { min-height: 960px; }

.letterhead { display: grid; justify-items: center; gap: 4px; margin-bottom: 28px; text-align: center; }
.format-logos, .print-logos {
  display: flex; align-items: center; justify-content: center;
  gap: 12px; margin-bottom: 6px;
}
.print-logo-ugel  { width: 72px; height: 72px; object-fit: contain; }
.print-logo-rrhh  { width: 200px; height: auto; object-fit: contain; }
.format-logo-ugel { width: 44px; height: 44px; object-fit: contain; }
.format-logo-rrhh { width: 145px; height: auto; object-fit: contain; }
.letterhead p, .format-header p, .format-header h2 { margin-bottom: 0; }
.letterhead h2 { font-size: 20px; }
.letterhead span, .recipient span, .format-header span { display: block; }

.office-date    { margin-bottom: 22px; text-align: right; }
.office-number  { margin-bottom: 24px; font-weight: 700; }
.recipient      { display: grid; gap: 3px; margin-bottom: 20px; }
.recipient p    { margin-bottom: 0; }
.subject {
  display: grid; grid-template-columns: 72px 1fr;
  gap: 10px; margin-bottom: 18px; text-align: justify;
}
.office-body { max-width: 900px; line-height: 1.65; text-align: justify; }

.signature-block { display: grid; justify-items: center; margin-top: 42px; page-break-inside: avoid; }
.signature-img   { display: none; }
.signature-img[src] { display: block; }
.signature-block p { margin: 8px 0 2px; font-weight: 700; }
.signature-block span { color: var(--muted); }

.format-header { display: grid; justify-items: center; gap: 4px; margin-bottom: 8px; text-align: center; }
.norm-title { max-width: 1180px; font-size: 11px; line-height: 1.25; text-align: center; }
.format-header h2 { font-size: 15px; }

.letterhead-top {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 10px; border-bottom: 2px solid #333;
  padding-bottom: 8px; margin-bottom: 12px;
}
.letterhead-escudo { width: 73px; height: auto; flex-shrink: 0; }
.letterhead-ugel   { width: 78px; height: auto; flex-shrink: 0; }
.letterhead-text   { flex: 1; text-align: center; }
.letterhead-year   { font-size: 8px; color: #555; margin: 0 0 2px; font-style: italic; }
.letterhead-ie-label { font-size: 9px; font-weight: 700; margin: 0; letter-spacing: 1px; }
.letterhead-ie-name  { font-size: 13px; font-weight: 700; margin: 2px 0; text-transform: uppercase; }
.letterhead-detail   { font-size: 9px; color: #333; margin: 1px 0; }

.office-sign-wrap { display: flex; flex-direction: column; align-items: center; margin-top: 38px; }
.office-sign-img-box { width: 180px; height: 78px; display: flex; align-items: flex-end; justify-content: center; }
.office-signature-img { max-width: 180px; max-height: 78px; object-fit: contain; display: block; }
.office-sign-line { width: 220px; height: 1px; background: #333; margin: 4px 0; }

/* ═══════════════════════════════════════════════════════
   POPUP DE TARDANZA (nuevo — solo minutos)
═══════════════════════════════════════════════════════ */
.tardanza-popup {
  position: fixed; inset: 0; background: rgba(0,0,0,.45);
  display: flex; align-items: center; justify-content: center;
  z-index: 9998; backdrop-filter: blur(4px);
}
.tardanza-popup-card {
  background: var(--panel); border-radius: var(--radius-lg);
  padding: 24px 24px 20px;
  width: min(340px, 92vw); border: 1px solid var(--line);
  box-shadow: var(--shadow-md);
}
.tardanza-popup-title {
  font-size: 14px; font-weight: 700; color: var(--ink);
  margin-bottom: 4px;
}
.tardanza-popup-sub { font-size: 11px; color: var(--muted); margin-bottom: 16px; }
.tardanza-popup label { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; gap: 5px; margin-bottom: 14px; }
.tardanza-popup input[type="number"] {
  font-size: 22px; font-weight: 700; text-align: center;
  border: 2px solid var(--accent-mid); border-radius: var(--radius-md);
  background: var(--panel); color: var(--ink);
  padding: 10px; min-height: 54px;
}
.tardanza-popup-actions { display: flex; gap: 8px; margin-top: 4px; }
.tardanza-popup-actions button { flex: 1; }
.tardanza-hint { font-size: 10px; color: var(--subtle); margin-top: 6px; text-align: center; }

/* ═══════════════════════════════════════════════════════
   HIDE/SHOW POR ROL
═══════════════════════════════════════════════════════ */
body.is-director-role .director-hidden { display: none !important; }
body.is-director-role #panel-rrhh,
body.is-director-role #panel-admin,
body.is-director-role [data-nav="rrhh"],
body.is-director-role [data-nav="admin"] { display: none !important; }
.dashboard-panel[hidden],
#exportExcelBtn[hidden], #printBtn[hidden], #visadoBtn[hidden],
#submitBtn[hidden], #saveBtn[hidden], #printDocument[hidden] { display: none !important; }
#printDocument { display: none; }

/* ═══════════════════════════════════════════════════════
   PRINT
═══════════════════════════════════════════════════════ */
.annex04-page .table-wrap {
  overflow: visible;
}

@media print {
  @page { size: A4 landscape; margin: 9mm; }
  @page office-page { size: A4 portrait; margin: 15mm; }

  body { background: #fff !important; color: #000 !important; }
  .no-print { display: none !important; }
  .theme-toggle { display: none !important; }

  #printDocument { display: block !important; }
  .app-root, .login-screen { display: none !important; }

  .report-page {
    border: 0; border-radius: 0; margin: 0; padding: 0;
    min-height: 185mm; page-break-after: always;
    background: #fff !important;
  }
  .office-page { page: office-page; min-height: 260mm; }
  .attendance-page { page: A4 landscape; }
  .table-wrap { overflow: visible; }

  .attendance-table, .annex04-table { min-width: 0; font-size: 7.5px; }
  .attendance-table th, .attendance-table td,
  .annex04-table th,    .annex04-table td { border-color: #777; padding: 1.5px; }
  .attendance-table select {
    appearance: none; border: 0;
    min-width: 15px; width: 15px; min-height: 14px;
    padding: 0; background: transparent; color: #000; text-align: center;
  }
  .name-col { min-width: 110px; }
  .role-col { min-width: 80px; }

  .fmt-header-table { font-size: 7.5px; }
  .fmt-header-table .fmt-lbl { font-size: 7px; background: #eee; }
  .fmt-header-table .fmt-val { font-size: 7.5px; }
  .fmt-header-table td { padding: 1px 3px; }

  .format-header p, .format-header h2 { font-size: 10px; }
  .norm-title { font-size: 8px; }
  .format-logos { gap: 8px; margin-bottom: 3px; }
  .format-logo-ugel { width: 30px; height: 30px; }
  .format-logo-rrhh { width: 110px; }
  .legend-two-col { font-size: 7.5px; }
  .annex04-notes { font-size: 7.5px; }
  .sign-block p { font-size: 8.5px; }
  .sign-block span { font-size: 7.5px; }
.annex04-table thead { display: table-header-group; }
  .annex04-table th { font-size: 7px !important; padding: 1px 2px !important; }
  .annex04-table td { font-size: 7px !important; padding: 1px 2px !important; }
  .annex04-table .name-col { min-width: 68px !important; }
  .annex04-table thead { display: table-header-group !important; }
  .annex04-table tbody { display: table-row-group !important; }
  .annex04-table tfoot { display: table-footer-group !important; }
  .injected-annex { page-break-before: always; }
  .compact .attendance-table { font-size: 6.5px; }
}

/* ═══════════════════════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════════════════════ */
@media (max-width: 900px) {
  .sidebar { width: 46px; }
  .nav-label, .nav-badge, .sidebar-status,
  .step-text, .tb-titles, .tb-logo-rrhh { display: none; }
  .nav-icon { width: 100%; text-align: center; }
  .app-root { height: auto; overflow: visible; }
  .app-layout { flex-direction: column; }
  .content-area { overflow: visible; }
  .form-grid-4, .form-grid-staff, .send-form-grid { grid-template-columns: 1fr; }
  .field-label.span2 { grid-column: auto; }
}

@media (max-width: 768px) {
  .app-root { height: auto; overflow: visible; }
  .app-layout { flex-direction: column; overflow: visible; }
  .content-area { overflow: visible; padding: 8px; }

  .topbar { flex-wrap: wrap; padding: 8px 10px; gap: 6px; }
  .topbar-left { flex: 1; min-width: 0; }
  .tb-logo-rrhh { display: none; }
  .tb-logo-ugel { width: 28px; height: 28px; }
  .topbar-center { width: 100%; order: 3; }
  .user-chip { width: 100%; justify-content: flex-start; }
  .topbar-right { width: 100%; order: 2; justify-content: flex-end; gap: 4px; }
  .tb-btn { padding: 4px 8px; font-size: 11px; }
  .tb-status { display: none; }

  .steps-bar { padding: 5px 8px; overflow-x: auto; scrollbar-width: none; }
  .steps-bar::-webkit-scrollbar { display: none; }
  .step-item { padding: 4px 7px; gap: 4px; }
  .step-text { display: none; }
  .step-circle { width: 26px; height: 26px; font-size: 11px; }

  .sidebar {
    width: 100%; height: auto; border-right: none; border-top: 1px solid var(--line);
    order: 2; flex-direction: row; overflow-x: auto; padding: 0;
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 100;
    background: var(--panel); box-shadow: 0 -2px 8px rgba(0,0,0,.08);
  }
  .nav-group { display: flex; flex-direction: row; padding: 0; width: 100%; justify-content: space-around; }
  .nav-separator { display: none; }
  .nav-item {
    flex-direction: column; align-items: center; justify-content: center;
    padding: 5px 8px; border-left: none; border-top: 3px solid transparent;
    min-width: 50px; gap: 2px; flex: 1;
  }
  .nav-item.active { background: var(--accent-light); border-left: none; border-top-color: var(--accent-mid); }
  .nav-icon { font-size: 17px; width: auto; }
  .nav-label { font-size: 9px; display: block; text-align: center; }
  .sidebar-status { display: none; }
  .content-area { padding-bottom: 68px; }

  .kpi-row { grid-template-columns: repeat(3,1fr); gap: 6px; }
  .kpi-card { padding: 8px 10px; }
  .kpi-card strong { font-size: 18px; }

  .rrhh-controls { flex-direction: column; gap: 8px; }
  .rrhh-cards-grid { grid-template-columns: 1fr; }
  .official-staff-wrap { max-height: 50vh; }
  .send-form-grid { grid-template-columns: 1fr !important; }
  .send-form-grid .span2 { grid-column: auto !important; }
}