:root {
  --color-accent: #0f766e;
  --color-success: #168451;
  --color-warning: #b7791f;
  --color-error: #c4493d;
  --bg: #eef3f1;
  --panel: #ffffff;
  --ink: #15201d;
  --muted: #64706c;
  --line: #dde5e1;
  --teal: var(--color-accent);
  --teal-soft: #e4f4f1;
  --coral: var(--color-error);
  --coral-soft: #fff0ea;
  --amber: var(--color-warning);
  --amber-soft: #fff7df;
  --green: var(--color-success);
  --green-soft: #e8f7ee;
  --blue: #2868a8;
  --blue-soft: #e8f1fb;
  --shadow: 0 18px 45px rgba(22, 32, 29, 0.14);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

i[data-lucide],
svg[data-lucide] {
  display: inline-flex;
  width: 1em;
  height: 1em;
  flex: 0 0 auto;
}

.stage {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 18px;
}

.phone {
  width: min(100%, 390px);
  height: min(860px, calc(100vh - 36px));
  background: #f8fbfa;
  border: 1px solid rgba(21, 32, 29, 0.08);
  border-radius: 28px;
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.topbar {
  padding: 18px 18px 10px;
  background: #ffffff;
  border-bottom: 1px solid var(--line);
}

.topbar-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand {
  min-width: 0;
}

.brand h1 {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  font-size: 21px;
  line-height: 1.25;
  letter-spacing: 0;
}

.ai-sparkle {
  position: relative;
  display: inline-grid;
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  place-items: center;
  color: var(--color-accent);
}

.ai-sparkle svg {
  width: 17px;
  height: 17px;
}

.ai-sparkle::after {
  content: "";
  position: absolute;
  inset: 2px;
  border-top: 1px solid rgba(255, 255, 255, 0.76);
  opacity: 0.22;
  transform: rotate(-35deg) translateX(-3px);
  animation: aiEdgeShimmer 3600ms ease-in-out infinite;
  pointer-events: none;
}

@keyframes aiEdgeShimmer {
  0%,
  70%,
  100% {
    opacity: 0.18;
    transform: rotate(-35deg) translateX(-3px);
  }
  82% {
    opacity: 0.52;
    transform: rotate(-35deg) translateX(3px);
  }
}

.brand p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.today-pill {
  flex: 0 0 auto;
  padding: 7px 10px;
  border-radius: 999px;
  background: var(--teal-soft);
  color: var(--teal);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.content {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 16px 16px 14px;
}

.panel {
  display: none;
  animation: fadeIn 160ms ease;
}

.panel.active {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.section-title h2 {
  margin: 0;
  font-size: 18px;
  letter-spacing: 0;
}

.section-title span {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  box-shadow: 0 8px 20px rgba(21, 32, 29, 0.05);
}

.stack {
  display: grid;
  gap: 12px;
}

.reward-summary {
  min-width: 0;
  padding: 13px 14px;
  overflow: hidden;
  border: 1px solid rgba(183, 121, 31, 0.26);
  border-radius: 8px;
  background: linear-gradient(135deg, #ffffff 0%, #f4fbf7 62%, #fff8e7 100%);
  box-shadow: 0 8px 20px rgba(21, 32, 29, 0.05);
}

.reward-summary-header,
.reward-footer,
.reward-dialog header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.reward-summary-header h2,
.reward-dialog header h2 {
  margin: 2px 0 0;
  font-size: 15px;
  line-height: 1.3;
  letter-spacing: 0;
}

.reward-kicker,
.reward-dialog header span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.reward-level {
  flex: 0 0 auto;
  padding: 5px 8px;
  border-radius: 999px;
  background: var(--amber-soft);
  color: #8b5b16;
  font-size: 11px;
  font-weight: 900;
}

.reward-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 10px 0;
  border-block: 1px solid rgba(22, 132, 81, 0.13);
}

.reward-metrics > div {
  min-width: 0;
  padding: 9px 8px 8px;
}

.reward-metrics > div + div {
  border-left: 1px solid rgba(22, 132, 81, 0.13);
}

.reward-metrics strong,
.reward-metrics span {
  display: block;
}

.reward-metrics strong {
  color: var(--green);
  font-size: 20px;
  line-height: 1.1;
}

.reward-metrics span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

.reward-progress > span {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}

.reward-progress [role="progressbar"] {
  height: 6px;
  margin-top: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: #e5ece8;
}

#reward-cycle-progress {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green), #d7a72e);
  transition: width 420ms ease;
}

.reward-footer {
  min-width: 0;
  margin-top: 10px;
}

.reward-protection {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 5px;
  color: #276348;
  font-size: 10px;
  font-weight: 800;
}

.reward-protection svg {
  width: 14px;
  height: 14px;
}

.reward-pending-button {
  display: inline-flex;
  min-height: 30px;
  flex: 0 0 auto;
  align-items: center;
  gap: 5px;
  padding: 5px 8px;
  border-radius: 7px;
  background: #97661a;
  color: #ffffff;
  font-size: 10px;
  font-weight: 900;
}

.reward-summary.is-loading .reward-metrics strong,
.reward-summary.is-loading .reward-progress > span,
.reward-summary.is-loading .reward-protection {
  color: transparent;
  border-radius: 5px;
  background: #e8eeeb;
  animation: reward-skeleton 1.25s ease-in-out infinite;
}

.reward-summary.has-error {
  border-color: rgba(196, 73, 61, 0.28);
}

.reward-points-fly {
  animation: reward-points-fly 680ms ease-out;
}

@keyframes reward-points-fly {
  0% { opacity: 0.35; transform: translateY(7px) scale(0.92); }
  48% { color: #b7791f; transform: translateY(-2px) scale(1.08); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes reward-skeleton {
  50% { opacity: 0.55; }
}

.reward-dialog {
  width: min(calc(100% - 24px), 360px);
  max-height: calc(100dvh - 40px);
  padding: 0;
  overflow: auto;
  border: 0;
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  box-shadow: 0 24px 70px rgba(21, 32, 29, 0.28);
}

.reward-dialog::backdrop {
  background: rgba(17, 29, 25, 0.58);
  backdrop-filter: blur(3px);
}

.reward-dialog-sheet {
  padding: 16px;
}

.reward-dialog header button {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 50%;
  background: var(--teal-soft);
  color: var(--teal);
}

.reward-dialog-list {
  display: grid;
  gap: 0;
  margin: 16px 0 12px;
  padding: 0;
  list-style: none;
}

.reward-timeline-item {
  position: relative;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 9px;
  min-width: 0;
  padding: 8px 0;
}

.reward-timeline-item:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 38px;
  bottom: -4px;
  left: 16px;
  width: 1px;
  background: var(--line);
}

.reward-timeline-icon {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 50%;
  background: var(--green-soft);
  color: var(--green);
}

.reward-timeline-item.is-new .reward-timeline-icon {
  background: var(--amber-soft);
  color: #97661a;
}

.reward-timeline-item strong,
.reward-timeline-item span {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.reward-timeline-item strong {
  font-size: 13px;
}

.reward-timeline-item div > span,
.reward-dialog-sheet > p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.reward-dialog-done {
  width: 100%;
  min-height: 42px;
  margin-top: 8px;
  border-radius: 8px;
  background: var(--green);
  color: #ffffff;
  font-weight: 900;
}

.reward-dialog.is-active .reward-dialog-sheet {
  animation: reward-celebration 420ms ease-out;
}

@keyframes reward-celebration {
  from { opacity: 0; transform: translateY(10px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  .reward-points-fly,
  .reward-dialog.is-active .reward-dialog-sheet,
  .reward-summary.is-loading .reward-metrics strong,
  .reward-summary.is-loading .reward-progress > span,
  .reward-summary.is-loading .reward-protection {
    animation: none;
  }

  #reward-cycle-progress {
    transition: none;
  }
}

.field {
  display: grid;
  gap: 7px;
}

.field label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.control {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  padding: 10px 12px;
  outline: none;
}

.control:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}

textarea.control {
  min-height: 84px;
  resize: vertical;
  line-height: 1.5;
}

.status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px;
  border-radius: 8px;
  background: var(--green-soft);
  border: 1px solid rgba(22, 132, 81, 0.2);
}

.status-row.makeup {
  background: var(--amber-soft);
  border-color: rgba(183, 121, 31, 0.24);
}

.status-main {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.status-main strong {
  font-size: 15px;
}

.status-main small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.tag.today {
  background: var(--green);
  color: #ffffff;
}

.tag.makeup {
  background: var(--amber);
  color: #ffffff;
}

.tag.normal {
  background: var(--teal-soft);
  color: var(--teal);
}

.tag.video {
  background: var(--blue-soft);
  color: var(--blue);
}

.tag.alert {
  background: var(--coral-soft);
  color: var(--coral);
}

.upload-box {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 146px;
  padding: 16px;
  border: 1.5px dashed rgba(15, 118, 110, 0.35);
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff 0%, #f3fbf8 100%);
  text-align: center;
  overflow: hidden;
}

.upload-box input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.upload-visual {
  width: 54px;
  height: 54px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  margin: 0 auto 10px;
  background: #dff2ed;
  color: var(--teal);
  font-size: 22px;
  font-weight: 900;
}

.upload-box strong {
  display: block;
  font-size: 15px;
  margin-bottom: 5px;
}

.upload-box span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.media-summary {
  display: grid;
  gap: 8px;
}

.media-tile {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 58px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.thumb {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--teal-soft);
  color: var(--teal);
  font-size: 11px;
  font-weight: 900;
}

.thumb.video {
  background: var(--blue-soft);
  color: var(--blue);
}

.media-name {
  min-width: 0;
  flex: 1;
}

.media-name strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}

.media-name span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.selected-preview {
  position: relative;
  width: 52px;
  height: 52px;
  flex: 0 0 auto;
  border-radius: 8px;
  overflow: hidden;
  background: var(--teal-soft);
  color: var(--teal);
  font-size: 11px;
  font-weight: 900;
}

.selected-preview.video {
  background: var(--blue-soft);
  color: var(--blue);
}

.selected-preview img,
.selected-preview video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.selected-preview span {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  background: linear-gradient(180deg, transparent 20%, rgba(0, 0, 0, 0.44) 100%);
  color: #ffffff;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}

.remove-media-button {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--coral-soft);
  color: var(--coral);
  font-size: 20px;
  font-weight: 900;
  line-height: 1;
}

.submit-button {
  width: 100%;
  min-height: 48px;
  border-radius: 8px;
  background: var(--teal);
  color: #ffffff;
  font-weight: 800;
  box-shadow: 0 10px 22px rgba(15, 118, 110, 0.18);
}

.submit-button:active {
  transform: translateY(1px);
}

.submit-button:disabled {
  opacity: 0.72;
  cursor: wait;
}

.upload-progress {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: none;
  place-items: center;
  padding: 20px;
  pointer-events: auto;
}

.upload-progress.visible {
  display: grid;
}

.upload-progress-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(12, 20, 18, 0.58);
  backdrop-filter: blur(5px);
}

.upload-progress-panel {
  position: relative;
  z-index: 1;
  width: min(100%, 328px);
  display: grid;
  gap: 12px;
  padding: 20px 18px 18px;
  border: 1px solid rgba(15, 118, 110, 0.18);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.3);
  animation: uploadPanelIn 180ms ease-out;
}

.upload-progress-mark {
  width: 52px;
  height: 52px;
  margin: 0 auto 2px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  border: 4px solid rgba(15, 118, 110, 0.14);
  border-top-color: var(--teal);
  color: var(--teal);
  font-weight: 900;
  animation: uploadSpin 960ms linear infinite;
}

.upload-progress-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--teal);
  font-size: 12px;
  font-weight: 900;
}

