:root {
  color-scheme: light;
  --ink: #12333e;
  --muted: #58717a;
  --line: #cbd9dc;
  --paper: #f7faf9;
  --white: #fff;
  --teal: #0a5969;
  --teal-dark: #073d4a;
  --accent: #d7f0ea;
  --danger: #a32d2d;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  font: 16px/1.5 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: linear-gradient(145deg, #edf6f3, var(--paper) 46%, #e5f0f3);
}
a { color: var(--teal); }
.auth-shell { width: min(1100px, calc(100% - 32px)); margin: 0 auto; padding: 32px 0 64px; }
.auth-header { display: flex; justify-content: space-between; align-items: center; gap: 18px; margin-bottom: 32px; }
.auth-brand { display: inline-flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; font-weight: 800; font-size: 1.25rem; }
.auth-brand img { width: 42px; height: 42px; }
.auth-nav { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.auth-card { max-width: 520px; margin: 7vh auto 0; padding: 36px; background: var(--white); border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 24px 70px rgb(12 61 74 / 10%); }
.auth-card--wide { max-width: none; margin-top: 0; }
.eyebrow { margin: 0 0 8px; color: var(--teal); font-size: .78rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
h1, h2 { margin: 0 0 12px; line-height: 1.15; }
.lead { color: var(--muted); margin: 0 0 26px; }
.auth-notice { margin: -8px 0 24px; padding: 12px 14px; color: var(--ink); background: var(--accent); border-left: 4px solid var(--teal); border-radius: 8px; font-size: .92rem; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.form-grid .full { grid-column: 1 / -1; }
label { display: grid; gap: 7px; font-weight: 700; font-size: .92rem; }
input, select, button { font: inherit; }
input, select { width: 100%; padding: 11px 12px; color: var(--ink); background: var(--white); border: 1px solid #aebfc4; border-radius: 8px; }
input:focus, select:focus { outline: 3px solid rgb(10 89 105 / 16%); border-color: var(--teal); }
.actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 22px; }
button, .button { border: 0; border-radius: 8px; padding: 10px 16px; background: var(--teal); color: white; font-weight: 750; text-decoration: none; cursor: pointer; }
button:hover, .button:hover { background: var(--teal-dark); }
button.secondary, .button.secondary { color: var(--teal); background: var(--accent); }
button.danger { background: var(--danger); }
button:disabled { opacity: .55; cursor: wait; }
.status { min-height: 24px; margin: 16px 0 0; color: var(--muted); }
.status.error { color: var(--danger); }
.status.success { color: #167044; }
.account-summary { display: grid; gap: 6px; padding: 16px; margin-bottom: 24px; background: var(--paper); border-radius: 10px; }
.account-summary span { color: var(--muted); }
.panel-grid { display: grid; grid-template-columns: minmax(280px, .8fr) minmax(520px, 1.6fr); gap: 24px; align-items: start; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { padding: 11px 9px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; }
.user-actions { width: 1%; min-width: 158px; white-space: nowrap; }
.user-action-select {
  min-width: 150px;
  padding: 7px 34px 7px 10px;
  color: var(--teal);
  background-color: var(--accent);
  border-color: transparent;
  font-size: .84rem;
  font-weight: 750;
  cursor: pointer;
}
.user-action-select:hover { border-color: var(--teal); }
.user-action-select:disabled { opacity: .55; cursor: wait; }
.badge { display: inline-flex; padding: 3px 8px; border-radius: 999px; background: var(--accent); font-size: .78rem; font-weight: 750; }
.badge.off { background: #f6dddd; color: var(--danger); }
dialog { width: min(450px, calc(100% - 32px)); border: 1px solid var(--line); border-radius: 14px; padding: 26px; color: var(--ink); }
dialog::backdrop { background: rgb(5 30 38 / 45%); }
.access-dialog { width: min(560px, calc(100% - 32px)); }
.access-list { margin: 0 0 20px; padding: 16px; border: 1px solid var(--line); border-radius: 10px; }
.access-list legend { padding: 0 6px; font-weight: 800; }
.access-list > div { display: grid; gap: 10px; }
.access-list label { display: flex; grid-template-columns: none; align-items: center; gap: 10px; }
.access-list input { width: auto; }
.field-help { margin: 8px 0 0; color: var(--muted); font-size: .86rem; }
@media (max-width: 820px) {
  .panel-grid, .form-grid { grid-template-columns: 1fr; }
  .form-grid .full { grid-column: auto; }
  .auth-header { align-items: flex-start; }
}
