:root {
  --bg: #14070f;
  --bg-soft: #1b0a14;
  --surface: #24101c;
  --surface-2: #2d1423;
  --surface-3: #36192a;
  --border: #4a2438;
  --border-soft: #3a1c2c;
  --text: #fff5f8;
  --muted: #c7a6b5;
  --faint: #987c89;
  --accent: #ff5c97;
  --accent-strong: #ff8ab5;
  --accent-soft: #ffd3e2;
  --burgundy: #8c0f3d;
  --success: #4ade80;
  --success-soft: rgba(74, 222, 128, 0.14);
  --warning: #fbbf24;
  --warning-soft: rgba(251, 191, 36, 0.14);
  --danger: #fb7185;
  --danger-soft: rgba(251, 113, 133, 0.14);
  --info: #7dd3fc;
  --info-soft: rgba(125, 211, 252, 0.14);
  --radius: 20px;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.35);
  --font: "SF Arabic", "Geeza Pro", "Segoe UI", Tahoma, sans-serif;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: var(--font);
  background:
    radial-gradient(1100px 700px at 85% -12%, rgba(140, 15, 61, 0.38), transparent 62%),
    radial-gradient(800px 600px at 0% 100%, rgba(255, 92, 151, 0.10), transparent 62%),
    linear-gradient(180deg, #1b0a14 0%, #14070f 55%, #10060c 100%);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

[hidden] { display: none !important; }
button, input, select { font: inherit; }
button { color: inherit; }
a { color: var(--accent-strong); }
bdi { font-variant-numeric: tabular-nums; }
::selection { background: rgba(255, 92, 151, 0.35); }

.ico {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.ico-flip { transform: scaleX(-1); }

/* Boot */
.boot {
  min-height: 100vh;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 18px;
  color: var(--muted);
  font-size: 13px;
}
.boot .brand-mark { animation: breathe 1.8s ease-in-out infinite; }
@keyframes breathe {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255, 92, 151, 0.25); }
  50% { transform: scale(1.04); box-shadow: 0 0 50px 12px rgba(255, 92, 151, 0.12); }
}

/* Brand */
.brand-mark {
  display: block;
  width: 76px;
  height: 76px;
  object-fit: cover;
  border-radius: 22px;
  border: 1px solid rgba(255, 211, 226, 0.28);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.05);
}
.brand-mark-small { width: 46px; height: 46px; border-radius: 14px; }

.eyebrow {
  margin: 0;
  color: var(--accent-strong);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 2.6px;
  direction: ltr;
  text-align: right;
}

