/* ==========================================================================
   Notes admin — secure control room
   ========================================================================== */

:root {
  --bg: #0b1120;
  --bg-soft: #0f172a;
  --sidebar: #0c1526;
  --panel: linear-gradient(180deg, rgba(30, 41, 59, 0.6), rgba(24, 34, 51, 0.38));
  --panel-solid: #131f34;
  --panel-hover: #1b2940;
  --border: #253349;
  --border-strong: #344761;
  --text: #e2e8f0;
  --text-strong: #f8fafc;
  --muted: #8fa0b8;
  --dim: #64748b;
  --indigo: #818cf8;
  --indigo-strong: #6366f1;
  --emerald: #34d399;
  --sky: #38bdf8;
  --violet: #c4b5fd;
  --amber: #fbbf24;
  --pink: #f472b6;
  --danger: #f87171;
  --radius: 16px;
  --radius-sm: 10px;
  --font-ui: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-code: 'JetBrains Mono', ui-monospace, Consolas, monospace;
  --font-urdu: 'Noori Nastaleeq', 'Noto Nastaliq Urdu', serif;
  --sidebar-width: 260px;
}

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

html {
  color-scheme: dark;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--bg);
  background-image:
    radial-gradient(55rem 32rem at 94% -12%, rgba(99, 102, 241, 0.13), transparent 62%),
    radial-gradient(42rem 26rem at 4% 108%, rgba(16, 185, 129, 0.06), transparent 62%);
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: rgba(99, 102, 241, 0.35);
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  color: inherit;
}

a {
  color: inherit;
}

svg {
  display: block;
}

[hidden] {
  display: none !important;
}

:focus-visible {
  outline: 2px solid var(--indigo);
  outline-offset: 2px;
}

.spinner {
  width: 23px;
  height: 23px;
  border: 2px solid rgba(129, 140, 248, 0.2);
  border-block-start-color: var(--indigo);
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* --------------------------------------------------------------------------
   Login
   -------------------------------------------------------------------------- */

.login-view {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  position: relative;
  overflow: hidden;
}

.login-view::before,
.login-view::after {
  content: '';
  position: fixed;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
}

.login-view::before {
  width: 380px;
  height: 380px;
  inset-block-start: -140px;
  inset-inline-end: -100px;
  background: rgba(79, 70, 229, 0.18);
}

.login-view::after {
  width: 340px;
  height: 340px;
  inset-block-end: -160px;
  inset-inline-start: -90px;
  background: rgba(16, 185, 129, 0.08);
}

.login-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  color: var(--muted);
  font-size: 0.85rem;
}

