:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #172033;
  background: #ffffff;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background: #ffffff;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

[hidden] {
  display: none !important;
}

.user-page {
  display: grid;
  place-items: center;
}

.user-screen {
  width: min(100% - 32px, 420px);
  padding: 32px 0;
  text-align: center;
}

.user-screen h1,
.admin-card h1,
.dashboard-header h1 {
  margin: 0;
  color: #111827;
  font-size: clamp(1.6rem, 4vw, 2rem);
  letter-spacing: -0.03em;
}

.user-screen h1 {
  font-size: 1.25rem;
  font-weight: 600;
}

.status {
  min-height: 24px;
  margin: 12px 0 24px;
  color: #667085;
  font-size: 1rem;
}

.status.success {
  color: #147a52;
}

.status.error,
.form-error {
  color: #b42318;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border: 1px solid #1d4ed8;
  border-radius: 8px;
  padding: 0 16px;
  background: #1d4ed8;
  color: #ffffff;
  font-weight: 600;
  transition: background 120ms ease, border-color 120ms ease;
}

.button:hover {
  border-color: #1e40af;
  background: #1e40af;
}

.button:focus-visible,
input:focus-visible {
  outline: 3px solid #bfdbfe;
  outline-offset: 2px;
}

.button-secondary {
  border-color: #d0d5dd;
  background: #ffffff;
  color: #344054;
}

.button-secondary:hover {
  border-color: #98a2b3;
  background: #f9fafb;
}

.button-danger {
  border-color: #fda29b;
  background: #ffffff;
  color: #b42318;
}

.button-danger:hover {
  border-color: #f97066;
  background: #fff5f4;
}

.admin-page {
  background: #f8fafc;
}

.admin-shell {
  width: min(100% - 32px, 1440px);
  margin: 0 auto;
  padding: 48px 0 72px;
}

.admin-card,
.table-card {
  border: 1px solid #e4e7ec;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 8px 24px rgba(16, 24, 40, 0.05);
}

.admin-card {
  width: min(100%, 440px);
  margin: 10vh auto 0;
  padding: 32px;
}

.eyebrow {
  margin: 0 0 8px;
  color: #1d4ed8;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.muted {
  color: #667085;
  line-height: 1.55;
}

.admin-card .muted {
  margin: 12px 0 24px;
}

.stack {
  display: grid;
  gap: 10px;
}

label {
  color: #344054;
  font-size: 0.875rem;
  font-weight: 600;
}

input {
  width: 100%;
  min-height: 44px;
  border: 1px solid #d0d5dd;
  border-radius: 8px;
  padding: 0 12px;
  background: #ffffff;
  color: #101828;
}

.form-error {
  margin: 2px 0 0;
  font-size: 0.875rem;
}

.dashboard-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

.dashboard-header h1 {
  margin-bottom: 6px;
}

.dashboard-header .muted {
  margin: 0;
}

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

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

.notice-error {
  border: 1px solid #fecdca;
  background: #fff6f5;
  color: #b42318;
}

.table-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 20px 16px;
}

.table-heading h2 {
  margin: 0;
  color: #101828;
  font-size: 1rem;
}

.table-wrap {
  overflow-x: auto;
  border-top: 1px solid #eaecf0;
}

table {
  width: 100%;
  min-width: 1000px;
  border-collapse: collapse;
  text-align: left;
}

th,
td {
  padding: 14px 20px;
  border-bottom: 1px solid #f2f4f7;
  vertical-align: top;
  font-size: 0.875rem;
}

th {
  background: #fcfcfd;
  color: #667085;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  white-space: nowrap;
}

td {
  color: #344054;
}

td code {
  display: block;
  max-width: 220px;
  overflow-wrap: anywhere;
  color: #475467;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.75rem;
}

.location-cell {
  display: grid;
  gap: 4px;
}

.location-cell a {
  color: #1d4ed8;
  font-size: 0.75rem;
}

.status-badge {
  display: inline-flex;
  border-radius: 999px;
  padding: 4px 9px;
  background: #f2f4f7;
  color: #475467;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}

.status-badge.granted {
  background: #ecfdf3;
  color: #067647;
}

.status-badge.denied,
.status-badge.error {
  background: #fff1f3;
  color: #c01048;
}

.empty-state {
  margin: 0;
  padding: 32px 20px;
  color: #667085;
  text-align: center;
}

@media (max-width: 680px) {
  .admin-shell {
    padding-top: 24px;
  }

  .admin-card {
    padding: 24px;
  }

  .dashboard-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .header-actions {
    width: 100%;
  }

  .header-actions .button {
    flex: 1;
  }
}
