/* ============================================================
   Vahvista app — auth (signin/signup) + account dashboard
   ============================================================ */

:root {
  --ink: #15161c;
  --ink-soft: #565a66;
  --muted: #8b8f9a;
  --line: rgba(20, 24, 40, 0.1);
  --white: #ffffff;
  --bg: #eef2fb;
  --blue: #3b82f6;
  --blue-2: #6366f1;
  --blue-bg: #e6edfe;
  --green: #18a058;
  --green-bg: #e3f6ec;
  --amber: #e0890f;
  --amber-bg: #fdf0db;
  --red: #e5484d;
  --red-bg: #fdeaea;
  --pink: #ec4899;
  --radius: 16px;
  --radius-lg: 22px;
  --radius-pill: 999px;
  --shadow-sm: 0 6px 16px rgba(30, 40, 80, 0.07);
  --shadow-md: 0 18px 40px rgba(30, 40, 80, 0.12);
  --shadow-lg: 0 34px 70px rgba(30, 40, 80, 0.18);
  --font: "Plus Jakarta Sans", system-ui, -apple-system, Segoe UI, Roboto,
    Helvetica, Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

/* The hidden attribute must always win, even over display rules like .btn. */
[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}

a {
  color: var(--blue);
}

/* ---------- Brand ---------- */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
  line-height: 1;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  overflow: hidden;
  flex-shrink: 0;
}

.brand-mark img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.brand-name {
  display: inline-flex;
  align-items: baseline;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
}

.brand-name-vah {
  background: linear-gradient(135deg, #1e40af 0%, #4338ca 50%, #7c3aed 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.brand-name-vista {
  margin-left: -0.5px;
  color: var(--ink);
  font-weight: 700;
  letter-spacing: -0.03em;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: var(--radius-pill);
  font-family: inherit;
  font-weight: 600;
  font-size: 15px;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease,
    opacity 0.2s ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: 0.6; cursor: not-allowed; }

.btn-dark {
  background: var(--ink);
  color: #fff;
  box-shadow: 0 10px 22px rgba(21, 22, 28, 0.2);
}
.btn-dark:hover { transform: translateY(-2px); }

.btn-primary {
  background: linear-gradient(135deg, var(--blue), var(--blue-2));
  color: #fff;
  box-shadow: 0 10px 22px rgba(59, 99, 246, 0.32);
}
.btn-primary:hover { transform: translateY(-2px); }

.btn-light {
  background: #eef1f7;
  color: var(--ink);
  border-color: var(--line);
}
.btn-light:hover { background: #e6eaf2; }

.btn-ghost {
  background: transparent;
  color: var(--ink-soft);
}
.btn-ghost:hover { background: rgba(20, 24, 40, 0.05); }

.btn-danger {
  background: var(--red-bg);
  color: var(--red);
}
.btn-danger:hover { background: #fbdada; }

.btn-block { width: 100%; }
.btn-sm { padding: 8px 14px; font-size: 13.5px; }

/* ---------- Forms ---------- */
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}

.field label {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-soft);
}

.input {
  width: 100%;
  font-family: inherit;
  font-size: 15px;
  color: var(--ink);
  background: #f7f8fc;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.input:focus {
  background: #fff;
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.14);
}
textarea.input {
  resize: vertical;
  min-height: 70px;
}

.msg {
  font-size: 14px;
  margin: 4px 0 0;
  min-height: 18px;
}
.msg.error { color: var(--red); }
.msg.success { color: var(--green); }

/* ============================================================
   Auth pages — split-screen
   ============================================================ */
.auth {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: clamp(0px, 3vw, 32px);
  background: #e7e9ee;
}

.auth-shell {
  width: min(1100px, 100%);
  height: min(860px, calc(100vh - clamp(0px, 6vw, 64px)));
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--white);
  border-radius: clamp(0px, 2vw, 22px);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

