/* ======================================================
   RRHH · ANÁLISIS DE HORAS · PROTOTIPO VISUAL V0.1
   Estilos encapsulados para no afectar Analítica actual.
   ====================================================== */

#rrhhHorasView{padding:16px 20px 28px;background:var(--bg)}
.horas-shell{max-width:1800px;margin:0 auto}
.horas-filter-card{display:grid;grid-template-columns:160px minmax(700px,2fr) minmax(240px,.75fr) minmax(360px,1.15fr) auto;gap:14px;align-items:end;background:var(--card);border:1px solid var(--border);border-radius:18px;padding:16px;margin-bottom:14px;box-shadow:var(--shadow)}
.horas-filter-card label{display:block;margin-bottom:7px;font-size:10px;font-weight:900;letter-spacing:.08em;text-transform:uppercase;color:var(--muted)}
.horas-filter-card select{width:100%;height:42px;border:1px solid var(--border);border-radius:10px;padding:0 12px;background:#F8FAFB;color:var(--ink);font-weight:800;outline:none}

.horas-filter-search{min-width:0}
.horas-search-wrap{position:relative}
.horas-filter-search input{
  width:100%;
  height:42px;
  border:1px solid var(--border);
  border-radius:10px;
  padding:0 42px 0 13px;
  background:#F8FAFB;
  color:var(--ink);
  font-weight:800;
  outline:none;
}
.horas-filter-search input::placeholder{color:var(--muted);font-weight:700}
.horas-filter-search input:focus{
  border-color:#FF5C33;
  box-shadow:0 0 0 3px rgba(255,92,51,.12);
}
.horas-search-icon{
  position:absolute;
  right:14px;
  top:50%;
  transform:translateY(-50%);
  color:var(--muted);
  font-size:19px;
  pointer-events:none;
}
.horas-table tbody tr[hidden]{display:none}
.horas-filter-months{min-width:0}
.horas-month-grid{display:grid;grid-template-columns:repeat(12,minmax(54px,1fr));gap:6px}
.horas-month{height:42px;border:1px solid var(--border);border-radius:9px;background:#F8FAFB;color:var(--muted);font-size:10.5px;font-weight:900;cursor:pointer}
.horas-month.active{background:rgba(255,92,51,.10);border-color:#FF5C33;color:#FF5C33}
.horas-month span{display:inline-flex;margin-left:4px;width:16px;height:16px;align-items:center;justify-content:center;border-radius:50%;background:#FF5C33;color:#fff;font-size:9px}
.horas-clear-button{height:42px;padding:0 16px;border:1px solid var(--border);border-radius:10px;background:transparent;color:var(--ink);font-weight:850;cursor:pointer;white-space:nowrap}

.horas-tabs{display:flex;align-items:center;gap:8px;border:1px solid var(--border);border-radius:16px 16px 0 0;background:var(--card);padding:0 12px;min-height:50px;overflow:auto}
.horas-tab{height:50px;padding:0 14px;border:0;border-bottom:3px solid transparent;background:transparent;color:var(--muted);font-size:12px;font-weight:850;cursor:pointer;white-space:nowrap;display:flex;align-items:center;gap:8px}
.horas-tab.active{color:var(--ink);border-bottom-color:#FF5C33}
.horas-tab.active span{color:#FF5C33}
.horas-content{background:var(--card);border:1px solid var(--border);border-top:0;border-radius:0 0 18px 18px;padding:16px;box-shadow:var(--shadow)}
.horas-section-head{display:flex;justify-content:space-between;align-items:flex-start;gap:18px;margin-bottom:14px}
.horas-section-head h2{font-size:21px;margin:0 0 5px;font-weight:900;letter-spacing:-.02em}
.horas-section-head p{margin:0;color:var(--muted);font-size:12px}
.horas-actions-row{display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.horas-context-button,.horas-primary-button,.horas-danger-button,.horas-reload-button{height:40px;border-radius:10px;padding:0 15px;font-size:11px;font-weight:900;cursor:pointer;transition:.15s ease;white-space:nowrap}
.horas-context-button{background:transparent;color:var(--ink);border:1px solid var(--border)}
.horas-reload-button{background:transparent;color:var(--ui-muted-strong,var(--muted));border:1px solid transparent;padding:0 10px;font-weight:600}
.horas-reload-button:hover{color:var(--ui-text,var(--ink));text-decoration:underline;text-underline-offset:3px}
.horas-reload-button:focus-visible{outline:2px solid #FF5C33;outline-offset:3px}
.horas-primary-button{background:#FF5C33;color:#fff;border:1px solid #FF5C33}
.horas-danger-button{background:transparent;color:#FF5C33;border:1px solid #FF5C33}
.horas-context-button:hover,.horas-primary-button:hover,.horas-danger-button:hover{transform:translateY(-1px)}
.horas-context-button.full,.horas-primary-button.full{width:100%;margin-top:8px}

.horas-kpis{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:10px;margin:0 0 10px}
.horas-kpis.secondary{grid-template-columns:repeat(4,minmax(0,1fr));margin-bottom:12px}
.horas-kpis.report-kpis{grid-template-columns:repeat(4,minmax(0,1fr))}
.horas-kpi{position:relative;display:flex;gap:12px;align-items:center;min-height:94px;background:linear-gradient(145deg,#FFFFFF,#F7FAFB);border:1px solid var(--border);border-radius:14px;padding:13px 14px;overflow:hidden}
.horas-kpi-mark{width:5px;align-self:stretch;border-radius:999px;background:#FF5C33;flex:0 0 5px}
.horas-kpi span{display:block;color:var(--muted);font-size:11px;font-weight:800}
.horas-kpi strong{display:block;font-size:25px;line-height:1.1;margin:4px 0;font-weight:950;letter-spacing:-.02em}
.horas-kpi small{display:block;color:var(--muted);font-size:10px}
.tone-green .horas-kpi-mark{background:#2ECC71}.tone-coral .horas-kpi-mark{background:#FF6B4A}.tone-amber .horas-kpi-mark{background:#F4B400}.tone-red .horas-kpi-mark{background:#F44336}.tone-purple .horas-kpi-mark{background:#C45BFF}.tone-blue .horas-kpi-mark{background:#5B8CFF}.tone-teal .horas-kpi-mark{background:#3EC7C2}.tone-indigo .horas-kpi-mark{background:#677CFF}.tone-orange .horas-kpi-mark{background:#FF7A1A}

.horas-grid-main{display:grid;grid-template-columns:minmax(0,1.6fr) minmax(280px,.58fr);gap:12px}
.horas-grid-detail{display:grid;grid-template-columns:minmax(0,1.5fr) minmax(310px,.5fr);gap:12px}
.horas-panel{background:#F9FBFC;border:1px solid var(--border);border-radius:14px;padding:12px;min-width:0}
.horas-panel-title{display:flex;justify-content:space-between;align-items:center;margin-bottom:10px;color:var(--ink);font-size:12px}
.horas-panel-title span{font-size:10px;color:#FF5C33;font-weight:850}
.horas-table-wrap{overflow:auto;border-radius:10px;border:1px solid var(--line)}
.horas-table{width:100%;border-collapse:collapse;font-size:10.5px;min-width:760px}
.horas-table th{position:sticky;top:0;z-index:1;background:#F2F6F8;color:var(--muted);font-size:8.5px;padding:9px 8px;text-transform:uppercase;letter-spacing:.04em;white-space:nowrap}
.horas-table td{padding:9px 8px;border-bottom:1px solid var(--line);white-space:nowrap}
.horas-table tr:last-child td{border-bottom:0}
.horas-table td:first-child{display:flex;align-items:center;gap:7px}
.horas-table.dense{min-width:1250px}
.horas-table.report-table{min-width:1500px}
.horas-avatar{display:inline-flex;width:23px;height:23px;border-radius:50%;background:#7A5633;color:#fff;align-items:center;justify-content:center;font-size:8px;font-weight:900;flex:0 0 23px}
.horas-status{display:inline-flex;align-items:center;justify-content:center;border-radius:7px;padding:4px 7px;font-size:8px;font-weight:950;background:#E9EEF1;color:#5F6B73;border:1px solid transparent}
.horas-status.ok{background:#E8F8EF;color:#167A42;border-color:#BDE8CC}.horas-status.danger{background:#FDEDEC;color:#B33A32;border-color:#F4C8C4}.horas-status.warning{background:#FFF4E6;color:#A56608;border-color:#F4D5A6}
.horas-count{display:inline-flex;min-width:22px;height:22px;padding:0 6px;border-radius:50%;align-items:center;justify-content:center;background:#EEF2F4;color:var(--ink);font-size:9px;font-weight:900}
.horas-table .neg{color:#E65A4E;font-weight:900}.horas-table .pos{color:#11B25C;font-weight:900}
.horas-link-button{margin-top:10px;border:0;background:transparent;color:#FF5C33;font-size:10px;font-weight:900;cursor:pointer}
.horas-edit-cell{display:inline-flex;gap:5px;align-items:center;border:1px solid var(--border);border-radius:7px;padding:5px 7px;background:var(--card)}

.horas-alert{display:grid;grid-template-columns:32px 1fr 18px;gap:8px;align-items:center;padding:10px 3px;border-bottom:1px solid var(--line)}
.horas-alert:last-of-type{border-bottom:0}.horas-alert i{width:28px;height:28px;border-radius:9px;background:rgba(255,92,51,.10);color:#FF5C33;display:flex;align-items:center;justify-content:center;font-style:normal;font-weight:900}.horas-alert b{display:block;font-size:10.5px}.horas-alert small{display:block;color:var(--muted);font-size:9px;margin-top:2px}.horas-alert>span{color:var(--muted);font-size:18px}.horas-updated{text-align:right;color:var(--muted);font-size:9px;margin-top:12px}

.detail-card{font-size:11px}.detail-card h3{font-size:17px;margin:0 0 6px}.detail-card h4{font-size:12px;margin:14px 0 8px}.detail-card p{color:var(--muted);line-height:1.45}.detail-card hr{border:0;border-top:1px solid var(--line);margin:14px 0}.horas-auto-flow{display:grid;grid-template-columns:1fr 20px 1fr 20px 1fr;gap:4px;align-items:center;margin-top:14px}.horas-auto-flow div{border:1px solid var(--border);border-radius:10px;padding:9px;text-align:center}.horas-auto-flow small{display:block;color:var(--muted);font-size:8px;font-weight:900}.horas-auto-flow strong{display:block;margin-top:5px;font-size:11px}.horas-auto-flow>span{text-align:center;color:#FF5C33}.horas-compare{display:grid;grid-template-columns:repeat(3,1fr);gap:7px;margin-bottom:10px}.horas-compare div{border:1px solid var(--border);border-radius:10px;padding:9px;text-align:center}.horas-compare small,.horas-compare span{display:block;color:var(--muted);font-size:8px}.horas-compare b{display:block;font-size:18px;margin:5px 0}.horas-suggestion{display:flex;align-items:center;gap:7px;border:1px solid var(--border);border-radius:9px;padding:8px;margin:6px 0}.horas-suggestion b{margin-left:auto;color:#11B25C}
.horas-toast{position:fixed;right:24px;bottom:24px;z-index:10050;max-width:430px;padding:12px 16px;border-radius:11px;background:#182126;color:#fff;border:1px solid rgba(255,92,51,.45);box-shadow:0 14px 40px rgba(0,0,0,.28);font-size:11px;font-weight:800;opacity:0;transform:translateY(12px);pointer-events:none;transition:.18s ease}.horas-toast.show{opacity:1;transform:translateY(0)}
.horas-toast.success{border-color:rgba(46,204,113,.62)}
.horas-toast.warning{border-color:rgba(244,180,0,.72)}
.horas-toast.error{border-color:rgba(244,67,54,.72)}

html[data-theme="dark"] #rrhhHorasView{background:#0C1215}
html[data-theme="dark"] .horas-filter-card,html[data-theme="dark"] .horas-tabs,html[data-theme="dark"] .horas-content,html[data-theme="dark"] .horas-panel{background:#11181C;border-color:#283238;box-shadow:none}
html[data-theme="dark"] .horas-filter-card select,html[data-theme="dark"] .horas-month{background:#0E1519;border-color:#2B363C;color:#CBD4D9}
html[data-theme="dark"] .horas-filter-search input{background:#0E1519;border-color:#2B363C;color:#E8EEF1}
html[data-theme="dark"] .horas-filter-search input::placeholder{color:#758189}
html[data-theme="dark"] .horas-month.active{background:rgba(255,92,51,.10);border-color:#FF5C33;color:#FF7A59}
html[data-theme="dark"] .horas-clear-button,html[data-theme="dark"] .horas-context-button{border-color:#2B363C;color:#E8EEF1;background:#121B20}
html[data-theme="dark"] .horas-kpi{background:linear-gradient(145deg,#151E23,#10171B);border-color:#29353B}
html[data-theme="dark"] .horas-table-wrap{border-color:#253038}
html[data-theme="dark"] .horas-table th{background:#0D1418;color:#95A2A9}
html[data-theme="dark"] .horas-table td{border-bottom-color:#222D33;color:#DDE5E9}
html[data-theme="dark"] .horas-edit-cell{background:#0F171B;border-color:#334048}
html[data-theme="dark"] .horas-panel-title,html[data-theme="dark"] .horas-section-head h2,html[data-theme="dark"] .detail-card h3,html[data-theme="dark"] .detail-card h4{color:#EEF3F5}
html[data-theme="dark"] .horas-alert{border-bottom-color:#253038}
html[data-theme="dark"] .horas-auto-flow div,html[data-theme="dark"] .horas-compare div,html[data-theme="dark"] .horas-suggestion{border-color:#2B363C;background:#0E1519}
html[data-theme="dark"] .horas-status.neutral{background:#1C252A;color:#B8C2C8}
html[data-theme="dark"] .horas-status.ok{background:#123423;color:#66D99A;border-color:#1B5735}
html[data-theme="dark"] .horas-status.danger{background:#3A1D1B;color:#FF8C82;border-color:#67302C}
html[data-theme="dark"] .horas-status.warning{background:#3A2C12;color:#FFC56E;border-color:#60481E}
html[data-theme="dark"] .horas-count{background:#1B252A;color:#DCE5E9}

@media(max-width:1450px){.horas-filter-card{grid-template-columns:130px minmax(600px,1fr) 220px minmax(280px,.8fr) auto}.horas-kpis{grid-template-columns:repeat(3,1fr)}.horas-kpis.secondary{grid-template-columns:repeat(2,1fr)}}
@media(max-width:1120px){.horas-filter-card{grid-template-columns:1fr 2fr}.horas-filter-months{grid-column:2}.horas-filter-select,.horas-filter-select.wide{grid-column:auto}.horas-clear-button{justify-self:start}.horas-grid-main,.horas-grid-detail{grid-template-columns:1fr}.horas-kpis{grid-template-columns:repeat(2,1fr)}.horas-kpis.secondary,.horas-kpis.report-kpis{grid-template-columns:repeat(2,1fr)}}
@media(max-width:720px){#rrhhHorasView{padding:10px}.horas-filter-card{grid-template-columns:1fr}.horas-filter-months{grid-column:auto}.horas-month-grid{grid-template-columns:repeat(4,1fr)}.horas-kpis,.horas-kpis.secondary,.horas-kpis.report-kpis{grid-template-columns:1fr}.horas-section-head{flex-direction:column}.horas-actions-row{width:100%}.horas-actions-row>*{flex:1}.horas-content{padding:10px}}

/* ======================================================
   V0.4 · FIX DEFINITIVO TARJETA DE FILTROS
   Fila 1: Año + Período
   Fila 2: Sede + Buscar colaborador + Limpiar filtros
   ====================================================== */

#rrhhHorasView .horas-filter-card{
  display:flex;
  flex-direction:column;
  gap:14px;
}

#rrhhHorasView .horas-filter-row{
  display:grid;
  gap:14px;
  align-items:end;
  width:100%;
  min-width:0;
}

#rrhhHorasView .horas-filter-row-top{
  grid-template-columns:160px minmax(0,1fr);
}

#rrhhHorasView .horas-filter-row-bottom{
  grid-template-columns:minmax(260px,.78fr) minmax(380px,1.22fr) auto;
}

#rrhhHorasView .horas-filter-year,
#rrhhHorasView .horas-filter-months,
#rrhhHorasView .horas-filter-select,
#rrhhHorasView .horas-filter-search{
  min-width:0;
}

#rrhhHorasView .horas-month-grid{
  display:grid;
  grid-template-columns:repeat(12,minmax(52px,1fr));
  gap:6px;
  width:100%;
}

#rrhhHorasView .horas-clear-button{
  justify-self:end;
  align-self:end;
  min-width:146px;
}

/* El sidebar abierto no debe cambiar la jerarquía del filtro. */
@media (max-width:1250px){
  #rrhhHorasView .horas-filter-row-top{
    grid-template-columns:140px minmax(0,1fr);
  }

  #rrhhHorasView .horas-filter-row-bottom{
    grid-template-columns:minmax(220px,.72fr) minmax(300px,1fr) auto;
  }

  #rrhhHorasView .horas-month-grid{
    grid-template-columns:repeat(12,minmax(46px,1fr));
  }
}

/* Recién en pantallas realmente chicas se apilan los controles. */
@media (max-width:820px){
  #rrhhHorasView .horas-filter-row-top,
  #rrhhHorasView .horas-filter-row-bottom{
    grid-template-columns:1fr;
  }

  #rrhhHorasView .horas-month-grid{
    grid-template-columns:repeat(4,1fr);
  }

  #rrhhHorasView .horas-clear-button{
    width:100%;
    justify-self:stretch;
  }
}

/* ======================================================
   V0.5 · FICHAJES REALES · AJUSTES VISUALES Y FILTROS
   ====================================================== */

/* Mantiene la línea horizontal de cada fila perfectamente alineada.
   El primer TD no debe convertirse en flex porque deja de comportarse
   como una celda de tabla. */
#rrhhHorasView .horas-table td:first-child{
  display:table-cell;
  vertical-align:middle;
}

#rrhhHorasView .horas-avatar{
  margin-right:7px;
  vertical-align:middle;
}

/* Fechas dentro del bloque global de filtros. */
#rrhhHorasView .horas-filter-date{
  min-width:0;
}

#rrhhHorasView .horas-filter-date input{
  width:100%;
  height:42px;
  box-sizing:border-box;
  border:1px solid var(--border);
  border-radius:10px;
  padding:0 12px;
  background:#F8FAFB;
  color:var(--ink);
  font:inherit;
  font-weight:800;
  outline:none;
}

#rrhhHorasView .horas-filter-date input:focus{
  border-color:#FF5C33;
  box-shadow:0 0 0 3px rgba(255,92,51,.10);
}

#rrhhHorasView .horas-filter-date input:disabled{
  opacity:.55;
  cursor:not-allowed;
}

/* La segunda fila ahora contiene:
   Sede + Fecha desde + Fecha hasta + Buscar + Limpiar. */
#rrhhHorasView .horas-filter-row-bottom{
  grid-template-columns:
    minmax(220px,.72fr)
    minmax(150px,.44fr)
    minmax(150px,.44fr)
    minmax(320px,1.15fr)
    auto;
}

/* Disponibilidad de Fichadas: fuentes y resultados consultables. */
#rrhhHorasView .horas-disponibilidad{
  margin:0 0 14px;
  padding:12px 16px;
  border:1px solid var(--border);
  border-radius:14px;
  background:var(--card);
  color:var(--ink);
  font-size:12px;
}
#rrhhHorasView .horas-disponibilidad[hidden]{display:none}
#rrhhHorasView .horas-disponibilidad-cabecera{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  flex-wrap:wrap;
}
#rrhhHorasView .horas-disponibilidad p{margin:0;color:var(--muted)}
#rrhhHorasView .horas-disponibilidad summary{margin-top:8px;cursor:pointer;font-weight:700}
#rrhhHorasView .horas-disponibilidad ul{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(min(100%,340px),1fr));
  gap:8px 18px;
  margin:12px 0 0;
  padding:0;
  list-style:none;
}
#rrhhHorasView .horas-disponibilidad li{display:flex;gap:8px;align-items:baseline}
#rrhhHorasView .horas-disponibilidad li b{white-space:nowrap}
#rrhhHorasView .horas-disponibilidad li span{color:var(--muted);overflow-wrap:anywhere}
#rrhhHorasView .horas-disponibilidad button:disabled{opacity:.6;cursor:wait;transform:none}
#rrhhHorasView .horas-month.pendiente{border-style:dashed}
#rrhhHorasView .horas-month-pending{font-size:13px}
#rrhhHorasView .horas-periodos-pendientes h3{margin:0 0 10px;color:var(--ink)}
#rrhhHorasView .horas-periodos-pendientes p{color:var(--muted);margin:12px 0 0}
#rrhhHorasView .horas-periodos-pendientes li{margin:6px 0;overflow-wrap:anywhere}

/* Mes sin carpeta/base procesable: mismo criterio visual que Analítica. */
#rrhhHorasView .horas-month:disabled,
#rrhhHorasView .horas-month.disabled{
  opacity:.36;
  cursor:not-allowed;
  border-style:dashed;
  background:#F3F5F6;
  color:#9AA4AA;
}

#rrhhHorasView .horas-month:disabled:hover,
#rrhhHorasView .horas-month.disabled:hover{
  border-color:var(--border);
  color:#9AA4AA;
}

html[data-theme="dark"] #rrhhHorasView .horas-filter-date input{
  background:#0E1519;
  border-color:#2B363C;
  color:#E8EEF1;
  color-scheme:dark;
}

html[data-theme="dark"] #rrhhHorasView .horas-month:disabled,
html[data-theme="dark"] #rrhhHorasView .horas-month.disabled{
  background:#0B1114;
  border-color:#253038;
  color:#5F6A70;
}

@media (max-width:1450px){
  #rrhhHorasView .horas-filter-row-bottom{
    grid-template-columns:
      minmax(210px,.75fr)
      minmax(145px,.46fr)
      minmax(145px,.46fr)
      minmax(260px,1fr)
      auto;
  }
}

@media (max-width:1180px){
  #rrhhHorasView .horas-filter-row-bottom{
    grid-template-columns:repeat(3,minmax(0,1fr));
  }

  #rrhhHorasView .horas-filter-search{
    grid-column:1 / span 2;
  }

  #rrhhHorasView .horas-clear-button{
    grid-column:3;
    justify-self:stretch;
  }
}

@media (max-width:820px){
  #rrhhHorasView .horas-filter-row-bottom{
    grid-template-columns:1fr;
  }

  #rrhhHorasView .horas-filter-search,
  #rrhhHorasView .horas-clear-button{
    grid-column:auto;
  }
}

/* ======================================================
   V0.6 · JORNADAS REALES · CALIDAD DE DATOS Y DRAWER
   ====================================================== */

#rrhhHorasView .horas-quality-panel{
  margin:0 0 12px;
  padding:12px;
  border:1px solid var(--border);
  border-radius:14px;
  background:#F9FBFC;
}

#rrhhHorasView .horas-quality-head{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:12px;
  margin-bottom:10px;
}

#rrhhHorasView .horas-quality-head b{
  display:block;
  color:var(--ink);
  font-size:12px;
}

#rrhhHorasView .horas-quality-head small{
  display:block;
  margin-top:3px;
  color:var(--muted);
  font-size:9px;
}

#rrhhHorasView .horas-quality-grid{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:10px;
}

#rrhhHorasView .horas-quality-card{
  display:grid;
  grid-template-columns:38px 1fr 20px;
  gap:10px;
  align-items:center;
  min-width:0;
  padding:12px;
  border:1px solid var(--border);
  border-radius:12px;
  background:var(--card);
  color:var(--ink);
  text-align:left;
  cursor:pointer;
  transition:.15s ease;
}

#rrhhHorasView .horas-quality-card:hover:not(:disabled){
  transform:translateY(-1px);
  border-color:#FF5C33;
  box-shadow:0 8px 22px rgba(20,30,36,.08);
}

#rrhhHorasView .horas-quality-card:disabled{
  opacity:.5;
  cursor:not-allowed;
}

#rrhhHorasView .horas-quality-card .horas-quality-icon{
  display:flex;
  width:34px;
  height:34px;
  align-items:center;
  justify-content:center;
  border-radius:10px;
  font-size:15px;
  font-weight:950;
}

#rrhhHorasView .horas-quality-card.warning .horas-quality-icon{
  background:#FFF4E6;
  color:#A56608;
}

#rrhhHorasView .horas-quality-card.source .horas-quality-icon{
  background:rgba(255,92,51,.10);
  color:#FF5C33;
}

#rrhhHorasView .horas-quality-card.danger .horas-quality-icon{
  background:#FDEDEC;
  color:#B33A32;
}

#rrhhHorasView .horas-quality-card strong{
  display:inline-block;
  margin-right:7px;
  font-size:18px;
  line-height:1;
}

#rrhhHorasView .horas-quality-card b{
  font-size:10.5px;
}