.upload-progress-track {
  height: 8px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(15, 118, 110, 0.12);
}

.upload-progress-bar {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--teal) 0%, var(--green) 100%);
  transition: width 180ms ease;
}

.upload-progress small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  text-align: center;
}

@keyframes uploadPanelIn {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes uploadSpin {
  to {
    transform: rotate(360deg);
  }
}

.toast {
  display: none;
  padding: 11px 12px;
  border-radius: 8px;
  background: var(--teal-soft);
  color: var(--teal);
  font-size: 13px;
  font-weight: 700;
}

.toast.visible {
  display: block;
}

.toast.error {
  background: var(--coral-soft);
  color: var(--coral);
}

.records-list {
  display: grid;
  gap: 10px;
}

.record-card {
  display: grid;
  gap: 10px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

.record-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.record-date {
  min-width: 0;
}

.record-date strong {
  display: block;
  font-size: 15px;
}

.record-date span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.record-media {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.media-chip {
  position: relative;
  aspect-ratio: 1 / 0.78;
  border: 0;
  border-radius: 8px;
  display: grid;
  place-items: end start;
  padding: 8px;
  color: #ffffff;
  font-size: 11px;
  font-weight: 900;
  overflow: hidden;
  text-align: left;
  background:
    linear-gradient(135deg, rgba(15, 118, 110, 0.86), rgba(22, 132, 81, 0.78)),
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.16) 6px, transparent 6px, transparent 12px);
}

.media-chip.video {
  background:
    linear-gradient(135deg, rgba(40, 104, 168, 0.9), rgba(232, 93, 63, 0.72)),
    repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.14) 7px, transparent 7px, transparent 14px);
}

.media-chip img,
.media-chip video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.media-chip::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 30%, rgba(0, 0, 0, 0.58) 100%);
}

.media-chip span {
  position: relative;
  z-index: 1;
  text-shadow: 0 1px 5px rgba(0, 0, 0, 0.45);
}

.media-chip:focus-visible {
  outline: 3px solid rgba(15, 118, 110, 0.34);
  outline-offset: 2px;
}

.preview-modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: end center;
  padding: 16px;
}

.preview-modal[hidden] {
  display: none;
}

.preview-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 16, 14, 0.58);
}

.preview-sheet {
  position: relative;
  width: min(100%, 390px);
  max-height: min(82vh, 720px);
  border-radius: 8px;
  background: #ffffff;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.32);
}

.preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 12px 10px;
  border-bottom: 1px solid var(--line);
}

.preview-head strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
}

.preview-tools {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 4px;
}

.preview-tool-button,
.preview-close {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: var(--teal-soft);
  color: var(--teal);
  cursor: pointer;
}

.preview-tool-button[hidden] {
  display: none;
}

.preview-close {
  font-size: 20px;
  line-height: 1;
}

.preview-body {
  position: relative;
  display: grid;
  place-items: center;
  min-height: min(58vh, 420px);
  max-height: calc(min(82vh, 720px) - 67px);
  background: #0f1513;
  overflow: hidden;
}

.preview-loading-state {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 28px;
  color: #f7fbfa;
  text-align: center;
  background: #0f1513;
}

