/*
 * Tdreeb LMS — admin UI styles
 */

:root {
  --bg: #0c1222;
  --bg-elevated: #111a2e;
  --surface: #151f36;
  --border: rgba(255, 255, 255, 0.08);
  --text: #e8edf7;
  --muted: #8b98b3;
  --accent: #5b8cff;
  --accent-dim: rgba(91, 140, 255, 0.15);
  --success: #3ecf8e;
  --radius: 12px;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  height: 100%;
}

body {
  margin: 0;
  min-height: 100%;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

/* ---------- Flash ---------- */

.flash {
  position: fixed;
  top: 1rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  padding: 0.65rem 1.25rem;
  border-radius: 999px;
  font-size: 0.9rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
  max-width: min(90vw, 420px);
  text-align: center;
}

.flash-notice {
  background: rgba(62, 207, 142, 0.2);
  border: 1px solid rgba(62, 207, 142, 0.35);
  color: #b8f5d9;
}

.flash-alert {
  background: rgba(255, 107, 107, 0.15);
  border: 1px solid rgba(255, 107, 107, 0.35);
  color: #ffc9c9;
}

/* ---------- Auth ---------- */

.body-auth {
  background:
    radial-gradient(ellipse 80% 60% at 50% -20%, rgba(91, 140, 255, 0.25), transparent),
    radial-gradient(ellipse 60% 50% at 100% 100%, rgba(62, 207, 142, 0.08), transparent),
    var(--bg);
}

.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  padding: 2.25rem 2rem;
  background: linear-gradient(145deg, var(--surface) 0%, var(--bg-elevated) 100%);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 4px);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 1.75rem;
}

.auth-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  font-size: 1.1rem;
  color: var(--accent);
  background: var(--accent-dim);
  border-radius: 10px;
}

.auth-brand-name {
  font-weight: 700;
  letter-spacing: -0.02em;
  font-size: 1.1rem;
}

.auth-brand-sub {
  font-size: 0.8rem;
  color: var(--muted);
}

.auth-heading {
  margin: 0 0 0.35rem;
  font-size: 1.5rem;
  font-weight: 650;
  letter-spacing: -0.03em;
}

.auth-lead {
  margin: 0 0 1.75rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.auth-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
}

.auth-input {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.25);
  color: var(--text);
  font: inherit;
}

.auth-input:focus {
  outline: none;
  border-color: rgba(91, 140, 255, 0.55);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

.auth-remember {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.auth-checkbox {
  width: 1rem;
  height: 1rem;
  accent-color: var(--accent);
}

.auth-remember-label {
  font-size: 0.875rem;
  color: var(--muted);
}

.auth-actions {
  margin-top: 0.25rem;
}

.auth-submit {
  width: 100%;
  padding: 0.75rem 1rem;
  border: none;
  border-radius: 8px;
  background: linear-gradient(135deg, #6b96ff 0%, var(--accent) 100%);
  color: #fff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: filter 0.15s ease, transform 0.1s ease;
}

.auth-submit:hover {
  filter: brightness(1.06);
}

.auth-submit:active {
  transform: scale(0.99);
}

.auth-links {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
  font-size: 0.875rem;
}

.auth-links a {
  color: var(--accent);
  text-decoration: none;
}

.auth-links a:hover {
  text-decoration: underline;
}

#error_explanation {
  padding: 0.75rem 1rem;
  border-radius: 8px;
  background: rgba(255, 107, 107, 0.1);
  border: 1px solid rgba(255, 107, 107, 0.25);
  color: #ffc9c9;
  font-size: 0.875rem;
}

#error_explanation h2 {
  margin: 0 0 0.5rem;
  font-size: 0.9rem;
}

#error_explanation ul {
  margin: 0;
  padding-left: 1.1rem;
}

/* ---------- Dashboard ---------- */

.body-app {
  background: var(--bg);
}

.dash-shell {
  display: flex;
  min-height: 100vh;
}