/* Login */
.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 18px;
  position: relative;
  overflow: hidden;
}
.login-glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(10px);
  pointer-events: none;
}
.login-glow-one {
  width: 460px;
  height: 460px;
  top: -190px;
  right: -100px;
  background: radial-gradient(circle, rgba(255, 92, 151, 0.28), transparent 68%);
}
.login-glow-two {
  width: 520px;
  height: 520px;
  bottom: -260px;
  left: -140px;
  background: radial-gradient(circle, rgba(140, 15, 61, 0.42), transparent 68%);
}
.login-panel {
  position: relative;
  width: min(100%, 470px);
  padding: 34px;
  border-radius: 30px;
  border: 1px solid rgba(255, 211, 226, 0.16);
  background:
    linear-gradient(180deg, rgba(54, 25, 42, 0.94), rgba(30, 12, 23, 0.97));
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}
.login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 28px; }
.brand-sub {
  margin: 3px 0 0;
  color: var(--faint);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 2px;
  direction: ltr;
  text-align: right;
}
.login-panel h1 { margin: 0 0 10px; font-size: clamp(30px, 6vw, 40px); letter-spacing: -0.8px; }
.login-lead { margin: 0 0 26px; color: var(--muted); font-size: 13px; line-height: 1.85; }
.login-form { display: grid; gap: 9px; }
.login-form label { color: var(--muted); font-size: 11.5px; font-weight: 700; margin-top: 6px; }
.field {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 50px;
  padding: 0 14px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  background: rgba(20, 7, 15, 0.58);
  transition: border-color 0.18s, box-shadow 0.18s;
}
.field:focus-within {
  border-color: rgba(255, 92, 151, 0.8);
  box-shadow: 0 0 0 3px rgba(255, 92, 151, 0.12);
}
.field .ico { color: var(--faint); width: 18px; height: 18px; }
.field input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 15px;
  padding: 13px 0;
  direction: ltr;
  text-align: left;
}
.field input[type="password"] { letter-spacing: 1.5px; }
.field input::placeholder { color: #6f5361; letter-spacing: 0; }
.form-error { min-height: 20px; margin: 3px 0 0; color: #ff9aaa; font-size: 11.5px; line-height: 1.6; }
.form-error:empty { min-height: 0; }
.demo-note {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin: 20px 0 0;
  padding: 10px 12px;
  border: 1px dashed rgba(255, 211, 226, 0.22);
  border-radius: 12px;
  color: var(--muted);
  font-size: 11px;
}
.demo-note span { color: var(--accent-soft); font-weight: 700; }
.login-foot { margin: 18px 0 0; color: var(--faint); font-size: 9.5px; text-align: center; letter-spacing: 0.6px; }

/* App layout */
.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 264px minmax(0, 1fr);
}
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 24px 16px 18px;
  border-left: 1px solid var(--border-soft);
  background: linear-gradient(180deg, rgba(36, 16, 28, 0.92), rgba(20, 7, 15, 0.96));
  backdrop-filter: blur(18px);
  z-index: 20;
}
.sidebar-brand { display: flex; align-items: center; gap: 10px; padding: 0 6px; }
.sidebar-brand strong { display: block; font-size: 13px; letter-spacing: 0.8px; direction: ltr; text-align: right; }
.sidebar-brand span { display: block; margin-top: 2px; color: var(--faint); font-size: 10px; }
.nav { display: flex; flex-direction: column; gap: 4px; }
.nav-btn {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  text-align: right;
  transition: background 0.16s, color 0.16s, border-color 0.16s;
}
.nav-btn .ico { width: 18px; height: 18px; }
.nav-btn:hover { background: rgba(255, 92, 151, 0.07); color: var(--text); }
.nav-btn.is-active {
  background: linear-gradient(90deg, rgba(255, 92, 151, 0.18), rgba(255, 92, 151, 0.05));
  border-color: rgba(255, 92, 151, 0.26);
  color: var(--accent-soft);
}
.nav-btn.is-active .ico { color: var(--accent); }
.nav-btn:focus-visible, .audience-btn:focus-visible { outline: 2px solid rgba(255, 92, 151, 0.55); outline-offset: -2px; }
.sidebar-user {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px;
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.025);
}
.sidebar-user-copy { min-width: 0; flex: 1; }
.sidebar-user-copy strong { display: block; font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-user-copy span { display: block; color: var(--faint); font-size: 9.5px; margin-top: 2px; }
.sidebar-foot { margin: 0; color: #6f5361; font-size: 8px; letter-spacing: 1.6px; text-align: center; direction: ltr; }

.avatar {
  position: relative;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  overflow: hidden;
  flex: 0 0 auto;
  border-radius: 13px;
  background: linear-gradient(145deg, #8c0f3d, #4a001f);
  border: 1px solid rgba(255, 211, 226, 0.18);
  color: #ffe8f0;
  font-weight: 800;
  font-size: 15px;
}
.avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.avatar.has-image span { display: none; }
.avatar-group { width: 52px; height: 52px; border-radius: 15px; }
.avatar.av-1 { background: linear-gradient(145deg, #7c3aed, #3b1d6e); }
.avatar.av-2 { background: linear-gradient(145deg, #0e7490, #083344); }
.avatar.av-3 { background: linear-gradient(145deg, #b45309, #451a03); }
.avatar.av-4 { background: linear-gradient(145deg, #15803d, #052e16); }
.avatar.av-5 { background: linear-gradient(145deg, #be185d, #500724); }
.avatar.is-blocked { filter: grayscale(0.65); opacity: 0.72; }

.main { min-width: 0; padding: 0 28px 26px; max-width: 1480px; width: 100%; margin: 0 auto; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 12;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  padding: 26px 0 16px;
  background: linear-gradient(180deg, rgba(20, 7, 15, 0.95) 58%, rgba(20, 7, 15, 0));
  backdrop-filter: blur(8px);
}
.topbar-title h1 { margin: 5px 0 3px; font-size: clamp(24px, 3vw, 30px); line-height: 1.35; letter-spacing: -0.6px; }
.topbar-title p:last-child { margin: 0; color: var(--faint); font-size: 11.5px; }
.topbar-actions { display: flex; align-items: center; gap: 9px; padding-bottom: 3px; }
.date-chip, .server-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 11px;
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.025);
  color: var(--muted);
  font-size: 10.5px;
  white-space: nowrap;
}
.date-chip .ico { width: 15px; height: 15px; color: var(--faint); }
.server-badge { color: var(--success); border-color: rgba(74, 222, 128, 0.22); background: var(--success-soft); }
.pulse { width: 6px; height: 6px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.12); }
.mobile-only { display: none; }

.banner {
  margin: 4px 0 16px;
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 12px;
  line-height: 1.7;
}
.banner-error { color: #ffc2cb; background: var(--danger-soft); border: 1px solid rgba(251, 113, 133, 0.28); }

/* Stats */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(158px, 1fr));
  gap: 12px;
}
.stat-card {
  position: relative;
  display: block;
  width: 100%;
  text-align: right;
  color: var(--text);
  font-family: inherit;
  min-height: 128px;
  padding: 15px;
  border: 1px solid var(--border-soft);
  border-radius: 18px;
  background:
    radial-gradient(150px 90px at 100% 0%, rgba(255, 92, 151, 0.09), transparent 70%),
    linear-gradient(160deg, var(--surface-2), var(--surface));
  overflow: hidden;
}
.stat-card::after {
  content: "";
  position: absolute;
  inset: auto 14px 0 auto;
  width: 42px;
  height: 2px;
  border-radius: 2px;
  background: var(--accent);
  opacity: 0.55;
}
.stat-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.stat-label { color: var(--muted); font-size: 10.5px; font-weight: 700; }
.stat-icon {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: rgba(255, 92, 151, 0.11);
  color: var(--accent);
}
.stat-icon .ico { width: 15px; height: 15px; }
.stat-value { margin: 15px 0 4px; font-size: 30px; font-weight: 800; line-height: 1; letter-spacing: -1px; }
.stat-caption { color: var(--faint); font-size: 9.5px; line-height: 1.5; }
.stat-card.is-success .stat-icon { color: var(--success); background: var(--success-soft); }
.stat-card.is-success::after { background: var(--success); }
.stat-card.is-warning .stat-icon { color: var(--warning); background: var(--warning-soft); }
.stat-card.is-warning::after { background: var(--warning); }
.stat-card.is-danger .stat-icon { color: var(--danger); background: var(--danger-soft); }
.stat-card.is-danger::after { background: var(--danger); }
.stat-card.is-info .stat-icon { color: var(--info); background: var(--info-soft); }
.stat-card.is-info::after { background: var(--info); }

.split-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 16px;
}
.panel {
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  background: linear-gradient(170deg, rgba(45, 20, 35, 0.72), rgba(28, 11, 21, 0.86));
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
}
.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 15px;
}
.panel-head h2 { margin: 0; font-size: 14px; letter-spacing: -0.2px; }
.panel-head p { margin: 4px 0 0; color: var(--faint); font-size: 10px; line-height: 1.55; }
.text-btn {
  flex: 0 0 auto;
  padding: 5px 2px;
  border: 0;
  background: none;
  color: var(--accent-strong);
  font-size: 10.5px;
  font-weight: 700;
  cursor: pointer;
}
.text-btn:hover { color: var(--accent-soft); text-decoration: underline; text-underline-offset: 3px; }
.count-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 0 9px;
  border-radius: 20px;
  border: 1px solid var(--border-soft);
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  font-size: 10px;
  white-space: nowrap;
}

/* City chart */
.city-chart { display: grid; gap: 13px; }
.city-row { display: grid; gap: 5px; }
.city-meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: var(--muted); font-size: 10.5px; }
.city-meta b { color: var(--text); font-size: 11.5px; }
.bar-track { height: 6px; border-radius: 8px; background: rgba(255, 255, 255, 0.055); overflow: hidden; }
.bar-fill { height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--burgundy), var(--accent)); box-shadow: 0 0 16px rgba(255, 92, 151, 0.28); }
.bar-fill.is-soft { background: linear-gradient(90deg, #3b1d6e, #a78bfa); }

/* Team summary */
.team-summary { display: grid; gap: 9px; }
.team-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.045); }
.team-row:last-child { border-bottom: 0; padding-bottom: 0; }
.team-copy { min-width: 0; flex: 1; }
.team-copy strong { display: block; font-size: 11.5px; }
.team-copy span { display: block; margin-top: 2px; color: var(--faint); font-size: 9.5px; }
.role-pill, .status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 20px;
  border: 1px solid transparent;
  font-size: 9px;
  font-weight: 700;
  white-space: nowrap;
}
.role-pill.role-owner { color: #ffd3e2; background: rgba(255, 92, 151, 0.18); border-color: rgba(255, 92, 151, 0.32); }
.role-pill.role-admin { color: #ddd6fe; background: rgba(167, 139, 250, 0.13); border-color: rgba(167, 139, 250, 0.26); }
.role-pill.role-moderator { color: #bae6fd; background: var(--info-soft); border-color: rgba(125, 211, 252, 0.24); }
.role-pill.role-member { color: var(--muted); background: rgba(255, 255, 255, 0.04); border-color: var(--border-soft); }
.status-pill.is-online { color: var(--success); background: var(--success-soft); border-color: rgba(74, 222, 128, 0.22); }
.status-pill.is-blocked { color: var(--danger); background: var(--danger-soft); border-color: rgba(251, 113, 133, 0.24); }
.status-pill.is-offline { color: var(--faint); background: rgba(255, 255, 255, 0.035); border-color: var(--border-soft); }

/* Mini list */
.mini-list { display: grid; gap: 2px; }
.mini-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 2px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.045);
}
.mini-row:last-child { border-bottom: 0; padding-bottom: 0; }
.mini-row .mini-copy { min-width: 0; flex: 1; }
.mini-row strong { display: block; font-size: 11px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-row span { display: block; margin-top: 2px; color: var(--faint); font-size: 9px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-row .mini-time { flex: 0 0 auto; color: var(--faint); font-size: 8.5px; }
.mini-icon {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  border-radius: 9px;
  background: rgba(255, 92, 151, 0.09);
  color: var(--accent);
}
.mini-icon .ico { width: 14px; height: 14px; }

/* Toolbar */
.view { animation: view-in 0.22s ease-out; }
@keyframes view-in { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }
.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.search-field {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 250px;
  max-width: 390px;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.025);
}
.search-field:focus-within { border-color: rgba(255, 92, 151, 0.55); box-shadow: 0 0 0 3px rgba(255, 92, 151, 0.08); }
.search-field .ico { width: 16px; height: 16px; color: var(--faint); }
.search-field input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--text); font-size: 12px; padding: 11px 0; }
.search-field input::placeholder { color: #7d6170; }
.chips { display: flex; flex-wrap: wrap; gap: 5px; }
.chip {
  min-height: 32px;
  padding: 0 11px;
  border: 1px solid var(--border-soft);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.025);
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  transition: 0.15s;
}
.chip:hover { border-color: rgba(255, 92, 151, 0.35); color: var(--text); }
.chip.is-active { color: var(--accent-soft); border-color: rgba(255, 92, 151, 0.45); background: rgba(255, 92, 151, 0.13); }
.toolbar .count-pill { margin-right: auto; }

/* Members */
.member-list { display: grid; gap: 9px; }
.member-card {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) 100px 140px 100px;
  grid-template-areas: "identity status role actions";
  align-items: center;
  gap: 10px 14px;
  padding: 13px 15px;
  border: 1px solid var(--border-soft);
  border-radius: 17px;
  background: linear-gradient(150deg, rgba(45, 20, 35, 0.62), rgba(28, 11, 21, 0.76));
}
.member-card.is-blocked { border-color: rgba(251, 113, 133, 0.25); background: linear-gradient(150deg, rgba(80, 20, 35, 0.32), rgba(28, 11, 21, 0.8)); }
.member-identity { grid-area: identity; display: flex; align-items: center; gap: 11px; min-width: 0; }
.member-copy { min-width: 0; }
.member-name { display: flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 700; }
.member-name .owner-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }
.member-id { margin-top: 2px; color: var(--faint); font-size: 9.5px; direction: ltr; text-align: right; }
.member-city { margin-top: 3px; color: var(--muted); font-size: 9.5px; }
.member-status-cell { grid-area: status; }
.member-role-cell { grid-area: role; }
.member-actions { grid-area: actions; display: flex; align-items: center; gap: 7px; justify-content: flex-end; }
.role-select {
  width: 100%;
  min-height: 32px;
  padding: 0 8px;
  border: 1px solid var(--border-soft);
  border-radius: 9px;
  background: rgba(20, 7, 15, 0.55);
  color: var(--text);
  font-size: 10px;
  cursor: pointer;
}
.role-select:disabled { opacity: 0.5; cursor: not-allowed; }
.role-select:focus { outline: 2px solid rgba(255, 92, 151, 0.35); outline-offset: 1px; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 42px;
  padding: 0 17px;
  border: 1px solid transparent;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.12s, filter 0.15s, background 0.15s, border-color 0.15s;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-primary {
  color: #2a0011;
  background: linear-gradient(135deg, var(--accent), #ff8ab5);
  box-shadow: 0 10px 28px rgba(255, 92, 151, 0.20);
}
.btn-primary:hover { filter: brightness(1.06); }
.btn-block { width: 100%; min-height: 50px; margin-top: 8px; }
.btn-ghost {
  color: var(--muted);
  border-color: var(--border-soft);
  background: rgba(255, 255, 255, 0.03);
}
.btn-ghost:hover { color: var(--text); border-color: rgba(255, 92, 151, 0.35); }
.btn-danger {
  color: #ffe4e8;
  border-color: rgba(251, 113, 133, 0.35);
  background: rgba(159, 18, 57, 0.55);
}
.btn-danger:hover { background: rgba(190, 18, 60, 0.7); }
.btn-soft {
  color: var(--accent-soft);
  border-color: rgba(255, 92, 151, 0.22);
  background: rgba(255, 92, 151, 0.09);
}
.btn-soft:hover { background: rgba(255, 92, 151, 0.16); }
.btn-sm { min-height: 32px; padding: 0 11px; font-size: 10px; border-radius: 9px; }
.icon-btn {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  cursor: pointer;
}
.icon-btn:hover { color: var(--text); border-color: rgba(255, 92, 151, 0.35); }
.icon-btn .ico { width: 16px; height: 16px; }

/* Reports */
.report-list { display: grid; gap: 11px; }
.report-card {
  padding: 16px;
  border: 1px solid var(--border-soft);
  border-radius: 18px;
  background: linear-gradient(150deg, rgba(45, 20, 35, 0.64), rgba(28, 11, 21, 0.8));
}
.report-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.report-ref { color: var(--faint); font-size: 9px; letter-spacing: 0.8px; direction: ltr; text-align: right; }
.report-title { margin: 5px 0 0; font-size: 14px; }
.report-target { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 5px; color: var(--faint); font-size: 9.5px; }
.report-details {
  margin: 13px 0 0;
  padding: 11px 12px;
  border-right: 2px solid rgba(255, 92, 151, 0.35);
  border-radius: 0 10px 10px 0;
  background: rgba(255, 255, 255, 0.025);
  color: var(--muted);
  font-size: 11px;
  line-height: 1.75;
}
.report-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin-top: 12px; }
.report-date { margin-right: auto; color: var(--faint); font-size: 9px; }
.status-pill.status-pending { color: var(--warning); background: var(--warning-soft); border-color: rgba(251, 191, 36, 0.24); }
.status-pill.status-reviewing { color: var(--info); background: var(--info-soft); border-color: rgba(125, 211, 252, 0.24); }
.status-pill.status-resolved { color: var(--success); background: var(--success-soft); border-color: rgba(74, 222, 128, 0.22); }

/* Groups */
.group-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(255px, 1fr)); gap: 10px; }
.group-card {
  padding: 15px;
  border: 1px solid var(--border-soft);
  border-radius: 17px;
  background: linear-gradient(150deg, rgba(45, 20, 35, 0.62), rgba(28, 11, 21, 0.78));
}
.group-top { display: flex; align-items: center; gap: 10px; }
.group-copy { min-width: 0; flex: 1; }
.group-name { font-size: 12.5px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.group-id { margin-top: 2px; color: var(--faint); font-size: 9px; direction: ltr; text-align: right; }
.group-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 12px; color: var(--muted); font-size: 9.5px; }
.group-meta b { color: var(--text); }
.group-bar { margin-top: 6px; }

