:root {
  color-scheme: dark;
  --bg: #07111f;
  --bg-elevated: rgba(10, 19, 35, 0.92);
  --bg-panel: rgba(14, 25, 47, 0.84);
  --bg-soft: rgba(148, 163, 184, 0.08);
  --bg-soft-hover: rgba(148, 163, 184, 0.14);
  --border: rgba(148, 163, 184, 0.18);
  --border-strong: rgba(125, 211, 252, 0.28);
  --text: #e5eefb;
  --text-muted: #94a3b8;
  --text-soft: #cbd5e1;
  --accent: #7dd3fc;
  --accent-strong: #38bdf8;
  --accent-violet: #a78bfa;
  --success: #34d399;
  --warning: #fbbf24;
  --danger: #fb7185;
  --shadow-lg: 0 30px 80px rgba(2, 6, 23, 0.55);
  --shadow-md: 0 18px 40px rgba(2, 6, 23, 0.38);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --content-width: 1280px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at top left, rgba(56, 189, 248, 0.16), transparent 28%),
    radial-gradient(circle at top right, rgba(167, 139, 250, 0.16), transparent 24%),
    linear-gradient(180deg, #07111f 0%, #0b1323 100%);
  color: var(--text);
}

body {
  min-height: 100vh;
  line-height: 1.5;
}

a {
  color: inherit;
  text-decoration: none;
}

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

button {
  border: 0;
  background: none;
  color: inherit;
  cursor: pointer;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.9);
  color: var(--text);
  border-radius: 14px;
  padding: 0.9rem 1rem;
  transition: border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

input::placeholder,
textarea::placeholder {
  color: #64748b;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: rgba(125, 211, 252, 0.6);
  box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.12);
  background: rgba(15, 23, 42, 1);
}

select {
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--text-muted) 50%),
    linear-gradient(135deg, var(--text-muted) 50%, transparent 50%);
  background-position:
    calc(100% - 18px) calc(50% - 3px),
    calc(100% - 12px) calc(50% - 3px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  padding-right: 2.5rem;
}

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

.surface {
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.92), rgba(9, 16, 29, 0.92));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(18px);
}

.surface--soft {
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.72), rgba(9, 16, 29, 0.78));
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  min-height: 44px;
  padding: 0.8rem 1.1rem;
  border-radius: 14px;
  font-weight: 600;
  letter-spacing: 0.01em;
  transition: transform 140ms ease, background 180ms ease, border-color 180ms ease, color 180ms ease, box-shadow 180ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.button--primary {
  color: #04111f;
  background: linear-gradient(135deg, var(--accent) 0%, #67e8f9 100%);
  box-shadow: 0 14px 34px rgba(56, 189, 248, 0.28);
}

.button--secondary {
  background: rgba(148, 163, 184, 0.1);
  border: 1px solid rgba(148, 163, 184, 0.18);
  color: var(--text);
}

.button--ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
}

.button--danger {
  background: rgba(244, 63, 94, 0.12);
  border: 1px solid rgba(244, 63, 94, 0.22);
  color: #fecdd3;
}

.button--full {
  width: 100%;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  background: rgba(125, 211, 252, 0.12);
  border: 1px solid rgba(125, 211, 252, 0.18);
  color: #c8f1ff;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.badge--success {
  background: rgba(52, 211, 153, 0.12);
  border-color: rgba(52, 211, 153, 0.2);
  color: #bbf7d0;
}

.badge--warning {
  background: rgba(251, 191, 36, 0.12);
  border-color: rgba(251, 191, 36, 0.2);
  color: #fde68a;
}

.badge--danger {
  background: rgba(251, 113, 133, 0.12);
  border-color: rgba(251, 113, 133, 0.22);
  color: #fecdd3;
}

.admin-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: 100vh;
}

.admin-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 1.5rem;
  border-right: 1px solid rgba(148, 163, 184, 0.12);
  background: linear-gradient(180deg, rgba(7, 17, 31, 0.96), rgba(7, 17, 31, 0.82));
}

.admin-brand {
  display: grid;
  gap: 0.9rem;
  padding: 1rem;
  margin-bottom: 1.25rem;
  border-radius: var(--radius-lg);
  background: rgba(15, 23, 42, 0.56);
  border: 1px solid rgba(125, 211, 252, 0.14);
}

.admin-brand__mark {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.2), rgba(167, 139, 250, 0.22));
  color: #dbeafe;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.admin-brand__title {
  font-size: 1.05rem;
  font-weight: 700;
}

.admin-brand__subtitle {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.admin-nav {
  display: grid;
  gap: 0.5rem;
}

.admin-nav__link {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.85rem;
  align-items: center;
  padding: 0.9rem 1rem;
  border-radius: 16px;
  color: var(--text-muted);
  transition: background 180ms ease, color 180ms ease, border-color 180ms ease, transform 140ms ease;
  border: 1px solid transparent;
}

.admin-nav__link:hover {
  background: rgba(148, 163, 184, 0.08);
  color: var(--text);
  transform: translateX(2px);
}

.admin-nav__link--active {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.14), rgba(167, 139, 250, 0.14));
  border-color: rgba(125, 211, 252, 0.22);
  color: var(--text);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.admin-nav__icon {
  width: 20px;
  height: 20px;
}