.dash-sidebar {
  width: 260px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  padding: 1.5rem 1.25rem;
  background: var(--bg-elevated);
  border-right: 1px solid var(--border);
}

.dash-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 2rem;
  padding: 0 0.25rem;
}

.dash-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  color: var(--accent);
  background: var(--accent-dim);
  border-radius: 10px;
  font-size: 1rem;
}

.dash-brand-name {
  font-weight: 700;
  letter-spacing: -0.02em;
}

.dash-brand-sub {
  font-size: 0.75rem;
  color: var(--muted);
}

.dash-nav {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  flex: 1;
}

.dash-nav-link {
  display: block;
  padding: 0.6rem 0.85rem;
  border-radius: 8px;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
  transition: background 0.12s ease, color 0.12s ease;
}

.dash-nav-link small {
  font-size: 0.7rem;
  opacity: 0.8;
}

.dash-nav-link--active {
  background: var(--accent-dim);
  color: var(--text);
  font-weight: 600;
}

.dash-nav-link--muted {
  cursor: default;
  opacity: 0.65;
}

.dash-sidebar-footer {
  margin-top: auto;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.dash-user {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 1rem;
}

.dash-user-avatar {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), #3ecf8e);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.95rem;
  color: #0c1222;
}

.dash-user-email {
  font-size: 0.8rem;
  font-weight: 600;
  word-break: break-all;
}

.dash-user-role {
  font-size: 0.7rem;
  color: var(--success);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.dash-signout {
  width: 100%;
  padding: 0.5rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
}

.dash-signout:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
}

.dash-main {
  flex: 1;
  padding: 2rem 2.5rem 3rem;
  overflow-x: auto;
}

.dash-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 2rem;
}

.dash-title {
  margin: 0;
  font-size: 1.65rem;
  font-weight: 650;
  letter-spacing: -0.03em;
}

.dash-subtitle {
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.dash-header-pill {
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: rgba(91, 140, 255, 0.12);
  color: var(--accent);
  border: 1px solid rgba(91, 140, 255, 0.25);
}

.dash-stats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.dash-stat {
  padding: 1.25rem 1.35rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.dash-stat-label {
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

.dash-stat-value {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.dash-stat-hint {
  margin-top: 0.5rem;
  font-size: 0.75rem;
  color: var(--muted);
}

.dash-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.35rem 1.5rem;
}

.dash-panel-title {
  margin: 0 0 1.25rem;
  font-size: 1.05rem;
  font-weight: 650;
}

.dash-activity {
  list-style: none;
  margin: 0;
  padding: 0;
}

.dash-activity-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.85rem;
  align-items: start;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--border);
}

.dash-activity-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.dash-activity-row:first-child {
  padding-top: 0;
}

.dash-activity-dot {
  width: 8px;
  height: 8px;
  margin-top: 0.35rem;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 12px rgba(91, 140, 255, 0.5);
}

.dash-activity-title {
  font-weight: 600;
  font-size: 0.95rem;
}

.dash-activity-meta {
  font-size: 0.82rem;
  color: var(--muted);
  margin-top: 0.15rem;
}

.dash-activity-user {
  color: var(--text);
  font-weight: 500;
}

.dash-activity-time {
  font-size: 0.78rem;
  color: var(--muted);
  white-space: nowrap;
}

/* —— Dashboard analytics —— */
.dash-stats--analytics {
  grid-template-columns: repeat(auto-fill, minmax(185px, 1fr));
}

.dash-stat--accent {
  border-left: 3px solid var(--border);
}

.dash-stat--accent-blue {
  border-left-color: #3b82f6;
}

.dash-stat--accent-teal {
  border-left-color: #14b8a6;
}

.dash-stat--accent-violet {
  border-left-color: #8b5cf6;
}

.dash-stat--accent-amber {
  border-left-color: #f59e0b;
}

.dash-panel--flush {
  padding: 1.15rem 1.35rem;
}

.dash-panel--mix {
  margin-bottom: 1.75rem;
}

.dash-panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  margin-bottom: 1rem;
}

