
*{box-sizing:border-box}
:root{
  --navy:#0d4f82;
  --navy-dark:#073b63;
  --blue:#1d67ad;
  --input:#e7f3df;
  --summary:#fffbd4;
  --grid:#9aa4ad;
  --paper:#fff;
  --holiday:#e21d25;
}
body{
  margin:0;
  background:#f4f6f8;
  font-family:Arial,Helvetica,sans-serif;
  color:#111;
}
.sheet-wrap{
  overflow:auto;
  padding:18px 20px 4px;
}
table{
  border-collapse:collapse;
  background:var(--paper);
  margin:auto;
  table-layout:fixed;
  font-size:11px;
  min-width:1180px;
  width:min(1500px,calc(100vw - 40px));
  box-shadow:0 2px 14px #00000018;
}
td{
  border:1px solid #b8c0c7;
  padding:3px 4px;
  vertical-align:middle;
  height:24px;
  overflow:hidden;
}
.logo-cell{
  background:#fff;
  text-align:center;
  vertical-align:middle;
  padding:4px!important;
}
.crest{
  display:block;
  max-width:82px;
  max-height:112px;
  object-fit:contain;
  margin:auto;
}
.title{
  text-align:center;
  background:#fff;
  line-height:1.2;
  padding:6px 10px!important;
}
.title-main{
  font-size:22px;
  font-weight:800;
  color:#111;
  letter-spacing:.3px;
}
.title-secretaria{
  font-size:19px;
  font-weight:800;
  color:#2f6fb2;
  margin-top:2px;
}
.title-sub{
  font-size:12px;
  font-weight:800;
  margin-top:7px;
}
.title-celadores{
  font-size:13px;
  font-weight:800;
  margin-top:3px;
}
.center{text-align:center}.bold{font-weight:700}.label{font-weight:700}
.editable,.time-cell{background:var(--input)}
input,select{
  width:100%;
  height:100%;
  border:0;
  background:transparent;
  font:inherit;
  text-align:center;
  outline:none;
  padding:0;
}
input.wide{text-align:left;padding:0 5px}
.section{
  background:var(--navy-dark);
  color:#fff;
  font-weight:800;
  text-align:center;
  letter-spacing:.15px;
}
.headers td,.subheaders td,.codes td{
  background:var(--navy);
  color:#fff;
  font-weight:800;
  text-align:center;
  line-height:1.05;
}
.codes td{font-size:10px}
.blue-header{background:#d9ecfb!important;color:#111!important}
#controlInicial{
  font-weight:800;
  background:#e7f3df;
  text-align:center;
  color:#111;
}
.day-row td{text-align:center;height:25px}
.day-row .weekday{font-weight:700}
.day-row:nth-child(even) td.calc{background:#fbfcfd}
.holiday-row td{color:var(--holiday);font-weight:700}
.holiday-row select{color:var(--holiday);font-weight:700}
.calc{background:#fff}
.total{
  font-weight:800;
  text-align:center;
  background:var(--navy-dark);
  color:#fff;
}
#totalesRow td{
  background:var(--navy-dark);
  color:#fff;
  font-weight:800;
}
#totalesRow td:first-child{letter-spacing:.3px}
.holiday-total{color:#fff!important}
.weekly{font-weight:800}
.note{
  font-size:9px;
  line-height:1.1;
  background:#fff;
}
.cert{
  text-align:center;
  font-weight:800;
  font-size:9px;
  background:#fff;
}
.summary-value{
  font-weight:800;
  text-align:center;
  background:var(--summary);
}
.compensar-box{
  text-align:center;
  font-size:9px;
  line-height:1.05;
  white-space:normal;
  background:var(--summary);
}
.compensar-box span{display:inline}
.compensar-box strong{display:inline;font-size:12px;margin-left:4px}
.dfl-one{color:#fff!important;font-weight:800!important}
.day-row td:nth-child(16),
.day-row td:nth-child(16).calc,
.holiday-row td:nth-child(16){color:#fff!important}

.page-footer{
  max-width:1500px;
  width:calc(100vw - 40px);
  margin:0 auto 24px;
  background:#fff;
  padding:18px 22px 20px;
  display:flex;
  gap:26px;
  align-items:flex-end;
  justify-content:space-between;
  box-shadow:0 2px 14px #00000012;
}
.conventions{
  flex:1 1 auto;
  display:grid;
  grid-template-columns:repeat(2,minmax(260px,1fr));
  gap:6px 26px;
  font-size:11px;
}
.conventions-title{
  grid-column:1/-1;
  font-weight:800;
  text-decoration:underline;
  margin-bottom:4px;
}
.bottom-actions{
  display:flex;
  gap:22px;
  flex:0 0 auto;
  align-items:flex-end;
}
.action-btn{
  width:150px;
  min-height:82px;
  border:1px solid #304050;
  border-radius:12px;
  color:#fff;
  font-size:17px;
  line-height:1.25;
  font-weight:800;
  cursor:pointer;
  box-shadow:0 3px 6px #0003;
}
.action-btn.calculate{
  background:linear-gradient(#78b84b,#4f8d25);
}
.action-btn.report{
  background:linear-gradient(#4f83cf,#2461a8);
}
.action-btn.download{
  color:#111;
  background:linear-gradient(#ffd525,#f1b900);
}
.action-btn:hover{filter:brightness(1.04)}
.action-btn:active{transform:translateY(1px)}

.cA{width:53px}.cB{width:34px}.cC{width:105px}.cD{width:50px}.cE{width:50px}
.cF{width:62px}.cG{width:68px}.cH{width:72px}.cI{width:77px}.cJ{width:77px}
.cK{width:72px}.cL{width:72px}.cM{width:78px}.cN{width:77px}.cO{width:77px}
.cP{width:82px}.cQ{width:64px}.cR{width:60px}.cS{width:70px}

@media(max-width:900px){
  .page-footer{flex-direction:column;align-items:stretch}
  .bottom-actions{justify-content:flex-end;flex-wrap:wrap}
  .conventions{grid-template-columns:1fr}
}

@media print{
  @page{size:letter portrait;margin:0.12in}
  body{background:#fff}
  .no-print{display:none!important}
  .sheet-wrap{
    padding:0!important;
    overflow:visible!important;
    width:8.26in!important;
    height:10.76in!important;
  }
  table{
    box-shadow:none!important;
    min-width:0!important;
    width:100%!important;
    max-width:100%!important;
    table-layout:fixed!important;
    font-size:5.1px!important;
    line-height:.92!important;
    page-break-inside:avoid!important;
    break-inside:avoid-page!important;
  }
  td,.day-row td{
    height:10.5px!important;
    min-height:0!important;
    max-height:10.5px!important;
    padding:.2px .6px!important;
    line-height:.92!important;
    overflow:hidden!important;
  }
  .crest{max-width:28px!important;max-height:34px!important}
  .title-main{font-size:7px!important}
  .title-secretaria{font-size:6.5px!important}
  .title-sub,.title-celadores{font-size:5px!important;margin-top:1px!important}
  input,select{appearance:none;-webkit-appearance:none;font-size:5px!important;padding:0!important}
  tr,td{page-break-inside:avoid!important;break-inside:avoid-page!important}
}

@media print{
  .logo-cell{
    padding:0!important;
  }
  .crest{
    max-width:28px!important;
    max-height:34px!important;
    width:auto!important;
    height:auto!important;
    margin:0 auto!important;
    object-fit:contain!important;
  }
}

/* Botón DESCANSO dentro de la columna del día */
.weekday-label{
  display:inline-block;
  line-height:1;
}
.rest-btn{
  margin-top:1px;
  padding:1px 3px;
  border:1px solid #8b949e;
  border-radius:3px;
  background:#f3f4f6;
  color:#374151;
  font-size:7px;
  line-height:1;
  cursor:pointer;
  white-space:nowrap;
}
.rest-btn.active{
  background:#6b7280;
  border-color:#4b5563;
  color:#fff;
  font-weight:800;
}
.day-row.rest-day td{
  background:#e5e7eb!important;
  color:#4b5563!important;
}
.day-row.rest-day .weekday-label{
  font-weight:800;
}
.day-row.rest-day select{
  opacity:.55;
}
@media print{
  .rest-btn{display:none!important}
  .day-row.rest-day td{
    background:#e5e7eb!important;
    -webkit-print-color-adjust:exact;
    print-color-adjust:exact;
  }
}

@media print{
  .logo-cell .crest{display:none!important}
  .logo-cell{padding:0!important}
}