.preview-loading-state[hidden] {
  display: none;
}

.preview-loading-state strong {
  font-size: 15px;
  line-height: 1.5;
}

.preview-loading-state span:not(.preview-loading-spinner) {
  color: #aebdb8;
  font-size: 13px;
  line-height: 1.5;
}

.preview-loading-spinner {
  width: 42px;
  height: 42px;
  border: 4px solid rgba(122, 207, 188, 0.22);
  border-top-color: #7acfbc;
  border-radius: 50%;
  animation: preview-spin 0.8s linear infinite;
}

.preview-retry-button {
  min-height: 40px;
  margin-top: 4px;
  padding: 0 18px;
  border: 0;
  border-radius: 6px;
  color: #0b4f43;
  font: inherit;
  font-weight: 700;
  background: #bfeee2;
  cursor: pointer;
}

.preview-retry-button:focus-visible {
  outline: 3px solid rgba(191, 238, 226, 0.45);
  outline-offset: 3px;
}

.preview-media-content {
  opacity: 0;
  transition: opacity 180ms ease;
}

.preview-media-content.is-ready {
  opacity: 1;
}

@keyframes preview-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .preview-loading-spinner {
    animation-duration: 1.6s;
  }

  .preview-media-content {
    transition: none;
  }
}

.preview-body.is-zoomable {
  cursor: zoom-in;
}

.preview-body.is-zoomed {
  place-items: center;
  cursor: grab;
  user-select: none;
  touch-action: none;
}

.preview-body.has-gallery:not(.is-zoomed) {
  touch-action: pan-y;
}

.preview-body.is-panning {
  cursor: grabbing;
}

.preview-body img,
.preview-body video {
  width: 100%;
  max-height: calc(min(82vh, 720px) - 67px);
  object-fit: contain;
  display: block;
}

.preview-zoom-target {
  transform:
    translate3d(var(--preview-pan-x, 0px), var(--preview-pan-y, 0px), 0)
    scale(var(--preview-scale, 1))
    rotate(var(--preview-rotation, 0deg));
  transform-origin: center center;
  transition: transform 120ms ease-out;
  user-select: none;
  -webkit-user-drag: none;
  will-change: transform;
}

.preview-nav-button {
  position: absolute;
  top: calc(50% + 28px);
  z-index: 4;
  display: grid;
  place-items: center;
  width: 44px;
  height: 52px;
  border: 0;
  border-radius: 6px;
  color: #103b34;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.22);
  transform: translateY(-50%);
  cursor: pointer;
}

.preview-nav-button.previous {
  left: 8px;
}

.preview-nav-button.next {
  right: 8px;
}

.preview-nav-button[hidden] {
  display: none;
}

.preview-nav-button:disabled {
  opacity: 0.35;
  cursor: default;
}

.preview-counter {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 4;
  padding: 5px 9px;
  border-radius: 999px;
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
  background: rgba(4, 12, 10, 0.72);
  pointer-events: none;
}

.preview-counter[hidden] {
  display: none;
}

.preview-tool-button:focus-visible,
.preview-close:focus-visible,
.preview-nav-button:focus-visible {
  outline: 3px solid rgba(22, 135, 119, 0.38);
  outline-offset: 2px;
}

.preview-body.is-panning .preview-zoom-target {
  transition: none;
}

.celebration-modal {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(15, 25, 22, 0.48);
  animation: celebrationFade 180ms ease-out;
}

.celebration-modal[hidden] {
  display: none;
}

.celebration-card {
  position: relative;
  width: min(100%, 344px);
  overflow: hidden;
  border: 1px solid rgba(15, 118, 110, 0.18);
  border-radius: 8px;
  background: #ffffff;
  padding: 20px 18px 18px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
  text-align: center;
  animation: celebrationPop 260ms cubic-bezier(.2, 1.25, .4, 1);
}

.celebration-badge {
  width: 70px;
  height: 70px;
  margin: 0 auto 12px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--color-success);
  color: #ffffff;
  font-size: 34px;
  font-weight: 900;
  box-shadow: 0 12px 24px rgba(15, 118, 110, 0.2);
  animation: celebrationBadge 720ms ease-in-out;
}

.celebration-title {
  margin: 0;
  font-size: 22px;
  letter-spacing: 0;
}

.celebration-phrase {
  margin: 10px 0 16px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.55;
  font-weight: 700;
}

.celebration-close {
  width: 100%;
  min-height: 42px;
  border-radius: 8px;
  background: var(--teal);
  color: #ffffff;
  font-weight: 900;
}

.celebration-spark {
  position: absolute;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  opacity: 0.82;
  animation: celebrationFloat 1400ms ease-in-out infinite;
}

.celebration-spark.one {
  left: 22px;
  top: 30px;
  background: var(--coral);
}

.celebration-spark.two {
  right: 30px;
  top: 48px;
  background: var(--blue);
  animation-delay: 120ms;
}

.celebration-spark.three {
  left: 54px;
  bottom: 34px;
  background: var(--amber);
  animation-delay: 240ms;
}

.celebration-spark.four {
  right: 58px;
  bottom: 28px;
  background: var(--green);
  animation-delay: 360ms;
}

@keyframes celebrationFade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes celebrationPop {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.94);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes celebrationBadge {
  0% {
    transform: scale(0.72) rotate(-8deg);
  }
  55% {
    transform: scale(1.12) rotate(4deg);
  }
  100% {
    transform: scale(1) rotate(0);
  }
}

@keyframes celebrationFloat {
  0%, 100% {
    transform: translateY(0) scale(1);
  }
  50% {
    transform: translateY(-8px) scale(1.18);
  }
}

.record-note {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.record-manage-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 42px;
  width: 100%;
  border: 1px solid #cde3dd;
  border-radius: 6px;
  color: var(--primary-dark);
  font: inherit;
  font-weight: 700;
  background: #f4fbf9;
  cursor: pointer;
}

.record-manage-button svg,
.record-media-add svg,
.record-media-delete svg {
  width: 18px;
  height: 18px;
}

.record-media-manager {
  display: grid;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.record-media-manager[hidden] {
  display: none;
}

.record-media-manager-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.record-media-manager-head > div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.record-media-manager-head strong {
  font-size: 14px;
}

.record-media-manager-head span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.record-media-add {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 0 12px;
  border-radius: 6px;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  background: var(--primary);
  cursor: pointer;
}

.record-media-manage-list {
  display: grid;
  gap: 6px;
}

.record-media-manage-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px;
  align-items: center;
  gap: 8px;
  min-height: 46px;
  padding: 4px 4px 4px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.record-media-manage-name {
  overflow: hidden;
  color: var(--text);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.record-media-delete {
  display: grid;
  place-items: center;
  width: 42px;
  height: 38px;
  border: 0;
  border-radius: 6px;
  color: #b42318;
  background: #fff1f0;
  cursor: pointer;
}

.record-media-delete:disabled {
  color: #9da8a5;
  background: #eef2f1;
  cursor: not-allowed;
}

.records-list.is-media-busy .record-manage-button,
.records-list.is-media-busy .record-media-add,
.records-list.is-media-busy .record-media-delete {
  pointer-events: none;
  opacity: 0.58;
}

.user-media-delete-dialog {
  width: min(88vw, 380px);
  padding: 0;
  border: 0;
  border-radius: 8px;
  color: var(--text);
  background: #fff;
  box-shadow: 0 20px 60px rgba(15, 38, 32, 0.25);
}

.user-media-delete-dialog::backdrop {
  background: rgba(10, 24, 20, 0.62);
  backdrop-filter: blur(3px);
}

.user-media-delete-card {
  display: grid;
  gap: 12px;
  padding: 22px;
  text-align: center;
}

.user-media-delete-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  margin: 0 auto;
  border-radius: 50%;
  color: #b42318;
  background: #fff1f0;
}

.user-media-delete-icon svg {
  width: 22px;
  height: 22px;
}

.user-media-delete-card h3,
.user-media-delete-card p {
  margin: 0;
}

.user-media-delete-card p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.user-media-delete-card p strong {
  color: var(--text);
  overflow-wrap: anywhere;
}

.user-media-delete-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 4px;
}