.dash-panel-title--inline {
  margin-bottom: 0;
}

.dash-panel-caption {
  font-size: 0.82rem;
  color: var(--muted);
}

.dash-panel-foot {
  margin: 1rem 0 0;
  font-size: 0.9rem;
}

.dash-split {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
  align-items: stretch;
}

.dash-panel--grow {
  margin: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.dash-kv {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.dash-kv > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.75rem;
  align-items: baseline;
  font-size: 0.9rem;
}

.dash-kv dt {
  margin: 0;
  color: var(--muted);
  font-weight: 500;
}

.dash-kv dd {
  margin: 0;
  text-align: right;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.dash-kv-note {
  font-weight: 400;
  color: var(--muted);
  font-size: 0.78rem;
}

.dash-user-mix-bar {
  display: flex;
  height: 38px;
  border-radius: var(--radius);
  overflow: hidden;
  gap: 3px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
}

.dash-user-mix-seg {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  font-size: 0.72rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.92);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

.dash-user-mix-seg--coach {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
}

.dash-user-mix-seg--student {
  background: linear-gradient(135deg, #14b8a6, #0d9488);
}

.dash-user-mix-seg--guardian {
  background: linear-gradient(135deg, #a78bfa, #7c3aed);
}

.dash-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.35rem;
  list-style: none;
  padding: 0;
  margin: 0.85rem 0 0;
  font-size: 0.8rem;
  color: var(--muted);
}

.dash-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  display: inline-block;
  margin-right: 0.35rem;
  vertical-align: middle;
}

.dash-dot--coach {
  background: #3b82f6;
}

.dash-dot--student {
  background: #14b8a6;
}

.dash-dot--guardian {
  background: #8b5cf6;
}

.dash-activity-row--feed {
  grid-template-columns: 5rem 1fr auto;
}

.dash-activity-kind {
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 0.4rem 0.35rem;
  border-radius: 8px;
  text-align: center;
  line-height: 1.2;
  align-self: start;
  margin-top: 0.12rem;
}

.dash-activity-kind--course {
  background: rgba(59, 130, 246, 0.18);
  color: #93c5fd;
}

.dash-activity-kind--booking {
  background: rgba(20, 184, 166, 0.18);
  color: #5eead4;
}

.dash-activity-kind--purchase {
  background: rgba(245, 158, 11, 0.18);
  color: #fcd34d;
}

.dash-activity-kind--payment {
  background: rgba(34, 197, 94, 0.18);
  color: #86efac;
}

.dash-empty-msg {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.45;
}

@media (max-width: 900px) {
  .dash-shell {
    flex-direction: column;
  }

  .dash-sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--border);
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
  }

  .dash-nav {
    flex-direction: row;
    flex-wrap: wrap;
    width: 100%;
    order: 3;
  }

  .dash-sidebar-footer {
    margin-left: auto;
    margin-top: 0;
    padding-top: 0;
    border-top: none;
    display: flex;
    align-items: center;
    gap: 1rem;
  }

  .dash-user {
    margin-bottom: 0;
  }

  .dash-signout {
    width: auto;
  }
}

/* ---------- Public landing ---------- */

.body-landing {
  background:
    radial-gradient(ellipse 90% 55% at 50% -15%, rgba(91, 140, 255, 0.22), transparent),
    radial-gradient(ellipse 50% 40% at 100% 0%, rgba(62, 207, 142, 0.06), transparent),
    var(--bg);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--border);
  background: rgba(12, 18, 34, 0.85);
  backdrop-filter: blur(12px);
}

.site-header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0.85rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.site-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--text);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.site-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  font-size: 0.95rem;
  color: var(--accent);
  background: var(--accent-dim);
  border-radius: 8px;
}

.site-brand-text {
  font-size: 1.05rem;
}

.site-nav {
  display: none;
  flex: 1;
  justify-content: center;
  gap: 1.5rem;
}

@media (min-width: 640px) {
  .site-nav {
    display: flex;
  }
}

