:root {
  color-scheme: light;
  --background: #f8f9ff;
  --surface: #ffffff;
  --surface-soft: #eef5ff;
  --ink: #202337;
  --muted: #606a7c;
  --line: #8fa0bb;
  --accent: #7b4dff;
  --accent-dark: #4624a8;
  --accent-soft: #ede8ff;
  --shadow: 0 18px 50px rgba(24, 32, 51, 0.13);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 8% 10%, rgba(255, 91, 146, 0.34), transparent 28%),
    radial-gradient(circle at 88% 12%, rgba(255, 201, 64, 0.35), transparent 29%),
    radial-gradient(circle at 18% 74%, rgba(35, 205, 255, 0.30), transparent 31%),
    radial-gradient(circle at 82% 78%, rgba(88, 226, 126, 0.30), transparent 32%),
    linear-gradient(135deg, #fff7fb 0%, var(--background) 38%, #f4fff8 72%, #fff9ed 100%);
  color: var(--ink);
  font-family: "Trebuchet MS", "Segoe UI Rounded", "Arial Rounded MT Bold", Arial, sans-serif;
}

.page {
  width: min(620px, calc(100% - 32px));
  margin: 0 auto;
  padding: 64px 0;
}

.site-header {
  margin-bottom: 34px;
  text-align: center;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent-dark);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(2.1rem, 5vw, 4.2rem);
  line-height: 1.05;
}

.intro {
  max-width: 560px;
  margin: 18px auto 0;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.6;
}

.coupon-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

.coupon-card {
  display: flex;
  min-height: 178px;
  flex-direction: column;
  gap: 14px;
  justify-content: space-between;
  border: 5px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(var(--surface), var(--surface)) padding-box,
    linear-gradient(135deg, #ff5b92, #ffc940, #58e27e, #23cdff, #7b4dff) border-box;
  border-color: transparent;
  box-shadow: var(--shadow);
  padding: 20px;
}

.coupon-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

h2 {
  margin: 0;
  font-size: 1.48rem;
  line-height: 1.15;
}

.discount {
  flex: 0 0 auto;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-size: 0.95rem;
  font-weight: 800;
  padding: 8px 12px;
}

.coupon-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.98rem;
  line-height: 1.55;
}

.coupon-card .coupon-meta {
  color: #4f5c70;
  font-size: 0.82rem;
  font-weight: 800;
}

.code-button {
  align-self: flex-start;
  min-width: 136px;
  border: 3px dashed var(--accent);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--accent-dark);
  cursor: pointer;
  font: inherit;
  font-size: 0.98rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  padding: 10px 15px;
  transition: background-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.code-button:hover {
  background: var(--accent);
  color: #ffffff;
  transform: translateY(-1px);
}

.code-button.is-copied {
  background: var(--accent-dark);
  color: #ffffff;
}

.details-link {
  align-self: flex-start;
  color: var(--accent-dark);
  font-size: 0.9rem;
  font-weight: 900;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.detail-page .page {
  width: min(760px, calc(100% - 32px));
}

.detail-card {
  display: grid;
  gap: 16px;
  border: 1px solid rgba(143, 160, 187, 0.55);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.84);
  box-shadow: var(--shadow);
  padding: 22px;
}

.detail-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
  line-height: 1.55;
}

.back-link {
  display: inline-flex;
  margin-bottom: 22px;
  color: var(--accent-dark);
  font-weight: 900;
}

.info-section {
  margin-top: 28px;
  border-top: 1px solid rgba(143, 160, 187, 0.35);
  padding-top: 24px;
}

.info-section h2 {
  margin-bottom: 14px;
}

.info-section p {
  color: var(--muted);
  line-height: 1.6;
}

.info-section details {
  border-bottom: 1px solid rgba(143, 160, 187, 0.28);
  padding: 12px 0;
}

.info-section summary {
  cursor: pointer;
  font-weight: 900;
}

.letter-footer {
  display: flex;
  flex-wrap: nowrap;
  justify-content: center;
  gap: 4px;
  width: min(620px, calc(100% - 32px));
  margin: 20px auto 34px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.letter-footer a {
  display: grid;
  width: 18px;
  height: 18px;
  place-items: center;
  border: 1px solid rgba(143, 160, 187, 0.55);
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.56);
  color: rgba(96, 106, 124, 0.62);
  font-size: 0.62rem;
  font-weight: 800;
  line-height: 1;
  text-decoration: none;
}

.letter-footer a:hover,
.letter-footer a:focus {
  border-color: var(--accent);
  color: var(--accent-dark);
  outline: none;
}

.auth-page {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
}