#rrhhHorasView .horas-quality-card small{
  display:block;
  margin-top:4px;
  color:var(--muted);
  font-size:9px;
  line-height:1.4;
}

#rrhhHorasView .horas-quality-card i{
  color:var(--muted);
  font-size:20px;
  font-style:normal;
  text-align:right;
}

#rrhhHorasView .horas-jornadas-table{
  min-width:1320px;
}


/* Drawer de detalle */

.horas-drawer-backdrop{
  position:fixed;
  inset:0;
  z-index:10020;
  background:rgba(7,11,13,.56);
  backdrop-filter:blur(2px);
}

.horas-drawer{
  position:fixed;
  top:0;
  right:0;
  bottom:0;
  z-index:10021;
  width:min(860px,92vw);
  overflow:auto;
  padding:22px;
  background:#FFFFFF;
  border-left:1px solid #D9E0E4;
  box-shadow:-18px 0 45px rgba(0,0,0,.22);
}

.horas-drawer-head{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:18px;
  margin-bottom:16px;
}

.horas-drawer-head h3{
  margin:0 0 6px;
  color:#1A2328;
  font-size:20px;
  font-weight:950;
  letter-spacing:-.02em;
}

.horas-drawer-head p{
  max-width:680px;
  margin:0;
  color:#6F7B82;
  font-size:11px;
  line-height:1.55;
}

