/* SixFive Control — vidrio oscuro sobre una aurora cian y dorada (colores de sixfivelab.com). */
:root {
  --bg: #0d0f11;
  --ink: #f4f6f7;
  --text: #d5dadd;
  --muted: #98a2a8;
  --faint: #6f797f;
  --cyan: #22cbe0;
  --cyan-deep: #00acc1;
  --gold: #ffd54a;
  --rose: #ff6b7d;
  --mint: #58e0a4;
  --glass: rgba(255, 255, 255, 0.055);
  --glass-strong: rgba(255, 255, 255, 0.09);
  --line: rgba(255, 255, 255, 0.12);
  --line-soft: rgba(255, 255, 255, 0.07);
  --shadow: 0 24px 60px -24px rgba(0, 0, 0, 0.75);
  --line-strong: rgba(255, 255, 255, 0.24);
  --well: rgba(0, 0, 0, 0.28);
  --well-focus: rgba(0, 0, 0, 0.4);
  --well-soft: rgba(0, 0, 0, 0.2);
  --row: rgba(255, 255, 255, 0.025);
  --row-hover: rgba(255, 255, 255, 0.06);
  --dot-bg: #14181b;
  --option-bg: #15191c;
  --stroke: rgba(255, 255, 255, 0.45);
  --scrim: rgba(5, 7, 8, 0.6);
  --sheet-bg: linear-gradient(150deg, rgba(40, 48, 53, 0.92), rgba(18, 22, 25, 0.94));
  --toast-bg: rgba(24, 29, 32, 0.9);
  --glass-bg: linear-gradient(145deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.03) 42%, rgba(255, 255, 255, 0.05));
  --glass-inset: inset 0 1px 0 rgba(255, 255, 255, 0.16), inset 0 -1px 0 rgba(0, 0, 0, 0.25);
  --sky: radial-gradient(120% 80% at 50% -10%, #16232a 0%, transparent 60%), linear-gradient(180deg, #0f1214 0%, #0b0d0e 100%);
  --grain: 0.07;
  --orb: 1;
  --rose-ink: #ffc2ca;
  --glow: rgba(34, 203, 224, 0.13);
  --r-lg: 26px;
  --r-md: 16px;
  --r-sm: 11px;
  --display: 'Bricolage Grotesque', 'Inter', system-ui, sans-serif;
  --body: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --spring: cubic-bezier(0.34, 1.4, 0.44, 1);
}

/* Tema claro: mismo vidrio, sobre un cielo de día. */
:root[data-theme='light'] {
  --bg: #e9f0f4;
  --ink: #0c1519;
  --text: #2b3940;
  --muted: #586973;
  --faint: #8493a0;
  --cyan: #0891a5;
  --cyan-deep: #06788a;
  --gold: #b07d00;
  --rose: #d6354b;
  --mint: #0f9d63;
  --glass: rgba(255, 255, 255, 0.5);
  --glass-strong: rgba(255, 255, 255, 0.78);
  --line: rgba(12, 21, 25, 0.13);
  --line-soft: rgba(12, 21, 25, 0.08);
  --line-strong: rgba(12, 21, 25, 0.26);
  --shadow: 0 24px 60px -28px rgba(22, 60, 80, 0.45);
  --well: rgba(255, 255, 255, 0.62);
  --well-focus: rgba(255, 255, 255, 0.9);
  --well-soft: rgba(255, 255, 255, 0.5);
  --row: rgba(255, 255, 255, 0.36);
  --row-hover: rgba(255, 255, 255, 0.72);
  --dot-bg: #f4f8fa;
  --option-bg: #ffffff;
  --stroke: rgba(12, 21, 25, 0.5);
  --scrim: rgba(190, 208, 218, 0.55);
  --sheet-bg: linear-gradient(150deg, rgba(255, 255, 255, 0.95), rgba(238, 245, 248, 0.94));
  --toast-bg: rgba(255, 255, 255, 0.92);
  --glass-bg: linear-gradient(145deg, rgba(255, 255, 255, 0.78), rgba(255, 255, 255, 0.42) 45%, rgba(255, 255, 255, 0.58));
  --glass-inset: inset 0 1px 0 rgba(255, 255, 255, 0.95), inset 0 -1px 0 rgba(12, 21, 25, 0.05);
  --sky: radial-gradient(120% 80% at 50% -10%, #cfeef5 0%, transparent 60%), linear-gradient(180deg, #f2f7f9 0%, #e3ecf1 100%);
  --grain: 0.05;
  --orb: 0.75;
  --rose-ink: #a81f33;
  --glow: rgba(8, 145, 165, 0.12);
  color-scheme: light;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  color-scheme: dark;
  transition: none;
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  transition: background 0.5s var(--ease), color 0.5s var(--ease);
  font: 400 15px/1.5 var(--body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}
button {
  cursor: pointer;
}
h1,
h2,
h3,
p {
  margin: 0;
}
:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
  border-radius: 8px;
}
.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}

