:root {
  --bg: #f4efe6;
  --paper: #fffdf9;
  --ink: #241c16;
  --muted: #74685d;
  --line: #eadfce;
  --orange: #e25b12;
  --orange-soft: #fff1e6;
  --green: #1c7a46;
  --green-soft: #e7f6ee;
  --red: #c13b2a;
  --red-soft: #fdeceb;
  --today: #fff6cc;
  --shadow: 0 10px 30px rgba(60, 36, 12, 0.06);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font-family: "Avenir Next", "Segoe UI", "Helvetica Neue", sans-serif;
  font-size: 16px;
  line-height: 1.45;
}
a { color: inherit; text-decoration: none; }
table a { text-decoration: underline; text-underline-offset: 2px; }
button, input, select, textarea { font: inherit; color: inherit; }
.layout { display: flex; min-height: 100vh; }
.side {
  width: 240px;
  flex: none;
  background: #2b211b;
  color: #f6efe6;
  padding: 22px 16px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.brand { display: flex; gap: 10px; align-items: center; }
.mark {
  width: 36px; height: 36px; border-radius: 10px;
  background: var(--orange); color: white;
  display: grid; place-items: center; font-weight: 700;
}
.brand b { display: block; letter-spacing: 0.04em; }
.brand span, .muted, .side .who small { color: var(--muted); }
.side .who small, .side .data-note { color: #cbbbaa; }
nav { display: flex; flex-direction: column; gap: 4px; }
nav a {
  text-decoration: none;
  padding: 8px 10px;
  border-radius: 8px;
}
nav a:hover, nav a.on { background: rgba(255,255,255,0.08); }
.field { display: block; margin: 10px 0; }
.side form select, .field input, .field select, .field textarea, .search input,
form[data-autosave] select, form[data-autosave] textarea {
  width: 100%;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
}
.side form select { background: #3a2e26; color: white; border-color: #5a463a; }
.main { flex: 1; padding: 28px 32px 48px; min-width: 0; }
.banner {
  background: var(--orange);
  color: white;
  border-radius: 12px;
  padding: 12px 16px;
  margin-bottom: 18px;
}
.banner a { color: white; }
h1 { font-size: 32px; line-height: 1.1; margin: 0 0 8px; font-weight: 650; }
h2 { font-size: 20px; margin: 28px 0 10px; }
.lead { color: var(--muted); margin-top: 0; }
.hero, .stats, .cards, .split { display: grid; gap: 14px; }
.hero { grid-template-columns: minmax(220px, 280px) minmax(0, 1fr); align-items: stretch; }
.hero > *, .stats, .card { min-width: 0; }
.stats { grid-template-columns: repeat(auto-fit, minmax(148px, 1fr)); }
.cards { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.card, .panel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 16px 18px;
}
.kicker { margin: 0; color: var(--muted); font-size: 13px; text-transform: uppercase; letter-spacing: 0.06em; }
.big { font-size: 40px; margin: 6px 0; font-variant-numeric: tabular-nums; letter-spacing: -0.03em; }
.stat b { display: block; font-size: 26px; font-variant-numeric: tabular-nums; }
.ok { color: var(--green); }
.miss, .bad { color: var(--red); }
.calendar { display: grid; gap: 8px; min-width: 0; }
.week, .dow { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.dow span { color: var(--muted); font-size: 13px; padding-left: 6px; }
.day {
  min-width: 0;
  min-height: 108px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 8px;
  font-size: 12px;
  overflow-wrap: anywhere;
}
.day strong { font-size: 16px; }
.day.ok { background: var(--green-soft); }
.day.miss { background: var(--red-soft); }
.day.today, .day.is-today { outline: 2px solid var(--orange); }
.day.future, .day.closed, .day.empty { background: transparent; color: var(--muted); }
.day .who { margin-top: 6px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: 13px; }
tr.me { background: var(--orange-soft); }
.msg { display: flex; gap: 10px; align-items: flex-start; }
.msg p { margin: 0; }
button, .btn {
  background: var(--orange);
  color: white;
  border: 0;
  border-radius: 8px;
  padding: 8px 12px;
  text-decoration: none;
  cursor: pointer;
  display: inline-block;
}
button.ghost, .btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.search { display: flex; gap: 8px; }
.search input { flex: 1; }
.pager { display: flex; gap: 8px; align-items: center; margin-top: 12px; }
.save-note { color: var(--green); font-size: 13px; }
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login { width: min(420px, 100%); }
.login h1 { margin-top: 14px; }
.error { color: var(--red); }
.check { margin: 0 0 14px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.check ul { margin: 6px 0 0; padding-left: 18px; }
.rule { color: var(--muted); font-size: 14px; }
@media (max-width: 1180px) {
  .hero { grid-template-columns: 1fr; }
}
@media (max-width: 980px) {
  .layout { display: block; }
  .side { width: auto; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .main { padding: 18px; }
}