/* Roles */
.roles-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 10px; margin-bottom: 16px; }
.role-card {
  padding: 16px;
  border: 1px solid var(--border-soft);
  border-radius: 18px;
  background: linear-gradient(150deg, rgba(45, 20, 35, 0.66), rgba(28, 11, 21, 0.8));
}
.role-card.is-current { border-color: rgba(255, 92, 151, 0.4); box-shadow: inset 0 0 0 1px rgba(255, 92, 151, 0.12); }
.role-card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.role-card h3 { margin: 12px 0 4px; font-size: 14px; }
.role-card p { margin: 0; color: var(--faint); font-size: 10px; line-height: 1.7; }
.role-caps { display: grid; gap: 5px; margin: 12px 0 0; padding: 0; list-style: none; }
.role-caps li { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 9.5px; }
.role-caps li::before { content: ""; width: 4px; height: 4px; border-radius: 50%; background: var(--accent); flex: 0 0 auto; }
.team-list { display: grid; gap: 2px; }
.team-list .team-row { padding: 10px 2px; }
.team-role-form { display: flex; align-items: center; gap: 8px; }
.team-role-form .role-select { min-width: 120px; }

/* Audit */
.audit-list { display: grid; gap: 0; }
.audit-row { display: flex; align-items: flex-start; gap: 10px; padding: 12px 2px; border-bottom: 1px solid rgba(255, 255, 255, 0.05); }
.audit-row:last-child { border-bottom: 0; padding-bottom: 0; }
.audit-icon {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  border-radius: 9px;
  background: rgba(255, 92, 151, 0.08);
  color: var(--accent);
}
.audit-icon .ico { width: 14px; height: 14px; }
.audit-copy { min-width: 0; flex: 1; }
.audit-copy strong { display: block; font-size: 11px; line-height: 1.5; }
.audit-copy span { display: block; margin-top: 3px; color: var(--faint); font-size: 9px; line-height: 1.55; }
.audit-time { flex: 0 0 auto; color: var(--faint); font-size: 8.5px; padding-top: 2px; }