.horas-drawer-close{
  display:flex;
  width:38px;
  height:38px;
  flex:0 0 38px;
  align-items:center;
  justify-content:center;
  border:1px solid #D9E0E4;
  border-radius:11px;
  background:#F8FAFB;
  color:#334149;
  font-size:22px;
  cursor:pointer;
}

.horas-drawer-summary{
  display:flex;
  align-items:baseline;
  gap:8px;
  margin-bottom:14px;
  padding:12px 14px;
  border:1px solid #E0E6E9;
  border-radius:12px;
  background:#F8FAFB;
}

.horas-drawer-summary strong{
  color:#FF5C33;
  font-size:24px;
  font-weight:950;
}

.horas-drawer-summary span{
  color:#6F7B82;
  font-size:10px;
  font-weight:850;
}

.horas-drawer .horas-table-wrap{
  border:1px solid #E0E6E9;
}

.horas-drawer .horas-table{
  min-width:760px;
}

.horas-drawer .horas-table th{
  background:#F2F6F8;
  color:#6F7B82;
}

.horas-drawer .horas-table td{
  color:#27333A;
  border-bottom:1px solid #E7ECEF;
}


/* Dark mode */

html[data-theme="dark"] #rrhhHorasView .horas-quality-panel{
  background:#11181C;
  border-color:#283238;
}

html[data-theme="dark"] #rrhhHorasView .horas-quality-head b{
  color:#EEF3F5;
}

html[data-theme="dark"] #rrhhHorasView .horas-quality-card{
  background:#0E1519;
  border-color:#2B363C;
  color:#E8EEF1;
}

html[data-theme="dark"] #rrhhHorasView .horas-quality-card:hover:not(:disabled){
  border-color:#FF5C33;
  box-shadow:none;
}

html[data-theme="dark"] #rrhhHorasView .horas-quality-card.warning .horas-quality-icon{
  background:#3A2C12;
  color:#FFC56E;
}

html[data-theme="dark"] #rrhhHorasView .horas-quality-card.source .horas-quality-icon{
  background:rgba(255,92,51,.12);
  color:#FF7A59;
}

html[data-theme="dark"] #rrhhHorasView .horas-quality-card.danger .horas-quality-icon{
  background:#3A1D1B;
  color:#FF8C82;
}

html[data-theme="dark"] .horas-drawer{
  background:#11181C;
  border-left-color:#283238;
}

html[data-theme="dark"] .horas-drawer-head h3{
  color:#EEF3F5;
}

html[data-theme="dark"] .horas-drawer-head p{
  color:#95A2A9;
}

html[data-theme="dark"] .horas-drawer-close{
  background:#121B20;
  border-color:#2B363C;
  color:#E8EEF1;
}

html[data-theme="dark"] .horas-drawer-summary{
  background:#0E1519;
  border-color:#2B363C;
}

html[data-theme="dark"] .horas-drawer-summary span{
  color:#95A2A9;
}

html[data-theme="dark"] .horas-drawer .horas-table-wrap{
  border-color:#253038;
}

html[data-theme="dark"] .horas-drawer .horas-table th{
  background:#0D1418;
  color:#95A2A9;
}

html[data-theme="dark"] .horas-drawer .horas-table td{
  color:#DDE5E9;
  border-bottom-color:#222D33;
}


@media(max-width:820px){
  #rrhhHorasView .horas-quality-grid{
    grid-template-columns:1fr;
  }

  .horas-drawer{
    width:100vw;
    padding:16px;
  }
}

/* ======================================================
   V0.7 · REEMPLAZOS + CAPACITACIONES · DRILL-DOWN KPI
   ====================================================== */

#rrhhHorasView .horas-kpi.has-detail{
  padding-right:52px;
}

#rrhhHorasView .horas-kpi-detail-button{
  position:absolute;
  top:10px;
  right:10px;
  display:flex;
  width:30px;
  height:30px;
  align-items:center;
  justify-content:center;
  border:1px solid var(--border);
  border-radius:9px;
  background:rgba(255,255,255,.72);
  color:var(--muted);
  font-size:13px;
  font-weight:950;
  cursor:pointer;
  transition:.15s ease;
}

#rrhhHorasView .horas-kpi-detail-button:hover{
  transform:translateY(-1px);
  border-color:#FF5C33;
  background:#FFFFFF;
  color:#FF5C33;
}

#rrhhHorasView .horas-kpi-detail-button:focus-visible{
  outline:0;
  border-color:#FF5C33;
  box-shadow:0 0 0 3px rgba(255,92,51,.12);
}

.horas-events-drawer{
  width:min(980px,94vw);
}

.horas-events-context-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:10px;
  margin-bottom:12px;
}

.horas-events-context-card{
  min-width:0;
  padding:12px 14px;
  border:1px solid #E0E6E9;
  border-radius:12px;
  background:#F8FAFB;
}

.horas-events-context-card b{
  display:block;
  margin-bottom:5px;
  color:#1A2328;
  font-size:10.5px;
  font-weight:900;
}

.horas-events-context-card p{
  margin:0;
  color:#6F7B82;
  font-size:10px;
  line-height:1.5;
}

.horas-events-drawer .horas-drawer-table{
  min-width:1050px;
}

html[data-theme="dark"] #rrhhHorasView .horas-kpi-detail-button{
  background:#121B20;
  border-color:#2B363C;
  color:#95A2A9;
}

html[data-theme="dark"] #rrhhHorasView .horas-kpi-detail-button:hover{
  background:#151E23;
  border-color:#FF5C33;
  color:#FF7A59;
}

html[data-theme="dark"] .horas-events-context-card{
  background:#0E1519;
  border-color:#2B363C;
}

html[data-theme="dark"] .horas-events-context-card b{
  color:#EEF3F5;
}

html[data-theme="dark"] .horas-events-context-card p{
  color:#95A2A9;
}

@media(max-width:820px){
  .horas-events-context-grid{
    grid-template-columns:1fr;
  }

  .horas-events-drawer{
    width:100vw;
  }
}

/* ======================================================
   V0.8 · LEGAJO_OVERRIDE · DRAWER + MODAL
   ====================================================== */

.horas-events-drawer .horas-drawer-table{
  min-width:1120px;
}

.horas-override-action-cell{
  width:54px;
  text-align:center;
}

.horas-override-edit-button{
  display:inline-flex;
  width:30px;
  height:30px;
  align-items:center;
  justify-content:center;
  border:1px solid #D9E0E4;
  border-radius:9px;
  background:#F8FAFB;
  color:#52616A;
  font-size:15px;
  font-weight:950;
  cursor:pointer;
  transition:.15s ease;
}

.horas-override-edit-button:hover{
  transform:translateY(-1px);
  border-color:#FF5C33;
  background:#FFFFFF;
  color:#FF5C33;
}

.horas-override-edit-button:focus-visible{
  outline:0;
  border-color:#FF5C33;
  box-shadow:0 0 0 3px rgba(255,92,51,.12);
}

