@font-face {
  font-family: "Paaxel";
  src:
    url("/assets/fonts/Paaxel-xRjLO.otf") format("opentype"),
    local("Paaxel");
  font-display: swap;
}

.tracker-page,
.tracker-page *,
.tracker-page *::before,
.tracker-page *::after {
  box-sizing: border-box;
}

.tracker-page {
  color: #5a3156;
  font-family: "Paaxel", "Trebuchet MS", sans-serif;
  background:
    radial-gradient(circle at 12% 14%, rgba(255, 255, 255, 0.8) 0 24px, transparent 25px),
    radial-gradient(circle at 86% 18%, rgba(255, 214, 236, 0.9) 0 54px, transparent 55px),
    radial-gradient(circle at 20% 78%, rgba(255, 235, 179, 0.85) 0 62px, transparent 63px),
    radial-gradient(circle at 78% 74%, rgba(205, 244, 255, 0.9) 0 58px, transparent 59px),
    linear-gradient(180deg, rgba(255,255,255,0.45), rgba(255,255,255,0.12)),
    linear-gradient(135deg, #ffe7f3 0%, #ffeccf 48%, #e3f7ff 100%);
  background-attachment: fixed;
}

.tracker-page.news-page {
  background-image:
    radial-gradient(circle at 12% 14%, rgba(255, 255, 255, 0.8) 0 24px, transparent 25px),
    radial-gradient(circle at 86% 18%, rgba(255, 214, 236, 0.9) 0 54px, transparent 55px),
    radial-gradient(circle at 20% 78%, rgba(255, 235, 179, 0.85) 0 62px, transparent 63px),
    radial-gradient(circle at 78% 74%, rgba(205, 244, 255, 0.9) 0 58px, transparent 59px),
    linear-gradient(180deg, rgba(255,255,255,0.45), rgba(255,255,255,0.12)),
    linear-gradient(135deg, #ffe7f3 0%, #ffeccf 48%, #e3f7ff 100%);
  background-repeat: repeat;
}

.tracker-page button,
.tracker-page input,
.tracker-page select,
.tracker-page textarea {
  font: inherit;
  font-family: inherit;
}

.hidden {
  display: none !important;
}

.auth-shell {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(48, 28, 16, 0.58);
  backdrop-filter: blur(10px);
}

.auth-card {
  width: min(560px, 100%);
  padding: 26px;
  border: 2px solid #ef9ac5;
  border-radius: 26px;
  background:
    radial-gradient(circle at top right, rgba(255, 255, 255, 0.92), transparent 30%),
    linear-gradient(135deg, #fff8fe 0%, #ffe4f2 45%, #ffecc9 100%);
  box-shadow: 0 18px 36px rgba(197, 114, 165, 0.24);
}

.auth-form {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.auth-form label {
  display: grid;
  gap: 6px;
  font-weight: 700;
}

.auth-form input {
  width: 100%;
  min-width: 0;
  border: 2px solid #f1b4d6;
  border-radius: 16px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.92);
}

.auth-message {
  min-height: 1.4em;
  margin: 0;
  color: #b14979;
  font-weight: 700;
}

.login-hint {
  margin: 0;
  color: #936781;
  line-height: 1.45;
}

.tracker-page .page-shell {
  width: min(1240px, calc(100vw - 32px));
  margin: 18px 16px 40px 20px;
}

.tracker-page .retro-content {
  padding-bottom: 24px;
}

.tracker-page .retro-sidebar {
  width: 190px;
  padding-right: 22px;
}

.tracker-page .retro-nav a {
  color: #c4478e;
  text-decoration-thickness: 2px;
}

.cute-sticker {
  display: grid;
  place-items: center;
  width: 88px;
  min-height: 88px;
  margin-bottom: 18px;
  border: 3px solid #f3add0;
  border-radius: 999px;
  background:
    radial-gradient(circle at top, rgba(255,255,255,0.92), transparent 38%),
    linear-gradient(135deg, #fff9fc 0%, #ffe2f0 50%, #fff0cb 100%);
  color: #bf4d8f;
  box-shadow: 0 14px 28px rgba(194, 121, 165, 0.2);
  text-align: center;
}

.sticker-heart {
  display: block;
  font-size: 2.25rem;
  line-height: 1;
}

.tracker-hero {
  margin-bottom: 22px;
  padding: 24px;
  border: 2px solid #f2a6cf;
  border-radius: 28px;
  background:
    radial-gradient(circle at top right, rgba(255, 255, 255, 0.95), transparent 30%),
    linear-gradient(135deg, #fff9fd 0%, #ffe4f2 52%, #fff1d7 100%);
  box-shadow: 0 18px 36px rgba(194, 121, 165, 0.18);
}

.tracker-kicker {
  margin: 0 0 8px;
  color: #db6aa3;
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.tracker-hero h1 {
  margin: 0 0 10px;
  font-size: clamp(1.9rem, 4vw, 3.2rem);
}

.hero-topline {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.viewer-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 10px 0 0;
}

.viewer-chip {
  margin: 0;
  padding: 8px 14px;
  border: 2px solid #f0b1d2;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.75);
  color: #a1497e;
}

.viewer-alert {
  border-color: #cc92f3;
  background: linear-gradient(180deg, #fbf2ff 0%, #ecd6ff 100%);
  color: #7c45a3;
}

.tracker-intro {
  max-width: 62ch;
  margin: 0;
  line-height: 1.5;
  color: #7a4c73;
}

.tracker-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 18px;
}

.tracker-summary {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.summary-card,
.panel {
  border: 2px solid #f0b1d2;
  border-radius: 24px;
  background: rgba(255, 251, 254, 0.95);
  box-shadow: 0 14px 28px rgba(194, 121, 165, 0.14);
}

.summary-card {
  padding: 18px;
}

.summary-points {
  background:
    linear-gradient(135deg, rgba(255, 229, 244, 0.98), rgba(255, 239, 198, 0.98)),
    rgba(255, 250, 241, 0.96);
}

.summary-label {
  margin: 0 0 10px;
  color: #d56ca5;
  font-size: 0.86rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.summary-value {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3.4rem);
  font-weight: 700;
}

.summary-note {
  margin: 8px 0 0;
  line-height: 1.45;
}

.panel {
  padding: 20px;
}

.panel-heading {
  margin-bottom: 16px;
}

.panel-heading h2 {
  margin: 0 0 4px;
  font-size: 1.35rem;
}

.panel-heading p,
.helper-copy {
  margin: 0;
  line-height: 1.45;
  color: #8c6380;
}

.button-cluster {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.action-button,
.save-button,
.shop-button,
.logout-button {
  border: 2px solid #ee9bc8;
  border-radius: 18px;
  padding: 14px 16px;
  background: linear-gradient(180deg, #fff6fb 0%, #ffcce6 100%);
  color: #8a3167;
  font-size: 1rem;
  font-weight: 700;
  box-shadow: 0 10px 18px rgba(207, 126, 173, 0.16);
}

.action-button:hover,
.save-button:hover,
.shop-button:hover,
.logout-button:hover,
.action-button:focus-visible,
.save-button:focus-visible,
.shop-button:focus-visible,
.logout-button:focus-visible,
.mini-button:hover,
.mini-button:focus-visible,
.calendar-nav:hover,
.calendar-nav:focus-visible {
  transform: translate(-1px, -1px);
}

.workout-button {
  background: linear-gradient(180deg, #fff0f7 0%, #ffb8dd 100%);
}

.water-button {
  background: linear-gradient(180deg, #f4fcff 0%, #b9eaff 100%);
}

.miss-button {
  background: linear-gradient(180deg, #fff1ee 0%, #f5b8a5 100%);
}

.vacation-button {
  background: linear-gradient(180deg, #f5ebff 0%, #ccacf4 100%);
}

.daily-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px 14px;
}

.daily-form label {
  display: grid;
  gap: 6px;
  min-width: 0;
  font-weight: 700;
}

.date-field,
.calendar-panel,
.weight-field,
.status-field,
.checkbox-row,
.save-button {
  grid-column: 1 / -1;
}

.calendar-panel {
  padding: 14px;
  border: 2px solid #f3bad8;
  border-radius: 22px;
  background: linear-gradient(180deg, #fffafe 0%, #fff0f8 100%);
}

.calendar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.calendar-title {
  margin: 0;
  color: #b44f86;
  font-weight: 700;
}

.calendar-nav {
  border: 2px solid #efadd0;
  border-radius: 14px;
  padding: 8px 12px;
  background: linear-gradient(180deg, #fff6fb 0%, #ffd5ea 100%);
  color: #963f72;
}

.calendar-weekdays,
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
}

.calendar-weekdays {
  margin-bottom: 6px;
  color: #bf6b9d;
  font-size: 0.82rem;
  text-align: center;
}

.calendar-day,
.calendar-spacer {
  aspect-ratio: 1;
}

.calendar-day {
  border: 2px solid #f1c0da;
  border-radius: 16px;
  background: #fffdfd;
  color: #8d4673;
  font-weight: 700;
}

.calendar-day.has-entry {
  background: linear-gradient(180deg, #fff1f8 0%, #ffd7e9 100%);
  border-color: #e38bb8;
}

.calendar-day.status-worked-out {
  background: linear-gradient(180deg, #fff0f7 0%, #ffb8dd 100%);
  border-color: #d96ca9;
}

.calendar-day.status-missed {
  background: linear-gradient(180deg, #fde4dc 0%, #e89c80 100%);
  border-color: #b35f44;
}

.calendar-day.status-vacation {
  background: linear-gradient(180deg, #f5ebff 0%, #ccacf4 100%);
  border-color: #8c5cc7;
}

.calendar-day.status-water-only {
  background: linear-gradient(180deg, #e5f8ff 0%, #92d3eb 100%);
  border-color: #4f97b2;
}

.calendar-day.is-selected {
  outline: 3px solid #ff78b4;
  outline-offset: 1px;
}

.calendar-day.is-today {
  box-shadow: inset 0 0 0 2px rgba(255, 145, 187, 0.65);
}

.calendar-spacer {
  border: 1px dashed transparent;
}

.calendar-legend {
  margin: 10px 0 0;
  color: #8f6a83;
  font-size: 0.92rem;
}

.calendar-legend strong {
  color: #b54e87;
}

.daily-form span {
  color: #b55f92;
}

.daily-form input,
.daily-form select {
  width: 100%;
  min-width: 0;
  border: 2px solid #f1b4d6;
  border-radius: 16px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.96);
}

.checkbox-row {
  display: flex !important;
  align-items: center;
  gap: 10px;
}

.checkbox-row input {
  width: auto;
}

.save-button {
  justify-self: start;
}

.chart-shell {
  border: 2px dashed #f0b4d6;
  border-radius: 20px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.92);
}

#weightChart {
  width: 100%;
  height: auto;
  display: block;
}

.shop-list {
  display: grid;
  gap: 12px;
}

.shop-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 14px;
  border: 2px solid #f1c1db;
  border-radius: 20px;
  background: linear-gradient(180deg, #fffaff 0%, #fff1f8 100%);
}

.shop-item h3 {
  margin: 0 0 4px;
  font-size: 1.1rem;
}

.shop-item p {
  margin: 0;
  color: #8c6380;
}

.shop-button[disabled] {
  cursor: not-allowed;
  opacity: 0.5;
  transform: none;
}

.request-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.mini-button {
  border: 2px solid #efadd0;
  border-radius: 14px;
  padding: 8px 12px;
  background: linear-gradient(180deg, #fff6fb 0%, #ffd5ea 100%);
  color: #963f72;
}

.approve-button {
  border-color: #cc92f3;
  background: linear-gradient(180deg, #faf2ff 0%, #ecd6ff 100%);
  color: #7c45a3;
}

.deny-button {
  border-color: #f0b4b4;
  background: linear-gradient(180deg, #fff3f3 0%, #ffd3d3 100%);
  color: #aa4a68;
}

.table-wrap {
  overflow-x: auto;
}

.log-table {
  width: 100%;
  border-collapse: collapse;
  background: rgba(255, 255, 255, 0.96);
  border-radius: 18px;
  overflow: hidden;
}

.log-table th,
.log-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #f4cade;
  text-align: left;
}

.log-table th {
  background: #ffe9f4;
  color: #a4487b;
}

.history-list {
  margin: 0;
  padding-left: 18px;
  line-height: 1.6;
  color: #7f5776;
}

.history-list li + li {
  margin-top: 8px;
}

.history-item-meta {
  display: block;
  margin-top: 4px;
  color: #a78399;
  font-size: 0.9rem;
}

.empty-state {
  color: #a78399;
  font-style: italic;
}

@media (max-width: 980px) {
  .tracker-page .retro-layout,
  .tracker-page .retro-layout tbody,
  .tracker-page .retro-layout tr,
  .tracker-page .retro-layout td {
    display: block;
    width: 100%;
  }

  .tracker-page .retro-sidebar {
    width: 100%;
    padding-right: 0;
    margin-bottom: 18px;
  }

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

  .daily-form {
    grid-template-columns: 1fr;
  }

}

@media (max-width: 720px) {
  .tracker-page .page-shell {
    width: calc(100vw - 20px);
    margin: 10px;
  }

  .tracker-grid,
  .tracker-summary,
  .button-cluster {
    grid-template-columns: 1fr;
  }

  .tracker-hero,
  .panel,
  .summary-card,
  .auth-card {
    padding: 16px;
    border-radius: 20px;
  }

  .hero-topline {
    flex-direction: column;
    align-items: flex-start;
  }

  .calendar-weekdays,
  .calendar-grid {
    gap: 4px;
  }

  .calendar-day {
    border-radius: 12px;
    font-size: 0.9rem;
  }

  .calendar-nav {
    padding-inline: 10px;
  }

  .shop-item {
    grid-template-columns: 1fr;
  }

  .save-button {
    width: 100%;
  }
}
