:root {
  font-family: "Plus Jakarta Sans", "Segoe UI", system-ui, sans-serif;
  color: #1d232e;
  background: #f6f7f9;
  font-synthesis: none;
  line-height: 1.5;
  --ink: #1d232e;
  --muted: #555f6f;
  --line: #dfe3e9;
  --accent: #924209;
  --amber: #f2a222;
  --sidebar: #12151a;
  --sidebar-line: #272d37;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 280px; }
button, input, select, textarea { font: inherit; }
input, select, textarea { font-weight: 400; }
a { color: var(--accent); text-underline-offset: 0.2em; }
a:hover { color: #6d3106; }
:focus-visible { outline: 3px solid #a75512; outline-offset: 3px; }
h1, h2, p { margin: 0; }
h1, h2 { line-height: 1.12; letter-spacing: -0.035em; }
h1 { font-size: clamp(1.75rem, 4vw, 2.25rem); }
h2 { font-size: 1.35rem; }
p { color: var(--muted); }

.brand { display: inline-flex; align-items: center; gap: 0.75rem; font-weight: 650; }
.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 2.25rem;
  aspect-ratio: 1;
  flex: 0 0 auto;
  border-radius: 0.65rem;
  background: linear-gradient(145deg, #ffb93f, #da820e);
  color: #352005;
  box-shadow: 0 4px 12px #a864222e;
}

.brand-mark::before {
  content: "";
  width: 45%;
  aspect-ratio: 1;
  border: 1px solid currentColor;
  border-radius: 3px;
  background: repeating-linear-gradient(135deg, currentColor 0 1.5px, transparent 1.5px 4px);
  background-clip: content-box;
  padding: 3px;
}

.login {
  display: grid;
  place-items: center;
  min-height: 100vh;
  min-height: 100svh;
  padding: clamp(1.25rem, 5vw, 3rem);
  background: radial-gradient(ellipse at 50% 20%, #fff9ef, transparent 38rem), #f6f7f9;
}
.login-content { width: min(100%, 28rem); }
.login-heading { text-align: center; margin-bottom: 1.5rem; }
.login-heading .brand-mark { width: 3rem; border-radius: 0.8rem; margin-bottom: 0.9rem; }
.login-heading h1 { font-size: clamp(1.45rem, 4.5vw, 1.8rem); text-wrap: balance; }
.login-heading p { margin: 0.5rem auto 0; max-width: 22rem; }
.login-card { box-shadow: 0 16px 36px -20px #222a4047, 0 2px 6px #222a4009; }
.login-card .stack > button { width: 100%; margin-top: 0.4rem; }

.stack { display: grid; gap: 1rem; }
.stack label, .search label { display: grid; gap: 0.35rem; font-size: 0.9375rem; font-weight: 650; }
input, select, textarea {
  width: 100%;
  min-height: 2.8rem;
  min-width: 0;
  border: 1px solid #b9c0cb;
  border-radius: 0.5rem;
  background: #fbfcfd;
  padding: 0.55rem 0.75rem;
  color: var(--ink);
}
select {
  appearance: none;
  padding-right: 2.4rem;
  background:
    linear-gradient(45deg, transparent 47%, var(--muted) 50%) calc(100% - 1.2rem) 50% / 5px 5px no-repeat,
    linear-gradient(135deg, var(--muted) 50%, transparent 53%) calc(100% - 0.9rem) 50% / 5px 5px no-repeat #fbfcfd;
}
button, .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  justify-self: start;
  min-height: 2.8rem;
  padding: 0.55rem 1rem;
  border: 1px solid transparent;
  border-radius: 0.5rem;
  background: linear-gradient(120deg, #ffb333, #ed9b19);
  color: #261708;
  font-weight: 650;
  text-decoration: none;
  cursor: pointer;
}
button:hover, .button:hover { background: #ef9c23; color: #261708; }
button:disabled { cursor: wait; opacity: 0.65; }
.secondary { background: white; border-color: #b9c0cb; color: var(--ink); }
.secondary:hover { background: #f2f4f7; color: var(--ink); }
.quiet { background: transparent; color: #e5e7eb; border-color: #3c4553; }
.quiet:hover { background: #232936; color: #fff; }
.hint { margin-top: -0.65rem; font-size: 0.875rem; }
.message { padding: 0.75rem 1rem; margin-bottom: 1rem; border: 1px solid; border-radius: 7px; }
.error { background: #fff3f2; border-color: #efb9b5; color: #882923; }
.success { background: #eaf7ee; border-color: #a9d7b4; color: #1c6137; }

.workspace { display: grid; grid-template-columns: 15.75rem minmax(0, 1fr); min-height: 100vh; min-height: 100svh; }
.workspace-content { min-width: 0; }
.workspace-header {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-height: 4rem;
  padding: 0.5rem clamp(1rem, 3.5vw, 2.5rem);
  border-bottom: 1px solid var(--line);
  background: white;
}
.topbar-brand, .menu-toggle { display: none; }
.user-menu { position: relative; margin-inline-start: auto; }
.user-menu summary {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.25rem 0.6rem 0.25rem 0.25rem;
  border: 1px solid transparent;
  border-radius: 0.65rem;
  font-weight: 650;
  list-style: none;
  cursor: pointer;
}
.user-menu summary::-webkit-details-marker { display: none; }
.user-menu summary:hover, .user-menu[open] summary { border-color: var(--line); background: #f6f7f9; }
.user-avatar {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 2.2rem;
  aspect-ratio: 1;
  border-radius: 50%;
  background: #fff0d4;
  color: var(--accent);
  font-size: 0.875rem;
}
.user-menu-name { max-width: 14rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-menu-chevron {
  width: 0.45rem;
  aspect-ratio: 1;
  border: solid var(--muted);
  border-width: 0 1.5px 1.5px 0;
  transform: translateY(-2px) rotate(45deg);
}
.user-menu[open] .user-menu-chevron { transform: translateY(2px) rotate(225deg); }
.user-menu-panel {
  position: absolute;
  inset: calc(100% + 0.45rem) 0 auto auto;
  width: min(15rem, calc(100vw - 2rem));
  padding: 0.35rem;
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  background: white;
  box-shadow: 0 8px 22px #1d232e22;
}
.user-menu-profile { display: grid; gap: 0.15rem; padding: 0.45rem 0.65rem 0.65rem; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.user-menu-profile span { color: var(--muted); font-size: 0.875rem; }
.user-menu-panel a, .user-menu-panel button {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 2.8rem;
  justify-content: flex-start;
  padding: 0.55rem 0.65rem;
  border: 0;
  border-radius: 0.45rem;
  background: transparent;
  color: var(--ink);
  font-weight: 550;
  text-decoration: none;
}
.user-menu-panel a:hover, .user-menu-panel button:hover { background: #fff5e5; color: var(--accent); }
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  background: var(--sidebar);
  color: #eceff4;
  border-right: 1px solid var(--sidebar-line);
}
.sidebar :focus-visible { outline-color: var(--amber); }
.sidebar-heading {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 1.15rem 1rem;
  border-bottom: 1px solid var(--sidebar-line);
}
.sidebar-brand {
  color: inherit;
  text-decoration: none;
  line-height: 1.25;
}
.sidebar-brand:hover { color: #ffd387; }
.sidebar-nav { display: grid; gap: 0.3rem; padding: 0.85rem 0.75rem; }
.sidebar-nav a {
  padding: 0.62rem 0.85rem;
  border-inline-start: 2px solid transparent;
  border-radius: 0.45rem;
  color: #c4c9d2;
  font-weight: 600;
  text-decoration: none;
}
.sidebar-nav a:hover { background: #1d222c; color: #f4f6fa; }
.sidebar-nav a[aria-current] { background: #2a2119; border-color: var(--amber); color: #ffd188; }
.icon-button { flex: 0 0 auto; width: 2.8rem; padding: 0; }
.sidebar-close { display: none; margin-inline-start: auto; }
.hamburger-icon {
  width: 1.15rem;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  box-shadow: 0 -5px currentColor, 0 5px currentColor;
}
.close-icon {
  width: 1.15rem;
  aspect-ratio: 1;
  background:
    linear-gradient(45deg, transparent 45%, currentColor 46% 54%, transparent 55%),
    linear-gradient(135deg, transparent 45%, currentColor 46% 54%, transparent 55%);
}
.sidebar-drawer {
  position: fixed;
  inset: 0 auto 0 0;
  width: min(18rem, calc(100% - 2.5rem));
  max-width: none;
  height: 100%;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: var(--sidebar);
}
.sidebar-drawer::backdrop { background: #0d101899; }
.sidebar-drawer .sidebar { position: static; height: 100%; overscroll-behavior: contain; }
.sidebar-drawer .sidebar-heading { padding: 0.85rem 0.75rem 0.85rem 1rem; }
.sidebar-drawer .sidebar-close { display: inline-flex; }
html:has(.sidebar-drawer[open]) { overflow: hidden; }

@media (prefers-reduced-motion: no-preference) {
  .sidebar-drawer[open] { animation: slide-in 200ms ease-out; }
  .sidebar-drawer[open]::backdrop { animation: fade-in 200ms ease-out; }
}
@keyframes slide-in { from { transform: translateX(-100%); } }
@keyframes fade-in { from { opacity: 0; } }

.container { width: min(70rem, calc(100% - clamp(2rem, 7vw, 5rem))); margin: clamp(1.75rem, 4vw, 3rem) auto; }
.account { max-width: 39rem; }
.page-title { margin-bottom: 1.5rem; }
.page-title p { margin-top: 0.45rem; }
.title-row, .identity { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.panel { background: white; border: 1px solid var(--line); border-radius: 1rem; padding: clamp(1rem, 4vw, 1.8rem); }
.panel + .panel { margin-top: 1rem; }
.panel h2 + form, .panel p + form { margin-top: 1rem; }
.panel h2 + p { margin-top: 0.4rem; }
.back { display: inline-block; margin-bottom: 0.5rem; }
.search { margin-bottom: 1.2rem; }
.search div { display: flex; align-items: center; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.35rem; }
.search input { max-width: 22rem; flex: 1 1 10rem; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th, td { padding: 0.8rem 0.7rem; vertical-align: middle; }
th { font-size: 0.875rem; background: #f1f3f6; color: var(--muted); }
td { border-bottom: 1px solid var(--line); }
.username { display: block; font-size: 0.875rem; color: var(--muted); overflow-wrap: anywhere; }
.actions { text-align: right; }
.pill, .status {
  display: inline-block;
  padding: 0.22rem 0.6rem;
  border-radius: 99px;
  background: #eef0f4;
  color: #434d5d;
  font-size: 0.875rem;
  font-weight: 650;
  white-space: nowrap;
}
.status.active { background: #e8f5ed; color: #276443; }
.pagination { display: flex; gap: 1rem; margin-top: 1rem; }
.empty { padding: 1rem 0; }

.sidebar-checks {
  margin-top: 0.45rem;
  padding-top: 0.9rem;
  border-top: 1px solid var(--sidebar-line);
  min-width: 0;
}
.sidebar-checks h2, .sidebar-checks > p { margin-inline: 0.85rem; }
.sidebar-checks h2 { font-size: 0.9375rem; letter-spacing: 0; }
.sidebar-checks h3, .sidebar-checks h4, .sidebar-checks p, .sidebar-checks a {
  margin-block: 0;
  overflow-wrap: anywhere;
  font-size: 0.875rem;
}
.sidebar-checks p { margin-top: 0.45rem; color: #adb4bf; }
.sidebar-project { margin-top: 0.9rem; }
.sidebar-project h3 { padding: 0 0.85rem; color: #f4f6fa; }
.sidebar-work-area { margin-top: 0.25rem; }
.sidebar-work-area h4 { padding: 0.25rem 0.85rem 0.2rem 1.25rem; color: #adb4bf; font-weight: 550; }
.sidebar-work-area a { display: block; padding-block: 0.44rem; padding-inline-start: 1.6rem; }

.inline-form, .assignment-row {
  display: flex;
  gap: 0.75rem;
  align-items: end;
  flex-wrap: wrap;
}
.inline-form label, .assignment-row label {
  display: grid;
  gap: 0.35rem;
  font-size: 0.9375rem;
  font-weight: 650;
}
.inline-form label:has(input:not([type="date"])) { flex: 1 1 12rem; max-width: 25rem; }
.inline-form label:has(select) { min-width: min(100%, 10rem); }
.inline-form > a { align-self: center; }
.window-fields { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: flex-end; }
.window-fields[hidden] { display: none; }
.panel-action, .resource-list + form { margin-top: 1rem; }
.resource-list { margin: 0.75rem 0 0; padding: 0; list-style: none; }
.resource-list li {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.4rem 1.2rem;
  padding-block: 0.65rem;
  border-bottom: 1px solid var(--line);
  overflow-wrap: anywhere;
}
.resource-heading + p { margin-top: 0.4rem; }
.resource-heading h2 { overflow-wrap: anywhere; }
.resource-actions { display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; }
.import-heading, .import-preview > .title-row { flex-wrap: wrap; }
.import-heading p, .import-preview h2 + p, .import-format { margin-top: 0.45rem; }
.import-upload, .import-table, .import-preview > .message { margin-top: 1rem; }
.import-format { font-size: 0.875rem; }
.import-table { max-height: 35rem; overflow: auto; }
.import-table table { min-width: 40rem; }
.import-table thead { position: sticky; top: 0; }
.import-table td { overflow-wrap: anywhere; }
.import-table td:last-child { min-width: 11rem; }
.status.import-error { background: #fff3f2; color: #882923; }
.work-area-panel, .resource-list li[id] { scroll-margin-top: 5rem; }
.settings-list > * + *, .settings-list { margin-top: 0.75rem; }
.settings-list > * + * { padding-top: 0.75rem; border-top: 1px solid var(--line); }
.assignment-row > div { flex: 1 1 12rem; padding-block: 0.3rem; }
.assignment-row h2 { font-size: 1.05rem; }
.assignment-row p, .check-day h2 + p { margin-top: 0.3rem; }
.assignment-row select { max-width: 100%; }
.assignment-row label { max-width: 100%; }
.group-label {
  margin-bottom: 0.3rem;
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 650;
}
.page-title .section-path, .history-section .section-path { margin: 0 0 0.35rem; overflow-wrap: anywhere; }
.check-day {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: end;
  gap: 1rem;
}
.history-filter label:has(select) { flex: 1 1 13rem; min-width: 0; max-width: 28rem; }
.history-section { flex-wrap: wrap; margin-block: 1.5rem 0.85rem; }
.history-section h2 { overflow-wrap: anywhere; }
.history-list span, .submission-status p { color: var(--muted); font-size: 0.875rem; }
.dashboard-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.dashboard-overview, .dashboard-details, .dashboard-rankings { margin-top: 1.5rem; }
.dashboard-section-heading { margin-bottom: 0.75rem; }
.dashboard-filter .inline-form { margin-top: 0; }
.dashboard-metric {
  display: grid;
  gap: 0.3rem;
  border: 1px solid;
  border-radius: 1rem;
  padding: 1.2rem 1.4rem;
  font-weight: 650;
  text-decoration: none;
}
.dashboard-metric:hover span { text-decoration: underline; }
.dashboard-metric strong { font-size: clamp(2rem, 6vw, 3rem); line-height: 1.1; }
.dashboard-metric small { color: inherit; font-weight: 450; }
.dashboard-metric-missing { background: #fff5e5; border-color: #edcf9d; color: #784208; }
.dashboard-metric-no { background: #fff0f2; border-color: #efc8d0; color: #8f213c; }
.dashboard-ranking.panel { margin-top: 0; }
.dashboard-ranking ol { padding-left: 1.4rem; margin: 1rem 0 0; }
.dashboard-ranking li { padding: 0.65rem 0; overflow-wrap: anywhere; }
.dashboard-ranking li + li { border-top: 1px solid var(--line); }
.dashboard-ranking li span, .dashboard-ranking li small { display: block; color: var(--muted); }
.dashboard-empty, .dashboard-note { margin-top: 1rem; }
.dashboard-details { scroll-margin-top: 5rem; }
.dashboard-details .table-scroll { margin-top: 0.85rem; }
.dashboard-details table { min-width: 34rem; }
.dashboard-pagination { display: flex; gap: 1rem; margin-top: 0.85rem; }
@media (max-width: 44rem) {
  .dashboard-grid { grid-template-columns: 1fr; }
}
.submission-status p, .submission-status form { margin-top: 0.45rem; }
.check-day + .message, .check-entries, .check-submission { margin-top: 1rem; }
.checklist .message ul { margin: 0.5rem 0 0; }
.checklist .message p { color: inherit; }
.submit-checklist-form { display: flex; align-items: center; flex-wrap: wrap; gap: 0.75rem 1rem; }
.submission-error { margin: 0.85rem 0 0; }
.title-row > :last-child.button { flex-shrink: 0; }
.check-card { scroll-margin-top: 5rem; }
.check-card header { margin-bottom: 1rem; }
.nested-check-card header { margin-bottom: 0; }
.nested-check-card h2 + p { margin-top: 0.35rem; }
.manage-sub-checks { display: inline-block; margin-top: 0.6rem; }
.check-card h2, .assignment-row p, .page-title h1 { overflow-wrap: anywhere; }
.check-card textarea { resize: vertical; }
.check-window { margin-top: 0.35rem; font-size: 0.875rem; }
.check-window-note { margin-bottom: 0.75rem; }
.answer-field { min-width: 0; margin: 0; padding: 0; border: 0; }
.answer-field legend { padding: 0; margin-bottom: 0.35rem; font-size: 0.9375rem; font-weight: 650; }
.answer-options { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.answer-options label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 2.8rem;
  min-width: 5.25rem;
  padding: 0.4rem 0.75rem;
  border: 1px solid #b9c0cb;
  border-radius: 0.5rem;
  cursor: pointer;
}
.answer-options label:has(:checked) { border-color: var(--accent); background: #fff5e5; }
.check-card .tick-label { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; font-weight: 650; }
.tick-label input[type="checkbox"], .answer-options input[type="radio"] {
  width: 1.2rem;
  height: 1.2rem;
  min-height: 0;
  margin: 0;
  accent-color: var(--accent);
}
.muted { color: var(--muted); font-weight: 400; }
.check-images { display: grid; gap: 0.5rem; padding: 0; margin: 0; }
.image-actions { display: flex; flex-wrap: wrap; gap: 0.65rem 1rem; }
.read-value { display: block; white-space: pre-wrap; overflow-wrap: anywhere; }
.last-edit { margin-top: 0.85rem; font-size: 0.875rem; }

@media (max-width: 720px) {
  .workspace { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; }
  .drawer-ready .workspace > .sidebar { display: none; }
  .drawer-ready .menu-toggle, .drawer-ready .topbar-brand { display: inline-flex; }
  .topbar-brand { min-width: 0; gap: 0.5rem; color: var(--ink); font-size: 0.9375rem; line-height: 1.2; text-decoration: none; }
  .topbar-brand .brand-mark { width: 1.9rem; }
  .topbar-brand span:last-child { min-width: 0; overflow-wrap: anywhere; }
  .user-menu-name { display: none; }
  .workspace > .sidebar { position: static; height: auto; border-right: 0; }
  .workspace > .sidebar .sidebar-heading { padding-block: 0.85rem; }
  .workspace > .sidebar .sidebar-nav { display: flex; flex-wrap: wrap; padding-block: 0.55rem; }
  .workspace > .sidebar .sidebar-checks { flex: 1 0 100%; }
  .page-title.title-row { flex-wrap: wrap; }
  th, td { padding-inline: 0.35rem; }
  .directory td:first-child { overflow-wrap: anywhere; }
}