.horas-override-modal-backdrop{
  position:fixed;
  inset:0;
  z-index:10040;
  background:rgba(7,11,13,.66);
  backdrop-filter:blur(3px);
}

.horas-override-modal{
  position:fixed;
  top:50%;
  left:50%;
  z-index:10041;
  width:min(620px,calc(100vw - 32px));
  max-height:calc(100vh - 32px);
  overflow:auto;
  transform:translate(-50%,-50%);
  padding:22px;
  border:1px solid #D9E0E4;
  border-radius:18px;
  background:#FFFFFF;
  color:#1A2328;
  box-shadow:0 24px 70px rgba(0,0,0,.32);
}

.horas-override-modal-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:18px;
  margin-bottom:16px;
}

.horas-override-modal-head span{
  display:block;
  margin-bottom:5px;
  color:#FF5C33;
  font-size:9px;
  font-weight:950;
  letter-spacing:.1em;
}

.horas-override-modal-head h3{
  margin:0;
  color:#1A2328;
  font-size:21px;
  font-weight:950;
  letter-spacing:-.02em;
}

.horas-override-modal-close{
  display:flex;
  width:36px;
  height:36px;
  flex:0 0 36px;
  align-items:center;
  justify-content:center;
  border:1px solid #D9E0E4;
  border-radius:10px;
  background:#F8FAFB;
  color:#334149;
  font-size:21px;
  cursor:pointer;
}

.horas-override-readonly-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:8px;
  margin:0 0 14px;
}

.horas-override-readonly-grid>div{
  min-width:0;
  padding:10px 12px;
  border:1px solid #E0E6E9;
  border-radius:11px;
  background:#F8FAFB;
}

.horas-override-readonly-grid>div.wide{
  grid-column:1/-1;
}

.horas-override-readonly-grid dt{
  margin:0 0 4px;
  color:#6F7B82;
  font-size:8.5px;
  font-weight:900;
  letter-spacing:.06em;
  text-transform:uppercase;
}

.horas-override-readonly-grid dd{
  overflow-wrap:anywhere;
  margin:0;
  color:#27333A;
  font-size:11px;
  font-weight:850;
  line-height:1.4;
}

.horas-override-global-warning{
  margin:0 0 14px;
  padding:10px 12px;
  border:1px solid rgba(255,92,51,.28);
  border-radius:11px;
  background:rgba(255,92,51,.07);
  color:#75412F;
  font-size:10px;
  font-weight:750;
  line-height:1.5;
}

.horas-override-form fieldset{
  display:flex;
  gap:9px;
  margin:0 0 13px;
  padding:0;
  border:0;
}

.horas-override-form legend,
.horas-override-input-label{
  display:block;
  width:100%;
  margin:0 0 7px;
  color:#6F7B82;
  font-size:9px;
  font-weight:900;
  letter-spacing:.07em;
  text-transform:uppercase;
}

.horas-override-form legend{
  padding:0;
}

.horas-override-radio{
  display:flex;
  min-height:40px;
  flex:1;
  align-items:center;
  gap:8px;
  padding:0 12px;
  border:1px solid #D9E0E4;
  border-radius:10px;
  background:#F8FAFB;
  color:#334149;
  font-size:10.5px;
  font-weight:850;
  cursor:pointer;
}

.horas-override-radio:has(input:checked){
  border-color:#FF5C33;
  background:rgba(255,92,51,.07);
  color:#D94C28;
}

.horas-override-radio input{
  margin:0;
  accent-color:#FF5C33;
}

.horas-override-input{
  width:100%;
  height:44px;
  box-sizing:border-box;
  border:1px solid #D9E0E4;
  border-radius:10px;
  padding:0 12px;
  background:#F8FAFB;
  color:#1A2328;
  font:inherit;
  font-size:12px;
  font-weight:850;
  outline:none;
}

.horas-override-input:focus{
  border-color:#FF5C33;
  box-shadow:0 0 0 3px rgba(255,92,51,.10);
}

.horas-override-input:disabled{
  opacity:.55;
  cursor:not-allowed;
}

.horas-override-state{
  min-height:18px;
  margin:7px 0 0;
  color:#6F7B82;
  font-size:10px;
  font-weight:800;
  line-height:1.45;
}

.horas-override-state.error{
  color:#B33A32;
}

.horas-override-state.warning{
  color:#A56608;
}

.horas-override-actions{
  display:flex;
  justify-content:flex-end;
  gap:8px;
  margin-top:12px;
  padding-top:14px;
  border-top:1px solid #E0E6E9;
}

.horas-override-modal button:disabled,
.horas-override-modal input:disabled{
  opacity:.55;
  cursor:not-allowed;
  transform:none;
}

html[data-theme="dark"] .horas-override-edit-button{
  background:#121B20;
  border-color:#2B363C;
  color:#AAB5BB;
}

html[data-theme="dark"] .horas-override-edit-button:hover{
  background:#151E23;
  border-color:#FF5C33;
  color:#FF7A59;
}

html[data-theme="dark"] .horas-override-modal{
  border-color:#2B363C;
  background:#11181C;
  color:#EEF3F5;
}

html[data-theme="dark"] .horas-override-modal-head h3{
  color:#EEF3F5;
}

html[data-theme="dark"] .horas-override-modal-close{
  border-color:#2B363C;
  background:#121B20;
  color:#E8EEF1;
}

html[data-theme="dark"] .horas-override-readonly-grid>div{
  border-color:#2B363C;
  background:#0E1519;
}

html[data-theme="dark"] .horas-override-readonly-grid dt,
html[data-theme="dark"] .horas-override-form legend,
html[data-theme="dark"] .horas-override-input-label,
html[data-theme="dark"] .horas-override-state{
  color:#95A2A9;
}

html[data-theme="dark"] .horas-override-readonly-grid dd{
  color:#DDE5E9;
}

html[data-theme="dark"] .horas-override-global-warning{
  border-color:rgba(255,92,51,.28);
  background:rgba(255,92,51,.09);
  color:#F2AA93;
}

html[data-theme="dark"] .horas-override-radio{
  border-color:#2B363C;
  background:#0E1519;
  color:#CBD4D9;
}

html[data-theme="dark"] .horas-override-radio:has(input:checked){
  border-color:#FF5C33;
  background:rgba(255,92,51,.10);
  color:#FF8B6C;
}

html[data-theme="dark"] .horas-override-input{
  border-color:#2B363C;
  background:#0E1519;
  color:#E8EEF1;
}

html[data-theme="dark"] .horas-override-state.error{
  color:#FF8C82;
}

html[data-theme="dark"] .horas-override-state.warning{
  color:#FFC56E;
}

html[data-theme="dark"] .horas-override-actions{
  border-top-color:#2B363C;
}

@media(max-width:620px){
  .horas-override-modal{
    width:calc(100vw - 20px);
    max-height:calc(100vh - 20px);
    padding:16px;
    border-radius:14px;
  }

  .horas-override-readonly-grid{
    grid-template-columns:1fr;
  }

  .horas-override-readonly-grid>div.wide{
    grid-column:auto;
  }

  .horas-override-form fieldset,
  .horas-override-actions{
    flex-direction:column;
  }

  .horas-override-actions button{
    width:100%;
  }

  .horas-toast{
    right:10px;
    bottom:10px;
    left:10px;
    max-width:none;
  }
}

/* ======================================================
   V0.9 · DRAWERS AGRUPADOS POR PROFESOR / ALIAS
   ====================================================== */

.horas-events-drawer{
  overflow-x:hidden;
}

.horas-events-drawer .horas-events-summary{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  align-items:stretch;
  gap:8px;
  padding:8px;
}

.horas-events-summary-metric{
  min-width:0;
  padding:9px 11px;
  border:1px solid var(--ui-border);
  border-radius:10px;
  background:var(--ui-surface-secondary);
}

.horas-events-summary-metric strong,
.horas-events-summary-metric span{
  display:block;
}

.horas-events-summary-metric strong{
  font-size:20px;
}

.horas-events-summary-metric span{
  margin-top:3px;
  line-height:1.35;
}

.horas-events-drawer .horas-drawer-table>tbody>.horas-event-group-row>td:first-child,
.horas-events-drawer .horas-drawer-table>tbody>.horas-event-group-detail-row>td:first-child,
.horas-event-group-detail table td:first-child{
  display:table-cell;
}

.horas-events-drawer .horas-event-group-row>td{
  vertical-align:middle;
}

.horas-events-drawer .horas-event-group-person{
  min-width:145px;
  max-width:210px;
  white-space:normal;
  overflow-wrap:anywhere;
  line-height:1.35;
}

.horas-event-group-toggle-cell{
  width:54px;
  text-align:center;
}

.horas-event-group-toggle{
  display:inline-flex;
  width:30px;
  height:30px;
  align-items:center;
  justify-content:center;
  border:1px solid var(--ui-border);
  border-radius:9px;
  background:var(--ui-surface-secondary);
  color:var(--ui-muted);
  font-size:13px;
  font-weight:950;
  cursor:pointer;
  transition:.15s ease;
}

.horas-event-group-toggle:hover,
.horas-event-group-toggle[aria-expanded="true"]{
  border-color:var(--core-orange);
  background:var(--ui-surface-hover);
  color:var(--core-orange);
}

.horas-event-group-toggle:focus-visible{
  outline:0;
  border-color:var(--core-orange);
  box-shadow:0 0 0 3px rgba(255,92,51,.12);
}

.horas-event-group-toggle span{
  transition:transform .15s ease;
}

.horas-event-group-toggle[aria-expanded="true"] span{
  transform:rotate(180deg);
}

.horas-events-drawer .horas-drawer-table>tbody>.horas-event-group-detail-row:hover>td{
  background:transparent !important;
}

.horas-events-drawer .horas-drawer-table>tbody>.horas-event-group-row:has(.horas-event-group-toggle[aria-expanded="true"])>td{
  background:var(--ui-surface-hover) !important;
}

.horas-event-group-detail-row>td{
  padding:0 8px 10px !important;
  white-space:normal !important;
}

.horas-event-group-detail{
  max-width:100%;
  overflow-x:auto;
  padding:10px;
  border:1px solid var(--ui-border);
  border-radius:10px;
  background:var(--ui-surface-secondary);
}

.horas-event-group-detail table{
  width:100%;
  min-width:560px;
  border-collapse:collapse;
  color:var(--ui-text);
  font-size:9.5px;
}

.horas-events-drawer[data-eventos-modulo="capacitaciones"] .horas-event-group-detail table{
  min-width:760px;
}

.horas-event-group-detail th,
.horas-event-group-detail td{
  height:auto;
  padding:7px 8px !important;
  border-bottom:1px solid var(--ui-line) !important;
  white-space:nowrap;
  text-align:left;
}

.horas-event-group-detail th{
  position:static;
  color:var(--ui-muted) !important;
  background:transparent !important;
  font-size:8px;
  letter-spacing:.04em;
  text-transform:uppercase;
}

.horas-event-group-detail td{
  color:var(--ui-text) !important;
  background:transparent !important;
}

.horas-event-group-detail tbody tr:last-child td{
  border-bottom:0 !important;
}

.horas-event-group-detail tbody tr:hover td{
  background:var(--ui-surface-hover) !important;
}

