:root {
  --bg: #070a0f;
  --bg-soft: #0b1118;
  --surface: #111923;
  --surface-2: #16202b;
  --surface-3: #1c2835;
  --text: #f5f0e7;
  --muted: #a9b0b8;
  --subtle: #6f7b87;
  --gold: #d9aa55;
  --gold-soft: #f0cf88;
  --aqua: #62c7bd;
  --blue: #2f6f9d;
  --danger: #d96868;
  --success: #6bc49a;
  --border: rgba(240, 207, 136, 0.14);
  --border-strong: rgba(240, 207, 136, 0.28);
  --shadow: 0 22px 55px rgba(0, 0, 0, 0.38);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html {
  min-height: 100%;
  background: var(--bg);
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 10% -10%, rgba(47, 111, 157, 0.18), transparent 34%),
    radial-gradient(circle at 90% 10%, rgba(217, 170, 85, 0.12), transparent 28%),
    linear-gradient(180deg, #080c11 0%, #07090d 100%);
  overflow-x: hidden;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  color: inherit;
}

button,
select {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid var(--gold-soft);
  outline-offset: 3px;
}

svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.hidden {
  display: none !important;
}

.ambient {
  position: fixed;
  pointer-events: none;
  filter: blur(90px);
  opacity: 0.22;
  z-index: 0;
}

.ambient-one {
  width: 280px;
  height: 280px;
  background: #215f78;
  top: 18%;
  left: -170px;
}

.ambient-two {
  width: 260px;
  height: 260px;
  background: #795d25;
  right: -170px;
  bottom: 12%;
}

.app-shell {
  position: relative;
  z-index: 1;
  width: min(100%, 760px);
  min-height: 100vh;
  margin: 0 auto;
  background: rgba(7, 10, 15, 0.76);
  border-inline: 1px solid rgba(255, 255, 255, 0.035);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
  padding: max(12px, env(safe-area-inset-top)) 18px 10px;
  background: linear-gradient(180deg, rgba(8, 12, 17, 0.97), rgba(8, 12, 17, 0.86));
  backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.055);
}

.brand-button {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
}

.brand-button img {
  flex: 0 0 auto;
  border-radius: 13px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
}

.brand-button span {
  display: grid;
  min-width: 0;
}

.brand-button strong {
  font-size: 0.96rem;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.brand-button small {
  color: var(--muted);
  font-size: 0.7rem;
  letter-spacing: 0.04em;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 4px rgba(107, 196, 154, 0.09);
}

.status-dot.offline {
  background: var(--danger);
  box-shadow: 0 0 0 4px rgba(217, 104, 104, 0.09);
}

.icon-button {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.035);
}

.icon-button svg {
  width: 20px;
  height: 20px;
}

.content {
  padding: 18px 16px calc(106px + var(--safe-bottom));
}

.view {
  display: none;
  animation: viewIn 0.28s ease both;
}

.view.active {
  display: block;
}

