:root {
  --frame: #5b3fa8;
  --frame-dark: #4b328f;
  --white: #ffffff;
  --panel: #fbf8ff;
  --ink: #2b2238;
  --muted: #81738f;
  --line: rgba(91, 63, 168, 0.13);
  --fany: #f9bed7;
  --fany-strong: #dd6fa4;
  --christell: #cdbbff;
  --christell-strong: #6e55c7;
  --janecita: #bdeed2;
  --janecita-strong: #2c9565;
  --gold: #ffd778;
  --danger: #c43d73;
  --shadow: 0 18px 45px rgba(44, 27, 91, 0.18);
  --soft-shadow: 0 12px 30px rgba(63, 43, 125, 0.10);
  --glow-fany: 0 0 26px rgba(249, 190, 215, 0.72);
  --glow-christell: 0 0 28px rgba(205, 187, 255, 0.76);
  --glow-janecita: 0 0 26px rgba(189, 238, 210, 0.70);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--frame);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 18% 16%, rgba(249, 190, 215, 0.44), transparent 28%),
    radial-gradient(circle at 78% 10%, rgba(189, 238, 210, 0.34), transparent 28%),
    linear-gradient(160deg, var(--frame), var(--frame-dark));
  font-family: Arial, Helvetica, sans-serif;
}

a {
  color: inherit;
  text-decoration: none;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  gap: 14px;
  padding: 18px 16px 16px;
  color: var(--white);
  background: linear-gradient(150deg, rgba(91, 63, 168, 0.96), rgba(75, 50, 143, 0.96));
  box-shadow: 0 16px 40px rgba(38, 22, 88, 0.24);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  font-weight: 900;
}

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 8px;
  color: var(--frame-dark);
  background: linear-gradient(135deg, var(--gold), var(--fany));
  box-shadow: var(--glow-fany);
}

.nav {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  font-size: 0.78rem;
}

.nav a {
  display: grid;
  min-height: 42px;
  place-items: center;
  padding: 0 6px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.10);
  color: rgba(255, 255, 255, 0.86);
  text-align: center;
}

.nav a:hover {
  background: rgba(255, 255, 255, 0.18);
  color: var(--white);
}

.page {
  width: 100%;
  min-height: calc(100vh - 122px);
  margin: 0;
  padding: 22px 16px 48px;
  border-radius: 28px 28px 0 0;
  background:
    radial-gradient(circle at 20% 6%, rgba(249, 190, 215, 0.32), transparent 22%),
    radial-gradient(circle at 90% 1%, rgba(189, 238, 210, 0.30), transparent 24%),
    linear-gradient(180deg, var(--white), var(--panel));
  box-shadow: 0 -16px 42px rgba(28, 17, 65, 0.16);
}

.flash,
.notice {
  margin: 0 0 16px;
  padding: 14px 15px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  box-shadow: var(--soft-shadow);
}

.flash-success,
.notice.success {
  background: #f0fff6;
  box-shadow: var(--glow-janecita);
}

.flash-warning {
  background: #fff8df;
  box-shadow: 0 0 24px rgba(255, 215, 120, 0.38);
}

.flash-error,
.notice.danger {
  color: var(--danger);
  background: #fff1f7;
  box-shadow: var(--glow-fany);
}

.auth-shell {
  display: grid;
  min-height: calc(100vh - 180px);
  place-items: center;
}

.auth-panel,
.form-shell {
  width: 100%;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
}

.form-shell.narrow {
  max-width: 560px;
  margin: 0 auto;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--christell-strong);
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 10px;
  font-size: 2rem;
  line-height: 1.04;
}

.form-shell h1,
.day-block h2,
.plan-card h2,
.installer-group h2 {
  font-size: 1.12rem;
  line-height: 1.25;
}

.subtext,
.muted-link,
.day-meta,
.location,
.notes,
.status {
  color: var(--muted);
}

.subtext {
  max-width: 640px;
  line-height: 1.5;
}

.muted-link {
  display: inline-block;
  margin-top: 18px;
  color: var(--christell-strong);
  font-weight: 900;
}

.dashboard-head,
.form-head {
  display: grid;
  gap: 16px;
  margin-bottom: 18px;
}

.dashboard-head {
  position: relative;
  padding: 18px;
  overflow: hidden;
  border-radius: 22px;
  color: var(--white);
  background:
    radial-gradient(circle at 86% 18%, rgba(255, 255, 255, 0.26), transparent 18%),
    linear-gradient(135deg, var(--christell-strong), var(--frame));
  box-shadow: var(--shadow), var(--glow-christell);
}

.dashboard-head .eyebrow,
.dashboard-head .subtext {
  color: rgba(255, 255, 255, 0.84);
}