/* ---- fondo vivo ------------------------------------------------------ */
.sky {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background: var(--sky);
}
.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: calc(0.55 * var(--orb));
  will-change: transform;
}
.orb-cyan {
  width: 46vmax;
  height: 46vmax;
  left: -12vmax;
  top: -14vmax;
  background: radial-gradient(circle at 35% 35%, #22cbe0, #0a6f80 55%, transparent 72%);
  animation: drift-a 26s var(--ease) infinite alternate;
}
.orb-gold {
  width: 34vmax;
  height: 34vmax;
  right: -8vmax;
  top: 22vh;
  opacity: calc(0.32 * var(--orb));
  background: radial-gradient(circle at 60% 40%, #ffd54a, #b8860b 55%, transparent 72%);
  animation: drift-b 32s var(--ease) infinite alternate;
}
.orb-deep {
  width: 52vmax;
  height: 52vmax;
  left: 28vw;
  bottom: -30vmax;
  opacity: calc(0.4 * var(--orb));
  background: radial-gradient(circle at 50% 50%, #1b4f8f, #0d2440 55%, transparent 72%);
  animation: drift-c 38s var(--ease) infinite alternate;
}
.grain {
  position: absolute;
  inset: 0;
  opacity: var(--grain);
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
@keyframes drift-a {
  to {
    transform: translate3d(14vw, 10vh, 0) scale(1.15);
  }
}
@keyframes drift-b {
  to {
    transform: translate3d(-16vw, -12vh, 0) scale(0.9);
  }
}
@keyframes drift-c {
  to {
    transform: translate3d(-12vw, -8vh, 0) scale(1.1);
  }
}

/* ---- vidrio ---------------------------------------------------------- */
.glass {
  position: relative;
  background: var(--glass-bg);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow:
    var(--shadow),
    var(--glass-inset);
  -webkit-backdrop-filter: blur(26px) saturate(150%);
  backdrop-filter: blur(26px) saturate(150%);
}
.glass::before {
  /* reflejo que sigue al cursor */
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.5s var(--ease);
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 0%), var(--glow), transparent 60%);
}
.glass:hover::before {
  opacity: 1;
}

#app {
  position: relative;
  z-index: 1;
}
.rise {
  animation: rise 0.8s var(--ease) both;
  animation-delay: calc(var(--i, 0) * 70ms);
}
@keyframes rise {
  from {
    opacity: 0;
    transform: translate3d(0, 22px, 0) scale(0.985);
    filter: blur(6px);
  }
}

/* ---- acceso ---------------------------------------------------------- */
.gate {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.gate-card {
  width: min(430px, 100%);
  padding: 38px 34px 30px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font: 800 19px/1 var(--display);
  letter-spacing: -0.02em;
  color: var(--ink);
}
.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font: 800 15px/1 var(--display);
  color: #04262c;
  background: linear-gradient(140deg, var(--cyan), #7ef0ff 55%, var(--gold));
  box-shadow:
    0 8px 24px -8px rgba(34, 203, 224, 0.8),
    inset 0 1px 0 rgba(255, 255, 255, 0.7);
}
.brand small {
  display: block;
  margin-top: 4px;
  font: 500 11px/1 var(--mono);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}
.gate h1 {
  margin: 30px 0 6px;
  font: 700 clamp(28px, 6vw, 34px) / 1.05 var(--display);
  letter-spacing: -0.03em;
  color: var(--ink);
}
.gate .lede {
  color: var(--muted);
  margin-bottom: 24px;
}

/* ---- formularios ----------------------------------------------------- */
.field {
  display: grid;
  gap: 7px;
  margin-bottom: 15px;
}
.field > span {
  font: 500 12px/1 var(--body);
  letter-spacing: 0.04em;
  color: var(--muted);
}
.input,
.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
  background: var(--well);
  color: var(--ink);
  transition:
    border-color 0.25s,
    box-shadow 0.25s,
    background 0.25s;
}
.field textarea {
  resize: vertical;
  min-height: 74px;
}
.field select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position:
    calc(100% - 19px) 52%,
    calc(100% - 14px) 52%;
  background-size:
    5px 5px,
    5px 5px;
  background-repeat: no-repeat;
  padding-right: 36px;
}
.field select option {
  background: var(--option-bg);
}
.field input::placeholder,
.field textarea::placeholder {
  color: var(--faint);
}
.field input:focus,
.field select:focus,
.field textarea:focus,
.input:focus {
  outline: none;
  border-color: rgba(34, 203, 224, 0.75);
  background: var(--well-focus);
  box-shadow: 0 0 0 4px rgba(34, 203, 224, 0.14);
}
.row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.row.three {
  grid-template-columns: 1.3fr 0.9fr 0.8fr;
}
.hint {
  font-size: 12px;
  color: var(--faint);
  margin-top: -6px;
  margin-bottom: 14px;
}
.form-error {
  display: none;
  margin: 2px 0 14px;
  padding: 10px 13px;
  border-radius: var(--r-sm);
  border: 1px solid rgba(255, 107, 125, 0.4);
  background: rgba(255, 107, 125, 0.1);
  color: var(--rose-ink);
  font-size: 13.5px;
}
.form-error.on {
  display: block;
  animation: shake 0.4s var(--ease);
}
@keyframes shake {
  25% {
    transform: translateX(-5px);
  }
  60% {
    transform: translateX(4px);
  }
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 18px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--glass);
  color: var(--ink);
  font-weight: 600;
  font-size: 14px;
  white-space: nowrap;
  transition:
    transform 0.25s var(--spring),
    background 0.25s,
    border-color 0.25s,
    box-shadow 0.25s;
}
.btn:hover {
  background: var(--glass-strong);
  border-color: var(--line-strong);
  transform: translateY(-1px);
}
.btn:active {
  transform: translateY(0) scale(0.97);
}
.btn svg {
  width: 16px;
  height: 16px;
  flex: none;
}
.btn.primary {
  border-color: transparent;
  color: #04262c;
  background: linear-gradient(135deg, #7ef0ff, var(--cyan) 45%, var(--cyan-deep));
  box-shadow:
    0 12px 30px -12px rgba(34, 203, 224, 0.9),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);
}
.btn.primary:hover {
  box-shadow:
    0 16px 36px -12px rgba(34, 203, 224, 1),
    inset 0 1px 0 rgba(255, 255, 255, 0.7);
}
.btn.danger {
  color: var(--rose-ink);
  border-color: rgba(255, 107, 125, 0.35);
}
.btn.danger:hover {
  background: rgba(255, 107, 125, 0.14);
}
.btn.block {
  width: 100%;
  padding: 13px 18px;
}
.btn.small {
  padding: 7px 13px;
  font-size: 13px;
}
.btn[disabled] {
  opacity: 0.55;
  pointer-events: none;
}
.icon-btn {
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  transition:
    background 0.2s,
    color 0.2s,
    border-color 0.2s,
    transform 0.25s var(--spring);
}
.icon-btn:hover {
  color: var(--ink);
  background: var(--glass-strong);
  border-color: var(--line);
  transform: translateY(-1px);
}
.icon-btn svg {
  width: 16px;
  height: 16px;
}

