:root {
  --bg: #f7f4ec;
  --ink: #1d2635;
  --muted: #687385;
  --surface: #ffffff;
  --line: #e5e0d6;
  --primary: #284b8f;
  --primary-2: #173569;
  --gold: #e6b94f;
  --soft: #edf1f8;
  --shadow: 0 18px 55px rgba(29, 38, 53, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(230, 185, 79, 0.22), transparent 32rem),
    radial-gradient(circle at bottom right, rgba(40, 75, 143, 0.18), transparent 30rem),
    var(--bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.app-shell {
  width: min(1440px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: clamp(1rem, 3vw, 2.5rem);
}

.app-menu {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  padding: 0.75rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 10px 30px rgba(29, 38, 53, 0.08);
}

.menu-brand,
.menu-link {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 850;
}

.menu-brand {
  color: var(--ink);
  padding: 0.55rem 0.7rem;
}

.menu-brand i {
  color: var(--primary);
}

.menu-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.menu-link {
  border: 0;
  color: var(--muted);
  padding: 0.55rem 0.75rem;
  background: transparent;
  line-height: 1.2;
}

.menu-link:hover,
.menu-link:focus-visible,
.menu-link.is-active {
  color: var(--primary);
  background: var(--soft);
  outline: none;
}

.menu-dropdown {
  position: relative;
  display: inline-flex;
}

.menu-dropdown-toggle {
  appearance: none;
  font-family: inherit;
  font-size: inherit;
  font-weight: 850;
  cursor: pointer;
}

.menu-dropdown-chevron {
  margin-left: 0.1rem;
  font-size: 0.75rem;
  transition: transform 0.16s ease;
}

.menu-dropdown:hover .menu-dropdown-chevron,
.menu-dropdown:focus-within .menu-dropdown-chevron,
.menu-dropdown.is-open .menu-dropdown-chevron {
  transform: rotate(180deg);
}

.menu-dropdown::after {
  content: "";
  position: absolute;
  top: 100%;
  right: 0;
  left: 0;
  height: 0.55rem;
}

.menu-dropdown-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 0.35rem);
  z-index: 30;
  display: none;
  min-width: 220px;
  padding: 0.5rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.menu-dropdown:hover .menu-dropdown-panel,
.menu-dropdown:focus-within .menu-dropdown-panel,
.menu-dropdown.is-open .menu-dropdown-panel {
  display: grid;
  gap: 0.25rem;
}

.menu-dropdown-panel .menu-link {
  width: 100%;
  justify-content: flex-start;
  white-space: nowrap;
}

.auth-shell {
  display: grid;
  place-items: center;
}

.not-found-shell {
  display: grid;
  align-content: start;
}

.auth-card {
  width: min(520px, 100%);
}

.auth-card h1,
.admin-page h1 {
  margin-bottom: 1rem;
  font-size: clamp(2.25rem, 5vw, 4rem);
  font-weight: 900;
}

.stack-form {
  display: grid;
  gap: 1rem;
}

.admin-page {
  min-height: 70vh;
}

.not-found-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: clamp(1.25rem, 3vw, 2.25rem);
  min-height: clamp(420px, 62vh, 620px);
  overflow: hidden;
  position: relative;
  padding: clamp(1.5rem, 4vw, 3rem);
}

.not-found-card::before {
  content: "";
  position: absolute;
  inset: auto -8rem -11rem auto;
  width: 24rem;
  height: 24rem;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(230, 185, 79, 0.22), transparent 68%);
  pointer-events: none;
}

.not-found-mark {
  display: grid;
  place-items: center;
  width: clamp(9rem, 19vw, 15rem);
  aspect-ratio: 1;
  border: 1px solid rgba(230, 185, 79, 0.5);
  border-radius: 999px;
  background:
    linear-gradient(145deg, rgba(255, 246, 214, 0.95), rgba(237, 241, 248, 0.95)),
    var(--surface);
  box-shadow: var(--shadow);
}

.not-found-mark span {
  color: var(--primary);
  font-size: clamp(2.25rem, 5vw, 4.25rem);
  font-weight: 950;
  letter-spacing: 0;
  line-height: 1;
}

.not-found-mark i {
  color: var(--gold);
  font-size: clamp(1.75rem, 4vw, 3rem);
  margin-top: -0.3rem;
}

.not-found-content {
  max-width: 720px;
}

.not-found-content h1 {
  margin-bottom: 1rem;
  font-size: clamp(2.35rem, 6vw, 5rem);
  font-weight: 950;
  line-height: 0.98;
}

.not-found-actions {
  grid-column: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.admin-modern-page {
  display: grid;
  gap: 1.25rem;
}

.admin-modern-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.25rem;
}

.admin-modern-header h1 {
  margin-bottom: 0.35rem;
  font-size: clamp(2.35rem, 5vw, 4.8rem);
  font-weight: 950;
  line-height: 0.98;
}

.admin-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.admin-card,
.admin-details {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 1rem;
  background: #fffdf8;
}

.admin-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  align-items: end;
}

.admin-form-actions,
.admin-check {
  align-self: end;
}

.full-span {
  grid-column: 1 / -1;
}

.admin-help {
  margin-bottom: 1rem;
  padding: 0.85rem 1rem;
  border-radius: 8px;
  color: var(--muted);
  background: var(--soft);
  font-weight: 750;
}

.admin-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75rem;
}

.admin-stat-card {
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf8;
}

.admin-stat-card span {
  display: block;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 850;
}

