:root {
  color-scheme: dark;
  --bg: #10100f;
  --panel: #191815;
  --text: #eee8dd;
  --muted: #a79f92;
  --gold: #c8a75d;
  --green: #6fc06a;
  --red: #e05b52;
  --line: #302d27;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: radial-gradient(circle at top, #242019, #10100f 42rem);
  color: var(--text);
  font: 16px/1.5 system-ui, Segoe UI, Roboto, Arial, sans-serif;
  letter-spacing: 0;
}
a { color: var(--text); }
main { width: min(1100px, 92vw); margin: 32px auto 80px; }
.top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px min(4vw, 42px);
  border-bottom: 1px solid var(--line);
  background: #11100ed9;
  position: sticky;
  top: 0;
  backdrop-filter: blur(12px);
  z-index: 3;
}
.brand { display: flex; gap: 10px; align-items: center; text-decoration: none; font-weight: 800; }
.brand img { width: 38px; height: 38px; }
.top nav { display: flex; gap: 16px; align-items: center; }
.top form { display: inline; }
.top button, .linkbtn, .primary {
  border: 1px solid var(--gold);
  background: #211f1a;
  color: var(--text);
  padding: 10px 14px;
  border-radius: 6px;
  text-decoration: none;
  cursor: pointer;
}
.danger {
  border: 1px solid var(--red);
  background: #2a1513;
  color: #ffd6d2;
  padding: 8px 10px;
  border-radius: 6px;
  cursor: pointer;
}
.actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin: 0 0 16px; }
.actions form, td form { margin: 0; }
.month-filter { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin: 20px 0; }
.month-filter label { margin: 0; }
.month-filter > a:first-child, .month-filter > a[aria-label] { padding: 12px; font-size: 24px; text-decoration: none; }
.month-archive { margin-top: 32px; }
.report h1 { font-size: 28px; overflow-wrap: anywhere; }
.period-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.period-metrics b, .report .metrics b { font-size: 22px; overflow-wrap: anywhere; }
.primary { background: linear-gradient(180deg, #3d3320, #211f1a); font-weight: 800; }
.auth {
  max-width: 430px;
  margin: 10vh auto;
  padding: 28px;
  background: #171612;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.auth h1 { font-size: 42px; margin-top: 0; }
.gridform, label { display: grid; gap: 8px; margin: 12px 0; }
input, select {
  width: 100%;
  border: 1px solid var(--line);
  background: #0d0d0c;
  color: var(--text);
  padding: 12px;
  border-radius: 6px;
}
.dash { display: flex; justify-content: space-between; gap: 24px; align-items: end; }
.dash h1 { font-size: clamp(30px, 6vw, 64px); margin: .2em 0; }
.muted { color: var(--muted); }
.shiftline { color: var(--gold); margin: 10px 0 0; }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin: 24px 0; }
.metrics article { background: #171612; border: 1px solid var(--line); border-radius: 8px; padding: 18px; color: var(--muted); }
.metrics b { display: block; color: var(--text); font-size: 30px; margin-top: 8px; }
.center { display: grid; place-items: center; margin: 38px 0; }

.coffin {
  position: relative;
  width: min(70vw, 300px);
  height: 310px;
  border: 0;
  color: var(--green);
  background:
    linear-gradient(145deg, rgba(255,255,255,.07), rgba(0,0,0,0) 32%),
    linear-gradient(180deg, #27231d 0%, #151411 58%, #090908 100%);
  clip-path: polygon(34% 0, 66% 0, 89% 18%, 75% 100%, 25% 100%, 11% 18%);
  display: grid;
  place-content: center;
  gap: 8px;
  text-align: center;
  filter: drop-shadow(0 0 26px color-mix(in srgb, currentColor 54%, transparent));
  transition: transform .18s, filter .18s;
  cursor: pointer;
  isolation: isolate;
}
.coffin::before {
  content: "";
  position: absolute;
  inset: 8px;
  clip-path: polygon(34% 0, 66% 0, 89% 18%, 75% 100%, 25% 100%, 11% 18%);
  border: 4px solid currentColor;
  background:
    linear-gradient(90deg, transparent 0 48%, color-mix(in srgb, var(--gold) 48%, transparent) 48% 52%, transparent 52%),
    linear-gradient(180deg, transparent 0 19%, color-mix(in srgb, var(--gold) 58%, transparent) 19% 21%, transparent 21% 78%, color-mix(in srgb, var(--gold) 38%, transparent) 78% 80%, transparent 80%);
  z-index: -1;
}
.coffin::after {
  content: "";
  position: absolute;
  width: 92px;
  height: 142px;
  left: 50%;
  top: 46px;
  transform: translateX(-50%);
  opacity: .62;
  background:
    linear-gradient(currentColor, currentColor) center top / 18px 138px no-repeat,
    linear-gradient(currentColor, currentColor) center 42px / 82px 17px no-repeat;
  filter: drop-shadow(0 2px 0 #000);
  z-index: -1;
}
.coffin:hover { transform: translateY(-3px) scale(1.01); }
.coffin:active { transform: scale(.98); }
.coffin b { font-size: 62px; line-height: 1; text-shadow: 0 3px 0 #000, 0 0 18px #000; }
.coffin span { text-transform: uppercase; color: var(--text); text-shadow: 0 2px 0 #000; }
.coffin.stop { color: var(--red); animation: pulse 1.8s infinite; }
.coffin:disabled { opacity: .45; cursor: not-allowed; }

@keyframes pulse {
  0%, 100% { filter: drop-shadow(0 0 18px rgba(224,91,82,.42)); }
  50% { filter: drop-shadow(0 0 36px rgba(224,91,82,.78)); }
}
table { width: 100%; border-collapse: collapse; background: #151411; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
th, td { text-align: left; padding: 12px; border-bottom: 1px solid var(--line); }
th { color: var(--gold); font-size: 13px; text-transform: uppercase; }
.alert { border: 1px solid var(--red); padding: 12px; border-radius: 6px; color: #ffd6d2; }
.install {
  margin: 26px auto 0;
  max-width: 640px;
  text-align: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: #151411;
}
.install h2 { margin: 0 0 6px; font-size: 20px; }
.install button { margin: 8px 0; }
.offline { color: #ffd6d2; }
footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 10px;
  text-align: center;
  background: #10100f;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}
@media (max-width: 760px) {
  .top, .dash { align-items: flex-start; flex-direction: column; }
  .top nav { flex-wrap: wrap; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .period-metrics { grid-template-columns: 1fr; }
  .coffin { height: 250px; }
  .coffin::after { top: 38px; transform: translateX(-50%) scale(.82); }
  .coffin b { font-size: 46px; }
  table { font-size: 14px; display: block; overflow: auto; }
}
@media print {
  .month-filter, .month-archive { display: none; }
  .top, footer, button { display: none; }
  body { background: white; color: black; }
  main { width: auto; }
  .report table { color: black; }
}