@keyframes viewIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.hero-card,
.today-card,
.panel-card,
.timer-card,
.info-card,
.admin-card {
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.hero-card {
  position: relative;
  overflow: hidden;
  padding: 22px;
  border-radius: var(--radius-xl);
  background:
    linear-gradient(135deg, rgba(217, 170, 85, 0.13), transparent 45%),
    linear-gradient(145deg, #17202a, #0e151e 78%);
}

.hero-card::after {
  content: "";
  position: absolute;
  width: 180px;
  height: 180px;
  right: -70px;
  top: -80px;
  border-radius: 50%;
  border: 1px solid rgba(240, 207, 136, 0.16);
  box-shadow: 0 0 0 28px rgba(240, 207, 136, 0.025), 0 0 0 58px rgba(240, 207, 136, 0.018);
}

.hero-topline,
.balance-row,
.timer-status-row,
.section-heading,
.page-heading.admin-heading,
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.eyebrow {
  display: block;
  color: var(--gold-soft);
  font-size: 0.71rem;
  font-weight: 750;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.level-badge,
.date-chip,
.price-pill,
.timer-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 29px;
  padding: 5px 10px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: rgba(217, 170, 85, 0.08);
  color: var(--gold-soft);
  font-size: 0.74rem;
  font-weight: 750;
  letter-spacing: 0.04em;
}

.balance-row {
  margin-top: 12px;
}

.balance-number {
  font-size: clamp(3.4rem, 16vw, 5.8rem);
  font-weight: 780;
  line-height: 0.95;
  letter-spacing: -0.055em;
}

.balance-unit {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-size: 0.86rem;
  letter-spacing: 0.04em;
}

.balance-ring {
  position: relative;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: conic-gradient(var(--gold) var(--ring-progress, 20%), rgba(255, 255, 255, 0.075) 0);
}

.balance-ring::before {
  content: "";
  position: absolute;
  inset: 6px;
  border-radius: 50%;
  background: #121a23;
}

.balance-ring span {
  position: relative;
  z-index: 1;
  font-size: 0.86rem;
  font-weight: 800;
}

.hero-caption {
  position: relative;
  z-index: 1;
  max-width: 430px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.55;
}

.today-card,
.panel-card,
.admin-card {
  margin-top: 16px;
  padding: 19px;
  border-radius: var(--radius-lg);
  background: linear-gradient(150deg, rgba(22, 32, 43, 0.94), rgba(14, 21, 30, 0.97));
}

.section-heading {
  margin-bottom: 15px;
}

.section-heading.compact {
  margin-bottom: 8px;
}

.section-heading h1,
.section-heading h2,
.page-heading h1,
.modal-card h2 {
  margin: 4px 0 0;
  line-height: 1.15;
}

.section-heading h1 {
  font-size: 1.25rem;
}

.section-heading h2 {
  font-size: 1.08rem;
}

.date-chip {
  color: var(--aqua);
  border-color: rgba(98, 199, 189, 0.2);
  background: rgba(98, 199, 189, 0.07);
  white-space: nowrap;
}

.today-message {
  margin: 10px 0 16px;
  color: #e9e3d9;
  font-size: 1rem;
  font-weight: 620;
  line-height: 1.45;
}

.today-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}

.today-grid > div,
.summary-grid > div,
.timer-details > div,
.admin-summary-grid > div,
.history-summary > div {
  padding: 13px;
  border: 1px solid rgba(255, 255, 255, 0.055);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.025);
}

.today-grid span,
.summary-grid span,
.timer-details span,
.admin-summary-grid span,
.history-summary span {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.35;
}

.today-grid strong,
.summary-grid strong,
.timer-details strong,
.admin-summary-grid strong,
.history-summary strong {
  display: block;
  margin-top: 5px;
  font-size: 0.94rem;
  line-height: 1.35;
}

.primary-button,
.secondary-button,
.danger-button,
.text-button,
.quick-button,
.filter-chip,
.segmented-control button {
  border: 0;
  transition: transform 0.16s ease, background 0.16s ease, border-color 0.16s ease, opacity 0.16s ease;
}

.primary-button:active,
.secondary-button:active,
.danger-button:active,
.quick-button:active {
  transform: translateY(1px) scale(0.995);
}

.primary-button,
.secondary-button,
.danger-button {
  min-height: 48px;
  padding: 12px 17px;
  border-radius: 15px;
  font-weight: 780;
}

.primary-button {
  color: #17120a;
  background: linear-gradient(135deg, var(--gold-soft), var(--gold));
  box-shadow: 0 12px 26px rgba(217, 170, 85, 0.16);
}

.primary-button:hover {
  filter: brightness(1.035);
}

.primary-button svg {
  width: 20px;
  height: 20px;
}

.secondary-button {
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.055);
}