/* ---- armazón --------------------------------------------------------- */
.shell {
  max-width: 1320px;
  margin: 0 auto;
  padding: 22px clamp(16px, 3vw, 34px) 80px;
}
.top {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px 12px 18px;
  border-radius: 999px;
  position: sticky;
  top: 14px;
  z-index: 20;
}
.top .spacer {
  flex: 1;
}
.search {
  position: relative;
  width: min(280px, 34vw);
}
.search svg {
  position: absolute;
  left: 13px;
  top: 50%;
  width: 15px;
  height: 15px;
  transform: translateY(-50%);
  color: var(--faint);
  pointer-events: none;
}
.search input {
  width: 100%;
  padding: 9px 14px 9px 36px;
  border-radius: 999px;
  border: 1px solid var(--line-soft);
  background: var(--well);
  color: var(--ink);
  transition:
    border-color 0.25s,
    box-shadow 0.25s;
}
.search input:focus {
  outline: none;
  border-color: rgba(34, 203, 224, 0.7);
  box-shadow: 0 0 0 4px rgba(34, 203, 224, 0.12);
}
.who {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--line-soft);
  background: transparent;
  font: 500 12px/1 var(--mono);
  color: var(--muted);
  letter-spacing: 0.04em;
  transition:
    color 0.2s,
    border-color 0.2s,
    background 0.2s;
}
.who:hover {
  color: var(--ink);
  border-color: var(--line);
  background: var(--glass-strong);
}
.who svg {
  width: 14px;
  height: 14px;
}