.site-nav-link {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.15s ease;
}

.site-nav-link:hover {
  color: var(--text);
}

.site-header-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.site-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.site-btn--ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--text);
}

.site-btn--ghost:hover {
  background: rgba(255, 255, 255, 0.06);
}

.site-btn--primary {
  background: linear-gradient(135deg, #6b96ff 0%, var(--accent) 100%);
  color: #fff;
  border-color: transparent;
}

.site-btn--primary:hover {
  filter: brightness(1.06);
}

.site-btn--lg {
  padding: 0.75rem 1.35rem;
  font-size: 0.95rem;
}

.site-main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 3rem 1.5rem 4rem;
}

.hero {
  text-align: center;
  padding: 2rem 0 3.5rem;
  max-width: 720px;
  margin: 0 auto;
}

.hero-eyebrow {
  margin: 0 0 0.75rem;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
}

.hero-title {
  margin: 0 0 1rem;
  font-size: clamp(1.85rem, 4vw, 2.45rem);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.15;
}

.hero-lead {
  margin: 0 0 1.75rem;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.65;
}

.hero-cta {
  display: flex;
  justify-content: center;
}

.features {
  padding: 2rem 0;
  border-top: 1px solid var(--border);
}

.section-title {
  margin: 0 0 0.5rem;
  font-size: 1.35rem;
  font-weight: 650;
  letter-spacing: -0.02em;
  text-align: center;
}

.section-lead {
  margin: 0 auto 2rem;
  max-width: 520px;
  text-align: center;
  color: var(--muted);
  font-size: 0.95rem;
}

.feature-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}

.feature-card {
  padding: 1.35rem 1.4rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.feature-card-title {
  margin: 0 0 0.5rem;
  font-size: 1.05rem;
  font-weight: 650;
}

.feature-card-text {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.55;
}

.about-block {
  margin-top: 2.5rem;
  padding: 2rem 0;
  border-top: 1px solid var(--border);
  text-align: center;
}

.about-text {
  margin: 0 auto;
  max-width: 560px;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.65;
}

.site-footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.82rem;
}

.site-footer p {
  margin: 0;
}

/* ---------- Admin CRUD ---------- */

.admin-main {
  max-width: 960px;
}

.admin-page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.75rem;
}

.admin-page-head-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.admin-breadcrumb {
  margin: 0 0 0.35rem;
  font-size: 0.85rem;
}

