:root {
  --blue: #2563eb;
  --blue-dark: #1d4ed8;
  --blue-soft: rgba(37, 99, 235, 0.08);
  --teal: #0d9488;
  --teal-soft: rgba(13, 148, 136, 0.1);
  --coral: #ef4444;
  --coral-soft: rgba(239, 68, 68, 0.1);
  --amber: #f59e0b;
  --navy: #0f172a;
  --navy-mid: #1e293b;
  --sidebar: #070d18;
  --sidebar-hover: rgba(255, 255, 255, 0.05);
  --sidebar-active: rgba(37, 99, 235, 0.18);
  --bg: #eef2f7;
  --card: #ffffff;
  --border: rgba(15, 23, 42, 0.07);
  --text: #1e293b;
  --muted: #64748b;
  --radius: 14px;
  --radius-sm: 10px;
  --font: "DM Sans", system-ui, sans-serif;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.06);
  --shadow-lg: 0 20px 50px rgba(15, 23, 42, 0.12);
}

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

body {
  margin: 0;
  font-family: var(--font);
  font-size: 0.9375rem;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--blue); text-decoration: none; }

/* ── Login ── */
.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  background:
    radial-gradient(ellipse 80% 60% at 20% 0%, rgba(37, 99, 235, 0.18), transparent),
    radial-gradient(ellipse 60% 50% at 80% 100%, rgba(13, 148, 136, 0.12), transparent),
    linear-gradient(165deg, #070d18, var(--navy));
}

.login-layout {
  width: min(100%, 920px);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.login-hero {
  padding: 2.5rem;
  background: linear-gradient(145deg, rgba(37, 99, 235, 0.15), rgba(13, 148, 136, 0.08));
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.85);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.login-hero h2 {
  margin: 1.5rem 0 0.75rem;
  font-size: 1.625rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.25;
}

.login-hero p { margin: 0; font-size: 0.9375rem; opacity: 0.75; }

.login-hero ul {
  margin: 1.5rem 0 0;
  padding: 0;
  list-style: none;
}

.login-hero li {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.5rem 0;
  font-size: 0.875rem;
  opacity: 0.8;
}

.login-hero li::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--teal);
  flex-shrink: 0;
}

.login-card {
  background: var(--card);
  padding: 2.5rem;
}

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

.brand-mark {
  display: block;
  flex-shrink: 0;
  object-fit: contain;
}

.login-brand .brand-mark {
  width: 44px;
  height: 44px;
}

.login-hero .login-brand span {
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
}

.login-card h1 {
  margin: 0 0 0.375rem;
  font-size: 1.5rem;
  font-weight: 700;
}

.login-card .login-hint {
  margin: 0 0 1.5rem;
  color: var(--muted);
  font-size: 0.875rem;
}

/* ── Forms ── */
.form-group { margin-bottom: 1rem; }
.form-group label {
  display: block;
  margin-bottom: 0.375rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--navy-mid);
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.6875rem 0.875rem;
  font: inherit;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px var(--blue-soft);
}

.form-group textarea { min-height: 100px; resize: vertical; }

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  padding: 0.625rem 1rem;
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: transform 0.1s, opacity 0.15s, box-shadow 0.15s;
}