/* Empty state */
.empty {
  display: grid;
  place-items: center;
  gap: 8px;
  padding: 34px 18px;
  text-align: center;
  border: 1px dashed var(--border-soft);
  border-radius: 15px;
  color: var(--faint);
  font-size: 11px;
}
.empty .ico { width: 24px; height: 24px; color: #6f5361; }
.empty strong { color: var(--text); font-size: 11.5px; font-weight: 700; }
.empty span { max-width: 250px; line-height: 1.65; }

/* Main footer */
.main-foot { margin-top: 22px; padding-top: 14px; border-top: 1px solid rgba(255, 255, 255, 0.045); color: #6f5361; font-size: 8.5px; letter-spacing: 0.7px; text-align: center; direction: ltr; }

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  z-index: 60;
  max-width: min(420px, calc(100vw - 32px));
  padding: 11px 18px;
  border: 1px solid rgba(255, 92, 151, 0.28);
  border-radius: 12px;
  background: rgba(36, 16, 28, 0.97);
  color: var(--text);
  font-size: 11.5px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  opacity: 0;
  transition: opacity 0.18s, transform 0.18s;
}
.toast.is-visible { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.is-error { border-color: rgba(251, 113, 133, 0.4); }

/* Dialog */
.dialog {
  width: min(420px, calc(100vw - 32px));
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--surface-2);
  color: var(--text);
  box-shadow: var(--shadow);
}
.dialog::backdrop { background: rgba(8, 3, 7, 0.72); backdrop-filter: blur(4px); }
.dialog h2 { margin: 0 0 8px; font-size: 18px; }
.dialog p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.8; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 22px; }

.noscript { padding: 20px; color: var(--danger); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); border: 0; }

button.stat-card { cursor: pointer; }
button.stat-card:hover { border-color: rgba(255, 92, 151, 0.35); }
button.stat-card:focus-visible { outline: 2px solid rgba(255, 92, 151, 0.55); outline-offset: 2px; }

@media (max-width: 1100px) {
  .app-shell { grid-template-columns: 232px minmax(0, 1fr); }
  .main { padding-inline: 22px; }
  .member-card {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "identity status" "role actions";
    gap: 10px 12px;
    padding: 13px;
  }
  .member-role-cell { max-width: 190px; }
  .member-actions { padding-top: 10px; border-top: 1px solid rgba(255, 255, 255, 0.05); }
}

