@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/static/InterVariable.woff2") format("woff2");
}

:root {
  color-scheme: light;
  --psg-orange: #ef5025;
  --psg-teal: #20bdb3;
  --psg-purple: #36266b;
  --psg-green: #44b749;
  --psg-gray: #818285;
  --psg-light-gray: #bdbec0;
  --color-text: #2f2f2f;
  --color-text-muted: #5f5f5f;
  --color-border: #e5e7eb;
  --color-surface: #ffffff;
  --color-page: #f8f7f3;
  --color-primary: var(--psg-orange);
  --color-primary-hover: #d9471f;
  --color-focus: rgba(239, 80, 37, 0.25);
  --radius-sm: 6px;
  --radius-md: 8px;
  --font-sans: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --bg: var(--color-page);
  --panel: var(--color-surface);
  --text: var(--color-text);
  --muted: var(--color-text-muted);
  --line: var(--color-border);
  --accent: var(--color-primary);
  --accent-dark: var(--color-primary-hover);
  --danger: #b42318;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-optical-sizing: auto;
  font-size: 16px;
  line-height: 1.5;
}

h1 {
  margin: 0;
  font-size: 1.6rem;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.muted {
  color: var(--muted);
  margin: 0.25rem 0 0;
}

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

.auth-panel {
  width: min(100%, 26rem);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 2rem;
}

.auth-brand {
  margin-bottom: 1.75rem;
}

.auth-logo {
  display: block;
  width: min(100%, 20rem);
  height: auto;
  margin-bottom: 1.5rem;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  min-height: 4.5rem;
  padding: 0.75rem 1.5rem;
  background: var(--panel);
  border-bottom: 2px solid var(--psg-orange);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  color: var(--text);
  font-size: 1.08rem;
  font-weight: 650;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.brand:hover {
  color: var(--text);
}

.brand-monogram {
  width: 3.25rem;
  height: 2rem;
  object-fit: cover;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.9rem;
}

.user-avatar {
  display: inline-grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  flex: 0 0 auto;
  border: 1px solid #cfcfd1;
  border-radius: 50%;
  background: var(--psg-purple);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 650;
  letter-spacing: 0.02em;
  cursor: default;
}

.user-menu {
  position: relative;
}

.user-menu summary {
  display: block;
  border-radius: 50%;
  cursor: pointer;
  list-style: none;
}

.user-menu summary::-webkit-details-marker {
  display: none;
}

.user-menu-panel {
  position: absolute;
  z-index: 10;
  top: calc(100% + 0.6rem);
  right: 0;
  width: 14rem;
  padding: 0.5rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}

.user-menu-name {
  margin: 0;
  padding: 0.55rem 0.65rem 0.7rem;
  overflow-wrap: anywhere;
  color: var(--text);
  font-weight: 600;
}

.user-menu-panel form {
  display: block;
  border-top: 1px solid var(--line);
  padding-top: 0.35rem;
}

.user-menu-action {
  width: 100%;
  min-height: 2.25rem;
  justify-content: flex-start;
  border: 0;
  padding-inline: 0.65rem;
  background: transparent;
  color: var(--text);
  text-align: left;
}

.user-menu-action:hover {
  background: #f4f4f3;
}

.content {
  width: min(100%, 90rem);
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

.page-heading {
  margin-bottom: 1.5rem;
}

form {
  display: grid;
  gap: 1rem;
}

.filters {
  grid-template-columns: minmax(12rem, 1fr) minmax(10rem, 16rem) auto auto;
  align-items: end;
  margin-bottom: 1rem;
}

.batch-download {
  display: block;
}

.batch-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
  margin: 1rem 0;
}

.batch-actions .muted {
  margin: 0;
}

.checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.batch-download input[type="checkbox"] {
  width: auto;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

label {
  display: grid;
  gap: 0.35rem;
  color: var(--muted);
  font-size: 0.9rem;
}

input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.7rem;
  color: var(--text);
  background: #fff;
  font: inherit;
}

input:hover {
  border-color: var(--psg-light-gray);
}

input:focus-visible,
button:focus-visible,
.button:focus-visible,
a:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--color-focus);
  outline-offset: 2px;
}

input:focus {
  border-color: var(--accent);
}

a {
  color: #a83a1c;
  text-underline-offset: 0.15em;
}

a:hover {
  color: var(--accent-dark);
}

button,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.4rem;
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.85rem;
  background: var(--accent);
  color: #fff;
  font: inherit;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}

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

.secondary {
  background: #fff;
  border-color: var(--psg-light-gray);
  color: var(--text);
}

.secondary:hover {
  background: #f4f4f3;
  border-color: var(--psg-gray);
}

.error {
  color: var(--danger);
}

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

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

th {
  background: #f3f3f1;
  font-size: 0.85rem;
  color: var(--muted);
  font-weight: 650;
}

tbody tr:last-child td {
  border-bottom: 0;
}

tbody tr:hover {
  background: #fdfbf9;
}

.number {
  text-align: right;
}

.empty {
  text-align: center;
  color: var(--muted);
  padding: 2rem;
}

.admin-content { max-width: 72rem; }
.breadcrumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 0.45rem; margin-bottom: 1rem; color: var(--muted); font-size: 0.9rem; }
.breadcrumbs a { color: var(--muted); }
.breadcrumbs a:hover { color: var(--text); }
.breadcrumbs [aria-current="page"] { color: var(--text); font-weight: 600; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-md); padding: 1.25rem; margin-bottom: 1rem; }
.panel h2 { margin: 0 0 0.8rem; font-size: 1.2rem; }
.panel p { margin-bottom: 1rem; }
.client-form { grid-template-columns: 1fr 1fr auto auto; align-items: end; }
.client-row { display: grid; grid-template-columns: minmax(10rem, 2fr) minmax(8rem, 2fr) minmax(5rem, 1fr) auto; gap: 1rem; align-items: center; }
.client-row label { min-width: 0; }
.row-label { display: none; }
.client-row input[type="text"], .client-row input:not([type]) { width: 100%; }
.client-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.9rem; margin-top: 0.75rem; font-size: 0.9rem; }
.client-actions details { flex-basis: 100%; }
.client-actions details p { margin: 0.5rem 0; }
.client-user-form { display: grid; gap: 0.85rem; max-width: 38rem; }
.client-user-form input:not([type="checkbox"]) { width: 100%; }
.warning { padding: 0.75rem 1rem; background: #fff8e6; border: 1px solid #e4b95c; border-radius: var(--radius-sm); }
.checkbox { display: flex; align-items: center; gap: 0.5rem; color: var(--text); }
.checkbox input { width: auto; }
.access-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr)); gap: 0.7rem 1rem; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 1rem; }
.access-list legend { color: var(--muted); font-weight: 600; padding: 0 0.35rem; }
.notice { padding: 0.75rem 1rem; background: #f1f8f2; border: 1px solid #b9ddbd; border-radius: var(--radius-sm); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

@media (max-width: 720px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
    padding-block: 1rem;
  }

  .header-actions {
    width: 100%;
    flex-wrap: wrap;
  }

  .user-menu {
    margin-left: auto;
  }

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

  .client-form, .client-row { grid-template-columns: 1fr; }
  .row-label { display: inline; }

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