.btn:hover { opacity: 0.92; }
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.btn-primary {
  background: linear-gradient(135deg, var(--blue), var(--blue-dark));
  color: #fff;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

.btn-teal { background: var(--teal); color: #fff; }
.btn-ghost {
  background: #fff;
  color: var(--muted);
  border: 1px solid var(--border);
}

.btn-danger { background: var(--coral); color: #fff; }
.btn-sm { padding: 0.375rem 0.75rem; font-size: 0.8125rem; }
.btn-block { width: 100%; }

.error-msg {
  margin-top: 0.75rem;
  padding: 0.75rem;
  background: var(--coral-soft);
  border-radius: var(--radius-sm);
  color: var(--coral);
  font-size: 0.8125rem;
  display: none;
}

.error-msg.is-visible { display: block; }

/* ── App shell ── */
.app-shell {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
}

.sidebar {
  background: var(--sidebar);
  color: rgba(255, 255, 255, 0.72);
  padding: 1.25rem 0;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 50;
  border-right: 1px solid rgba(255, 255, 255, 0.04);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0 1.25rem 1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  margin-bottom: 0.75rem;
}

.sidebar-brand .brand-mark {
  width: 36px;
  height: 36px;
}

.sidebar-brand__title {
  display: block;
  font-weight: 700;
  color: #fff;
  font-size: 1.0625rem;
  line-height: 1.2;
}

.sidebar-brand__sub {
  display: block;
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(255, 255, 255, 0.4);
  margin-top: 0.125rem;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 0 0.75rem;
}

.nav-group { margin-bottom: 1.25rem; }

.nav-group__label {
  display: block;
  padding: 0 0.75rem;
  margin-bottom: 0.375rem;
  font-size: 0.625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.32);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.625rem 0.875rem;
  border-radius: var(--radius-sm);
  color: rgba(255, 255, 255, 0.62);
  font-weight: 500;
  font-size: 0.875rem;
  border: none;
  background: none;
  cursor: pointer;
  text-align: left;
  width: 100%;
  font-family: inherit;
  transition: background 0.15s, color 0.15s;
}

.nav-item:hover { background: var(--sidebar-hover); color: #fff; }
.nav-item.is-active {
  background: var(--sidebar-active);
  color: #fff;
  box-shadow: inset 3px 0 0 var(--blue);
}

.nav-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  opacity: 0.7;
}

.nav-item.is-active .nav-icon { opacity: 1; }

.nav-badge {
  margin-left: auto;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--coral);
  color: #fff;
  font-size: 0.6875rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.nav-item--logout { color: rgba(255, 255, 255, 0.45); }

.sidebar-context {
  padding: 1rem 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.country-picker { display: block; margin-bottom: 0.75rem; }

.country-picker span {
  display: block;
  font-size: 0.625rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(255, 255, 255, 0.38);
  margin-bottom: 0.375rem;
}

.country-picker select {
  width: 100%;
  padding: 0.5rem 0.625rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  font: inherit;
}

.user-badge {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.5);
  line-height: 1.45;
}

.user-badge strong {
  display: block;
  color: rgba(255, 255, 255, 0.9);
  font-weight: 600;
  font-size: 0.8125rem;
}

.sidebar-footer {
  padding: 0.75rem 0.75rem 0;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

/* ── Main area ── */
.main-wrap {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.75rem;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 40;
}

.topbar__left {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  min-width: 0;
}

.topbar__menu {
  display: none;
  padding: 0.5rem;
  border: none;
  background: none;
  cursor: pointer;
  color: var(--navy);
}

.topbar__menu svg { width: 22px; height: 22px; }

.topbar__title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--navy);
  line-height: 1.2;
}

.topbar__subtitle {
  margin: 0.125rem 0 0;
  font-size: 0.8125rem;
  color: var(--muted);
}

.topbar__right {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  flex-shrink: 0;
}

.context-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.3125rem 0.75rem;
  border-radius: 999px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.main {
  padding: 1.5rem 1.75rem 2.5rem;
  flex: 1;
}

.page { display: none; animation: fadeIn 0.2s ease; }
.page.is-active { display: block; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: none; }
}

/* ── Welcome banner ── */
.welcome-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.125rem 1.375rem;
  margin-bottom: 1.25rem;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--navy), var(--navy-mid));
  color: rgba(255, 255, 255, 0.85);
  flex-wrap: wrap;
}

.welcome-banner h2 {
  margin: 0;
  font-size: 1.0625rem;
  font-weight: 600;
  color: #fff;
}

.welcome-banner p {
  margin: 0.25rem 0 0;
  font-size: 0.8125rem;
  opacity: 0.7;
}

.welcome-banner__meta {
  font-size: 0.75rem;
  opacity: 0.55;
}