@media (max-width: 880px) {
  .app-shell { display: block; }
  .sidebar {
    position: fixed;
    inset: auto 0 0 0;
    width: auto;
    height: 68px;
    flex-direction: row;
    align-items: center;
    gap: 0;
    padding: 5px 6px calc(5px + env(safe-area-inset-bottom));
    border-left: 0;
    border-top: 1px solid var(--border);
    background: rgba(22, 8, 16, 0.97);
    backdrop-filter: blur(20px);
  }
  .sidebar-brand, .sidebar-user, .sidebar-foot { display: none; }
  .nav { flex-direction: row; width: 100%; overflow-x: auto; gap: 1px; scrollbar-width: none; }
  .nav::-webkit-scrollbar { display: none; }
  .nav-btn {
    flex: 1 0 58px;
    min-height: 54px;
    flex-direction: column;
    justify-content: center;
    gap: 3px;
    padding: 4px 2px;
    font-size: 8.5px;
    border-radius: 10px;
  }
  .nav-btn .ico { width: 17px; height: 17px; }
  .main { padding: 0 16px 92px; }
  .topbar { padding-top: 18px; }
  .mobile-only { display: grid; }
  .server-badge { display: none; }
  .date-chip { display: none; }
  .split-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .login-panel { padding: 26px 20px; border-radius: 22px; }
  .login-brand { margin-bottom: 22px; }
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .stat-card { min-height: 116px; padding: 12px; }
  .stat-value { font-size: 26px; margin-top: 12px; }
  .stat-caption { font-size: 8.5px; }
  .panel { padding: 14px; border-radius: 16px; }
  .topbar { align-items: center; }
  .topbar-title h1 { font-size: 22px; }
  .topbar-title p:last-child { max-width: 210px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .toolbar { align-items: stretch; }
  .search-field { max-width: none; flex-basis: 100%; }
  .toolbar .count-pill { margin-right: 0; }
  .member-role-cell { max-width: 150px; }
  .member-actions .btn { min-width: 92px; }
  .role-select { min-height: 36px; }
  .report-head { flex-direction: column; gap: 6px; }
  .report-date { margin-right: 0; width: 100%; }
  .dialog { padding: 20px; }
}

@media (max-width: 380px) {
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .stat-label { font-size: 9.5px; }
  .nav-btn { flex-basis: 52px; font-size: 8px; }
}

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

/* Sidebar with twelve modules */
.nav { min-height: 0; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--border) transparent; }
.nav::-webkit-scrollbar { width: 4px; }
.nav::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

/* System summary */
.system-summary { display: grid; gap: 0; }
.system-row { display: flex; align-items: center; gap: 10px; padding: 9px 2px; border-bottom: 1px solid rgba(255, 255, 255, 0.045); }
.system-row:last-child { border-bottom: 0; padding-bottom: 0; }
.system-icon { display: grid; place-items: center; width: 28px; height: 28px; flex: 0 0 auto; border-radius: 9px; background: rgba(255, 92, 151, 0.08); color: var(--accent); }
.system-icon .ico { width: 14px; height: 14px; }
.system-copy { min-width: 0; flex: 1; }
.system-copy span { display: block; color: var(--faint); font-size: 9px; }
.system-copy strong { display: block; margin-top: 2px; color: var(--text); font-size: 10.5px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-row .mini-copy span { white-space: normal; }
.interest-row { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; }
.interest { padding: 2px 6px; border: 1px solid var(--border-soft); border-radius: 8px; color: var(--faint); font-size: 8px; }

/* Shared status colours */
.status-pill.ticket-open, .status-pill.post-published { color: var(--success); background: var(--success-soft); border-color: rgba(74, 222, 128, 0.22); }
.status-pill.ticket-inProgress, .status-pill.post-hidden { color: var(--warning); background: var(--warning-soft); border-color: rgba(251, 191, 36, 0.24); }
.status-pill.ticket-resolved { color: var(--info); background: var(--info-soft); border-color: rgba(125, 211, 252, 0.24); }
.status-pill.ticket-closed, .status-pill.post-removed { color: var(--faint); background: rgba(255, 255, 255, 0.035); border-color: var(--border-soft); }
.priority-pill { display: inline-flex; align-items: center; min-height: 20px; padding: 0 7px; border-radius: 20px; border: 1px solid var(--border-soft); font-size: 8.5px; font-weight: 700; white-space: nowrap; }
.priority-pill.priority-low { color: var(--muted); background: rgba(255, 255, 255, 0.035); }
.priority-pill.priority-normal { color: var(--info); background: var(--info-soft); border-color: rgba(125, 211, 252, 0.22); }
.priority-pill.priority-high { color: var(--warning); background: var(--warning-soft); border-color: rgba(251, 191, 36, 0.24); }
.priority-pill.priority-urgent { color: var(--danger); background: var(--danger-soft); border-color: rgba(251, 113, 133, 0.28); }
.toolbar-note { flex: 1 1 100%; margin: 0; color: var(--faint); font-size: 10.5px; line-height: 1.6; }
.resolution-note { margin: 10px 0 0; padding: 8px 10px; border-radius: 9px; background: var(--success-soft); color: var(--success); font-size: 10px; line-height: 1.65; }

/* Content moderation */
.post-list { display: grid; gap: 11px; }
.post-card { padding: 16px; border: 1px solid var(--border-soft); border-radius: 18px; background: linear-gradient(150deg, rgba(45, 20, 35, 0.64), rgba(28, 11, 21, 0.8)); }
.post-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.post-author { display: flex; align-items: center; gap: 10px; min-width: 0; }
.post-author .avatar { width: 36px; height: 36px; border-radius: 11px; font-size: 13px; }
.post-author strong { display: block; font-size: 12px; }
.post-author span { display: block; margin-top: 2px; color: var(--faint); font-size: 9px; }
.post-head-side { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; }
.post-id { color: var(--faint); font-size: 8.5px; direction: ltr; }
.post-text { margin: 13px 0 0; color: var(--muted); font-size: 12px; line-height: 1.85; white-space: pre-wrap; overflow-wrap: anywhere; }
.thumb-row { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 12px; }
.thumb { width: 96px; height: 96px; object-fit: cover; border: 1px solid var(--border-soft); border-radius: 11px; background: var(--surface); }
.post-meta { display: flex; align-items: center; gap: 14px; margin-top: 13px; color: var(--faint); font-size: 10px; }
.post-meta span { display: inline-flex; align-items: center; gap: 4px; }
.post-meta .ico { width: 14px; height: 14px; }
.post-meta .post-date { margin-right: auto; font-size: 9px; }
.post-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; padding-top: 12px; border-top: 1px solid rgba(255, 255, 255, 0.05); }
.comments-panel { margin-top: 16px; }
.comment-list { display: grid; gap: 0; }
.comment-row { display: flex; align-items: flex-start; gap: 12px; padding: 11px 2px; border-bottom: 1px solid rgba(255, 255, 255, 0.05); }
.comment-row:last-child { border-bottom: 0; padding-bottom: 0; }
.comment-copy { min-width: 0; flex: 1; }
.comment-copy strong { display: block; font-size: 10.5px; }
.comment-copy span { display: block; margin-top: 3px; color: var(--muted); font-size: 10.5px; line-height: 1.7; overflow-wrap: anywhere; }
.comment-copy small { display: block; margin-top: 3px; color: var(--faint); font-size: 8.5px; direction: ltr; text-align: right; }
.comment-row .text-btn { flex: 0 0 auto; }

