:root {
  --bg: #faf5fb;
  --ink: #2f1a45;
  --muted: #6b547e;
  --primary: #d055b6;
  --primary-dark: #6a2a87;
  --card: #ffffff;
  --line: #eadff2;
  --whatsapp: #25d366;
  --whatsapp-dark: #1ebe57;
  --danger: #9b2c2c;
  --ok: #1f7a4d;
  --shadow: 0 18px 40px rgba(106, 42, 135, 0.12);
  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Manrope", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--font-body);
  background:
    radial-gradient(circle at 12% 8%, rgba(208, 85, 182, 0.12), transparent 34%),
    radial-gradient(circle at 88% 18%, rgba(106, 42, 135, 0.1), transparent 30%),
    linear-gradient(180deg, #fff8fc 0%, var(--bg) 40%, #f7f0fb 100%);
  color: var(--ink);
  line-height: 1.55;
}

a { color: var(--primary-dark); text-decoration: none; }
a:hover { color: var(--primary); text-decoration: underline; }

.shell {
  min-height: 100vh;
}

.topnav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 40px;
  background: linear-gradient(90deg, #2f1c43, #4a2864 55%, #3b1f55);
  color: #f9f1ff;
  position: sticky;
  top: 0;
  z-index: 20;
}

.topnav-left {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.topnav-logo {
  display: inline-flex;
  align-items: center;
  margin-left: auto;
  background: #fff;
  border-radius: 0.5rem;
  padding: 4px 8px;
  line-height: 0;
}

.topnav-logo img {
  display: block;
  height: 48px;
  width: auto;
}

.page-search {
  display: flex;
  gap: 8px;
  flex: 1;
  max-width: 420px;
  margin-left: auto;
}

.page-search input {
  margin: 0;
  background: #fff;
}

.page-search .btn {
  white-space: nowrap;
}

.topnav-brand {
  min-width: 0;
}

.brand {
  font-family: var(--font-display);
  font-size: 1.25rem;
  line-height: 1.2;
  margin: 0;
  color: #fff;
}

.brand-sub {
  font-size: 0.82rem;
  color: #d9c6ea;
  margin: 4px 0 0;
}

.menu {
  position: relative;
}

.menu > summary {
  list-style: none;
  cursor: pointer;
}

.menu > summary::-webkit-details-marker {
  display: none;
}

.menu-panel {
  position: absolute;
  left: 0;
  top: calc(100% + 8px);
  min-width: 220px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 1rem;
  box-shadow: var(--shadow);
  padding: 8px;
  display: grid;
}

.menu-panel a,
.menu-signout {
  display: block;
  width: 100%;
  text-align: left;
  color: var(--ink);
  padding: 10px 12px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  background: transparent;
  border: 0;
  font: inherit;
  cursor: pointer;
}

.menu-panel a:hover,
.menu-panel a.active,
.menu-signout:hover {
  background: #f3e8fb;
  color: var(--primary-dark);
  text-decoration: none;
}

.main { padding: 32px 40px 64px; }

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}

h1, h2, .serif {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--primary-dark);
}

h1 { margin: 0; font-size: 1.8rem; }

.cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.card {
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid var(--line);
  border-radius: 1.15rem;
  padding: 20px;
  box-shadow: var(--shadow);
}

.stat {
  font-size: 2rem;
  font-family: var(--font-display);
  margin: 8px 0 0;
  color: var(--primary-dark);
}

.muted { color: var(--muted); }

table {
  width: 100%;
  border-collapse: collapse;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 1.15rem;
  overflow: hidden;
  border: 1px solid var(--line);
}

th, td {
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  font-size: 0.95rem;
}

th {
  background: #f5eefb;
  font-weight: 700;
  color: var(--primary-dark);
}

.btn {
  display: inline-block;
  background: var(--primary);
  color: white;
  border: 0;
  border-radius: 999px;
  padding: 9px 16px;
  cursor: pointer;
  font-size: 0.92rem;
  font-weight: 700;
  text-decoration: none;
  font-family: var(--font-body);
}

.btn:hover {
  background: var(--primary-dark);
  text-decoration: none;
  color: white;
  box-shadow: 0 10px 24px rgba(106, 42, 135, 0.22);
}

.btn.secondary {
  background: transparent;
  color: var(--primary-dark);
  border: 1.5px solid #d8b6ea;
}

.btn.secondary:hover {
  background: #f7ebfd;
  box-shadow: none;
  color: var(--primary-dark);
}

.btn.danger { background: var(--danger); }

.row-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.notice {
  background: #f3e8fb;
  color: var(--primary-dark);
  padding: 12px 14px;
  border-radius: 10px;
  margin-bottom: 16px;
  border: 1px solid var(--line);
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 18px;
  background: rgba(255, 255, 255, 0.9);
  padding: 24px;
  border-radius: 1.15rem;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.form-grid label, .stack label {
  display: block;
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--primary-dark);
}