.auth-page:has(.private-directory) {
  align-items: start;
  background:
    radial-gradient(circle at 12% 8%, rgba(255, 91, 146, 0.22), transparent 28%),
    radial-gradient(circle at 88% 10%, rgba(35, 205, 255, 0.20), transparent 30%),
    radial-gradient(circle at 78% 88%, rgba(88, 226, 126, 0.16), transparent 28%),
    linear-gradient(135deg, #f7f8fb 0%, #ffffff 45%, #f4f7fb 100%);
}

.auth-panel {
  width: min(1040px, 100%);
  border: 1px solid rgba(143, 160, 187, 0.38);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(247, 251, 255, 0.92)),
    var(--surface);
  box-shadow: 0 24px 70px rgba(24, 32, 51, 0.14);
  padding: clamp(20px, 4vw, 34px);
}

.auth-page:has(.private-directory) .auth-panel {
  width: min(980px, 100%);
  margin-top: clamp(22px, 5vh, 56px);
  border: 1px solid #d8dde5;
  border-radius: 0;
  background: #ffffff;
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.08);
  padding: 0;
}

.auth-panel h1 {
  font-size: 1.7rem;
}

.auth-panel p {
  color: var(--muted);
  line-height: 1.55;
}

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

.auth-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 800;
}

.auth-form input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  font: inherit;
  padding: 11px 12px;
}

.auth-form button,
.private-menu a {
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: #ffffff;
  cursor: pointer;
  font: inherit;
  font-weight: 900;
  padding: 12px 14px;
  text-align: center;
  text-decoration: none;
}

.auth-error {
  margin: 12px 0 0;
  color: #b8333a;
  font-weight: 800;
}

.private-menu {
  display: grid;
  gap: 10px;
  margin-top: 20px;
}

.private-dashboard {
  border-bottom: 1px solid rgba(143, 160, 187, 0.35);
  padding-bottom: 18px;
}

.private-kicker {
  margin: 0 0 6px;
  color: #64748b;
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.private-home {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid #d8dde5;
  padding: 28px 30px 24px;
}

.private-home h1 {
  margin: 0;
  color: #111827;
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: clamp(1.75rem, 4vw, 2.65rem);
  font-weight: 700;
  letter-spacing: 0;
}

.private-dashboard-copy {
  max-width: 520px;
  margin: 8px 0 0;
  color: var(--muted);
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 0.96rem;
  line-height: 1.5;
}

.private-directory {
  padding: 0;
}

.private-directory-head {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) 112px;
  gap: 18px;
  border-bottom: 1px solid #e5e7eb;
  background: #ffffff;
  color: #6b7280;
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 10px 30px;
  text-transform: uppercase;
}

.private-menu-cards {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.auth-form button,
.private-menu a.private-card {
  transition: transform 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}

.private-menu a.private-card {
  display: grid;
  min-height: 154px;
  align-content: space-between;
  border: 1px solid rgba(123, 77, 255, 0.22);
  background:
    radial-gradient(circle at 20% 0%, rgba(255, 201, 64, 0.32), transparent 38%),
    radial-gradient(circle at 90% 15%, rgba(35, 205, 255, 0.30), transparent 34%),
    linear-gradient(145deg, #7b4dff, #3f2aa7);
  box-shadow: 0 16px 34px rgba(70, 36, 168, 0.24);
  padding: 16px;
  text-align: left;
}

.private-menu a.private-card:hover,
.private-menu a.private-card:focus {
  box-shadow: 0 20px 42px rgba(70, 36, 168, 0.31);
  transform: translateY(-2px);
}

.private-card span {
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.8rem;
  font-weight: 900;
}

.private-card strong {
  display: block;
  margin-top: 18px;
  font-size: 1.08rem;
  line-height: 1.16;
}

.private-card small {
  display: block;
  margin-top: 8px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.78rem;
  line-height: 1.35;
}

.private-menu a.logout-link {
  justify-self: center;
  width: auto;
  margin-top: 2px;
  border: 1px solid rgba(143, 160, 187, 0.55);
  background: rgba(255, 255, 255, 0.65);
  color: var(--muted);
  font-size: 0.78rem;
  padding: 7px 10px;
}

/* private menu access system */
.private-menu-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  border: 0;
  border-radius: 0;
  overflow: visible;
}

.private-row {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) 112px;
  align-items: center;
  gap: 18px;
  min-height: 58px;
  border: 0;
  border-bottom: 1px solid #eceff3;
  border-radius: 0;
  background: #ffffff;
  color: #111827;
  box-shadow: none;
  padding: 10px 30px;
  text-align: left;
  text-decoration: none;
  transition: none;
}