/* Conversations */
.chat-layout { display: grid; grid-template-columns: 310px minmax(0, 1fr); gap: 14px; align-items: start; }
.conversation-list { display: grid; gap: 6px; max-height: 68vh; overflow-y: auto; padding-left: 2px; }
.conversation-item {
  display: block;
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--border-soft);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.022);
  color: var(--text);
  text-align: right;
  cursor: pointer;
  font-family: inherit;
  transition: 0.15s;
}
.conversation-item:hover { border-color: rgba(255, 92, 151, 0.32); background: rgba(255, 92, 151, 0.05); }
.conversation-item.is-active { border-color: rgba(255, 92, 151, 0.48); background: rgba(255, 92, 151, 0.11); }
.conversation-top { display: flex; align-items: center; justify-content: space-between; gap: 7px; }
.conversation-top strong { font-size: 10.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conversation-top span { flex: 0 0 auto; color: var(--faint); font-size: 8px; }
.conversation-item p { margin: 5px 0 0; color: var(--muted); font-size: 9.5px; line-height: 1.6; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conversation-item small { display: block; margin-top: 4px; color: var(--faint); font-size: 8px; }
.chat-thread-panel { min-height: 480px; }
.message-list { display: grid; gap: 9px; max-height: 62vh; overflow-y: auto; padding-left: 2px; }
.message-row { max-width: 82%; padding: 10px 12px; border: 1px solid var(--border-soft); border-radius: 13px 13px 13px 3px; background: rgba(255, 255, 255, 0.025); }
.message-row.is-removed { opacity: 0.55; border-color: rgba(251, 113, 133, 0.28); }
.message-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.message-head strong { font-size: 9.5px; color: var(--accent-soft); }
.message-head span { color: var(--faint); font-size: 8px; direction: ltr; text-align: left; }
.message-row p { margin: 5px 0 0; color: var(--muted); font-size: 10.5px; line-height: 1.75; white-space: pre-wrap; overflow-wrap: anywhere; }
.message-row .thumb { width: 120px; height: 120px; margin-top: 7px; }
.message-actions { display: flex; justify-content: flex-end; margin-top: 5px; }
.message-actions .text-btn { font-size: 8.5px; color: var(--danger); }

/* Support tickets */
.ticket-list { display: grid; gap: 12px; }
.ticket-card { padding: 16px; border: 1px solid var(--border-soft); border-radius: 18px; background: linear-gradient(150deg, rgba(45, 20, 35, 0.64), rgba(28, 11, 21, 0.8)); }
.ticket-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.ticket-head h3 { margin: 5px 0 0; font-size: 14px; }
.ticket-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 5px; color: var(--faint); font-size: 9.5px; }
.ticket-messages { display: grid; gap: 7px; margin-top: 13px; padding: 10px; border-radius: 12px; background: rgba(20, 7, 15, 0.35); }
.ticket-message { padding: 8px 10px; border-right: 2px solid var(--border); border-radius: 0 9px 9px 0; background: rgba(255, 255, 255, 0.02); }
.ticket-message.is-support { border-right-color: var(--accent); background: rgba(255, 92, 151, 0.07); }
.ticket-message p { margin: 4px 0 0; color: var(--muted); font-size: 10.5px; line-height: 1.7; white-space: pre-wrap; overflow-wrap: anywhere; }
.ticket-empty { margin: 0; color: var(--faint); font-size: 10px; }
.ticket-actions { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; margin-top: 12px; }
.inline-select { display: flex; align-items: center; gap: 6px; color: var(--faint); font-size: 9px; }
.inline-select select { min-height: 32px; border: 1px solid var(--border-soft); border-radius: 9px; background: rgba(20, 7, 15, 0.55); color: var(--text); font-size: 9.5px; padding: 0 7px; }
.ticket-reply { display: flex; align-items: flex-end; gap: 7px; flex: 1 1 260px; }
.ticket-reply textarea { flex: 1; min-height: 40px; max-height: 120px; resize: vertical; padding: 8px 10px; border: 1px solid var(--border-soft); border-radius: 10px; background: rgba(20, 7, 15, 0.55); color: var(--text); font-size: 10.5px; line-height: 1.6; outline: 0; }
.ticket-reply textarea:focus { border-color: rgba(255, 92, 151, 0.55); }
.ticket-reply .ico { width: 14px; height: 14px; }

/* Nearby */
.nearby-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(310px, 1fr)); gap: 10px; }
.nearby-card { padding: 14px; border: 1px solid var(--border-soft); border-radius: 17px; background: linear-gradient(150deg, rgba(45, 20, 35, 0.62), rgba(28, 11, 21, 0.78)); }
.nearby-card.is-active { border-color: rgba(74, 222, 128, 0.25); box-shadow: inset 0 0 0 1px rgba(74, 222, 128, 0.05); }
.nearby-identity { display: flex; align-items: center; gap: 10px; }
.nearby-identity strong { display: block; font-size: 11.5px; }
.nearby-identity span { display: block; margin-top: 2px; color: var(--faint); font-size: 9px; }
.nearby-status { margin-top: 9px; }
.nearby-meta { display: flex; flex-wrap: wrap; gap: 6px 12px; margin-top: 9px; color: var(--faint); font-size: 9px; }
.nearby-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 11px; padding-top: 10px; border-top: 1px solid rgba(255, 255, 255, 0.05); }
.inline-number { display: flex; align-items: center; gap: 5px; color: var(--faint); font-size: 9px; }
.inline-number input { width: 62px; min-height: 32px; border: 1px solid var(--border-soft); border-radius: 9px; background: rgba(20, 7, 15, 0.55); color: var(--text); font-size: 10px; padding: 0 6px; text-align: center; }