.user-media-delete-actions button {
  min-height: 44px;
  border: 0;
  border-radius: 6px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

#user-media-delete-cancel {
  color: var(--text);
  background: #edf3f1;
}

#user-media-delete-confirm {
  color: #fff;
  background: #c4382d;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  margin-bottom: 12px;
}

.segment {
  min-height: 38px;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.segment.active {
  background: var(--teal);
  color: #ffffff;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.stat {
  min-height: 82px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  display: grid;
  align-content: space-between;
}

.stat.primary {
  grid-column: span 2;
  color: #ffffff;
  background: linear-gradient(135deg, #0f766e 0%, #168451 100%);
  border-color: transparent;
}

.stat span {
  color: inherit;
  opacity: 0.76;
  font-size: 12px;
  font-weight: 700;
}

.stat strong {
  margin-top: 8px;
  font-size: 24px;
  letter-spacing: 0;
}

.report-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.report-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 50px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #ffffff;
}

.report-row strong {
  font-size: 13px;
}

.report-row span {
  color: var(--muted);
  font-size: 12px;
}

.calendar-panel {
  grid-column: span 2;
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.calendar-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.calendar-toolbar strong {
  font-size: 16px;
}

.calendar-actions {
  display: flex;
  gap: 6px;
}

.calendar-action {
  min-width: 34px;
  min-height: 34px;
  border-radius: 8px;
  background: var(--teal-soft);
  color: var(--teal);
  font-size: 13px;
  font-weight: 800;
}

.calendar-weekdays,
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.calendar-weekdays {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-align: center;
}

.calendar-day {
  min-height: 64px;
  padding: 5px;
  border: 1px solid var(--line);
  background: #fbfdfc;
  display: grid;
  align-content: start;
  gap: 3px;
}

.calendar-day.is-muted {
  color: #a3aaa7;
  background: #f1f4f3;
}

.calendar-day.is-today {
  border-color: rgba(15, 118, 110, 0.42);
  box-shadow: inset 0 0 0 1px rgba(15, 118, 110, 0.18);
}

.calendar-date {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  font-size: 11px;
  font-weight: 900;
}

.calendar-state {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  padding: 2px 4px;
  border-radius: 6px;
  font-size: 9px;
  font-weight: 900;
  line-height: 1.2;
  white-space: nowrap;
  color: var(--teal);
  background: var(--teal-soft);
}

.calendar-state.makeup {
  color: var(--amber);
  background: var(--amber-soft);
}

.calendar-state.missed {
  color: var(--coral);
  background: var(--coral-soft);
}

.calendar-count {
  color: var(--muted);
  font-size: 9px;
  line-height: 1.2;
}

.calendar-makeup {
  width: 100%;
  min-height: 24px;
  padding: 0 4px;
  border-radius: 7px;
  background: var(--coral);
  color: #ffffff;
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
}

.bottom-nav {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  padding: 9px 12px 12px;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(10px);
}

.nav-button {
  display: grid;
  place-items: center;
  gap: 3px;
  min-height: 58px;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.nav-icon {
  width: 22px;
  height: 22px;
  display: block;
}

.upload-visual svg {
  width: 28px;
  height: 28px;
}

.preview-close svg,
.admin-dialog header button svg,
.admin-media-dialog header button svg {
  width: 19px;
  height: 19px;
}

.celebration-badge svg {
  width: 31px;
  height: 31px;
}

.admin-mobile-nav button > i[data-lucide],
.admin-mobile-nav button > svg[data-lucide],
.admin-nav button > i[data-lucide],
.admin-nav button > svg[data-lucide] {
  width: 18px;
  height: 18px;
}

.nav-button.active {
  background: var(--teal-soft);
  color: var(--teal);
}

@media (min-width: 768px) {
  .preview-modal {
    place-items: center;
    padding: 32px;
  }

  .preview-sheet {
    width: min(92vw, 980px);
    max-height: 90vh;
  }

  .preview-body {
    max-height: calc(90vh - 57px);
  }

  .preview-body img,
  .preview-body video {
    width: auto;
    max-width: 100%;
    max-height: calc(90vh - 57px);
    height: auto;
  }
}

@media (max-width: 430px) {
  html,
  body {
    height: 100%;
  }

  body:not(.auth-view-active) {
    overflow: hidden;
  }

  body.auth-view-active {
    height: auto;
    min-height: 100%;
    overflow-y: auto;
  }

  .stage {
    height: 100dvh;
    min-height: 100dvh;
    padding: 0;
  }

  .phone {
    width: 100%;
    height: 100dvh;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .topbar {
    padding: 14px 16px 8px;
  }

  .content {
    padding: 12px 12px 10px;
  }

  #panel-reports .section-title {
    margin-bottom: 6px;
  }

  #panel-reports .stats-grid {
    gap: 8px;
  }

  .section-title {
    margin-bottom: 8px;
  }

  .segmented {
    margin-bottom: 8px;
  }

  .calendar-panel {
    padding: 9px;
  }

  .calendar-toolbar strong {
    font-size: 15px;
  }

  .calendar-action {
    min-width: 32px;
    min-height: 32px;
  }

  .calendar-day {
    min-height: 60px;
    padding: 4px;
  }

  .calendar-day.is-muted .calendar-count,
  .calendar-day.is-muted .calendar-state {
    display: none;
  }

  .report-list {
    margin-top: 6px;
  }

  .bottom-nav {
    padding: 7px 12px 10px;
  }

  .nav-button {
    min-height: 54px;
  }
}

[hidden] {
  display: none !important;
}

.app-view {
  min-height: 100vh;
}

.login-view {
  min-height: 100dvh;
  height: 100dvh;
  display: flex;
  align-items: flex-start;
  overflow-y: auto;
  padding: 24px;
  background: #f3f7f5;
}

.login-panel {
  width: min(100%, 380px);
  flex: 0 0 auto;
  margin: auto;
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.login-brand {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--teal);
  color: #ffffff;
  font-weight: 800;
}

.login-kicker,
.admin-kicker {
  margin: 22px 0 6px;
  color: var(--teal);
  font-size: 13px;
  font-weight: 800;
}

.login-panel h1 {
  margin: 0;
  font-size: 28px;
}

.login-copy {
  margin: 10px 0 24px;
  color: var(--muted);
  line-height: 1.6;
}

.login-form {
  display: grid;
  gap: 9px;
}

.login-form label {
  margin-top: 5px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
}

.login-form input {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: none;
}

.login-form input:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}

.login-button {
  min-height: 48px;
  margin-top: 10px;
  border-radius: 8px;
  background: var(--teal);
  color: #ffffff;
  font-weight: 800;
}

.login-button:disabled,
.text-button:disabled {
  opacity: 0.65;
  cursor: wait;
}

.login-error {
  margin: 4px 0 0;
  color: #b42318;
  font-size: 13px;
  line-height: 1.5;
}

.session-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 9px;
  color: var(--muted);
  font-size: 12px;
}