.login-shell {
  position: relative;
  z-index: 1;
  width: min(940px, 100%);
  display: grid;
  grid-template-columns: 1.02fr 0.98fr;
  border: 1px solid var(--border);
  border-radius: 22px;
  background: rgba(15, 23, 42, 0.7);
  box-shadow: 0 40px 100px rgba(2, 6, 23, 0.6);
  overflow: hidden;
  animation: loginIn 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes loginIn {
  from { opacity: 0; transform: translateY(14px) scale(0.99); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.login-visual {
  position: relative;
  padding: 42px 38px;
  background:
    radial-gradient(30rem 22rem at 110% 110%, rgba(129, 140, 248, 0.24), transparent 60%),
    linear-gradient(145deg, #182445, #111b31 62%);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 38px;
}

.login-visual::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(148, 163, 184, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.05) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: linear-gradient(to bottom, transparent, #000 35%, #000 75%, transparent);
  pointer-events: none;
}

.login-visual-inner {
  position: relative;
  z-index: 1;
}

.login-logo {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  margin-block-end: 34px;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: #e0e7ff;
}

.login-logo-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--indigo-strong);
  box-shadow: 0 8px 22px rgba(99, 102, 241, 0.35);
}

.login-logo-icon svg {
  width: 20px;
  height: 20px;
}

.login-visual h1 {
  margin: 0 0 14px;
  max-width: 12ch;
  color: #fff;
  font-size: clamp(1.8rem, 3.4vw, 2.55rem);
  line-height: 1.14;
  letter-spacing: -0.035em;
  font-weight: 700;
}

.login-visual p {
  margin: 0;
  max-width: 36ch;
  color: #a7b4c9;
  font-size: 0.88rem;
  line-height: 1.7;
}

.login-points {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 11px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.login-points li {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #c4cfe1;
  font-size: 0.79rem;
}

.login-points svg {
  width: 15px;
  height: 15px;
  color: var(--emerald);
  flex: 0 0 auto;
}

.login-panel {
  display: flex;
  align-items: center;
  padding: 40px 38px;
}

.login-form-wrap {
  width: 100%;
  max-width: 340px;
  margin-inline: auto;
}

.login-kicker {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-block-end: 12px;
  color: var(--indigo);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.login-kicker svg {
  width: 13px;
  height: 13px;
}

.login-title {
  margin: 0 0 6px;
  color: #fff;
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.login-sub {
  margin: 0 0 24px;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.6;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.login-error {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid rgba(248, 113, 113, 0.28);
  border-radius: 9px;
  background: rgba(239, 68, 68, 0.1);
  color: #fca5a5;
  font-size: 0.78rem;
  line-height: 1.5;
}

.login-error svg {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
  margin-block-start: 1px;
}

.login-foot {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-block-start: 22px;
  padding-block-start: 18px;
  border-block-start: 1px solid rgba(37, 51, 73, 0.75);
  color: var(--dim);
  font-size: 0.7rem;
  line-height: 1.6;
}

.login-foot svg {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
  margin-block-start: 1px;
}

/* --------------------------------------------------------------------------
   Shell, sidebar and topbar
   -------------------------------------------------------------------------- */

.admin-shell {
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  inset-block: 0;
  inset-inline-start: 0;
  z-index: 50;
  width: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  padding: 18px 14px 14px;
  background: rgba(12, 21, 38, 0.96);
  border-inline-end: 1px solid var(--border);
  backdrop-filter: blur(16px);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 4px 8px 20px;
}

.side-brand-link {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
  text-decoration: none;
  border-radius: 10px;
}

.side-brand-icon {
  display: grid;
  place-items: center;
  width: 37px;
  height: 37px;
  flex: 0 0 auto;
  border-radius: 10px;
  background: var(--indigo-strong);
  color: #fff;
  box-shadow: 0 8px 20px rgba(99, 102, 241, 0.28);
}

.side-brand-icon svg {
  width: 21px;
  height: 21px;
}

.side-brand-link strong {
  display: block;
  color: #fff;
  font-size: 0.96rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.side-brand-link small {
  display: block;
  color: var(--dim);
  font-size: 0.64rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.side-close {
  display: none;
  width: 32px;
  height: 32px;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
}

.side-close:hover {
  background: var(--panel-hover);
  color: #fff;
}

.side-close svg {
  width: 18px;
  height: 18px;
}

.side-nav {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 0 4px;
  scrollbar-width: thin;
}

.nav-group-label {
  margin: 20px 10px 7px;
  color: #52627a;
  font-size: 0.61rem;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.nav-group-label:first-child {
  margin-block-start: 6px;
}

.side-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 39px;
  margin-block-end: 2px;
  padding: 8px 11px;
  border: 1px solid transparent;
  border-radius: 9px;
  color: var(--muted);
  font-size: 0.81rem;
  font-weight: 500;
  text-decoration: none;
  transition: background-color 0.16s ease, color 0.16s ease, border-color 0.16s ease;
}

.side-link svg {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  opacity: 0.88;
}

.side-link:hover {
  background: rgba(30, 41, 59, 0.55);
  color: var(--text);
}

.side-link.is-active {
  background: rgba(99, 102, 241, 0.12);
  border-color: rgba(129, 140, 248, 0.18);
  color: #c7d2fe;
}

.side-link.is-active::before {
  content: '';
  position: absolute;
  inset-block: 10px;
  inset-inline-start: -13px;
  width: 2px;
  border-radius: 2px;
  background: var(--indigo);
}

.nav-badge {
  margin-inline-start: auto;
  min-width: 19px;
  height: 19px;
  padding-inline: 5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(244, 114, 182, 0.14);
  border: 1px solid rgba(244, 114, 182, 0.2);
  color: #f9a8d4;
  font-size: 0.63rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.sidebar-foot {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-block-start: 12px;
  padding-block-start: 12px;
  border-block-start: 1px solid rgba(37, 51, 73, 0.75);
}

.user-card {
  display: flex;
  align-items: center;
  gap: 9px;
  flex: 1 1 auto;
  min-width: 0;
  padding: 6px;
  border-radius: 10px;
  text-decoration: none;
  transition: background-color 0.16s ease;
}

.user-card:hover {
  background: rgba(30, 41, 59, 0.6);
}

.user-card-copy {
  min-width: 0;
}

.user-card-copy strong {
  display: block;
  color: #e2e8f0;
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.role-badge {
  display: inline-flex;
  align-items: center;
  margin-block-start: 2px;
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 0.56rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: #a5b4fc;
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(129, 140, 248, 0.16);
}

.role-badge.owner {
  color: #fcd34d;
  background: rgba(251, 191, 36, 0.1);
  border-color: rgba(251, 191, 36, 0.18);
}

.role-badge.admin {
  color: #93c5fd;
  background: rgba(59, 130, 246, 0.1);
  border-color: rgba(59, 130, 246, 0.16);
}

.logout-btn {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--dim);
  cursor: pointer;
}

.logout-btn:hover {
  background: rgba(239, 68, 68, 0.1);
  color: var(--danger);
}

.logout-btn svg {
  width: 16px;
  height: 16px;
}

.sidebar-scrim {
  position: fixed;
  inset: 0;
  z-index: 45;
  background: rgba(2, 6, 23, 0.65);
  backdrop-filter: blur(2px);
}

.admin-workspace {
  margin-inline-start: var(--sidebar-width);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.admin-topbar {
  position: sticky;
  inset-block-start: 0;
  z-index: 35;
  display: flex;
  align-items: center;
  gap: 14px;
  height: 62px;
  padding-inline: 26px;
  border-block-end: 1px solid rgba(37, 51, 73, 0.8);
  background: rgba(11, 17, 32, 0.78);
  backdrop-filter: blur(14px);
}

.menu-btn {
  display: none;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: rgba(30, 41, 59, 0.5);
  color: var(--text);
}

.menu-btn svg {
  width: 18px;
  height: 18px;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  color: var(--dim);
  font-size: 0.75rem;
}

.breadcrumb svg {
  width: 13px;
  height: 13px;
  flex: 0 0 auto;
  opacity: 0.6;
}

.breadcrumb strong {
  color: var(--text);
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-inline-start: auto;
}

.admin-main {
  width: 100%;
  max-width: 1450px;
  margin-inline: auto;
  padding: 28px 26px 60px;
  outline: none;
}

/* --------------------------------------------------------------------------
   Shared controls
   -------------------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 38px;
  padding: 8px 13px;
  border: 1px solid transparent;
  border-radius: 9px;
  font-size: 0.78rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.16s ease, border-color 0.16s ease, transform 0.16s ease, opacity 0.16s ease;
  white-space: nowrap;
}

.btn svg {
  width: 15px;
  height: 15px;
}

.btn:disabled {
  opacity: 0.55;
  cursor: wait;
}

.btn-primary {
  background: var(--indigo-strong);
  color: #fff;
  box-shadow: 0 8px 20px rgba(79, 70, 229, 0.22);
}

.btn-primary:hover:not(:disabled) {
  background: #4f46e5;
  transform: translateY(-1px);
}

.btn-secondary {
  background: rgba(30, 41, 59, 0.65);
  border-color: var(--border);
  color: var(--text);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--panel-hover);
  border-color: var(--border-strong);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(248, 113, 113, 0.24);
  color: #fca5a5;
}

.btn-danger:hover:not(:disabled) {
  background: rgba(239, 68, 68, 0.2);
}

.btn-sm {
  min-height: 31px;
  padding: 5px 9px;
  font-size: 0.7rem;
  border-radius: 7px;
}

.btn-sm svg {
  width: 13px;
  height: 13px;
}

.ghost-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 0.73rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.16s ease, color 0.16s ease, border-color 0.16s ease;
}

.ghost-btn svg {
  width: 15px;
  height: 15px;
}

.ghost-btn:hover {
  background: rgba(30, 41, 59, 0.65);
  border-color: var(--border);
  color: var(--text);
}

.ghost-btn.icon-only {
  width: 34px;
  padding: 0;
  justify-content: center;
}

.icon-action {
  display: inline-grid;
  place-items: center;
  width: 29px;
  height: 29px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--dim);
  cursor: pointer;
  transition: color 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
}

.icon-action svg {
  width: 14px;
  height: 14px;
}

.icon-action:hover {
  color: var(--text);
  background: rgba(51, 65, 85, 0.5);
  border-color: var(--border);
}

.icon-action.danger:hover {
  color: var(--danger);
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(248, 113, 113, 0.18);
}

.avatar {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.avatar-sm {
  width: 28px;
  height: 28px;
  font-size: 0.57rem;
}

.avatar-lg {
  width: 33px;
  height: 33px;
  font-size: 0.63rem;
}

.avatar-xl {
  width: 62px;
  height: 62px;
  font-size: 1.1rem;
}

.avatar.tone-0 { background: linear-gradient(135deg, #6366f1, #8b5cf6); }
.avatar.tone-1 { background: linear-gradient(135deg, #0ea5e9, #22d3ee); }
.avatar.tone-2 { background: linear-gradient(135deg, #10b981, #34d399); }
.avatar.tone-3 { background: linear-gradient(135deg, #f59e0b, #fbbf24); }
.avatar.tone-4 { background: linear-gradient(135deg, #ec4899, #f472b6); }
.avatar.tone-5 { background: linear-gradient(135deg, #8b5cf6, #d946ef); }

/* --------------------------------------------------------------------------
   Page headers and panels
   -------------------------------------------------------------------------- */

.page-enter {
  animation: pageIn 0.32s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes pageIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-block-end: 24px;
  flex-wrap: wrap;
}

.page-head-copy {
  min-width: 0;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-block-end: 8px;
  color: var(--indigo);
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.eyebrow::before {
  content: '';
  width: 16px;
  height: 1px;
  background: currentColor;
}

.page-head h1 {
  margin: 0;
  color: #fff;
  font-size: clamp(1.35rem, 2.7vw, 1.7rem);
  line-height: 1.25;
  font-weight: 700;
  letter-spacing: -0.025em;
}

.page-head p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.55;
}

.page-actions {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

.panel {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: 0 20px 44px rgba(2, 6, 23, 0.12);
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 17px 19px 0;
}

.panel-head h2 {
  margin: 0;
  color: var(--text-strong);
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.panel-sub {
  margin: 3px 0 0;
  color: var(--dim);
  font-size: 0.7rem;
  line-height: 1.5;
}

.panel-body {
  padding: 17px 19px 19px;
}

.panel-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex: 0 0 auto;
  margin-block-start: 2px;
  color: var(--indigo);
  font-size: 0.7rem;
  font-weight: 600;
  text-decoration: none;
}

.panel-link:hover {
  color: #c7d2fe;
}

.panel-link svg {
  width: 13px;
  height: 13px;
}

.section-grid {
  display: grid;
  gap: 16px;
  margin-block-end: 16px;
}

.section-grid.two {
  grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr);
}

.section-grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.section-grid.equal {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

/* --------------------------------------------------------------------------
   KPI cards
   -------------------------------------------------------------------------- */

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  margin-block-end: 16px;
}

.kpi-card {
  position: relative;
  overflow: hidden;
  padding: 15px 15px 14px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: var(--panel);
}

.kpi-card::after {
  content: '';
  position: absolute;
  inset-block-start: 0;
  inset-inline: 0;
  height: 1px;
  opacity: 0.7;
  background: linear-gradient(90deg, transparent, var(--kpi-color, var(--indigo)), transparent);
}

.kpi-icon {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  margin-block-end: 12px;
  border-radius: 8px;
  color: var(--kpi-color, var(--indigo));
  background: color-mix(in srgb, var(--kpi-color, var(--indigo)) 12%, transparent);
}

.kpi-icon svg {
  width: 16px;
  height: 16px;
}

.kpi-label {
  display: block;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 500;
}

.kpi-value {
  display: block;
  margin-block: 2px;
  color: #fff;
  font-size: 1.42rem;
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}

.kpi-meta {
  display: block;
  color: var(--dim);
  font-size: 0.62rem;
  line-height: 1.45;
}

.kpi-meta .up {
  color: var(--emerald);
}

/* --------------------------------------------------------------------------
   Charts
   -------------------------------------------------------------------------- */

.chart-legend {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 0.65rem;
}

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex: 0 0 auto;
}

.dot.indigo { background: var(--indigo); }
.dot.emerald { background: var(--emerald); }
.dot.amber { background: var(--amber); }
.dot.pink { background: var(--pink); }

.chart-wrap {
  position: relative;
  width: 100%;
  margin-block-start: 8px;
}

.chart-svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.chart-svg text {
  fill: #64748b;
  font-family: var(--font-ui);
  font-size: 10px;
}

.chart-grid-line {
  stroke: rgba(51, 65, 85, 0.55);
  stroke-dasharray: 3 5;
  stroke-width: 1;
}

.chart-axis-label {
  text-anchor: end;
  font-variant-numeric: tabular-nums;
}

.chart-x-label {
  text-anchor: middle;
}

.chart-area {
  opacity: 0.9;
  pointer-events: none;
}

.chart-line {
  fill: none;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.chart-line.views {
  stroke: #818cf8;
}

.chart-line.uniques {
  stroke: #34d399;
}

.chart-dot {
  stroke: #0f172a;
  stroke-width: 1.5;
}

.chart-dot.views {
  fill: #818cf8;
}

.chart-dot.uniques {
  fill: #34d399;
}

.chart-hover {
  fill: transparent;
  cursor: crosshair;
}

.chart-hover:hover {
  fill: rgba(129, 140, 248, 0.045);
}

.chart-tooltip {
  position: absolute;
  z-index: 5;
  min-width: 132px;
  padding: 8px 10px;
  border: 1px solid var(--border-strong);
  border-radius: 9px;
  background: rgba(8, 14, 26, 0.95);
  box-shadow: 0 10px 28px rgba(2, 6, 23, 0.5);
  pointer-events: none;
  transform: translate(-50%, -100%);
  backdrop-filter: blur(8px);
}

.chart-tooltip-date {
  margin-block-end: 5px;
  color: #cbd5e1;
  font-size: 0.65rem;
  font-weight: 600;
}

.chart-tooltip-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  color: var(--muted);
  font-size: 0.64rem;
  line-height: 1.7;
}

.chart-tooltip-row strong {
  color: var(--text);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.chart-tooltip-row .dot {
  margin-inline-end: 5px;
}

.chart-summary {
  display: flex;
  align-items: baseline;
  gap: 7px;
  margin-block-start: 12px;
  padding-block-start: 12px;
  border-block-start: 1px solid rgba(37, 51, 73, 0.7);
  color: var(--dim);
  font-size: 0.65rem;
}

.chart-summary strong {
  color: var(--text);
  font-weight: 600;
}

/* --------------------------------------------------------------------------
   Contributions
   -------------------------------------------------------------------------- */

.contrib-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.contrib-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.contrib-main {
  flex: 1 1 auto;
  min-width: 0;
}

.contrib-topline {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-block-end: 6px;
}

.contrib-name {
  color: var(--text);
  font-size: 0.74rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.contrib-total {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 0.63rem;
  font-variant-numeric: tabular-nums;
}

.contrib-track {
  height: 6px;
  border-radius: 999px;
  background: rgba(51, 65, 85, 0.5);
  overflow: hidden;
}

.contrib-fill {
  display: block;
  height: 100%;
  min-width: 0;
  border-radius: inherit;
  transition: width 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.bar-0 { background: linear-gradient(90deg, #6366f1, #a5b4fc); }
.bar-1 { background: linear-gradient(90deg, #0ea5e9, #67e8f9); }
.bar-2 { background: linear-gradient(90deg, #10b981, #6ee7b7); }
.bar-3 { background: linear-gradient(90deg, #d97706, #fcd34d); }
.bar-4 { background: linear-gradient(90deg, #db2777, #f9a8d4); }
.bar-5 { background: linear-gradient(90deg, #7c3aed, #d8b4fe); }

.contrib-breakdown {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  margin-block-start: 6px;
}

.mini-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 0.57rem;
  font-weight: 500;
  color: var(--muted);
  background: rgba(51, 65, 85, 0.4);
}

.mini-chip.create { color: #6ee7b7; }
.mini-chip.update { color: #93c5fd; }
.mini-chip.delete { color: #fca5a5; }
.mini-chip.feedback { color: #f9a8d4; }

/* --------------------------------------------------------------------------
   Ratings and library
   -------------------------------------------------------------------------- */

.rating-summary {
  display: flex;
  align-items: center;
  gap: 13px;
  margin-block-end: 18px;
}

.rating-score {
  color: #fff;
  font-size: 2rem;
  line-height: 1;
  font-weight: 700;
  letter-spacing: -0.04em;
}

.rating-summary-copy {
  min-width: 0;
}

.stars-inline {
  display: inline-flex;
  align-items: center;
  gap: 1px;
  color: #fbbf24;
}

.stars-inline svg {
  width: 12px;
  height: 12px;
  fill: currentColor;
  stroke: currentColor;
}

.stars-inline .off {
  color: #334155;
}

.rating-summary-copy small {
  display: block;
  margin-block-start: 3px;
  color: var(--dim);
  font-size: 0.64rem;
}

.rating-bars {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.rating-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.64rem;
  color: var(--muted);
}

.rating-row > span:first-child {
  width: 25px;
  flex: 0 0 auto;
  font-variant-numeric: tabular-nums;
}

.rating-track {
  flex: 1 1 auto;
  height: 5px;
  border-radius: 999px;
  background: rgba(51, 65, 85, 0.45);
  overflow: hidden;
}

.rating-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #d97706, #fbbf24);
  transition: width 0.4s ease;
}

.rating-count {
  width: 22px;
  text-align: end;
  flex: 0 0 auto;
  color: var(--dim);
  font-variant-numeric: tabular-nums;
}

.library-list {
  display: flex;
  flex-direction: column;
  gap: 13px;
}

.library-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.library-icon {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  border-radius: 8px;
  background: rgba(99, 102, 241, 0.1);
  color: #a5b4fc;
}

.library-icon svg {
  width: 15px;
  height: 15px;
}

.library-main {
  flex: 1 1 auto;
  min-width: 0;
}

.library-topline {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-block-end: 4px;
}

.library-name {
  color: var(--text);
  font-size: 0.73rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.library-meta {
  flex: 0 0 auto;
  color: var(--dim);
  font-size: 0.6rem;
}

.library-track {
  height: 4px;
  border-radius: 999px;
  background: rgba(51, 65, 85, 0.45);
  overflow: hidden;
}

.library-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #6366f1, #8b5cf6);
}

/* --------------------------------------------------------------------------
   Recent feedback and audit mini
   -------------------------------------------------------------------------- */

.feedback-latest {
  display: flex;
  flex-direction: column;
  gap: 13px;
}

.feedback-mini {
  padding-block-end: 12px;
  border-block-end: 1px solid rgba(37, 51, 73, 0.65);
}

.feedback-mini:last-child {
  padding-block-end: 0;
  border-block-end: 0;
}

.feedback-mini-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-block-end: 4px;
}

.feedback-mini-name {
  color: var(--text);
  font-size: 0.72rem;
  font-weight: 600;
}

.feedback-mini-text {
  margin: 0;
  color: var(--muted);
  font-size: 0.7rem;
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.feedback-mini-time {
  color: var(--dim);
  font-size: 0.6rem;
  white-space: nowrap;
}

.audit-mini {
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.audit-mini-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.audit-mini-icon {
  display: grid;
  place-items: center;
  width: 27px;
  height: 27px;
  flex: 0 0 auto;
  border-radius: 7px;
  background: rgba(51, 65, 85, 0.4);
  color: var(--muted);
}

.audit-mini-icon svg {
  width: 13px;
  height: 13px;
}

.audit-mini-icon.create { color: var(--emerald); background: rgba(16, 185, 129, 0.1); }
.audit-mini-icon.update { color: var(--sky); background: rgba(56, 189, 248, 0.1); }
.audit-mini-icon.delete { color: var(--danger); background: rgba(239, 68, 68, 0.1); }
.audit-mini-icon.restore { color: var(--amber); background: rgba(251, 191, 36, 0.1); }

.audit-mini-body {
  min-width: 0;
  flex: 1 1 auto;
}

.audit-mini-body p {
  margin: 0;
  color: var(--muted);
  font-size: 0.68rem;
  line-height: 1.5;
}

.audit-mini-body p strong {
  color: var(--text);
  font-weight: 600;
}

.audit-mini-time {
  display: block;
  margin-block-start: 2px;
  color: var(--dim);
  font-size: 0.59rem;
}

/* --------------------------------------------------------------------------
   Content manager
   -------------------------------------------------------------------------- */

.content-manager {
  display: grid;
  grid-template-columns: 0.9fr 1fr 1.3fr;
  gap: 14px;
  align-items: start;
}

.content-column {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: rgba(19, 31, 52, 0.55);
  overflow: hidden;
}

.column-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 13px 14px;
  border-block-end: 1px solid rgba(37, 51, 73, 0.8);
  background: rgba(15, 23, 42, 0.35);
}

.column-title {
  margin: 0;
  color: var(--text-strong);
  font-size: 0.78rem;
  font-weight: 600;
}

.column-sub {
  margin: 2px 0 0;
  color: var(--dim);
  font-size: 0.62rem;
}

.column-body {
  max-height: 620px;
  overflow-y: auto;
  padding: 8px;
  scrollbar-width: thin;
}

.entity-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px;
  border: 1px solid transparent;
  border-radius: 9px;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.entity-row + .entity-row {
  margin-block-start: 2px;
}

.entity-row:hover {
  background: rgba(30, 41, 59, 0.55);
}

.entity-row.is-selected {
  background: rgba(99, 102, 241, 0.1);
  border-color: rgba(129, 140, 248, 0.22);
}

.entity-main {
  display: flex;
  align-items: center;
  gap: 9px;
  flex: 1 1 auto;
  min-width: 0;
  border: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  text-align: start;
  cursor: pointer;
}

.entity-icon {
  display: grid;
  place-items: center;
  width: 29px;
  height: 29px;
  flex: 0 0 auto;
  border-radius: 7px;
  background: rgba(51, 65, 85, 0.45);
  color: #a5b4fc;
}

.entity-icon svg {
  width: 14px;
  height: 14px;
}

.entity-icon.chapter {
  color: #6ee7b7;
  background: rgba(16, 185, 129, 0.08);
}

.entity-title {
  display: block;
  color: var(--text);
  font-size: 0.72rem;
  font-weight: 500;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.entity-sub {
  display: block;
  margin-block-start: 1px;
  color: var(--dim);
  font-size: 0.6rem;
}

.row-actions {
  display: flex;
  align-items: center;
  gap: 1px;
  flex: 0 0 auto;
  opacity: 0.6;
  transition: opacity 0.15s ease;
}

.entity-row:hover .row-actions,
.entity-row.is-selected .row-actions {
  opacity: 1;
}

.question-card {
  padding: 10px;
  border: 1px solid rgba(37, 51, 73, 0.85);
  border-radius: 9px;
  background: rgba(15, 23, 42, 0.32);
}

.question-card + .question-card {
  margin-block-start: 7px;
}

.question-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.question-text {
  margin: 0;
  color: var(--text);
  font-size: 0.71rem;
  font-weight: 500;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.question-sub {
  margin: 3px 0 0;
  color: var(--dim);
  font-size: 0.61rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.question-actions {
  display: flex;
  gap: 1px;
  flex: 0 0 auto;
}

.type-pill {
  display: inline-flex;
  align-items: center;
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 0.55rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-block-end: 5px;
}

.type-pill.short {
  color: #93c5fd;
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.16);
}

.type-pill.long {
  color: #c4b5fd;
  background: rgba(139, 92, 246, 0.12);
  border: 1px solid rgba(139, 92, 246, 0.18);
}

.inline-empty {
  padding: 22px 12px;
  color: var(--dim);
  font-size: 0.7rem;
  line-height: 1.55;
  text-align: center;
}

.section-toolbar-note {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--dim);
  font-size: 0.64rem;
}

.section-toolbar-note svg {
  width: 13px;
  height: 13px;
}

/* --------------------------------------------------------------------------
   Feedback page
   -------------------------------------------------------------------------- */

.feedback-tabs {
  display: inline-flex;
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: rgba(15, 23, 42, 0.4);
}

.tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 29px;
  padding: 4px 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 0.69rem;
  font-weight: 500;
  cursor: pointer;
}

.tab-btn:hover {
  color: var(--text);
}

.tab-btn.is-active {
  background: rgba(51, 65, 85, 0.8);
  color: #fff;
}

.tab-count {
  padding: 0 5px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.15);
  font-size: 0.58rem;
  font-variant-numeric: tabular-nums;
}

.feedback-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.feedback-entry {
  display: flex;
  flex-direction: column;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: var(--panel);
}

.feedback-entry.is-new {
  border-color: rgba(129, 140, 248, 0.25);
  box-shadow: inset 0 1px 0 rgba(129, 140, 248, 0.12);
}

.feedback-entry-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-block-end: 11px;
}

.feedback-person {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.feedback-person-copy {
  min-width: 0;
}

.feedback-person-copy strong {
  display: block;
  color: var(--text);
  font-size: 0.76rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.feedback-person-copy span {
  display: block;
  color: var(--dim);
  font-size: 0.62rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.feedback-message {
  flex: 1 1 auto;
  margin: 0 0 14px;
  color: #c7d2e1;
  font-size: 0.77rem;
  line-height: 1.65;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.feedback-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-block-start: 11px;
  border-block-start: 1px solid rgba(37, 51, 73, 0.65);
  flex-wrap: wrap;
}

.feedback-footer-left {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

.feedback-footer-right {
  display: flex;
  align-items: center;
  gap: 2px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 0.56rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.status-pill.new {
  color: #f9a8d4;
  background: rgba(244, 114, 182, 0.1);
  border: 1px solid rgba(244, 114, 182, 0.18);
}

.status-pill.read {
  color: #94a3b8;
  background: rgba(51, 65, 85, 0.4);
  border: 1px solid rgba(51, 65, 85, 0.6);
}

.feedback-email {
  color: var(--dim);
  font-size: 0.62rem;
  text-decoration: none;
}

.feedback-email:hover {
  color: var(--indigo);
}

/* --------------------------------------------------------------------------
   Tables and filters
   -------------------------------------------------------------------------- */

.filter-bar {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
  margin-block-end: 14px;
}

.filter-field {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 5px 9px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.45);
  color: var(--dim);
  font-size: 0.69rem;
}

.filter-field svg {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
}

.filter-field select,
.filter-field input {
  min-height: 22px;
  border: 0;
  background: transparent;
  color: var(--text);
  font-size: 0.69rem;
  outline: none;
  max-width: 180px;
}

.filter-field select option {
  background: var(--panel-solid);
  color: var(--text);
}

.filter-field input::placeholder {
  color: var(--dim);
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: rgba(19, 31, 52, 0.5);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.71rem;
  min-width: 760px;
}

.data-table th {
  padding: 10px 13px;
  border-block-end: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.45);
  color: var(--dim);
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-align: start;
  text-transform: uppercase;
  white-space: nowrap;
}

.data-table td {
  padding: 11px 13px;
  border-block-end: 1px solid rgba(37, 51, 73, 0.55);
  color: var(--muted);
  vertical-align: top;
  line-height: 1.5;
}

.data-table tr:last-child td {
  border-block-end: 0;
}

.data-table tbody tr:hover td {
  background: rgba(30, 41, 59, 0.28);
}

.data-table .cell-strong {
  color: var(--text);
  font-weight: 500;
}

.data-table .cell-details {
  max-width: 430px;
  overflow-wrap: anywhere;
}

.data-table .cell-time {
  white-space: nowrap;
  color: var(--dim);
}

.action-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: 5px;
  font-size: 0.58rem;
  font-weight: 600;
  white-space: nowrap;
}

.action-badge.create { color: #6ee7b7; background: rgba(16, 185, 129, 0.1); }
.action-badge.update { color: #93c5fd; background: rgba(59, 130, 246, 0.1); }
.action-badge.delete { color: #fca5a5; background: rgba(239, 68, 68, 0.1); }
.action-badge.restore { color: #fcd34d; background: rgba(251, 191, 36, 0.1); }
.action-badge.backup { color: #d8b4fe; background: rgba(168, 85, 247, 0.1); }
.action-badge.feedback { color: #f9a8d4; background: rgba(244, 114, 182, 0.1); }
.action-badge.admin { color: #a5b4fc; background: rgba(99, 102, 241, 0.1); }
.action-badge.auth { color: #94a3b8; background: rgba(51, 65, 85, 0.4); }

.mono {
  font-family: var(--font-code);
  font-size: 0.65rem;
}

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

.audit-result-count {
  margin-inline-start: auto;
  color: var(--dim);
  font-size: 0.65rem;
}

/* --------------------------------------------------------------------------
   Backups
   -------------------------------------------------------------------------- */

.info-banner {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-block-end: 15px;
  padding: 12px 14px;
  border: 1px solid rgba(129, 140, 248, 0.18);
  border-radius: 11px;
  background: rgba(99, 102, 241, 0.07);
  color: #a5b4fc;
  font-size: 0.71rem;
  line-height: 1.6;
}

.info-banner svg {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
  margin-block-start: 2px;
}

.info-banner strong {
  color: #c7d2fe;
}

.backup-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.backup-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.32);
}

.backup-icon {
  display: grid;
  place-items: center;
  width: 33px;
  height: 33px;
  flex: 0 0 auto;
  border-radius: 8px;
  background: rgba(168, 85, 247, 0.09);
  color: #d8b4fe;
}

.backup-icon svg {
  width: 16px;
  height: 16px;
}

.backup-main {
  flex: 1 1 auto;
  min-width: 0;
}

.backup-title {
  display: block;
  color: var(--text);
  font-size: 0.73rem;
  font-weight: 500;
  overflow-wrap: anywhere;
}

.backup-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-block-start: 3px;
  color: var(--dim);
  font-size: 0.61rem;
}

.backup-actions {
  display: flex;
  align-items: center;
  gap: 3px;
  flex: 0 0 auto;
}

/* --------------------------------------------------------------------------
   Admins
   -------------------------------------------------------------------------- */

.admin-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 13px;
}

.admin-card {
  position: relative;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: var(--panel);
}

.admin-card-head {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  margin-block-end: 14px;
}

.admin-card-copy {
  min-width: 0;
  flex: 1 1 auto;
}

.admin-name {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-strong);
  font-size: 0.82rem;
  font-weight: 600;
}

.admin-username {
  display: block;
  margin-block-start: 1px;
  color: var(--dim);
  font-size: 0.65rem;
}

.self-tag {
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(51, 65, 85, 0.5);
  color: var(--muted);
  font-size: 0.52rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.admin-card-badges {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
  margin-block-start: 7px;
}

.status-pill.active {
  color: #6ee7b7;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.18);
}

.status-pill.inactive {
  color: #94a3b8;
  background: rgba(51, 65, 85, 0.4);
  border: 1px solid rgba(51, 65, 85, 0.6);
}

.admin-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 10px 0;
  border-block: 1px solid rgba(37, 51, 73, 0.7);
  margin-block-end: 11px;
}

.admin-stat {
  min-width: 0;
}

.admin-stat span {
  display: block;
  color: var(--dim);
  font-size: 0.58rem;
}

.admin-stat strong {
  display: block;
  margin-block-start: 1px;
  color: var(--text);
  font-size: 0.71rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.admin-card-actions .left {
  display: flex;
  gap: 5px;
}

.admin-card-actions .right {
  display: flex;
  gap: 2px;
}

/* --------------------------------------------------------------------------
   Account
   -------------------------------------------------------------------------- */

.account-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 16px;
  align-items: start;
}

.profile-card {
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
}

.profile-head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-block-end: 16px;
  border-block-end: 1px solid rgba(37, 51, 73, 0.7);
  margin-block-end: 14px;
}

.profile-head h2 {
  margin: 0;
  color: #fff;
  font-size: 1.03rem;
  font-weight: 600;
}

.profile-head p {
  margin: 3px 0 0;
  color: var(--dim);
  font-size: 0.7rem;
}

.profile-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0;
  padding: 0;
}

.profile-list > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-block-end: 9px;
  border-block-end: 1px solid rgba(37, 51, 73, 0.45);
}

.profile-list > div:last-child {
  border-block-end: 0;
  padding-block-end: 0;
}

.profile-list dt {
  color: var(--dim);
  font-size: 0.68rem;
}

.profile-list dd {
  margin: 0;
  color: var(--text);
  font-size: 0.72rem;
  font-weight: 500;
  text-align: end;
  overflow-wrap: anywhere;
}

.form-card {
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
}

.form-card h2 {
  margin: 0 0 4px;
  color: #fff;
  font-size: 0.92rem;
  font-weight: 600;
}

.form-card > p {
  margin: 0 0 17px;
  color: var(--dim);
  font-size: 0.7rem;
  line-height: 1.55;
}

.form-stack {
  display: flex;
  flex-direction: column;
  gap: 13px;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

.field-label {
  color: #cbd5e1;
  font-size: 0.71rem;
  font-weight: 600;
}

.field-hint {
  color: var(--dim);
  font-size: 0.61rem;
  line-height: 1.5;
  font-weight: 400;
}

.input,
.textarea,
.select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(9, 15, 28, 0.6);
  color: var(--text-strong);
  font-size: 0.76rem;
  padding: 8px 10px;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.input,
.select {
  min-height: 37px;
}

.textarea {
  min-height: 110px;
  line-height: 1.65;
  resize: vertical;
}

.input::placeholder,
.textarea::placeholder {
  color: #52627a;
}

.input:focus,
.textarea:focus,
.select:focus {
  outline: none;
  border-color: var(--indigo);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.select option {
  background: var(--panel-solid);
}

.textarea.urdu,
.input.urdu {
  font-family: var(--font-urdu);
  font-size: 0.95rem;
  line-height: 2;
  direction: rtl;
  text-align: right;
}

.urdu-text {
  font-family: var(--font-urdu);
  direction: rtl;
  unicode-bidi: plaintext;
  line-height: 1.9;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 11px;
}

.password-wrap {
  position: relative;
}

.password-wrap .input {
  padding-inline-end: 38px;
}

.password-toggle {
  position: absolute;
  inset-block-start: 50%;
  inset-inline-end: 6px;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  width: 27px;
  height: 27px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--dim);
  cursor: pointer;
}

.password-toggle:hover {
  color: var(--text);
  background: rgba(51, 65, 85, 0.5);
}

.password-toggle svg {
  width: 14px;
  height: 14px;
}

.checkbox-field {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  color: var(--text);
  font-size: 0.72rem;
  cursor: pointer;
}

.checkbox-field input {
  width: 15px;
  height: 15px;
  margin: 2px 0 0;
  accent-color: var(--indigo-strong);
}

.checkbox-field small {
  display: block;
  color: var(--dim);
  font-size: 0.61rem;
  margin-block-start: 1px;
}

.form-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-block-start: 16px;
}

.inline-error {
  margin: 0;
  padding: 8px 10px;
  border: 1px solid rgba(248, 113, 113, 0.24);
  border-radius: 8px;
  background: rgba(239, 68, 68, 0.08);
  color: #fca5a5;
  font-size: 0.7rem;
  line-height: 1.5;
}

.security-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-block-start: 14px;
  padding: 10px;
  border: 1px solid rgba(52, 211, 153, 0.14);
  border-radius: 8px;
  background: rgba(16, 185, 129, 0.05);
  color: #86efac;
  font-size: 0.64rem;
  line-height: 1.55;
}

.security-note svg {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
  margin-block-start: 1px;
}

/* --------------------------------------------------------------------------
   Modal forms
   -------------------------------------------------------------------------- */

.modal-form {
  display: flex;
  flex-direction: column;
  gap: 13px;
}

.modal-root:empty {
  display: none;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(2, 6, 23, 0.75);
  backdrop-filter: blur(6px);
  animation: fadeIn 0.16s ease both;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.admin-modal {
  width: min(460px, 100%);
  max-height: min(88vh, 780px);
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border-strong);
  border-radius: 16px;
  background: #101b2e;
  box-shadow: 0 30px 90px rgba(2, 6, 23, 0.65);
  animation: modalIn 0.22s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.admin-modal.wide {
  width: min(670px, 100%);
}

@keyframes modalIn {
  from { opacity: 0; transform: translateY(9px) scale(0.99); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 19px 0;
}

.modal-head h2 {
  margin: 0;
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.modal-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.71rem;
  line-height: 1.55;
}

.modal-close {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--dim);
  cursor: pointer;
}

.modal-close:hover {
  background: rgba(51, 65, 85, 0.6);
  color: #fff;
}

.modal-close svg {
  width: 16px;
  height: 16px;
}

.modal-body {
  padding: 17px 19px;
  overflow-y: auto;
}

.modal-error {
  margin: 0 19px;
  padding: 8px 10px;
  border: 1px solid rgba(248, 113, 113, 0.24);
  border-radius: 8px;
  background: rgba(239, 68, 68, 0.08);
  color: #fca5a5;
  font-size: 0.68rem;
  line-height: 1.5;
}

.modal-error[hidden] {
  display: none;
}

.modal-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 13px 19px 17px;
  border-block-start: 1px solid rgba(37, 51, 73, 0.7);
  background: rgba(15, 23, 42, 0.25);
  border-radius: 0 0 16px 16px;
}

.modal-foot .btn-danger {
  margin-inline-end: auto;
}

.confirm-copy {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.65;
}

.confirm-copy strong {
  color: var(--text);
}

.danger-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-block-start: 12px;
  padding: 9px 10px;
  border: 1px solid rgba(248, 113, 113, 0.18);
  border-radius: 8px;
  background: rgba(239, 68, 68, 0.06);
  color: #fca5a5;
  font-size: 0.67rem;
  line-height: 1.55;
}

.danger-note svg {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
  margin-block-start: 1px;
}

.editor-tools {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  margin-block: 2px;
}

.editor-tool {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 27px;
  padding: 3px 7px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: rgba(30, 41, 59, 0.5);
  color: var(--muted);
  font-size: 0.62rem;
  cursor: pointer;
}

.editor-tool:hover {
  color: var(--text);
  border-color: var(--border-strong);
  background: var(--panel-hover);
}

.editor-tool svg {
  width: 11px;
  height: 11px;
}

.editor-hint {
  margin: 0;
  color: var(--dim);
  font-size: 0.59rem;
  line-height: 1.55;
}

.editor-hint code {
  font-family: var(--font-code);
  font-size: 0.57rem;
  color: #a5b4fc;
}

.split-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 11px;
}

.form-section-label {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 4px 0 -3px;
  color: #94a3b8;
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.form-section-label::after {
  content: '';
  flex: 1 1 auto;
  height: 1px;
  background: rgba(37, 51, 73, 0.7);
}

/* --------------------------------------------------------------------------
   Empty, loading, toast
   -------------------------------------------------------------------------- */

.admin-loading {
  min-height: 50vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 13px;
  color: var(--muted);
  font-size: 0.8rem;
}

.admin-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 48px 20px;
  border: 1px dashed var(--border);
  border-radius: 14px;
  color: var(--muted);
  font-size: 0.8rem;
  text-align: center;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 34px 18px;
  color: var(--dim);
  font-size: 0.74rem;
  text-align: center;
  line-height: 1.6;
}

.empty-state svg {
  width: 25px;
  height: 25px;
  opacity: 0.5;
}

.empty-state strong {
  color: var(--muted);
  font-weight: 600;
}

.toast-region {
  position: fixed;
  inset-block-end: 20px;
  inset-inline-end: 20px;
  z-index: 120;
  display: flex;
  flex-direction: column;
  gap: 7px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  max-width: min(370px, calc(100vw - 32px));
  padding: 10px 13px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: #172236;
  box-shadow: 0 16px 38px rgba(2, 6, 23, 0.5);
  color: var(--text);
  font-size: 0.75rem;
  animation: toastIn 0.22s ease both;
}

.toast.success { border-color: rgba(52, 211, 153, 0.32); }
.toast.error { border-color: rgba(248, 113, 113, 0.34); }

.toast-icon {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  margin-block-start: 1px;
}

.toast-icon svg {
  width: 14px;
  height: 14px;
}

.toast.success .toast-icon { color: var(--emerald); }
.toast.error .toast-icon { color: var(--danger); }

@keyframes toastIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 1300px) {
  .kpi-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .admin-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 1150px) {
  .content-manager {
    grid-template-columns: 1fr 1fr;
  }

  .content-column.questions-column {
    grid-column: 1 / -1;
  }

  .column-body {
    max-height: 430px;
  }

  .section-grid.two,
  .section-grid.three,
  .section-grid.equal {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 960px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1);
    box-shadow: 20px 0 60px rgba(2, 6, 23, 0.45);
  }

  .admin-shell.sidebar-open .sidebar {
    transform: translateX(0);
  }

  .side-close {
    display: grid;
  }

  .admin-workspace {
    margin-inline-start: 0;
  }

  .menu-btn {
    display: grid;
  }

  .admin-main {
    padding: 22px 20px 50px;
  }
}

@media (max-width: 760px) {
  .login-view {
    padding: 14px;
  }

  .login-shell {
    grid-template-columns: 1fr;
  }

  .login-visual {
    padding: 26px 24px;
    gap: 20px;
  }

  .login-visual h1 {
    max-width: 20ch;
    font-size: 1.65rem;
    margin-block-end: 9px;
  }

  .login-visual p {
    font-size: 0.8rem;
  }

  .login-logo {
    margin-block-end: 18px;
  }

  .login-points {
    display: none;
  }

  .login-panel {
    padding: 26px 24px 28px;
  }

  .login-form-wrap {
    max-width: none;
  }

  .admin-topbar {
    padding-inline: 14px;
    height: 58px;
  }

  .admin-main {
    padding: 18px 14px 46px;
  }

  .breadcrumb > span,
  .breadcrumb svg {
    display: none;
  }

  .ghost-btn span {
    display: none;
  }

  .ghost-btn {
    width: 34px;
    justify-content: center;
    padding: 0;
  }

  .page-head {
    align-items: flex-start;
  }

  .page-head p {
    font-size: 0.75rem;
  }

  .kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .feedback-list,
  .admin-grid {
    grid-template-columns: 1fr;
  }

  .content-manager {
    grid-template-columns: 1fr;
  }

  .content-column.questions-column {
    grid-column: auto;
  }

  .column-body {
    max-height: 320px;
  }

  .panel-head {
    padding: 14px 14px 0;
  }

  .panel-body {
    padding: 14px;
  }

  .filter-bar {
    align-items: stretch;
  }

  .filter-field {
    flex: 1 1 150px;
  }

  .filter-field select,
  .filter-field input {
    max-width: none;
    flex: 1 1 auto;
    width: 100%;
  }

  .audit-result-count {
    margin-inline-start: 0;
    width: 100%;
  }

  .split-fields,
  .form-row {
    grid-template-columns: 1fr;
  }

  .modal-backdrop {
    padding: 10px;
    align-items: flex-end;
  }

  .admin-modal,
  .admin-modal.wide {
    width: 100%;
    max-height: 92vh;
    border-radius: 16px 16px 12px 12px;
  }

  .modal-foot {
    border-radius: 0 0 12px 12px;
  }

  .backup-row {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .backup-main {
    flex-basis: calc(100% - 45px);
  }

  .backup-actions {
    width: 100%;
    justify-content: flex-end;
    padding-block-start: 7px;
    border-block-start: 1px solid rgba(37, 51, 73, 0.55);
  }

  .toast-region {
    inset-inline: 12px;
    inset-block-end: 12px;
  }

  .toast {
    max-width: none;
  }
}

@media (max-width: 480px) {
  .kpi-grid {
    grid-template-columns: 1fr;
  }

  .kpi-card {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 12px;
  }

  .kpi-icon {
    margin-block-end: 0;
    width: 34px;
    height: 34px;
  }

  .kpi-label,
  .kpi-value,
  .kpi-meta {
    display: inline;
    margin: 0;
  }

  .kpi-card > div:last-child {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0 7px;
  }

  .kpi-value {
    font-size: 1.15rem;
  }

  .kpi-meta {
    flex-basis: 100%;
    margin-block-start: 2px;
  }

  .page-head {
    margin-block-end: 18px;
  }

  .page-actions {
    width: 100%;
  }

  .rating-summary {
    gap: 10px;
  }

  .admin-topbar {
    gap: 9px;
  }

  .tab-btn {
    padding-inline: 8px;
    font-size: 0.65rem;
  }

  .feedback-entry {
    padding: 13px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
