/* ===== Selector de Empresa Profesional (ámbar / naranja elegante) ===== */
.emp-selector{position:relative;display:inline-block}
.emp-trigger{display:flex;align-items:center;gap:11px;min-width:300px;max-width:430px;background:linear-gradient(135deg,#1a1305,#120d04);border:1px solid #5a3d12;border-radius:11px;padding:7px 12px;cursor:pointer;transition:.15s;font-family:'Exo 2',sans-serif}
.emp-trigger:hover{border-color:#b4791f;box-shadow:0 0 0 3px rgba(245,158,11,.13)}
.emp-trigger.open{border-color:#f59e0b;box-shadow:0 0 0 3px rgba(245,158,11,.25)}
.emp-trigger-ico{flex:0 0 auto;width:34px;height:34px;border-radius:9px;background:linear-gradient(135deg,#b45309,#f59e0b);display:flex;align-items:center;justify-content:center;color:#fff;box-shadow:0 3px 10px rgba(245,158,11,.4)}
.emp-trigger-txt{flex:1;display:flex;flex-direction:column;align-items:flex-start;min-width:0;line-height:1.25}
.emp-trigger-name{font-size:13.5px;font-weight:800;color:#fbe7cf;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:310px;letter-spacing:.3px}
.emp-trigger-rut{font-size:10.5px;color:#c79a5b;font-family:'Consolas',monospace}
.emp-trigger-chev{flex:0 0 auto;color:#d99a3a;transition:transform .2s}
.emp-trigger.open .emp-trigger-chev{transform:rotate(180deg)}
/* Empresa en uso (seleccionada) → recuadro en VERDE */
.emp-trigger.has-emp{background:linear-gradient(135deg,#072017,#04140d);border-color:#0f7a4d}
.emp-trigger.has-emp:hover{border-color:#10b981;box-shadow:0 0 0 3px rgba(16,185,129,.15)}
.emp-trigger.has-emp.open{border-color:#10b981;box-shadow:0 0 0 3px rgba(16,185,129,.28)}
.emp-trigger.has-emp .emp-trigger-ico{background:linear-gradient(135deg,#047857,#10b981);box-shadow:0 3px 10px rgba(16,185,129,.4)}
.emp-trigger.has-emp .emp-trigger-name{color:#eafff5}
.emp-trigger.has-emp .emp-trigger-rut{color:#6ee7b7}
.emp-trigger.has-emp .emp-trigger-chev{color:#34d399}
.emp-dropdown{position:absolute;top:calc(100% + 8px);left:0;width:390px;max-width:92vw;background:#140e05;border:1px solid #4d350f;border-radius:13px;box-shadow:0 18px 50px rgba(0,0,0,.6);opacity:0;visibility:hidden;transform:translateY(-6px);transition:.16s;z-index:1200;overflow:hidden}
.emp-dropdown.open{opacity:1;visibility:visible;transform:none}
.emp-dd-search{display:flex;align-items:center;gap:8px;padding:11px 13px;border-bottom:1px solid #3a280c;background:#0f0a03}
.emp-dd-search svg{color:#d99a3a;flex:0 0 auto}
.emp-dd-search input{flex:1;background:transparent;border:none;outline:none;color:#fbe7cf;font-size:13px;font-family:'Exo 2',sans-serif}
.emp-dd-search input::placeholder{color:#8a6a3a}
.emp-dd-list{max-height:340px;overflow-y:auto;padding:6px}
.emp-dd-item{display:flex;align-items:center;gap:11px;padding:9px 11px;border-radius:9px;cursor:pointer;transition:.12s}
.emp-dd-item:hover{background:#241803}
.emp-dd-item.active{background:linear-gradient(135deg,#0c3a23,#062017);box-shadow:inset 3px 0 0 #10b981}
.emp-dd-ava{flex:0 0 auto;width:38px;height:38px;border-radius:10px;background:linear-gradient(135deg,#7a4d12,#b4791f);color:#fbe7cf;display:flex;align-items:center;justify-content:center;font-weight:800;font-size:12.5px;overflow:hidden;letter-spacing:.5px}
.emp-dd-ava img{width:100%;height:100%;object-fit:contain;background:#fff}
.emp-dd-info{flex:1;display:flex;flex-direction:column;min-width:0;line-height:1.3}
.emp-dd-name{font-size:13px;font-weight:700;color:#fbe7cf;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.emp-dd-rut{font-size:10.5px;color:#c79a5b;font-family:'Consolas',monospace;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.emp-dd-item.active .emp-dd-name{color:#34d399}
.emp-dd-item.active .emp-dd-ava{background:linear-gradient(135deg,#0f7a4d,#10b981);color:#eafff5}
.emp-dd-item.active .emp-dd-check{color:#34d399}
.emp-dd-check{flex:0 0 auto;color:#f59e0b}
.emp-dd-empty{padding:22px;text-align:center;color:#8a6a3a;font-size:12.5px}
.emp-dd-nueva{width:100%;display:flex;align-items:center;justify-content:center;gap:7px;padding:11px;background:#0f0a03;border:none;border-top:1px solid #3a280c;color:#f0b860;font-size:12.5px;font-weight:800;cursor:pointer;font-family:'Exo 2',sans-serif;transition:.12s}
.emp-dd-nueva:hover{background:#241803;color:#ffd591}

:root {
  --primary: #000000;
  --primary-light: #0A0A0A;
  --accent: #2563EB;
  --accent-hover: #1D4ED8;
  --success: #059669;
  --warning: #D97706;
  --danger: #DC2626;
  --sidebar-width: 260px;
  --topbar-height: 130px;
  --statusbar-height: 36px;
  --bg: #0D0D0D;
  --card-bg: #111111;
  --text: #E2E8F0;
  --text-muted: #64748B;
  --border: #1E293B;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
/* Eliminar flechas up/down de inputs numéricos */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
input[type="number"] { -moz-appearance: textfield; }
body { font-family: 'Exo 2', 'Segoe UI', sans-serif; background: var(--bg); color: var(--text); overflow-x: hidden; font-weight: 500; }

/* TOPBAR */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; height: var(--topbar-height);
  background: #010103; color: white; display: flex; align-items: center; /* = negro del logo (rgb 1,1,3): funde el logo y evita el recuadro/linea */
  padding: 0 20px; z-index: 1000;
  border-bottom: 1px solid #1a3a6e;
  box-shadow: 0 0 20px rgba(37,99,235,0.3);
}
.topbar-logo {
  width: 480px;
  height: 130px;
  flex-shrink: 0;
  background: url('/img/logo_tight.png') no-repeat center center;
  background-size: auto 104px;
}
.topbar-logo img { display: none; }
.topbar-logo .logo-text { font-size: 20px; font-weight: 700; letter-spacing: 1px; color: #60A5FA; }
.topbar-logo .logo-sub { font-size: 10px; color: #94A3B8; letter-spacing: 2px; text-transform: uppercase; }
.topbar-center { display: flex; align-items: center; gap: 12px; padding: 0 28px; flex-shrink: 0; flex: 1; }

/* ===== EMPRESA SELECTOR SIMPLE ===== */
.emp-select-wrap {
  display: flex; align-items: center; gap: 10px;
  background: #0A1E3C;
  border: 2px solid #1E3A6E;
  border-radius: 7px;
  padding: 0 14px;
  height: 40px;
  min-width: 320px;
  transition: border-color 0.2s;
}
.emp-select-wrap:focus-within {
  border-color: #2563EB;
  box-shadow: 0 0 0 2px rgba(37,99,235,0.15);
}
.emp-select-icon { color: #4A7ABA; flex-shrink: 0; }

.emp-simple-select {
  flex: 1; background: transparent; border: none; outline: none;
  color: #FFFFFF;
  font-family: 'Exo 2', sans-serif;
  font-size: 13px; font-weight: 800;
  letter-spacing: 0.3px; cursor: pointer;
  appearance: none; -webkit-appearance: none;
  text-overflow: ellipsis;
}
.emp-simple-select option {
  background: #0A1928; color: #FFFFFF;
  font-size: 13px; font-weight: 700;
}

/* Botón Nueva Empresa */
.btn-nueva-empresa {
  display: flex; align-items: center; gap: 7px;
  background: #1D4ED8; border: 2px solid #3B82F6;
  color: #FFFFFF; padding: 7px 18px; border-radius: 6px;
  font-size: 13px; font-family: 'Exo 2', sans-serif;
  font-weight: 800; cursor: pointer; letter-spacing: 0.4px;
  transition: all 0.2s; white-space: nowrap;
  text-shadow: 0 1px 3px rgba(0,0,0,0.3);
}
.btn-nueva-empresa:hover {
  background: #2563EB; border-color: #60A5FA;
  box-shadow: 0 0 20px rgba(59,130,246,0.5);
  transform: translateY(-1px);
}

.topbar-right {
  display: flex; align-items: center; gap: 16px;
  padding-right: 24px;
  border-left: 1px solid #1a2a3a;
  margin-left: 12px; padding-left: 20px;
  flex: 1; justify-content: flex-end;
}

.topbar-user {
  display: flex; align-items: center; gap: 14px;
  cursor: default;
  padding: 4px 10px 4px 12px;
  border-radius: 6px;
  border: 1px solid transparent;
  transition: border-color 0.2s, background 0.2s;
}
.topbar-user:hover {
  border-color: #2A4A7A;
  background: rgba(37,99,235,0.06);
}
.topbar-user-info {
  display: flex; flex-direction: column; align-items: flex-end; gap: 1px;
}
.topbar-user-name {
  font-family: 'Exo 2', sans-serif;
  font-size: 15px; font-weight: 600;
  color: #C8D8EC; letter-spacing: 0.3px;
}
.topbar-user-role {
  font-family: 'Exo 2', sans-serif;
  font-size: 11.5px; font-weight: 600;
  color: #8AAEC8; letter-spacing: 0.8px;
  text-transform: uppercase;
}
.topbar-user-avatar {
  width: 42px; height: 42px; border-radius: 50%;
  background: linear-gradient(135deg, #1A3A7A, #2563EB);
  border: 2px solid #3A6AAA;
  display: flex; align-items: center; justify-content: center;
  color: #A8C8F0;
  flex-shrink: 0;
}

/* CALENDARIO TRIGGER */
.cal-trigger {
  display: flex; align-items: center; gap: 12px;
  background: rgba(37,99,235,0.07);
  border: 2px solid #3A6AAA;
  border-radius: 9px;
  padding: 8px 18px;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
  user-select: none;
}
.cal-trigger:hover { border-color: #5B8FD0; background: rgba(37,99,235,0.13); }
.cal-trigger.open { border-color: #5B9BD5; background: rgba(37,99,235,0.15); }
.cal-trigger-icon { flex-shrink: 0; filter: drop-shadow(0 1px 2px rgba(0,0,0,0.4)); }
.cal-trigger-text {
  font-family: 'Exo 2', sans-serif;
  font-size: 16px; font-weight: 700;
  color: #A8C8EC; letter-spacing: 0.5px;
  white-space: nowrap;
}
.cal-trigger-date {
  font-family: 'Consolas', 'Exo 2', monospace;
  font-size: 15px; font-weight: 800;
  color: #f0c860; letter-spacing: 0.5px;
  white-space: nowrap;
  padding-right: 12px;
  border-right: 1px solid rgba(120,150,190,0.30);
  text-shadow: 0 1px 2px rgba(0,0,0,0.4);
}

/* CALENDARIO POPUP */
.cal-popup {
  display: none;
  position: absolute;
  top: calc(var(--topbar-height) - 6px);
  right: 200px;
  width: 280px;
  background: #0D1B2E;
  border: 2px solid #2A5080;
  border-radius: 10px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.8), 0 0 0 1px rgba(37,99,235,0.2);
  z-index: 2000;
  overflow: hidden;
}
.cal-popup.open { display: block; }

.cal-header {
  display: flex; align-items: center; justify-content: space-between;
  background: #1A3A6E;
  padding: 10px 12px;
}
.cal-header-label {
  font-family: 'Rajdhani', sans-serif;
  font-size: 15px; font-weight: 700;
  color: #C8E0FF; letter-spacing: 1px; text-transform: uppercase;
}
.cal-nav {
  background: transparent; border: none;
  color: #7BB8E8; font-size: 22px; cursor: pointer;
  padding: 0 6px; line-height: 1;
  transition: color 0.15s;
  font-weight: 300;
}
.cal-nav:hover { color: #ffffff; }

.cal-weekdays {
  display: grid; grid-template-columns: repeat(7, 1fr);
  background: #0A1628;
  padding: 6px 8px 4px;
}
.cal-weekdays span {
  text-align: center;
  font-family: 'Exo 2', sans-serif;
  font-size: 10px; font-weight: 700;
  color: #3A6A9A; letter-spacing: 0.5px;
  text-transform: uppercase;
}

.cal-days {
  display: grid; grid-template-columns: repeat(7, 1fr);
  padding: 4px 8px 8px; gap: 2px;
}
.cal-day {
  display: flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; margin: auto;
  border-radius: 50%;
  font-family: 'Exo 2', sans-serif;
  font-size: 12px; font-weight: 500;
  color: #8AAAC8; cursor: pointer;
  transition: background 0.15s, color 0.15s;
  border: none; background: transparent;
}
.cal-day:hover { background: rgba(37,99,235,0.3); color: #ffffff; }
.cal-day.vacio { cursor: default; }
.cal-day.vacio:hover { background: transparent; }
.cal-day.otro-mes { color: #2A4A6A; }
.cal-day.hoy {
  background: #DC2626 !important;
  color: #ffffff !important;
  font-weight: 700;
  box-shadow: 0 0 10px rgba(220,38,38,0.5);
}
.cal-day.seleccionado {
  background: rgba(37,99,235,0.4);
  color: #ffffff;
  font-weight: 700;
  border: 1px solid #2563EB;
}

.cal-footer {
  display: flex; align-items: center; justify-content: space-between;
  background: #0A1628;
  border-top: 1px solid #1A3A5A;
  padding: 8px 12px;
}
.cal-footer-label {
  font-family: 'Exo 2', sans-serif;
  font-size: 11px; font-weight: 600;
  color: #4A7AAA; letter-spacing: 0.5px; text-transform: uppercase;
}
.cal-hoy-btn {
  background: transparent; border: 1px solid #2A5080;
  color: #5B9BD5; padding: 3px 12px;
  border-radius: 4px; font-size: 11px; font-weight: 600;
  font-family: 'Exo 2', sans-serif; cursor: pointer;
  transition: all 0.15s;
}
.cal-hoy-btn:hover { background: rgba(37,99,235,0.2); color: #7BB8E8; border-color: #4A7ABA; }

/* MENUBAR */
.menubar {
  position: fixed; top: var(--topbar-height); left: var(--sidebar-width); right: 0;
  background: #1a1a2e; border-bottom: 2px solid #1a3a6e;
  border-left: 1px solid #1a3a6e;
  z-index: 950; display: flex; align-items: center;
  padding: 0 8px; height: 36px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.5);
}
.menu-item {
  position: relative;
}
.menu-item > .menu-label {
  display: flex; align-items: center; gap: 4px;
  padding: 0 14px; height: 36px; font-size: 13px;
  color: #CBD5E1; cursor: pointer; white-space: nowrap;
  border: none; background: transparent;
  font-family: 'Exo 2', sans-serif; font-weight: 600;
  letter-spacing: 0.3px;
  transition: all 0.15s;
}
.menu-item > .menu-label:hover,
.menu-item.open > .menu-label {
  background: rgba(37,99,235,0.25); color: #60A5FA;
}
.menu-item.highlight > .menu-label {
  background: #CA8A04; color: #000;
  font-weight: 700;
}
.menu-item.highlight > .menu-label:hover {
  background: #EAB308; color: #000;
}
.menu-dropdown {
  display: none; position: absolute; top: 36px; left: 0;
  background: #0f0f1a; border: 1px solid #1a3a6e;
  min-width: 220px; z-index: 9999;
  box-shadow: 0 8px 24px rgba(0,0,0,0.8);
  border-radius: 0 0 6px 6px;
}
.menu-item.open .menu-dropdown { display: block; }
.menu-dropdown a {
  display: block; padding: 8px 16px; font-size: 13px; white-space: nowrap;
  color: #CBD5E1; text-decoration: none; cursor: pointer;
  border-bottom: 1px solid #141428; transition: all 0.15s;
}
.menu-dropdown a:hover {
  background: rgba(37,99,235,0.2); color: #60A5FA; padding-left: 20px;
}
.menu-dropdown a:last-child { border-bottom: none; }
.menu-separator { height: 1px; background: #1a3a6e; margin: 4px 0; }

/* ===== MENÚ CASCADA ===== */
.menu-item-cascade { position: relative; }
.menu-cascade-label {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 16px; font-size: 13px;
  color: #CBD5E1; cursor: pointer; white-space: nowrap;
  border-bottom: 1px solid #141428; transition: all 0.15s;
  font-family: 'Exo 2', sans-serif; font-weight: 600;
}
.menu-item-cascade:hover > .menu-cascade-label {
  background: rgba(37,99,235,0.2); color: #60A5FA;
}
.menu-cascada {
  display: none;
  position: absolute;
  top: 0; left: 100%;
  background: #0f0f1a;
  border: 1px solid #1a3a6e;
  min-width: 210px;
  z-index: 9999;
  box-shadow: 0 8px 24px rgba(0,0,0,0.8);
  border-radius: 0 0 6px 6px;
}
.menu-item-cascade:hover > .menu-cascada { display: block; }
.cascada-item {
  display: block;
  padding: 8px 16px; font-size: 13px;
  color: #CBD5E1; cursor: pointer;
  border-bottom: 1px solid #141428;
  transition: all 0.15s;
  text-decoration: none;
  font-family: 'Exo 2', sans-serif; font-weight: 600;
  white-space: nowrap;
}
.cascada-item-cascade .menu-cascade-label { white-space: nowrap; }
.cascada-item:hover { background: rgba(37,99,235,0.2); color: #60A5FA; padding-left: 20px; }
.cascada-item:last-child { border-bottom: none; }
.cascada-sep { height: 1px; background: #1a3a6e; margin: 4px 0; }

/* Submenú anidado dentro de cascada */
.cascada-item-cascade { position: relative; padding: 0; }
.cascada-item-cascade .menu-cascade-label {
  display: flex; align-items: center;
  padding: 8px 16px; font-size: 13px;
  color: #CBD5E1; cursor: pointer;
  border-bottom: 1px solid #141428;
  font-family: 'Exo 2', sans-serif; font-weight: 600;
  transition: all 0.15s;
}
.cascada-item-cascade:hover > .menu-cascade-label { background: rgba(37,99,235,0.2); color: #60A5FA; }
.cascada-item-cascade .menu-cascada { top: 0; left: 100%; border-radius: 6px; min-width: 190px; }
.menu-cascada-right { left: 100%; }
.cascada-item-cascade:hover > .menu-cascada { display: block; }

/* Toolbar bajo el menú */
.toolbar {
  position: fixed; top: calc(var(--topbar-height) + 36px); left: 0; right: 0;
  background: #111122; border-bottom: 1px solid #1a3a6e;
  z-index: 940; display: flex; align-items: center;
  padding: 4px 8px; height: 34px; gap: 4px;
}
.toolbar-btn {
  width: 26px; height: 26px; border: 1px solid #1a3a6e;
  background: transparent; color: #60A5FA; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  border-radius: 3px; font-size: 14px; transition: all 0.15s;
}
.toolbar-btn:hover { background: rgba(37,99,235,0.3); border-color: #2563EB; }
.toolbar-sep { width: 1px; height: 20px; background: #1a3a6e; margin: 0 4px; }

/* SIDEBAR */
/* ============================================================
   ERP MODULE SIDEBAR (Softland-style)
   ============================================================ */
.erp-modsidebar {
  position: fixed;
  top: var(--topbar-height);
  left: 0; bottom: var(--statusbar-height);
  width: var(--sidebar-width);
  background: #060C18;
  border-right: 1.5px solid #0E2040;
  display: flex; flex-direction: column;
  z-index: 950;
  overflow: hidden;
}

/* — Sección superior: título del módulo activo + ítems — */
.erp-mod-header {
  display: flex; align-items: center;
  justify-content: space-between;
  background: #D97706;
  border-bottom: 2px solid #B45309;
  padding: 0 10px 0 12px;
  height: 38px; flex-shrink: 0;
}
.erp-mod-header-text {
  font-family: 'Rajdhani', sans-serif;
  font-size: 16px; font-weight: 700;
  color: #000000; letter-spacing: 1px;
  text-transform: uppercase; line-height: 1.2;
}

.erp-mod-items {
  flex: 1; overflow-y: auto;
  padding: 4px 0;
}
.erp-mod-items::-webkit-scrollbar { width: 3px; }
.erp-mod-items::-webkit-scrollbar-thumb { background: #1A3A5A; border-radius: 3px; }

.erp-mod-item {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 12px;
  cursor: pointer;
  border-left: 3px solid transparent;
  transition: all 0.15s;
  font-family: 'Exo 2', sans-serif;
  font-size: 11px; font-weight: 600;
  color: #7A9AB8; line-height: 1.3;
  text-decoration: none;
}
.erp-mod-item:hover { background: rgba(37,99,235,0.1); color: #AACCEE; border-left-color: #1A4A8A; }
.erp-mod-item.active { background: rgba(37,99,235,0.16); color: #FFFFFF; border-left-color: #2563EB; }
.erp-mod-item svg { flex-shrink: 0; opacity: 0.75; }

/* — Sección inferior: tabs de módulos — */
.erp-mod-tabs {
  flex-shrink: 0;
  border-top: 1.5px solid #0D2040;
}
.erp-mod-tab {
  display: flex; align-items: center; gap: 10px;
  padding: 13px 14px;
  cursor: pointer;
  border-left: 3px solid transparent;
  border-top: 1px solid #08182C;
  transition: all 0.15s;
  font-family: 'Rajdhani', sans-serif;
  font-size: 16px; font-weight: 700;
  color: #7AAAC8; letter-spacing: 1px;
  text-transform: uppercase;
  background: #040A14;
}
.erp-mod-tab:hover { background: #071525; color: #7AAAC8; }
.erp-mod-tab.active { background: #D97706; color: #000000; border-left-color: #B45309; font-weight: 800; }
.erp-mod-tab svg { flex-shrink: 0; opacity: 0.6; }
.erp-mod-tab.active svg { opacity: 1; }

/* MAIN */
.main { margin-left: var(--sidebar-width); margin-top: calc(var(--topbar-height) + 36px); padding: 24px; min-height: calc(100vh - var(--topbar-height) - 36px); }

/* BREADCRUMB */
.breadcrumb-bar { display: flex; align-items: center; gap: 8px; margin-bottom: 20px; font-size: 13px; color: var(--text-muted); }
.breadcrumb-bar strong { color: var(--text); }

/* PAGE HEADER */
.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.page-header .page-subtitle { font-size: 14px; color: #7A9DBF; font-weight: 500; }
.page-title { font-size: 22px; font-weight: 700; color: #60A5FA; font-family: 'Rajdhani', sans-serif; letter-spacing: 1px; }
.page-subtitle { font-size: 13px; color: var(--text-muted); margin-top: 2px; }

/* STATS */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card { background: #0a0a0a; border-radius: 10px; padding: 20px; border: 1px solid #1a3a6e; display: flex; align-items: center; gap: 16px; box-shadow: 0 0 15px rgba(37,99,235,0.08); cursor: default; transition: box-shadow 0.2s; }
.stat-card:hover { box-shadow: 0 0 25px rgba(37,99,235,0.2); }
.stat-icon { width: 48px; height: 48px; border-radius: 10px; display: flex; align-items: center; justify-content: center; }
.stat-icon.blue { background: #EFF6FF; color: var(--accent); }
.stat-icon.green { background: #ECFDF5; color: var(--success); }
.stat-icon.orange { background: #FFFBEB; color: var(--warning); }
.stat-icon.red { background: #FEF2F2; color: var(--danger); }
.stat-value { font-size: 24px; font-weight: 700; color: var(--text); }
.stat-label { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* CARDS */
.card { background: #0D0D0D; border-radius: 10px; border: 1px solid #1a3a6e; margin-bottom: 20px; box-shadow: 0 0 15px rgba(37,99,235,0.08); }
.card-header { padding: 16px 20px; border-bottom: 1px solid #1a3a6e; display: flex; align-items: center; justify-content: space-between; }
.card-title { font-size: 15px; font-weight: 600; color: var(--text); display: flex; align-items: center; gap: 8px; }
.card-body { padding: 20px; }

/* TABLES */
.table-responsive { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
thead th { background: #070d1a; color: #60A5FA; font-weight: 700; font-size: 11px; text-transform: uppercase; letter-spacing: 1px; padding: 10px 14px; text-align: left; border-bottom: 1px solid #1a3a6e; white-space: nowrap; font-family: 'Rajdhani', sans-serif; }
tbody td { padding: 12px 14px; border-bottom: 1px solid #141414; vertical-align: middle; color: #CBD5E1; }
tbody tr:hover { background: rgba(37,99,235,0.05); }
tbody tr:last-child td { border-bottom: none; }

/* BADGES */
.badge { padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 600; }
.badge-success { background: #DCFCE7; color: #166534; }
.badge-warning { background: #FEF9C3; color: #854D0E; }
.badge-danger { background: #FEE2E2; color: #991B1B; }
.badge-info { background: #DBEAFE; color: #1E40AF; }
.badge-gray { background: #F1F5F9; color: #475569; }

/* BUTTONS */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; border-radius: 7px; font-size: 13px; font-weight: 700; font-family: 'Exo 2', sans-serif; cursor: pointer; border: none; transition: all 0.2s; white-space: nowrap; }
.btn-primary { background: var(--accent); color: white; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-success { background: var(--success); color: white; }
.btn-success:hover { background: #047857; }
.btn-outline { background: #475569; color: #fff; border: 1px solid #64748b; }
.btn-outline:hover { background: #5b6b82; }
.btn-danger { background: var(--danger); color: white; }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-icon { padding: 6px; border-radius: 6px; background: transparent; border: 1px solid var(--border); color: var(--text-muted); cursor: pointer; }
.btn-icon:hover { background: var(--bg); color: var(--text); }

/* FORMS */
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.form-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label { font-size: 12px; font-weight: 600; color: #60A5FA; text-transform: uppercase; letter-spacing: 0.5px; }
.form-control { padding: 9px 12px; border: 1px solid #1a3a6e; border-radius: 7px; font-size: 13px; color: #E2E8F0; background: #0a0a0a; transition: border-color 0.2s; width: 100%; }
.form-control:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37,99,235,0.2); }
.form-control:disabled { background: #050505; color: var(--text-muted); }
select.form-control { cursor: pointer; }
select.form-control option { background: #0a0a0a; color: #E2E8F0; }

/* MODAL */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.75); z-index: 2000; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal {
  background: #C8CDD6;
  border: none;
  border-radius: 10px;
  width: 100%; max-width: 680px; max-height: 90vh; overflow-y: auto;
  box-shadow: 0 10px 40px rgba(0,0,0,0.6);
}
.modal-lg { max-width: 900px; }
.modal-header {
  padding: 16px 24px;
  background: #2563EB;
  border-radius: 10px 10px 0 0;
  display: flex; align-items: center; justify-content: space-between;
}
.modal-title { font-size: 16px; font-weight: 700; color: white; font-family: 'Exo 2', sans-serif; letter-spacing: 0.5px; }
.modal-body { padding: 24px; background: #C8CDD6; }
.modal-footer { padding: 14px 24px; border-top: 1px solid #A0A8B4; display: flex; justify-content: flex-end; gap: 10px; background: #BCC1CB; border-radius: 0 0 10px 10px; }
.btn-close { background: rgba(255,255,255,0.2); border: none; cursor: pointer; color: white; font-size: 18px; width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.btn-close:hover { background: rgba(255,255,255,0.35); }

/* Modal inputs en gris claro */
.modal .form-group label {
  color: #1E3A5F; font-weight: 800;
  font-family: 'Exo 2', sans-serif;
  font-size: 11px; letter-spacing: 0.8px; text-transform: uppercase;
}
.modal .form-control {
  background: #FFFFFF;
  border: 1.5px solid #9AA3B0;
  color: #0D1A2E;
  border-radius: 6px;
  font-weight: 700;
  font-size: 14px;
  font-family: 'Exo 2', sans-serif;
}
.modal .form-control:focus { border-color: #2563EB; background: #F4F8FF; box-shadow: 0 0 0 3px rgba(37,99,235,0.15); }
.modal .form-control::placeholder { color: #9AAABB; font-weight: 400; }

/* Validación RUT */
.rut-msg { display: block; margin-top: 4px; font-size: 11px; font-weight: 700; font-family: 'Exo 2', sans-serif; letter-spacing: 0.3px; }
.rut-msg.ok  { color: #059669; }
.rut-msg.err { color: #DC2626; }
.form-control.rut-ok  { border-color: #059669 !important; }
.form-control.rut-err { border-color: #DC2626 !important; box-shadow: 0 0 0 2px rgba(220,38,38,.18) !important; }
/* Teléfono con prefijo bandera Chile +56 */
.tel-wrap { position: relative; }
.tel-wrap input { padding-left: 64px !important; }
.tel-flag { position: absolute; left: 1px; top: 1px; bottom: 1px; display: flex; align-items: center; gap: 5px; padding: 0 9px; border-radius: 7px 0 0 7px; pointer-events: none; font-family: 'Exo 2', sans-serif; font-weight: 700; font-size: 13px; color: #cfe0f5; }
.tel-flag svg { display: block; border-radius: 2px; box-shadow: 0 0 0 1px rgba(0,0,0,.25); }
.tel-flag::after { content: ''; position: absolute; right: 0; top: 20%; bottom: 20%; width: 1px; background: #2a4a7e; }
/* Autocompletado del navegador (Chrome): respeta el fondo oscuro en vez de pintarlo blanco/amarillo */
input:-webkit-autofill, input:-webkit-autofill:hover, input:-webkit-autofill:focus, textarea:-webkit-autofill, select:-webkit-autofill {
  -webkit-box-shadow: 0 0 0 1000px #0a1628 inset !important;
  -webkit-text-fill-color: #e2ecf8 !important;
  caret-color: #e2ecf8;
  transition: background-color 9999s ease-in-out 0s;
}

/* Password toggle */
.pass-group { position: relative; }
.pass-group .form-control { padding-right: 40px; }
.pass-toggle { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); background: none; border: none; cursor: pointer; color: #2563EB; display:flex; align-items:center; padding:4px; border-radius:4px; transition: color 0.2s; }
.pass-toggle:hover { color: #1D4ED8; }

/* Sección SII */
.sii-section { background: #B8BEC8; border-radius: 8px; padding: 16px; margin-top: 16px; border: 1px solid #9AA3B0; }
.sii-title { font-size: 12px; font-weight: 700; color: #1D4ED8; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 12px; font-family: 'Exo 2', sans-serif; display:flex; align-items:center; }

/* Toggle afecta/exenta */
.tax-toggle-group { display: flex; gap: 10px; margin-bottom: 14px; }
.tax-option { display: flex; align-items: center; gap: 8px; cursor: pointer; padding: 8px 18px; border-radius: 6px; border: 2px solid #9AA3B0; background: #C8CDD6; font-family: 'Exo 2', sans-serif; font-weight: 700; font-size: 13px; color: #1E3A5F; transition: all 0.2s; user-select: none; }
.tax-option input[type=radio] { display: none; }
.tax-option.selected-afecta { border-color: #2563EB; background: #DBEAFE; color: #1D4ED8; }
.tax-option.selected-exenta { border-color: #059669; background: #D1FAE5; color: #065F46; }
.tax-option.selected-ambas  { border-color: #D4AF37; background: #FEF3C7; color: #92670A; }
.tax-dot { width: 14px; height: 14px; border-radius: 50%; border: 2px solid currentColor; display:flex; align-items:center; justify-content:center; }
.tax-dot::after { content:''; width:7px; height:7px; border-radius:50%; background:currentColor; display:none; }
.tax-option.selected-afecta .tax-dot::after,
.tax-option.selected-exenta .tax-dot::after,
.tax-option.selected-ambas .tax-dot::after { display:block; }

/* ── Modal "Nueva Empresa": tema azul oscuro del ERP (solo color, sin cambiar layout) ── */
#modalEmpresa .modal { background: #0d1117; border: 3px solid #d4af37; }
#modalEmpresa .modal-header { background: linear-gradient(90deg,#0a1e3c,#0d1f3c); border-bottom: 1px solid #1e3a6e; }
#modalEmpresa .modal-body { background: #0d1117; }
#modalEmpresa .modal-footer { background: #070f1e; border-top: 1px solid #1e3a6e; justify-content: space-between; }
#modalEmpresa .form-group label { color: #7da3d0; }
#modalEmpresa .modal .form-control,
#modalEmpresa .form-control { background: #0a1628; border: 1px solid #1e3a6e; color: #e2ecf8; }
#modalEmpresa .modal .form-control:focus,
#modalEmpresa .form-control:focus { border-color: #3b82f6; background: #0a1628; box-shadow: 0 0 0 3px rgba(37,99,235,0.20); }
#modalEmpresa .modal .form-control::placeholder,
#modalEmpresa .form-control::placeholder { color: #5f7da0; font-weight: 400; }
#modalEmpresa select.form-control option { background: #0a1628; color: #e2ecf8; }
#modalEmpresa .sii-section { background: #0b1322; border: 1px solid #1e3a6e; }
#modalEmpresa .sii-title { color: #60a5fa; }
#modalEmpresa .tax-option { background: #0a1628; border: 2px solid #1e3a6e; color: #cfe0f5; }
#modalEmpresa .tax-option.selected-afecta { border-color: #3b82f6; background: rgba(37,99,235,0.16); color: #93c5fd; }
#modalEmpresa .tax-option.selected-exenta { border-color: #10b981; background: rgba(16,185,129,0.15); color: #6ee7b7; }
#modalEmpresa .tax-option.selected-ambas { border-color: #d4af37; background: rgba(212,175,55,0.16); color: #fcd34d; }
#modalEmpresa .pass-toggle { color: #7da3d0; }
#modalEmpresa .pass-toggle:hover { color: #9cc2ec; }
#modalEmpresa .btn-outline { color: #fff; border-color: #64748b; }
#modalEmpresa .btn-outline:hover { background: #5b6b82; }
/* Campos autocompletados por el navegador (email/clave): forzar fondo oscuro (si no, quedan en blanco) */
#modalEmpresa .form-control:-webkit-autofill,
#modalEmpresa .form-control:-webkit-autofill:hover,
#modalEmpresa .form-control:-webkit-autofill:focus,
#modalEmpresa .form-control:-webkit-autofill:active {
  -webkit-text-fill-color: #e2ecf8 !important;
  -webkit-box-shadow: 0 0 0 1000px #0a1628 inset !important;
  box-shadow: 0 0 0 1000px #0a1628 inset !important;
  caret-color: #e2ecf8;
  border: 1px solid #1e3a6e !important;
  transition: background-color 9999s ease-out 0s;
}
/* Cabecera del modal con logo (presentación profesional) */
#modalEmpresa .modal-header { padding: 13px 22px; }
#modalEmpresa .modal-head-left { display: flex; align-items: center; gap: 13px; }
#modalEmpresa .modal-logo {
  height: 34px; width: 34px; object-fit: contain; border-radius: 7px;
  background: rgba(255,255,255,0.06); padding: 4px; border: 1px solid #1e3a6e;
}
#modalEmpresa .modal-head-tt { display: flex; flex-direction: column; line-height: 1.15; }
#modalEmpresa .modal-head-tt small { font-size: 10.5px; font-weight: 600; color: #7da3d0; letter-spacing: .3px; }

/* ALERTS */
.alert { padding: 12px 16px; border-radius: 8px; font-size: 13px; margin-bottom: 16px; }
.alert-success { background: #DCFCE7; color: #166534; border: 1px solid #BBF7D0; }
.alert-danger { background: #FEE2E2; color: #991B1B; border: 1px solid #FECACA; }
.alert-info { background: #DBEAFE; color: #1E40AF; border: 1px solid #BFDBFE; }
.alert-warning { background: #FEF9C3; color: #854D0E; border: 1px solid #FDE68A; }

/* TABS */
.tabs { display: flex; border-bottom: 2px solid var(--border); margin-bottom: 20px; gap: 4px; }
.tab { padding: 10px 20px; font-size: 13px; font-weight: 500; color: var(--text-muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -2px; transition: all 0.2s; }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.tab:hover { color: var(--text); }

/* SEARCH BAR */
.search-bar { display: flex; gap: 10px; align-items: center; margin-bottom: 16px; }
.search-input { flex: 1; max-width: 320px; }

/* EMPTY STATE */
.empty-state { text-align: center; padding: 60px 20px; color: var(--text-muted); }
.empty-state svg { width: 64px; height: 64px; margin-bottom: 16px; opacity: 0.3; }
.empty-state h3 { font-size: 16px; color: var(--text); margin-bottom: 8px; }

/* DIVIDER */
.section-divider { height: 1px; background: var(--border); margin: 20px 0; }

/* LIQUIDO HIGHLIGHT */
.liquido-cell { font-weight: 700; color: var(--success); }
.descuento-cell { color: var(--danger); }

/* RESPONSIVE */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .main { margin-left: 0; padding: 16px; }
  .form-grid-3 { grid-template-columns: 1fr; }
}

/* LOADING */
.spinner { width: 20px; height: 20px; border: 2px solid #E2E8F0; border-top-color: var(--accent); border-radius: 50%; animation: spin 0.6s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes sapModalIn { from { opacity:0; transform: scale(0.93) translateY(-10px); } to { opacity:1; transform: scale(1) translateY(0); } }

.hidden { display: none !important; }

/* NUMBER FORMAT */
.num { font-variant-numeric: tabular-nums; }

/* PERIODO INPUT */
.periodo-input { max-width: 140px; }

/* ====== SAP FIORI HUB ====== */
.sap-hub-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 28px; padding-bottom: 16px;
  border-bottom: 2px solid #1A3A6E;
}
.sap-hub-title {
  font-family: 'Rajdhani', sans-serif;
  font-size: 22px; font-weight: 700;
  color: #7BB8E8; letter-spacing: 1.5px; text-transform: uppercase;
}
.sap-hub-period {
  font-family: 'Exo 2', sans-serif;
  font-size: 12px; font-weight: 600;
  color: #4A7AAA; letter-spacing: 1px; text-transform: uppercase;
  background: rgba(37,99,235,0.08);
  border: 1px solid #2A4A7A; border-radius: 4px; padding: 4px 14px;
}

.sap-tiles {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 20px; margin-bottom: 32px;
}
.sap-tile {
  background: #0A0F1A;
  border: 2px solid #1A3A6E;
  border-radius: 10px;
  padding: 0;
  cursor: pointer;
  transition: all 0.2s;
  overflow: hidden;
  position: relative;
}
.sap-tile:hover {
  border-color: #2563EB;
  box-shadow: 0 0 30px rgba(37,99,235,0.2), inset 0 0 20px rgba(37,99,235,0.04);
  transform: translateY(-2px);
}
.sap-tile.active {
  border-color: #3B82F6;
  box-shadow: 0 0 25px rgba(59,130,246,0.25);
}
.sap-tile-stripe {
  height: 4px; width: 100%;
}
.sap-tile-stripe.blue  { background: linear-gradient(90deg,#1D4ED8,#3B82F6); }
.sap-tile-stripe.green { background: linear-gradient(90deg,#059669,#10B981); }
.sap-tile-stripe.amber { background: linear-gradient(90deg,#B45309,#F59E0B); }
.sap-tile-body { padding: 20px 22px 22px; }
.sap-tile-icon {
  width: 44px; height: 44px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 14px;
}
.sap-tile-icon.blue  { background: rgba(37,99,235,0.15); color: #3B82F6; }
.sap-tile-icon.green { background: rgba(5,150,105,0.15);  color: #10B981; }
.sap-tile-icon.amber { background: rgba(180,83,9,0.15);   color: #F59E0B; }
.sap-tile-label {
  font-family: 'Rajdhani', sans-serif;
  font-size: 17px; font-weight: 700;
  color: #C8D8F0; letter-spacing: 0.8px;
  text-transform: uppercase; margin-bottom: 6px;
}
.sap-tile-desc {
  font-family: 'Exo 2', sans-serif;
  font-size: 12px; font-weight: 400;
  color: #4A6A8A; line-height: 1.5;
}
.sap-tile-count {
  font-family: 'Exo 2', sans-serif;
  font-size: 28px; font-weight: 700;
  margin-top: 12px;
}
.sap-tile-count.blue  { color: #3B82F6; }
.sap-tile-count.green { color: #10B981; }
.sap-tile-count.amber { color: #F59E0B; }
.sap-tile-action {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 14px; padding-top: 12px;
  border-top: 1px solid #1A3A5A;
}
.sap-tile-action-text {
  font-family: 'Exo 2', sans-serif;
  font-size: 11px; font-weight: 600;
  color: #3A6A9A; letter-spacing: 0.5px; text-transform: uppercase;
}
.sap-tile-arrow { color: #2A5A8A; font-size: 18px; }

/* SAP Panel contenido */
.sap-panel {
  background: #080D18;
  border: 2px solid #1A3A6E;
  border-radius: 10px;
  overflow: hidden;
}
.sap-panel-header {
  display: flex; align-items: center; justify-content: space-between;
  background: #0D1B30;
  padding: 14px 20px;
  border-bottom: 2px solid #1A3A6E;
}
.sap-panel-title {
  font-family: 'Rajdhani', sans-serif;
  font-size: 15px; font-weight: 700;
  color: #7BB8E8; letter-spacing: 1px; text-transform: uppercase;
  display: flex; align-items: center; gap: 10px;
}
.sap-panel-title-dot {
  width: 8px; height: 8px; border-radius: 50%;
}
.sap-panel-title-dot.blue  { background: #3B82F6; box-shadow: 0 0 8px #3B82F6; }
.sap-panel-title-dot.green { background: #10B981; box-shadow: 0 0 8px #10B981; }
.sap-panel-title-dot.amber { background: #F59E0B; box-shadow: 0 0 8px #F59E0B; }
.sap-panel-body { padding: 20px; }

/* Modal SAP mejorado */
.modal-sap { max-width: 780px; width: 95%; }
.modal-tabs {
  display: flex; background: #050A14;
  border-bottom: 2px solid #1A3A6E;
}
.modal-tab {
  padding: 12px 22px; cursor: pointer;
  font-family: 'Exo 2', sans-serif;
  font-size: 12px; font-weight: 700;
  color: #4A6A8A; letter-spacing: 0.8px; text-transform: uppercase;
  border-bottom: 3px solid transparent; margin-bottom: -2px;
  transition: all 0.15s; white-space: nowrap;
}
.modal-tab:hover { color: #7BB8E8; background: rgba(37,99,235,0.05); }
.modal-tab.active { color: #3B82F6; border-bottom-color: #3B82F6; background: rgba(37,99,235,0.08); }
.modal-section-title {
  font-family: 'Rajdhani', sans-serif;
  font-size: 13px; font-weight: 700;
  color: #3B82F6; letter-spacing: 1.5px; text-transform: uppercase;
  padding-bottom: 8px; margin-bottom: 14px;
  border-bottom: 1px solid #1A3A5A;
}
.form-grid-sap {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px;
}
.form-grid-sap .span2 { grid-column: span 2; }
.form-grid-sap .span3 { grid-column: span 3; }

.sap-field label {
  display: block; margin-bottom: 5px;
  font-family: 'Exo 2', sans-serif;
  font-size: 10px; font-weight: 700;
  color: #3A6A9A; letter-spacing: 1px; text-transform: uppercase;
}
.sap-field input, .sap-field select {
  width: 100%; background: #0A1220;
  border: 1.5px solid #1E3A5F;
  border-radius: 5px; color: #C8D8EC;
  padding: 8px 10px;
  font-family: 'Exo 2', sans-serif; font-size: 13px; font-weight: 500;
  transition: border-color 0.2s;
  outline: none;
}
.sap-field input:focus, .sap-field select:focus {
  border-color: #2563EB;
  box-shadow: 0 0 0 2px rgba(37,99,235,0.15);
}
.sap-field select option { background: #0A1220; }
.sap-required::after { content: ' *'; color: #EF4444; }

/* ====== FICHA ERP TRABAJADOR (PANTALLA COMPLETA) ====== */
#modalTrabajador.modal-overlay {
  padding: 18px;
  background: rgba(0,0,0,0.88);
  align-items: center;
  justify-content: center;
}

.ficha-erp {
  display: flex; flex-direction: column;
  background: #040810;
  width: 990px;
  max-width: 99vw;
  max-height: 93vh;
  border-radius: 6px;
  border: 1.5px solid #1E3A6E;
  animation: sapModalIn 0.2s ease;
  overflow: hidden;
  box-shadow: 0 24px 80px rgba(0,0,0,0.88);
}

/* ---- TOPBAR ---- */
.ficha-topbar {
  display: flex; align-items: center;
  justify-content: space-between;
  background: linear-gradient(90deg, #081428 0%, #0D1E3A 50%, #081428 100%);
  border-bottom: 2px solid #1E3A6E;
  padding: 0 28px; height: 62px; flex-shrink: 0;
  box-shadow: 0 2px 24px rgba(0,0,0,0.7);
}
.ficha-topbar-left { display: flex; align-items: center; gap: 16px; }
.ficha-topbar-icon {
  width: 40px; height: 40px; border-radius: 10px;
  background: rgba(37,99,235,0.18);
  border: 1.5px solid rgba(59,130,246,0.35);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.ficha-topbar-title {
  font-family: 'Rajdhani', sans-serif;
  font-size: 20px; font-weight: 700;
  color: #FFFFFF; letter-spacing: 2px; text-transform: uppercase; line-height: 1.1;
}
.ficha-topbar-sub {
  font-family: 'Exo 2', sans-serif;
  font-size: 10px; font-weight: 600;
  color: rgba(255,255,255,0.4);
  letter-spacing: 1.5px; text-transform: uppercase; margin-top: 3px;
}
.ficha-topbar-right { display: flex; align-items: center; gap: 10px; }
.ficha-topbar-mes {
  display: flex; align-items: center; gap: 12px;
  pointer-events: none; white-space: nowrap; margin-right: 18px;
}

/* ---- BÚSQUEDA DE FICHA ---- */
.ficha-busqueda-bar {
  background: #C8D8E8;
  border-bottom: 1px solid #9AAFC5;
  padding: 5px 12px;
}
.ficha-busq-group {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
}
.ficha-busq-title {
  font-size: 11px; font-weight: 700; color: #1A3A6E;
  background: #D8E8F4; border: 1px solid #9AAFC5;
  padding: 2px 8px; border-radius: 3px; white-space: nowrap;
}
.ficha-busq-filtros {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.ficha-busq-label {
  font-size: 11px; color: #2A3A5A; font-weight: 600; white-space: nowrap;
}
.ficha-busq-chk {
  display: flex; align-items: center; gap: 4px;
  font-size: 11px; color: #1A2A4A; cursor: pointer; white-space: nowrap;
}
.ficha-busq-chk input[type="checkbox"] { cursor: pointer; margin: 0; width: 13px; height: 13px; }
.ficha-busq-campo {
  display: flex; align-items: center; gap: 6px; margin-left: auto;
}
.ficha-busq-input-wrap {
  display: flex; align-items: center;
  border: 1px solid #8A9FBF; border-radius: 3px; background: #fff; overflow: hidden;
}
.ficha-busq-input {
  border: none; outline: none; padding: 3px 8px;
  font-size: 11px; width: 220px; background: #fff; color: #111;
}
.ficha-busq-btn {
  background: #2A5CAA; border: none; color: #fff;
  padding: 4px 8px; cursor: pointer; display: flex; align-items: center;
}
.ficha-busq-btn:hover { background: #1A4A9A; }

.ficha-btn-cancel {
  background: #475569; border: 1px solid #64748b;
  color: #FFFFFF; padding: 7px 18px; border-radius: 6px;
  font-family: 'Exo 2', sans-serif; font-size: 13px; font-weight: 800;
  cursor: pointer; letter-spacing: 0.3px; transition: all 0.15s;
}
.ficha-btn-cancel:hover { background: #5b6b82; }

.ficha-btn-save {
  display: inline-flex; align-items: center; gap: 8px;
  background: linear-gradient(135deg, #047857, #059669);
  border: 1.5px solid #10B981;
  color: #FFFFFF; padding: 7px 20px; border-radius: 6px;
  font-family: 'Exo 2', sans-serif; font-size: 13px; font-weight: 800;
  cursor: pointer; letter-spacing: 0.3px;
  box-shadow: 0 0 16px rgba(5,150,105,0.3); transition: all 0.15s;
}
.ficha-btn-save:hover { box-shadow: 0 0 30px rgba(16,185,129,0.5); transform: translateY(-1px); }

.ficha-btn-save2 {
  display: inline-flex; align-items: center; gap: 8px;
  background: linear-gradient(135deg, #1D4ED8, #2563EB);
  border: 2px solid #3B82F6; color: #FFFFFF;
  padding: 10px 28px; border-radius: 7px;
  font-family: 'Exo 2', sans-serif; font-size: 14px; font-weight: 800;
  cursor: pointer; letter-spacing: 0.4px;
  box-shadow: 0 0 20px rgba(37,99,235,0.4); transition: all 0.15s;
}
.ficha-btn-save2:hover { box-shadow: 0 0 35px rgba(59,130,246,0.65); transform: translateY(-1px); }

.ficha-close {
  width: 32px; height: 32px; border-radius: 50%;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.65); font-size: 20px; line-height: 1;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: all 0.15s; margin-left: 6px;
}
.ficha-close:hover { background: rgba(220,38,38,0.22); border-color: #DC2626; color: #FFFFFF; }

/* ---- INFOBAR (Mes / Ficha / Trabajador) — FIJA ---- */
.ficha-infobar {
  display: flex; align-items: center;
  background: #04101E;
  border-bottom: 2px solid #0D2040;
  padding: 0 24px;
  height: 44px; flex-shrink: 0;
  gap: 0;
  overflow: hidden;
}
.ficha-infobar-item {
  display: flex; align-items: center; gap: 8px;
  padding: 0 20px;
}
.ficha-infobar-item svg { color: #2A5070; flex-shrink: 0; }
.ficha-infobar-item:first-child { padding-left: 0; }
.ficha-infobar-sep {
  width: 1px; height: 22px;
  background: #0E2040; flex-shrink: 0;
}
.ficha-infobar-label {
  font-family: 'Exo 2', sans-serif;
  font-size: 9px; font-weight: 800;
  color: #2A5070; letter-spacing: 1.5px;
  text-transform: uppercase; flex-shrink: 0;
}
.ficha-infobar-val {
  font-family: 'Exo 2', sans-serif;
  font-size: 13px; font-weight: 800;
  color: #FFFFFF; letter-spacing: 0.3px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: 280px;
}
.ficha-infobar-money { color: #10B981 !important; }

/* ---- HORIZONTAL TABS ---- */
.ficha-htab-row {
  display: flex; align-items: flex-end;
  background: #060D1C;
  border-bottom: 2px solid #0E2040;
  padding: 0 24px;
  flex-shrink: 0;
  gap: 0;
}
.ficha-htab {
  font-family: 'Exo 2', sans-serif;
  font-size: 11px; font-weight: 800;
  color: #8FB8E0; letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 10px 22px 9px;
  cursor: pointer;
  border-bottom: 2.5px solid transparent;
  margin-bottom: -2px;
  transition: color 0.15s, border-color 0.15s;
  white-space: nowrap;
  user-select: none;
}
.ficha-htab:hover { color: #AACCE8; border-bottom-color: #1A4A7A; }
.ficha-htab.active { color: #FFFFFF; border-bottom-color: #2563EB; }

/* ---- BODY SCROLLABLE ---- */
.ficha-body {
  flex: 1; overflow-y: auto;
  background: #070D1A;
  padding: 24px 30px 28px;
  min-height: 0;
}
.ficha-body::-webkit-scrollbar { width: 6px; }
.ficha-body::-webkit-scrollbar-thumb { background: #1A3A6E; border-radius: 4px; }

/* ---- FOOTER ---- */
.ficha-footer {
  display: flex; align-items: center;
  justify-content: flex-end; gap: 10px;
  background: #050C1A;
  border-top: 1.5px solid #0E2040;
  padding: 0 20px;
  height: 52px;
  flex-shrink: 0;
}
.ficha-footer-left { flex: 1; }
.ficha-footer-portal {
  display: inline-flex; align-items: center; gap: 7px;
  background: transparent;
  border: 1px solid #1A3A6E;
  color: #4A7AAA;
  padding: 6px 14px; border-radius: 4px;
  font-family: 'Exo 2', sans-serif;
  font-size: 11px; font-weight: 700;
  cursor: pointer; letter-spacing: 0.3px;
  transition: all 0.15s;
}
.ficha-footer-portal:hover { background: #0A1E3C; color: #AACCEE; border-color: #2A5A9A; }

/* ---- LAYOUT (DEPRECATED — kept for reference) ---- */
.ficha-layout { display: flex; flex: 1; overflow: hidden; }

/* ---- SIDEBAR ---- */
.ficha-sidebar {
  width: 246px; flex-shrink: 0;
  background: #060C18; border-right: 2px solid #1A3A6E;
  display: flex; flex-direction: column; overflow-y: auto;
}
.ficha-sidebar::-webkit-scrollbar { width: 3px; }
.ficha-sidebar::-webkit-scrollbar-thumb { background: #1A3A5A; border-radius: 3px; }

.ficha-tab {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 18px; cursor: pointer;
  border-left: 3px solid transparent;
  border-bottom: 1px solid #0A1525;
  transition: all 0.15s;
}
.ficha-tab:hover { background: rgba(37,99,235,0.07); border-left-color: #2563EB; }
.ficha-tab.active { background: rgba(37,99,235,0.14); border-left-color: #3B82F6; }

.ficha-tab-num {
  font-family: 'Rajdhani', sans-serif;
  font-size: 24px; font-weight: 700;
  color: #1E3A5A; line-height: 1; flex-shrink: 0; transition: color 0.15s;
}
.ficha-tab:hover .ficha-tab-num,
.ficha-tab.active .ficha-tab-num { color: #3B82F6; }

.ficha-tab-name {
  font-family: 'Exo 2', sans-serif;
  font-size: 11px; font-weight: 700;
  color: #7A9AB8; letter-spacing: 0.5px;
  text-transform: uppercase; line-height: 1.2; transition: color 0.15s;
}
.ficha-tab:hover .ficha-tab-name,
.ficha-tab.active .ficha-tab-name { color: #FFFFFF; }

.ficha-tab-desc {
  font-family: 'Exo 2', sans-serif;
  font-size: 10px; font-weight: 400;
  color: #253A55; margin-top: 2px;
}
.ficha-tab.active .ficha-tab-desc { color: #3A6A9A; }

/* ---- RESUMEN MINI ---- */
.ficha-resumen {
  margin: 14px 12px 12px;
  background: #091628; border: 1px solid #1E3A6E;
  border-radius: 8px; padding: 13px 14px 10px; flex-shrink: 0;
}
.ficha-resumen-title {
  font-family: 'Rajdhani', sans-serif;
  font-size: 10px; font-weight: 700;
  color: #2A5AAA; letter-spacing: 2.5px; text-transform: uppercase;
  margin-bottom: 11px; padding-bottom: 8px;
  border-bottom: 1px solid #132A4A;
}
.ficha-resumen-row {
  display: flex; justify-content: space-between;
  align-items: flex-start; gap: 6px; margin-bottom: 7px;
}
.ficha-resumen-row span {
  font-family: 'Exo 2', sans-serif;
  font-size: 9px; font-weight: 700;
  color: #254A6A; letter-spacing: 0.5px;
  text-transform: uppercase; flex-shrink: 0;
}
.ficha-resumen-row strong {
  font-family: 'Exo 2', sans-serif;
  font-size: 11px; font-weight: 700;
  color: #FFFFFF; text-align: right;
  line-height: 1.3; word-break: break-word;
}

/* ---- CONTENT AREA ---- */
.ficha-content {
  flex: 1; overflow-y: auto;
  background: #070D1A; padding: 28px 38px 44px;
  min-height: 480px;
}
/* Todas las pestañas misma altura mínima */
.ficha-panel { min-height: 400px; }
.ficha-content::-webkit-scrollbar { width: 6px; }
.ficha-content::-webkit-scrollbar-thumb { background: #1A3A6E; border-radius: 4px; }

.ficha-panel { display: block; }
.ficha-panel.hidden { display: none; }

/* ══════════════════════════════════════
   TAB LABORAL — Layout estilo Softland
   ══════════════════════════════════════ */
.sl-form { padding: 4px 0; }
.sl-main { display: flex; gap: 0; align-items: flex-start; }

/* Columna izquierda */
.sl-left  { flex: 0 0 56%; display: flex; flex-direction: column; gap: 3px; padding-right: 18px; }
.sl-right { flex: 1; display: flex; flex-direction: column; gap: 3px; padding-left: 18px; }
.sl-divider { width: 1px; background: #1E3A6A; align-self: stretch; flex-shrink: 0; }

/* Fila individual */
.sl-r { display: flex; align-items: center; min-height: 25px; gap: 0; }
.sl-r-chk { margin-bottom: 6px; }

/* Etiqueta izquierda */
.sl-l {
  font-size: 11.5px; color: #8AAACE; text-align: right;
  min-width: 148px; padding-right: 8px; flex-shrink: 0; line-height: 1.2;
}
.sl-l2 {
  font-size: 11.5px; color: #8AAACE; text-align: right;
  min-width: 130px; padding-right: 8px; padding-left: 10px; flex-shrink: 0;
}
/* Etiqueta derecha */
.sl-rl {
  font-size: 11.5px; color: #8AAACE; text-align: right;
  min-width: 170px; padding-right: 8px; flex-shrink: 0; line-height: 1.2;
}

/* Inputs */
.sl-inp {
  height: 22px; font-size: 11.5px; border-radius: 2px;
  background: #0A1628; border: 1px solid #2A4A7A; color: #D0E8FF;
  padding: 0 6px; outline: none;
}
.sl-inp:focus { border-color: #4A8ADA; background: #0D1E38; }
/* Calendario visible en campos de fecha */
.sl-inp[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(0.7) sepia(1) saturate(3) hue-rotate(180deg);
  cursor: pointer; opacity: 0.85;
}
.sl-inp[type="date"]::-webkit-calendar-picker-indicator:hover { opacity: 1; }
.sl-inp-lg { width: 230px; }
.sl-inp-md { width: 160px; }
.sl-inp-dt { width: 126px; }
.sl-inp-xs { width: 58px; }

/* Fila con dos campos inline */
.sl-pair { flex-wrap: nowrap; }

/* Checkbox */
.sl-chk { display: flex; align-items: center; gap: 5px; cursor: pointer; font-size: 11.5px; color: #B8D4F0; }
.sl-chk input { cursor: pointer; accent-color: #3B82F6; }
.sl-chk-full { grid-column: 1 / -1; margin-top: 3px; }
/* Pertenece a Rol Privado — ticket rojo */
.rol-privado-chk {
  display: flex; align-items: center; gap: 10px;
  cursor: pointer; margin-bottom: 12px; user-select: none;
}
.rol-ticket {
  width: 22px; height: 22px; border-radius: 4px; flex-shrink: 0;
  border: 2px solid #4A6A9A; background: #0A1628;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s, border-color 0.15s;
}
.rol-ticket.activo {
  background: #CC1111; border-color: #FF2222;
  box-shadow: 0 0 6px rgba(220,30,30,0.6);
}
/* Ticket VERDE para el selector «Detalle de la liquidación» (dorado) — el rojo es solo de Rol Privado */
.det-ticket {
  width: 22px; height: 22px; border-radius: 4px; flex-shrink: 0;
  border: 2px solid #4A6A9A; background: #0A1628;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s, border-color 0.15s;
}
.det-ticket.activo {
  background: #059669; border-color: #34d399;
  box-shadow: 0 0 6px rgba(52,211,153,0.55);
}
.rol-privado-txt {
  font-size: 13.5px; font-weight: 600; color: #C8E0FF;
  letter-spacing: 0.2px;
}

/* Botón documento */
.sl-doc-btn {
  background: #112040; border: 1px solid #2A5CAA; color: #5A9AEA;
  border-radius: 2px; padding: 2px 8px; cursor: pointer; display: flex; align-items: center; gap: 4px;
  font-size: 11px;
}
.sl-doc-btn:hover { background: #1A3A70; }
.sl-lupa {
  background: #112040; border: 1px solid #2A5CAA; color: #5A9AEA;
  border-radius: 2px; padding: 2px 6px; cursor: pointer; margin-left: 4px;
  display: flex; align-items: center; height: 22px; flex-shrink: 0;
}
.sl-lupa:hover { background: #1A3A70; }

/* Certificado de Rentas */
.sl-cert {
  margin-top: 14px; border: 1px solid #1E3A6A; border-radius: 4px;
  padding: 8px 12px; background: rgba(10,22,50,0.6);
}
.sl-cert-title { font-size: 11px; font-weight: 700; color: #5A9AEA; margin-bottom: 7px; letter-spacing: 0.5px; text-transform: uppercase; }
.sl-cert-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 5px 12px; }

/* ---- TAB LABORAL v2 ---- */
.lab2-wrap { display:flex; gap:28px; align-items:flex-start; }
.lab2-col  { flex:1; display:flex; flex-direction:column; gap:6px; }
.lab2-row  { display:flex; align-items:center; gap:8px; min-height:26px; }
.lab2-lbl  { font-size:11.5px; color:#A8C0E0; min-width:175px; text-align:right; flex-shrink:0; }
.lab2-lbl.req::after { content:' *'; color:#F87171; }
.lab2-inp    { flex:1; height:24px; font-size:12px; }
.lab2-inp-sm { width:140px; flex-shrink:0; height:24px; font-size:12px; }
.lab2-inp-xs { width:72px;  flex-shrink:0; height:24px; font-size:12px; }
.lab2-chk  { display:flex; align-items:center; gap:6px; cursor:pointer; font-size:12px; color:#C8DFF8; }
.lab2-chk input { cursor:pointer; }
.lab2-doc-btn { background:#1A3A6E; border:1px solid #2A5CAA; color:#7ABAFF; border-radius:3px; padding:3px 8px; cursor:pointer; display:flex; align-items:center; }
.lab2-doc-btn:hover { background:#2A5CAA; }
.lab2-cert-box { border:1px solid #2A4A7A; border-radius:4px; padding:8px 12px; background:rgba(20,40,80,0.4); display:flex; flex-direction:column; gap:5px; width:100%; }
.lab2-cert-title { font-size:11px; font-weight:700; color:#7ABAFF; margin-bottom:4px; }

/* ---- TAB LABORAL ---- */
.lab-two-col { display: flex; gap: 18px; align-items: flex-start; }
.lab-col { flex: 1; display: flex; flex-direction: column; gap: 5px; }
.lab-row { display: flex; align-items: center; gap: 8px; min-height: 26px; }
.lab-lbl { font-size: 11.5px; color: #A8C0E0; min-width: 170px; text-align: right; flex-shrink: 0; }
.lab-lbl.req::after { content: ' *'; color: #F87171; }
.lab-inp    { flex: 1; height: 24px; font-size: 12px; }
.lab-inp-sm { width: 130px; flex-shrink: 0; height: 24px; font-size: 12px; }
.lab-inp-xs { width: 70px; flex-shrink: 0; height: 24px; font-size: 12px; }
.lab-chk-row { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.lab-lbl-chk { font-size: 12px; color: #C8DFF8; }
.lab-btn-doc {
  background: #1A3A6E; border: 1px solid #2A5CAA; color: #7ABAFF;
  border-radius: 3px; padding: 3px 8px; cursor: pointer; display: flex; align-items: center;
}
.lab-btn-doc:hover { background: #2A5CAA; }
/* Certificado de Rentas */
.lab-cert-box {
  margin-top: 12px; border: 1px solid #2A4A7A; border-radius: 5px;
  padding: 8px 14px; background: rgba(20,40,80,0.4);
}
.lab-cert-title { font-size: 11px; font-weight: 700; color: #7ABAFF; margin-bottom: 7px; }
.lab-cert-row { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; }

/* ---- SECTION TITLE ---- */
.ficha-section-title {
  display: flex; align-items: center; gap: 10px;
  font-family: 'Rajdhani', sans-serif;
  font-size: 13px; font-weight: 700;
  color: #3B82F6; letter-spacing: 2px; text-transform: uppercase;
  margin-bottom: 18px; padding-bottom: 10px;
  border-bottom: 1px solid #152A48;
}
.ficha-section-title svg { opacity: 0.75; flex-shrink: 0; }

/* ---- FIELD GRID ---- */
.ficha-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px 22px; margin-bottom: 4px;
}
.ficha-field { display: flex; flex-direction: column; gap: 6px; }
.ficha-field.col2 { grid-column: span 2; }
.ficha-field.col3 { grid-column: span 3; }

.ficha-label {
  font-family: 'Exo 2', sans-serif;
  font-size: 10px; font-weight: 800;
  color: #2A5070; letter-spacing: 1.2px; text-transform: uppercase;
}
.ficha-label.req::after { content: ' *'; color: #EF4444; }

.ficha-input {
  padding: 9px 12px;
  background: #0B1928;
  border: 1.5px solid #1E3A5F;
  border-radius: 6px; color: #FFFFFF;
  font-family: 'Exo 2', sans-serif;
  font-size: 13px; font-weight: 700;
  outline: none; width: 100%;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.ficha-input:focus { border-color: #2563EB; box-shadow: 0 0 0 2px rgba(37,99,235,0.18); }
.ficha-input::placeholder { color: #1A3450; font-weight: 400; }
/* Calendario visible en todos los date inputs de la ficha */
.ficha-input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(0.7) sepia(1) saturate(3) hue-rotate(180deg);
  cursor: pointer; opacity: 0.85;
}
.ficha-input[type="date"]::-webkit-calendar-picker-indicator:hover { opacity: 1; }
select.ficha-input { cursor: pointer; }
select.ficha-input option { background: #0B1928; color: #FFFFFF; }
input[type="date"].ficha-input { color-scheme: dark; }
.ficha-input[readonly] { opacity: 0.6; cursor: not-allowed; }
.ficha-input:disabled  { opacity: 0.6; cursor: not-allowed; }
.ficha-money { color: #10B981 !important; }
.ficha-money:focus { color: #FFFFFF !important; }

/* RUT validation inside ficha */
.ficha-field .rut-msg { color: #DC2626; font-size: 10px; font-weight: 700; font-family: 'Exo 2', sans-serif; margin-top: 2px; }
.ficha-field .rut-msg.ok { color: #059669; }

/* DTE tab — search button & radio */
.dte-search-btn { display:flex; align-items:center; justify-content:center; width:30px; height:36px; background:#0D1E38; border:1.5px solid #1A3A6E; border-radius:4px; color:#4A8ABF; cursor:pointer; transition:background 0.2s,color 0.2s; flex-shrink:0; }
.dte-search-btn:hover { background:#163060; color:#FFFFFF; }

/* Modal búsqueda actividades SII */
.modal-act-box {
  width: 700px; max-width: 96vw;
  background: #060D1C; border: 1.5px solid #1E3A6E; border-radius: 6px;
  display: flex; flex-direction: column;
  box-shadow: 0 24px 80px rgba(0,0,0,0.92);
  max-height: 88vh; overflow: hidden;
}
.modal-act-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 13px 18px; border-bottom: 2px solid #0E2040;
  font-family: 'Rajdhani', sans-serif; font-size: 15px; font-weight: 700; color: #FFFFFF;
  flex-shrink: 0;
}
.modal-act-close {
  background: none; border: none; color: #3A6A9A; cursor: pointer;
  font-size: 18px; line-height: 1; padding: 2px 6px; border-radius: 3px;
  transition: color 0.2s, background 0.2s;
}
.modal-act-close:hover { color: #FFFFFF; background: #1A3A6E; }
.act-item {
  display: flex; align-items: flex-start; gap: 14px;
  padding: 8px 16px; border-bottom: 1px solid #0A1830;
  cursor: pointer; transition: background 0.12s;
}
.act-item:hover { background: #0D1E3A; }
.act-cod {
  font-family: 'Exo 2', sans-serif; font-size: 12px; font-weight: 800;
  color: #3B82F6; min-width: 68px; flex-shrink: 0; padding-top: 1px; letter-spacing: 0.5px;
}
.act-desc {
  font-family: 'Exo 2', sans-serif; font-size: 11.5px; color: #A8C4D8; line-height: 1.45;
}
.act-empty {
  padding: 28px; text-align: center;
  color: #3A6A9A; font-family: 'Exo 2', sans-serif; font-size: 12px;
}
.dte-search-btn:disabled { opacity:0.4; cursor:not-allowed; }
.dte-radio-label { display:flex; align-items:center; gap:8px; font-family:'Exo 2',sans-serif; font-size:12px; font-weight:600; color:#7AAAC8; cursor:pointer; }
.dte-radio-label input[type="radio"] { accent-color:#2563EB; width:15px; height:15px; cursor:pointer; }
.dte-radio-label input[type="radio"]:disabled { cursor:not-allowed; }

/* ---- NAV BUTTONS ---- */
.ficha-nav-bottom {
  display: flex; align-items: center;
  justify-content: flex-end; gap: 12px;
  margin-top: 36px; padding-top: 20px;
  border-top: 1px solid #152A48;
}

.ficha-btn-next {
  display: inline-flex; align-items: center;
  background: linear-gradient(135deg, #1D4ED8, #2563EB);
  border: none; color: #FFFFFF;
  padding: 10px 26px; border-radius: 6px;
  font-family: 'Exo 2', sans-serif;
  font-size: 13px; font-weight: 800;
  cursor: pointer; letter-spacing: 0.4px;
  box-shadow: 0 0 18px rgba(37,99,235,0.4); transition: all 0.15s;
}
.ficha-btn-next:hover { box-shadow: 0 0 30px rgba(59,130,246,0.6); transform: translateY(-1px); }

.ficha-btn-prev {
  display: inline-flex; align-items: center;
  background: transparent; border: 1.5px solid #253A5A;
  color: #7AAAC8; padding: 10px 20px; border-radius: 6px;
  font-family: 'Exo 2', sans-serif;
  font-size: 13px; font-weight: 700;
  cursor: pointer; letter-spacing: 0.3px; transition: all 0.15s;
}
.ficha-btn-prev:hover { border-color: #4A7ABA; color: #FFFFFF; background: rgba(37,99,235,0.08); }

/* ============================================================
   LAYOUT SOFTLAND-STYLE — PERSONAL TAB
   ============================================================ */

/* Dos columnas: izquierda (campos) + derecha (foto/misc) */
.fp-two-col {
  display: grid;
  grid-template-columns: 1fr 220px;
  gap: 20px;
  align-items: start;
}
.fp-left { display: flex; flex-direction: column; gap: 8px; }
.fp-right { display: flex; flex-direction: column; }

/* Fila de campos dentro de la columna izquierda */
.fp-row {
  display: flex; flex-direction: row;
  gap: 10px; align-items: flex-start;
}

/* Campo individual: label arriba, input abajo */
.fp-field {
  display: flex; flex-direction: column; gap: 4px;
}
.fp-label {
  font-family: 'Exo 2', sans-serif;
  font-size: 9.5px; font-weight: 800;
  color: #2A5070; letter-spacing: 1.2px;
  text-transform: uppercase; white-space: nowrap;
}
.fp-label em { font-style: normal; color: #EF4444; }

/* Caja de firma */
.fp-firma-box {
  width: 100%; height: 72px;
  background: #060F1E;
  border: 1.5px dashed #1A3050;
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
}
.fp-firma-txt {
  font-family: 'Exo 2', sans-serif;
  font-size: 9px; font-weight: 700;
  color: #1E3A5A; letter-spacing: 1.5px; text-transform: uppercase;
}

/* Checkbox con label */
.fp-check-opt {
  display: inline-flex; align-items: center; gap: 7px;
  cursor: pointer;
  font-family: 'Exo 2', sans-serif;
  font-size: 11px; font-weight: 600;
  color: #6A8AAE;
}
.fp-check-opt input[type="checkbox"] {
  accent-color: #2563EB; width: 13px; height: 13px; cursor: pointer;
}

/* Caja de sección con borde (estilo group box) */
.fp-group-box {
  background: #071020;
  border: 1.5px solid #152C4A;
  border-radius: 7px;
  padding: 10px 14px;
}
.fp-group-title {
  font-family: 'Exo 2', sans-serif;
  font-size: 9.5px; font-weight: 800;
  color: #3A6A9A; letter-spacing: 1.5px;
  text-transform: uppercase; margin-bottom: 8px;
}

/* Email box layout (flex horizontal) */
.fp-email-box {
  margin-top: 14px;
  display: flex; flex-direction: row;
  align-items: flex-start; gap: 0;
}
.fp-sitio-web {
  flex: 0 0 230px; margin-left: 20px;
  border-left: 1px solid #152C4A; padding-left: 16px;
}

/* Fila inline: label [label] + input al lado */
.fp-inline-row {
  display: flex; align-items: center; gap: 8px;
}
.fp-inline-label {
  font-family: 'Exo 2', sans-serif;
  font-size: 9.5px; font-weight: 800;
  color: #2A5070; letter-spacing: 1px;
  text-transform: uppercase;
  flex: 0 0 70px; text-align: right;
}

/* ============================================================
   PAGO TAB — FORMA DE PAGO SOFTLAND STYLE
   ============================================================ */
.fp-pago-group {
  padding: 0; overflow: hidden;
}
.fp-pago-row {
  display: flex; align-items: center; gap: 14px;
  padding: 11px 18px;
  border-bottom: 1px solid #0E2040;
  cursor: pointer; transition: background 0.12s;
  margin: 0;
}
.fp-pago-row:last-child { border-bottom: none; }
.fp-pago-row:hover { background: rgba(37,99,235,0.06); }
.fp-pago-row:has(input:checked) { background: rgba(37,99,235,0.10); }
.fp-pago-row input[type="radio"] {
  accent-color: #2563EB; width: 15px; height: 15px;
  cursor: pointer; flex-shrink: 0;
}
.fp-pago-lbl {
  font-family: 'Exo 2', sans-serif;
  font-size: 13px; font-weight: 700;
  color: #FFFFFF; letter-spacing: 0.3px;
  flex: 1;
}
.fp-pago-sub { width: 200px; }
.fp-pago-sub.hidden { display: none; }

/* Banco fields container */
.fp-banco-indent {
  margin-top: 8px;
  padding: 14px 16px;
  background: #060F1E;
  border: 1px solid #152C4A;
  border-radius: 6px;
}
.fp-banco-indent.hidden { display: none; }

/* ============================================================
   PREVISIÓN TAB — NUEVOS ELEMENTOS
   ============================================================ */

/* Dos columnas iguales para datos AFP y datos */
.fp-two-small {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

/* Caja interna (sub-sección) dentro de ficha-box */
.fp-sub-box {
  background: #060F1C;
  border: 1px solid #152C4A;
  border-radius: 6px;
  padding: 10px 12px;
}
.fp-sub-title {
  font-family: 'Exo 2', sans-serif;
  font-size: 9px; font-weight: 800;
  color: #2A5A80; letter-spacing: 1.5px;
  text-transform: uppercase; margin-bottom: 4px;
  display: block;
}

/* Botones APV */
.fp-apv-row {
  display: flex; gap: 8px; margin-top: 14px;
}
.fp-apv-btn {
  background: transparent;
  border: 1.5px solid #1A3A6E;
  color: #5A8AAE;
  padding: 6px 14px; border-radius: 5px;
  font-family: 'Exo 2', sans-serif;
  font-size: 11px; font-weight: 700;
  cursor: pointer; letter-spacing: 0.5px;
  transition: all 0.15s;
}
.fp-apv-btn:hover { border-color: #2563EB; color: #FFFFFF; background: rgba(37,99,235,0.1); }
.fp-apv-btn.activo { border-color: #2563EB; color: #FFFFFF; background: rgba(37,99,235,0.25); }
.fp-apv-panel { margin-top: 0; }
.fp-apv-regimen { display:flex; flex-direction:column; gap:6px; margin-top:4px; }
.fp-apv-reg-opt { display:flex; align-items:center; gap:8px; cursor:pointer; font-size:12px; color:#B8D4F0; }
.fp-apv-reg-opt input { accent-color:#3B82F6; cursor:pointer; }
.fp-apv-reg-opt small { color:#5A8AAE; font-size:10px; }

/* ---- PERSONAL TAB: TOP ROW ---- */
.ficha-personal-top {
  display: flex; flex-direction: row;
  gap: 20px; align-items: flex-start;
  margin-bottom: 0;
}
.ficha-personal-fields { flex: 1; min-width: 0; }

.ficha-foto-box {
  flex-shrink: 0;
  width: 112px; height: 135px;
  background: #071020;
  border: 2px dashed #1E3A6E;
  border-radius: 8px;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  cursor: pointer;
  transition: border-color 0.2s;
}
.ficha-foto-box:hover { border-color: #2563EB; }
.ficha-foto-txt {
  font-family: 'Exo 2', sans-serif;
  font-size: 9px; font-weight: 700;
  color: #2A4A70; letter-spacing: 1.5px;
  text-transform: uppercase; margin-top: 2px;
}

/* ---- RADIO GROUPS AREA ---- */
.ficha-radios-area {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid #0E2040;
}

.ficha-radio-group {
  display: flex; flex-direction: column;
  gap: 8px; margin-bottom: 16px;
}

.ficha-radio-grouplabel {
  font-family: 'Exo 2', sans-serif;
  font-size: 10px; font-weight: 800;
  color: #3A6A9A; letter-spacing: 1.5px;
  text-transform: uppercase;
}

.ficha-radio-row {
  display: flex; flex-direction: row;
  flex-wrap: wrap; gap: 6px;
}

.ficha-radio-opt {
  display: inline-flex; align-items: center; gap: 7px;
  background: #091525; border: 1.5px solid #1A3050;
  border-radius: 5px; padding: 6px 12px;
  cursor: pointer; transition: all 0.15s;
  font-family: 'Exo 2', sans-serif;
  font-size: 12px; font-weight: 700;
  color: #7A9ABE;
  user-select: none;
}
.ficha-radio-opt:hover { border-color: #2563EB; color: #FFFFFF; background: rgba(37,99,235,0.08); }
.ficha-radio-opt input[type="radio"] {
  accent-color: #2563EB;
  width: 13px; height: 13px; cursor: pointer;
  flex-shrink: 0;
}
.ficha-radio-opt:has(input:checked) {
  border-color: #2563EB;
  background: rgba(37,99,235,0.12);
  color: #FFFFFF;
}
.ficha-radio-opt span { line-height: 1; }

.ficha-radio-inline-groups {
  display: flex; flex-direction: row;
  gap: 32px; flex-wrap: wrap; align-items: flex-start;
}

/* ---- PAGO TAB ---- */
.ficha-pago-box {
  display: flex; flex-direction: column;
  gap: 4px; margin-top: 10px;
}

.ficha-pago-opt {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 14px;
  background: #091525; border: 1.5px solid #1A3050;
  border-radius: 6px; cursor: pointer;
  transition: all 0.15s; margin-bottom: 0;
  font-family: 'Exo 2', sans-serif;
}
.ficha-pago-opt:hover { border-color: #2563EB; background: rgba(37,99,235,0.07); }
.ficha-pago-opt:has(input:checked) {
  border-color: #2563EB;
  background: rgba(37,99,235,0.11);
}
.ficha-pago-opt input[type="radio"] {
  accent-color: #2563EB;
  width: 15px; height: 15px; cursor: pointer; flex-shrink: 0;
}

.ficha-pago-label {
  font-size: 13px; font-weight: 700;
  color: #FFFFFF; letter-spacing: 0.3px;
}

.ficha-pago-sub {
  margin-left: auto;
  width: 200px;
}
.ficha-pago-sub.hidden { display: none; }

.ficha-banco-fields {
  margin-top: 4px;
  padding: 14px 16px;
  background: #060F1E;
  border: 1px solid #1A3050;
  border-radius: 6px;
}
.ficha-banco-fields.hidden { display: none; }

/* ---- PREVISIÓN TAB ---- */
.ficha-prevision-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.ficha-box {
  background: #0A1528;
  border: 1.5px solid #1A3A6E;
  border-radius: 10px;
  padding: 18px 20px;
}

.ficha-box-title {
  display: flex; align-items: center; gap: 8px;
  font-family: 'Rajdhani', sans-serif;
  font-size: 13px; font-weight: 700;
  color: #7AAAC8; letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid #1A3A5A;
}
.ficha-box-title svg { opacity: 0.75; flex-shrink: 0; }



/* ============================================================
   VENTANA PARÁMETROS (estilo Softland)
   ============================================================ */
.param-overlay {
  display: none;
  position: fixed; inset: 0; z-index: 3000;
  background: rgba(0,0,0,0.55);
  align-items: center; justify-content: center;
}
.param-window {
  background: #F0F0F0;
  border: 2px solid #999;
  border-radius: 4px;
  box-shadow: 4px 4px 16px rgba(0,0,0,0.5);
  width: 560px; max-width: 96vw;
  display: flex; flex-direction: column;
  font-family: 'Segoe UI', Tahoma, sans-serif;
  color: #111;
}
.param-titlebar {
  background: linear-gradient(to right, #2A5CAA, #4A8ADE);
  color: #fff;
  display: flex; align-items: center; gap: 8px;
  padding: 6px 10px;
  border-radius: 2px 2px 0 0;
}
.param-icon { font-size: 14px; }
.param-title { flex: 1; font-size: 13px; font-weight: 600; }
.param-close {
  background: #C0392B; border: none; color: #fff;
  width: 18px; height: 18px; border-radius: 2px;
  font-size: 11px; cursor: pointer; line-height: 1;
}
.param-close:hover { background: #E74C3C; }
.param-tabs {
  display: flex; flex-wrap: wrap;
  background: #D8D8D8;
  border-bottom: 2px solid #999;
  padding: 4px 4px 0;
  gap: 2px;
}
.param-tab {
  background: #C8C8C8; border: 1px solid #999;
  border-bottom: none; border-radius: 3px 3px 0 0;
  padding: 4px 10px; font-size: 11.5px;
  cursor: pointer; color: #333;
  font-family: 'Segoe UI', Tahoma, sans-serif;
}
.param-tab:hover { background: #DDEEFF; }
.param-tab.active { background: #F0F0F0; color: #000; font-weight: 700; border-color: #888; }
.param-body {
  background: #F0F0F0;
  padding: 18px 20px;
  min-height: 200px;
  flex: 1;
}
.param-section { display: flex; flex-direction: column; gap: 10px; }
.param-row {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 0;
}
.param-label {
  font-size: 12px; color: #333;
  min-width: 110px; text-align: right;
}
.param-select {
  border: 1px solid #999; border-radius: 2px;
  padding: 3px 6px; font-size: 12px;
  background: #fff; color: #111;
  height: 26px; min-width: 120px;
}
.param-input-sm {
  border: 1px solid #999; border-radius: 2px;
  padding: 3px 6px; font-size: 12px;
  background: #fff; color: #111;
  height: 26px; width: 72px;
}
.param-input-ro {
  border: 1px solid #bbb; border-radius: 2px;
  padding: 3px 6px; font-size: 12px;
  background: #E8E8E8; color: #555;
  height: 26px; min-width: 120px;
}
.param-btn-add {
  background: #2A5CAA; color: #fff;
  border: none; border-radius: 3px;
  padding: 5px 14px; font-size: 12px;
  cursor: pointer;
}
.param-btn-add:hover { background: #1A4A9A; }
.param-years-table { margin-top: 12px; }
.param-years-table table { width: 100%; border-collapse: collapse; font-size: 12px; }
.param-years-table th {
  background: #C8D8EE; color: #222;
  padding: 5px 8px; border: 1px solid #AAA;
  text-align: left; font-weight: 600;
}
.param-years-table td {
  padding: 4px 8px; border: 1px solid #CCC;
  background: #fff; color: #111;
}
.param-years-table td strong { color: #111; }
.param-years-table tr:nth-child(even) td { background: #F5F5FF; }
.param-estado {
  display: inline-block; padding: 2px 8px;
  border-radius: 10px; font-size: 11px; font-weight: 700;
}
.param-estado.abierto { background: #D4EDDA; color: #155724; }
.param-estado.cerrado { background: #F8D7DA; color: #721C24; }
.param-btn-sm {
  background: #2A5CAA; color: #fff;
  border: none; border-radius: 2px;
  padding: 2px 8px; font-size: 11px;
  cursor: pointer; margin-right: 3px;
}
.param-btn-sm:hover { background: #1A4A9A; }
.param-btn-sm.danger { background: #C0392B; }
.param-btn-sm.danger:hover { background: #E74C3C; }
.param-footer {
  background: #E0E0E0;
  border-top: 1px solid #AAA;
  padding: 8px 12px;
  display: flex; gap: 6px; justify-content: flex-end;
}
.param-btn-ok {
  background: #2A5CAA; color: #fff;
  border: 1px solid #1A4A9A; border-radius: 3px;
  padding: 4px 16px; font-size: 12px; cursor: pointer;
}
.param-btn-ok:hover { background: #1A4A9A; }
.param-btn-cancel, .param-btn-salir {
  background: #E0E0E0; color: #333;
  border: 1px solid #999; border-radius: 3px;
  padding: 4px 14px; font-size: 12px; cursor: pointer;
}
.param-btn-cancel:hover, .param-btn-salir:hover { background: #CCCCCC; }

/* ============================================================
   COPIA DE FICHAS (estilo Softland)
   ============================================================ */
.copia-window {
  background: #F0F0F0; border: 2px solid #999;
  border-radius: 4px; width: 480px; max-width: 96vw;
  box-shadow: 4px 4px 16px rgba(0,0,0,0.5);
  font-family: 'Segoe UI', Tahoma, sans-serif; color: #111;
}
.copia-titlebar {
  background: linear-gradient(to right, #2A5CAA, #4A8ADE);
  color: #fff; display: flex; align-items: center; gap: 8px;
  padding: 6px 10px; border-radius: 2px 2px 0 0;
  font-size: 13px; font-weight: 600;
}
.copia-titlebar svg { flex-shrink: 0; }
.copia-titlebar span { flex: 1; }
.copia-close {
  background: #C0392B; border: none; color: #fff;
  width: 18px; height: 18px; border-radius: 2px;
  font-size: 11px; cursor: pointer; line-height: 1;
}
.copia-close:hover { background: #E74C3C; }
.copia-body {
  display: flex; gap: 16px; padding: 18px 16px;
}
.copia-left {
  flex: 1; display: flex; flex-direction: column; gap: 12px;
}
.copia-desc {
  font-size: 12px; color: #222; line-height: 1.5;
  border: 1px solid #CCC; background: #FFF;
  padding: 10px; border-radius: 2px;
}
.copia-note {
  font-size: 11px; color: #555; line-height: 1.5;
  border: 1px solid #CCC; background: #FFF;
  padding: 10px; border-radius: 2px;
}
.copia-right {
  display: flex; flex-direction: column; gap: 6px;
  min-width: 160px;
}
.copia-label { font-size: 12px; color: #333; font-weight: 600; }
.copia-input {
  border: 1px solid #999; border-radius: 2px;
  padding: 4px 8px; font-size: 12px; background: #fff;
  height: 28px; width: 100%;
}
.copia-input:focus { outline: 2px solid #2A5CAA; }
.copia-footer {
  background: #E0E0E0; border-top: 1px solid #AAA;
  padding: 8px 12px; display: flex; gap: 6px; justify-content: flex-end;
}
.copia-btn-cancel {
  display: flex; align-items: center; gap: 5px;
  background: #E0E0E0; color: #333; border: 1px solid #999;
  border-radius: 3px; padding: 4px 14px; font-size: 12px; cursor: pointer;
}
.copia-btn-cancel:hover { background: #CCCCCC; }
.copia-btn-grabar {
  display: flex; align-items: center; gap: 5px;
  background: #2A5CAA; color: #fff; border: 1px solid #1A4A9A;
  border-radius: 3px; padding: 4px 16px; font-size: 12px; cursor: pointer;
}
.copia-btn-grabar:hover { background: #1A4A9A; }
.ficha-btn-eliminar {
  display: inline-flex; align-items: center; gap: 6px;
  background: #1A0A0A; border: 1.5px solid #7F1D1D;
  color: #F87171; border-radius: 5px;
  padding: 6px 14px; font-size: 12px; font-weight: 600;
  cursor: pointer; font-family: 'Exo 2', sans-serif;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.ficha-btn-eliminar:hover { background: #7F1D1D; color: #fff; border-color: #EF4444; }

.ficha-btn-copiar {
  display: flex; align-items: center; gap: 6px;
  background: #0D1E38; border: 1.5px solid #1A3A6E;
  color: #7AAAC8; border-radius: 5px;
  padding: 6px 14px; font-size: 12px; font-weight: 600;
  cursor: pointer; font-family: 'Exo 2', sans-serif;
  transition: background 0.2s, color 0.2s;
}
.ficha-btn-copiar:hover { background: #163060; color: #FFFFFF; }

.ficha-btn-editar {
  display: flex; align-items: center; gap: 6px;
  background: linear-gradient(135deg, #065F46, #047857);
  border: 1.5px solid #10B981; color: #ECFDF5;
  border-radius: 5px; padding: 6px 18px;
  font-size: 12px; font-weight: 700; cursor: pointer;
  font-family: 'Exo 2', sans-serif;
  box-shadow: 0 0 12px rgba(16,185,129,0.3);
  transition: box-shadow 0.2s, transform 0.15s;
}
.ficha-btn-editar:hover { box-shadow: 0 0 24px rgba(16,185,129,0.55); transform: translateY(-1px); }

/* Modo solo lectura — deshabilita visualmente los campos */
#formTrabajador.ficha-readonly input:not([type="radio"]):not([type="checkbox"]),
#formTrabajador.ficha-readonly select,
#formTrabajador.ficha-readonly textarea {
  pointer-events: none; opacity: 0.65; background: rgba(0,0,0,0.15) !important;
}
#formTrabajador.ficha-readonly input[type="radio"],
#formTrabajador.ficha-readonly input[type="checkbox"] {
  pointer-events: none; opacity: 0.6;
}
#formTrabajador.ficha-readonly button:not(.ficha-tab-btn) {
  pointer-events: none; opacity: 0.4;
}

/* Sub-cascada (tercer nivel) */
.cascada-sub {
  position: relative;
}
.cascada-sub-label {
  display: flex; align-items: center; gap: 4px;
  padding: 8px 16px; font-size: 12.5px; color: #C8D8EC;
  cursor: pointer; white-space: nowrap;
  font-family: 'Exo 2', sans-serif; font-weight: 500;
}
.cascada-sub-label:hover { background: #0D2040; color: #FFFFFF; }
.cascada-sub-menu {
  display: none;
  position: absolute; left: 100%; top: 0;
  background: #060F20; border: 1px solid #1A3A6E;
  border-radius: 4px; min-width: 160px;
  box-shadow: 4px 4px 16px rgba(0,0,0,0.7);
  z-index: 999;
}
.cascada-sub:hover .cascada-sub-menu { display: block; }

/* ============================================================
   VENTANA TABLAS GENÉRICAS (estilo Softland)
   ============================================================ */
.tabla-window {
  background: #F0F0F0; border: 2px solid #999;
  border-radius: 4px; width: 560px; max-width: calc(100vw - 20px);
  box-shadow: 4px 4px 18px rgba(0,0,0,0.55);
  font-family: 'Segoe UI', Tahoma, sans-serif;
  display: flex; flex-direction: column;
  box-sizing: border-box;
}
.tabla-window.ancho { width: 1080px; }
.tabla-titlebar {
  background: linear-gradient(to right, #2A5CAA, #4A8ADE);
  color: #fff; display: flex; align-items: center; gap: 8px;
  padding: 6px 10px; font-size: 13px; font-weight: 600;
}
.tabla-titlebar span { flex: 1; }
.tabla-close {
  background: #C0392B; border: none; color: #fff;
  width: 18px; height: 18px; border-radius: 2px;
  font-size: 11px; cursor: pointer;
}
.tabla-close:hover { background: #E74C3C; }
.tabla-body { display: flex; min-height: 320px; }
.tabla-left {
  width: 158px; flex-shrink: 0;
  background: linear-gradient(175deg, #0F2A56 0%, #1A3F7A 40%, #1E4F9A 100%);
  border-right: 1px solid #0A1E40;
  display: flex; flex-direction: column; align-items: center;
  padding: 20px 12px 16px; gap: 12px;
}
.tabla-icon-box {
  width: 68px; height: 68px;
  background: linear-gradient(145deg, #0D2347 0%, #1A4A9A 45%, #2468D4 100%);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 14px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.22), inset 0 -1px 0 rgba(0,0,0,0.3);
}
.tabla-left-title {
  font-size: 13px; font-weight: 700; color: #FFFFFF;
  text-align: center; letter-spacing: 0.3px;
  text-shadow: 0 1px 3px rgba(0,0,0,0.4);
}
.tabla-left-desc {
  font-size: 10px; color: rgba(180,210,255,0.85); text-align: center;
  line-height: 1.5; font-style: italic;
}
.tabla-right {
  flex: 1; display: flex; flex-direction: column; padding: 10px;
  gap: 8px;
}
.tabla-list-wrap {
  flex: 1; border: 1px solid #AAA; background: #fff;
  overflow-y: auto; max-height: 200px;
}
.tabla-list { width: 100%; border-collapse: collapse; font-size: 12px; }
.tabla-list th {
  background: #C8D8EE; color: #222; padding: 5px 8px;
  border: 1px solid #AAA; text-align: left; font-weight: 600;
  position: sticky; top: 0;
}
.tabla-list td { padding: 4px 8px; border-bottom: 1px solid #DDD; color: #111; font-weight: 500; }
.tabla-list tr:hover td { background: #DDEEFF; cursor: pointer; }
.tabla-list tr.selected td { background: #2A5CAA; color: #fff; }
.tabla-form { display: flex; flex-direction: column; gap: 6px; }
.tabla-form-row { display: flex; align-items: center; gap: 8px; }
.tabla-form-label { font-size: 12px; color: #333; min-width: 80px; text-align: right; }
.tabla-form-input {
  flex: 1; border: 1px solid #999; border-radius: 2px;
  padding: 3px 7px; font-size: 12px; height: 26px; background: #fff;
}
.tabla-form-input.sm { max-width: 100px; flex: none; }
.tabla-form-input:focus { outline: 2px solid #2A5CAA; }
.tabla-btns {
  display: flex; justify-content: space-between; align-items: center;
  padding-top: 4px; border-top: 1px solid #CCC; gap: 4px;
}
.tabla-btns-left  { display: flex; gap: 4px; }
.tabla-btns-right { display: flex; gap: 4px; }
.tabla-btn-sync {
  background: linear-gradient(135deg,#0B3D91,#1565C0) !important;
  border-color: #1976D2 !important; color: #fff !important;
}
.tabla-btn-sync:hover { background: linear-gradient(135deg,#1565C0,#1976D2) !important; }
.tabla-btn {
  display: flex; align-items: center; gap: 5px;
  background: #2A5CAA; color: #fff; border: 1px solid #1A4A9A;
  border-radius: 3px; padding: 4px 12px; font-size: 12px; cursor: pointer;
}
.tabla-btn:hover { background: #1A4A9A; }
.tabla-btn.danger { background: #C0392B; border-color: #A93226; }
.tabla-btn.danger:hover { background: #E74C3C; }
.tabla-btn.outline { background: #E0E0E0; color: #333; border-color: #999; }
.tabla-btn.outline:hover { background: #CCCCCC; }
.tabla-btn.success { background: #1E7E34; border-color: #155724; }
.tabla-btn.success:hover { background: #27AE60; }

/* ══════════════════════════════════════
   TAB LABORAL — Card Layout (lb-*)
   ══════════════════════════════════════ */
.lb-wrap {
  display: flex; gap: 14px; align-items: flex-start; padding: 4px 2px;
}
.lb-col {
  flex: 1; display: flex; flex-direction: column; gap: 10px;
}

/* Tarjeta */
.lb-card {
  background: rgba(10,22,50,0.55); border: 1px solid #1E3A6A;
  border-radius: 6px; padding: 10px 14px;
  display: flex; flex-direction: column; gap: 7px;
}
.lb-card-highlight {
  background: rgba(30,8,8,0.70); border-color: #6A1A1A;
}

/* Cabecera de tarjeta */
.lb-card-hdr {
  display: flex; align-items: center; gap: 6px;
  font-size: 10.5px; font-weight: 700; color: #5A9AEA;
  letter-spacing: 0.7px; text-transform: uppercase;
  border-bottom: 1px solid #1E3A6A; padding-bottom: 6px; margin-bottom: 2px;
}
.lb-card-hdr svg { color: #4A8ADA; flex-shrink: 0; }

/* Fila de campo */
.lb-field {
  display: flex; align-items: center; gap: 8px; min-height: 24px;
}
.lb-field-row {
  display: flex; gap: 10px;
}
.lb-half {
  flex: 1; display: flex; align-items: center; gap: 6px;
}
.lb-field-accent {
  background: rgba(37,99,235,0.09); border-radius: 4px;
  padding: 3px 8px; border-left: 2px solid #2563EB; margin-left: -8px;
}

/* Etiquetas */
.lb-lbl {
  font-size: 11px; color: #8AAACE; min-width: 116px;
  flex-shrink: 0; text-align: right; line-height: 1.2;
}
.lb-half .lb-lbl { min-width: 88px; }
.lb-lbl-accent { color: #7ABAFF; font-weight: 700; }

/* Inputs / Selects */
.lb-inp {
  height: 22px; font-size: 11.5px; border-radius: 2px;
  background: #0A1628; border: 1px solid #2A4A7A; color: #D0E8FF;
  padding: 0 6px; outline: none; font-family: 'Exo 2', sans-serif;
}
.lb-inp:focus { border-color: #4A8ADA; background: #0D1E38; }
.lb-inp-grow { flex: 1; }
.lb-inp-sm   { width: 72px; flex-shrink: 0; }
.lb-inp-accent {
  border-color: #2563EB; background: #0A1A40; color: #60A5FA;
  font-weight: 700; font-size: 15px; height: 26px;
  text-align: center; width: 72px; flex-shrink: 0;
}
.lb-inp[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(0.7) sepia(1) saturate(3) hue-rotate(180deg);
  cursor: pointer; opacity: 0.85;
}
.lb-inp[type="date"]::-webkit-calendar-picker-indicator:hover { opacity: 1; }

/* Wrapper input + lupa (sin espacio entre ambos) */
.lb-inp-wrap {
  display: flex; align-items: center; flex: 1;
}
.lb-inp-wrap .lb-inp { border-radius: 2px 0 0 2px; flex: 1; }

/* Botón lupa */
.lb-lupa {
  background: #112040; border: 1px solid #2A5CAA; border-left: none;
  color: #5A9AEA; border-radius: 0 2px 2px 0;
  padding: 0 7px; cursor: pointer;
  display: flex; align-items: center; height: 22px; flex-shrink: 0;
}
.lb-lupa:hover { background: #1A3A70; color: #90CAFF; }

/* Botón documento */
.lb-btn-doc {
  background: #112040; border: 1px solid #2A5CAA; color: #5A9AEA;
  border-radius: 2px; padding: 3px 10px; cursor: pointer;
  display: flex; align-items: center; gap: 5px;
  font-size: 11px; font-family: 'Exo 2', sans-serif;
}
.lb-btn-doc:hover { background: #1A3A70; color: #90CAFF; }

/* Rol Privado */
.lb-rol-label {
  display: flex; align-items: center; gap: 12px;
  cursor: pointer; user-select: none; padding: 4px 0;
}
.lb-rol-txt {
  font-size: 13px; font-weight: 700; color: #E8A0A0; letter-spacing: 0.3px;
}
.lb-card-highlight .lb-rol-label:hover .lb-rol-txt { color: #FFD0D0; }

/* Control unificado de filtro por ROL: Todos / General / Rol Privado (SP749) */
.rol-seg { display:inline-flex; align-items:center; gap:9px; background:rgba(10,22,50,0.55); border:1px solid #1E3A6A; border-radius:8px; padding:6px 11px; font-family:'Exo 2',sans-serif; }
.rol-seg-lbl { display:inline-flex; align-items:center; gap:5px; font-size:10.5px; font-weight:800; letter-spacing:.8px; color:#5A9AEA; text-transform:uppercase; }
.rol-seg-btns { display:inline-flex; border:1px solid #2A4A7A; border-radius:7px; overflow:hidden; }
.rol-seg-b { border:none; border-right:1px solid #2A4A7A; background:#0A1628; color:#8AAACE; font-family:'Exo 2',sans-serif; font-size:12px; font-weight:700; padding:6px 14px; cursor:pointer; transition:background .12s, color .12s; white-space:nowrap; }
.rol-seg-b:last-child { border-right:none; }
.rol-seg-b:hover { background:#13294D; color:#CFE0F5; }
.rol-seg-b.on { color:#fff; }
.rol-seg-b.on-todos   { background:#2563EB; }
.rol-seg-b.on-general { background:#047857; }
.rol-seg-b.on-privado { background:#B91C1C; }

/* Checkboxes */
.lb-chk-row {
  display: flex; gap: 20px; flex-wrap: wrap; padding-top: 2px;
}
.lb-chk {
  display: flex; align-items: center; gap: 6px;
  cursor: pointer; font-size: 12px; color: #B8D4F0;
}
.lb-chk input { cursor: pointer; accent-color: #3B82F6; }

/* ══ BANNER ÉXITO AMARILLO ══ */
#toastExito {
  position: fixed; top: 140px; left: 50%; transform: translateX(-50%);
  z-index: 14000; animation: teIn 0.4s cubic-bezier(0.34,1.56,0.64,1) both;
  min-width: 380px;
}
#toastExito.te-hide { animation: teOut 0.5s ease forwards; }
@keyframes teIn  { from{opacity:0;transform:translateX(-50%) translateY(-30px) scale(0.92)} to{opacity:1;transform:translateX(-50%) translateY(0) scale(1)} }
@keyframes teOut { from{opacity:1;transform:translateX(-50%) scale(1)} to{opacity:0;transform:translateX(-50%) translateY(-20px) scale(0.95)} }

.te-banner {
  background: linear-gradient(135deg, #1A1200 0%, #231800 100%);
  border: 2px solid #F59E0B;
  border-radius: 10px;
  padding: 14px 18px;
  display: flex; align-items: center; gap: 14px;
  box-shadow: 0 0 30px rgba(245,158,11,0.35), 0 12px 40px rgba(0,0,0,0.8);
}
.te-left { flex-shrink: 0; }
.te-circle {
  width: 42px; height: 42px; border-radius: 50%;
  background: rgba(245,158,11,0.12);
  border: 2px solid rgba(245,158,11,0.5);
  display: flex; align-items: center; justify-content: center;
  animation: tePop 0.4s 0.2s cubic-bezier(0.34,1.56,0.64,1) both;
}
@keyframes tePop { from{transform:scale(0)} to{transform:scale(1)} }
.te-body { flex: 1; }
.te-title { font-size: 14px; font-weight: 800; color: #F59E0B; letter-spacing: 0.3px; }
.te-sub   { font-size: 12px; color: #D4A000; margin-top: 2px; }
.te-close {
  background: transparent; border: none; color: #A07000;
  cursor: pointer; font-size: 14px; padding: 2px 6px;
  border-radius: 4px; line-height: 1;
}
.te-close:hover { color: #F59E0B; background: rgba(245,158,11,0.1); }

/* Toast Error */
#toastError { position:fixed; top:140px; left:50%; transform:translateX(-50%); z-index:14000; animation:teIn 0.4s cubic-bezier(0.34,1.56,0.64,1) both; min-width:380px; }
#toastError.te-hide { animation:teOut 0.5s ease forwards; }
.te-banner-err { background:linear-gradient(135deg,#1A1200,#231800); border:2px solid #F59E0B; border-radius:10px; padding:14px 18px; display:flex; align-items:center; gap:14px; box-shadow:0 0 30px rgba(245,158,11,.35),0 12px 40px rgba(0,0,0,.8); }
.te-circle-err { width:42px; height:42px; border-radius:50%; background:rgba(245,158,11,.12); border:2px solid rgba(245,158,11,.5); display:flex; align-items:center; justify-content:center; animation:tePop 0.4s 0.2s cubic-bezier(0.34,1.56,0.64,1) both; }
.te-title-err { font-size:14px; font-weight:800; color:#F59E0B; letter-spacing:.3px; }
.te-sub-err   { font-size:12px; color:#D4A000; margin-top:2px; }
.te-close-err { background:transparent; border:none; color:#A07000; cursor:pointer; font-size:14px; padding:2px 6px; border-radius:4px; line-height:1; }
.te-close-err:hover { color:#F59E0B; background:rgba(245,158,11,.1); }

/* Toast Aviso */
#toastWarn { position:fixed; top:140px; left:50%; transform:translateX(-50%); z-index:14000; animation:teIn 0.4s cubic-bezier(0.34,1.56,0.64,1) both; min-width:380px; }
#toastWarn.te-hide { animation:teOut 0.5s ease forwards; }
.te-banner-warn { background:linear-gradient(135deg,#1A1200,#231800); border:2px solid #F59E0B; border-radius:10px; padding:14px 18px; display:flex; align-items:center; gap:14px; box-shadow:0 0 30px rgba(245,158,11,.35),0 12px 40px rgba(0,0,0,.8); }
.te-circle-warn { width:42px; height:42px; border-radius:50%; background:rgba(245,158,11,.12); border:2px solid rgba(245,158,11,.5); display:flex; align-items:center; justify-content:center; animation:tePop 0.4s 0.2s cubic-bezier(0.34,1.56,0.64,1) both; }
.te-title-warn { font-size:14px; font-weight:800; color:#F59E0B; letter-spacing:.3px; }
.te-sub-warn   { font-size:12px; color:#D4A000; margin-top:2px; }
.te-close-warn { background:transparent; border:none; color:#A07000; cursor:pointer; font-size:14px; padding:2px 6px; border-radius:4px; line-height:1; }
.te-close-warn:hover { color:#F59E0B; background:rgba(245,158,11,.1); }

/* ══════════════════════════════════════
   BANNER PREVIRED ANIMADO
   ══════════════════════════════════════ */
#toastPrevired {
  position: fixed; bottom: 32px; right: 32px; z-index: 9999;
  animation: tpIn 0.45s cubic-bezier(0.34,1.56,0.64,1) both;
}
#toastPrevired.tp-hide { animation: tpOut 0.5s ease forwards; }
@keyframes tpIn  { from { opacity:0; transform:translateY(30px) scale(0.9); } to { opacity:1; transform:translateY(0) scale(1); } }
@keyframes tpOut { from { opacity:1; transform:translateY(0) scale(1); } to { opacity:0; transform:translateY(16px) scale(0.95); } }

.tp-banner {
  background: linear-gradient(120deg,#071525 0%,#0B1E38 60%,#071A2E 100%);
  border: 1px solid #1A3A6A;
  border-top: 2px solid #2563EB;
  border-radius: 10px;
  padding: 12px 20px 10px;
  display: flex; align-items: center; gap: 14px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.7), 0 0 20px rgba(37,99,235,0.15);
  min-width: 0;
}
.tp-side {
  display: flex; flex-direction: column; align-items: center; gap: 5px;
}
.tp-pc {
  width: 44px; height: 44px; border-radius: 8px;
  background: rgba(37,99,235,0.12);
  border: 1px solid rgba(96,165,250,0.3);
  display: flex; align-items: center; justify-content: center;
}
.tp-pc-green {
  background: rgba(52,211,153,0.1);
  border-color: rgba(52,211,153,0.3);
}
.tp-name {
  font-size: 8.5px; font-weight: 800; letter-spacing: 1.6px;
  color: #4A8ADA; text-transform: uppercase;
}
.tp-name-green { color: #34D399; }
.tp-canal { display: flex; align-items: center; }
.tp-ok {
  display: flex; align-items: center; gap: 5px;
  font-size: 12px; font-weight: 800; color: #34D399;
  letter-spacing: 0.3px; white-space: nowrap;
  animation: tpOkFade 0.4s 0.8s both;
}
@keyframes tpOkFade { from { opacity:0; transform:scale(0.85); } to { opacity:1; transform:scale(1); } }