.admin-stat-card strong {
  display: block;
  margin-top: 0.25rem;
  color: var(--primary);
  font-size: 2rem;
  font-weight: 950;
  line-height: 1;
}

.admin-table-card {
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf8;
}

.admin-table-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.admin-table-header h2 {
  margin: 0;
  color: var(--ink);
  font-size: 1.35rem;
  font-weight: 950;
}

.admin-table {
  --bs-table-bg: transparent;
}

.admin-table thead th {
  color: var(--ink);
  font-weight: 900;
}

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.45rem;
}

.admin-muted-cell {
  max-width: 360px;
  color: var(--muted);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 1.75rem;
  padding: 0.25rem 0.65rem;
  border: 1px solid #d8dee8;
  border-radius: 999px;
  color: var(--muted);
  background: #eef1f6;
  font-size: 0.82rem;
  font-weight: 900;
}

.status-pill.is-active {
  border-color: #75e0a7;
  color: #067647;
  background: #dcfae6;
}

.status-pill.is-muted {
  border-color: #d8dee8;
  color: #5f6b7a;
  background: #eef1f6;
}

.status-pill.is-role {
  border-color: #c7d7f1;
  color: var(--primary);
  background: var(--soft);
}

.admin-modal {
  border: 0;
  border-radius: 8px;
  background: #fffdf8;
}

.admin-modal .modal-header,
.admin-modal .modal-footer {
  border-color: var(--line);
}

.admin-modal .modal-title {
  margin: 0;
  color: var(--ink);
  font-size: 1.45rem;
  font-weight: 950;
}

.color-image-field {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 1rem;
  align-items: center;
  margin-bottom: 1.25rem;
  padding: 1rem;
  border: 1px dashed #d7cdbb;
  border-radius: 8px;
  background: #fffaf0;
  cursor: pointer;
  transition: border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}

.color-image-field:hover,
.color-image-field.is-dragover {
  border-color: var(--gold);
  background: #fff6dc;
  box-shadow: 0 14px 34px rgba(230, 185, 79, 0.15);
}

.color-image-input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.color-image-preview,
.color-thumb {
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--soft);
  color: var(--primary);
}

.color-image-preview {
  width: 96px;
  aspect-ratio: 1;
  border-radius: 8px;
  font-size: 2rem;
}

.color-image-preview img,
.color-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.color-image-copy {
  display: grid;
  gap: 0.2rem;
  color: var(--muted);
}

.color-image-copy strong {
  color: var(--ink);
  font-size: 1.05rem;
}

.color-thumb {
  width: 54px;
  aspect-ratio: 1;
  border-radius: 8px;
  font-size: 1.25rem;
}

.score-editor {
  display: grid;
  gap: 1rem;
  margin: 1rem 0;
}

.score-editor-compact {
  max-height: 60vh;
  overflow: auto;
  padding-right: 0.25rem;
}

.score-editor-phase {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 1rem;
  background: var(--surface);
}

.score-editor-phase h2 {
  margin-bottom: 0.75rem;
  font-size: 1.1rem;
  font-weight: 900;
}

.score-input-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
  gap: 0.75rem;
}

.score-input-row label {
  font-weight: 800;
  color: var(--muted);
}

.profile-page {
  min-height: 70vh;
}

.profile-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.profile-header h1 {
  margin-bottom: 0.35rem;
  font-size: clamp(2.5rem, 6vw, 5rem);
  font-weight: 900;
}

.profile-avatar {
  display: grid;
  place-items: center;
  width: 5rem;
  height: 5rem;
  flex: 0 0 auto;
  border-radius: 50%;
  color: var(--primary);
  background: var(--soft);
  font-size: 2rem;
  font-weight: 900;
}

.profile-layout {
  display: grid;
  grid-template-columns: minmax(220px, 320px) minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}

.profile-summary,
.profile-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf8;
}

.profile-summary {
  padding: 1.25rem;
}

.profile-summary-icon {
  display: grid;
  place-items: center;
  width: 4rem;
  height: 4rem;
  margin-bottom: 1rem;
  border-radius: 50%;
  color: var(--primary);
  background: var(--soft);
  font-size: 1.8rem;
}

.profile-summary h2,
.profile-card-heading h2 {
  margin-bottom: 0.25rem;
  font-size: 1.35rem;
  font-weight: 900;
}

.profile-summary p,
.profile-card-heading p {
  color: var(--muted);
  font-weight: 700;
}

.profile-card {
  padding: 1.25rem;
}

.profile-card-heading {
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--line);
}

.profile-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.profile-password-field {
  grid-column: 1 / -1;
}

.profile-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 1.25rem;
}

@media (max-width: 768px) {
  .admin-modern-header,
  .admin-table-header {
    flex-direction: column;
  }

  .admin-modern-header .btn {
    width: 100%;
  }

  .admin-actions {
    justify-content: flex-start;
  }

  .profile-header {
    align-items: center;
  }

  .profile-layout,
  .profile-form-grid {
    grid-template-columns: 1fr;
  }

  .profile-actions {
    justify-content: stretch;
  }

.profile-actions .btn {
    width: 100%;
  }
}

.subscription-admin-form {
  display: grid;
  grid-template-columns: minmax(180px, 260px) minmax(160px, 220px) minmax(220px, 1fr) auto;
  gap: 0.75rem;
  align-items: end;
  padding: 0.75rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf8;
}