.danger-button {
  color: #ffd6d6;
  border: 1px solid rgba(217, 104, 104, 0.23);
  background: rgba(217, 104, 104, 0.12);
}

.primary-button.full {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  gap: 10px;
}

.primary-button.large {
  min-height: 58px;
  font-size: 1rem;
}

.primary-button.small,
.secondary-button.small {
  min-height: 38px;
  padding: 8px 12px;
  border-radius: 12px;
  font-size: 0.8rem;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
  filter: saturate(0.4);
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 16px;
}

.metric-card {
  min-height: 125px;
  padding: 15px 12px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-md);
  background: linear-gradient(155deg, rgba(22, 32, 43, 0.86), rgba(12, 18, 25, 0.92));
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.22);
}

.metric-card .metric-icon {
  display: grid;
  place-items: center;
  width: 31px;
  height: 31px;
  margin-bottom: 14px;
  border-radius: 10px;
  color: var(--aqua);
  background: rgba(98, 199, 189, 0.08);
}

.metric-card > span:not(.metric-icon) {
  display: block;
  min-height: 31px;
  color: var(--muted);
  font-size: 0.69rem;
  line-height: 1.3;
}

.metric-card strong {
  display: block;
  margin-top: 6px;
  font-size: 1.5rem;
}

.quick-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.quick-button {
  min-height: 112px;
  padding: 15px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.032);
  text-align: left;
}

.quick-button:hover {
  border-color: var(--border-strong);
  background: rgba(217, 170, 85, 0.055);
}

.quick-icon {
  display: block;
  margin-bottom: 16px;
  color: var(--gold-soft);
  font-size: 1.4rem;
}

.quick-button strong,
.quick-button small {
  display: block;
}

.quick-button strong {
  font-size: 0.92rem;
}

.quick-button small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.73rem;
}

.text-button {
  padding: 6px 0;
  color: var(--gold-soft);
  background: transparent;
  font-size: 0.76rem;
  font-weight: 750;
}

.activity-list {
  display: grid;
  gap: 9px;
}

.activity-item {
  display: grid;
  grid-template-columns: 39px 1fr auto;
  align-items: center;
  gap: 11px;
  min-width: 0;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.055);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.022);
}

.activity-icon {
  display: grid;
  place-items: center;
  width: 39px;
  height: 39px;
  border-radius: 12px;
  background: rgba(98, 199, 189, 0.075);
  color: var(--aqua);
  font-weight: 800;
}

.activity-item.negative .activity-icon {
  color: var(--gold-soft);
  background: rgba(217, 170, 85, 0.08);
}

.activity-item.admin .activity-icon {
  color: #b7a9e5;
  background: rgba(155, 133, 218, 0.09);
}

.activity-main {
  min-width: 0;
}

.activity-main strong {
  display: block;
  overflow: hidden;
  font-size: 0.82rem;
  line-height: 1.35;
  text-overflow: ellipsis;
}

.activity-main small {
  display: block;
  margin-top: 4px;
  color: var(--subtle);
  font-size: 0.68rem;
}

.activity-value {
  color: var(--success);
  font-size: 0.77rem;
  font-weight: 800;
  white-space: nowrap;
}

.activity-value.negative {
  color: var(--gold-soft);
}

.empty-state {
  padding: 26px 16px;
  border: 1px dashed rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  color: var(--muted);
  text-align: center;
}

.empty-state strong {
  display: block;
  color: var(--text);
  margin-bottom: 5px;
}

.page-heading {
  margin: 4px 2px 18px;
}

.page-heading.centered {
  text-align: center;
}

.page-heading h1 {
  margin-top: 6px;
  font-size: clamp(1.8rem, 8vw, 2.5rem);
  letter-spacing: -0.035em;
}

.page-heading p {
  max-width: 560px;
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.55;
}

.page-heading.centered p {
  margin-inline: auto;
}