.horas-events-drawer .horas-override-edit-button:disabled,
html[data-theme="dark"] .horas-events-drawer .horas-override-edit-button:disabled{
  opacity:.42;
  border-color:var(--ui-border);
  background:var(--ui-surface-secondary);
  color:var(--ui-muted);
  cursor:not-allowed;
  transform:none;
}

@media(max-width:620px){
  .horas-events-drawer .horas-events-summary{
    grid-template-columns:1fr;
  }

  .horas-events-summary-metric{
    display:flex;
    align-items:baseline;
    gap:7px;
  }

  .horas-events-summary-metric span{
    margin-top:0;
  }
}

/* ======================================================
   V1.0 · RESUMEN REAL + COMPUTABLES_CIERRE
   ====================================================== */

#rrhhHorasView .horas-resumen-edit-note{
  display:block;
  margin-top:6px;
  color:var(--muted);
  font-size:9px;
  font-weight:800;
}

#rrhhHorasView .horas-resumen-table{
  min-width:980px;
}

#rrhhHorasView .horas-resumen-person-cell{
  display:flex;
  align-items:center;
  gap:7px;
  min-width:190px;
}

#rrhhHorasView .horas-resumen-persona-copy{
  display:flex;
  min-width:0;
  flex-direction:column;
  gap:2px;
}

#rrhhHorasView .horas-resumen-persona-copy b{
  overflow:hidden;
  max-width:220px;
  text-overflow:ellipsis;
  white-space:nowrap;
}

#rrhhHorasView .horas-resumen-persona-copy small{
  color:var(--muted);
  font-size:8.5px;
  font-weight:750;
}

#rrhhHorasView .horas-computables-cell{
  min-width:150px;
}

#rrhhHorasView .horas-computables-main{
  display:flex;
  align-items:center;
  gap:6px;
}

#rrhhHorasView .horas-computables-main strong{
  font-size:11px;
  font-weight:950;
}

#rrhhHorasView .horas-manual-badge{
  display:inline-flex;
  align-items:center;
  min-height:19px;
  padding:0 6px;
  border:1px solid rgba(255,92,51,.30);
  border-radius:999px;
  background:rgba(255,92,51,.08);
  color:#D94C28;
  font-size:7.5px;
  font-weight:950;
  letter-spacing:.04em;
}

#rrhhHorasView .horas-computables-auto{
  display:block;
  margin-top:4px;
  color:var(--muted);
  font-size:8.5px;
  font-weight:750;
}

#rrhhHorasView .horas-resumen-edit-button{
  display:inline-flex;
  width:26px;
  height:26px;
  flex:0 0 26px;
  align-items:center;
  justify-content:center;
  border:1px solid var(--border);
  border-radius:8px;
  background:var(--card);
  color:var(--muted);
  font-size:13px;
  font-weight:950;
  cursor:pointer;
  transition:.15s ease;
}

#rrhhHorasView .horas-resumen-edit-button:hover{
  transform:translateY(-1px);
  border-color:#FF5C33;
  color:#FF5C33;
}

#rrhhHorasView .horas-resumen-edit-button:focus-visible{
  outline:0;
  border-color:#FF5C33;
  box-shadow:0 0 0 3px rgba(255,92,51,.12);
}

#rrhhHorasView .horas-resumen-incidencias-button{
  display:inline-flex;
  min-width:28px;
  height:26px;
  align-items:center;
  justify-content:center;
  border:1px solid var(--border);
  border-radius:999px;
  background:var(--card);
  color:var(--muted);
  font-size:9px;
  font-weight:950;
  cursor:pointer;
}

#rrhhHorasView .horas-resumen-incidencias-button.has-incidents{
  border-color:#F4D5A6;
  background:#FFF4E6;
  color:#A56608;
}

#rrhhHorasView .horas-resumen-alert-empty{
  display:flex;
  min-height:150px;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:5px;
  color:var(--muted);
  text-align:center;
}

#rrhhHorasView .horas-resumen-alert-empty b{
  color:var(--ink);
  font-size:11px;
}

#rrhhHorasView .horas-resumen-alert-empty small{
  max-width:230px;
  font-size:9px;
  line-height:1.45;
}

.horas-computables-cierre-modal{
  width:min(680px,calc(100vw - 32px));
}

.horas-cierre-warning{
  margin:0 0 14px;
  padding:10px 12px;
  border:1px solid rgba(255,92,51,.28);
  border-radius:11px;
  background:rgba(255,92,51,.07);
  color:#75412F;
  font-size:10px;
  font-weight:750;
  line-height:1.5;
}

.horas-cierre-alert-section{
  margin-bottom:14px;
}

.horas-cierre-alert-section>b{
  display:block;
  margin-bottom:7px;
  color:#6F7B82;
  font-size:9px;
  font-weight:900;
  letter-spacing:.07em;
  text-transform:uppercase;
}

.horas-cierre-alert-list{
  display:grid;
  gap:6px;
}

.horas-cierre-alert-item{
  padding:9px 10px;
  border:1px solid #E0E6E9;
  border-radius:10px;
  background:#F8FAFB;
}

.horas-cierre-alert-item b{
  display:block;
  color:#A56608;
  font-size:9px;
}

.horas-cierre-alert-item span{
  display:block;
  margin-top:3px;
  color:#6F7B82;
  font-size:9px;
  line-height:1.4;
}

.horas-cierre-alert-empty{
  padding:10px 12px;
  border:1px dashed #D9E0E4;
  border-radius:10px;
  color:#6F7B82;
  font-size:9.5px;
}

.horas-cierre-motivo-label{
  margin-top:13px;
}

.horas-cierre-motivo{
  width:100%;
  min-height:82px;
  box-sizing:border-box;
  resize:vertical;
  border:1px solid #D9E0E4;
  border-radius:10px;
  padding:10px 12px;
  background:#F8FAFB;
  color:#1A2328;
  font:inherit;
  font-size:11px;
  font-weight:750;
  line-height:1.45;
  outline:none;
}

.horas-cierre-motivo:focus{
  border-color:#FF5C33;
  box-shadow:0 0 0 3px rgba(255,92,51,.10);
}

.horas-resumen-drawer{
  width:min(760px,92vw);
}

.horas-resumen-detail-metrics{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:8px;
  margin-bottom:14px;
}

.horas-resumen-detail-metrics>div{
  padding:10px 12px;
  border:1px solid #E0E6E9;
  border-radius:11px;
  background:#F8FAFB;
}

.horas-resumen-detail-metrics span,
.horas-resumen-detail-metrics b{
  display:block;
}

.horas-resumen-detail-metrics span{
  color:#6F7B82;
  font-size:8.5px;
  font-weight:850;
  text-transform:uppercase;
}

.horas-resumen-detail-metrics b{
  margin-top:4px;
  color:#27333A;
  font-size:15px;
  font-weight:950;
}

.horas-resumen-detail-section{
  margin-top:12px;
}

.horas-resumen-detail-title{
  display:flex;
  align-items:center;
  justify-content:space-between;
  margin-bottom:7px;
}

.horas-resumen-detail-title b{
  color:#27333A;
  font-size:11px;
}

.horas-resumen-detail-title span{
  display:inline-flex;
  min-width:24px;
  height:22px;
  align-items:center;
  justify-content:center;
  border-radius:999px;
  background:#EEF2F4;
  color:#52616A;
  font-size:8.5px;
  font-weight:950;
}

.horas-resumen-detail-alert{
  position:relative;
  margin-bottom:6px;
  padding:10px 12px;
  border:1px solid #E0E6E9;
  border-radius:10px;
  background:#F8FAFB;
}

.horas-resumen-detail-alert>b{
  color:#A56608;
  font-size:9px;
}

.horas-resumen-detail-alert>span{
  float:right;
  color:#6F7B82;
  font-size:8.5px;
  font-weight:850;
}

.horas-resumen-detail-alert p,
.horas-resumen-detail-empty{
  margin:5px 0 0;
  color:#6F7B82;
  font-size:9.5px;
  line-height:1.45;
}

#rrhhHorasView .horas-pending-panel{
  display:flex;
  min-height:180px;
  align-items:center;
  justify-content:center;
  gap:16px;
  text-align:left;
}

#rrhhHorasView .horas-pending-icon{
  display:flex;
  width:52px;
  height:52px;
  flex:0 0 52px;
  align-items:center;
  justify-content:center;
  border-radius:14px;
  background:rgba(255,92,51,.09);
  color:#FF5C33;
  font-size:22px;
}

#rrhhHorasView .horas-pending-panel b{
  display:block;
  margin-bottom:5px;
  color:var(--ink);
  font-size:13px;
}

#rrhhHorasView .horas-pending-panel p{
  max-width:680px;
  margin:0;
  color:var(--muted);
  font-size:10.5px;
  line-height:1.55;
}

html[data-theme="dark"] #rrhhHorasView .horas-manual-badge{
  border-color:rgba(255,92,51,.32);
  background:rgba(255,92,51,.12);
  color:#FF8B6C;
}

html[data-theme="dark"] #rrhhHorasView .horas-resumen-edit-button,
html[data-theme="dark"] #rrhhHorasView .horas-resumen-incidencias-button{
  border-color:#2B363C;
  background:#121B20;
  color:#AAB5BB;
}

html[data-theme="dark"] #rrhhHorasView .horas-resumen-incidencias-button.has-incidents{
  border-color:#60481E;
  background:#3A2C12;
  color:#FFC56E;
}

html[data-theme="dark"] .horas-cierre-warning{
  border-color:rgba(255,92,51,.28);
  background:rgba(255,92,51,.09);
  color:#F2AA93;
}

html[data-theme="dark"] .horas-cierre-alert-item,
html[data-theme="dark"] .horas-resumen-detail-metrics>div,
html[data-theme="dark"] .horas-resumen-detail-alert{
  border-color:#2B363C;
  background:#0E1519;
}

html[data-theme="dark"] .horas-cierre-alert-section>b,
html[data-theme="dark"] .horas-cierre-alert-item span,
html[data-theme="dark"] .horas-resumen-detail-metrics span,
html[data-theme="dark"] .horas-resumen-detail-alert>span,
html[data-theme="dark"] .horas-resumen-detail-alert p,
html[data-theme="dark"] .horas-resumen-detail-empty{
  color:#95A2A9;
}

html[data-theme="dark"] .horas-cierre-alert-empty{
  border-color:#2B363C;
  color:#95A2A9;
}

html[data-theme="dark"] .horas-cierre-motivo{
  border-color:#2B363C;
  background:#0E1519;
  color:#E8EEF1;
}

html[data-theme="dark"] .horas-resumen-detail-metrics b,
html[data-theme="dark"] .horas-resumen-detail-title b{
  color:#DDE5E9;
}

html[data-theme="dark"] .horas-resumen-detail-title span{
  background:#1B252A;
  color:#DCE5E9;
}

@media(max-width:820px){
  .horas-resumen-detail-metrics{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
}

@media(max-width:620px){
  .horas-computables-cierre-modal{
    width:calc(100vw - 20px);
  }

  .horas-resumen-detail-metrics{
    grid-template-columns:1fr;
  }
}


/* ======================================================
   V1.1 · RESUMEN OPERATIVO · KPI + ALERTAS DRILL-DOWN
   ====================================================== */

#rrhhHorasView .resumen-kpis{
  grid-template-columns:repeat(5,minmax(0,1fr));
  margin-bottom:12px;
}