/* ── Stats ── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.stat-card {
  display: flex;
  align-items: flex-start;
  gap: 0.875rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.125rem 1.25rem;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
}

.stat-card--blue::before { background: var(--blue); }
.stat-card--coral::before { background: var(--coral); }
.stat-card--teal::before { background: var(--teal); }
.stat-card--navy::before { background: var(--navy); }

.stat-card__icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.stat-card--blue .stat-card__icon { background: var(--blue-soft); color: var(--blue); }
.stat-card--coral .stat-card__icon { background: var(--coral-soft); color: var(--coral); }
.stat-card--teal .stat-card__icon { background: var(--teal-soft); color: var(--teal); }
.stat-card--navy .stat-card__icon { background: rgba(15, 23, 42, 0.08); color: var(--navy); }

.stat-card__icon svg { width: 20px; height: 20px; }

.stat-card__body strong {
  display: block;
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--navy);
  line-height: 1;
  margin-bottom: 0.25rem;
}

.stat-card__body span {
  font-size: 0.8125rem;
  color: var(--muted);
}

/* ── Layout grids ── */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 1.25rem;
  margin-bottom: 1.25rem;
}

.dashboard-grid--2 {
  grid-template-columns: 1fr 1fr;
}

/* ── Cards ── */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.375rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow-sm);
}

.card--chart { margin-bottom: 0; }

.card--gradient {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.06), rgba(13, 148, 136, 0.04));
  border-color: rgba(37, 99, 235, 0.12);
}

.card--form {
  border-color: rgba(37, 99, 235, 0.2);
  box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.06), var(--shadow-md);
}

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

.card h2 {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--navy);
}

.card-meta {
  font-size: 0.75rem;
  color: var(--muted);
  white-space: nowrap;
}

.card-desc {
  margin: -0.5rem 0 1rem;
  font-size: 0.8125rem;
  color: var(--muted);
}

.card--notice {
  border: 1px solid rgba(239, 68, 68, 0.25);
  background: #fef2f2;
}

.card--notice p { margin: 0; color: #991b1b; font-size: 0.875rem; }

/* ── Chart ── */
.bar-chart {
  display: flex;
  align-items: flex-end;
  gap: 0.5rem;
  height: 140px;
  padding-top: 0.5rem;
}

.bar-chart__col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.375rem;
  height: 100%;
  justify-content: flex-end;
}

.bar-chart__bar-wrap {
  width: 100%;
  height: 100px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.bar-chart__bar {
  width: min(100%, 36px);
  border-radius: 6px 6px 2px 2px;
  background: linear-gradient(180deg, var(--blue), rgba(37, 99, 235, 0.55));
  min-height: 4px;
  transition: height 0.4s ease;
}

.bar-chart__label {
  font-size: 0.625rem;
  color: var(--muted);
  text-align: center;
}

.bar-chart__value {
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--navy);
}

/* ── Quick actions ── */
.quick-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.quick-action {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  padding: 0.75rem 0.875rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.quick-action:hover {
  border-color: rgba(37, 99, 235, 0.25);
  box-shadow: var(--shadow-sm);
}

.quick-action strong {
  display: block;
  font-size: 0.875rem;
  color: var(--navy);
}

.quick-action small {
  display: block;
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 0.125rem;
}

.quick-action__icon {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  font-size: 1rem;
  flex-shrink: 0;
}

.quick-action__icon--blue { background: var(--blue-soft); }
.quick-action__icon--coral { background: var(--coral-soft); }
.quick-action__icon--teal { background: var(--teal-soft); }
.quick-action__icon--navy { background: rgba(15, 23, 42, 0.06); }

/* ── Activity feed ── */
.activity-feed { display: flex; flex-direction: column; gap: 0; }

.activity-item {
  display: flex;
  gap: 0.75rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
}

.activity-item:last-child { border-bottom: none; padding-bottom: 0; }
.activity-item:first-child { padding-top: 0; }

.activity-item__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-top: 0.4rem;
  flex-shrink: 0;
}