.segmented-control {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
  padding: 5px;
  border: 1px solid rgba(255, 255, 255, 0.065);
  border-radius: 16px;
  background: #0d141c;
  margin-bottom: 14px;
}

.segmented-control button {
  min-height: 43px;
  border-radius: 12px;
  color: var(--muted);
  background: transparent;
  font-weight: 750;
}

.segmented-control button.active {
  color: #191309;
  background: linear-gradient(135deg, var(--gold-soft), var(--gold));
}

.segmented-control span {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  margin-left: 4px;
  padding: 0 5px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.18);
  font-size: 0.68rem;
}

.coupon-panel {
  display: none;
}

.coupon-panel.active {
  display: block;
  animation: viewIn 0.24s ease both;
}

.coupon-grid {
  display: grid;
  gap: 12px;
}

.coupon-card {
  position: relative;
  overflow: hidden;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at 110% -10%, rgba(217, 170, 85, 0.12), transparent 34%),
    linear-gradient(145deg, #16202a, #0f161f);
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.27);
}

.coupon-card::before,
.coupon-card::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #080c11;
  transform: translateY(-50%);
}

.coupon-card::before { left: -10px; }
.coupon-card::after { right: -10px; }

.coupon-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.coupon-card h3 {
  margin: 0;
  font-size: 1rem;
  line-height: 1.25;
}

.coupon-card p {
  min-height: 42px;
  margin: 8px 0 14px;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.5;
}

.coupon-price {
  flex: 0 0 auto;
  color: var(--gold-soft);
  font-size: 1rem;
  font-weight: 850;
  white-space: nowrap;
}

.coupon-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 13px;
  border-top: 1px dashed rgba(255, 255, 255, 0.1);
}

.coupon-meta small {
  color: var(--subtle);
  font-size: 0.68rem;
}

.coupon-meta button {
  min-width: 112px;
}

.coupon-card.insufficient {
  opacity: 0.64;
}

.coupon-card.reward {
  border-color: rgba(98, 199, 189, 0.23);
  background:
    radial-gradient(circle at 110% -10%, rgba(98, 199, 189, 0.16), transparent 34%),
    linear-gradient(145deg, #14242a, #0e171d);
}

.timer-card {
  position: relative;
  overflow: hidden;
  padding: 22px;
  border-radius: var(--radius-xl);
  background:
    radial-gradient(circle at 50% 30%, rgba(47, 111, 157, 0.18), transparent 32%),
    linear-gradient(150deg, #16212c, #0c1219 80%);
}

.timer-card.active-session {
  border-color: rgba(98, 199, 189, 0.3);
}

.timer-status {
  color: var(--aqua);
  border-color: rgba(98, 199, 189, 0.2);
  background: rgba(98, 199, 189, 0.07);
}

.timer-status.paused {
  color: var(--gold-soft);
  border-color: var(--border-strong);
  background: rgba(217, 170, 85, 0.08);
}

.price-pill {
  color: var(--muted);
  background: rgba(255, 255, 255, 0.035);
  border-color: rgba(255, 255, 255, 0.08);
}

.price-pill strong {
  color: var(--text);
  margin-right: 4px;
}

.timer-display {
  margin: 34px 0 24px;
  text-align: center;
  font-variant-numeric: tabular-nums;
  font-size: clamp(4rem, 20vw, 7rem);
  font-weight: 760;
  line-height: 1;
  letter-spacing: -0.055em;
  text-shadow: 0 12px 35px rgba(0, 0, 0, 0.42);
}

.timer-progress {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
}

.timer-progress span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--aqua), var(--gold-soft));
  transition: width 0.4s linear;
}

.timer-details,
.summary-grid,
.admin-summary-grid,
.history-summary {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.timer-details {
  margin: 16px 0;
}

.timer-details strong {
  font-size: 1.15rem;
}

.timer-controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.info-card {
  display: flex;
  gap: 12px;
  margin-top: 14px;
  padding: 16px;
  border-radius: var(--radius-md);
  background: rgba(98, 199, 189, 0.055);
}

.info-icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  color: var(--aqua);
  border: 1px solid rgba(98, 199, 189, 0.22);
  font-weight: 800;
}

