:root {
  color-scheme: light;
  --bg: #f6f8fb;
  --surface: #ffffff;
  --text: #111827;
  --muted: #667085;
  --line: #d9e0ea;
  --primary: #007ee5;
  --primary-dark: #0065b8;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

a {
  color: inherit;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 20px clamp(20px, 5vw, 72px);
  background: rgba(255, 255, 255, 0.88);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  backdrop-filter: blur(12px);
}

.admin-page {
  min-height: 100vh;
  background: #f4f8fc;
}

.admin-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  min-height: 72px;
  padding: 12px clamp(16px, 3vw, 40px);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
  backdrop-filter: blur(14px);
}

.admin-brand {
  color: var(--primary);
  font-size: 20px;
  font-weight: 900;
  text-decoration: none;
  white-space: nowrap;
}

.admin-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: thin;
}

.admin-nav a {
  flex: 0 0 auto;
  min-height: 38px;
  padding: 8px 12px;
  border-radius: 8px;
  color: #425466;
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.admin-nav a:hover,
.admin-nav a.active {
  background: #e7f3ff;
  color: var(--primary-dark);
}

.admin-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.admin-actions form {
  display: flex;
  align-items: center;
  gap: 8px;
}

.workspace-switcher label {
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.workspace-switcher select {
  width: 190px;
  min-height: 38px;
  padding: 7px 10px;
}

.admin-main {
  width: min(100%, 1180px);
  margin: 0 auto;
  padding: 32px clamp(16px, 3vw, 40px) 56px;
}

.page-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.page-title h1 {
  max-width: none;
  margin-bottom: 6px;
  font-size: 30px;
  line-height: 1.2;
}

.page-title p {
  margin: 0;
  color: var(--muted);
}

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

.dashboard-card {
  display: grid;
  gap: 8px;
  min-height: 132px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: inherit;
  text-decoration: none;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
}

.dashboard-card:hover {
  border-color: #9bd4ff;
  box-shadow: 0 14px 34px rgba(0, 126, 229, 0.12);
}

.dashboard-card span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

.dashboard-card strong {
  color: #0f172a;
  font-size: 18px;
}

.form-grid {
  max-width: 720px;
}

.brand {
  color: #0f172a;
  font-size: 22px;
  font-weight: 800;
  text-decoration: none;
}

nav {
  display: flex;
  align-items: center;
  gap: 18px;
}

nav a {
  color: var(--muted);
  font-weight: 600;
  text-decoration: none;
}

.hero {
  min-height: 620px;
  padding: 92px clamp(20px, 7vw, 96px) 76px;
  background:
    linear-gradient(rgba(246, 248, 251, 0.78), rgba(246, 248, 251, 1)),
    url("https://images.unsplash.com/photo-1522202176988-66273c2fd55f?auto=format&fit=crop&w=1800&q=80") center/cover;
}

.eyebrow {
  color: var(--primary-dark);
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 920px;
  font-size: clamp(42px, 7vw, 78px);
  line-height: 1.02;
  letter-spacing: 0;
}

h2 {
  font-size: 34px;
  line-height: 1.16;
}

.hero-copy {
  max-width: 720px;
  color: #344054;
  font-size: 20px;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 32px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 18px;
  border: 0;
  border-radius: 8px;
  background: var(--primary);
  color: #ffffff;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  text-decoration: none;
}

.button:hover {
  background: var(--primary-dark);
}

.button-secondary {
  background: #e8eef8;
  color: #0f172a;
}

.button-secondary:hover {
  background: #dbe5f4;
}

.button-small {
  min-height: 38px;
  padding: 0 14px;
}

.section {
  padding: 72px clamp(20px, 7vw, 96px);
}

.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 24px;
}

.grid article,
.panel,
.auth-card,
.workspace-item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
}

.grid article,
.panel {
  padding: 24px;
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(280px, 0.8fr);
  gap: 24px;
  align-items: start;
}

.auth-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at top left, rgba(0, 126, 229, 0.08), transparent 32rem),
    var(--bg);
}

.auth-card {
  width: min(100%, 440px);
  padding: 30px 32px 32px;
}

.auth-card-wide {
  width: min(100%, 560px);
}

.auth-header {
  margin-bottom: 24px;
}

.auth-card .brand {
  display: inline-flex;
  margin-bottom: 18px;
  color: var(--primary);
  font-size: 17px;
  font-weight: 900;
}

.auth-card h1 {
  max-width: none;
  margin-bottom: 8px;
  color: #101828;
  font-size: 30px;
  line-height: 1.16;
  letter-spacing: 0;
}

.auth-card p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.auth-card .workspace-name {
  margin-top: 2px;
  color: #101828;
  font-size: 15px;
}

.auth-form {
  gap: 14px;
}

.auth-form label {
  margin-top: 2px;
  font-size: 14px;
}

.auth-form input {
  min-height: 44px;
  padding: 9px 12px;
  background: #f8fbff;
}

.auth-form input:focus {
  border-color: var(--primary);
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(0, 126, 229, 0.14);
  outline: none;
}

.auth-form .button {
  margin-top: 8px;
  min-height: 44px;
  font-size: 15px;
}

form {
  display: grid;
  gap: 12px;
}

label {
  color: #344054;
  font-weight: 700;
}

input {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid #c8d2df;
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
  font: inherit;
}

.alert {
  margin: 18px 0;
  padding: 12px 14px;
  border: 1px solid #fecaca;
  border-radius: 8px;
  background: #fff1f2;
  color: #9f1239;
}

.workspace-list {
  display: grid;
  gap: 12px;
}

.workspace-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px;
}

.workspace-item h3 {
  margin-bottom: 4px;
}

.workspace-item p {
  margin: 0;
  color: var(--muted);
}

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

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

th,
td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  background: #eef6ff;
  color: var(--text);
  font-size: 13px;
}

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

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

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
}

.status-success {
  background: #dcfce7;
  color: #166534;
}

.status-failure {
  background: #fee2e2;
  color: #991b1b;
}

.audit-agent {
  max-width: 300px;
  color: #475467;
  font-size: 12px;
  overflow-wrap: anywhere;
}

code {
  color: var(--primary-dark);
  font-weight: 700;
}

select {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid #c8d2df;
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
  font: inherit;
}

@media (max-width: 820px) {
  .site-header,
  .workspace-item,
  .page-title {
    align-items: flex-start;
    flex-direction: column;
  }

  .admin-topbar {
    grid-template-columns: 1fr;
  }

  .admin-actions {
    align-items: stretch;
    flex-direction: column;
    justify-content: flex-start;
  }

  .admin-actions form,
  .workspace-switcher select {
    width: 100%;
  }

  nav,
  .grid,
  .split,
  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
  }
}