#rrhhHorasView .horas-resumen-kpi-card{
  width:100%;
  box-sizing:border-box;
  padding-right:50px;
  color:var(--ink);
  font:inherit;
  text-align:left;
  appearance:none;
  cursor:pointer;
  transition:.15s ease;
}

#rrhhHorasView .horas-resumen-kpi-card:hover{
  transform:translateY(-1px);
  border-color:rgba(255,92,51,.42);
  box-shadow:0 10px 26px rgba(20,30,36,.08);
}

#rrhhHorasView .horas-resumen-kpi-card:focus-visible{
  outline:0;
  border-color:#FF5C33;
  box-shadow:0 0 0 3px rgba(255,92,51,.12);
}

#rrhhHorasView .horas-resumen-kpi-card .horas-kpi-mark{
  display:block;
}

#rrhhHorasView .horas-resumen-kpi-copy{
  display:block;
  min-width:0;
}

#rrhhHorasView .horas-resumen-kpi-copy>span,
#rrhhHorasView .horas-resumen-kpi-copy>strong,
#rrhhHorasView .horas-resumen-kpi-copy>small{
  display:block;
}

#rrhhHorasView .horas-resumen-kpi-arrow{
  position:absolute;
  top:11px;
  right:11px;
  display:flex !important;
  width:30px;
  height:30px;
  align-items:center;
  justify-content:center;
  border:1px solid var(--border);
  border-radius:9px;
  background:rgba(255,255,255,.72);
  color:var(--muted) !important;
  font-size:13px !important;
  font-weight:950;
  transition:.15s ease;
}

#rrhhHorasView .horas-resumen-kpi-card:hover .horas-resumen-kpi-arrow{
  border-color:#FF5C33;
  background:#FFFFFF;
  color:#FF5C33 !important;
}

#rrhhHorasView .horas-resumen-alerts-head{
  gap:10px;
}

#rrhhHorasView .horas-resumen-alerts-open{
  display:inline-flex;
  align-items:center;
  gap:6px;
  border:0;
  background:transparent;
  color:#FF5C33;
  font:inherit;
  font-size:10px;
  font-weight:950;
  cursor:pointer;
}

#rrhhHorasView .horas-resumen-alerts-open span{
  color:#FF5C33;
  font-size:10px;
}

#rrhhHorasView .horas-resumen-alerts-open i{
  font-style:normal;
  font-size:12px;
}

#rrhhHorasView .horas-alert-button{
  width:100%;
  box-sizing:border-box;
  border:0;
  background:transparent;
  color:var(--ink);
  font:inherit;
  text-align:left;
  cursor:pointer;
  transition:.15s ease;
}

#rrhhHorasView .horas-alert-button:hover{
  background:rgba(255,92,51,.035);
}

#rrhhHorasView .horas-alert-button:focus-visible{
  outline:0;
  border-radius:9px;
  box-shadow:0 0 0 3px rgba(255,92,51,.10);
}

#rrhhHorasView .horas-resumen-alerts-footer{
  width:100%;
  margin-top:10px;
  border:0;
  background:transparent;
  color:#FF5C33;
  font-size:9.5px;
  font-weight:900;
  text-align:right;
  cursor:pointer;
}

.horas-resumen-audit-drawer{
  width:min(980px,94vw);
}

.horas-resumen-audit-table{
  min-width:900px;
}

.horas-resumen-audit-table.wide{
  min-width:1050px;
}

.horas-resumen-table-sub{
  display:block;
  margin-top:2px;
  color:#6F7B82;
  font-size:8.5px;
  font-weight:750;
}

.horas-resumen-wrap-cell{
  min-width:230px;
  white-space:normal !important;
  line-height:1.4;
}

.horas-resumen-alert-summary-grid{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:8px;
  margin-bottom:12px;
}

.horas-resumen-alert-summary-card{
  min-width:0;
  padding:10px 12px;
  border:1px solid #E0E6E9;
  border-radius:10px;
  background:#F8FAFB;
  color:#27333A;
  text-align:left;
  cursor:pointer;
  transition:.15s ease;
}

.horas-resumen-alert-summary-card:hover{
  transform:translateY(-1px);
  border-color:#FF5C33;
}

.horas-resumen-alert-summary-card strong,
.horas-resumen-alert-summary-card span{
  display:block;
}

.horas-resumen-alert-summary-card strong{
  color:#FF5C33;
  font-size:17px;
  font-weight:950;
}

.horas-resumen-alert-summary-card span{
  margin-top:3px;
  color:#52616A;
  font-size:8.5px;
  font-weight:850;
  line-height:1.35;
}

html[data-theme="dark"] #rrhhHorasView .horas-resumen-kpi-card{
  color:#E8EEF1;
}

html[data-theme="dark"] #rrhhHorasView .horas-resumen-kpi-card:hover{
  border-color:#FF5C33;
  box-shadow:none;
}

html[data-theme="dark"] #rrhhHorasView .horas-resumen-kpi-arrow{
  border-color:#2B363C;
  background:#121B20;
  color:#95A2A9 !important;
}

html[data-theme="dark"] #rrhhHorasView .horas-resumen-kpi-card:hover .horas-resumen-kpi-arrow{
  border-color:#FF5C33;
  background:#151E23;
  color:#FF7A59 !important;
}

html[data-theme="dark"] #rrhhHorasView .horas-alert-button{
  color:#DDE5E9;
}

html[data-theme="dark"] #rrhhHorasView .horas-alert-button:hover{
  background:rgba(255,92,51,.055);
}

html[data-theme="dark"] .horas-resumen-table-sub{
  color:#95A2A9;
}

html[data-theme="dark"] .horas-resumen-alert-summary-card{
  border-color:#2B363C;
  background:#0E1519;
  color:#DDE5E9;
}

html[data-theme="dark"] .horas-resumen-alert-summary-card:hover{
  border-color:#FF5C33;
}

html[data-theme="dark"] .horas-resumen-alert-summary-card span{
  color:#95A2A9;
}

@media(max-width:1450px){
  #rrhhHorasView .resumen-kpis{
    grid-template-columns:repeat(3,minmax(0,1fr));
  }
}

@media(max-width:980px){
  #rrhhHorasView .resumen-kpis{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }

  .horas-resumen-alert-summary-grid{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
}

@media(max-width:620px){
  #rrhhHorasView .resumen-kpis,
  .horas-resumen-alert-summary-grid{
    grid-template-columns:1fr;
  }

  .horas-resumen-audit-drawer{
    width:100vw;
  }
}

/* ======================================================
   V1.2 · RESUMEN · AJUSTES DE DETALLE
   - Colaboradores queda informativo, sin drill-down.
   - Corrige alineación de bordes en todas las tablas de drawers.
   ====================================================== */

#rrhhHorasView .horas-resumen-kpi-card.static{
  cursor:default;
}

#rrhhHorasView .horas-resumen-kpi-card.static:hover{
  transform:none;
  border-color:var(--border);
  box-shadow:none;
}

html[data-theme="dark"] #rrhhHorasView .horas-resumen-kpi-card.static:hover{
  border-color:#29353B;
  box-shadow:none;
}

/* Los drawers se montan directamente en <body>, fuera de #rrhhHorasView.
   La regla histórica .horas-table td:first-child { display:flex } rompía
   la geometría de la primera celda y dejaba el borde inferior desalineado. */
.horas-drawer .horas-table td:first-child{
  display:table-cell;
  vertical-align:middle;
}


/* ======================================================
   V1.3 · REPORTE FINAL REAL · CIERRE RRHH
   ====================================================== */

#rrhhHorasView .horas-report-kpis{
  grid-template-columns:repeat(5,minmax(0,1fr));
  margin-bottom:10px;
}

#rrhhHorasView .horas-report-kpi-card{
  position:relative;
  width:100%;
  box-sizing:border-box;
  padding-right:48px;
  color:var(--ink);
  font:inherit;
  text-align:left;
  appearance:none;
  cursor:pointer;
  transition:.15s ease;
}

#rrhhHorasView .horas-report-kpi-card.static{
  cursor:default;
  padding-right:14px;
}

#rrhhHorasView .horas-report-kpi-card:not(.static):hover{
  transform:translateY(-1px);
  border-color:rgba(255,92,51,.42);
  box-shadow:0 10px 26px rgba(20,30,36,.08);
}

#rrhhHorasView .horas-report-kpi-card:focus-visible{
  outline:0;
  border-color:#FF5C33;
  box-shadow:0 0 0 3px rgba(255,92,51,.12);
}

#rrhhHorasView .horas-report-kpi-copy,
#rrhhHorasView .horas-report-kpi-copy>span,
#rrhhHorasView .horas-report-kpi-copy>strong,
#rrhhHorasView .horas-report-kpi-copy>small{
  display:block;
}

#rrhhHorasView .horas-report-kpi-arrow{
  position:absolute;
  top:11px;
  right:11px;
  display:flex !important;
  width:30px;
  height:30px;
  align-items:center;
  justify-content:center;
  border:1px solid var(--border);
  border-radius:9px;
  background:rgba(255,255,255,.72);
  color:var(--muted) !important;
  font-size:13px !important;
  font-weight:950;
}

#rrhhHorasView .horas-report-kpi-card:not(.static):hover .horas-report-kpi-arrow{
  border-color:#FF5C33;
  background:#FFFFFF;
  color:#FF5C33 !important;
}

#rrhhHorasView .horas-report-totals{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:10px;
  margin:0 0 12px;
}

#rrhhHorasView .horas-report-total-card{
  position:relative;
  min-width:0;
  overflow:hidden;
  padding:14px 15px;
  border:1px solid var(--border);
  border-radius:13px;
  background:#F9FBFC;
}

#rrhhHorasView .horas-report-total-card::before{
  content:"";
  position:absolute;
  top:0;
  bottom:0;
  left:0;
  width:4px;
  background:#5B8CFF;
}

#rrhhHorasView .horas-report-total-card.deduction::before{
  background:#F4B400;
}

#rrhhHorasView .horas-report-total-card.primary{
  border-color:rgba(255,92,51,.34);
  background:rgba(255,92,51,.055);
}

#rrhhHorasView .horas-report-total-card.primary::before{
  background:#FF5C33;
}

#rrhhHorasView .horas-report-total-card span,
#rrhhHorasView .horas-report-total-card strong,
#rrhhHorasView .horas-report-total-card small{
  display:block;
}

#rrhhHorasView .horas-report-total-card span{
  color:var(--muted);
  font-size:9px;
  font-weight:900;
  letter-spacing:.05em;
  text-transform:uppercase;
}

#rrhhHorasView .horas-report-total-card strong{
  margin:5px 0 3px;
  color:var(--ink);
  font-size:21px;
  font-weight:950;
  letter-spacing:-.02em;
}

#rrhhHorasView .horas-report-total-card small{
  color:var(--muted);
  font-size:8.5px;
  line-height:1.4;
}