.info-card strong {
  font-size: 0.84rem;
}

.info-card p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.5;
}

.summary-grid {
  grid-template-columns: repeat(3, 1fr);
}

.history-summary {
  grid-template-columns: repeat(3, 1fr);
  margin-bottom: 14px;
}

.filter-row {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
  overflow-x: auto;
  scrollbar-width: none;
}

.filter-row::-webkit-scrollbar {
  display: none;
}

.filter-chip {
  flex: 0 0 auto;
  min-height: 38px;
  padding: 8px 13px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.035);
  font-size: 0.75rem;
  font-weight: 700;
}

.filter-chip.active {
  color: #161109;
  border-color: transparent;
  background: var(--gold-soft);
}

.history-list .activity-item {
  grid-template-columns: 42px 1fr auto;
  padding: 13px;
}

.admin-summary-grid {
  grid-template-columns: repeat(2, 1fr);
  margin-bottom: 2px;
}

.admin-summary-grid > div {
  background: linear-gradient(145deg, rgba(22, 32, 43, 0.92), rgba(12, 18, 25, 0.95));
  border-color: var(--border);
}

.admin-summary-grid strong {
  font-size: 1.3rem;
}

.admin-card h2 {
  margin: 4px 0 0;
  font-size: 1.06rem;
}

.admin-card p {
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.5;
}

.stack-form,
.inline-form {
  display: grid;
  gap: 12px;
}

.inline-form {
  grid-template-columns: 1fr auto;
  align-items: end;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 650;
}

input,
textarea,
select {
  width: 100%;
  min-height: 47px;
  padding: 11px 13px;
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 13px;
  background: #0c131b;
}

textarea {
  min-height: 88px;
  resize: vertical;
}

input::placeholder,
textarea::placeholder {
  color: #596470;
}

.inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.admin-coupon-list {
  display: grid;
  gap: 9px;
}

.admin-coupon-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 13px;
  border: 1px solid rgba(255, 255, 255, 0.065);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.025);
}

.admin-coupon-item.inactive {
  opacity: 0.55;
}

.admin-coupon-item strong,
.admin-coupon-item small {
  display: block;
}

.admin-coupon-item strong {
  font-size: 0.84rem;
}

.admin-coupon-item small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.68rem;
}

.admin-item-actions {
  display: flex;
  gap: 7px;
}

.mini-button {
  min-height: 35px;
  padding: 7px 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.045);
  font-size: 0.7rem;
  font-weight: 750;
}

.mini-button.delete {
  color: #ffc7c7;
  border-color: rgba(217, 104, 104, 0.2);
  background: rgba(217, 104, 104, 0.08);
}

.toggle-row p {
  max-width: 480px;
  margin: 4px 0 0;
}

.switch {
  position: relative;
  display: inline-block;
  flex: 0 0 auto;
  width: 52px;
  height: 30px;
}

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

.switch span {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: #35404b;
  transition: background 0.2s ease;
}

.switch span::after {
  content: "";
  position: absolute;
  width: 22px;
  height: 22px;
  left: 4px;
  top: 4px;
  border-radius: 50%;
  background: white;
  transition: transform 0.2s ease;
}

.switch input:checked + span {
  background: var(--gold);
}

.switch input:checked + span::after {
  transform: translateX(22px);
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 9px;
}

.checkbox-row input {
  width: 18px;
  min-height: 18px;
}

.danger-zone {
  border-color: rgba(217, 104, 104, 0.16);
}

.bottom-nav {
  position: fixed;
  z-index: 25;
  bottom: 0;
  left: 50%;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  width: min(100%, 760px);
  min-height: calc(76px + var(--safe-bottom));
  padding: 8px 9px calc(8px + var(--safe-bottom));
  transform: translateX(-50%);
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(8, 12, 17, 0.96);
  backdrop-filter: blur(20px);
}