/* ---- portada del mes -------------------------------------------------- */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 22px;
  margin-top: 34px;
  align-items: stretch;
}
.month {
  padding: 30px 32px 28px;
  display: flex;
  flex-direction: column;
  min-height: 268px;
  overflow: hidden;
}
.eyebrow {
  font: 500 11px/1 var(--mono);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--cyan);
}
.month-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
}
.month-name {
  font: 800 clamp(40px, 6.6vw, 78px) / 0.92 var(--display);
  letter-spacing: -0.045em;
  color: var(--ink);
  text-transform: capitalize;
  margin-right: 8px;
}
.month-name em {
  font-style: normal;
  font-weight: 500;
  color: transparent;
  -webkit-text-stroke: 1px var(--stroke);
}
.month-name.swap {
  animation: swap 0.55s var(--ease);
}
@keyframes swap {
  from {
    opacity: 0;
    transform: translateY(14px);
    filter: blur(8px);
  }
}
.progress {
  margin-top: auto;
  padding-top: 26px;
}
.progress-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  color: var(--muted);
  font-size: 13.5px;
  margin-bottom: 10px;
}
.progress-meta strong {
  color: var(--ink);
  font: 700 15px/1 var(--mono);
}
.bar {
  height: 10px;
  border-radius: 999px;
  background: var(--well);
  border: 1px solid var(--line-soft);
  overflow: hidden;
}
.bar i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--cyan-deep), var(--cyan) 60%, var(--gold));
  box-shadow: 0 0 18px rgba(34, 203, 224, 0.7);
  transition: width 1.1s var(--ease);
}

.tiles {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.tile {
  padding: 20px 22px;
  border-radius: 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 126px;
}
.tile-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--muted);
}
.tile-label i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 12px currentColor;
  color: var(--cyan);
}
.tile.gold .tile-label i {
  background: var(--gold);
  color: var(--gold);
}
.tile.rose .tile-label i {
  background: var(--rose);
  color: var(--rose);
}
.tile.mint .tile-label i {
  background: var(--mint);
  color: var(--mint);
}
.tile.rose.alert .tile-label i {
  animation: pulse 1.6s ease-in-out infinite;
}
@keyframes pulse {
  50% {
    transform: scale(1.7);
    opacity: 0.4;
  }
}
.tile-value {
  margin-top: auto;
  font: 700 clamp(21px, 2.3vw, 29px) / 1.05 var(--mono);
  letter-spacing: -0.03em;
  color: var(--ink);
}
.tile-value + .tile-value {
  margin-top: 0;
  font-size: clamp(15px, 1.5vw, 18px);
  color: var(--muted);
}
.tile-value.dim {
  color: var(--faint);
}

/* ---- riel de días ----------------------------------------------------- */
.rail-card {
  margin-top: 22px;
  padding: 22px 26px 20px;
}
.section-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.section-head h2 {
  font: 700 19px/1.1 var(--display);
  letter-spacing: -0.02em;
  color: var(--ink);
}
.section-head .count {
  font: 500 12px/1 var(--mono);
  color: var(--muted);
  padding: 5px 9px;
  border-radius: 999px;
  border: 1px solid var(--line-soft);
}
.section-head .spacer {
  flex: 1;
}
.rail {
  position: relative;
  display: grid;
  grid-template-columns: repeat(var(--days, 30), minmax(0, 1fr));
  align-items: end;
  height: 92px;
  padding-bottom: 24px;
}
.rail::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 23px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--line) 8%, var(--line) 92%, transparent);
}
.day {
  position: relative;
  display: flex;
  flex-direction: column-reverse;
  align-items: center;
  gap: 4px;
  height: 100%;
  padding-bottom: 6px;
}
.day > span {
  position: absolute;
  bottom: -22px;
  font: 500 10px/1 var(--mono);
  color: var(--faint);
}
.day:nth-child(even) > span {
  opacity: 0;
}
.day.has > span,
.day.today > span {
  opacity: 1;
  color: var(--text);
}
.day.today > span {
  color: var(--cyan);
  font-weight: 700;
}
.day.today::before {
  content: '';
  position: absolute;
  bottom: 0;
  top: -6px;
  width: 1px;
  background: linear-gradient(180deg, transparent, rgba(34, 203, 224, 0.75));
}
.dot {
  position: relative;
  z-index: 1;
  width: 12px;
  height: 12px;
  padding: 0;
  border-radius: 50%;
  border: 2px solid var(--muted);
  background: var(--dot-bg);
  transition:
    transform 0.3s var(--spring),
    box-shadow 0.3s;
  animation: pop 0.6s var(--spring) both;
  animation-delay: calc(var(--i, 0) * 28ms + 250ms);
}
.dot:hover {
  transform: scale(1.55);
}
.dot.paid {
  border-color: var(--mint);
  background: var(--mint);
  box-shadow: 0 0 12px rgba(88, 224, 164, 0.7);
}
.dot.late {
  border-color: var(--rose);
  background: var(--rose);
  box-shadow: 0 0 14px rgba(255, 107, 125, 0.85);
}
.dot.soon {
  border-color: var(--gold);
  box-shadow: 0 0 12px rgba(255, 213, 74, 0.6);
}
.dot.hit {
  animation: hit 0.9s var(--spring);
}
@keyframes pop {
  from {
    opacity: 0;
    transform: scale(0) translateY(10px);
  }
}
@keyframes hit {
  40% {
    transform: scale(2.1);
  }
}
.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 16px;
  font-size: 12px;
  color: var(--muted);
}
.legend span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.legend .dot {
  animation: none;
  width: 10px;
  height: 10px;
  pointer-events: none;
}