input, select, textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
  background: white;
  color: var(--ink);
}

textarea { min-height: 140px; }

.span-2 { grid-column: span 2; }

.check {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 22px;
}

.check input { width: auto; }

.toolbar {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
}

.search { flex: 1; }

.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 20% 20%, rgba(208, 85, 182, 0.18), transparent 40%),
    radial-gradient(circle at 88% 18%, rgba(106, 42, 135, 0.14), transparent 32%),
    var(--bg);
}

.login-card {
  width: 380px;
  background: rgba(255, 255, 255, 0.92);
  padding: 32px;
  border-radius: 1.15rem;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.login-card-wide {
  width: min(460px, calc(100vw - 32px));
}

.username-preview-box {
  padding: 12px 14px;
  border-radius: 0.75rem;
  border: 1px dashed var(--line);
  background: #fbf7fd;
}

.username-preview-box label {
  margin-bottom: 4px;
}

.username-preview-value {
  margin: 0 0 6px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--primary-dark);
  word-break: break-all;
}

.menu-user {
  margin: 12px 14px 4px;
  font-size: 0.8rem;
  color: #d9c6ea;
}

.login-card .brand { color: var(--primary-dark); }

.badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 999px;
  background: #f3e8fb;
  color: var(--primary-dark);
  font-size: 0.78rem;
  font-weight: 700;
}

.error { color: var(--danger); font-size: 0.9rem; }

.dl { display: grid; grid-template-columns: 180px 1fr; gap: 8px 16px; }
.dl dt { color: var(--muted); }

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

.perf-bar {
  width: 88px;
  height: 8px;
  background: #f3e8fb;
  border-radius: 999px;
  overflow: hidden;
  display: inline-block;
  vertical-align: middle;
  margin-right: 8px;
}

.perf-bar span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--primary-dark));
}

.reminder-card {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  border-radius: 1.15rem;
  box-shadow: var(--shadow);
  padding: 20px 22px;
  margin-top: 16px;
  scroll-margin-top: 96px;
}

.reminder-card:target {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(208, 85, 182, 0.22), var(--shadow);
}

.reminder-head {
  margin-bottom: 12px;
}

.reminder-message {
  min-height: 96px;
  resize: vertical;
  background: #faf5fb;
}

.reminder-alert-bar {
  background: linear-gradient(90deg, #6a2a87, #d055b6);
  color: #fff;
  padding: 10px 40px;
}

.reminder-alert-bar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.reminder-alert-bar p {
  margin: 0;
  font-weight: 600;
}

.reminder-alert-bar a {
  color: #fff;
  text-decoration: underline;
  font-weight: 800;
}

.reminder-alert-bar a:hover {
  color: #ffe9fb;
}

.reminder-alert-dismiss {
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.45);
  color: #fff;
  border-radius: 999px;
  padding: 6px 14px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.reminder-alert-dismiss:hover {
  background: rgba(255, 255, 255, 0.28);
}

.reminder-pending-card {
  margin-bottom: 24px;
  border-color: #e2a8d8;
  background: linear-gradient(180deg, #fff7fc 0%, rgba(255, 255, 255, 0.92) 100%);
  box-shadow: 0 18px 40px rgba(208, 85, 182, 0.16);
}

.reminder-pending-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.reminder-pending-kicker {
  margin: 0 0 6px;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--primary);
}

.reminder-pending-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.reminder-pending-link {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid var(--line);
  text-decoration: none;
  color: var(--ink);
}

.reminder-pending-link:hover {
  border-color: #e2a8d8;
  background: #fdf6fb;
  text-decoration: none;
  color: var(--primary-dark);
}

.reminder-pending-name {
  font-weight: 700;
  color: var(--primary-dark);
}

.card-alert {
  border-color: #e2a8d8;
  background: linear-gradient(180deg, #fff7fc 0%, rgba(255, 255, 255, 0.92) 100%);
}

.reminder-popup {
  border: 1px solid var(--line);
  border-radius: 1.15rem;
  padding: 0;
  max-width: min(440px, calc(100vw - 32px));
  box-shadow: var(--shadow);
  color: var(--ink);
}

.reminder-popup::backdrop {
  background: rgba(47, 26, 69, 0.42);
}

.reminder-popup-inner {
  margin: 0;
  padding: 24px;
}

.reminder-popup-list {
  margin-top: 4px;
}

.reminder-popup-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}

.reminder-popup-list li:last-child {
  border-bottom: 0;
}

@media (max-width: 900px) {
  .cards, .form-grid { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .topnav, .main, .reminder-alert-bar { padding-left: 20px; padding-right: 20px; }
}
