:root {
  --primary: #5750F1;
  --primary-dark: #4640c9;
  --primary-muted: rgba(87, 80, 241, 0.1);
  --background: #ffffff;
  --surface: #f9fafb;
  --surface-elevated: #f1f5f9;
  --heading: #374151;
  --body: #4b5563;
  --muted: #6b7280;
  --border: #e5e7eb;
  --accent: #fb923c;
  --success: #16a34a;
  --success-bg: #dcfce7;
  --danger: #ef4444;
  --danger-bg: #fee2e2;
  --warning: #fb923c;
  --warning-bg: #ffedd5;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--surface);
  color: var(--body);
  min-height: 100vh;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }

.admin-body {
  background: #eef1f6;
}

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

.sidebar {
  width: 260px;
  flex-shrink: 0;
  background: #111827;
  color: #fff;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 40;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 18px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  color: #fff;
}

.sidebar-brand:hover { color: #fff; }

.sidebar-brand img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #fff;
}

.sidebar-brand-name {
  font-size: 15px;
  font-weight: 700;
}

.sidebar-brand-tag {
  margin-top: 2px;
  font-size: 11px;
  color: rgba(255,255,255,0.6);
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px 12px;
  flex: 1;
  overflow-y: auto;
}

.sidebar-section-label {
  margin: 10px 10px 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.42);
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border-radius: 10px;
  color: rgba(255,255,255,0.78);
  font-size: 14px;
  font-weight: 600;
}

.sidebar-link svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.sidebar-link:hover {
  background: rgba(255,255,255,0.08);
  color: #fff;
}

.sidebar-link.active {
  background: var(--primary);
  color: #fff;
}

.sidebar-footer {
  padding: 14px;
  border-top: 1px solid rgba(255,255,255,0.08);
  display: grid;
  gap: 12px;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-user .avatar-sm {
  background: rgba(255,255,255,0.12);
  color: #fff;
}

.sidebar-user-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.sidebar-user-meta strong {
  font-size: 13px;
  color: #fff;
}

.sidebar-user-meta span {
  font-size: 11px;
  color: rgba(255,255,255,0.55);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.content-topbar {
  display: none;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: #fff;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 30;
}

.content-topbar-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--heading);
}

.sidebar-toggle {
  width: 38px;
  height: 38px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--heading);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.sidebar-toggle svg {
  width: 18px;
  height: 18px;
}

.sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  z-index: 35;
}

.container {
  width: min(1180px, calc(100% - 40px));
  margin: 28px auto 40px;
}

.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.filter-header {
  background: #fff;
  padding: 16px;
}

.filter-bar {
  display: flex;
  gap: 14px;
  width: 100%;
  flex-wrap: wrap;
  align-items: end;
}

.filter-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 180px;
}

.filter-field-grow {
  flex: 1;
  min-width: 240px;
}

.filter-field label {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.filter-search-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.list-meta {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  font-size: 13px;
  color: var(--muted);
}

select {
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 14px;
  color: var(--heading);
  background: #fff;
}

select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-muted);
}

.page-title {
  margin: 0 0 6px;
  color: var(--heading);
  font-size: 26px;
  font-weight: 700;
}

.page-subtitle {
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 14px;
}

.dash-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}