.activity-item__dot--report { background: var(--coral); }
.activity-item__dot--alert { background: var(--blue); }

.activity-item__body { min-width: 0; flex: 1; }

.activity-item__title {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--navy);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.activity-item__meta {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 0.125rem;
}

/* ── Type breakdown ── */
.type-breakdown { display: flex; flex-direction: column; gap: 0.625rem; }

.type-row {
  display: grid;
  grid-template-columns: 72px 1fr 36px;
  align-items: center;
  gap: 0.625rem;
}

.type-row__label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--muted);
}

.type-row__bar {
  height: 8px;
  border-radius: 999px;
  background: var(--bg);
  overflow: hidden;
}

.type-row__fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--teal), var(--blue));
  transition: width 0.4s ease;
}

.type-row__count {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--navy);
  text-align: right;
}

/* ── Rank list ── */
.rank-list { display: flex; flex-direction: column; gap: 0.5rem; }

.rank-item {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  align-items: center;
  gap: 0.625rem;
  padding: 0.625rem 0.75rem;
  border-radius: var(--radius-sm);
  background: var(--bg);
}

.rank-item__num {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--muted);
}

.rank-item__name {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--navy);
}

.rank-item__bar-wrap {
  grid-column: 2;
  height: 4px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.06);
  margin-top: 0.25rem;
}

.rank-item__bar {
  height: 100%;
  border-radius: 999px;
  background: var(--blue);
}

.rank-item__count {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--blue);
}