.bottom-nav button {
  position: relative;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 4px;
  min-width: 0;
  min-height: 54px;
  padding: 5px 3px;
  border: 0;
  border-radius: 14px;
  color: #7f8993;
  background: transparent;
}

.bottom-nav button.active {
  color: var(--gold-soft);
  background: rgba(217, 170, 85, 0.07);
}

.bottom-nav svg {
  width: 22px;
  height: 22px;
}

.bottom-nav span {
  font-size: 0.61rem;
  font-weight: 720;
}

.bottom-nav .nav-primary svg {
  width: 26px;
  height: 26px;
}

.modal {
  width: min(calc(100% - 28px), 470px);
  max-height: calc(100vh - 28px);
  padding: 0;
  border: 0;
  border-radius: var(--radius-xl);
  color: var(--text);
  background: transparent;
  box-shadow: var(--shadow);
}

.modal::backdrop {
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(9px);
}

.modal-card {
  position: relative;
  display: grid;
  gap: 13px;
  margin: 0;
  padding: 25px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-xl);
  background:
    radial-gradient(circle at 100% 0, rgba(217, 170, 85, 0.12), transparent 35%),
    linear-gradient(145deg, #17212c, #0e151d);
}

.modal-card.compact-modal {
  text-align: center;
}

.modal-card h2 {
  font-size: 1.35rem;
}

.modal-card p {
  margin: -4px 0 2px;
  color: var(--muted);
  font-size: 0.83rem;
  line-height: 1.5;
}

.modal-close {
  position: absolute;
  right: 14px;
  top: 12px;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 11px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.05);
  font-size: 1.3rem;
}

.modal-icon {
  display: grid;
  place-items: center;
  width: 47px;
  height: 47px;
  margin: 0 auto 2px;
  border: 1px solid var(--border-strong);
  border-radius: 15px;
  color: var(--gold-soft);
  background: rgba(217, 170, 85, 0.08);
  font-size: 1.2rem;
}

.modal-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 3px;
}

.form-error {
  min-height: 18px;
  color: #ffaaaa !important;
  font-size: 0.72rem !important;
}

.toast {
  position: fixed;
  z-index: 100;
  left: 50%;
  bottom: calc(92px + var(--safe-bottom));
  width: min(calc(100% - 32px), 460px);
  padding: 13px 16px;
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  color: var(--text);
  background: rgba(20, 29, 38, 0.97);
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 16px);
  transition: opacity 0.22s ease, transform 0.22s ease;
  text-align: center;
  font-size: 0.8rem;
  font-weight: 700;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (min-width: 620px) {
  .content {
    padding-inline: 24px;
  }

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

  .coupon-card p {
    min-height: 60px;
  }

  .metric-card {
    padding: 17px;
  }
}

@media (max-width: 420px) {
  .content {
    padding-inline: 12px;
  }

  .brand-button small {
    display: none;
  }

  .hero-card,
  .today-card,
  .panel-card,
  .admin-card,
  .timer-card {
    padding: 16px;
  }

  .today-grid,
  .field-row,
  .summary-grid {
    grid-template-columns: 1fr;
  }

  .metric-grid {
    gap: 7px;
  }

  .metric-card {
    min-height: 116px;
    padding: 13px 9px;
  }

  .metric-card strong {
    font-size: 1.28rem;
  }

  .page-heading.admin-heading {
    align-items: flex-start;
  }

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

  .history-summary {
    gap: 7px;
  }

  .history-summary > div {
    padding: 11px 8px;
  }

  .history-summary strong {
    font-size: 0.84rem;
  }

  .activity-item {
    grid-template-columns: 36px 1fr;
  }

  .activity-value {
    grid-column: 2;
  }

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

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

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
