:root{
  --bg:#0b1220;
  --card:#111b2e;
  --stroke:rgba(255,255,255,.10);
  --txt:#f1f4ff;
  --muted:rgba(241,244,255,.78);
  --shadow:rgba(0,0,0,.60);
  --ok:#25d987;
  --bad:#ff5a5a;
  --accent:#8fb4ff;
  --focus:#ffd36a;

  --fz: 18px;
  --fz-sm: 15px;
  --radius: 18px;

  --red:#ff4d4d;
  --redGlow: rgba(255,77,77,.18);
}

*{ box-sizing:border-box; }
html, body{ min-height:100%; }
body{
  margin:0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  font-size: var(--fz);
  line-height: 1.35;
  color:var(--txt);
  background: var(--bg);
}

/* Fondo continuo (no se corta) */
body::before{
  content:"";
  position:fixed;
  inset:0;
  z-index:-1;
  background:
    radial-gradient(1200px 900px at 20% 0%, rgba(143,180,255,.12), transparent 60%),
    radial-gradient(1200px 900px at 80% 0%, rgba(37,217,135,.10), transparent 60%),
    radial-gradient(900px 700px at 50% 100%, rgba(255,77,77,.10), transparent 60%),
    var(--bg);
}

.skip{
  position:absolute; left:-999px; top:auto;
  width:1px; height:1px; overflow:hidden;
}
.skip:focus{
  left:12px; top:12px;
  width:auto; height:auto;
  padding:10px 12px;
  border-radius:12px;
  background:#0a0f1a;
  border:2px solid var(--focus);
  z-index:9999;
}

:focus-visible{
  outline: 3px solid var(--focus);
  outline-offset: 3px;
  border-radius: 12px;
}

.topbar{
  position:sticky; top:0; z-index:50;
  background:rgba(11,18,32,.86);
  backdrop-filter: blur(10px);
  border-bottom:1px solid var(--stroke);
}

.brand{
  display:flex; gap:12px; align-items:center;
  padding:14px 16px;
  max-width:1100px; margin:0 auto;
}

.logo{
  width:44px; height:44px;
  border-radius:14px;
  background:linear-gradient(180deg, rgba(143,180,255,.22), rgba(143,180,255,.06));
  border:1px solid rgba(143,180,255,.30);
  display:grid; place-items:center;
  box-shadow: 0 14px 38px var(--shadow);
}

.title{ font-weight:950; letter-spacing:.2px; }
.subtitle{ font-size: var(--fz-sm); color:var(--muted); }

.wrap{ max-width:1100px; margin:0 auto; padding:14px 14px 28px; }

.card{
  background: linear-gradient(180deg, rgba(255,255,255,.045), rgba(255,255,255,.02));
  border:1px solid var(--stroke);
  border-radius: var(--radius);
  padding:14px;
  box-shadow: 0 18px 50px var(--shadow);
}

h2{ margin:0 0 10px; font-size: 20px; }

.small{ font-size: var(--fz-sm); }
.muted{ color: var(--muted); }

.segmented{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:10px;
  margin-bottom:12px;
}
.seg{
  padding:12px 12px;
  border-radius:14px;
  border:1px solid var(--stroke);
  background:#0a1020;
  color:var(--txt);
  cursor:pointer;
  font-weight:900;
}
.seg i{ margin-right:10px; }
.seg.active{
  border-color: rgba(143,180,255,.7);
  background: rgba(143,180,255,.14);
}

.tankBox{
  margin-top:10px;
  border-top:1px solid var(--stroke);
  padding-top:12px;
}
.tankTitle{
  font-size: var(--fz-sm);
  color: var(--muted);
  margin-bottom:10px;
}

label{
  display:grid;
  gap:8px;
  font-size: var(--fz-sm);
  color: var(--muted);
}

input, select{
  width:100%;
  padding:13px 12px;
  border-radius:14px;
  border:1px solid var(--stroke);
  background:#0a1020;
  color:var(--txt);
  font-size: 17px;
}

.hidden{ display:none !important; }

.btn{
  padding:13px 12px;
  border-radius:14px;
  border:1px solid var(--stroke);
  background:#0a1020;
  color:var(--txt);
  cursor:pointer;
  font-weight:900;
  font-size: 17px;
  white-space:nowrap;
}
.btn.primary{
  border-color: rgba(37,217,135,.55);
  background: rgba(37,217,135,.12);
}
.btn.danger{
  border-color: rgba(255,77,77,.55);
  background: rgba(255,77,77,.10);
}
.btn:active{ transform: translateY(1px); }

.grid{
  display:grid;
  gap:12px;
  margin-top:12px;
}
@media (min-width: 980px){
  .grid{ grid-template-columns: 1fr 1fr; align-items:start; }
}

.grid2{
  display:grid;
  gap:10px;
  grid-template-columns: 1fr;
}
@media (min-width: 720px){
  .grid2{ grid-template-columns: 1fr 1fr; align-items:end; }
}

.summary{
  display:grid;
  gap:12px;
  margin: 10px 0 12px;
}

.sumBlock{
  border:1px solid var(--stroke);
  border-radius:14px;
  padding:12px;
  background: rgba(255,255,255,.02);
}

.sumTop{
  display:flex;
  justify-content:space-between;
  gap:12px;
  flex-wrap:wrap;
  align-items:center;
  margin-bottom:10px;
}

.pill{
  font-size: 14px;
  padding:6px 10px;
  border-radius:999px;
  border:1px solid var(--stroke);
  color: var(--muted);
}