#rrhhHorasView .horas-report-main-grid{
  display:grid;
  grid-template-columns:minmax(0,1.7fr) minmax(270px,.48fr);
  gap:12px;
}

#rrhhHorasView .horas-report-table-final{
  min-width:1320px;
}

#rrhhHorasView .horas-report-person-cell{
  display:flex;
  min-width:190px;
  align-items:center;
  gap:7px;
}

#rrhhHorasView .horas-report-person-cell>span:last-child{
  display:flex;
  min-width:0;
  flex-direction:column;
  gap:2px;
}

#rrhhHorasView .horas-report-person-cell b{
  overflow:hidden;
  max-width:220px;
  text-overflow:ellipsis;
  white-space:nowrap;
}

#rrhhHorasView .horas-report-person-cell small{
  color:var(--muted);
  font-size:8.5px;
  font-weight:750;
}

#rrhhHorasView .horas-report-value-cell{
  display:inline-flex;
  align-items:center;
  gap:6px;
}

#rrhhHorasView .horas-report-total-cell{
  color:#FF5C33;
  font-weight:950;
}

#rrhhHorasView .horas-report-edit-button{
  display:inline-flex;
  width:30px;
  height:30px;
  flex:0 0 30px;
  align-items:center;
  justify-content:center;
  border:1px solid var(--border);
  border-radius:9px;
  background:var(--card);
  color:var(--muted);
  font-size:13px;
  font-weight:950;
  cursor:pointer;
  transition:.15s ease;
}

#rrhhHorasView .horas-report-edit-button.compact{
  width:25px;
  height:25px;
  flex-basis:25px;
  border-radius:8px;
  font-size:12px;
}

#rrhhHorasView .horas-report-edit-button:hover{
  transform:translateY(-1px);
  border-color:#FF5C33;
  color:#FF5C33;
}

#rrhhHorasView .horas-report-detail-button{
  height:28px;
  padding:0 10px;
  border:1px solid var(--border);
  border-radius:8px;
  background:var(--card);
  color:var(--ink);
  font-size:8.5px;
  font-weight:900;
  cursor:pointer;
}

#rrhhHorasView .horas-report-detail-button:hover{
  border-color:#FF5C33;
  color:#FF5C33;
}

#rrhhHorasView .horas-report-close-panel{
  align-self:start;
}

#rrhhHorasView .horas-report-close-step{
  display:grid;
  grid-template-columns:30px 1fr 16px;
  gap:9px;
  width:100%;
  align-items:center;
  padding:11px 4px;
  border:0;
  border-bottom:1px solid var(--line);
  background:transparent;
  color:var(--ink);
  font:inherit;
  text-align:left;
  cursor:pointer;
}

#rrhhHorasView .horas-report-close-step i{
  display:flex;
  width:28px;
  height:28px;
  align-items:center;
  justify-content:center;
  border-radius:9px;
  background:rgba(255,92,51,.10);
  color:#FF5C33;
  font-size:10px;
  font-style:normal;
  font-weight:950;
}

#rrhhHorasView .horas-report-close-step span,
#rrhhHorasView .horas-report-close-step b,
#rrhhHorasView .horas-report-close-step small{
  display:block;
}

#rrhhHorasView .horas-report-close-step b{
  font-size:10px;
  font-weight:900;
}

#rrhhHorasView .horas-report-close-step small{
  margin-top:2px;
  color:var(--muted);
  font-size:8.5px;
  line-height:1.35;
}

#rrhhHorasView .horas-report-close-step em{
  color:var(--muted);
  font-size:18px;
  font-style:normal;
}

#rrhhHorasView .horas-report-close-step:hover{
  background:rgba(255,92,51,.035);
}

#rrhhHorasView .horas-report-close-note{
  margin-top:11px;
  padding:10px 11px;
  border:1px solid rgba(255,92,51,.20);
  border-radius:10px;
  background:rgba(255,92,51,.055);
  color:var(--muted);
  font-size:8.5px;
  font-weight:750;
  line-height:1.5;
}

/* Reporte Final · drawer */

.horas-report-drawer{
  width:min(980px,94vw);
}

.horas-report-person-drawer{
  width:min(1040px,95vw);
}

.horas-report-drawer-table{
  min-width:760px;
}

.horas-report-drawer-table.wide{
  min-width:920px;
}

.horas-report-detail-metrics{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:8px;
  margin-bottom:12px;
}

.horas-report-detail-metrics article{
  min-width:0;
  padding:11px 12px;
  border:1px solid #E0E6E9;
  border-radius:11px;
  background:#F8FAFB;
}

.horas-report-detail-metrics article.primary{
  border-color:rgba(255,92,51,.30);
  background:rgba(255,92,51,.06);
}

.horas-report-detail-metrics span,
.horas-report-detail-metrics strong{
  display:block;
}

.horas-report-detail-metrics span{
  color:#6F7B82;
  font-size:8px;
  font-weight:900;
  letter-spacing:.05em;
  text-transform:uppercase;
}

.horas-report-detail-metrics strong{
  margin-top:5px;
  color:#27333A;
  font-size:16px;
  font-weight:950;
}

.horas-report-detail-metrics article.primary strong{
  color:#FF5C33;
}

.horas-report-detail-section{
  margin-top:12px;
  padding-top:12px;
  border-top:1px solid #E7ECEF;
}

.horas-report-detail-section.first{
  margin-top:0;
}

.horas-report-detail-title{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-bottom:8px;
}

.horas-report-detail-title b{
  color:#27333A;
  font-size:11px;
  font-weight:950;
}

.horas-report-detail-title span{
  color:#6F7B82;
  font-size:8.5px;
  font-weight:800;
  text-align:right;
}

.horas-report-composition-flow{
  display:grid;
  grid-template-columns:1fr 18px 1fr 18px 1fr 18px 1fr;
  gap:5px;
  align-items:stretch;
}

.horas-report-composition-flow article{
  min-width:0;
  padding:10px 11px;
  border:1px solid #E0E6E9;
  border-radius:10px;
  background:#F8FAFB;
  text-align:center;
}

.horas-report-composition-flow article.total{
  border-color:rgba(255,92,51,.28);
  background:rgba(255,92,51,.06);
}

.horas-report-composition-flow span,
.horas-report-composition-flow strong,
.horas-report-composition-flow small{
  display:block;
}

.horas-report-composition-flow span{
  color:#6F7B82;
  font-size:8px;
  font-weight:850;
}

.horas-report-composition-flow strong{
  margin-top:5px;
  color:#27333A;
  font-size:14px;
  font-weight:950;
}

.horas-report-composition-flow article.total strong{
  color:#FF5C33;
}

.horas-report-composition-flow small{
  margin-top:3px;
  color:#A56608;
  font-size:7.5px;
  line-height:1.35;
}

.horas-report-composition-flow>i{
  display:flex;
  align-items:center;
  justify-content:center;
  color:#FF5C33;
  font-style:normal;
  font-weight:950;
}

.horas-report-mini-grid{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:8px;
}

.horas-report-mini-grid.two{
  grid-template-columns:repeat(2,minmax(0,1fr));
}

.horas-report-mini-grid.motivos{
  grid-template-columns:repeat(auto-fit,minmax(150px,1fr));
}

.horas-report-mini-grid article{
  min-width:0;
  padding:10px 11px;
  border:1px solid #E0E6E9;
  border-radius:10px;
  background:#F8FAFB;
}

.horas-report-mini-grid span,
.horas-report-mini-grid strong,
.horas-report-mini-grid small{
  display:block;
}

.horas-report-mini-grid span{
  color:#6F7B82;
  font-size:8px;
  font-weight:900;
  text-transform:uppercase;
}

.horas-report-mini-grid strong{
  margin-top:4px;
  color:#27333A;
  font-size:13px;
  font-weight:950;
}

.horas-report-mini-grid small{
  margin-top:4px;
  color:#6F7B82;
  font-size:8px;
  line-height:1.4;
}

.horas-report-inner-table{
  margin-top:8px;
}

.horas-report-inner-table .horas-table{
  min-width:760px;
}

.horas-report-detail-empty{
  margin:0;
  padding:9px 11px;
  border:1px dashed #D9E0E4;
  border-radius:9px;
  color:#6F7B82;
  font-size:9px;
}

.horas-report-manual-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:8px;
}

.horas-report-manual-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  min-width:0;
  padding:10px 11px;
  border:1px solid #E0E6E9;
  border-radius:10px;
  background:#F8FAFB;
}

.horas-report-manual-row>div{
  min-width:0;
}

.horas-report-manual-row span,
.horas-report-manual-row strong,
.horas-report-manual-row small{
  display:block;
}

.horas-report-manual-row span{
  color:#6F7B82;
  font-size:8px;
  font-weight:900;
  text-transform:uppercase;
}

.horas-report-manual-row strong{
  margin-top:3px;
  color:#27333A;
  font-size:13px;
  font-weight:950;
}

.horas-report-manual-row small{
  margin-top:3px;
  color:#6F7B82;
  font-size:8px;
  line-height:1.35;
}

.horas-report-alert-item{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-bottom:6px;
  padding:9px 10px;
  border:1px solid #E0E6E9;
  border-radius:9px;
  background:#F8FAFB;
}

.horas-report-alert-item>div{
  min-width:0;
}

.horas-report-alert-item b,
.horas-report-alert-item span,
.horas-report-alert-item small{
  display:block;
}

.horas-report-alert-item b{
  color:#A56608;
  font-size:9px;
  overflow-wrap:anywhere;
}

.horas-report-alert-item span,
.horas-report-alert-item small{
  margin-top:2px;
  color:#6F7B82;
  font-size:8px;
}

.horas-report-manual-modal{
  width:min(680px,calc(100vw - 32px));
}

/* Dark mode */

html[data-theme="dark"] #rrhhHorasView .horas-report-kpi-card{
  color:#E8EEF1;
}

html[data-theme="dark"] #rrhhHorasView .horas-report-kpi-card:not(.static):hover{
  border-color:#FF5C33;
  box-shadow:none;
}

html[data-theme="dark"] #rrhhHorasView .horas-report-kpi-arrow{
  border-color:#2B363C;
  background:#121B20;
  color:#95A2A9 !important;
}

html[data-theme="dark"] #rrhhHorasView .horas-report-kpi-card:not(.static):hover .horas-report-kpi-arrow{
  border-color:#FF5C33;
  background:#151E23;
  color:#FF7A59 !important;
}

html[data-theme="dark"] #rrhhHorasView .horas-report-total-card,
html[data-theme="dark"] .horas-report-detail-metrics article,
html[data-theme="dark"] .horas-report-composition-flow article,
html[data-theme="dark"] .horas-report-mini-grid article,
html[data-theme="dark"] .horas-report-manual-row,
html[data-theme="dark"] .horas-report-alert-item{
  border-color:#2B363C;
  background:#0E1519;
}

html[data-theme="dark"] #rrhhHorasView .horas-report-total-card.primary,
html[data-theme="dark"] .horas-report-detail-metrics article.primary,
html[data-theme="dark"] .horas-report-composition-flow article.total{
  border-color:rgba(255,92,51,.32);
  background:rgba(255,92,51,.09);
}