/* ── Insights ── */
.insights-intro {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.insights-intro h2 { font-size: 1.125rem; margin-bottom: 0.375rem; }
.insights-intro p { margin: 0; font-size: 0.875rem; color: var(--muted); max-width: 560px; }

.insights-pills { display: flex; gap: 0.5rem; flex-wrap: wrap; }

.pill {
  padding: 0.3125rem 0.75rem;
  border-radius: 999px;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.pill--cert { background: var(--blue-soft); color: var(--blue); }
.pill--b2b { background: var(--teal-soft); color: var(--teal); }
.pill--contrib { background: rgba(245, 158, 11, 0.12); color: var(--amber); }

/* ── Search ── */
.search-bar {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.5rem 0.875rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
}

.search-bar svg {
  width: 16px;
  height: 16px;
  color: var(--muted);
  flex-shrink: 0;
}

.search-bar input {
  border: none;
  outline: none;
  font: inherit;
  font-size: 0.875rem;
  width: 100%;
  background: transparent;
}

.search-bar--compact { min-width: 220px; }

.page-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

/* ── Filter tabs ── */
.filter-tabs {
  display: flex;
  gap: 0.25rem;
  padding: 0.25rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.filter-tab {
  padding: 0.4375rem 0.875rem;
  border: none;
  border-radius: 7px;
  background: none;
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.filter-tab:hover { color: var(--navy); }
.filter-tab.is-active {
  background: var(--blue);
  color: #fff;
}

/* ── Tables ── */
.table-wrap { overflow-x: auto; margin: 0 -0.25rem; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

th, td {
  text-align: left;
  padding: 0.8125rem 0.875rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

th {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  background: var(--bg);
  position: sticky;
  top: 0;
}

tr:hover td { background: rgba(37, 99, 235, 0.02); }

.badge {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.badge--high { background: var(--coral-soft); color: var(--coral); }
.badge--low { background: var(--teal-soft); color: var(--teal); }
.badge--pending { background: var(--blue-soft); color: var(--blue); }
.badge--reviewed { background: var(--teal-soft); color: var(--teal); }
.badge--rejected { background: rgba(100, 116, 139, 0.12); color: #64748b; }
.badge--inactive { background: rgba(100, 116, 139, 0.1); color: #64748b; }
.badge--super { background: var(--blue-soft); color: var(--blue); }

.actions { display: flex; flex-wrap: wrap; gap: 0.375rem; }

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0.75rem 0;
  font-size: 0.875rem;
}

.field-readonly {
  background: var(--bg);
  color: var(--muted);
  cursor: not-allowed;
}

.empty {
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--muted);
  font-size: 0.875rem;
}

.empty-inline {
  margin: 0;
  padding: 1rem 0;
  color: var(--muted);
  font-size: 0.875rem;
}

/* ── Toast ── */
.toast {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  padding: 0.875rem 1.25rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 500;
  color: #fff;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.25s, transform 0.25s;
  z-index: 999;
  max-width: 360px;
  box-shadow: var(--shadow-md);
}

.toast.is-visible { opacity: 1; transform: none; }
.toast--success { background: var(--teal); }
.toast--error { background: var(--coral); }

/* ── Responsive ── */
@media (max-width: 1100px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .dashboard-grid,
  .dashboard-grid--2 { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .app-shell { grid-template-columns: 1fr; }

  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    width: 260px;
  }

  .sidebar.is-open { transform: none; }

  .topbar__menu { display: block; }

  .login-layout { grid-template-columns: 1fr; }
  .login-hero { display: none; }
}

@media (max-width: 560px) {
  .stats-grid { grid-template-columns: 1fr; }
  .main { padding: 1rem; }
  .topbar { padding: 0.875rem 1rem; }
  .form-row { grid-template-columns: 1fr; }
  .page-toolbar { flex-direction: column; align-items: stretch; }
  .search-bar--compact { min-width: unset; width: 100%; }
}

/* ── MFA & Security ── */
.mfa-backup-details {
  margin-top: 1.25rem;
  font-size: 0.875rem;
  color: var(--muted);
}

.mfa-backup-details summary {
  cursor: pointer;
  color: var(--blue);
  font-weight: 600;
}

.mfa-setup-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1.25rem;
  align-items: start;
}

.mfa-qr {
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: #fff;
}

.mfa-secret {
  display: block;
  padding: 0.625rem 0.75rem;
  background: var(--bg);
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
  word-break: break-all;
  margin-top: 0.375rem;
}

.security-status__grid {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.security-status__grid h2 {
  margin: 0 0 0.25rem;
  font-size: 1rem;
}

.security-status__grid p {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--muted);
}

.security-status__meta {
  display: flex;
  gap: 1.5rem;
  font-size: 0.75rem;
  color: var(--muted);
}

.security-status__meta strong {
  display: block;
  font-size: 0.875rem;
  color: var(--navy);
  margin-top: 0.125rem;
}

.backup-codes {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
  margin: 1rem 0;
}

.backup-codes code {
  display: block;
  padding: 0.5rem;
  text-align: center;
  background: var(--bg);
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 600;
}

.feedback-detail-dialog {
  border: none;
  border-radius: 16px;
  padding: 0;
  max-width: min(920px, 92vw);
  width: 100%;
  box-shadow: 0 24px 64px rgba(15, 23, 42, 0.18);
}

.feedback-detail-dialog::backdrop {
  background: rgba(15, 23, 42, 0.45);
}

.feedback-detail-dialog__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
}

.feedback-detail-dialog__header h2 {
  margin: 0;
  font-size: 1.125rem;
}

.feedback-detail-dialog__body {
  padding: 1.25rem;
  max-height: 70vh;
  overflow: auto;
}

.feedback-detail-grid {
  display: grid;
  gap: 1.25rem;
}

.feedback-detail-grid section h3 {
  margin: 0 0 0.5rem;
  font-size: 0.95rem;
}

.feedback-detail-grid p {
  margin: 0.35rem 0;
}

.detail-list,
.detail-stats {
  margin: 0;
  padding-left: 1.1rem;
}

.detail-list li,
.detail-stats li {
  margin-bottom: 0.45rem;
}

.report-review-dialog textarea {
  width: 100%;
  margin-top: 0.35rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font: inherit;
  resize: vertical;
}

.report-review-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 1rem;
}

@media (max-width: 560px) {
  .mfa-setup-grid { grid-template-columns: 1fr; }
  .backup-codes { grid-template-columns: repeat(2, 1fr); }
}