.admin-nav__label {
  font-weight: 600;
}

.admin-nav__meta {
  display: block;
  margin-top: 0.12rem;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.admin-sidebar__footer {
  margin-top: auto;
  padding: 1rem;
  border-radius: var(--radius-md);
  background: rgba(15, 23, 42, 0.56);
  border: 1px solid rgba(148, 163, 184, 0.12);
  color: var(--text-muted);
  font-size: 0.88rem;
}

.admin-main {
  min-width: 0;
  padding: 1.25rem;
}

.admin-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: var(--content-width);
  margin: 0 auto 1.25rem;
}

.admin-topbar__context {
  display: grid;
  gap: 0.25rem;
}

.admin-topbar__eyebrow {
  color: var(--accent);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 700;
}

.admin-topbar__title {
  font-size: 1.25rem;
  font-weight: 700;
}

.admin-topbar__user {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.75rem 0.95rem;
  border-radius: 18px;
  background: rgba(15, 23, 42, 0.62);
  border: 1px solid rgba(148, 163, 184, 0.14);
}

.admin-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.28), rgba(167, 139, 250, 0.28));
  color: #ecfeff;
  font-weight: 700;
}

.admin-content {
  max-width: var(--content-width);
  margin: 0 auto;
}

.page-stack {
  display: grid;
  gap: 1.25rem;
}

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

.page-header__copy {
  max-width: 780px;
}

.page-eyebrow {
  margin-bottom: 0.45rem;
  color: var(--accent);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 700;
}

.page-title {
  margin: 0;
  font-size: clamp(2rem, 3vw, 2.8rem);
  line-height: 1.05;
}

.page-subtitle {
  margin: 0.8rem 0 0;
  color: var(--text-muted);
  max-width: 70ch;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}

.metric-card {
  position: relative;
  overflow: hidden;
  padding: 1.2rem;
}

.metric-card::after {
  content: '';
  position: absolute;
  inset: auto -20% -50% 30%;
  height: 120px;
  background: radial-gradient(circle, rgba(125, 211, 252, 0.16), transparent 70%);
  pointer-events: none;
}

.metric-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.metric-card__icon {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.metric-card__icon svg {
  width: 24px;
  height: 24px;
}

.metric-card__label {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.metric-card__value {
  margin-top: 1rem;
  font-size: clamp(1.9rem, 3vw, 2.5rem);
  font-weight: 800;
  letter-spacing: -0.03em;
}

.metric-card__meta {
  margin-top: 0.35rem;
  color: var(--text-soft);
  font-size: 0.92rem;
}

.dual-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(320px, 1fr);
  gap: 1rem;
}

.panel {
  padding: 1.25rem;
}

.panel__title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
}

.panel__subtitle {
  margin: 0.45rem 0 0;
  color: var(--text-muted);
  font-size: 0.94rem;
}

.quick-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.action-card {
  display: grid;
  gap: 0.8rem;
  padding: 1.2rem;
  border-radius: var(--radius-md);
  background: rgba(15, 23, 42, 0.58);
  border: 1px solid rgba(148, 163, 184, 0.12);
  transition: transform 160ms ease, border-color 180ms ease, background 180ms ease;
}

.action-card:hover {
  transform: translateY(-3px);
  border-color: rgba(125, 211, 252, 0.26);
  background: rgba(18, 28, 51, 0.8);
}

.action-card__title {
  font-weight: 700;
}

.action-card__description {
  color: var(--text-muted);
}

.filters-grid {
  display: grid;
  grid-template-columns: minmax(260px, 1.4fr) minmax(220px, 1fr) auto;
  gap: 1rem;
  align-items: end;
}

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

.field-group {
  display: grid;
  gap: 0.55rem;
}

.filter-actions {
  display: flex;
  gap: 0.75rem;
  align-items: end;
  flex-wrap: wrap;
}

.field-label {
  color: var(--text-soft);
  font-size: 0.88rem;
  font-weight: 600;
}

.data-shell {
  overflow: hidden;
}

.data-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem 1.25rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
}

.table-wrap {
  overflow-x: auto;
}

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

.data-table th,
.data-table td {
  padding: 1rem 1.25rem;
  text-align: left;
  vertical-align: top;
}

.data-table thead th {
  color: var(--text-muted);
  font-size: 0.77rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 700;
  border-bottom: 1px solid rgba(148, 163, 184, 0.14);
}

.data-table tbody tr {
  border-bottom: 1px solid rgba(148, 163, 184, 0.1);
}

.data-table tbody tr:hover {
  background: rgba(148, 163, 184, 0.04);
}

.data-table tbody tr.is-selected {
  background: rgba(125, 211, 252, 0.08);
}

.data-cell__primary {
  font-weight: 600;
}

.data-cell__secondary {
  color: var(--text-muted);
  font-size: 0.88rem;
  margin-top: 0.3rem;
}

.mono {
  font-family: 'SFMono-Regular', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  color: #c7d2fe;
  font-size: 0.88rem;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem 1.2rem;
}