.dashboard-head h1 {
  max-width: 650px;
}

.button,
.small-button,
.text-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  width: 100%;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 8px;
  font: inherit;
  font-weight: 900;
  cursor: pointer;
}

.button.primary {
  color: var(--frame-dark);
  background: linear-gradient(135deg, var(--gold), var(--fany));
  box-shadow: var(--glow-fany), 0 12px 24px rgba(221, 111, 164, 0.24);
}

.button.primary:hover {
  transform: translateY(-1px);
}

.button.ghost,
.small-button {
  color: var(--christell-strong);
  border-color: rgba(110, 85, 199, 0.15);
  background: rgba(255, 255, 255, 0.84);
  box-shadow: var(--soft-shadow);
}

.small-button {
  min-height: 40px;
  padding: 0 12px;
  font-size: 0.9rem;
}

.dashboard-head .small-button,
.dashboard-head .button {
  color: var(--frame-dark);
  background: linear-gradient(135deg, var(--gold), var(--fany));
}

.text-danger {
  min-height: 40px;
  padding: 0;
  color: var(--danger);
  background: #fff1f7;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 18px 0;
}

.summary-item {
  min-height: 94px;
  padding: 13px 10px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--white);
  box-shadow: var(--soft-shadow);
}

.summary-item span {
  display: block;
  margin-bottom: 6px;
  color: var(--christell-strong);
  font-size: 1.15rem;
  font-weight: 900;
}

.summary-item p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.2;
}

.summary-item.accent {
  background: linear-gradient(145deg, #fff, #fff0f7);
  box-shadow: var(--glow-fany);
}

.summary-item.accent span {
  color: var(--fany-strong);
}

.summary-item.work {
  background: linear-gradient(145deg, #fff, #f0fff6);
  box-shadow: var(--glow-janecita);
}

.summary-item.work span {
  color: var(--janecita-strong);
}

.people-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0 18px;
}

.calendar-panel {
  display: grid;
  gap: 16px;
  margin: 18px 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--white);
  box-shadow: var(--shadow), var(--glow-christell);
}

.calendar-panel-head {
  display: grid;
  gap: 12px;
}

.calendar-panel-head h2 {
  margin-bottom: 0;
  font-size: 1.35rem;
}

.mini-calendars {
  display: grid;
  gap: 14px;
}

.mini-calendar {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background:
    radial-gradient(circle at 88% 8%, rgba(189, 238, 210, 0.34), transparent 28%),
    linear-gradient(145deg, #fff, #fbf8ff);
  box-shadow: var(--soft-shadow);
}

.mini-calendar h3 {
  margin: 0 0 12px;
  font-size: 1rem;
}

.week-row {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
  margin-bottom: 6px;
}

.week-row > span {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
  text-align: center;
}

.calendar-day {
  position: relative;
  display: grid;
  min-height: 38px;
  place-items: center;
  border-radius: 14px;
  color: var(--ink);
  font-size: 0.86rem;
  font-weight: 900;
}

.calendar-day.muted-day {
  color: rgba(129, 115, 143, 0.32);
}

.calendar-day.trip-day {
  color: var(--frame-dark);
  background: rgba(205, 187, 255, 0.36);
}

.calendar-day.has-plan {
  background: linear-gradient(135deg, var(--fany), var(--christell));
  box-shadow: var(--glow-fany);
}

.calendar-day.work-day {
  outline: 2px solid rgba(44, 149, 101, 0.28);
  background: linear-gradient(135deg, rgba(189, 238, 210, 0.82), rgba(255, 255, 255, 0.88));
  box-shadow: var(--glow-janecita);
}

.calendar-day i {
  position: absolute;
  right: 3px;
  bottom: 2px;
  display: grid;
  width: 16px;
  height: 16px;
  place-items: center;
  border-radius: 50%;
  color: var(--white);
  background: var(--frame);
  font-size: 0.62rem;
  font-style: normal;
}

.agenda-list {
  display: grid;
  gap: 16px;
}

.day-block {
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.74);
  box-shadow: var(--soft-shadow);
  break-inside: avoid;
  margin-bottom: 16px;
}

.day-header {
  display: grid;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.day-name {
  margin-bottom: 4px;
  font-weight: 900;
}

.day-meta {
  margin-bottom: 0;
  font-size: 0.88rem;
}

.plan-card,
.empty-day {
  margin-top: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--christell-strong);
  border-radius: 18px;
  background: var(--white);
  box-shadow: var(--soft-shadow);
}

.empty-day {
  color: var(--muted);
  border-left-color: var(--christell);
  background: rgba(255, 255, 255, 0.62);
}