.subscription-option {
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.subscription-option + .subscription-option {
  margin-top: 0.75rem;
}

.subscription-option h2 {
  margin: 0 0 0.25rem;
  font-size: 1.2rem;
  font-weight: 900;
}

.subscription-option p {
  margin-bottom: 0.35rem;
  color: var(--muted);
  font-weight: 800;
}

.subscription-option span {
  display: block;
  color: var(--muted);
}

@media (max-width: 992px) {
  .subscription-admin-form {
    grid-template-columns: 1fr;
  }
}

.calendar-panel {
  min-height: calc(100vh - clamp(2rem, 6vw, 5rem));
  display: flex;
  align-items: stretch;
}

.surface {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(229, 224, 214, 0.95);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: clamp(1rem, 2vw, 1.5rem);
}

.calendar-header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: start;
  margin-bottom: 1.25rem;
}

.eyebrow {
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  font-weight: 850;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(1.75rem, 3vw, 3rem);
}

h2 {
  font-size: clamp(1.45rem, 2vw, 2rem);
}

h3 {
  font-size: 1rem;
}

.btn-primary {
  --bs-btn-bg: var(--primary);
  --bs-btn-border-color: var(--primary);
  --bs-btn-hover-bg: var(--primary-2);
  --bs-btn-hover-border-color: var(--primary-2);
  font-weight: 700;
}

.btn-soft {
  color: var(--primary);
  background: var(--soft);
  border: 1px solid #dce4f2;
  font-weight: 800;
}