.progressWrap{ display:grid; gap:10px; }
.progressRow{ display:grid; gap:8px; }
.progressLabel{
  display:flex; justify-content:space-between; gap:12px; flex-wrap:wrap;
  font-size: var(--fz-sm);
  color: var(--muted);
}
.progressBar{
  height: 14px;
  border-radius: 999px;
  border:1px solid var(--stroke);
  background: rgba(255,255,255,.04);
  overflow:hidden;
}
.progressFill{
  height:100%;
  width:0%;
  border-radius:999px;
  background: linear-gradient(90deg, rgba(143,180,255,.9), rgba(37,217,135,.85));
  transition: width 700ms cubic-bezier(.2,.8,.2,1);
}

.modeActions{ display:grid; gap:10px; margin-top:10px; }
.actionsRow{
  display:grid;
  gap:10px;
  grid-template-columns: 1fr;
}
@media (min-width: 720px){
  .actionsRow{ grid-template-columns: 1fr 1fr; }
}

/* Calendario “normal” */
.calendar{
  margin-top:12px;
  border:1px solid var(--stroke);
  border-radius:14px;
  overflow:hidden;
}
.calHead{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:10px;
  padding:12px;
  background: rgba(255,255,255,.03);
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.calTitle{
  font-weight:950;
  letter-spacing:.2px;
}
.calGrid{
  display:grid;
  grid-template-columns: repeat(7, 1fr);
}
.calDow{
  font-size: 13px;
  color: var(--muted);
  padding: 10px 8px;
  background: rgba(255,255,255,.02);
  border-bottom: 1px solid rgba(255,255,255,.06);
  text-align:center;
}
.calCell{
  min-height: 62px;
  padding:8px;
  border-right: 1px solid rgba(255,255,255,.05);
  border-bottom: 1px solid rgba(255,255,255,.05);
  position:relative;
  background: rgba(255,255,255,.01);
}
.calCell:nth-child(7n){ border-right:none; }
.calNum{
  font-size: 14px;
  color: rgba(241,244,255,.85);
  font-weight: 800;
}
.calMuted .calNum{ color: rgba(241,244,255,.35); }

/* Día marcado (uso) rojo */
.calUse{
  background: linear-gradient(180deg, rgba(255,77,77,.16), rgba(255,77,77,.06));
  box-shadow: inset 0 0 0 1px rgba(255,77,77,.25);
}
.calUse::after{
  content:"";
  position:absolute;
  right:10px; bottom:10px;
  width:10px; height:10px;
  border-radius:999px;
  background: var(--red);
  box-shadow: 0 0 0 5px var(--redGlow);
}

.toastRegion{
  position: fixed;
  right: 12px;
  top: 70px;
  z-index: 500;
  display:grid;
  gap:10px;
  max-width: 380px;
}
.toast{
  border:1px solid var(--stroke);
  background: rgba(10,16,32,.92);
  border-radius:14px;
  padding: 12px;
  box-shadow: 0 14px 40px rgba(0,0,0,.65);
}
.toast.ok{ border-color: rgba(37,217,135,.5); }
.toast.bad{ border-color: rgba(255,90,90,.55); }
.toastTitle{ font-weight: 950; margin-bottom: 4px; }
.toastMsg{ font-size: var(--fz-sm); color: var(--muted); }

.foot{ margin-top:14px; text-align:center; }

.pill{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:8px 12px;
  border-radius:999px;
  border:1px solid var(--stroke);
  background: rgba(255,255,255,.03);
  color: var(--txt);
  line-height: 1.1;
}

.pill .k{
  color: var(--muted);
  font-weight: 900;
  font-size: 13px;
  letter-spacing: .2px;
}

.pill .v{
  font-weight: 950;
  font-size: 14px;
  color: rgba(241,244,255,.92);
}

/* Para valores largos (ID) */
.pill.break{
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* Para los que deben quedarse en una línea */
.pill.nowrap{
  white-space: nowrap;
}

.modalBackdrop{
  position:fixed; inset:0;
  background: rgba(0,0,0,.55);
  z-index: 200;
}
.modal{
  position:fixed;
  left:0; right:0; bottom:0;
  z-index: 220;
  max-width: 1100px;
  margin: 0 auto;
  background: rgba(17,27,46,.96);
  border:1px solid var(--stroke);
  border-radius: 18px 18px 0 0;
  box-shadow: 0 -18px 50px rgba(0,0,0,.65);
  max-height: 80vh;
  overflow:hidden;
}
.modalHandle{
  width: 50px;
  height: 5px;
  border-radius: 999px;
  background: rgba(255,255,255,.18);
  margin: 10px auto 0;
}
.modalHead{
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.modalTitle{ margin:0; font-size: 18px; }
.modalBody{
  padding: 12px;
  overflow:auto;
  max-height: 68vh;
}
.iconBtn{
  border:1px solid var(--stroke);
  background:#0a1020;
  color:var(--txt);
  border-radius:12px;
  padding:10px 12px;
  cursor:pointer;
}
.filters{
  display:grid;
  gap:10px;
  grid-template-columns: 1fr 1fr 1fr auto;
  align-items:end;
  margin-bottom: 12px;
}
@media (max-width: 900px){
  .filters{ grid-template-columns: 1fr 1fr; }
  .filters button{ grid-column: 1 / -1; }
}
.logContent{ display:grid; gap:10px; }
.logItem{
  border:1px solid var(--stroke);
  border-radius:14px;
  padding:12px;
  background: rgba(255,255,255,.02);
}
.logTop{
  display:flex;
  justify-content:space-between;
  gap:10px;
  flex-wrap:wrap;
}
.logK{ font-size: var(--fz-sm); color: var(--muted); }