.dash-eyebrow {
  margin: 0 0 6px;
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.dash-hero-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.btn-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: rgba(255,255,255,0.22);
  font-size: 12px;
  font-weight: 700;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

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

.kpi {
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  box-shadow: var(--shadow);
}

.kpi-link {
  color: inherit;
  transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.kpi-link:hover {
  border-color: #c7d2fe;
  color: inherit;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.08);
}

.kpi-top {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.kpi-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

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

.kpi-icon-total { background: var(--primary-muted); color: var(--primary); }
.kpi-icon-pending { background: var(--warning-bg); color: #c2410c; }
.kpi-icon-active { background: var(--success-bg); color: var(--success); }
.kpi-icon-verified { background: #eff6ff; color: #2563eb; }

.kpi-label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.kpi-value {
  color: var(--heading);
  font-size: 30px;
  font-weight: 700;
  line-height: 1;
  margin-bottom: 8px;
}

.kpi-hint {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.kpi.pending .kpi-value { color: #c2410c; }
.kpi.active .kpi-value { color: var(--success); }
.kpi.verified .kpi-value { color: #2563eb; }

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

.dash-side {
  display: grid;
  gap: 16px;
}

.card-sub {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.owner-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.avatar-sm {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--primary-muted);
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}

.avatar-sm-light {
  background: rgba(255,255,255,0.18);
  color: #fff;
}

.quick-list,
.side-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.quick-item,
.side-list-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  color: inherit;
}

.quick-item:last-child,
.side-list li:last-child .side-list-item {
  border-bottom: none;
}

.quick-item:hover,
.side-list-item:hover {
  background: var(--surface);
  color: inherit;
}

.quick-item {
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.quick-title {
  color: var(--heading);
  font-size: 14px;
  font-weight: 600;
}

.quick-meta {
  color: var(--muted);
  font-size: 12px;
}

.side-list-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.side-list-body strong {
  color: var(--heading);
  font-size: 14px;
}

.card {
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.card-header h2 {
  margin: 0;
  font-size: 15px;
  color: var(--heading);
}

.card-body { padding: 16px; }

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
  align-items: center;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  display: inline-flex;
  align-items: center;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.chip.active {
  background: var(--primary-muted);
  border-color: var(--primary);
  color: var(--primary);
}

.search {
  flex: 1;
  min-width: 220px;
  display: flex;
  gap: 8px;
}

input[type="text"],
input[type="email"],
input[type="password"],
select {
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 14px;
  color: var(--heading);
  background: #fff;
}

input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-muted);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: none;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover { background: var(--primary-dark); color: #fff; }

.btn-success {
  background: var(--success);
  color: #fff;
}

.btn-danger {
  background: var(--danger);
  color: #fff;
}

.btn-ghost {
  background: transparent;
  color: rgba(255,255,255,0.95);
  border: 1px solid rgba(255,255,255,0.35);
}

.btn-outline {
  background: #fff;
  color: var(--heading);
  border: 1px solid var(--border);
}

.btn-sm {
  padding: 7px 10px;
  font-size: 12px;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid #d1d5db;
  font-size: 14px;
  vertical-align: middle;
}

th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--surface);
}

td { color: var(--heading); }

.muted { color: var(--muted); }
.small { font-size: 12px; }

.pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.pill-success { background: var(--success-bg); color: var(--success); }
.pill-danger { background: var(--danger-bg); color: var(--danger); }
.pill-warning { background: var(--warning-bg); color: #c2410c; }

.alert {
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 16px;
  font-size: 14px;
}

.alert-success {
  background: var(--success-bg);
  color: #166534;
  border: 1px solid #bbf7d0;
}

.alert-error {
  background: var(--danger-bg);
  color: #991b1b;
  border: 1px solid #fecaca;
}

.empty {
  padding: 28px 16px;
  text-align: center;
  color: var(--muted);
}

.profile-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 16px;
}

.profile-hero {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-bottom: 18px;
}

.avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--primary-muted);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 20px;
}

.detail-list {
  display: grid;
  gap: 10px;
}

.detail-row {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 8px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.detail-row:last-child { border-bottom: none; padding-bottom: 0; }
.detail-label { color: var(--muted); font-size: 13px; }
.detail-value { color: var(--heading); font-size: 14px; font-weight: 500; }

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pagination {
  display: flex;
  justify-content: flex-end;
  padding: 14px 16px;
  gap: 6px;
}

.pagination nav > div { justify-content: flex-end; }

.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(circle at top right, rgba(87, 80, 241, 0.12), transparent 40%),
    radial-gradient(circle at bottom left, rgba(251, 146, 60, 0.10), transparent 35%),
    var(--surface);
}

.login-card {
  width: min(420px, 100%);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 28px 24px;
  box-shadow: var(--shadow);
}

.login-brand {
  text-align: center;
  margin-bottom: 24px;
}

.login-brand img {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  margin-bottom: 12px;
  background: #fff;
}

.login-brand h1 {
  margin: 0;
  font-size: 22px;
  color: var(--heading);
}

.login-brand h1 .brand-primary { color: var(--primary); }
.login-brand p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.form-group { margin-bottom: 14px; }
.form-group label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--heading);
}

.field-error {
  margin: 6px 0 0;
  color: var(--danger);
  font-size: 12px;
}

.checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
  margin: 0;
}

.login-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 8px 0 16px;
  flex-wrap: wrap;
}

.forgot-link {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

.login-footer {
  margin: 18px 0 0;
  text-align: center;
  font-size: 13px;
  color: var(--muted);
}

.password-field {
  position: relative;
  display: block;
}

.password-field input[type="password"],
.password-field input[type="text"] {
  width: 100%;
  padding-right: 44px;
}

.password-toggle {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  padding: 0;
  margin: 0;
  border-radius: 0 8px 8px 0;
  line-height: 1;
}

.password-toggle:hover {
  color: var(--primary);
  background: transparent;
}

.password-toggle:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: -2px;
}

.password-toggle-icon {
  width: 20px;
  height: 20px;
  display: block;
  pointer-events: none;
}

.password-toggle-icon[hidden] {
  display: none !important;
}

.full-width { width: 100%; }

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

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

  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    transform: translateX(-105%);
    transition: transform 0.2s ease;
  }

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

  .content-topbar {
    display: flex;
  }
}

@media (max-width: 800px) {
  .kpi-grid,
  .kpi-grid-4,
  .profile-grid {
    grid-template-columns: 1fr;
  }

  .detail-row {
    grid-template-columns: 1fr;
  }

  table { display: block; overflow-x: auto; }

  .dash-hero-actions {
    width: 100%;
  }

  .dash-hero-actions .btn {
    flex: 1;
  }

  .container {
    width: calc(100% - 24px);
    margin: 18px auto 28px;
  }

  .filter-search-row {
    flex-wrap: wrap;
  }
}