.private-menu a.private-row,
.private-menu span.private-row {
  background: #ffffff;
  color: #111827;
  padding: 10px 30px;
  text-align: left;
}

.private-row:last-child {
  border-bottom: 0;
}

a.private-row:hover,
a.private-row:focus {
  background: #ffffff;
  color: #111827;
  outline: none;
}

.private-row-number {
  color: #6b7280;
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0;
}

.private-row-content {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.private-row strong {
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.2;
}

.private-row small {
  color: #6b7280;
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 0.78rem;
  line-height: 1.35;
}

.private-row-status {
  color: #4b5563;
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 0.78rem;
  font-weight: 500;
  text-align: right;
}

.private-row-disabled {
  background: #ffffff;
  color: #9ca3af;
  box-shadow: none;
  color: #9ca3af;
  opacity: 1;
  pointer-events: none;
}

.private-row-disabled .private-row-number,
.private-row-disabled small,
.private-row-disabled .private-row-status {
  color: #aeb6c2;
}

.logout-link {
  display: inline-block;
  margin: 0;
  border: 1px solid #d8dde5;
  border-radius: 0;
  background: #ffffff;
  color: #4b5563;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 7px 10px;
  text-decoration: none;
}

.private-footer-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 30px 24px;
}

.private-footer-actions span {
  color: #6b7280;
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 0.82rem;
}

.user-admin-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.user-admin-hero p {
  max-width: 560px;
}

.user-back-link {
  flex: 0 0 auto;
  border: 1px solid rgba(143, 160, 187, 0.55);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.75);
  color: var(--accent-dark);
  font-size: 0.86rem;
  font-weight: 900;
  padding: 9px 11px;
  text-decoration: none;
}

.user-admin-layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.95fr) minmax(300px, 1.05fr);
  gap: 22px;
  margin-top: 22px;
}

.user-create-card,
.user-list {
  border: 1px solid rgba(143, 160, 187, 0.46);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  padding: 18px;
}

.user-create-card h2,
.user-list h2 {
  margin: 0 0 8px;
  font-size: 1.08rem;
}

.user-create-card p {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 0.9rem;
}

.access-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  border: 1px solid rgba(143, 160, 187, 0.55);
  border-radius: 8px;
  margin: 8px 0 0;
  padding: 14px;
}

.access-grid legend {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 900;
  padding: 0 6px;
}

.access-grid label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-size: 0.9rem;
}

.access-grid span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.access-grid b {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 6px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-size: 0.74rem;
}

.auth-success {
  border-radius: 8px;
  background: rgba(15, 139, 111, 0.12);
  color: #0f6f5a;
  font-weight: 900;
  padding: 10px 12px;
}

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

.user-card {
  border: 1px solid rgba(143, 160, 187, 0.48);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(239, 247, 255, 0.92));
  padding: 14px;
}

.user-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.user-card-head strong {
  font-size: 1.02rem;
}

.user-card-head span {
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-size: 0.74rem;
  font-weight: 900;
  padding: 5px 8px;
}

.user-access-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.user-access-chips span {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 900;
}

.user-access-chips .is-on {
  background: var(--accent);
  color: #ffffff;
}

.user-access-chips .is-off {
  background: rgba(143, 160, 187, 0.16);
  color: rgba(96, 106, 124, 0.66);
}

.user-card small {
  color: var(--muted);
}

.private-image {
  display: block;
  width: 100%;
  max-height: 520px;
  object-fit: cover;
  border-radius: 8px;
}

.private-note {
  margin-top: 12px;
  font-size: 0.86rem;
}

@media (max-width: 760px) {
  .page {
    width: min(100% - 24px, 520px);
    padding: 42px 0;
  }

  .site-header {
    text-align: left;
  }

  .intro {
    margin-right: 0;
    margin-left: 0;
  }

  .coupon-card {
    min-height: 210px;
    padding: 22px;
  }

  h2 {
    font-size: 1.45rem;
  }

  .private-menu-cards {
    grid-template-columns: 1fr;
  }

  .private-home {
    display: grid;
    padding: 22px 18px;
  }

  .private-directory-head,
  .private-row {
    grid-template-columns: 46px minmax(0, 1fr);
    padding-right: 18px;
    padding-left: 18px;
  }

  .private-directory-head span:last-child,
  .private-row-status {
    display: none;
  }

  .private-footer-actions {
    align-items: flex-start;
    flex-direction: column;
    padding-right: 18px;
    padding-left: 18px;
  }

  .user-admin-hero,
  .user-admin-layout {
    display: grid;
    grid-template-columns: 1fr;
  }

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