:root {
  --ink: #1c1915;
  --muted: #6d655b;
  --paper: #f4f0e7;
  --panel: #fffdf8;
  --line: #e3d9c8;
  --amber: #c65a12;
  --amber-deep: #8d3d0c;
  --green: #1f6b45;
  --green-soft: #e5f4eb;
  --red: #8d2d2d;
  --red-soft: #f8e8e4;
  --shadow: 0 12px 40px rgba(28, 25, 21, 0.08);
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, p { margin: 0; }

.shell { display: grid; min-height: 100vh; grid-template-columns: 240px 1fr; }
.nav {
  background: var(--ink);
  color: #f6f1e8;
  padding: 28px 18px 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.brand { display: flex; gap: 12px; align-items: center; }
.brand img { width: 42px; height: 42px; }
.brand strong { display: block; font-size: 18px; letter-spacing: 0.04em; }
.brand span { color: #c8bfb2; font-size: 13px; }
.nav button {
  background: transparent;
  border: 0;
  color: inherit;
  text-align: left;
  padding: 12px 12px;
  border-radius: 10px;
}
.nav button.active, .nav button:hover { background: rgba(255, 255, 255, 0.08); }
.nav .spacer { flex: 1; }
.who { font-size: 13px; color: #c8bfb2; }
.who strong { color: white; display: block; }

.main { padding: 28px 28px 96px; max-width: 1100px; }
.top { display: flex; justify-content: space-between; gap: 16px; align-items: end; margin-bottom: 22px; }
.kicker { color: var(--muted); font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; }
h1 { font-size: 34px; line-height: 1.1; margin-top: 4px; }
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px;
  box-shadow: var(--shadow);
}
.stack { display: grid; gap: 14px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.muted { color: var(--muted); }
.banner {
  border-radius: 14px;
  padding: 12px 14px;
  background: #fff4e8;
  border: 1px solid #f0d2b4;
}
.banner.bad { background: var(--red-soft); border-color: #efc7c0; }
.banner.good { background: var(--green-soft); border-color: #b7dfc6; }

.clock-button {
  width: 100%;
  min-height: 112px;
  border: 0;
  border-radius: 22px;
  background: var(--amber);
  color: white;
  font-size: 32px;
  font-weight: 700;
}
.clock-button.out { background: var(--green); }
.clock-button:disabled { opacity: 0.6; }

label { display: grid; gap: 6px; font-size: 14px; }
input, select, textarea {
  border: 1px solid var(--line);
  background: white;
  border-radius: 10px;
  padding: 12px;
  width: 100%;
}
textarea { min-height: 80px; }
.actions button, .inline-button {
  background: var(--ink);
  color: white;
  border: 0;
  border-radius: 10px;
  padding: 12px 16px;
}
.inline-button.secondary { background: transparent; color: var(--ink); border: 1px solid var(--line); }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }

.cards { display: grid; gap: 12px; }
.card {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  background: white;
  text-align: left;
  width: 100%;
}
.card strong { display: block; font-size: 18px; }
.pill {
  display: inline-block;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 12px;
  background: #f3ecdf;
}
.pill.warn { background: #f8e8e4; color: var(--red); }
.pill.ok { background: var(--green-soft); color: var(--green); }

.login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.login .panel { width: min(460px, 100%); }
.login h1 { font-size: 40px; }

.bottom-nav { display: none; }
.empty { padding: 18px; color: var(--muted); }

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .nav { display: none; }
  .main { padding: 20px 16px 120px; }
  h1 { font-size: 28px; }
  .grid-2 { grid-template-columns: 1fr; }
  .bottom-nav {
    display: flex;
    position: fixed;
    left: 0; right: 0; bottom: 0;
    background: var(--ink);
    color: white;
    padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
    gap: 4px;
  }
  .bottom-nav button {
    flex: 1;
    background: transparent;
    color: white;
    border: 0;
    border-radius: 12px;
    padding: 10px 4px;
    font-size: 13px;
  }
  .bottom-nav button.active { background: rgba(255,255,255,0.12); }
}