/* ----- Left media panel ----- */
.auth-media {
  position: relative;
  isolation: isolate;
  background: #2b2622;
}
.auth-media > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 25%;
}
.auth-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(18, 16, 26, 0.45) 0%,
    rgba(18, 16, 26, 0) 28%,
    rgba(18, 16, 26, 0.05) 52%,
    rgba(18, 16, 26, 0.82) 100%
  );
}
.auth-media .brand {
  position: absolute;
  top: 30px;
  left: 30px;
  z-index: 2;
  color: #fff;
}
.auth-media .brand .brand-name-vah {
  background: linear-gradient(135deg, #ffffff 0%, #c7d2fe 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.auth-media .brand .brand-name-vista { color: #fff; }

.auth-quote {
  position: absolute;
  left: 32px;
  right: 32px;
  bottom: 32px;
  z-index: 2;
  color: #fff;
}
.auth-quote blockquote {
  margin: 0 0 16px;
  font-size: clamp(20px, 2.1vw, 27px);
  font-weight: 800;
  line-height: 1.28;
  letter-spacing: -0.01em;
}
.auth-quote-name { font-weight: 700; font-size: 14px; }
.auth-quote-role { font-size: 13px; opacity: 0.78; margin-top: 2px; }

/* ----- Right form panel ----- */
.auth-panel {
  overflow-y: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(28px, 5vw, 56px);
}
.auth-form { width: 100%; max-width: 360px; }

.auth-form-brand { display: none; margin-bottom: 26px; }

.auth-head { text-align: center; margin-bottom: 26px; }
.auth-head h1 {
  margin: 0 0 8px;
  font-size: clamp(24px, 2.6vw, 30px);
  letter-spacing: -0.02em;
}
.auth-head .sub {
  margin: 0;
  color: var(--ink-soft);
  font-size: 14.5px;
}

/* Floating-label inputs */
.f { position: relative; margin-bottom: 14px; }
.f-input {
  width: 100%;
  font-family: inherit;
  font-size: 15px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 22px 15px 8px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.f-input::placeholder { color: transparent; }
.f-label {
  position: absolute;
  left: 15px;
  top: 15px;
  color: var(--muted);
  font-size: 15px;
  pointer-events: none;
  transition: top 0.15s ease, font-size 0.15s ease, color 0.15s ease;
}
.f-input:focus {
  border-color: var(--blue-2);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15);
}
.f-input:focus + .f-label,
.f-input:not(:placeholder-shown) + .f-label {
  top: 8px;
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-soft);
}
.f-input:focus + .f-label { color: var(--blue-2); }

/* Password show / hide */
.f-password .f-input,
.password-field .input {
  padding-right: 46px;
}
.password-toggle {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease;
}
.f-password .password-toggle { top: calc(50% + 2px); }
.password-toggle:hover {
  color: var(--ink-soft);
  background: rgba(99, 102, 241, 0.08);
}
.password-toggle:focus-visible {
  outline: 2px solid var(--blue-2);
  outline-offset: 2px;
}
.password-field {
  position: relative;
}
.field-password .password-field .password-toggle {
  top: 50%;
}
.adminauth-card .password-toggle {
  color: rgba(255, 255, 255, 0.55);
}
.adminauth-card .password-toggle:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}
.adminauth-card .field-password .input {
  padding-right: 46px;
}
.password-toggle-icon {
  width: 20px;
  height: 20px;
  display: block;
}

.link {
  color: var(--blue-2);
  font-weight: 700;
  font-size: 13.5px;
  text-decoration: none;
}
.link:hover { text-decoration: underline; }