.pagination__meta {
  color: var(--text-muted);
  font-size: 0.92rem;
}

.pagination__controls {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.page-pill {
  min-width: 40px;
  height: 40px;
  padding: 0 0.85rem;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.14);
  background: rgba(15, 23, 42, 0.56);
  color: var(--text-soft);
}

.page-pill--active {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.18), rgba(167, 139, 250, 0.18));
  color: #e0f2fe;
  border-color: rgba(125, 211, 252, 0.28);
}

.empty-state,
.error-state,
.loading-state {
  padding: 2.4rem 1.4rem;
  text-align: center;
  color: var(--text-muted);
}

.error-banner {
  padding: 0.95rem 1rem;
  border-radius: 16px;
  background: rgba(251, 113, 133, 0.1);
  border: 1px solid rgba(251, 113, 133, 0.2);
  color: #fecdd3;
}

.loading-spinner {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 3px solid rgba(148, 163, 184, 0.18);
  border-top-color: var(--accent);
  animation: spin 0.8s linear infinite;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 2rem;
}

.login-layout {
  width: min(1120px, 100%);
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(380px, 460px);
  gap: 1.25rem;
}

.login-showcase {
  position: relative;
  overflow: hidden;
  padding: 2rem;
}

.login-showcase__orb {
  position: absolute;
  border-radius: 999px;
  filter: blur(20px);
  opacity: 0.45;
}

.login-showcase__orb--cyan {
  inset: -10% auto auto -8%;
  width: 220px;
  height: 220px;
  background: rgba(56, 189, 248, 0.24);
}

.login-showcase__orb--violet {
  inset: auto -10% 5% auto;
  width: 220px;
  height: 220px;
  background: rgba(167, 139, 250, 0.24);
}

.login-showcase__content {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 1.1rem;
}

.login-title {
  margin: 0;
  font-size: clamp(2.2rem, 5vw, 3.8rem);
  line-height: 0.96;
}

.login-copy {
  margin: 0;
  color: var(--text-soft);
  max-width: 52ch;
}

.login-highlights {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
  margin-top: 1rem;
}

.login-highlight {
  padding: 1rem;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.login-panel {
  padding: 2rem;
  display: grid;
  gap: 1.2rem;
  align-content: center;
}

.login-panel__header {
  display: grid;
  gap: 0.55rem;
}

.login-panel__title {
  margin: 0;
  font-size: 1.9rem;
}

.login-panel__subtitle {
  margin: 0;
  color: var(--text-muted);
}

.login-form {
  display: grid;
  gap: 1rem;
}

.split-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  align-items: center;
  justify-content: space-between;
}

.inline-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.inline-metric {
  padding: 0.95rem 1rem;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.58);
  border: 1px solid rgba(148, 163, 184, 0.12);
}

.inline-metric__value {
  font-size: 1.2rem;
  font-weight: 700;
}

.inline-metric__label {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.85rem;
}

.detail-item {
  padding: 1rem;
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.58);
  border: 1px solid rgba(148, 163, 184, 0.12);
}

.detail-item__label {
  color: var(--text-muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.detail-item__value {
  margin-top: 0.4rem;
  color: var(--text);
  word-break: break-word;
}

.message-block {
  margin-top: 1rem;
  padding: 1rem;
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.58);
  border: 1px solid rgba(148, 163, 184, 0.12);
}

.message-block__content {
  margin-top: 0.6rem;
  color: var(--text-soft);
  white-space: pre-wrap;
  word-break: break-word;
}

.button-row {
  display: flex;
  gap: 0.65rem;
  align-items: center;
  flex-wrap: wrap;
}

.button-row--stacked {
  justify-content: flex-end;
}

.mobile-cards {
  display: none;
  padding: 0.75rem;
  gap: 0.8rem;
}

.data-card {
  padding: 1rem;
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.58);
  border: 1px solid rgba(148, 163, 184, 0.12);
}

.data-card__row + .data-card__row {
  margin-top: 0.65rem;
}

.data-card__label {
  color: var(--text-muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.data-card__value {
  margin-top: 0.2rem;
}

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

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

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

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

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

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

  .admin-sidebar {
    position: static;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid rgba(148, 163, 184, 0.12);
  }

  .admin-main {
    padding-top: 1rem;
  }

  .admin-topbar {
    flex-direction: column;
    align-items: stretch;
  }

  .page-header {
    flex-direction: column;
  }

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

  .filter-actions {
    justify-content: stretch;
  }

  .filter-actions > * {
    flex: 1 1 auto;
  }

  .quick-actions,
  .login-highlights,
  .inline-metrics {
    grid-template-columns: 1fr;
  }

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

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

  .table-wrap {
    display: none;
  }

  .mobile-cards {
    display: grid;
  }

  .pagination {
    flex-direction: column;
    align-items: stretch;
  }

  .pagination__controls {
    justify-content: stretch;
  }

  .pagination__controls > * {
    flex: 1 1 auto;
  }

  .login-shell,
  .admin-main,
  .admin-sidebar {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .login-panel,
  .login-showcase,
  .panel {
    padding: 1.25rem;
  }
}