.text-button {
  padding: 6px 0;
  background: transparent;
  color: var(--teal);
  font-weight: 800;
}

.admin-view {
  background: #f3f7f5;
}

.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px max(24px, calc((100vw - 1040px) / 2));
  border-bottom: 1px solid var(--line);
  background: #ffffff;
}

.admin-header p,
.admin-header h1 {
  margin: 0;
}

.admin-header p {
  color: var(--muted);
  font-size: 12px;
}

.admin-header h1 {
  margin-top: 3px;
  font-size: 20px;
}

.admin-content {
  width: min(100% - 32px, 1040px);
  margin: 0 auto;
  padding: 56px 0;
}

.admin-content h2 {
  margin: 0 0 10px;
  font-size: 24px;
}

.admin-content p:last-child {
  color: var(--muted);
}

.public-notice {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 100;
  max-width: calc(100vw - 32px);
  transform: translateX(-50%);
  padding: 10px 14px;
  border-radius: 8px;
  background: #15201d;
  color: #ffffff;
  font-size: 13px;
  box-shadow: 0 10px 30px rgba(21, 32, 29, 0.2);
}

/* Administrator workspace */
.session-actions,
.admin-header-actions,
.admin-row-actions,
.admin-pagination {
  display: flex;
  align-items: center;
  gap: 10px;
}

.admin-view {
  min-height: 100dvh;
  height: 100dvh;
  background: #f4f6f5;
  overflow: auto;
}

.admin-shell {
  min-height: 100dvh;
}

.admin-sidebar {
  display: none;
}

.admin-workspace {
  min-width: 0;
}

.admin-header {
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: 68px;
  padding: 13px 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
}

.admin-header p,
.admin-header strong {
  margin: 0;
}

.admin-header strong {
  display: block;
  margin-top: 3px;
  font-size: 15px;
}

.admin-header-actions .admin-switch-button {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 7px 9px;
  white-space: nowrap;
  font-size: 12px;
}

.admin-switch-button,
.admin-secondary-button,
.admin-primary-button,
.admin-row-action {
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #ffffff;
  color: var(--ink);
  font-weight: 700;
}

.admin-primary-button {
  border-color: var(--teal);
  background: var(--teal);
  color: #ffffff;
}

.admin-action-icon {
  display: inline-flex;
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  vertical-align: -3px;
}

.admin-secondary-button:disabled,
.admin-row-action:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.admin-content {
  width: min(100% - 28px, 1160px);
  margin: 0 auto;
  padding: 24px 0 104px;
}

.admin-panel {
  display: none;
}

.admin-panel.active {
  display: block;
  animation: fadeIn 160ms ease;
}

.admin-page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.admin-page-heading p,
.admin-page-heading h1 {
  margin: 0;
}

.admin-page-heading p {
  margin-bottom: 4px;
  color: var(--teal);
  font-size: 12px;
  font-weight: 800;
}

.admin-page-heading h1 {
  font-size: 25px;
  line-height: 1.25;
}

.admin-page-heading > span {
  color: var(--muted);
  font-size: 12px;
}

.admin-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.admin-metrics article {
  min-height: 104px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.admin-metrics span,
.admin-metrics strong {
  display: block;
}

.admin-metrics span {
  color: var(--muted);
  font-size: 13px;
}

.admin-metrics strong {
  margin-top: 12px;
  font-size: 29px;
  line-height: 1;
}

.admin-overview-band {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 22px;
  padding: 20px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.admin-overview-band h2,
.admin-overview-band p {
  margin: 0;
}

.admin-overview-band h2 {
  font-size: 16px;
}

.admin-overview-band p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
}

.admin-today-heading {
  align-items: flex-start;
  flex-direction: column;
}

.admin-today-heading .ai-sparkle {
  width: 17px;
  height: 17px;
  margin-right: 3px;
  vertical-align: -4px;
}

.admin-today-date-controls {
  display: grid;
  grid-template-columns: 40px minmax(124px, 1fr) 40px;
  gap: 7px;
  width: min(100%, 280px);
}

.admin-icon-button {
  display: inline-grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #ffffff;
  color: var(--teal);
}

.admin-icon-button i,
.admin-icon-button svg {
  width: 18px;
  height: 18px;
}

.admin-today-date {
  position: relative;
  min-width: 0;
}

.admin-today-date span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.admin-today-date input {
  width: 100%;
  height: 40px;
  min-width: 0;
  padding: 7px 8px;
  border: 1px solid #cfd9d5;
  border-radius: 7px;
  background: #ffffff;
  color: var(--ink);
}

.admin-today-back {
  grid-column: 1 / -1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 38px;
}

.admin-today-content {
  position: relative;
  min-height: 480px;
}

#admin-today-data[hidden] {
  display: block;
  visibility: hidden;
  pointer-events: none;
}

#admin-today-feedback:not([hidden]) {
  position: absolute;
  inset: 0 0 auto;
  z-index: 2;
  width: 100%;
  background: #f4f6f5;
}

#admin-today-feedback:not(:empty) {
  margin-bottom: 16px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.admin-today-metrics article {
  position: relative;
  overflow: hidden;
}

.admin-today-metrics article::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 3px;
  background: var(--teal);
}

.admin-today-metrics span i,
.admin-today-metrics span svg {
  width: 14px;
  height: 14px;
  margin-right: 6px;
  vertical-align: -2px;
}

.admin-today-metrics .is-checked::before {
  background: var(--green);
}

.admin-today-metrics .is-missing::before {
  background: var(--coral);
}

.admin-today-metrics .is-makeup::before {
  background: var(--amber);
}

.admin-storage-card {
  --storage-accent: var(--green);
  margin-top: 18px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(20, 52, 47, 0.06);
}

.admin-storage-card.warning { --storage-accent: var(--amber); }
.admin-storage-card.danger,
.admin-storage-card.error { --storage-accent: var(--coral); }
.admin-storage-card.unavailable { --storage-accent: var(--muted); }

.admin-storage-heading,
.admin-storage-title-row,
.admin-storage-body,
.admin-storage-footer {
  display: flex;
  align-items: center;
}

.admin-storage-heading,
.admin-storage-footer { justify-content: space-between; gap: 14px; }
.admin-storage-title-row { gap: 12px; min-width: 0; }
.admin-storage-title-row h2 { margin: 0; font-size: 17px; }
.admin-storage-title-row p { margin: 3px 0 0; color: var(--muted); font-size: 13px; }
.admin-storage-icon { display: grid; width: 38px; height: 38px; place-items: center; border-radius: 8px; color: var(--storage-accent); background: #edf6f3; background: color-mix(in srgb, var(--storage-accent) 11%, white); }
.admin-storage-icon svg { width: 19px; height: 19px; }
.admin-storage-body { align-items: stretch; gap: 20px; margin-top: 20px; }
.admin-storage-percent { flex: 0 0 92px; }
.admin-storage-percent strong { display: block; color: var(--storage-accent); font-size: 30px; line-height: 1; }
.admin-storage-percent span,
.admin-storage-meter p,
.admin-storage-details dt,
.admin-storage-footer { color: var(--muted); font-size: 12px; }
.admin-storage-meter { flex: 1; align-self: center; min-width: 140px; }
.admin-storage-track { overflow: hidden; height: 10px; border-radius: 5px; background: #e8efed; }
.admin-storage-track span { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--storage-accent); transition: width 500ms ease; }
.admin-storage-meter p { margin: 8px 0 0; }
.admin-storage-meter p strong { color: var(--ink); }
.admin-storage-details { display: grid; grid-template-columns: repeat(2, minmax(90px, 1fr)); gap: 18px; margin: 0; }
.admin-storage-details div { min-width: 0; }
.admin-storage-details dd { margin: 5px 0 0; color: var(--ink); font-weight: 700; }
.admin-storage-footer { align-items: flex-start; margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); }
.admin-storage-refresh[aria-busy="true"] svg { animation: admin-storage-spin 800ms linear infinite; }
@keyframes admin-storage-spin { to { transform: rotate(360deg); } }

