:root {
  color-scheme: dark;
  --rail: #101010;
  --canvas: #141414;
  --ink: #f3f3f3;
  --muted: #9a9a9a;
  --accent: #d4d4d4;
  --panel: #1c1c1c;
  --hairline: #2e2e2e;
  --field: #242424;
  --error: #e4c7a4;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
}

body {
  min-height: 100vh;
  background: var(--canvas);
  color: var(--ink);
  font-family: "Segoe UI", system-ui, sans-serif;
  font-size: 15px;
}

.shell {
  display: grid;
  grid-template-columns: 220px 1fr;
  grid-template-rows: auto auto minmax(0, 1fr);
  min-height: 100vh;
}

.banner {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 64px;
  padding: 0 22px 0 18px;
  background: #0e0e0e;
  border-bottom: 1px solid var(--hairline);
}

a.logo-link {
  display: flex;
  line-height: 0;
}

.logo {
  display: block;
  width: 132px;
  height: auto;
}

.home-mark {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.home-logo {
  display: block;
  width: min(680px, 78vw);
  height: auto;
}

.home-tag {
  margin: 22px 0 0;
  color: var(--ink);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.banner-end {
  display: flex;
  align-items: center;
  gap: 18px;
}

.banner-end form {
  display: flex;
  align-items: center;
  margin: 0;
}

.banner-end button.quiet {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 32px;
  margin: 0;
  padding: 0 12px;
  font-size: 13px;
  line-height: 1;
}

.clock {
  display: flex;
  align-items: center;
  height: 32px;
  gap: 12px;
}

.clock time {
  color: var(--ink);
  font-size: 15px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.03em;
}

.clock time,
.clock p {
  line-height: 1;
}

.clock p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.subnav {
  grid-column: 1 / -1;
  display: flex;
  align-items: stretch;
  gap: 2px;
  min-height: 42px;
  padding: 0 14px;
  background: #141414;
  border-bottom: 1px solid var(--hairline);
}

.subnav a {
  display: flex;
  align-items: center;
  padding: 0 14px;
  color: var(--muted);
  font-size: 13px;
  text-decoration: none;
  border-bottom: 2px solid transparent;
}

.subnav a:hover {
  color: var(--ink);
}

.subnav a.here {
  color: var(--ink);
  border-bottom-color: var(--accent);
}

.rail {
  grid-column: 1;
  display: flex;
  flex-direction: column;
  background: var(--rail);
  border-right: 1px solid #000;
  padding: 12px 16px 18px;
}

.rail-nav { margin-top: 4px; }

a.nav-button {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 1px 0;
  padding: 10px 12px 10px 14px;
  border-left: 3px solid transparent;
  border-radius: 8px;
  color: #c8c8c8;
  font-size: 13px;
  font-weight: 500;
  text-align: left;
  text-decoration: none;
}

a.nav-button.depth-2 { padding-left: 28px; }
a.nav-button.depth-3 { padding-left: 44px; }

.caret {
  width: 6px;
  height: 6px;
  margin-top: -1px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(-45deg);
  flex: none;
}

.branch.open > a.nav-button .caret {
  margin-top: 2px;
  transform: rotate(45deg);
}

.branch-children { display: none; }
.branch.open > .branch-children { display: block; }

a.nav-button:hover {
  background: #222;
  color: #f5f5f5;
}

a.nav-button.here {
  background: #2a2a2a;
  color: #f5f5f5;
  border-left-color: var(--accent);
  font-weight: 600;
}

.rail-space { flex: 1; }

a.rail-link {
  display: block;
  width: 100%;
  height: 36px;
  margin: 0 0 8px;
  padding: 0 14px;
  background: transparent;
  color: #c8c8c8;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  font-weight: 500;
  line-height: 34px;
  text-align: center;
  text-decoration: none;
}

a.rail-link:hover,
a.rail-link.here {
  background: #2a2a2a;
  color: var(--ink);
}

.work {
  grid-column: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 36px 24px;
}

.panel {
  width: min(420px, 100%);
  background: var(--panel);
  border: 1px solid var(--hairline);
  border-radius: 12px;
  padding: 28px 28px 24px;
}

.desk {
  width: min(640px, 100%);
}

h1 {
  margin: 0;
  font-size: 22px;
  font-weight: 600;
}

.lede {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

form { margin-top: 22px; }

label {
  display: block;
  margin: 14px 0 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

label.remember {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 16px 0 0;
  color: var(--ink);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}

label.remember input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--accent);
}

input[type="text"],
input[type="password"],
input:not([type]) {
  width: 100%;
  height: 40px;
  background: var(--field);
  color: var(--ink);
  border: 1px solid var(--hairline);
  border-radius: 8px;
  padding: 0 12px;
  font: inherit;
}

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

button {
  width: 100%;
  height: 40px;
  margin-top: 18px;
  background: var(--accent);
  color: #111;
  border: none;
  border-radius: 8px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

button:hover { background: #e6e6e6; }

button:focus-visible,
input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

button.quiet {
  width: auto;
  height: 36px;
  margin: 0;
  padding: 0 14px;
  background: transparent;
  color: #c8c8c8;
  border: 1px solid var(--hairline);
  font-weight: 500;
}

button.quiet:hover {
  background: #2a2a2a;
  color: var(--ink);
}

.error {
  margin: 14px 0 0;
  color: var(--error);
  font-size: 13px;
  line-height: 1.4;
}

.empty {
  margin-top: 22px;
  padding: 28px 22px;
  background: var(--panel);
  border: 1px solid var(--hairline);
  border-radius: 12px;
  color: var(--muted);
}

.work.work-top {
  align-items: flex-start;
  justify-content: flex-start;
}

.admin {
  width: min(880px, 100%);
  margin: 0 auto;
}

.admin h2 {
  margin: 28px 0 0;
  font-size: 16px;
  font-weight: 600;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: end;
  margin-top: 16px;
}

.filters label {
  margin: 0;
}

.filters select,
.filters input[type="date"] {
  display: block;
  width: 100%;
  min-width: 150px;
  height: 40px;
  margin-top: 6px;
  background: var(--field);
  color: var(--ink);
  border: 1px solid var(--hairline);
  border-radius: 8px;
  padding: 0 10px;
  font: inherit;
}

.filters button {
  width: auto;
  min-width: 110px;
  margin-top: 0;
}

.notice {
  margin: 12px 0 0;
  color: var(--accent);
  font-size: 13px;
}

.person {
  margin-top: 12px;
  padding: 16px 18px 18px;
  background: var(--panel);
  border: 1px solid var(--hairline);
  border-radius: 12px;
}

.person .role {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.person .lede { margin-top: 0; }

.person button { width: auto; min-width: 160px; padding: 0 16px; }

.person button.quiet { margin-top: 8px; }

.person select,
.time-form select {
  display: block;
  width: 100%;
  max-width: 280px;
  height: 40px;
  margin-top: 6px;
  background: var(--field);
  color: var(--ink);
  border: 1px solid var(--hairline);
  border-radius: 8px;
  padding: 0 10px;
  font: inherit;
}

.roster-wrap {
  margin-top: 12px;
  overflow-x: auto;
  border: 1px solid var(--hairline);
  border-radius: 12px;
  background: var(--panel);
}

.roster {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
}

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

.roster th {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.roster tr:last-child td { border-bottom: none; }

.remain-expired { color: var(--error); }

.row-actions details { margin-bottom: 8px; }

.row-actions summary {
  width: fit-content;
  padding: 6px 12px;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  color: #c8c8c8;
  cursor: pointer;
}

.row-actions summary:hover { color: var(--ink); background: #2a2a2a; }

.time-form {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: end;
  margin: 8px 0;
}

.time-label { margin: 0; }

.time-form select { min-width: 150px; margin-top: 6px; }

.time-form button,
.row-actions button {
  width: auto;
  min-width: 0;
  margin-top: 0;
  padding: 0 12px;
}

.log {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  max-height: 420px;
  overflow: auto;
  background: var(--panel);
  border: 1px solid var(--hairline);
  border-radius: 12px;
}

.log-row {
  display: grid;
  grid-template-columns: 168px 88px minmax(140px, 1fr) 120px minmax(120px, 1.2fr);
  gap: 10px;
  align-items: baseline;
  padding: 10px 14px;
  border-bottom: 1px solid var(--hairline);
  font-size: 13px;
}

.log-empty {
  padding: 22px 14px;
  color: var(--muted);
}

.log-area {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.log-user { color: var(--ink); }
.log-frontend { color: #b0b0b0; }
.log-backend { color: var(--error); }
.log-who, .log-detail { color: var(--muted); }

@media (max-width: 720px) {
  .shell { grid-template-columns: 1fr; }
  .banner,
  .subnav,
  .rail,
  .work { grid-column: 1; }
  .rail {
    border-right: none;
    border-bottom: 1px solid #000;
    padding-bottom: 14px;
  }
  .rail-space { display: none; }
  .banner { padding-right: 16px; }
  .work { align-items: flex-start; }
  .log-row { grid-template-columns: 1fr; gap: 2px; }
}