.empty-day p {
  margin-bottom: 0;
}

.plan-card.category-viaje {
  border-left-color: var(--christell-strong);
  box-shadow: var(--glow-christell);
}

.plan-card.category-cine {
  border-left-color: #8e6be8;
  background: linear-gradient(145deg, #fff, #f7f2ff);
}

.plan-card.category-comida,
.plan-card.category-pareja {
  border-left-color: var(--fany-strong);
  box-shadow: var(--glow-fany);
}

.plan-card.category-familia {
  border-left-color: var(--janecita-strong);
  box-shadow: var(--glow-janecita);
}

.plan-card.category-nota {
  border-left-color: #9a8bb0;
}

.work-card {
  border-left-color: var(--janecita-strong);
  background: linear-gradient(145deg, #fff, #f0fff6);
}

.plan-topline,
.plan-footer,
.actions-row {
  display: grid;
  gap: 10px;
}

.plan-topline {
  margin-bottom: 9px;
  color: var(--muted);
  font-size: 0.86rem;
}

.pill,
.chips span,
.person-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  width: max-content;
  max-width: 100%;
  padding: 0 10px;
  border-radius: 999px;
  color: var(--frame-dark);
  background: #f2edff;
  font-size: 0.8rem;
  font-weight: 900;
}

.pill.neutral {
  background: #f0fff6;
  color: var(--janecita-strong);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.person-chip.person-fany,
.person-check.person-fany input:checked + span {
  color: #8b2d58;
  background: var(--fany);
  box-shadow: var(--glow-fany);
}

.person-chip.person-christell,
.person-check.person-christell input:checked + span {
  color: var(--frame-dark);
  background: var(--christell);
  box-shadow: var(--glow-christell);
}

.person-chip.person-janecita,
.person-check.person-janecita input:checked + span {
  color: #1d6047;
  background: var(--janecita);
  box-shadow: var(--glow-janecita);
}

.status {
  font-size: 0.86rem;
  font-weight: 800;
}

.plan-footer,
.actions-row {
  margin-top: 14px;
}

.actions-row form {
  margin: 0;
}

.location,
.notes {
  margin-bottom: 8px;
  line-height: 1.45;
}

.form {
  display: grid;
  gap: 16px;
}

.form label,
fieldset {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-weight: 900;
}

fieldset {
  margin: 0;
  padding: 0;
  border: 0;
}

legend {
  margin-bottom: 8px;
  color: var(--muted);
  font-weight: 900;
}

input,
select,
textarea {
  width: 100%;
  min-height: 48px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: var(--white);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
  font: inherit;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--christell-strong);
  outline: 3px solid rgba(205, 187, 255, 0.48);
  box-shadow: var(--glow-christell);
}

.field-grid {
  display: grid;
  gap: 14px;
}

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

.check-pill {
  position: relative;
}

.check-pill input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.check-pill span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: var(--white);
  text-align: center;
}

.button-row {
  display: grid;
  gap: 10px;
}

.installer-group {
  display: grid;
  gap: 12px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.75);
  box-shadow: var(--soft-shadow);
}

.installer-group h2 {
  margin-bottom: 0;
}

@media (min-width: 600px) {
  .page {
    width: min(980px, calc(100% - 32px));
    margin: 0 auto;
  }

  .dashboard-head,
  .calendar-panel-head,
  .form-head,
  .day-header,
  .plan-topline,
  .plan-footer,
  .actions-row,
  .button-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  .field-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .button,
  .small-button,
  .text-danger {
    width: auto;
  }
}

@media (min-width: 900px) {
  body {
    display: grid;
    grid-template-columns: 230px minmax(0, 1fr);
    gap: 0;
    padding: 18px;
  }

  .topbar {
    position: sticky;
    top: 18px;
    align-self: start;
    min-height: calc(100vh - 36px);
    padding: 22px 18px;
    border-radius: 24px;
  }

  .brand {
    margin-bottom: 22px;
  }

  .nav {
    grid-template-columns: 1fr;
    gap: 10px;
    font-size: 0.9rem;
  }

  .nav a {
    justify-content: flex-start;
    min-height: 46px;
    padding: 0 14px;
  }

  .page {
    width: min(1120px, calc(100% - 24px));
    min-height: calc(100vh - 36px);
    margin: 0 0 0 18px;
    padding: 34px;
    border-radius: 28px;
  }

  .auth-panel,
  .form-shell {
    max-width: 720px;
    margin: 0 auto;
    padding: 34px;
  }

  h1 {
    font-size: 3rem;
  }

  .agenda-list {
    display: block;
    column-count: 2;
    column-gap: 18px;
  }

  .day-block {
    display: inline-block;
    width: 100%;
  }
}