.auth-row {
  margin: 2px 0 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

/* Remember toggle */
.remember {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 6px 0 20px;
  font-size: 14px;
  color: var(--ink-soft);
}
.switch { position: relative; width: 44px; height: 26px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch-slider {
  position: absolute;
  inset: 0;
  background: #d6d9e0;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s ease;
}
.switch-slider::before {
  content: "";
  position: absolute;
  width: 20px;
  height: 20px;
  left: 3px;
  top: 3px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  transition: transform 0.2s ease;
}
.switch input:checked + .switch-slider {
  background: linear-gradient(135deg, var(--blue), var(--blue-2));
}
.switch input:checked + .switch-slider::before { transform: translateX(18px); }
.switch input:focus-visible + .switch-slider {
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.2);
}

/* OR divider */
.divider {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 22px 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
}
.divider::before,
.divider::after {
  content: "";
  height: 1px;
  background: var(--line);
  flex: 1;
}

/* Google button */
.btn-google {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 20px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  font-family: inherit;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease;
}
.btn-google:hover { background: #f7f8fc; transform: translateY(-1px); }
.btn-google svg { width: 18px; height: 18px; }

.auth-foot {
  margin-top: 22px;
  text-align: center;
  font-size: 14px;
  color: var(--muted);
}

@media (max-width: 860px) {
  .auth { padding: 0; }
  .auth-shell {
    grid-template-columns: 1fr;
    width: 100%;
    height: auto;
    min-height: 100vh;
    border-radius: 0;
  }
  .auth-media { display: none; }
  .auth-form-brand { display: inline-flex; }
}

/* ============================================================
   Account dashboard
   ============================================================ */
body.dash {
  background:
    radial-gradient(900px 520px at 100% -12%, rgba(99, 102, 241, 0.1), transparent 60%),
    radial-gradient(720px 480px at -8% -4%, rgba(236, 72, 153, 0.07), transparent 60%),
    linear-gradient(180deg, #f1f4fb 0%, #f6f8fc 100%);
  min-height: 100vh;
}
body.modal-open { overflow: hidden; }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 13px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.topbar-user { display: flex; align-items: center; gap: 12px; }
.topbar-id { display: flex; flex-direction: column; line-height: 1.25; text-align: right; }
.topbar-divider { width: 1px; height: 30px; background: var(--line); margin: 0 4px; }
.topbar-name { font-weight: 700; font-size: 14px; }
.topbar-email { font-size: 12px; color: var(--muted); }

.admin-tabs {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  margin-right: 12px;
}
.admin-tab {
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink-soft);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.admin-tab:hover { background: rgba(99, 102, 241, 0.08); color: var(--ink); }
.admin-tab.is-active {
  background: #fff;
  border-color: var(--line);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}
.mail-unread {
  display: inline-grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  margin-left: 4px;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
}

/* ---------- Admin mail ---------- */
.mail-card { overflow: hidden; }
.mail-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}
.mail-search { flex: 1; min-width: 0; }
.mail-layout {
  display: grid;
  grid-template-columns: minmax(260px, 340px) minmax(0, 1fr);
  min-height: 520px;
}
.mail-list-wrap {
  border-right: 1px solid var(--line);
  background: #fafbff;
}
.mail-list {
  display: flex;
  flex-direction: column;
  max-height: 620px;
  overflow-y: auto;
}
.mail-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
  padding: 14px 16px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: inherit;
  transition: background 0.15s ease;
}
.mail-item:hover { background: rgba(99, 102, 241, 0.06); }
.mail-item.is-active { background: #fff; box-shadow: inset 3px 0 0 #6366f1; }
.mail-item.is-unread .mail-item-subject { font-weight: 800; }
.mail-item-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.mail-item-who {
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mail-item-date { font-size: 11px; color: var(--muted); flex-shrink: 0; }
.mail-item-subject {
  font-size: 14px;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mail-item-preview {
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.mail-item-tag {
  align-self: flex-start;
  margin-top: 2px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #6366f1;
}
.mail-read {
  padding: 22px 24px;
  min-height: 520px;
  background: #fff;
}
.mail-empty {
  color: var(--muted);
  font-size: 14px;
  padding: 24px;
}
.mail-read-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}
.mail-read-subject {
  margin: 0 0 8px;
  font-size: 22px;
  letter-spacing: -0.02em;
}
.mail-read-meta {
  margin: 0;
  font-size: 13px;
  line-height: 1.6;
  color: var(--ink-soft);
}
.mail-read-actions {
  flex-shrink: 0;
  display: flex;
  gap: 8px;
  align-items: flex-start;
}
.btn-danger-text {
  color: #b91c1c;
  border-color: #fecaca;
}
.btn-danger-text:hover {
  background: #fef2f2;
  color: #991b1b;
}
.mail-delivery-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0 12px;
}
.mail-item-status {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}
.mail-status {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.mail-status-pending { background: #f3f4f6; color: #4b5563; }
.mail-status-sent { background: #dbeafe; color: #1d4ed8; }
.mail-status-delivered { background: #dcfce7; color: #15803d; }
.mail-status-failed { background: #fee2e2; color: #b91c1c; }
.mail-status-opened { background: #ede9fe; color: #6d28d9; }
.mail-status-clicked { background: #ffedd5; color: #c2410c; }
.mail-failed-reason {
  margin: 0 0 12px;
  font-size: 13px;
  color: #b91c1c;
}
.mail-events {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.mail-events h3 {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 800;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.mail-event-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.mail-event-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}
.mail-event-item:last-child { border-bottom: 0; }
.mail-event-item time {
  flex-shrink: 0;
  color: var(--muted);
  font-size: 12px;
}
.mail-event-item a {
  color: #4338ca;
  word-break: break-all;
}
.mail-thread {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}
.mail-thread-chip {
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #f8faff;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.mail-thread-chip.is-current {
  border-color: #6366f1;
  background: #eef2ff;
  color: #4338ca;
}
.mail-read-body {
  margin: 0;
  padding: 16px;
  border-radius: 14px;
  background: #f8faff;
  border: 1px solid var(--line);
  white-space: pre-wrap;
  word-break: break-word;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.6;
}
.mail-html-toggle {
  margin-top: 14px;
  font-size: 13px;
  color: var(--ink-soft);
}
.mail-html-frame {
  width: 100%;
  min-height: 240px;
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}
.mail-textarea {
  min-height: 220px;
  resize: vertical;
  line-height: 1.55;
}
.modal-card-wide { width: min(720px, calc(100vw - 32px)); }

/* ---------- Avatars ---------- */
.avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 14px;
  color: #fff;
  background: linear-gradient(135deg, #6366f1, #3b82f6);
  box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.4);
  flex: none;
}
.avatar-lg { width: 52px; height: 52px; font-size: 19px; border-radius: 16px; }
.avatar-xl {
  width: 104px;
  height: 104px;
  font-size: 38px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 3px rgba(255, 255, 255, 0.55), var(--shadow-md);
}

/* ---------- Layout ---------- */
.wrap {
  max-width: 1180px;
  margin: 0 auto;
  padding: 34px 28px 90px;
}

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 26px;
}
.page-head .eyebrow {
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--blue);
}
.page-head h1 {
  margin: 0;
  font-size: clamp(28px, 4vw, 38px);
  letter-spacing: -0.025em;
}
.page-head p {
  margin: 8px 0 0;
  color: var(--ink-soft);
  font-size: 16px;
  max-width: 520px;
}

.dash-grid {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 24px;
  align-items: start;
}

/* ---------- Sidebar ---------- */
.side {
  position: sticky;
  top: 86px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.profile-card {
  position: relative;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.profile-cover {
  height: 76px;
  background:
    radial-gradient(120px 80px at 80% 20%, rgba(255, 255, 255, 0.35), transparent),
    linear-gradient(135deg, var(--blue-2), var(--blue) 60%, var(--pink));
}
.profile-body {
  padding: 0 24px 24px;
  text-align: center;
  margin-top: -58px;
}
.profile-avatar-wrap {
  position: relative;
  display: inline-block;
  margin-bottom: 12px;
}
.profile-avatar-wrap .avatar-xl { border: 4px solid #fff; }
.status-dot {
  position: absolute;
  right: 7px;
  bottom: 9px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #22c55e;
  border: 3px solid #fff;
}

.profile-name-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.profile-name { font-weight: 800; font-size: 19px; letter-spacing: -0.01em; }
.tag-new {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: #fff;
  background: linear-gradient(135deg, var(--pink), var(--blue-2));
  padding: 3px 8px;
  border-radius: var(--radius-pill);
}
.profile-handle { font-size: 13.5px; color: var(--muted); margin-top: 2px; }

.profile-meta {
  margin: 18px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 6px 0;
}
.meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 2px;
  font-size: 14px;
}
.meta-row + .meta-row { border-top: 1px dashed var(--line); }
.meta-row span { color: var(--ink-soft); display: inline-flex; align-items: center; gap: 8px; }
.meta-row b { font-weight: 800; }

/* ---------- Next-up spotlight ---------- */
.nextup-card {
  position: relative;
  background: linear-gradient(140deg, #1f2230, #2a2f45);
  color: #fff;
  border-radius: var(--radius-lg);
  padding: 20px;
  overflow: hidden;
  box-shadow: var(--shadow-md);
}
.nextup-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(140px 120px at 90% 0%, rgba(236, 72, 153, 0.5), transparent 70%),
    radial-gradient(160px 120px at 0% 110%, rgba(99, 102, 241, 0.5), transparent 70%);
  pointer-events: none;
}
.nextup-label {
  position: relative;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0.8;
}
.nextup-row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
}
.nextup-name { font-weight: 800; font-size: 16px; }
.nextup-sub { font-size: 13px; opacity: 0.8; }
.nextup-count {
  position: relative;
  margin-top: 16px;
  display: flex;
  align-items: baseline;
  gap: 7px;
}
.nextup-count b {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.03em;
}
.nextup-count span { font-size: 13px; opacity: 0.8; }

/* ---------- Main column ---------- */
.main-col { display: flex; flex-direction: column; gap: 30px; }

.block-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}
.block-title {
  margin: 0;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.count {
  font-size: 12px;
  font-weight: 800;
  color: var(--blue);
  background: var(--blue-bg);
  padding: 3px 10px;
  border-radius: var(--radius-pill);
}

.tabbar {
  display: flex;
  align-items: center;
  gap: 24px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 20px;
}
.tab {
  position: relative;
  padding: 0 2px 14px;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  background: none;
  border: 0;
  cursor: pointer;
  font-family: inherit;
}
.tab em {
  font-style: normal;
  margin-left: 7px;
  font-size: 11px;
  color: var(--blue);
  background: var(--blue-bg);
  padding: 2px 8px;
  border-radius: var(--radius-pill);
}
.tab.is-active { color: var(--ink); }
.tab.is-active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 3px;
  border-radius: 3px 3px 0 0;
  background: linear-gradient(135deg, var(--blue), var(--blue-2));
}

/* ---------- Reminder cards ---------- */
.reminders {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}
.reminder {
  position: relative;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: transform 0.18s ease, box-shadow 0.2s ease;
}
.reminder:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.reminder::before {
  content: "";
  position: absolute;
  top: -34px;
  right: -34px;
  width: 110px;
  height: 110px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.12), transparent 70%);
  pointer-events: none;
}
.reminder.is-today {
  background: linear-gradient(180deg, #fff6fb, #fff) padding-box,
    linear-gradient(135deg, var(--pink), var(--blue-2)) border-box;
  border: 1.5px solid transparent;
}
.reminder.is-today::before {
  background: radial-gradient(circle, rgba(236, 72, 153, 0.2), transparent 70%);
}
.reminder-top { display: flex; align-items: center; gap: 12px; position: relative; }
.reminder-name { font-weight: 800; font-size: 16px; letter-spacing: -0.01em; }
.reminder-rel { font-size: 12.5px; color: var(--muted); }
.reminder-when { margin-top: 16px; display: flex; align-items: baseline; gap: 7px; position: relative; }
.countdown {
  font-size: 34px;
  font-weight: 800;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, var(--blue), var(--blue-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.countdown-unit { font-size: 13px; color: var(--ink-soft); font-weight: 600; }
.badge-today {
  font-size: 13.5px;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, var(--pink), var(--blue-2));
  padding: 6px 13px;
  border-radius: var(--radius-pill);
  box-shadow: 0 8px 18px rgba(236, 72, 153, 0.3);
}
.reminder-meta {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  color: var(--ink-soft);
  position: relative;
}
.reminder-meta .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--blue); }

/* ---------- People card grid ---------- */
.pgrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 16px;
}

.pcard {
  position: relative;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 22px 20px 18px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.pcard:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }

.pcard-actions {
  position: absolute;
  top: 12px;
  right: 12px;
  display: flex;
  gap: 6px;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.15s ease, transform 0.15s ease;
}
.pcard:hover .pcard-actions,
.pcard:focus-within .pcard-actions { opacity: 1; transform: none; }

.pcard-name { margin-top: 14px; font-weight: 800; font-size: 16px; letter-spacing: -0.01em; }
.pcard-rel {
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pcard-foot {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.pcard-date { font-size: 12.5px; color: var(--ink-soft); font-weight: 600; }

.pcard-add {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 196px;
  border: 2px dashed rgba(99, 102, 241, 0.35);
  background: rgba(99, 102, 241, 0.04);
  box-shadow: none;
  cursor: pointer;
  font-family: inherit;
  color: var(--blue-2);
  font-weight: 800;
  font-size: 15px;
}
.pcard-add:hover {
  border-color: var(--blue-2);
  background: rgba(99, 102, 241, 0.08);
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}
.pcard-add .add-plus {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 30px;
  font-weight: 400;
  color: #fff;
  background: linear-gradient(135deg, var(--blue), var(--blue-2));
  box-shadow: 0 10px 22px rgba(59, 99, 246, 0.32);
}

/* ---------- Pills ---------- */
.pill {
  font-size: 12px;
  font-weight: 700;
  padding: 5px 11px;
  border-radius: var(--radius-pill);
  white-space: nowrap;
  width: fit-content;
}
.pill.soon { color: var(--amber); background: var(--amber-bg); }
.pill.today { color: #fff; background: linear-gradient(135deg, var(--pink), var(--blue-2)); }
.pill.later { color: var(--blue); background: var(--blue-bg); }

/* ---------- Icon buttons ---------- */
.icon-btn {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 10px;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  cursor: pointer;
  font-size: 14px;
  transition: background 0.15s ease, transform 0.15s ease, border-color 0.15s ease;
}
.icon-btn:hover { background: #f3f5fa; transform: translateY(-1px); }
.icon-btn.danger:hover { background: var(--red-bg); border-color: rgba(229, 72, 77, 0.3); }

/* ---------- Empty / loading ---------- */
.empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 48px 24px;
  color: var(--muted);
}
.empty .emoji { font-size: 40px; }
.empty p { margin: 12px auto 0; font-size: 15px; max-width: 320px; }

.loading {
  grid-column: 1 / -1;
  padding: 34px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}

/* ============================================================
   Modal
   ============================================================ */
.modal[hidden] { display: none; }
.modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 20px;
}
.modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(18, 22, 40, 0.5);
  backdrop-filter: blur(3px);
  animation: fadeIn 0.2s ease;
}
.modal-card {
  position: relative;
  width: 100%;
  max-width: 520px;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  animation: popIn 0.22s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}
.modal-head {
  position: relative;
  padding: 22px 24px;
  border-bottom: 1px solid var(--line);
}
.modal-head h2 { margin: 0; font-size: 20px; letter-spacing: -0.01em; }
.modal-head p { margin: 4px 0 0; font-size: 13.5px; color: var(--muted); }
.modal-x {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
  cursor: pointer;
  font-size: 15px;
  color: var(--ink-soft);
  display: grid;
  place-items: center;
  transition: background 0.15s ease;
}
.modal-x:hover { background: #f3f5fa; }
.modal-body { padding: 22px 24px; }
.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 24px;
  border-top: 1px solid var(--line);
  background: #fafbfe;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.form-grid .span-2 { grid-column: 1 / -1; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes popIn {
  from { opacity: 0; transform: translateY(12px) scale(0.97); }
  to { opacity: 1; transform: none; }
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 920px) {
  .dash-grid { grid-template-columns: 1fr; }
  .side { position: static; flex-direction: row; flex-wrap: wrap; }
  .profile-card { flex: 1 1 300px; }
  .nextup-card { flex: 1 1 240px; }
}
@media (max-width: 600px) {
  .side { flex-direction: column; }
  .topbar-id { display: none; }
  .modal-foot { flex-direction: column-reverse; }
  .modal-foot .btn { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .modal-overlay, .modal-card { animation: none; }
  .reminder, .pcard, .stat { transition: none; }
}

/* ============================================================
   Admin console
   ============================================================ */
.admin-chip {
  margin-left: 8px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: #fff;
  background: linear-gradient(135deg, #f43f5e, #8b5cf6);
  padding: 3px 8px;
  border-radius: var(--radius-pill);
}

/* Card primitives (shared by admin cards) */
.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.card-head {
  padding: 18px 24px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.card-head h2 { margin: 0; font-size: 16px; letter-spacing: -0.01em; }
.card-pad { padding: 22px 24px; }

/* ----- Dedicated admin login ----- */
.adminauth {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(700px 480px at 15% 10%, rgba(139, 92, 246, 0.28), transparent 60%),
    radial-gradient(700px 520px at 90% 90%, rgba(244, 63, 94, 0.22), transparent 60%),
    linear-gradient(160deg, #15131f 0%, #1c1a2a 55%, #221a26 100%);
}
.adminauth-card {
  position: relative;
  width: 100%;
  max-width: 420px;
  background: rgba(31, 30, 46, 0.86);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-lg);
  padding: 40px 34px 30px;
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(10px);
  color: #fff;
  text-align: center;
}
.adminauth-badge {
  width: 60px;
  height: 60px;
  margin: -54px auto 18px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  font-size: 26px;
  background: linear-gradient(135deg, #f43f5e, #8b5cf6);
  box-shadow: 0 14px 30px rgba(139, 92, 246, 0.45);
}
.adminauth-card .brand {
  color: #fff;
  justify-content: center;
  margin-bottom: 16px;
}
.adminauth-card .brand .brand-name-vah {
  background: linear-gradient(135deg, #ffffff 0%, #c7d2fe 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.adminauth-card .brand .brand-name-vista { color: #fff; }
.adminauth-card h1 {
  margin: 0 0 8px;
  font-size: 24px;
  letter-spacing: -0.02em;
}
.adminauth-sub {
  margin: 0 0 24px;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.62);
}
.adminauth-card .field { text-align: left; }
.adminauth-card .field label { color: rgba(255, 255, 255, 0.7); }
.adminauth-card .input {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.16);
  color: #fff;
}
.adminauth-card .input::placeholder { color: rgba(255, 255, 255, 0.4); }
.adminauth-card .input:focus {
  background: rgba(255, 255, 255, 0.1);
  border-color: #a78bfa;
  box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.25);
}
.adminauth-btn {
  margin-top: 6px;
  color: #fff;
  background: linear-gradient(135deg, #f43f5e, #8b5cf6);
  box-shadow: 0 12px 26px rgba(139, 92, 246, 0.4);
}
.adminauth-btn:hover { transform: translateY(-2px); }
.adminauth-foot {
  margin-top: 22px;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.55);
}
.adminauth-foot .link { color: #c4b5fd; }
.adminauth-foot .dotsep { margin: 0 10px; opacity: 0.5; }

/* Stat cards (admin) */
.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.stat {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s ease, box-shadow 0.2s ease;
}
.stat:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.stat-ic {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-size: 23px;
  flex: none;
  background: linear-gradient(135deg, #eef0ff, #e6edfe);
}
.stat-ic.pink { background: linear-gradient(135deg, #ffe6f1, #ffe0ec); }
.stat-ic.green { background: linear-gradient(135deg, #e2f6ec, #dff3e6); }
.stat-body { min-width: 0; }
.stat-num {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.05;
}
.stat-label { font-size: 12.5px; font-weight: 600; color: var(--muted); margin-top: 2px; }

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

.admin-row {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 20px;
  margin: 24px 0;
  align-items: start;
}

.legend { display: flex; gap: 16px; font-size: 12.5px; font-weight: 700; }
.lg { display: inline-flex; align-items: center; gap: 7px; color: var(--ink-soft); }
.lg::before {
  content: "";
  width: 11px;
  height: 11px;
  border-radius: 3px;
}
.lg-signups::before { background: linear-gradient(135deg, var(--blue), var(--blue-2)); }
.lg-birthdays::before { background: linear-gradient(135deg, var(--pink), #fb7185); }

/* Bar chart */
.chart {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  height: 220px;
  padding-top: 10px;
}
.chart-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  height: 100%;
  justify-content: flex-end;
  min-width: 0;
}
.chart-bars {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 100%;
  width: 100%;
  justify-content: center;
}
.chart-bar {
  width: 11px;
  border-radius: 5px 5px 0 0;
  min-height: 3px;
  transition: height 0.5s cubic-bezier(0.2, 0.8, 0.3, 1);
  position: relative;
}
.chart-bar.b-signups { background: linear-gradient(180deg, var(--blue-2), var(--blue)); }
.chart-bar.b-birthdays { background: linear-gradient(180deg, #fb7185, var(--pink)); }
.chart-col:hover .chart-bar { filter: brightness(1.08); }
.chart-col .chart-x {
  font-size: 10.5px;
  color: var(--muted);
  white-space: nowrap;
}
.chart-col .chart-tip {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translate(-50%, -6px);
  background: var(--ink);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  padding: 5px 8px;
  border-radius: 8px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
  z-index: 5;
}
.chart-col:hover .chart-tip { opacity: 1; }

.mini-stats .mini-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 0;
  font-size: 14px;
  color: var(--ink-soft);
}
.mini-stats .mini-row + .mini-row { border-top: 1px dashed var(--line); }
.mini-stats .mini-row b { font-size: 17px; font-weight: 800; color: var(--ink); }

/* Accounts table */
.accounts-head { flex-wrap: wrap; gap: 14px; }
.accounts-tools { display: flex; gap: 10px; flex-wrap: wrap; }
.input-sm {
  padding: 9px 12px;
  font-size: 14px;
  border-radius: 10px;
  width: auto;
}

.head-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.card-sub { display: block; font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.accounts-title { display: flex; align-items: center; gap: 10px; }

.search-wrap { position: relative; }
.search-ic {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 16px;
  pointer-events: none;
}
.search-input { padding-left: 32px; min-width: 230px; }

/* Native select polish */
select.input {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='none' stroke='%238b8f9a' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round' d='M1 1.5 6 6.5 11 1.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 34px;
  cursor: pointer;
}
select.input:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  background-color: #f1f2f6;
}

.table-scroll { overflow-x: auto; }
.atable {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.atable th {
  text-align: left;
  padding: 12px 20px;
  background: #fafbfe;
  border-bottom: 1px solid var(--line);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}
.atable th.num, .atable td.num { text-align: center; }
.atable th.right, .atable td.right { text-align: right; }
.atable td {
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.atable tbody tr { transition: background 0.15s ease; }
.atable tbody tr:hover { background: #fafbfe; }
.atable tr:last-child td { border-bottom: 0; }

.acct-cell { display: flex; align-items: center; gap: 12px; min-width: 0; }
.acct-name { font-weight: 700; letter-spacing: -0.01em; }
.acct-email { font-size: 12.5px; color: var(--muted); }

.role-badge {
  font-size: 11.5px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  letter-spacing: 0.03em;
}
.role-badge.user { color: var(--ink-soft); background: #eef1f7; }
.role-badge.admin { color: #fff; background: linear-gradient(135deg, #f43f5e, #8b5cf6); }

.count-chip {
  display: inline-grid;
  place-items: center;
  min-width: 30px;
  height: 26px;
  padding: 0 8px;
  border-radius: var(--radius-pill);
  font-weight: 800;
  font-size: 13px;
  color: var(--blue);
  background: var(--blue-bg);
}
.count-chip.zero { color: var(--muted); background: #eef1f7; }

.row-actions { display: inline-flex; gap: 6px; justify-content: flex-end; }
.btn-xs {
  padding: 7px 12px;
  font-size: 12.5px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink-soft);
  font-family: inherit;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.btn-xs:hover { background: #f3f5fa; }
.btn-xs.danger:hover { background: var(--red-bg); color: var(--red); border-color: rgba(229, 72, 77, 0.3); }

/* Detail modal contents */
.detail-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 18px;
}
.detail-meta .dm {
  background: #f7f8fc;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
}
.detail-meta .dm .k { font-size: 12px; color: var(--muted); }
.detail-meta .dm .v { font-weight: 700; margin-top: 2px; }

.detail-people {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 320px;
  overflow-y: auto;
}
.dp {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.dp-info { min-width: 0; }
.dp-name { font-weight: 700; font-size: 14px; }
.dp-sub { font-size: 12.5px; color: var(--muted); }
.dp-when { margin-left: auto; }

@media (max-width: 980px) {
  .admin-row { grid-template-columns: 1fr; }
  .stats-4 { grid-template-columns: repeat(2, 1fr); }
  .mail-layout { grid-template-columns: 1fr; }
  .mail-list { max-height: 280px; }
  .mail-list-wrap { border-right: 0; border-bottom: 1px solid var(--line); }
}

@media (max-width: 900px) {
  .topbar-inner {
    flex-wrap: wrap;
    padding: 12px 16px;
    gap: 10px;
  }
  .topbar-inner > .brand { flex: 1; min-width: 0; }
  .admin-tabs {
    order: 3;
    width: 100%;
    margin: 4px 0 0;
    margin-left: 0;
    margin-right: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .admin-tabs::-webkit-scrollbar { display: none; }
  .admin-tab { flex-shrink: 0; }
}

@media (max-width: 720px) {
  .wrap { padding: 22px 16px 64px; }
  .page-head {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
    margin-bottom: 20px;
  }
  .page-head h1 { font-size: clamp(24px, 7vw, 32px); }
  .page-head p { font-size: 15px; max-width: none; }
  .head-actions { width: 100%; }
  .head-actions .btn { flex: 1; min-width: 0; }
  .card-head {
    flex-direction: column;
    align-items: flex-start;
    padding: 16px 18px;
  }
  .card-pad { padding: 18px; }
  .chart-card .card-head .legend {
    width: 100%;
    flex-wrap: wrap;
    gap: 10px;
  }
  .accounts-head {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  .accounts-tools {
    flex-direction: column;
    width: 100%;
  }
  .accounts-tools .search-wrap,
  .accounts-tools select.input {
    width: 100%;
  }
  .accounts-tools .search-input {
    width: 100%;
    min-width: 0;
  }
  .stat { padding: 16px 18px; gap: 12px; }
  .stat-ic { width: 42px; height: 42px; font-size: 20px; }
  .stat-num { font-size: 24px; }
  .chart { height: 190px; gap: 6px; }
  .mail-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  .mail-toolbar select.input { width: 100%; }
  .mail-read-head {
    flex-direction: column;
    gap: 12px;
  }
  .mail-read-actions {
    width: 100%;
    flex-wrap: wrap;
  }
  .mail-read-actions .btn { flex: 1; min-width: 0; }
  .topbar-id,
  .topbar-divider { display: none; }
  .topbar-user { gap: 8px; }
}

@media (max-width: 560px) {
  .stats-4 { grid-template-columns: 1fr; }
  .detail-meta { grid-template-columns: 1fr; }
  .admin-chip { margin-left: 6px; font-size: 9px; padding: 2px 6px; }
  .topbar-inner > .topbar-user .btn-ghost:first-of-type { display: none; }
  .atable { min-width: 620px; }
  .table-scroll {
    margin: 0 -1px;
    border-top: 1px solid var(--line);
  }
  .row-actions {
    flex-wrap: wrap;
    justify-content: flex-start;
    max-width: 220px;
  }
  .atable th.right,
  .atable td.right { text-align: left; }
  .modal-card-wide { max-width: none; }
}
