:root{
  --bg:#f5f7fb;--surface:#ffffff;--surface2:#f8fafc;--ink:#111827;--muted:#64748b;--line:#e5e7eb;
  --brand:#b80f16;--brand2:#7f0b10;--dark:#101114;--success:#0f766e;--warning:#d97706;--shadow:0 20px 55px rgba(15,23,42,.10);
  --radius:22px;--radius2:16px;
}
*{box-sizing:border-box}html{scroll-behavior:smooth}body{margin:0;min-height:100vh;font-family:Inter,Segoe UI,Roboto,Arial,sans-serif;color:var(--ink);background:radial-gradient(circle at 4% 2%,rgba(184,15,22,.13),transparent 30rem),radial-gradient(circle at 96% 10%,rgba(17,24,39,.10),transparent 28rem),linear-gradient(135deg,#fff,#f3f6fb 55%,#eef2f8)}
button,input,select,textarea{font:inherit}button{border:0;cursor:pointer} .hidden{display:none!important}
.login-screen{position:fixed;inset:0;z-index:999;display:grid;place-items:center;padding:24px;background:linear-gradient(135deg,#08090c,#31070a 70%,#6c0a0f)}
.login-card{width:min(460px,96vw);background:rgba(255,255,255,.96);border:1px solid rgba(255,255,255,.7);border-top:7px solid var(--brand);border-radius:30px;padding:34px;box-shadow:0 35px 110px rgba(0,0,0,.42);display:grid;gap:12px}.login-card h1{margin:4px 0 0;text-align:center;font-size:34px}.login-card p,.login-card small{text-align:center;color:var(--muted);line-height:1.45}.brand-circle{width:78px;height:78px;border-radius:24px;background:linear-gradient(135deg,var(--brand),var(--brand2));color:white;display:grid;place-items:center;font-weight:950;letter-spacing:.8px;font-size:27px;margin:auto;box-shadow:0 18px 36px rgba(184,15,22,.30)}.brand-circle.small{width:48px;height:48px;border-radius:16px;font-size:18px;margin:0}
.login-card label,label{font-size:12px;font-weight:900;text-transform:uppercase;letter-spacing:.5px;color:#334155}input,select,textarea{width:100%;border:1px solid #d8dee9;border-radius:14px;background:#fff;padding:12px 13px;outline:none;color:#111827;font-weight:650}textarea{resize:vertical;min-height:80px}input:focus,select:focus,textarea:focus{border-color:var(--brand);box-shadow:0 0 0 4px rgba(184,15,22,.12)}.login-card button,.content button,.file-label{background:linear-gradient(135deg,var(--brand),var(--brand2));color:#fff;padding:12px 16px;border-radius:14px;font-weight:900;box-shadow:0 12px 28px rgba(184,15,22,.22);display:inline-flex;align-items:center;justify-content:center;gap:8px}.content button:hover,.file-label:hover,.login-card button:hover{filter:saturate(1.08);transform:translateY(-1px)}
.app{display:grid;grid-template-columns:310px minmax(0,1fr);min-height:100vh}.sidebar{position:sticky;top:0;height:100vh;background:linear-gradient(180deg,#08090c 0%,#14161d 58%,#35080b 100%);color:#fff;padding:22px;display:flex;flex-direction:column;gap:10px;box-shadow:14px 0 45px rgba(2,6,23,.22);overflow:auto}.sidebar::-webkit-scrollbar{width:8px}.sidebar::-webkit-scrollbar-thumb{background:rgba(255,255,255,.2);border-radius:20px}.logo-row{display:flex;align-items:center;gap:13px;padding:14px;margin-bottom:10px;border-radius:22px;background:rgba(255,255,255,.08);border:1px solid rgba(255,255,255,.12)}.logo-row strong{display:block;font-size:18px}.logo-row span{font-size:12px;color:#fecdd3;text-transform:uppercase;letter-spacing:.7px;font-weight:900}.nav{width:100%;text-align:left;border-radius:15px;padding:12px 14px;background:rgba(255,255,255,.06);color:#e5e7eb;font-weight:850;border:1px solid rgba(255,255,255,.08);box-shadow:none}.nav:hover,.nav.active{background:linear-gradient(135deg,var(--brand),var(--brand2));color:#fff;transform:translateX(4px);box-shadow:0 16px 32px rgba(184,15,22,.25)}.nav.danger{margin-top:8px;background:rgba(255,255,255,.10);color:#fecaca}.nav.danger:hover{background:linear-gradient(135deg,#111827,#b80f16)}
.content{padding:26px 34px 60px;min-width:0}.topbar{position:sticky;top:0;z-index:20;display:flex;justify-content:space-between;align-items:center;gap:18px;padding:18px 22px;margin:-26px -34px 26px;background:rgba(245,247,251,.88);backdrop-filter:blur(16px);border-bottom:1px solid rgba(229,231,235,.85)}.topbar h1{margin:0;font-size:clamp(27px,3vw,42px);letter-spacing:-1px}.topbar p{margin:5px 0 0;color:var(--muted);font-weight:650}.actions{display:flex;gap:10px;align-items:center;flex-wrap:wrap}.file-label{position:relative;overflow:hidden}.file-label input{position:absolute;inset:0;opacity:0;cursor:pointer}.module{display:none!important}.module.active{display:block!important;animation:fade .22s ease}@keyframes fade{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:none}}
.cards{display:grid;grid-template-columns:repeat(4,minmax(160px,1fr));gap:16px;margin-bottom:18px}.card{background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);box-shadow:var(--shadow);padding:21px;position:relative;overflow:hidden}.card:before{content:"";position:absolute;left:0;top:0;width:6px;height:100%;background:linear-gradient(180deg,var(--brand),var(--brand2))}.card span{display:block;color:var(--muted);font-size:12px;font-weight:950;text-transform:uppercase;letter-spacing:.7px}.card b{display:block;margin-top:8px;font-size:35px;letter-spacing:-1px}.grid.two{display:grid;grid-template-columns:1fr 1fr;gap:18px}.panel{background:rgba(255,255,255,.92);border:1px solid var(--line);border-radius:var(--radius);box-shadow:var(--shadow);padding:22px;margin-bottom:18px}.panel h2{margin:0 0 16px;font-size:24px;letter-spacing:-.4px}.panel h2:after{content:"";display:block;width:70px;height:4px;background:linear-gradient(90deg,var(--brand),#111);border-radius:99px;margin-top:9px}.form-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px}.form-grid label{display:grid;gap:7px}.full{grid-column:1/-1}.right{text-align:right}.right button{margin-left:8px}.search{max-width:440px;margin-bottom:14px}.table-wrap{width:100%;overflow:auto;border-radius:18px;border:1px solid var(--line);background:#fff}table{width:100%;border-collapse:separate;border-spacing:0;min-width:760px}th,td{border-bottom:1px solid var(--line);padding:12px;text-align:left;vertical-align:top}th{background:#f8fafc;color:#334155;text-transform:uppercase;font-size:12px;letter-spacing:.5px}tr:last-child td{border-bottom:0}.badge{display:inline-flex;align-items:center;padding:5px 10px;border-radius:999px;background:#fee2e2;color:#991b1b;font-weight:900;font-size:12px}.hint,.hint-box{color:var(--muted);line-height:1.5}.hint-box{background:#f8fafc;border:1px dashed #cbd5e1;border-radius:16px;padding:14px;margin:14px 0}.danger-panel{border-color:#fecaca;background:#fff5f5}.danger-panel button{background:linear-gradient(135deg,#111827,#b80f16)}
.subtabs{display:flex;gap:10px;flex-wrap:wrap;margin:0 0 18px;padding:9px;background:#fff;border:1px solid var(--line);border-radius:18px;box-shadow:0 10px 28px rgba(15,23,42,.06)}.subtab{box-shadow:none!important;background:#f3f4f6!important;color:#111827!important;border:1px solid #e5e7eb!important;margin:0!important}.subtab.active{background:linear-gradient(135deg,var(--brand),var(--brand2))!important;color:#fff!important;border-color:transparent!important}.asistencia-panel{display:none!important}.asistencia-panel.active{display:block!important}.firebase-status{position:fixed;right:18px;bottom:18px;z-index:300;background:#111827;color:#fff;border-radius:999px;padding:10px 14px;font-weight:850;box-shadow:0 16px 32px rgba(0,0,0,.22)}.firebase-status.connected{background:var(--success)}.firebase-status.error{background:var(--brand)}
.orgchart{text-align:center}.org-node{display:inline-block;background:#fff;border:1px solid var(--line);border-radius:16px;padding:14px 18px;margin:10px;box-shadow:0 10px 25px rgba(15,23,42,.08);font-weight:950}.org-node.top{background:linear-gradient(135deg,var(--brand),var(--brand2));color:#fff}.org-level{display:flex;justify-content:center;gap:32px;flex-wrap:wrap}.org-node.child{background:#f8fafc}
@media(max-width:1180px){.app{grid-template-columns:250px 1fr}.sidebar{padding:16px}.form-grid{grid-template-columns:repeat(2,1fr)}.cards{grid-template-columns:repeat(2,1fr)}.grid.two{grid-template-columns:1fr}.topbar{flex-direction:column;align-items:flex-start}}
@media(max-width:820px){.app{display:block}.sidebar{position:relative;height:auto;border-radius:0 0 26px 26px}.content{padding:18px}.topbar{position:relative;margin:-18px -18px 20px}.form-grid,.cards{grid-template-columns:1fr}.nav{display:inline-flex;width:auto;margin:3px}.sidebar{display:block}.logo-row{margin-bottom:14px}.right{text-align:left}.right button{margin:4px 4px 0 0}table{min-width:700px}}
@media print{.sidebar,.actions,.login-screen,.subtabs,.firebase-status{display:none!important}.app{display:block}.content{padding:0}.topbar{position:relative;margin:0 0 18px;padding:0;background:#fff;border:0}.module{display:none!important}.module.active{display:block!important}.asistencia-panel{display:none!important}.asistencia-panel.active{display:block!important}.panel,.card{box-shadow:none;border:1px solid #ddd}}

/* Empleados estilo nómina por pestañas */
.employee-editor{overflow:hidden}.section-head{display:flex;justify-content:space-between;align-items:flex-start;gap:18px;margin-bottom:18px}.employee-form{display:block}.employee-tabs{display:flex;gap:8px;flex-wrap:wrap;margin:8px 0 18px;padding:8px;background:#f8fafc;border:1px solid #e5e7eb;border-radius:18px}.employee-tab{margin:0;background:#fff;color:#111827;border:1px solid #e5e7eb;box-shadow:none;padding:10px 14px;border-radius:12px}.employee-tab.active,.employee-tab:hover{background:linear-gradient(135deg,#111827,#b80f16);color:#fff}.employee-tab-panel{display:none;background:linear-gradient(180deg,#ffffff,#f8fafc);border:1px solid #e5e7eb;border-radius:22px;padding:18px}.employee-tab-panel.active{display:block}.employee-tab-panel .form-grid{box-shadow:none;border:0;padding:0;background:transparent;margin:0} .employee-tab-panel input[readonly]{background:#f1f5f9;color:#334155}.section-head .right{white-space:nowrap}@media(max-width:900px){.section-head{display:block}.section-head .right{white-space:normal;margin-top:12px}.employee-tab{flex:1 1 auto}}
/* Resumen de incidencias por empleado/tipo */
#incidenciasResumen.mini-cards{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(190px,1fr));
  gap:12px;
  margin:12px 0 18px;
}
#incidenciasResumen .card small{
  display:block;
  margin-top:6px;
  color:#6b7280;
  font-weight:700;
}
.employee-documents-grid label{padding:14px;border:1px solid #e5e7eb;border-radius:14px;background:#fff}.employee-documents-grid input[type="file"]{margin-top:8px}.file-current{display:block;margin-top:7px;color:#64748b;font-weight:700;overflow-wrap:anywhere}

/* Arqueo y comprobación de viáticos */
.viatico-card{border:1px solid var(--line);border-radius:22px;padding:20px;margin:18px 0;background:#fff;box-shadow:0 12px 30px rgba(15,23,42,.07)}
.viatico-head{display:flex;justify-content:space-between;gap:16px;align-items:flex-start}.viatico-head h3{margin:4px 0}.viatico-head p{margin:0;color:var(--muted)}.viatico-head small{font-weight:900;color:var(--brand)}
.mini-viatico{grid-template-columns:repeat(3,minmax(150px,1fr));margin-top:16px}.mini-viatico .card b{font-size:24px}.comprobacion-form{margin:16px 0;padding:16px;border:1px dashed #cbd5e1;border-radius:16px;background:#f8fafc}.tiny{padding:7px 9px!important;font-size:11px;box-shadow:none!important;margin:2px}.tiny.secondary{background:#64748b!important}a{color:var(--brand);font-weight:800}@media(max-width:820px){.viatico-head{display:block}.mini-viatico{grid-template-columns:1fr}}

.panel-title-actions{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;flex-wrap:wrap}.panel-title-actions h2{margin-top:0}.facturas-actions{display:flex;gap:6px;flex-wrap:wrap;min-width:180px}.facturas-actions .tiny{max-width:260px;white-space:normal;text-align:left}

/* Expediente digital del trabajador */
.employee-access-btn{background:linear-gradient(135deg,#111827,#334155)!important;box-shadow:none!important}
.secondary-access{background:#64748b!important;box-shadow:none!important}.employee-access-card{width:min(760px,96vw);max-height:92vh;overflow:auto}.employee-access-result{margin-top:8px;text-align:left}.employee-access-head{padding:14px 0;border-bottom:1px solid #e5e7eb;margin-bottom:14px}.employee-access-head h2{margin:0 0 4px}.employee-access-head p{margin:0;color:#64748b}.employee-doc-list{display:grid;gap:10px}.employee-doc-card{display:flex;justify-content:space-between;align-items:center;gap:14px;border:1px solid #e5e7eb;border-radius:16px;padding:14px;background:#fff}.employee-doc-card h3{margin:3px 0;font-size:16px}.employee-doc-card p,.employee-doc-card small{margin:0;color:#64748b}.employee-doc-card button{flex:0 0 auto}.employee-doc-empty{padding:18px;border:1px dashed #cbd5e1;border-radius:14px;background:#f8fafc;color:#64748b}.employee-docs-portal{margin-top:16px}@media(max-width:620px){.employee-doc-card{display:block}.employee-doc-card button{margin-top:10px;width:100%}}

.employee-access-admin-actions{display:flex;gap:10px;flex-wrap:wrap;align-items:center}.employee-access-admin-actions button{width:auto}

/* Expediente laboral */
.labor-acta-panel{border-left:5px solid var(--brand)}.visible-badge{background:#dcfce7;color:#166534}.labor-acta-panel textarea{min-height:110px}

/* Activos, vehículos, uniformes y EPP */
.asset-tabs{display:flex;gap:10px;flex-wrap:wrap;margin-top:14px}.activos-subpanel.hidden{display:none!important}.quick-vehicle{margin-top:18px;padding:14px;border:1px solid #e5e7eb;border-radius:12px;background:#fafafa}.quick-vehicle summary{cursor:pointer}.activos-subpanel table small{color:#6b7280}.activos-subpanel .badge{white-space:nowrap}


/* Portal del empleado integrado - PÁGINA COMPLETA */
.employee-portal-screen{padding:0!important;overflow:hidden!important;background:#f5f7fb!important;place-items:stretch!important}
.employee-portal-shell{width:100vw!important;height:100vh!important;min-height:100vh;margin:0!important;display:grid;place-items:center}
.employee-portal-shell>.employee-access-card{grid-area:1/1;align-self:center;justify-self:center}
.employee-portal-app{grid-area:1/1;width:100vw!important;height:100vh!important;min-height:100vh!important;background:#f5f7fa;border-radius:0!important;box-shadow:none!important;overflow:hidden;display:flex;flex-direction:column}
.employee-portal-header{flex:0 0 auto;display:flex;justify-content:space-between;align-items:center;padding:18px 30px;background:#fff;border-bottom:1px solid #dde3ea;box-shadow:0 3px 14px rgba(15,23,42,.05);z-index:3}
.employee-portal-header .logo-row{margin:0;padding:8px 12px;background:#f8fafc;border-color:#e5e7eb}
.employee-portal-header .logo-row span{display:block;font-size:12px;color:#64748b;margin-top:3px}
.employee-portal-tabs{flex:0 0 auto;display:flex;gap:10px;overflow-x:auto;padding:14px 30px;background:#fff;border-bottom:1px solid #dde3ea;z-index:2}
.employee-portal-tabs button{white-space:nowrap;background:#eef2f6;color:#263548;border:0;border-radius:12px;padding:11px 18px;font-weight:850}
.employee-portal-tabs button.active{background:linear-gradient(135deg,var(--brand),var(--brand2));color:#fff;box-shadow:0 8px 18px rgba(184,15,22,.18)}
.employee-portal-content{flex:1 1 auto;min-height:0;overflow:auto;width:100%;padding:28px 34px 50px}
.employee-portal-content>.panel,.employee-portal-content>.grid,.employee-portal-content>.cards,.employee-portal-content>.employee-welcome,.employee-portal-content>.viatico-card{width:100%;max-width:none}
.employee-portal-content .panel{padding:24px}
.employee-portal-content .cards{grid-template-columns:repeat(auto-fit,minmax(220px,1fr))}
.employee-welcome{padding:4px 2px 18px}
.employee-welcome h1{margin:0 0 4px;font-size:clamp(30px,3vw,46px)}
.danger-inline{background:#8b1e1e!important}
@media(max-width:700px){.employee-portal-header{padding:12px 14px}.employee-portal-header .logo-row{padding:6px 8px}.employee-portal-tabs{padding:10px 12px;gap:7px}.employee-portal-tabs button{padding:9px 12px;border-radius:10px}.employee-portal-content{padding:14px 12px 30px}.employee-portal-content .grid.two{grid-template-columns:1fr}.employee-portal-content .panel{padding:16px}}

.editing-employee{margin-top:8px;padding:8px 12px;border-radius:10px;background:#fef3c7;font-weight:700}.credential-card{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;padding:14px;border:1px solid #dbe3ea;border-radius:16px;background:#fff}.credential-card div{display:flex;flex-direction:column;gap:5px}.credential-card strong{font-size:1.08rem;letter-spacing:.03em}.employee-row-actions{white-space:nowrap}.employee-row-actions button{margin:2px}.danger-soft{background:#fff;color:#991b1b;border:1px solid #fecaca;box-shadow:none}@media(max-width:800px){.credential-card{grid-template-columns:1fr}.employee-row-actions{white-space:normal}}

/* Corrección edición empleados */
.employee-tab-panel{display:none}
.employee-tab-panel.active{display:block!important}
#empleados.active{display:block!important}

/* Acuse interno Leído y enterado */
.acuse-enterado{margin-top:10px;padding:10px 12px;border:1px solid #d7dce3;border-radius:10px;display:flex;gap:10px;align-items:center;justify-content:space-between;flex-wrap:wrap}.acuse-enterado small{display:block;color:#64748b}.acuse-enterado.ok{background:#f7faf8}.acuse-enterado.pendiente{background:#fffaf0}.acuse-enterado button{font-weight:800}.employee-doc-card .acuse-enterado{max-width:720px}


/* Avisos y acuses internos */
.acuse-hero{display:flex;justify-content:space-between;align-items:center;gap:20px}
.acuse-kpis{display:flex;gap:10px;flex-wrap:wrap}.acuse-kpis span{padding:10px 14px;border-radius:999px;background:#f3f4f6;font-weight:700}
.acuse-flow{display:grid;grid-template-columns:repeat(4,1fr);gap:10px;margin:18px 0}.acuse-flow>div{border:1px solid #e5e7eb;border-radius:12px;padding:14px;text-align:center}.acuse-flow b{display:block;font-size:24px;margin-bottom:6px}.acuse-flow span{font-size:13px}
.acuse-card{align-items:center}.employee-doc-actions{display:flex;gap:10px;flex-wrap:wrap;justify-content:flex-end}.acuse-enterado{margin-top:10px;padding:10px 12px;border-radius:10px;display:flex;flex-direction:column;gap:3px}.acuse-enterado.ok{background:#ecfdf5;border:1px solid #a7f3d0}.acuse-enterado.pendiente{background:#fff7ed;border:1px solid #fed7aa}
@media(max-width:800px){.acuse-hero{align-items:flex-start;flex-direction:column}.acuse-flow{grid-template-columns:1fr 1fr}.employee-doc-actions{justify-content:flex-start;width:100%}}

/* Fotografía del empleado */
.employee-photo-field{grid-column:1/-1}.employee-photo-editor{display:flex;align-items:center;gap:16px;margin-top:8px}.employee-photo-preview{width:112px;height:136px;object-fit:cover;border-radius:12px;border:1px solid #d8dee8;background:#f3f4f6}.employee-photo-editor>div{display:flex;flex-direction:column;align-items:flex-start;gap:8px}.employee-photo-editor .mini{padding:7px 11px}.employee-portal-person{display:flex;align-items:center;gap:12px}.employee-portal-photo{width:58px;height:58px;border-radius:50%;object-fit:cover;border:2px solid #e5e7eb;background:#f3f4f6}.employee-photo-preview:not([src]),.employee-portal-photo:not([src]){visibility:hidden}


/* =========================================================
   IDENTIDAD CORPORATIVA CALIBRACIONES DE DURANGO · 2026
   Capa visual únicamente: no altera lógica del Sistema RH.
   ========================================================= */
:root{
  --cd-rojo:#9d0b0f;
  --cd-rojo-profundo:#69070a;
  --cd-negro:#111317;
  --cd-grafito:#20242a;
  --cd-plata:#c8ccd1;
  --cd-fondo:#f3f4f6;
  --cd-blanco:#ffffff;
}
body{
  background:
    radial-gradient(circle at 85% 0%, rgba(157,11,15,.08), transparent 30rem),
    linear-gradient(180deg,#f7f8fa 0%,#eef0f3 100%) !important;
  color:#151922;
}
header,.topbar,.app-header,.main-header{
  background:linear-gradient(110deg,#0f1114 0%,#252a30 64%,#72080b 100%) !important;
  color:#fff !important;
  border-bottom:3px solid var(--cd-rojo) !important;
  box-shadow:0 10px 28px rgba(0,0,0,.18);
}
header h1, header h2, header p,
.topbar h1,.topbar h2,.topbar p,
.app-header h1,.app-header p,.main-header h1,.main-header p{
  color:#fff !important;
}
aside,.sidebar,.side-menu,.nav-panel{
  background:linear-gradient(180deg,#171a1f,#262b31) !important;
  color:#fff !important;
}
aside button,.sidebar button,.side-menu button,
aside a,.sidebar a,.side-menu a{
  color:#f6f6f6 !important;
}
aside button:hover,.sidebar button:hover,.side-menu button:hover,
aside .active,.sidebar .active,.side-menu .active{
  background:linear-gradient(90deg,var(--cd-rojo-profundo),var(--cd-rojo)) !important;
  color:#fff !important;
  border-color:rgba(255,255,255,.15) !important;
}
button,.btn,.button,input[type="submit"]{
  border-radius:12px !important;
}
button:not(.nav-item):not(.menu-item),.btn-primary,.primary,input[type="submit"]{
  background:linear-gradient(135deg,#b11116,#82090d) !important;
  border-color:#78090c !important;
  color:#fff !important;
  box-shadow:0 7px 16px rgba(137,8,12,.18);
}
button:not(.nav-item):not(.menu-item):hover,.btn-primary:hover,.primary:hover{
  filter:brightness(1.08);
}
.card,.panel,.box,.section-card,.content-card{
  border:1px solid #e0e3e7 !important;
  box-shadow:0 12px 32px rgba(20,24,30,.08) !important;
}
input,select,textarea{
  border-color:#cfd4da !important;
}
input:focus,select:focus,textarea:focus{
  border-color:var(--cd-rojo) !important;
  box-shadow:0 0 0 3px rgba(157,11,15,.12) !important;
  outline:none !important;
}
h1,h2,h3,.section-title{
  letter-spacing:-.02em;
}
h2::after,.section-title::after{
  background:linear-gradient(90deg,var(--cd-rojo),#252a30) !important;
}
.badge,.pill,.status{
  border-radius:999px !important;
}

/* Marca fija del Sistema RH */
.cd-brand{
  display:flex;
  align-items:center;
  gap:12px;
  min-width:260px;
}
.cd-brand img{
  width:66px;
  height:66px;
  object-fit:contain;
  filter:drop-shadow(0 5px 9px rgba(0,0,0,.35));
}
.cd-brand-copy{
  line-height:1.05;
}
.cd-brand-copy strong{
  display:block;
  color:#fff;
  font-size:16px;
  letter-spacing:.05em;
}
.cd-brand-copy span{
  display:block;
  color:#e4e6e9;
  font-size:11px;
  margin-top:5px;
  letter-spacing:.13em;
  text-transform:uppercase;
}
.cd-corner-brand{
  position:fixed;
  right:22px;
  bottom:18px;
  z-index:50;
  display:flex;
  align-items:center;
  gap:9px;
  padding:7px 13px 7px 8px;
  border-radius:16px;
  background:rgba(18,20,24,.93);
  border:1px solid rgba(255,255,255,.12);
  box-shadow:0 10px 28px rgba(0,0,0,.2);
  pointer-events:none;
}
.cd-corner-brand img{width:40px;height:40px;object-fit:contain}
.cd-corner-brand span{color:#fff;font-size:11px;font-weight:800;letter-spacing:.08em}
@media(max-width:760px){
  .cd-corner-brand span{display:none}
  .cd-corner-brand{right:10px;bottom:10px;padding:5px}
  .cd-corner-brand img{width:34px;height:34px}
}


/* LOGO CORPORATIVO VISIBLE · corrección */
.cd-login-logo{display:block;width:min(310px,78%);max-height:190px;object-fit:contain;margin:0 auto 12px;filter:drop-shadow(0 12px 20px rgba(0,0,0,.22));}
.cd-menu-logo{width:74px;height:60px;flex:0 0 auto;object-fit:contain;filter:drop-shadow(0 5px 8px rgba(0,0,0,.32));}
.cd-menu-logo.portal{width:64px;height:54px;}
.cd-topbar-brand{display:flex;align-items:center;gap:14px;}
.cd-topbar-brand>img{width:82px;height:64px;object-fit:contain;filter:drop-shadow(0 5px 10px rgba(0,0,0,.3));}
.login-card{overflow:visible!important}.sidebar .logo-row{align-items:center!important;min-height:75px}.employee-portal-header .logo-row{align-items:center!important}
@media(max-width:760px){.cd-login-logo{width:min(250px,72%);max-height:140px}.cd-topbar-brand>img{width:58px;height:48px}.cd-menu-logo{width:58px;height:48px}}


/* AJUSTE FINAL LOGOTIPO · tamaño corporativo discreto */
.cd-login-logo{
  width:130px !important;
  height:auto !important;
  max-height:105px !important;
  object-fit:contain !important;
  margin:0 auto 10px !important;
}
.cd-menu-logo{
  width:56px !important;
  height:46px !important;
  object-fit:contain !important;
}
.cd-menu-logo.portal{
  width:54px !important;
  height:44px !important;
}
.cd-topbar-brand>img{
  width:64px !important;
  height:50px !important;
  object-fit:contain !important;
}
@media(max-width:760px){
  .cd-login-logo{
    width:110px !important;
    max-height:90px !important;
  }
  .cd-topbar-brand>img{
    width:54px !important;
    height:43px !important;
  }
  .cd-menu-logo{
    width:50px !important;
    height:41px !important;
  }
}


/* CORRECCION DEFINITIVA DE ESCALA DEL LOGO */
body #loginView .login-card img.cd-login-logo,
body #employeeLoginView .login-card img.cd-login-logo,
body img.cd-login-logo{
  display:block !important;
  width:96px !important;
  height:96px !important;
  max-width:96px !important;
  max-height:96px !important;
  min-width:0 !important;
  min-height:0 !important;
  object-fit:contain !important;
  margin:0 auto 10px !important;
  transform:none !important;
}
body .sidebar img.cd-menu-logo{
  width:48px !important;
  height:42px !important;
  max-width:48px !important;
  max-height:42px !important;
}
body .topbar .cd-topbar-brand > img{
  width:54px !important;
  height:44px !important;
  max-width:54px !important;
  max-height:44px !important;
}


/* FOTO DEL TRABAJADOR EN PORTAL DEL EMPLEADO */
.employee-portal-identity{
  display:flex;
  align-items:center;
  gap:12px;
  margin-left:auto;
  padding:6px 10px;
  border-radius:16px;
  background:rgba(255,255,255,.08);
  border:1px solid rgba(255,255,255,.14);
}
.employee-photo-wrap{
  width:64px;
  height:64px;
  border-radius:50%;
  overflow:hidden;
  flex:0 0 64px;
  border:2px solid rgba(255,255,255,.85);
  background:linear-gradient(145deg,#d7d9dc,#8b9096);
  box-shadow:0 5px 16px rgba(0,0,0,.24);
  position:relative;
}
.employee-portal-photo{
  width:100% !important;
  height:100% !important;
  max-width:none !important;
  max-height:none !important;
  object-fit:cover !important;
  display:block !important;
}
.employee-portal-identity strong{
  display:block;
  color:#fff;
  font-size:14px;
  line-height:1.15;
}
.employee-portal-identity span{
  display:block;
  color:#e1e4e8;
  font-size:11px;
  margin-top:4px;
}
@media(max-width:760px){
  .employee-portal-identity{
    margin-left:0;
    width:100%;
  }
  .employee-photo-wrap{
    width:54px;
    height:54px;
    flex-basis:54px;
  }
}


/* EVALUACIONES Y EXÁMENES */
.exams-hero{display:flex;justify-content:space-between;gap:20px;align-items:center}
.exam-kpis{display:flex;gap:10px;flex-wrap:wrap}
.exam-kpis span{background:#f4f5f7;border:1px solid #dfe2e6;border-radius:14px;padding:10px 14px;font-size:12px}
.exam-kpis b{font-size:20px;margin-right:5px;color:#970b10}
.exam-tabs{display:flex;gap:8px;margin:16px 0;flex-wrap:wrap}
.exam-tabs button{background:#fff !important;color:#252a30 !important;border:1px solid #d7dbe0 !important;box-shadow:none !important}
.exam-tabs button.active{background:linear-gradient(135deg,#b11116,#82090d) !important;color:#fff !important}
.exam-sub{display:none}.exam-sub.active{display:block}
.panel-title-actions{display:flex;justify-content:space-between;align-items:center;gap:12px}
.exam-bank-filters{margin:10px 0}.exam-bank-filters input{width:100%}
.exam-status{font-size:11px;font-weight:800;padding:5px 9px;border-radius:999px}
.exam-status.ok{background:#e7f6ed;color:#176b38}.exam-status.bad{background:#fdebec;color:#9b1c22}
.exam-taking{max-width:920px;margin:0 auto}
.exam-taking-head{display:flex;justify-content:space-between;gap:20px}
.exam-taking-head>div:last-child{text-align:right}.exam-taking-head span{display:block;font-size:12px;color:#667085;margin-top:4px}
.exam-question h3{margin-top:0;font-size:17px}
.exam-option{display:flex !important;align-items:flex-start;gap:10px;padding:11px 13px;border:1px solid #dde1e5;border-radius:12px;margin:8px 0;cursor:pointer}
.exam-option:hover{border-color:#9d0b0f;background:#fff8f8}.exam-option input{width:auto;margin-top:3px}
.exam-submit{text-align:right}
.exam-result-card{max-width:620px;margin:40px auto;padding:38px;text-align:center;border-radius:24px;background:#fff;box-shadow:0 18px 45px rgba(0,0,0,.12)}
.exam-result-card strong{display:block;font-size:74px;line-height:1;color:#176b38;margin:12px 0}.exam-result-card.failed strong{color:#9b1c22}
.exam-result-card h2{font-size:26px}
@media(max-width:760px){.exams-hero,.exam-taking-head{flex-direction:column;align-items:flex-start}.exam-taking-head>div:last-child{text-align:left}}


/* IMPORTAR Y PUBLICAR EXÁMENES */
.exam-import-intro{border-left:4px solid #9d0b0f !important}
.file-drop{display:flex !important;flex-direction:column;gap:5px;border:2px dashed #c8cdd3;border-radius:16px;padding:20px;background:#fafbfc;cursor:pointer}
.file-drop:hover{border-color:#9d0b0f;background:#fff8f8}
.file-drop strong{font-size:15px}.file-drop span{font-size:12px;color:#667085}
.file-drop input{margin-top:10px}
.exam-separator{display:flex;align-items:center;gap:10px;margin:18px 0;color:#7a8088;font-size:12px}
.exam-separator:before,.exam-separator:after{content:"";height:1px;background:#e1e4e8;flex:1}
.exam-import-preview{display:grid;gap:12px;margin-top:14px}
.exam-preview-q{border:1px solid #e0e3e7;border-radius:14px;padding:14px;background:#fff}
.exam-preview-q.missing{border-color:#d99400;background:#fffaf0}
.exam-preview-head{display:flex;justify-content:space-between;gap:15px;margin-bottom:9px}
.exam-preview-head span{font-size:11px;font-weight:800;color:#7a8088;white-space:nowrap}
.exam-preview-q>div:not(.exam-preview-head){padding:6px 9px;border-radius:8px;margin:3px 0;background:#f7f8fa}
.exam-preview-q>div.correct{background:#e8f6ed;color:#176b38;font-weight:700}
@media(max-width:760px){.exam-preview-head{flex-direction:column}.exam-preview-head span{white-space:normal}}

.exam-import-status{margin-top:10px;padding:10px 12px;border-radius:10px;background:#f3f4f6;border:1px solid #d9dde2;font-size:12px;font-weight:700;color:#4b5563}

.exam-format-help{border-left:4px solid #176b38 !important;background:#f7fcf9 !important}
.exam-format-help h3{margin-top:0}

.exam-ready-status{
  margin:16px 0;
  padding:15px 18px;
  border-radius:14px;
  display:flex;
  flex-direction:column;
  gap:4px;
  border:1px solid;
}
.exam-ready-status.ready{background:#edf9f1;border-color:#79bd8f;color:#176b38}
.exam-ready-status.warning{background:#fff7e8;border-color:#e5b74d;color:#805b00}
.exam-ready-status b{font-size:15px}
.exam-ready-status span{font-size:12px}

.manual-answer-box{display:flex;align-items:center;gap:8px}
.manual-answer-box span{font-size:11px;font-weight:700}
.manual-answer-box select{width:72px !important;min-width:72px;padding:6px 8px !important}
.exam-preview-q.missing{border:2px solid #d99b00 !important;background:#fffaf0 !important}

.exam-ready-status.ready b::before{content:'✓ ';font-weight:900}

.print-exam-btn{margin-left:8px}
@media print{
  .sidebar,.topbar,.firebase-status,.actions{display:none!important}
}

.assigned-exam-actions{display:flex;gap:8px;flex-wrap:wrap}
.assigned-exam-actions button{white-space:nowrap}
.exam-result-modal{position:fixed;inset:0;background:rgba(0,0,0,.58);z-index:99999;display:flex;align-items:center;justify-content:center;padding:20px}
.exam-result-modal-card{position:relative;background:#fff;border-radius:20px;width:min(920px,96vw);max-height:92vh;overflow:auto;padding:26px;box-shadow:0 20px 70px rgba(0,0,0,.3)}
.exam-result-close{position:absolute;right:18px;top:14px;border:0;background:transparent!important;color:#222!important;font-size:30px;box-shadow:none!important}
.assigned-result-summary{display:grid;grid-template-columns:repeat(4,1fr);gap:10px;margin:18px 0}
.assigned-result-summary div{border:1px solid #dfe3e8;border-radius:12px;padding:12px;text-align:center}
.assigned-result-summary span{display:block;font-size:11px;color:#667085}.assigned-result-summary b{display:block;font-size:18px;margin-top:5px}
.assigned-result-question{padding:9px 0;border-bottom:1px solid #eceff2;display:flex;flex-direction:column;gap:4px}
.assigned-result-question span{font-size:12px;color:#667085}
.assigned-result-actions{display:flex;gap:10px;justify-content:flex-end;margin-top:18px}
@media(max-width:700px){.assigned-result-summary{grid-template-columns:1fr 1fr}.assigned-exam-actions{flex-direction:column}}

.estado-concluido{display:flex;flex-direction:column;gap:3px}
.estado-concluido span{font-size:12px;color:#667085}

.exam-v10-actions{display:flex;gap:8px;flex-wrap:wrap}
.exam-v10-actions button{white-space:nowrap}
.estado-concluido-v10{display:flex;flex-direction:column;gap:3px}
.estado-concluido-v10 span{font-size:12px;color:#667085}
#portalPrintExamsV10{margin-top:16px;border-left:4px solid #9d0b0f!important}
@media(max-width:760px){.exam-v10-actions{flex-direction:column}}