@media (max-width: 620px) {
  .admin-storage-body { flex-wrap: wrap; }
  .admin-storage-percent { flex-basis: 100%; }
  .admin-storage-details { width: 100%; }
  .admin-storage-footer { flex-direction: column; }
}

.admin-today-lists {
  display: grid;
  gap: 22px;
  margin-top: 28px;
}

.admin-today-lists > section,
.admin-today-recent {
  min-width: 0;
  border-top: 1px solid var(--line);
}

.admin-today-lists header,
.admin-today-recent > header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 2px 10px;
}

.admin-today-lists h2,
.admin-today-recent h2 {
  margin: 0;
  font-size: 16px;
}

.admin-today-lists header span,
.admin-today-recent header span {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 11px;
}

.admin-today-people,
.admin-today-recent-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.admin-today-person,
.admin-today-recent-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 58px;
  padding: 9px 2px;
  border-bottom: 1px solid var(--line);
}

.admin-today-identity {
  min-width: 0;
}

.admin-today-identity strong,
.admin-today-identity small {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-today-identity strong {
  font-size: 13px;
}

.admin-today-identity small,
.admin-today-recent-row time {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.admin-today-state {
  width: 54px;
  min-height: 26px;
  padding: 5px 6px;
  border-radius: 5px;
  background: #eef1f0;
  color: #53605c;
  font-size: 11px;
  font-weight: 800;
  line-height: 16px;
  text-align: center;
  white-space: nowrap;
}

.admin-today-state.checked,
.admin-today-state.normal {
  background: var(--green-soft);
  color: var(--green);
}

.admin-today-state.missing {
  background: var(--coral-soft);
  color: #a73b2b;
}

.admin-today-state.makeup {
  background: var(--amber-soft);
  color: #8a5b15;
}

.admin-today-recent {
  margin-top: 28px;
}

.admin-today-recent-row {
  grid-template-columns: minmax(0, 1fr) 48px 54px;
}

.admin-today-recent-row time {
  margin: 0;
  text-align: right;
  white-space: nowrap;
}

.admin-filter {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 16px;
  padding: 14px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #ffffff;
}

.admin-filter label,
.admin-dialog-field {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.admin-filter input,
.admin-filter select,
.admin-dialog-field input,
.admin-dialog-field select,
.admin-dialog-field textarea {
  width: 100%;
  min-height: 44px;
  padding: 9px 10px;
  border: 1px solid #cfd9d5;
  border-radius: 7px;
  background: #ffffff;
  color: var(--ink);
  outline: none;
}

.admin-filter input:focus,
.admin-filter select:focus,
.admin-dialog-field input:focus,
.admin-dialog-field select:focus,
.admin-dialog-field textarea:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.1);
}

.admin-filter .admin-check {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
}

.admin-filter .admin-check input {
  width: 18px;
  min-height: 18px;
}

.admin-filter-panel {
  margin-bottom: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.admin-filter-panel > summary {
  display: flex;
  min-height: 44px;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  cursor: pointer;
  font-weight: 750;
}

.admin-filter-panel .admin-filter {
  margin: 0;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
}

.admin-filter-actions {
  display: flex;
  align-items: end;
  justify-content: flex-end;
  gap: 8px;
}

.admin-filter-actions button {
  min-height: 44px;
}

.admin-filter-tags {
  display: flex;
  min-height: 28px;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.admin-filter-tag {
  display: inline-flex;
  max-width: 100%;
  align-items: center;
  padding: 4px 8px;
  border: 1px solid #b8ddd7;
  border-radius: 999px;
  background: #effaf8;
  color: #176b63;
  font-size: 12px;
  overflow-wrap: anywhere;
}

.admin-user-discovery {
  display: grid;
  gap: 12px;
  margin-bottom: 10px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}

.admin-user-search,
.admin-user-state-filter,
.admin-user-role-filter {
  display: grid;
  min-width: 0;
  gap: 6px;
  margin: 0;
  padding: 0;
  border: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.admin-user-search-control {
  position: relative;
  display: block;
}

.admin-user-search-control i,
.admin-user-search-control svg {
  position: absolute;
  top: 12px;
  left: 11px;
  width: 18px;
  height: 18px;
  color: var(--muted);
  pointer-events: none;
}

.admin-user-search input,
.admin-user-state-filter select {
  width: 100%;
  min-height: 44px;
  padding: 9px 10px;
  border: 1px solid #cfd9d5;
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
}

.admin-user-search input {
  padding-left: 38px;
}

.admin-user-search input:focus,
.admin-user-state-filter select:focus {
  border-color: var(--teal);
  outline: none;
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.1);
}

.admin-user-segments {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  overflow: hidden;
  min-height: 44px;
  border: 1px solid #cfd9d5;
  border-radius: 7px;
}

.admin-user-segments label {
  position: relative;
  display: grid;
  min-width: 0;
  min-height: 44px;
  place-items: center;
  border-left: 1px solid #cfd9d5;
  color: var(--ink);
  cursor: pointer;
}

.admin-user-segments label:first-child {
  border-left: 0;
}

.admin-user-segments input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.admin-user-segments label:has(input:checked) {
  background: var(--teal-soft);
  color: var(--teal);
}

.admin-user-segments label:has(input:focus-visible) {
  box-shadow: inset 0 0 0 2px var(--teal);
}

.admin-user-clear {
  align-self: end;
  min-width: 44px;
  min-height: 44px;
}

.admin-user-filter-summary {
  min-height: 20px;
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 12px;
}

.admin-users-feedback {
  min-height: 0;
}

.admin-users-refreshing {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 12px;
}

.admin-list {
  border-top: 1px solid var(--line);
}

.admin-data-row {
  display: grid;
  gap: 10px;
  padding: 16px 2px;
  border-bottom: 1px solid var(--line);
  background: transparent;
}

.admin-data-row.is-deleted {
  opacity: 0.72;
}

.admin-row-main {
  min-width: 0;
}

.admin-row-main strong,
.admin-row-main small {
  display: block;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.admin-user-updated {
  color: #7a8581;
  line-height: 1.45;
}

.admin-user-row,
.admin-user-row > * {
  min-width: 0;
}

.admin-user-identity strong,
.admin-user-identity small {
  overflow: hidden;
  max-width: 100%;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow-wrap: normal;
  word-break: normal;
}

.admin-user-actions {
  position: relative;
  justify-content: flex-end;
}

.admin-user-desktop-actions {
  display: none;
}

.admin-user-mobile-actions {
  position: relative;
}

.admin-user-mobile-actions summary,
.admin-user-icon-action {
  display: inline-grid;
  width: 44px;
  height: 44px;
  padding: 0;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  list-style: none;
}

.admin-user-mobile-actions summary::-webkit-details-marker {
  display: none;
}

.admin-user-mobile-actions svg,
.admin-user-icon-action svg {
  width: 17px;
  height: 17px;
}

.admin-user-action-menu {
  position: absolute;
  z-index: 5;
  right: 0;
  display: grid;
  width: 150px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  box-shadow: 0 10px 26px rgba(21, 32, 29, 0.16);
}

.admin-user-menu-action {
  display: flex;
  min-width: 44px;
  min-height: 44px;
  align-items: center;
  gap: 8px;
  padding: 7px 9px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.admin-user-menu-action svg {
  width: 16px;
  height: 16px;
}

.admin-user-menu-action.danger,
.admin-user-icon-action.danger {
  color: #b23b2b;
}

.admin-user-menu-action:disabled,
.admin-user-icon-action:disabled {
  opacity: 0.45;
}

.admin-row-main small,
.admin-checkin-meta,
.admin-log-row > p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.admin-status {
  width: fit-content;
  padding: 4px 7px;
  border-radius: 5px;
  background: #eef1f0;
  color: #53605c;
  font-size: 11px;
  font-weight: 800;
}

.admin-status.active {
  background: var(--green-soft);
  color: var(--green);
}

.admin-status.inactive {
  background: #fbe9e6;
  color: #a73b2b;
}

.admin-status.admin,
.admin-status.makeup {
  background: var(--blue-soft);
  color: var(--blue);
}

.admin-row-actions {
  flex-wrap: wrap;
}

.admin-row-action {
  min-height: 34px;
  padding: 6px 10px;
  font-size: 12px;
}

.admin-row-action.danger {
  color: #b23b2b;
}

.admin-checkin-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.admin-checkin-note,
.admin-log-row p {
  margin: 0;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.admin-media-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.admin-media-thumb {
  width: 58px;
  aspect-ratio: 1;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 11px;
  font-weight: 800;
}

.admin-delete-reason {
  flex: 1 1 100%;
  color: #9b4537;
}

.admin-list-message {
  margin: 0;
  padding: 28px 4px;
  color: var(--muted);
  text-align: center;
}

.admin-list-message.error,
.admin-form-error {
  color: #b42318;
}

.admin-log-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.admin-log-head time {
  color: var(--muted);
  font-size: 11px;
}

.admin-log-reason {
  color: var(--ink) !important;
}

.admin-log-details summary {
  color: var(--teal);
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}

.admin-log-compare {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.admin-log-compare > div {
  min-width: 0;
  padding: 10px;
  border-left: 3px solid var(--line);
  background: #ffffff;
}

.admin-log-compare pre {
  max-height: 260px;
  margin: 8px 0 0;
  overflow: auto;
  color: #34413d;
  font: 11px/1.55 ui-monospace, SFMono-Regular, Consolas, monospace;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.admin-pagination {
  justify-content: center;
  margin-top: 20px;
}

.admin-pagination span {
  min-width: 90px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.admin-rewards-heading .admin-icon-button {
  width: 44px;
  height: 44px;
}

.admin-reward-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 18px;
  border-block: 1px solid var(--line);
}

.admin-reward-metrics > div {
  min-width: 0;
  padding: 14px 10px;
}

.admin-reward-metrics > div + div {
  border-left: 1px solid var(--line);
}

.admin-reward-metrics span,
.admin-reward-metrics strong {
  display: block;
  overflow-wrap: anywhere;
}

.admin-reward-metrics span {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.admin-reward-metrics strong {
  margin-top: 5px;
  color: var(--ink);
  font-size: 22px;
  line-height: 1.15;
}

.admin-reward-filter {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.admin-reward-filter label {
  display: grid;
  min-width: 0;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.admin-reward-filter select {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 9px 34px 9px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #ffffff;
  color: var(--ink);
}

.admin-reward-filter .admin-primary-button {
  grid-column: 1 / -1;
  min-height: 44px;
}

.admin-rewards-list,
.admin-reward-row > * {
  min-width: 0;
}

.admin-reward-row {
  min-width: 0;
}

.admin-reward-main strong,
.admin-reward-main small,
.admin-reward-main p {
  overflow-wrap: anywhere;
}

.admin-reward-main small {
  margin-top: 3px;
  color: var(--muted);
  line-height: 1.45;
}

.admin-reward-encouragement,
.admin-reward-condition-change {
  margin: 7px 0 0;
  font-size: 12px;
  line-height: 1.5;
}

.admin-reward-encouragement {
  color: var(--green);
}

.admin-reward-condition-change {
  color: var(--amber);
  font-weight: 700;
}

.admin-reward-row .admin-status {
  justify-self: start;
}

.admin-status.pending {
  background: var(--amber-soft);
  color: #855814;
}

.admin-status.redeemed {
  background: var(--green-soft);
  color: var(--green);
}

.admin-status.revoked,
.admin-status.unknown {
  background: var(--coral-soft);
  color: var(--coral);
}

.admin-status.historical_skipped {
  background: #eef1ef;
  color: var(--muted);
}

.admin-reward-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.admin-reward-actions button {
  min-width: 72px;
  min-height: 40px;
}

.admin-reward-empty {
  display: grid;
  justify-items: center;
  gap: 5px;
  padding: 32px 12px;
  color: var(--muted);
  text-align: center;
}

.admin-reward-empty i,
.admin-reward-empty svg {
  width: 24px;
  height: 24px;
  color: var(--teal);
}

.admin-reward-empty strong {
  color: var(--ink);
  font-size: 14px;
}

.admin-reward-skeleton {
  min-height: 78px;
  color: transparent;
  background: linear-gradient(90deg, #f1f4f2 25%, #e5ebe8 50%, #f1f4f2 75%);
  background-size: 200% 100%;
  animation: adminSkeleton 1.3s ease-in-out infinite;
}

.admin-mobile-nav {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  padding: 7px 8px calc(7px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 -8px 24px rgba(21, 32, 29, 0.08);
}

.admin-mobile-nav button,
.admin-nav button {
  display: grid;
  place-items: center;
  gap: 3px;
  min-height: 50px;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.admin-mobile-nav button {
  min-width: 0;
  padding-inline: 2px;
}

.admin-mobile-nav button span {
  font-size: 18px;
}

.admin-mobile-nav button.active,
.admin-nav button.active {
  color: var(--teal);
}

.admin-action-panel,
.admin-dialog,
.admin-media-dialog {
  max-height: calc(100dvh - 96px);
  padding: 0;
  overflow: auto;
  border: 0;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 24px 80px rgba(21, 32, 29, 0.28);
}

.admin-log-summary {
  color: var(--ink) !important;
  font-size: 14px !important;
}

.admin-log-meta {
  color: var(--muted);
  font-size: 12px;
}

.admin-log-details h4 {
  margin: 12px 0 6px;
  font-size: 13px;
}

.admin-log-details pre {
  max-height: 260px;
  margin: 0;
  padding: 10px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f7f9f8;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.admin-dialog,
.admin-media-dialog {
  width: min(calc(100% - 24px), 520px);
}

.admin-action-panel {
  inset: 6px 6px 6px auto;
  width: min(calc(100% - 12px), 560px);
  max-width: none;
  height: calc(100dvh - 12px);
  max-height: calc(100dvh - 12px);
  margin: 0;
  transform: translateX(24px);
  opacity: 0;
}

.admin-action-panel[open] {
  transform: translateX(0);
  opacity: 1;
  transition: transform 180ms ease, opacity 180ms ease;
}

.admin-action-panel form {
  display: grid;
  min-height: 100%;
  grid-template-rows: auto 1fr auto auto;
}

.admin-action-panel::backdrop,
.admin-dialog::backdrop,
.admin-media-dialog::backdrop {
  background: rgba(17, 29, 25, 0.54);
}

.admin-action-panel form > header,
.admin-action-panel form > footer,
.admin-dialog form > header,
.admin-media-dialog > header,
.admin-dialog form > footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
}

.admin-action-panel form > header,
.admin-dialog form > header,
.admin-media-dialog > header {
  border-bottom: 1px solid var(--line);
}

.admin-action-panel form > footer,
.admin-dialog form > footer {
  position: sticky;
  bottom: 0;
  justify-content: flex-end;
  border-top: 1px solid var(--line);
  background: #ffffff;
}

.admin-action-panel header h2,
.admin-action-panel header small,
.admin-dialog header h2,
.admin-dialog header small {
  margin: 0;
}

.admin-action-panel header h2,
.admin-dialog header h2 {
  margin-top: 3px;
  font-size: 19px;
}

.admin-action-panel header small,
.admin-dialog header small {
  color: var(--muted);
}

.admin-action-panel header button,
.admin-dialog header button,
.admin-media-dialog header button {
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #eef2f0;
  color: var(--ink);
  font-size: 22px;
}

.admin-dialog-fields {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.admin-dialog-field textarea {
  resize: vertical;
}

.admin-field-error {
  color: #b42318;
  font-size: 12px;
  font-weight: 600;
}

.admin-action-context {
  display: grid;
  gap: 8px;
  padding: 12px;
  border-left: 3px solid var(--coral);
  background: var(--coral-soft);
}

.admin-action-context p {
  margin: 0;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.5;
}

.admin-action-context strong {
  color: #9b3427;
}

.admin-form-error {
  margin: 0;
  padding: 0 18px 12px;
  font-size: 13px;
}

.admin-discard-dialog {
  width: min(calc(100% - 24px), 420px);
}

.admin-discard-content > header,
.admin-discard-content > footer {
  display: flex;
  gap: 12px;
  padding: 16px 18px;
}

.admin-discard-content > header {
  border-bottom: 1px solid var(--line);
}

.admin-discard-content > footer {
  justify-content: flex-end;
  border-top: 1px solid var(--line);
}

.admin-discard-content > p {
  margin: 0;
  padding: 18px;
  color: var(--muted);
}

.admin-danger-button {
  min-height: 44px;
  padding: 9px 14px;
  border-radius: 7px;
  background: #b42318;
  color: #fff;
  font-weight: 800;
}

#admin-media-body {
  display: grid;
  place-items: center;
  min-height: 240px;
  padding: 16px;
  background: #111815;
}

#admin-media-body img,
#admin-media-body video {
  display: block;
  max-width: 100%;
  max-height: 70dvh;
  object-fit: contain;
}

.admin-toast {
  position: fixed;
  right: 16px;
  bottom: calc(78px + env(safe-area-inset-bottom));
  z-index: 80;
  max-width: calc(100vw - 32px);
  padding: 11px 14px;
  border-radius: 7px;
  background: #17221f;
  color: #ffffff;
  font-size: 13px;
  box-shadow: 0 12px 34px rgba(21, 32, 29, 0.24);
}

@media (min-width: 900px) {
  .admin-action-panel {
    inset: 0 0 0 auto;
    width: min(480px, 42vw);
    height: 100dvh;
    max-height: 100dvh;
    border-radius: 8px 0 0 8px;
  }

  .admin-shell {
    display: grid;
    grid-template-columns: 228px minmax(0, 1fr);
  }

  .admin-sidebar {
    position: sticky;
    top: 0;
    display: flex;
    height: 100dvh;
    flex-direction: column;
    padding: 22px 16px;
    border-right: 1px solid #24322e;
    background: #17231f;
    color: #ffffff;
  }

  .admin-brand {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 0 7px 22px;
  }

  .admin-brand > span {
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    border-radius: 7px;
    background: var(--coral);
    font-size: 13px;
    font-weight: 800;
  }

  .admin-brand strong,
  .admin-brand small {
    display: block;
  }

  .admin-brand small {
    margin-top: 3px;
    color: #9eaaa6;
    font-size: 11px;
  }

  .admin-nav {
    display: grid;
    gap: 5px;
  }

  .admin-nav button {
    grid-template-columns: 28px 1fr;
    place-items: center start;
    min-height: 44px;
    padding: 0 12px;
    border-radius: 7px;
    color: #aeb9b5;
    font-size: 13px;
  }

  .admin-nav button.active {
    background: #263630;
    color: #ffffff;
  }

  .admin-sidebar-footer {
    display: grid;
    gap: 4px;
    margin-top: auto;
    padding: 14px 6px 0;
    border-top: 1px solid #31413b;
  }

  .admin-sidebar-footer .admin-switch-button,
  .admin-sidebar-footer .text-button {
    border-color: #41514b;
    background: transparent;
    color: #e6ece9;
  }

  .admin-mobile-nav {
    display: none;
  }

  .admin-header {
    padding: 13px 30px;
  }

  .admin-header-actions .admin-switch-button {
    display: none;
  }

  .admin-content {
    width: min(100% - 60px, 1160px);
    padding: 34px 0 56px;
  }

  .admin-metrics {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
  }

  .admin-metrics article {
    min-height: 126px;
    padding: 20px;
  }

  .admin-today-heading {
    align-items: flex-end;
    flex-direction: row;
  }

  .admin-today-date-controls {
    grid-template-columns: 40px 150px 40px auto;
    width: auto;
  }

  .admin-today-back {
    grid-column: auto;
  }

  .admin-today-lists {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 30px;
  }

  .admin-today-recent-row {
    grid-template-columns: minmax(220px, 1fr) 80px 68px;
  }

  .admin-filter {
    grid-template-columns: minmax(170px, 1.4fr) repeat(2, minmax(145px, 1fr)) auto auto;
    align-items: end;
  }

  .admin-reward-filter {
    grid-template-columns: minmax(190px, 1fr) minmax(190px, 1fr) auto;
    align-items: end;
  }

  .admin-reward-filter .admin-primary-button {
    grid-column: auto;
    min-width: 104px;
  }

  .admin-reward-row {
    grid-template-columns: minmax(280px, 1fr) 110px minmax(170px, auto);
    align-items: center;
  }

  .admin-reward-row .admin-row-actions {
    justify-content: flex-end;
  }

  .admin-user-discovery {
    grid-template-columns: minmax(220px, 1.5fr) minmax(260px, 1.2fr) minmax(150px, 0.7fr) auto;
    align-items: end;
  }

  .admin-user-desktop-actions {
    display: flex;
    gap: 6px;
  }

  .admin-user-mobile-actions {
    display: none;
  }

  .admin-user-row {
    grid-template-columns: minmax(210px, 2fr) 100px 90px minmax(250px, auto);
    align-items: center;
  }

  .admin-user-row .admin-row-actions {
    justify-content: flex-end;
  }

  .admin-checkin-row {
    grid-template-columns: minmax(180px, 1.2fr) minmax(150px, 1fr) minmax(180px, 1.7fr) minmax(120px, 1fr) auto;
    align-items: center;
  }

  .admin-checkin-row .admin-row-actions {
    justify-content: flex-end;
  }

  .admin-log-compare {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-toast {
    bottom: 24px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }

  .ai-sparkle::after {
    animation: none;
    opacity: 0.18;
  }
}