/* Media library */
.media-upload-panel { margin-bottom: 14px; }
.media-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; }
.file-field, .select-field { display: grid; gap: 5px; color: var(--faint); font-size: 9.5px; }
.file-field { flex: 1 1 250px; }
.file-field input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.file-pick { display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 11px; border: 1px dashed var(--border); border-radius: 11px; background: rgba(20, 7, 15, 0.4); color: var(--muted); font-size: 10.5px; cursor: pointer; overflow: hidden; }
.file-pick .ico { width: 16px; height: 16px; flex: 0 0 auto; color: var(--accent-soft); }
.file-pick b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.file-field:focus-within .file-pick { border-color: rgba(255, 92, 151, 0.55); }
.select-field select { min-height: 40px; padding: 0 9px; border: 1px solid var(--border-soft); border-radius: 11px; background: rgba(20, 7, 15, 0.55); color: var(--text); font-size: 10.5px; }
.media-form .form-error { flex: 1 1 100%; margin: 0; }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.media-grid > .empty-state { grid-column: 1 / -1; }
.media-card { overflow: hidden; border: 1px solid var(--border-soft); border-radius: 15px; background: rgba(255, 255, 255, 0.022); }
.media-preview { aspect-ratio: 4 / 3; background: rgba(20, 7, 15, 0.55); }
.media-preview img { display: block; width: 100%; height: 100%; object-fit: cover; }
.media-copy { padding: 10px 11px; }
.media-copy strong { display: block; font-size: 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.media-copy span, .media-copy small { display: block; margin-top: 3px; color: var(--faint); font-size: 8.5px; }

/* Settings */
.settings-panel { max-width: 900px; }
.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px 16px; }
.setting-field { display: grid; gap: 6px; }
.setting-field.is-switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 58px; padding: 10px 12px; border: 1px solid var(--border-soft); border-radius: 12px; background: rgba(255, 255, 255, 0.022); }
.setting-label label { display: block; color: var(--muted); font-size: 10.5px; font-weight: 700; }
.setting-label small { display: block; margin-top: 3px; color: var(--faint); font-size: 8.5px; line-height: 1.5; }
.setting-field input:not([type="checkbox"]), .setting-field select { width: 100%; min-height: 40px; padding: 0 10px; border: 1px solid var(--border-soft); border-radius: 10px; background: rgba(20, 7, 15, 0.55); color: var(--text); font-size: 11px; outline: 0; }
.setting-field input:focus, .setting-field select:focus { border-color: rgba(255, 92, 151, 0.55); }
.switch { position: relative; display: inline-flex; width: 42px; height: 24px; flex: 0 0 auto; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.switch span { width: 100%; height: 100%; border-radius: 20px; border: 1px solid var(--border); background: rgba(20, 7, 15, 0.7); transition: 0.18s; }
.switch span::after { content: ""; position: absolute; top: 4px; right: 4px; width: 16px; height: 16px; border-radius: 50%; background: var(--faint); transition: 0.18s; }
.switch input:checked + span { background: rgba(255, 92, 151, 0.28); border-color: rgba(255, 92, 151, 0.55); }
.switch input:checked + span::after { transform: translateX(-18px); background: var(--accent); }
.settings-actions { display: flex; align-items: center; gap: 12px; margin-top: 18px; padding-top: 15px; border-top: 1px solid rgba(255, 255, 255, 0.06); }
.settings-hint { color: var(--faint); font-size: 9.5px; }

@media (max-width: 1100px) {
  .chat-layout { grid-template-columns: 260px minmax(0, 1fr); }
  .settings-grid { grid-template-columns: 1fr; }
}

@media (max-width: 880px) {
  .nav { overflow-x: auto; overflow-y: hidden; }
  .chat-layout { grid-template-columns: 1fr; }
  .conversation-list { display: flex; max-height: none; overflow-x: auto; overflow-y: hidden; padding-bottom: 3px; }
  .conversation-item { flex: 0 0 210px; }
  .chat-thread-panel { min-height: 0; }
  .message-list { max-height: none; }
  .nearby-list { grid-template-columns: 1fr; }
  .settings-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .post-head { flex-direction: column; gap: 7px; }
  .post-head-side { width: 100%; justify-content: space-between; }
  .post-actions .btn { flex: 1; }
  .message-row { max-width: 95%; }
  .ticket-head { flex-direction: column; gap: 6px; }
  .ticket-reply { flex-basis: 100%; }
  .ticket-actions .inline-select { width: 100%; justify-content: space-between; }
  .inline-select select { flex: 1; }
  .media-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .media-form .btn { width: 100%; }
  .settings-grid { grid-template-columns: 1fr; }
  .setting-field.is-switch { min-height: 52px; }
  .nearby-meta { flex-direction: column; gap: 4px; }
  .nearby-actions .inline-number { flex: 1 1 100%; justify-content: flex-end; }
}



/* Announcement icon and broadcast composer */
.nav-megaphone { width: 21px; height: 21px; flex: 0 0 auto; object-fit: contain; filter: drop-shadow(0 3px 7px rgba(255, 92, 151, 0.35)); }
.nav-announcement.is-active .nav-megaphone { filter: drop-shadow(0 0 8px rgba(255, 92, 151, 0.75)); }
.announcement-layout { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr); gap: 14px; align-items: start; }
.announcement-composer { display: flex; flex-direction: column; gap: 9px; }
.announcement-heading { display: flex; align-items: center; gap: 12px; }
.announcement-hero { width: 58px; height: 58px; flex: 0 0 auto; padding: 7px; border-radius: 17px; object-fit: contain; border: 1px solid rgba(255, 92, 151, 0.25); background: radial-gradient(circle at 35% 30%, rgba(255, 138, 181, 0.24), rgba(140, 15, 61, 0.18)); }
.field-label { display: block; color: var(--muted); font-size: 10px; font-weight: 700; }
.field-hint { color: var(--faint); font-size: 9px; line-height: 1.5; }
.field-block { display: grid; gap: 7px; margin-top: 2px; }
.announcement-composer .input {
  width: 100%; min-height: 42px; padding: 10px 12px; border: 1px solid var(--border-soft);
  border-radius: 11px; outline: 0; color: var(--text); background: rgba(20, 7, 15, 0.55);
  font-size: 11.5px; line-height: 1.7;
}
.announcement-composer .input:focus { border-color: rgba(255, 92, 151, 0.6); box-shadow: 0 0 0 3px rgba(255, 92, 151, 0.08); }
.announcement-composer .input::placeholder { color: #7d6170; }
.announcement-text { min-height: 138px; resize: vertical; white-space: pre-wrap; }
.audience-toggle { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.audience-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px;
  border: 1px solid var(--border-soft); border-radius: 11px; background: rgba(255, 255, 255, 0.025);
  color: var(--muted); font-size: 10.5px; font-weight: 700; cursor: pointer;
}
.audience-btn img { width: 20px; height: 20px; object-fit: contain; }
.audience-btn .audience-dm { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 7px; color: var(--accent-strong); background: rgba(255, 92, 151, 0.12); font-size: 14px; }
.audience-btn:hover { border-color: rgba(255, 92, 151, 0.35); color: var(--text); }
.audience-btn.is-active { border-color: rgba(255, 92, 151, 0.55); color: var(--text); background: linear-gradient(135deg, rgba(140, 15, 61, 0.55), rgba(255, 92, 151, 0.13)); }
.target-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 2px; }
.target-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; max-height: 218px; overflow-y: auto; padding: 2px; }
.target-grid .empty { grid-column: 1 / -1; }
.target-option {
  display: flex; align-items: flex-start; gap: 8px; min-height: 48px; padding: 8px 9px;
  border: 1px solid var(--border-soft); border-radius: 10px; background: rgba(255, 255, 255, 0.02);
  cursor: pointer;
}
.target-option:hover { border-color: rgba(255, 92, 151, 0.35); }
.target-option input { width: 15px; height: 15px; margin: 2px 0 0; accent-color: var(--accent); flex: 0 0 auto; }
.target-option span { min-width: 0; display: grid; gap: 2px; }
.target-option strong { color: var(--text); font-size: 10px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.target-option small { color: var(--faint); font-size: 8.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.announcement-submit { align-self: flex-start; display: inline-flex; align-items: center; gap: 8px; margin-top: 2px; }
.announcement-submit img { width: 22px; height: 22px; object-fit: contain; }
.announcement-history-panel { min-width: 0; }
.announcement-history { display: grid; gap: 8px; margin-top: 12px; }
.announcement-history-item { padding: 11px; border: 1px solid var(--border-soft); border-radius: 12px; background: rgba(255, 255, 255, 0.022); }
.announcement-history-head { display: flex; align-items: center; gap: 9px; }
.history-megaphone { width: 30px; height: 30px; flex: 0 0 auto; object-fit: contain; }
.announcement-history-head div { min-width: 0; display: grid; gap: 3px; }
.announcement-history-head strong { color: var(--text); font-size: 11px; }
.announcement-history-head span { color: var(--accent-strong); font-size: 8.5px; }
.announcement-history-item p { margin: 8px 0 6px; color: var(--muted); font-size: 10px; line-height: 1.75; white-space: pre-wrap; overflow-wrap: anywhere; }
.announcement-history-item small { color: var(--faint); font-size: 8.5px; }
.message-megaphone { width: 18px; height: 18px; margin-left: 6px; vertical-align: -4px; object-fit: contain; }
.announcement-badge { display: inline-flex; align-items: center; min-height: 19px; margin-top: 5px; padding: 0 7px; border: 1px solid rgba(255, 92, 151, 0.3); border-radius: 20px; color: var(--accent-strong); background: rgba(255, 92, 151, 0.09); font-size: 8px; font-weight: 700; }
.message-row.is-announcement { border-color: rgba(255, 92, 151, 0.32); background: linear-gradient(135deg, rgba(140, 15, 61, 0.34), rgba(255, 92, 151, 0.06)); }
.announcement-message-body { color: var(--text) !important; white-space: pre-wrap; }

@media (max-width: 1100px) {
  .announcement-layout { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .target-grid { grid-template-columns: 1fr; max-height: 185px; }
  .announcement-submit { width: 100%; justify-content: center; }
}

/* Modules stay visible on phones instead of hiding behind a scroll. */
@media (max-width: 880px) {
  .sidebar { height: auto; min-height: 68px; }
  .nav {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 2px;
    overflow: visible;
  }
  .nav-btn {
    flex: initial;
    min-width: 0;
    min-height: 50px;
  }
  .main { padding-bottom: 152px; }
  .nav-megaphone { width: 18px; height: 18px; }
}

/* Owner login, credentials and notification chime */
.login-modes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin: 0 0 14px;
  padding: 4px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 13px;
  background: rgba(20, 7, 15, 0.45);
}
.login-mode {
  min-height: 38px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: var(--faint);
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}
.login-mode:hover { color: var(--text); }
.login-mode.is-active {
  color: var(--text);
  border-color: rgba(255, 92, 151, 0.38);
  background: rgba(255, 92, 151, 0.13);
}
.login-mode:focus-visible { outline: 2px solid rgba(255, 92, 151, 0.55); outline-offset: -2px; }
.credentials-panel { max-width: 900px; margin-bottom: 14px; }
.credentials-form { margin-top: 14px; }
.credentials-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; }
.credential-field { display: grid; gap: 6px; }
.credential-field span { color: var(--muted); font-size: 10px; font-weight: 700; }
.credential-field .input {
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  background: rgba(12, 4, 9, 0.45);
  color: var(--text);
  font: inherit;
  font-size: 12px;
  direction: ltr;
  text-align: left;
}
.credential-field .input:focus { outline: 0; border-color: rgba(255, 92, 151, 0.6); box-shadow: 0 0 0 3px rgba(255, 92, 151, 0.1); }
.credential-field .input:-webkit-autofill {
  -webkit-text-fill-color: var(--text);
  -webkit-box-shadow: 0 0 0 1000px #2a1420 inset;
  caret-color: var(--text);
}
.banner-warning {
  margin: 12px 0 0;
  padding: 10px 12px;
  border: 1px solid rgba(251, 191, 36, 0.3);
  border-radius: 11px;
  color: #fde68a;
  background: rgba(251, 191, 36, 0.09);
  font-size: 10.5px;
  line-height: 1.7;
}
.notification-panel { max-width: 900px; margin-bottom: 14px; }
.notification-row { display: flex; align-items: center; gap: 12px; margin-top: 13px; padding: 12px; border: 1px solid var(--border-soft); border-radius: 12px; background: rgba(255, 255, 255, 0.022); }
.notification-copy { flex: 1; min-width: 0; }
.notification-copy strong { display: block; font-size: 11px; }
.notification-copy small { display: block; margin-top: 3px; color: var(--faint); font-size: 9px; }
.notification-btn { position: relative; }
.notification-btn.is-muted { color: var(--faint); opacity: 0.62; }
.notification-dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 2px rgba(20, 7, 15, 0.9);
}
.audience-toggle { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.target-all-note {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 52px;
  padding: 10px 12px;
  border: 1px dashed rgba(255, 92, 151, 0.32);
  border-radius: 11px;
  color: var(--muted);
  background: rgba(255, 92, 151, 0.06);
  font-size: 10px;
  line-height: 1.7;
}
.target-all-note img { width: 24px; height: 24px; flex: 0 0 auto; object-fit: contain; }
@media (max-width: 640px) {
  .credentials-grid { grid-template-columns: 1fr; }
  .notification-row { flex-wrap: wrap; }
  .notification-row .text-btn { margin-right: auto; }
  .audience-toggle { grid-template-columns: 1fr; }
}