.calendar-tools {
  display: grid;
  grid-template-columns: minmax(220px, 320px) minmax(190px, 240px);
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.form-control,
.form-select,
.input-group-text {
  border-color: var(--line);
}

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

.week-grid {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.week-grid span {
  padding: 0.85rem 0.55rem;
}

.calendar-grid {
  gap: 0.5rem;
  padding-top: 0.75rem;
}

.day-cell {
  min-height: 132px;
  padding: 0.7rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf8;
  cursor: pointer;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.day-cell:hover,
.day-cell:focus-visible {
  border-color: rgba(40, 75, 143, 0.5);
  box-shadow: 0 10px 28px rgba(29, 38, 53, 0.12);
  outline: none;
}

.day-cell.is-outside {
  opacity: 0.5;
}

.day-cell.is-today {
  border-color: var(--gold);
  box-shadow: inset 0 0 0 2px rgba(230, 185, 79, 0.35);
}

.day-cell.is-selected {
  background: #f1f5ff;
  border-color: var(--primary);
}

.day-cell.has-score-window {
  background: linear-gradient(180deg, #fffdf8, #fff8df);
}

.day-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
}

.day-number {
  font-size: 1rem;
  font-weight: 850;
}

.moon-icon {
  font-size: 1.65rem;
  line-height: 1;
}

.phase-label {
  display: none;
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 0.4rem;
}

.day-cell.is-exact-phase .phase-label {
  display: block;
}

.day-meta {
  display: none;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.35;
}

.score-chip {
  display: none;
  align-items: center;
  max-width: 100%;
  margin-top: 0.55rem;
  padding: 0.25rem 0.45rem;
  border-radius: 999px;
  color: #614800;
  background: rgba(230, 185, 79, 0.24);
  font-size: 0.7rem;
  font-weight: 850;
  line-height: 1.2;
}

.details-panel {
  position: sticky;
  top: 1.5rem;
}

.today-orb {
  display: grid;
  place-items: center;
  width: 108px;
  height: 108px;
  margin-bottom: 1.1rem;
  border-radius: 50%;
  background: linear-gradient(135deg, #101827, #2b3d64);
  box-shadow: inset 0 0 28px rgba(255, 255, 255, 0.12), 0 18px 40px rgba(29, 38, 53, 0.16);
  font-size: 3.2rem;
}

.phase-name {
  color: var(--primary);
  font-size: 1.1rem;
  font-weight: 850;
}

.detail-list {
  display: none;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.detail-list div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--line);
}

.detail-list div:last-child {
  border-bottom: 0;
}

.detail-list span {
  color: var(--muted);
}

.lunar-progress {
  height: 0.7rem;
  background: #ece7dc;
}

.lunar-progress .progress-bar {
  background: linear-gradient(90deg, var(--primary), var(--gold));
}

.lunar-cycle-ui,
.phase-legend {
  display: none;
}

.score-panel {
  min-height: 360px;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf8;
}

.score-badge {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 76px;
  height: 76px;
  border-radius: 50%;
  color: #1f2d42;
  background: linear-gradient(135deg, #f9dc76, #fff8d7);
  border: 1px solid rgba(230, 185, 79, 0.7);
  font-weight: 900;
  line-height: 1;
}

.score-badge span {
  display: block;
  font-size: 1.7rem;
}

.score-badge small {
  color: var(--muted);
  font-size: 0.78rem;
}

.score-status {
  display: none;
  min-height: 48px;
  padding: 0.75rem;
  border-radius: 8px;
  color: var(--muted);
  background: var(--soft);
  font-size: 0.88rem;
}

.score-card-list {
  display: grid;
  gap: 0.65rem;
  min-height: 136px;
  align-content: start;
}

.color-score-card {
  display: block;
  width: 100%;
  overflow: hidden;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: #fff;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.color-score-card:hover,
.color-score-card.is-selected {
  border-color: rgba(40, 75, 143, 0.55);
  box-shadow: 0 10px 24px rgba(29, 38, 53, 0.1);
}

.color-score-toggle {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  padding: 0.85rem;
  border: 0;
  color: inherit;
  background: transparent;
  text-align: left;
}

.color-score-toggle:focus-visible {
  box-shadow: inset 0 0 0 3px rgba(40, 75, 143, 0.18);
  outline: none;
}

.color-score-card.is-top {
  border-color: rgba(230, 185, 79, 0.75);
  background: #fff9e7;
}

.color-score-toggle strong,
.color-score-toggle span {
  display: block;
}

.color-score-toggle span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.rating-badge {
  display: inline-flex !important;
  align-items: center;
  width: fit-content;
  padding: 0.14rem 0.48rem;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 900;
  line-height: 1.1;
  vertical-align: middle;
}

.rating-best {
  color: #166534;
  border-color: #86efac;
  background: #dcfce7;
}

.rating-good {
  color: #1d4ed8;
  border-color: #93c5fd;
  background: #dbeafe;
}

.rating-fair {
  color: #92400e;
  border-color: #fcd34d;
  background: #fef3c7;
}

.rating-low {
  color: #991b1b;
  border-color: #fca5a5;
  background: #fee2e2;
}

.accordion-score-table {
  padding: 0 0.85rem 0.85rem;
}

.mini-score {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  color: var(--primary);
  background: var(--soft);
  font-size: 1.35rem;
  font-weight: 900;
  line-height: 1;
}

.mini-score small {
  color: var(--muted);
  font-size: 0.68rem;
}

.score-table {
  margin-top: 1rem;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.accordion-score-table .score-table {
  margin-top: 0;
}

.score-table th,
.score-table td {
  text-align: center;
}


.leg-table-help-note {
  margin-top: 0.55rem;
  padding: 0.55rem 0.7rem;
  border: 1px solid rgba(226, 216, 196, 0.95);
  border-radius: 8px;
  background: #fffaf0;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 800;
  line-height: 1.35;
}

.score-table th:first-child {
  text-align: left;
  min-width: 11rem;
}

.score-day-label,
.score-date-label,
.score-month-date,
.score-phase-label {
  display: block;
}

.score-date-label {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.25;
}

.score-month-date {
  color: var(--ink);
  font-size: 0.85rem;
  font-weight: 800;
  line-height: 1.25;
}


.insight-sections {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.insight-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
  padding: 1rem;
}

.insight-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.85rem;
}

.insight-card-header h4 {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 800;
  color: var(--ink);
}

.insight-card-header span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.insight-list {
  display: grid;
  gap: 0.65rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.insight-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  border: 1px solid rgba(226, 216, 196, 0.9);
  border-radius: 10px;
  background: #fffaf0;
  padding: 0.8rem 0.9rem;
}


.insight-item-with-image {
  justify-content: flex-start;
}

.insight-match-image {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  overflow: hidden;
  width: 46px;
  height: 46px;
  border: 1px solid rgba(226, 216, 196, 0.95);
  border-radius: 10px;
  background: #fffaf0;
}

.insight-match-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.insight-match-image.is-empty {
  color: var(--primary);
  background: var(--soft);
}

.insight-item-with-image .insight-item-main {
  flex: 1 1 auto;
}

.insight-item-main {
  min-width: 0;
}

.insight-item-main strong,
.insight-item-main span {
  display: block;
}

.insight-item-main strong {
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 800;
  line-height: 1.2;
}

.insight-item-main span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
  margin-top: 0.2rem;
}

.insight-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 58px;
  padding: 0.45rem 0.7rem;
  border-radius: 999px;
  background: #efe5bd;
  color: var(--primary);
  font-size: 0.84rem;
  font-weight: 900;
  white-space: nowrap;
}

.insight-card-note {
  margin-top: 0.85rem;
  border-top: 1px solid rgba(226, 216, 196, 0.9);
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
  line-height: 1.45;
  padding-top: 0.75rem;
}

.insight-empty {
  border: 1px dashed var(--line);
  border-radius: 10px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  padding: 0.95rem;
  text-align: center;
}

.score-phase-label {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.25;
}

.active-score-cell {
  color: var(--primary);
  background: rgba(230, 185, 79, 0.24) !important;
  font-weight: 900;
}

.score-value-cell {
  width: 7rem;
  text-align: center;
}

.leg-variant-table {
  margin-top: 0;
}

.leg-variant-table th:first-child {
  min-width: 9rem;
}

.leg-variant-table .score-value-cell {
  width: 5.25rem;
  white-space: nowrap;
}

.rankings-page {
  min-height: calc(100vh - clamp(2rem, 6vw, 5rem));
}

.dashboard-page {
  min-height: calc(100vh - clamp(2rem, 6vw, 5rem));
}

.rankings-hero,
.ranking-section-title,
.dashboard-hero,
.dashboard-card-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 1rem;
}

.rankings-controls {
  display: grid;
  grid-template-columns: auto minmax(240px, 1fr) auto auto;
  gap: 0.75rem;
  align-items: center;
  margin: 1.5rem 0;
}

.date-input-wrap {
  min-width: 0;
}

.ranking-status {
  min-height: 48px;
  padding: 0.85rem 1rem;
  border-radius: 8px;
  color: var(--muted);
  background: var(--soft);
  font-weight: 750;
}

.top-pick {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1rem;
  padding: 1.25rem;
  border: 1px solid rgba(230, 185, 79, 0.8);
  border-radius: 8px;
  background: linear-gradient(135deg, #fff8db, #ffffff);
}

.top-pick h2 {
  margin-bottom: 0.35rem;
}

.top-pick p {
  margin-bottom: 0;
  color: var(--muted);
  font-weight: 750;
}

.top-score,
.ranking-score {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 50%;
  font-weight: 950;
  line-height: 1;
}

.top-score {
  width: 92px;
  height: 92px;
  color: #1f2d42;
  background: linear-gradient(135deg, #f9dc76, #fff8d7);
  border: 1px solid rgba(230, 185, 79, 0.75);
}

.top-score span {
  font-size: 2.2rem;
}

.ranking-section-title {
  margin: 1.5rem 0 0.85rem;
}

.ranking-count {
  padding: 0.45rem 0.75rem;
  border-radius: 999px;
  color: var(--primary);
  background: var(--soft);
  font-weight: 850;
}

.ranking-list {
  display: grid;
  gap: 0.75rem;
}

.ranking-card {
  overflow: hidden;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.ranking-toggle {
  display: grid;
  grid-template-columns: 48px 1fr 68px;
  width: 100%;
  align-items: center;
  gap: 0.9rem;
  padding: 0.9rem;
  border: 0;
  color: inherit;
  background: transparent;
  text-align: left;
}

.ranking-card.is-expanded,
.ranking-card:hover {
  border-color: rgba(40, 75, 143, 0.55);
  box-shadow: 0 10px 24px rgba(29, 38, 53, 0.1);
}

.ranking-toggle:focus-visible {
  box-shadow: inset 0 0 0 3px rgba(40, 75, 143, 0.18);
  outline: none;
}

.ranking-number {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  color: var(--primary);
  background: var(--soft);
  font-size: 1.1rem;
  font-weight: 950;
}

.ranking-main h3,
.ranking-main p {
  margin: 0;
}

.ranking-main h3 {
  font-size: 1.05rem;
}

.ranking-main p {
  color: var(--muted);
  font-weight: 750;
}

.ranking-score {
  width: 62px;
  height: 62px;
  color: var(--primary);
  background: #fff8df;
  border: 1px solid rgba(230, 185, 79, 0.55);
  font-size: 1.5rem;
}

.top-score small,
.ranking-score small {
  color: var(--muted);
  font-size: 0.72rem;
}

.empty-ranking {
  display: grid;
  place-items: center;
  gap: 0.25rem;
  min-height: 220px;
  padding: 1.5rem;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
  background: #fffdf8;
}

.empty-ranking i {
  color: var(--primary);
  font-size: 2rem;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: start;
  gap: 1rem;
}

.dashboard-summary-grid {
  align-items: stretch;
}

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

.dashboard-natural-row {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.dashboard-natural-row > .dashboard-card {
  flex: 1 1 0;
}

.dashboard-card {
  min-width: 0;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf8;
}

.dashboard-pick-card {
  display: flex;
}

.dashboard-card h2 {
  margin-bottom: 0;
  font-size: clamp(1.2rem, 2vw, 1.55rem);
}

.dashboard-pick {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: 100%;
  min-height: 100%;
}

.dashboard-pick h2 {
  margin-bottom: 0.35rem;
}

.dashboard-pick p {
  margin-bottom: 0;
  color: var(--muted);
  font-weight: 750;
}

.phase-summary-main {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.phase-summary-icon {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: linear-gradient(135deg, #101827, #2b3d64);
  font-size: 2rem;
}

.phase-summary-main strong,
.phase-summary-main span {
  display: block;
}

.phase-summary-main span,
.phase-summary-stats span {
  color: var(--muted);
  font-weight: 700;
}

.phase-summary-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  margin-top: 1rem;
}

.phase-summary-stats div {
  padding: 0.75rem;
  border-radius: 8px;
  background: var(--soft);
}

.phase-summary-stats strong {
  display: block;
  margin-top: 0.2rem;
  font-size: 1.25rem;
}

.dashboard-list {
  display: grid;
  gap: 0.65rem;
  margin-top: 1rem;
}

.dashboard-row {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 68px;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.dashboard-row-plain {
  grid-template-columns: minmax(0, 1fr) 68px;
}

.dashboard-rank {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  color: var(--primary);
  background: var(--soft);
  font-weight: 950;
}

.dashboard-row-main {
  min-width: 0;
}

.dashboard-row-main strong,
.dashboard-row-main span {
  display: block;
}

.dashboard-row-main strong {
  color: var(--ink);
}

.dashboard-row-main span {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 750;
}

.dashboard-row-score {
  display: grid;
  place-items: center;
  justify-self: end;
  width: 64px;
  height: 64px;
  padding: 0.35rem;
  border: 1px solid rgba(230, 185, 79, 0.55);
  border-radius: 50%;
  color: var(--primary);
  background: #fff8df;
  font-size: 1.35rem;
  font-weight: 950;
  line-height: 1;
}

.dashboard-row-score small {
  color: var(--muted);
  font-size: 0.68rem;
}

.score-result-modal .modal-content {
  border: 0;
  border-radius: 12px;
  background: #fffdf8;
}

.score-result-modal .modal-header {
  align-items: flex-start;
  border-bottom-color: var(--line);
}

.score-result-modal .modal-title {
  color: var(--ink);
  font-size: 1.35rem;
  font-weight: 950;
}

.score-result-modal .score-panel {
  margin-top: 0;
}

.legend-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.legend-item span:first-child {
  flex: 0 0 auto;
  font-size: 1.25rem;
}

@media (max-width: 991.98px) {
  .calendar-header {
    align-items: stretch;
    flex-direction: column;
  }

  .details-panel {
    position: static;
  }
}

@media (max-width: 767.98px) {
  .app-shell {
    padding: 0.75rem;
  }

  .app-menu {
    align-items: stretch;
    flex-direction: column;
  }

  .menu-brand {
    justify-content: center;
  }

  .menu-links {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .menu-link {
    justify-content: center;
    padding-inline: 0.45rem;
  }

  .calendar-tools {
    grid-template-columns: 1fr;
  }

  .week-grid {
    display: none;
  }

  .calendar-grid {
    grid-template-columns: 1fr;
  }

  .day-cell {
    min-height: auto;
  }

  .legend-grid {
    grid-template-columns: 1fr;
  }

  .rankings-hero,
  .ranking-section-title,
  .top-pick,
  .dashboard-hero,
  .dashboard-pick,
  .dashboard-card-heading {
    flex-direction: column;
  }

  .rankings-controls,
  .dashboard-controls {
    grid-template-columns: 1fr;
  }

  .dashboard-grid,
  .dashboard-grid-2 {
    grid-template-columns: 1fr;
  }

  .dashboard-natural-row {
    flex-direction: column;
  }

  .dashboard-natural-row > .dashboard-card {
    width: 100%;
  }

  .dashboard-row,
  .dashboard-row-plain {
    grid-template-columns: minmax(0, 1fr) 58px;
  }

  .color-image-field {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .color-image-preview {
    margin: 0 auto;
  }

  .dashboard-row-score {
    width: 54px;
    height: 54px;
    justify-self: end;
  }

  .dashboard-rank {
    display: none;
  }

  .ranking-card {
    grid-template-columns: 1fr;
  }

  .ranking-toggle {
    grid-template-columns: 42px 1fr 58px;
  }

  .ranking-score {
    width: 54px;
    height: 54px;
  }

  .score-result-modal .modal-content {
    min-height: 100vh;
    border-radius: 0;
  }

  .score-result-modal .modal-body {
    padding: 1rem;
  }

  .not-found-card {
    grid-template-columns: 1fr;
    min-height: auto;
    text-align: center;
  }

  .not-found-mark {
    width: min(12rem, 70vw);
    margin: 0 auto;
  }

  .not-found-actions {
    grid-column: auto;
    justify-content: center;
  }

  .not-found-actions .btn {
    width: 100%;
  }
}

/* Generic/default color-group images */
.score-card-color-image,
.ranking-color-image,
.dashboard-color-image,
.dashboard-pick-image {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(226, 216, 196, 0.95);
  border-radius: 10px;
  background: #fffaf0;
}

.score-card-color-image,
.ranking-color-image,
.dashboard-color-image {
  width: 52px;
  height: 52px;
}

.dashboard-pick-image {
  width: 76px;
  height: 76px;
  border-radius: 14px;
}

.score-card-color-image img,
.ranking-color-image img,
.dashboard-color-image img,
.dashboard-pick-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.score-card-color-image.is-empty,
.ranking-color-image.is-empty,
.dashboard-color-image.is-empty,
.dashboard-pick-image.is-empty {
  color: var(--primary);
  background: var(--soft);
}

.score-card-main {
  min-width: 0;
  flex: 1 1 auto;
}

.ranking-toggle {
  grid-template-columns: 48px 52px minmax(0, 1fr) 68px;
}

.dashboard-row {
  grid-template-columns: 38px 52px minmax(0, 1fr) 68px;
}

.dashboard-row-plain {
  grid-template-columns: minmax(0, 1fr) 68px;
}

.dashboard-row-with-image {
  grid-template-columns: 52px minmax(0, 1fr) 68px;
}

.dashboard-pick {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr) auto;
  align-items: center;
  gap: 1rem;
}

@media (max-width: 575.98px) {
  .ranking-toggle {
    grid-template-columns: 40px 46px minmax(0, 1fr) 58px;
    gap: 0.6rem;
  }

  .score-card-color-image,
  .ranking-color-image,
  .dashboard-color-image {
    width: 46px;
    height: 46px;
  }

  .dashboard-row,
  .dashboard-row-with-image {
    grid-template-columns: 46px minmax(0, 1fr) 58px;
  }

  .dashboard-row .dashboard-rank {
    display: none;
  }

  .dashboard-pick {
    grid-template-columns: 58px minmax(0, 1fr);
  }

  .dashboard-pick-image {
    width: 58px;
    height: 58px;
  }

  .dashboard-pick .top-score {
    grid-column: 1 / -1;
    justify-self: start;
  }
}

@media (max-width: 767.98px) {
  .insight-sections {
    grid-template-columns: 1fr;
  }

  .insight-item {
    align-items: flex-start;
  }
}

.insight-detail-modal .modal-content {
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.18);
}

.insight-detail-modal .modal-title {
  color: var(--ink);
  font-size: 1.45rem;
  font-weight: 900;
  line-height: 1.15;
}

.modal-subtitle {
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 700;
  margin-top: 0.3rem;
}

.leg-insight-row {
  cursor: pointer;
}

.leg-insight-row:hover > * {
  background: #fff4cf !important;
}

.score-action-cell {
  width: 96px;
  text-align: center;
}

.leg-insight-button {
  font-weight: 800;
  border-radius: 999px;
  padding-inline: 0.85rem;
}

@media (max-width: 767.98px) {
  .insight-detail-modal .modal-dialog {
    margin: 0.75rem;
  }

  .insight-detail-modal .modal-title {
    font-size: 1.15rem;
  }

  .score-action-cell {
    width: auto;
  }
}

.insight-modal-profile {
  display: flex;
  align-items: center;
  gap: 1rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fffaf0;
  padding: 1rem;
  margin-bottom: 1rem;
}

.insight-modal-profile strong,
.insight-modal-profile span {
  display: block;
}

.insight-modal-profile strong {
  color: var(--ink);
  font-size: 1.1rem;
  font-weight: 900;
  line-height: 1.2;
}

.insight-modal-profile span {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
  margin-top: 0.25rem;
}

.insight-modal-image {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 86px;
  height: 86px;
  overflow: hidden;
  border: 1px solid rgba(226, 216, 196, 0.95);
  border-radius: 16px;
  background: #fff;
}

.insight-modal-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.insight-modal-image.is-empty {
  color: var(--primary);
  background: var(--soft);
  font-size: 1.5rem;
}

@media (max-width: 575.98px) {
  .insight-modal-profile {
    align-items: flex-start;
  }

  .insight-modal-image {
    width: 68px;
    height: 68px;
    border-radius: 14px;
  }
}

@media (max-width: 575.98px) {
  .insight-card {
    padding: 0.85rem;
  }

  .insight-card-header {
    align-items: flex-start;
  }

  .insight-item {
    gap: 0.7rem;
    padding: 0.75rem;
  }

  .insight-match-image {
    width: 42px;
    height: 42px;
  }

  .insight-badge {
    min-width: 50px;
    padding: 0.4rem 0.55rem;
    font-size: 0.78rem;
  }

  .insight-card-note {
    font-size: 0.72rem;
  }
}

.insight-date-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.insight-date-meta > div {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8fafc;
  padding: 0.85rem 0.95rem;
}

.insight-date-eyebrow {
  display: block;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  line-height: 1.2;
  margin-bottom: 0.28rem;
  text-transform: uppercase;
}

.insight-date-meta strong {
  display: block;
  color: var(--ink);
  font-size: 0.86rem;
  font-weight: 900;
  line-height: 1.25;
}

@media (max-width: 767.98px) {
  .insight-date-meta {
    grid-template-columns: 1fr;
  }

  .insight-date-meta > div {
    padding: 0.75rem 0.85rem;
  }
}

.insight-modal-profile-main {
  min-width: 0;
  flex: 1 1 auto;
}

.insight-modal-score {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  min-width: 86px;
  min-height: 58px;
  padding: 0.65rem 0.95rem;
  border: 1px solid #e6c964;
  border-radius: 999px;
  background: #fff4cf;
  color: var(--primary);
  font-size: 1.35rem;
  font-weight: 900;
  line-height: 1;
  text-align: center;
}

.insight-modal-score small {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  margin-top: 0.18rem;
}

@media (max-width: 575.98px) {
  .insight-modal-profile {
    align-items: flex-start;
  }

  .insight-modal-score {
    min-width: 70px;
    min-height: 48px;
    padding: 0.55rem 0.75rem;
    font-size: 1.05rem;
  }
}

.insight-date-note {
  border: 1px solid rgba(226, 216, 196, 0.9);
  border-radius: 12px;
  background: #fffaf0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.45;
  margin: -0.25rem 0 1rem;
  padding: 0.85rem 0.95rem;
}

@media (max-width: 767.98px) {
  .insight-date-note {
    font-size: 0.72rem;
    margin-top: -0.15rem;
  }
}

.score-search-wrap,
.ranking-search-wrap {
  margin-top: 1rem;
}

.score-search-wrap .input-group,
.ranking-search-wrap .input-group {
  border-radius: 12px;
  box-shadow: 0 8px 20px rgba(29, 38, 53, 0.04);
}

.score-search-wrap .input-group-text,
.ranking-search-wrap .input-group-text {
  background: #f8fafc;
  color: var(--primary);
  border-color: var(--line);
  font-weight: 800;
}

.score-search-wrap .form-control,
.ranking-search-wrap .form-control {
  font-weight: 700;
}

.empty-search-result {
  display: grid;
  place-items: center;
  gap: 0.35rem;
  padding: 1.25rem;
  border: 1px dashed var(--line);
  border-radius: 12px;
  color: var(--muted);
  text-align: center;
  background: #fffdf8;
}

.empty-search-result i {
  color: var(--primary);
  font-size: 1.4rem;
}

.empty-search-result strong {
  color: var(--ink);
  font-weight: 900;
}

@media (max-width: 767.98px) {
  .ranking-search-wrap .input-group {
    --bs-border-radius-lg: 0.75rem;
  }

  .score-search-wrap,
  .ranking-search-wrap {
    margin-top: 0.85rem;
  }
}

.dashboard-insight-trigger {
  cursor: pointer;
}

.dashboard-insight-trigger:focus-visible {
  outline: 3px solid rgba(36, 78, 150, 0.35);
  outline-offset: 3px;
}

.preview-mode-note {
  display: grid;
  gap: 0.3rem;
  border: 1px solid rgba(244, 195, 70, 0.45);
  border-radius: 14px;
  background: #fff8e8;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
  padding: 0.95rem 1rem;
}

.preview-mode-note strong {
  color: var(--primary);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.preview-mode-note a {
  color: var(--primary);
  font-weight: 900;
  text-decoration: none;
}

.locked-preview-box {
  display: grid;
  place-items: center;
  gap: 0.55rem;
  min-height: 180px;
  border: 1px dashed var(--line);
  border-radius: 16px;
  background: #fffaf0;
  color: var(--muted);
  font-weight: 700;
  padding: 1.25rem;
  text-align: center;
}

.locked-preview-box i {
  color: var(--primary);
  font-size: 2rem;
}

.locked-preview-box strong {
  color: var(--ink);
  font-size: 1.05rem;
}

@media (max-width: 767.98px) {
  .preview-mode-note,
  .locked-preview-box {
    font-size: 0.82rem;
  }
}

.is-locked-preview {
  cursor: pointer;
}

.admin-stats-grid-6 {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.status-pill.is-pending {
  background: #fff7db;
  color: #946200;
  border-color: #ffe1a3;
}

.status-pill.is-paid,
.status-pill.is-active {
  background: #dcfce7;
  color: #166534;
  border-color: #86efac;
}

.status-pill.is-expired,
.status-pill.is-refunded {
  background: #eef2ff;
  color: #334155;
  border-color: #c7d2fe;
}

.status-pill.is-cancelled,
.status-pill.is-rejected {
  background: #fee2e2;
  color: #991b1b;
  border-color: #fecaca;
}

@media (max-width: 1199.98px) {
  .admin-stats-grid-6 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 767.98px) {
  .admin-stats-grid-6 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 479.98px) {
  .admin-stats-grid-6 {
    grid-template-columns: 1fr;
  }
}

.chat-thread {
  display: grid;
  gap: 0.9rem;
  max-height: 420px;
  overflow-y: auto;
  padding-right: 0.25rem;
}

.chat-bubble {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fffaf0;
  padding: 0.95rem 1rem;
}

.chat-bubble.is-mine {
  border-color: rgba(42, 80, 158, 0.25);
  background: #f5f8ff;
}

.chat-bubble strong,
.chat-bubble small,
.chat-bubble p,
.chat-bubble a {
  display: block;
}

.chat-bubble strong {
  color: var(--ink);
  font-weight: 900;
}

.chat-bubble strong span,
.chat-bubble small {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.chat-bubble p {
  color: var(--muted);
  font-weight: 700;
  margin: 0.45rem 0;
}

.chat-bubble a {
  font-weight: 800;
  margin: 0.35rem 0;
}

@media (max-width: 767.98px) {
  .chat-thread {
    max-height: 320px;
  }
}

.support-layout {
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}

.support-layout-single {
  grid-template-columns: 1fr;
}

.support-sidebar,
.support-chat-card {
  padding: 1.25rem;
}

.support-sidebar-header,
.support-chat-header {
  margin-bottom: 1rem;
}

.support-sidebar-header h2,
.support-chat-header h2 {
  color: var(--ink);
  font-size: 1.35rem;
  margin: 0;
}

.support-thread-list {
  display: grid;
  gap: 0.7rem;
}

.support-thread-link {
  display: grid;
  grid-template-columns: 46px 1fr;
  gap: 0.8rem;
  align-items: center;
  padding: 0.85rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: inherit;
  text-decoration: none;
  background: #fffaf0;
}

.support-thread-link:hover,
.support-thread-link.is-active {
  border-color: rgba(42, 80, 158, 0.45);
  background: #f5f8ff;
}

.support-thread-avatar {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  color: var(--primary);
  background: var(--soft);
  font-weight: 950;
}

.support-thread-content {
  min-width: 0;
}

.support-thread-content strong,
.support-thread-content small,
.support-thread-content em {
  display: block;
}

.support-thread-content strong {
  color: var(--ink);
  font-weight: 900;
}

.support-thread-content small,
.support-thread-content em {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.support-thread-content em {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-style: normal;
  margin-top: 0.2rem;
}

.support-chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid var(--line);
  padding-bottom: 1rem;
}

.support-chat-header p {
  color: var(--muted);
  font-weight: 750;
  margin: 0.2rem 0 0;
}

.support-chat-header > i {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  color: var(--primary);
  background: var(--soft);
  font-size: 1.4rem;
}

.support-chat-thread {
  max-height: 560px;
  min-height: 280px;
  padding: 0.5rem 0.25rem 0.5rem 0;
}

.support-reply-form {
  border-top: 1px solid var(--line);
  margin-top: 1rem;
  padding-top: 1rem;
}

.support-reply-actions {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1rem;
  align-items: end;
}

.support-file-input {
  margin-bottom: 0;
}

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

@media (max-width: 991.98px) {
  .support-layout,
  .support-layout-single {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 575.98px) {
  .support-reply-actions {
    grid-template-columns: 1fr;
  }

  .admin-stats-grid-4 {
    grid-template-columns: 1fr;
  }

  .support-chat-header {
    align-items: flex-start;
  }
}

.menu-count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.35rem;
  height: 1.35rem;
  padding: 0 0.38rem;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 900;
  line-height: 1;
  box-shadow: 0 8px 18px rgba(239, 68, 68, 0.22);
}

.menu-dropdown-panel .menu-count-badge {
  margin-left: auto;
}

.support-unread-inline {
  color: #b42318;
  font-weight: 900;
}

.metric-alert-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.35rem;
  height: 1.35rem;
  margin-left: 0.4rem;
  padding: 0 0.4rem;
  border-radius: 999px;
  background: #fee2e2;
  color: #991b1b;
  font-style: normal;
  font-size: 0.72rem;
  font-weight: 900;
}

.storage-note-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff8e8;
  color: var(--muted);
  padding: 1rem 1.1rem;
  font-weight: 700;
}

.storage-note-card strong {
  color: var(--ink);
}