html[data-theme="dark"] #rrhhHorasView .horas-report-total-card strong,
html[data-theme="dark"] .horas-report-detail-metrics strong,
html[data-theme="dark"] .horas-report-detail-title b,
html[data-theme="dark"] .horas-report-composition-flow strong,
html[data-theme="dark"] .horas-report-mini-grid strong,
html[data-theme="dark"] .horas-report-manual-row strong{
  color:#DDE5E9;
}

html[data-theme="dark"] #rrhhHorasView .horas-report-total-card.primary strong,
html[data-theme="dark"] .horas-report-detail-metrics article.primary strong,
html[data-theme="dark"] .horas-report-composition-flow article.total strong{
  color:#FF7A59;
}

html[data-theme="dark"] #rrhhHorasView .horas-report-edit-button,
html[data-theme="dark"] #rrhhHorasView .horas-report-detail-button{
  border-color:#2B363C;
  background:#121B20;
  color:#AAB5BB;
}

html[data-theme="dark"] #rrhhHorasView .horas-report-edit-button:hover,
html[data-theme="dark"] #rrhhHorasView .horas-report-detail-button:hover{
  border-color:#FF5C33;
  color:#FF7A59;
}

html[data-theme="dark"] #rrhhHorasView .horas-report-close-step{
  border-bottom-color:#253038;
  color:#DDE5E9;
}

html[data-theme="dark"] #rrhhHorasView .horas-report-close-step:hover{
  background:rgba(255,92,51,.055);
}

html[data-theme="dark"] #rrhhHorasView .horas-report-close-note{
  border-color:rgba(255,92,51,.26);
  background:rgba(255,92,51,.08);
  color:#95A2A9;
}

html[data-theme="dark"] .horas-report-detail-section{
  border-top-color:#253038;
}

html[data-theme="dark"] .horas-report-detail-title span,
html[data-theme="dark"] .horas-report-detail-metrics span,
html[data-theme="dark"] .horas-report-composition-flow span,
html[data-theme="dark"] .horas-report-mini-grid span,
html[data-theme="dark"] .horas-report-mini-grid small,
html[data-theme="dark"] .horas-report-manual-row span,
html[data-theme="dark"] .horas-report-manual-row small,
html[data-theme="dark"] .horas-report-alert-item span,
html[data-theme="dark"] .horas-report-alert-item small{
  color:#95A2A9;
}

html[data-theme="dark"] .horas-report-detail-empty{
  border-color:#2B363C;
  color:#95A2A9;
}

@media(max-width:1450px){
  #rrhhHorasView .horas-report-kpis{
    grid-template-columns:repeat(3,minmax(0,1fr));
  }

  #rrhhHorasView .horas-report-main-grid{
    grid-template-columns:minmax(0,1fr) 300px;
  }
}

@media(max-width:1120px){
  #rrhhHorasView .horas-report-totals{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }

  #rrhhHorasView .horas-report-main-grid{
    grid-template-columns:1fr;
  }

  #rrhhHorasView .horas-report-close-panel{
    order:-1;
  }

  .horas-report-composition-flow{
    grid-template-columns:1fr;
  }

  .horas-report-composition-flow>i{
    min-height:16px;
  }
}

@media(max-width:820px){
  #rrhhHorasView .horas-report-kpis,
  #rrhhHorasView .horas-report-totals,
  .horas-report-detail-metrics,
  .horas-report-manual-grid,
  .horas-report-mini-grid,
  .horas-report-mini-grid.two,
  .horas-report-mini-grid.motivos{
    grid-template-columns:1fr;
  }

  .horas-report-drawer,
  .horas-report-person-drawer{
    width:100vw;
  }
}

/* ======================================================
   V1.4 · REPORTE FINAL · PREVIEW / EXPORT / PRESENTISMO
   ====================================================== */

#rrhhHorasView .horas-report-actions{
  justify-content:flex-end;
}

#rrhhHorasView .horas-report-actions .horas-primary-button,
#rrhhHorasView .horas-report-actions .horas-context-button{
  min-width:132px;
}

#rrhhHorasView .horas-report-actions button:disabled,
.horas-report-preview-modal button:disabled{
  opacity:.55;
  cursor:not-allowed;
  transform:none;
}

/* Vista previa del XLSX */
.horas-report-preview-modal{
  position:fixed;
  top:50%;
  left:50%;
  z-index:10041;
  display:flex;
  width:min(1540px,calc(100vw - 32px));
  height:min(880px,calc(100vh - 32px));
  flex-direction:column;
  transform:translate(-50%,-50%);
  overflow:hidden;
  border:1px solid #D9E0E4;
  border-radius:18px;
  background:#FFFFFF;
  color:#1A2328;
  box-shadow:0 24px 70px rgba(0,0,0,.34);
}

.horas-report-preview-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:18px;
  padding:18px 20px 14px;
  border-bottom:1px solid #E0E6E9;
}

.horas-report-preview-head>div:first-child{
  min-width:0;
}

.horas-report-preview-head span{
  display:block;
  margin-bottom:4px;
  color:#FF5C33;
  font-size:8.5px;
  font-weight:950;
  letter-spacing:.1em;
}

.horas-report-preview-head h3{
  margin:0;
  color:#1A2328;
  font-size:21px;
  font-weight:950;
  letter-spacing:-.02em;
}

.horas-report-preview-head p{
  margin:5px 0 0;
  color:#6F7B82;
  font-size:10px;
  font-weight:750;
}

.horas-report-preview-head-actions{
  display:flex;
  align-items:center;
  gap:8px;
}

.horas-report-preview-note{
  padding:9px 20px;
  border-bottom:1px solid #E7ECEF;
  background:#F8FAFB;
  color:#6F7B82;
  font-size:9px;
  font-weight:750;
  line-height:1.45;
}

.horas-report-preview-table-wrap{
  flex:1;
  min-height:0;
  overflow:auto;
  background:#F4F6F7;
  padding:14px;
}

.horas-report-preview-table{
  width:max-content;
  min-width:100%;
  border-collapse:collapse;
  table-layout:fixed;
  background:#FFFFFF;
  font-family:Roboto,Arial,sans-serif;
  font-size:10px;
  box-shadow:0 8px 24px rgba(20,30,36,.08);
}

.horas-report-preview-table th,
.horas-report-preview-table td{
  box-sizing:border-box;
  min-width:92px;
  max-width:240px;
  border:1px solid #DDE2E5;
  padding:7px 8px;
  vertical-align:middle;
  text-align:center;
  white-space:normal;
  overflow-wrap:anywhere;
}

.horas-report-preview-table th{
  position:sticky;
  z-index:3;
  border-color:#FFFFFF;
  background:var(--report-preview-color,#3c4043);
  color:#FFFFFF;
  font-weight:950;
  line-height:1.25;
}

.horas-report-preview-table .level-1 th{
  top:0;
  height:34px;
  font-size:12px;
}

.horas-report-preview-table .level-2 th{
  top:34px;
  height:34px;
  font-size:10px;
}

.horas-report-preview-table .level-3 th{
  top:68px;
  height:52px;
  font-size:9px;
}

.horas-report-preview-table tbody tr:nth-child(even) td{
  background:#FAFBFC;
}

.horas-report-preview-table tbody tr:hover td{
  background:#FFF7F3;
}

.horas-report-preview-table td:nth-child(3),
.horas-report-preview-table td:nth-child(4),
.horas-report-preview-table td:nth-child(10){
  min-width:180px;
}

.horas-report-preview-table td:nth-child(3){
  min-width:240px;
  text-align:left;
}

.horas-report-preview-table td:nth-child(10){
  min-width:230px;
}

/* Dark mode: la previsualización conserva aspecto de hoja clara,
   pero el chrome del modal respeta el tema de la plataforma. */
html[data-theme="dark"] .horas-report-preview-modal{
  border-color:#2B363C;
  background:#11181C;
  color:#EEF3F5;
}

html[data-theme="dark"] .horas-report-preview-head{
  border-bottom-color:#2B363C;
}

html[data-theme="dark"] .horas-report-preview-head h3{
  color:#EEF3F5;
}

html[data-theme="dark"] .horas-report-preview-head p{
  color:#95A2A9;
}

html[data-theme="dark"] .horas-report-preview-note{
  border-bottom-color:#2B363C;
  background:#0E1519;
  color:#95A2A9;
}

html[data-theme="dark"] .horas-report-preview-table-wrap{
  background:#0B1114;
}

@media(max-width:820px){
  #rrhhHorasView .horas-report-actions{
    width:100%;
  }

  #rrhhHorasView .horas-report-actions>*{
    flex:1 1 100%;
  }

  .horas-report-preview-modal{
    width:calc(100vw - 16px);
    height:calc(100vh - 16px);
    border-radius:12px;
  }

  .horas-report-preview-head{
    flex-direction:column;
    padding:14px;
  }

  .horas-report-preview-head-actions{
    width:100%;
  }

  .horas-report-preview-head-actions .horas-primary-button{
    flex:1;
  }

  .horas-report-preview-note{
    padding:9px 14px;
  }

  .horas-report-preview-table-wrap{
    padding:8px;
  }
}
.horas-actualizacion-mensual{padding:14px 16px;border:1px solid var(--border);border-left:3px solid #FF5C33;border-radius:14px;background:var(--card);box-shadow:0 5px 18px rgba(24,33,38,.045);margin-bottom:12px}
.horas-actualizacion-mensual[hidden]{display:none}
.horas-actualizacion-cabecera{display:flex;align-items:center;justify-content:space-between;gap:16px}
.horas-actualizacion-cabecera h3{margin:0 0 5px;font-size:12px;color:var(--ink)}
.horas-actualizacion-cabecera p{margin:0;font-size:11px;line-height:1.5;color:var(--ink)}
.horas-actualizacion-cabecera button{width:auto;flex-shrink:0}
.horas-actualizacion-mensual small{display:block;margin-top:7px;font-size:10px;line-height:1.5;color:var(--muted)}
.horas-actualizacion-mensual progress{display:block;width:100%;height:7px;margin-top:12px;accent-color:#FF5C33}
.horas-actualizacion-mensual progress[hidden],.horas-actualizacion-mensual button[hidden]{display:none}
.horas-actualizacion-mensual[data-estado="COMPLETADO"]{border-left-color:#12A982}
.horas-actualizacion-mensual[data-estado="ERROR"],.horas-actualizacion-mensual[data-estado="PAUSADO"]{border-left-color:#DF9C23}
@media(max-width:680px){.horas-actualizacion-cabecera{align-items:flex-start;flex-direction:column;gap:10px}.horas-actualizacion-cabecera button{align-self:flex-start}}

/* Acciones de consulta y actualización individual: sólo las tres fuentes editables. */
.horas-section-actions { display: flex; align-items: flex-start; gap: 10px; flex-wrap: wrap; }
.horas-fuente-actualizacion { display: flex; flex-direction: column; gap: 6px; max-width: 330px; }
.horas-fuente-actualizacion small { color: var(--muted); font-size: 11px; line-height: 1.4; }
@media (max-width: 680px) {
  .horas-section-actions, .horas-fuente-actualizacion { width: 100%; max-width: none; }
}

[data-horas-actualizar-fuente]:disabled { opacity: .55; cursor: not-allowed; transform: none; }