.admin-subheading {
  margin: 2rem 0 0.75rem;
  font-size: 1.1rem;
  font-weight: 650;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.admin-table th,
.admin-table td {
  padding: 0.65rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.admin-table th {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.admin-table-thumb {
  width: 56px;
}

.admin-table-thumb img {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 8px;
  vertical-align: middle;
}

.admin-thumb-placeholder {
  color: var(--muted);
  font-size: 0.85rem;
}

.admin-table-actions {
  text-align: right;
  white-space: nowrap;
}

.admin-link {
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
}

.admin-link:hover {
  color: var(--accent);
}

.admin-link-muted {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.88rem;
}

.admin-link-muted:hover {
  color: var(--accent);
}

.admin-muted {
  color: var(--muted);
  font-size: 0.88rem;
}

.admin-pill {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  background: var(--accent-dim);
  color: var(--accent);
}

.admin-pill--muted {
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
}

.admin-empty {
  color: var(--muted);
  margin-top: 1rem;
}

.admin-errors {
  padding: 1rem 1.15rem;
  margin-bottom: 1.25rem;
  border-radius: var(--radius);
  background: rgba(255, 107, 107, 0.1);
  border: 1px solid rgba(255, 107, 107, 0.25);
  color: #ffc9c9;
  font-size: 0.9rem;
}

.admin-errors h2 {
  margin: 0 0 0.5rem;
  font-size: 0.95rem;
}

.admin-errors ul {
  margin: 0;
  padding-left: 1.2rem;
}

.admin-form {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  max-width: 560px;
}

.admin-field label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

.admin-input {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.2);
  color: var(--text);
  font: inherit;
}

.admin-input--area {
  min-height: 4rem;
  resize: vertical;
}

.admin-input:focus {
  outline: none;
  border-color: rgba(91, 140, 255, 0.55);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

.admin-file {
  font-size: 0.88rem;
}

.admin-hint {
  margin: 0.35rem 0 0;
  font-size: 0.8rem;
  color: var(--muted);
}

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.admin-detail-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

@media (min-width: 720px) {
  .admin-detail-grid {
    grid-template-columns: 1fr 220px;
    align-items: start;
  }
}

.admin-detail-image img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.admin-prose {
  color: var(--muted);
  line-height: 1.65;
}

.admin-prose--boxed {
  padding: 1.25rem 1.35rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.admin-meta {
  margin: 0;
  padding: 1rem 1.15rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.9rem;
}

.admin-meta dt {
  margin: 0;
  color: var(--muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.admin-meta dd {
  margin: 0.2rem 0 0.85rem;
}

.admin-meta dd:last-child {
  margin-bottom: 0;
}

.admin-meta--inline {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 2rem;
}

.admin-meta--inline dt,
.admin-meta--inline dd {
  margin: 0;
}

.admin-meta--inline dt {
  flex: 0 0 100%;
}

@media (min-width: 720px) {
  .admin-meta--inline dt {
    flex: 0 0 auto;
  }
  .admin-meta--inline dd {
    margin-right: 1.5rem;
  }
}

.admin-list-links {
  margin: 0;
  padding-left: 1.2rem;
  color: var(--muted);
}

.admin-list-links li {
  margin-bottom: 0.35rem;
}

/* ---------- Support chat (admin) ---------- */

.support-chat-page {
  max-width: 1400px;
  margin: 0 auto;
}

.support-chat-admin-head {
  margin-bottom: 1.35rem;
}

.support-chat-admin-head-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem 1.5rem;
}

.support-chat-admin-head-text {
  flex: 1;
  min-width: min(100%, 280px);
}

.support-chat-admin-title {
  margin: 0 0 0.4rem;
  font-size: 1.75rem;
  font-weight: 750;
  letter-spacing: -0.03em;
  background: linear-gradient(120deg, var(--text) 0%, var(--accent) 160%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* Fallback when gradient clip unsupported */
@supports not (background-clip: text) {
  .support-chat-admin-title {
    color: var(--text);
    background: none;
  }
}

.support-chat-admin-lead {
  margin: 0;
  color: var(--muted);
  font-size: 0.94rem;
  line-height: 1.55;
  max-width: 46rem;
}

.support-chat-admin-stat {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  padding: 0.65rem 1rem;
  border-radius: 14px;
  border: 1px solid rgba(91, 140, 255, 0.28);
  background: linear-gradient(145deg, rgba(91, 140, 255, 0.12), rgba(62, 207, 142, 0.06));
  min-width: 5.5rem;
}

.support-chat-admin-stat-value {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text);
  line-height: 1.1;
}

.support-chat-admin-stat-label {
  font-size: 0.72rem;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.support-chat-code {
  padding: 0.15rem 0.45rem;
  border-radius: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 0.82rem;
}

.support-chat-split {
  display: flex;
  align-items: stretch;
  gap: 0;
  min-height: calc(100vh - 240px);
  max-height: calc(100vh - 140px);
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--surface);
  overflow: hidden;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.04) inset,
    0 18px 48px rgba(0, 0, 0, 0.35);
}

.support-chat-sidebar {
  flex: 0 0 min(340px, 38vw);
  min-width: 0;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  background:
    linear-gradient(180deg, rgba(91, 140, 255, 0.06) 0%, transparent 42%),
    var(--bg-elevated);
}

.support-chat-sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1rem 0.65rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.support-chat-sidebar-head-title {
  font-size: 0.72rem;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.support-chat-sidebar-head-count {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: rgba(91, 140, 255, 0.15);
  color: var(--accent);
}

.support-sidebar-list {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem;
}

.support-sidebar-item {
  display: flex;
  gap: 0.75rem;
  padding: 0.75rem 0.65rem;
  border-radius: 10px;
  text-decoration: none;
  color: inherit;
  margin-bottom: 0.35rem;
  transition: background 0.12s ease, border-color 0.12s ease;
  border: 1px solid transparent;
}

.support-sidebar-item:hover {
  background: rgba(91, 140, 255, 0.08);
}

.support-sidebar-item--active {
  background: rgba(91, 140, 255, 0.16);
  border-color: rgba(91, 140, 255, 0.35);
}

.support-sidebar-item-avatar-wrap {
  position: relative;
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
}

.support-sidebar-item-avatar {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.95rem;
  background: linear-gradient(145deg, rgba(91, 140, 255, 0.4), rgba(62, 207, 142, 0.2));
}

.support-sidebar-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 1.25rem;
  height: 1.25rem;
  padding: 0 0.35rem;
  border-radius: 999px;
  font-size: 0.65rem;
  font-weight: 800;
  line-height: 1.25rem;
  text-align: center;
  color: #0c1222;
  background: linear-gradient(135deg, #fbbf24, #f97316);
  border: 2px solid var(--bg-elevated);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

.support-sidebar-item-body {
  flex: 1;
  min-width: 0;
}

.support-sidebar-item-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.35rem;
  margin-bottom: 0.15rem;
}

.support-sidebar-item-name {
  font-weight: 700;
  font-size: 0.92rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.support-sidebar-item-role {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--accent);
  text-transform: capitalize;
  flex-shrink: 0;
}

.support-sidebar-item-email {
  font-size: 0.78rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.support-sidebar-item-time {
  margin-top: 0.35rem;
  font-size: 0.72rem;
  color: var(--muted);
}

.support-sidebar-empty {
  padding: 1.5rem 1rem;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.5;
}

.support-sidebar-empty-hint {
  margin-top: 0.5rem;
  font-size: 0.85rem;
  opacity: 0.9;
}

.support-chat-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding: 0;
  gap: 0;
  min-height: 0;
  background: linear-gradient(165deg, rgba(91, 140, 255, 0.04) 0%, transparent 55%);
}

.support-chat-main-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2.5rem 1.5rem;
  color: var(--muted);
  min-height: 280px;
}

.support-chat-main-empty-graphic {
  position: relative;
  width: 88px;
  height: 64px;
  margin-bottom: 1.25rem;
}

.support-chat-main-empty-bubble {
  position: absolute;
  border-radius: 16px;
  border: 1px solid var(--border);
}

.support-chat-main-empty-bubble--a {
  width: 52px;
  height: 38px;
  left: 0;
  top: 10px;
  background: linear-gradient(145deg, rgba(91, 140, 255, 0.28), rgba(91, 140, 255, 0.06));
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.support-chat-main-empty-bubble--b {
  width: 44px;
  height: 32px;
  right: 0;
  top: 0;
  background: linear-gradient(145deg, rgba(62, 207, 142, 0.22), rgba(62, 207, 142, 0.05));
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
}

.support-chat-main-empty-title {
  margin: 0 0 0.45rem;
  font-size: 1.2rem;
  font-weight: 750;
  color: var(--text);
  letter-spacing: -0.02em;
}

.support-chat-main-empty-text {
  margin: 0;
  max-width: 22rem;
  line-height: 1.6;
  font-size: 0.94rem;
}

@media (max-width: 900px) {
  .support-chat-split {
    flex-direction: column;
    max-height: none;
    min-height: min(70vh, 720px);
  }

  .support-chat-sidebar {
    flex: 0 0 auto;
    max-height: 44vh;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  .support-chat-compose-row {
    flex-direction: column;
    align-items: stretch;
  }

  .support-chat-send {
    width: 100%;
  }
}

.support-chat-peer {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  margin: 0;
  flex-shrink: 0;
  border-bottom: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.12);
}

.support-chat-peer-avatar {
  width: 48px;
  height: 48px;
  border-radius: 999px;
  background: linear-gradient(145deg, rgba(91, 140, 255, 0.45), rgba(62, 207, 142, 0.28));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.05rem;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  flex-shrink: 0;
}

.support-chat-peer-info {
  flex: 1;
  min-width: 0;
}

.support-chat-peer-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  margin-bottom: 0.2rem;
}

.support-chat-peer-name {
  font-weight: 750;
  font-size: 1.1rem;
  letter-spacing: -0.02em;
}

.support-chat-peer-role {
  font-size: 0.68rem;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  background: rgba(91, 140, 255, 0.18);
  color: var(--accent);
}

.support-chat-peer-meta {
  font-size: 0.82rem;
  color: var(--muted);
  word-break: break-all;
}

.support-chat-thread-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 0 1rem;
}

.support-chat-thread {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 0.75rem 1.25rem;
  margin-top: 0.5rem;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background:
    radial-gradient(circle at 20% 20%, rgba(91, 140, 255, 0.07) 0%, transparent 42%),
    radial-gradient(circle at 80% 60%, rgba(62, 207, 142, 0.05) 0%, transparent 45%),
    rgba(0, 0, 0, 0.18);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.support-msg-row {
  display: flex;
}

.support-msg-row--them {
  justify-content: flex-start;
}

.support-msg-row--mine {
  justify-content: flex-end;
}

.support-msg-bubble {
  max-width: min(88%, 560px);
  padding: 0.7rem 0.95rem;
  border-radius: 16px;
  border: 1px solid transparent;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.22);
}

.support-msg-row--them .support-msg-bubble {
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
  border-color: rgba(255, 255, 255, 0.08);
  border-bottom-left-radius: 6px;
}

.support-msg-row--mine .support-msg-bubble {
  background: linear-gradient(155deg, rgba(91, 140, 255, 0.42), rgba(91, 140, 255, 0.15));
  border-color: rgba(91, 140, 255, 0.45);
  border-bottom-right-radius: 6px;
}

.support-msg-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.35rem 0.75rem;
  margin-bottom: 0.45rem;
}

.support-msg-author {
  font-size: 0.72rem;
  font-weight: 750;
  color: rgba(255, 255, 255, 0.72);
}

.support-msg-row--them .support-msg-author {
  color: var(--muted);
}

.support-msg-time {
  font-size: 0.68rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.42);
  font-variant-numeric: tabular-nums;
}

.support-msg-row--them .support-msg-time {
  color: rgba(255, 255, 255, 0.35);
}

.support-msg-text {
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 0.94rem;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.92);
}

.support-msg-row--them .support-msg-text {
  color: var(--text);
}

.support-chat-compose {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1rem 1.25rem 1.25rem;
  margin-top: auto;
  border-top: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.22));
}

.support-chat-compose-label {
  font-size: 0.72rem;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.support-chat-compose-row {
  display: flex;
  flex-direction: row;
  align-items: flex-end;
  gap: 0.75rem;
}

.support-chat-input {
  flex: 1;
  min-width: 0;
  resize: vertical;
  min-height: 76px;
  max-height: 200px;
  padding: 0.85rem 1rem;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: 0.95rem;
  line-height: 1.45;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.support-chat-input:focus {
  outline: none;
  border-color: rgba(91, 140, 255, 0.55);
  box-shadow: 0 0 0 3px rgba(91, 140, 255, 0.18);
}

.support-chat-send {
  appearance: none;
  border: none;
  border-radius: 14px;
  padding: 0.75rem 1.35rem;
  font-weight: 750;
  font-size: 0.92rem;
  cursor: pointer;
  flex-shrink: 0;
  background: linear-gradient(145deg, #7aa7ff, var(--accent));
  color: #0b1020;
  box-shadow: 0 8px 22px rgba(91, 140, 255, 0.25);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.support-chat-send:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(91, 140, 255, 0.32);
}

.support-chat-send:active {
  transform: translateY(0);
}
