/* ============ Módulo Ralentí ============ */
.ral-grid { display: grid; gap: 16px; grid-template-columns: 1fr 1fr; margin-top: 18px; }
.ral-grid > :first-child { grid-column: 1 / -1; }
.ral-card { background: #fff; border: 1px solid var(--g200); border-radius: 12px;
            padding: 16px 18px; box-shadow: 0 1px 2px rgba(0,0,0,.03); }
.ral-card-ttl { font-weight: 700; font-size: 14.5px; margin-bottom: 12px; color: var(--g700); }

.ral-bd details { border-bottom: 1px solid var(--g100); padding: 6px 0; }
.ral-bd details:last-of-type { border-bottom: none; }
.ral-bd summary { display: grid; grid-template-columns: minmax(180px,1.4fr) 2fr auto auto;
                  gap: 14px; align-items: center; padding: 10px 6px; cursor: pointer;
                  list-style: none; user-select: none; }
.ral-bd summary::-webkit-details-marker { display: none; }
.ral-bd summary::before { content: "▸"; color: var(--g400); margin-right: 4px;
                          transition: transform .15s; display: inline-block; }
.ral-bd details[open] > summary::before { transform: rotate(90deg); }
.ral-pl-name { font-weight: 700; font-size: 14px; color: var(--g700); }
.ral-pl-h    { font-weight: 800; font-size: 14.5px; color: #1e293b; text-align: right; }
.ral-pl-sub  { font-size: 12px; color: var(--g400); text-align: right; }
.ral-bar     { display: block; height: 8px; background: var(--g100); border-radius: 4px; overflow: hidden; }
.ral-bar-in  { display: block; height: 100%; background: linear-gradient(90deg,#3b82f6,#06b6d4); border-radius: 4px; }

.ral-nota    { background: #fffbeb; border: 1px solid #fcd34d; border-radius: 8px;
               padding: 9px 12px; margin: 4px 0 12px; font-size: 12.5px;
               color: #92400e; line-height: 1.45; }

/* ---- tabla del desglose: TOTAL | ☀️ DIURNO | 🌙 NOCTURNO ---- */
.ral-tblwrap { overflow-x: auto; margin: 4px 0 12px; padding-left: 22px; }
.ral-tbl     { border-collapse: collapse; width: 100%; min-width: 900px; font-size: 12.5px; }
.ral-tbl th, .ral-tbl td { padding: 5px 8px; border: 1px solid var(--g200); white-space: nowrap; }
.ral-tbl thead .g th { font-size: 11.5px; letter-spacing: .04em; text-align: center;
                       font-weight: 800; padding: 5px 8px; }
.ral-tbl thead .s th { font-size: 11px; font-weight: 700; text-align: right; color: var(--g700); }
.ral-tbl thead .lbl  { text-align: left; vertical-align: bottom; color: var(--g700);
                       font-size: 12px; background: var(--g50); }
.ral-tbl .gt { background: #eef2ff; color: #3730a3; }
.ral-tbl .gc { background: #fef3c7; color: #92400e; vertical-align: bottom;
               text-align: right; font-size: 11px; }
.ral-tbl .gd { background: #fef3c7; color: #92400e; }
.ral-tbl .gn { background: #e0e7ff; color: #3730a3; }
.ral-tbl tbody td { text-align: right; color: var(--g700); }
.ral-tbl tbody td.lbl { text-align: left; font-weight: 600; color: var(--g700); }
.ral-tbl tbody td.lbl.sub { padding-left: 26px; font-weight: 500; color: var(--g500); }
.ral-tbl tbody td.h  { font-weight: 700; color: #1e293b; }
.ral-tbl tbody td.av { font-weight: 700; }
.ral-tbl tbody tr.pd td { background: #f5f6ff; font-weight: 700; }
.ral-tbl tbody tr.pd td.h { color: #1e1b4b; }
.ral-tbl tbody tr:not(.pd):hover td { background: var(--g50); }
/* franjas suaves para no perder el bloque al leer a lo ancho */
.ral-tbl tbody td.cd { background: #fffbeb; }
.ral-tbl tbody tr.pd td.cd { background: #fef3c7; }
.ral-tbl tbody td.cn { background: #f5f3ff; }
.ral-tbl tbody tr.pd td.cn { background: #e9e5ff; }
/* bloque de costo: separado con un borde para que no se lea como parte del nocturno */
.ral-tbl tbody td.cc { background: #fffdf5; border-left-color: var(--g300); }
.ral-tbl tbody tr.pd td.cc { background: #fef9e7; }
.ral-tbl thead .gc:first-of-type { border-left-color: var(--g300); }

/* ---- panel de costos de combustible ---- */
.ral-cost-tbl { border-collapse: collapse; margin: 4px 0 12px; font-size: 13px; }
.ral-cost-tbl th, .ral-cost-tbl td { border: 1px solid var(--g200); padding: 7px 12px;
                                     text-align: right; white-space: nowrap; }
.ral-cost-tbl th { background: var(--g50); font-size: 11.5px; font-weight: 700;
                   color: var(--g700); letter-spacing: .02em; }
.ral-cost-tbl th.cmb, .ral-cost-tbl td.cmb { text-align: left; font-weight: 600; }
.ral-cost-tbl td.chk { text-align: center; }
.ral-cost-tbl input[type="number"] { width: 92px; padding: 5px 8px; text-align: right;
                                     border: 1px solid var(--g200); border-radius: 6px;
                                     font-size: 13px; font-family: inherit; }
.ral-cost-tbl input[type="number"]:focus { outline: 2px solid var(--blue); outline-offset: 1px; }
.ral-cost-tbl td.perh { font-weight: 700; color: #92400e; background: #fffdf5; }
.ral-cost-tbl tr.nuevo td.cmb { color: #92400e; }
.ral-cost-tbl .tag { display: inline-block; margin-left: 6px; padding: 1px 6px;
                     background: #fef3c7; color: #92400e; border-radius: 3px;
                     font-size: 10.5px; font-weight: 700; letter-spacing: .03em; }
.ral-cost-acts { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

.ral-top-row { display: grid; grid-template-columns: 28px 70px 1fr 80px 80px;
               gap: 10px; align-items: center; padding: 8px 6px;
               border-bottom: 1px solid var(--g100); font-size: 13px; }
.ral-top-row:last-child { border-bottom: none; }
.ral-top-rk  { font-weight: 800; color: var(--g400); text-align: center; }
.ral-top-cr  { font-weight: 700; color: var(--g700); }
.ral-top-meta { color: var(--g500); font-size: 11.5px; line-height: 1.3; }
.ral-top-bar { height: 6px; background: var(--g100); border-radius: 3px; overflow: hidden; }
.ral-top-bar-in { display: block; height: 100%; border-radius: 3px; }
.ral-top-h   { font-weight: 800; text-align: right; font-size: 13px; }

/* ---- selector de semanas del histórico: dropdown de checkboxes ---- */
.ral-msel { position: relative; display: inline-block; min-width: 190px; }
.ral-msel-btn { width: 100%; padding: 8px 12px; border: 1px solid var(--g200); border-radius: 8px;
                font-size: 13px; font-weight: 600; cursor: pointer; background: #fff; color: var(--g700);
                display: flex; align-items: center; justify-content: space-between; gap: 8px;
                text-align: left; font-family: inherit; }
.ral-msel-btn:hover { border-color: var(--blue); }
.ral-msel.open .ral-msel-btn { border-color: var(--blue); }
.ral-msel-car { color: var(--g400); font-size: 11px; transition: transform .15s; }
.ral-msel.open .ral-msel-car { transform: rotate(180deg); }
.ral-msel-panel { display: none; position: absolute; z-index: 20; top: calc(100% + 4px); left: 0;
                  min-width: 260px; max-height: 280px; overflow-y: auto; background: #fff;
                  border: 1px solid var(--g200); border-radius: 10px;
                  box-shadow: 0 8px 24px rgba(0,0,0,.12); padding: 6px; }
.ral-msel.open .ral-msel-panel { display: block; }
.ral-msel-opt { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 6px;
                font-size: 13px; color: var(--g700); cursor: pointer; white-space: nowrap; }
.ral-msel-opt:hover { background: var(--g50); }
.ral-msel-opt input { margin: 0; }
.ral-msel-all { border-bottom: 1px solid var(--g100); margin-bottom: 4px; padding-bottom: 8px; font-weight: 700; }
.ral-msel-list { display: flex; flex-direction: column; }
.ral-msel-empty { display: block; padding: 8px; font-size: 12.5px; color: var(--g400); }

@media (max-width: 900px) {
  .ral-grid { grid-template-columns: 1fr; }
  .ral-tblwrap { padding-left: 0; }
  .ral-top-row { grid-template-columns: 24px 60px 1fr 70px; }
  .ral-top-bar { display: none; }
}