/* ---- columnas --------------------------------------------------------- */
.cols {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: 22px;
  margin-top: 22px;
  align-items: start;
}
.panel {
  padding: 24px 24px 18px;
}
.list {
  display: grid;
  gap: 8px;
}
.due {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 14px;
  padding: 12px 14px 12px 12px;
  border-radius: var(--r-md);
  border: 1px solid transparent;
  background: var(--row);
  transition:
    background 0.25s,
    border-color 0.25s,
    transform 0.35s var(--ease);
}
.due:hover {
  background: var(--row-hover);
  border-color: var(--line-soft);
  transform: translateX(3px);
}
.due.flash {
  animation: flash 0.9s var(--ease);
}
@keyframes flash {
  0% {
    background: rgba(34, 203, 224, 0.28);
  }
}
.date {
  width: 54px;
  height: 54px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 2px;
  border: 1px solid var(--line);
  background: var(--well);
}
.date b {
  font: 700 19px/1 var(--mono);
  color: var(--ink);
}
.date small {
  font: 500 9.5px/1 var(--mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.due.late .date {
  border-color: rgba(255, 107, 125, 0.5);
  background: rgba(255, 107, 125, 0.1);
}
.due.soon .date {
  border-color: rgba(255, 213, 74, 0.45);
}
.due.paid .date {
  border-color: rgba(88, 224, 164, 0.4);
}
.due-main {
  min-width: 0;
}
.due-main strong {
  display: block;
  color: var(--ink);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.due-main span {
  display: block;
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.due.paid .due-main strong {
  color: var(--muted);
}
.money {
  font: 700 15px/1.1 var(--mono);
  color: var(--ink);
  text-align: right;
  white-space: nowrap;
}
.money small {
  display: block;
  margin-top: 5px;
  font: 500 11px/1 var(--body);
  color: var(--muted);
}
.money small.late {
  color: var(--rose);
}
.money small.soon {
  color: var(--gold);
}
.money small.paid {
  color: var(--mint);
}
.check {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1.5px solid var(--line);
  background: var(--well);
  display: grid;
  place-items: center;
  color: transparent;
  transition:
    transform 0.3s var(--spring),
    border-color 0.25s,
    background 0.25s,
    color 0.25s,
    box-shadow 0.25s;
}
.check svg {
  width: 18px;
  height: 18px;
}
.check:hover {
  border-color: var(--mint);
  color: rgba(88, 224, 164, 0.6);
  transform: scale(1.08);
}
.check.on {
  border-color: transparent;
  color: #053321;
  background: linear-gradient(135deg, #9af5cb, var(--mint));
  box-shadow: 0 8px 22px -8px rgba(88, 224, 164, 0.9);
}
.check.on svg path {
  stroke-dasharray: 24;
  stroke-dashoffset: 24;
  animation: draw 0.45s var(--ease) 0.05s forwards;
}
@keyframes draw {
  to {
    stroke-dashoffset: 0;
  }
}

/* ---- clientes --------------------------------------------------------- */
.client {
  border-radius: var(--r-md);
  border: 1px solid var(--line-soft);
  background: var(--row);
  padding: 15px 15px 11px;
  transition:
    border-color 0.25s,
    background 0.25s;
}
.client:hover {
  border-color: var(--line);
  background: var(--row-hover);
}
.client-head {
  display: flex;
  align-items: center;
  gap: 12px;
}
.avatar {
  width: 40px;
  height: 40px;
  flex: none;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font: 800 14px/1 var(--display);
  color: var(--ink);
  border: 1px solid var(--line);
  background: linear-gradient(140deg, hsl(var(--hue, 188) 70% 42% / 0.55), hsl(calc(var(--hue, 188) + 50) 70% 30% / 0.35));
}
.client-head h3 {
  font: 600 15.5px/1.2 var(--body);
  color: var(--ink);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.client-head p {
  font-size: 12.5px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.client-head .grow {
  flex: 1;
  min-width: 0;
}
.client-actions {
  display: flex;
  gap: 2px;
  opacity: 0.55;
  transition: opacity 0.2s;
}
.client:hover .client-actions,
.client:focus-within .client-actions {
  opacity: 1;
}
.apps {
  margin-top: 12px;
  display: grid;
  gap: 4px;
}
.app-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  padding: 8px 6px 8px 12px;
  border-radius: 11px;
  border-left: 2px solid rgba(34, 203, 224, 0.5);
  background: var(--well-soft);
}
.app-row.off {
  border-left-color: var(--faint);
  opacity: 0.6;
}
.app-row b {
  font-weight: 500;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.app-row a {
  color: inherit;
  text-decoration: none;
}
.app-row a:hover {
  color: var(--cyan);
}
.app-row .fee {
  font: 500 12.5px/1 var(--mono);
  color: var(--muted);
  white-space: nowrap;
}
.app-row .fee em {
  font-style: normal;
  color: var(--faint);
}
.add-app {
  margin-top: 6px;
  width: 100%;
  padding: 8px;
  border-radius: 11px;
  border: 1px dashed var(--line);
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  transition:
    color 0.2s,
    border-color 0.2s,
    background 0.2s;
}
.add-app:hover {
  color: var(--cyan);
  border-color: rgba(34, 203, 224, 0.6);
  background: rgba(34, 203, 224, 0.06);
}
.empty {
  padding: 34px 16px 30px;
  text-align: center;
  color: var(--muted);
}
.empty strong {
  display: block;
  font: 700 18px/1.2 var(--display);
  color: var(--ink);
  margin-bottom: 6px;
}
.empty .btn {
  margin-top: 16px;
}

/* ---- diálogos --------------------------------------------------------- */
dialog {
  width: min(520px, calc(100vw - 28px));
  max-height: calc(100dvh - 28px);
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  overflow: visible;
}
dialog::backdrop {
  background: var(--scrim);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  animation: fade 0.3s ease both;
}
dialog[open] .sheet {
  animation: sheet 0.5s var(--spring) both;
}
dialog.closing .sheet {
  animation: sheet-out 0.2s ease forwards;
}
dialog.closing::backdrop {
  animation: fade 0.2s ease reverse forwards;
}
.sheet {
  padding: 28px 28px 24px;
  max-height: calc(100dvh - 28px);
  overflow-y: auto;
  background: var(--sheet-bg);
}
.sheet h2 {
  font: 700 24px/1.1 var(--display);
  letter-spacing: -0.025em;
  color: var(--ink);
  margin-bottom: 6px;
}
.sheet .lede {
  color: var(--muted);
  margin-bottom: 20px;
  font-size: 14px;
}
.sheet-actions {
  display: flex;
  gap: 10px;
  margin-top: 8px;
}
.sheet-actions .spacer {
  flex: 1;
}
.seg {
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 4px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
  background: var(--well);
  position: relative;
}
.seg label {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 8px 6px;
  border-radius: 8px;
  font: 600 13px/1.2 var(--mono);
  color: var(--muted);
  cursor: pointer;
  transition: color 0.25s;
}
.seg input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.seg label:has(input:checked) {
  color: #04262c;
}
.seg::before {
  content: '';
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 4px;
  width: calc(50% - 4px);
  border-radius: 8px;
  background: linear-gradient(135deg, #7ef0ff, var(--cyan));
  transition: transform 0.4s var(--spring);
}
.seg:has(label:last-child input:checked)::before {
  transform: translateX(100%);
}
.seg label:has(input:focus-visible) {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}
.switch {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 15px;
  cursor: pointer;
  color: var(--text);
  font-size: 14px;
}
.switch input {
  appearance: none;
  width: 42px;
  height: 24px;
  flex: none;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--well);
  position: relative;
  cursor: pointer;
  transition: background 0.25s;
}
.switch input::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--muted);
  transition:
    transform 0.35s var(--spring),
    background 0.25s;
}
.switch input:checked {
  background: rgba(34, 203, 224, 0.3);
  border-color: rgba(34, 203, 224, 0.6);
}
.switch input:checked::after {
  transform: translateX(18px);
  background: var(--cyan);
}
@keyframes fade {
  from {
    opacity: 0;
  }
}
@keyframes sheet {
  from {
    opacity: 0;
    transform: translateY(26px) scale(0.95);
  }
}
@keyframes sheet-out {
  to {
    opacity: 0;
    transform: translateY(12px) scale(0.97);
  }
}

/* ---- avisos ----------------------------------------------------------- */
.toasts {
  position: fixed;
  z-index: 60;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  display: grid;
  gap: 8px;
  justify-items: center;
  pointer-events: none;
}
.toast {
  padding: 11px 18px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--toast-bg);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  color: var(--ink);
  font-size: 14px;
  box-shadow: var(--shadow);
  animation: toast-in 0.45s var(--spring) both;
}
.toast.bad {
  border-color: rgba(255, 107, 125, 0.5);
  color: var(--rose-ink);
}
.toast.out {
  animation: toast-out 0.3s ease forwards;
}
@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.92);
  }
}
@keyframes toast-out {
  to {
    opacity: 0;
    transform: translateY(10px);
  }
}

/* ---- pantallas angostas ---------------------------------------------- */
@media (max-width: 1020px) {
  .hero,
  .cols {
    grid-template-columns: minmax(0, 1fr);
  }
  .month {
    min-height: 0;
  }
}
@media (max-width: 640px) {
  .shell {
    padding-top: 14px;
  }
  .top {
    flex-wrap: wrap;
    border-radius: 22px;
    padding: 12px;
    position: static;
  }
  .search {
    order: 5;
    width: 100%;
  }
  .who {
    padding: 0;
    width: 36px;
    height: 36px;
    justify-content: center;
    flex: none;
  }
  .who span {
    display: none;
  }
  .month {
    padding: 24px 22px;
  }
  .month-nav {
    flex-wrap: wrap;
  }
  .tile {
    padding: 16px;
    min-height: 108px;
  }
  .rail-card,
  .panel {
    padding: 20px 16px 16px;
  }
  .rail {
    overflow-x: auto;
    grid-template-columns: repeat(var(--days, 30), 22px);
  }
  .due {
    grid-template-columns: 46px minmax(0, 1fr) auto;
    gap: 10px;
  }
  .due .money {
    grid-column: 2;
    text-align: left;
  }
  .due .money small {
    display: inline;
    margin-left: 8px;
  }
  .due .check {
    grid-column: 3;
    grid-row: 1 / span 2;
  }
  .date {
    width: 46px;
    height: 46px;
  }
  .row,
  .row.three {
    grid-template-columns: 1fr;
  }
  .sheet {
    padding: 22px 18px 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---- ajustes del tema claro ------------------------------------------ */
:root[data-theme='light'] .orb-deep {
  background: radial-gradient(circle at 50% 50%, #8fc4ff, #c7dcff 55%, transparent 72%);
}
:root[data-theme='light'] .orb-gold {
  background: radial-gradient(circle at 60% 40%, #ffe08a, #ffd08a 55%, transparent 72%);
}
:root[data-theme='light'] .orb-cyan {
  background: radial-gradient(circle at 35% 35%, #7fe6f5, #9fdcec 55%, transparent 72%);
}
:root[data-theme='light'] .date b,
:root[data-theme='light'] .avatar {
  color: var(--ink);
}
:root[data-theme='light'] .avatar {
  background: linear-gradient(140deg, hsl(var(--hue, 188) 75% 62% / 0.6), hsl(calc(var(--hue, 188) + 50) 75% 72% / 0.45));
}
:root[data-theme='light'] .bar i {
  box-shadow: 0 0 14px rgba(8, 145, 165, 0.45);
}
:root[data-theme='light'] .dot.soon {
  background: #fff3c4;
}
.theme-toggle svg {
  transition: transform 0.6s var(--spring);
}
.theme-toggle:hover svg {
  transform: rotate(40deg);
}
.gate .theme-toggle {
  position: fixed;
  top: 18px;
  right: 18px;
}

/* ---- pantallas muy angostas y táctiles -------------------------------- */
@media (max-width: 400px) {
  .tiles {
    grid-template-columns: minmax(0, 1fr);
  }
  .month-name {
    font-size: 38px;
  }
  .gate-card {
    padding: 28px 20px 22px;
  }
  .sheet-actions {
    flex-wrap: wrap;
  }
}
@media (hover: none) {
  .client-actions {
    opacity: 1;
  }
  .icon-btn {
    width: 40px;
    height: 40px;
  }
  .due:hover {
    transform: none;
  }
}
@media (min-width: 1021px) and (max-width: 1180px) {
  .tile-value {
    font-size: 20px;
  }
}

@media (max-width: 640px) {
  .top {
    flex-wrap: nowrap;
    gap: 8px;
  }
  .top .search {
    display: none;
  }
  .top-search {
    display: block;
    margin-top: 12px;
  }
  .top-search .search {
    width: 100%;
  }
  .top .icon-btn {
    width: 36px;
    height: 36px;
    flex: none;
  }
  .rail {
    scroll-snap-type: x proximity;
    scrollbar-width: none;
  }
  .rail::-webkit-scrollbar {
    display: none;
  }
}
@media (min-width: 641px) {
  .top-search {
    display: none;
  }
}
@media (max-width: 430px) {
  .add-client span {
    display: none;
  }
  .add-client {
    padding: 9px 11px;
  }
}

/* ---- acceso: detalles -------------------------------------------------- */
.with-eye {
  position: relative;
}
.with-eye input {
  padding-right: 46px;
}
.with-eye .eye {
  position: absolute;
  right: 5px;
  top: 50%;
  translate: 0 -50%;
}
.with-eye .eye:hover {
  transform: none;
}
.caps {
  display: none;
  font-size: 12px;
  color: var(--gold);
}
.caps.on {
  display: block;
  animation: fade 0.25s ease both;
}
.code {
  font: 700 26px/1 var(--mono) !important;
  letter-spacing: 0.42em;
  text-align: center;
  padding: 14px 8px 14px 18px !important;
}
.step[hidden] {
  display: none;
}
.step:not([hidden]) {
  animation: step-in 0.45s var(--ease) both;
}
@keyframes step-in {
  from {
    opacity: 0;
    transform: translateX(14px);
  }
}
.link {
  padding: 0;
  border: 0;
  background: none;
  color: var(--cyan);
  font-size: 13px;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: transparent;
  transition: text-decoration-color 0.2s;
}
.link:hover {
  text-decoration-color: currentColor;
}
.step .link {
  margin: -4px 0 14px;
}
.fineprint {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 20px;
  font-size: 12px;
  color: var(--faint);
}
.fineprint svg {
  width: 14px;
  height: 14px;
  flex: none;
}
.gate-card.leave {
  animation: leave 0.34s var(--ease) forwards;
}
@keyframes leave {
  to {
    opacity: 0;
    transform: translateY(-14px) scale(0.97);
    filter: blur(6px);
  }
}
/* botón ocupado: el texto cede el lugar a un aro que gira */
.btn.loading {
  position: relative;
  opacity: 1;
}
.btn.loading > * {
  visibility: hidden;
}
.btn.loading::after {
  content: '';
  position: absolute;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-right-color: transparent;
  animation: spin 0.7s linear infinite;
}
@keyframes spin {
  to {
    rotate: 360deg;
  }
}

/* ---- cuenta y equipo --------------------------------------------------- */
.account h3 {
  margin: 22px 0 12px;
  padding-top: 18px;
  border-top: 1px solid var(--line-soft);
  font: 700 15px/1.2 var(--display);
  letter-spacing: -0.01em;
  color: var(--ink);
}
.account .hint {
  margin: 0 0 10px;
}
.account form > .btn {
  margin-top: -2px;
}
.account form.inline {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}
.account form.inline .code {
  font-size: 20px !important;
  padding: 10px 6px 10px 14px !important;
}
.state {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 12px;
  font-size: 13.5px;
  color: var(--muted);
}
.state.on {
  color: var(--mint);
}
.state svg {
  width: 17px;
  height: 17px;
  flex: none;
  margin-top: 1px;
}
.secret {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  padding: 10px 8px 10px 14px;
  border-radius: var(--r-sm);
  border: 1px dashed var(--line);
  background: var(--well);
}
.secret code {
  flex: 1;
  font: 700 14px/1.5 var(--mono);
  letter-spacing: 0.06em;
  color: var(--ink);
  word-break: break-word;
  user-select: all;
}
.team {
  display: grid;
  gap: 6px;
  margin-bottom: 14px;
}
.member {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 8px 8px 10px;
  border-radius: var(--r-sm);
  background: var(--row);
}
.member .avatar {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  font-size: 12px;
}
.member .grow {
  flex: 1;
  min-width: 0;
}
.member b {
  display: block;
  font-weight: 600;
  color: var(--ink);
}
.member small {
  display: block;
  font-size: 12px;
  color: var(--muted);
}

/* ---- transiciones entre estados (donde el navegador las soporta) ------- */
::view-transition-group(*) {
  animation-duration: 0.45s;
  animation-timing-function: cubic-bezier(0.22, 1, 0.36, 1);
}
::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 0.25s;
}

/* ---- nada se sale del ancho de la pantalla ------------------------------ */
.list,
.apps,
.team,
.tiles {
  grid-template-columns: minmax(0, 1fr);
}
.tiles {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.panel,
.rail-card,
.month,
.tile,
.client,
.due,
.app-row,
.member,
.sheet {
  min-width: 0;
}
.section-head {
  flex-wrap: wrap;
  row-gap: 8px;
}
.section-head h2 {
  min-width: 0;
}
.tile-value {
  overflow-wrap: anywhere;
}
@media (max-width: 400px) {
  .tiles {
    grid-template-columns: minmax(0, 1fr);
  }
}
@media (max-width: 640px) {
  .client {
    padding: 13px 12px 10px;
  }
  .client-head {
    gap: 10px;
  }
  .app-row {
    grid-template-columns: minmax(0, 1fr) auto;
    row-gap: 2px;
    padding: 8px 4px 8px 10px;
  }
  .app-row b {
    grid-column: 1;
  }
  .app-row .fee {
    grid-column: 1;
    grid-row: 2;
    white-space: normal;
  }
  .app-row .icon-btn {
    grid-column: 2;
    grid-row: 1 / span 2;
  }
  .month-name {
    font-size: clamp(34px, 11vw, 52px);
    overflow-wrap: anywhere;
  }
  .account form.inline {
    grid-template-columns: minmax(0, 1fr);
  }
}
@media (max-width: 350px) {
  .top .brand > div {
    display: none;
  }
  .shell {
    padding-left: 12px;
    padding-right: 12px;
  }
}
