:root {
  --bg: #14161a;
  --card: #1e222a;
  --line: #2e3440;
  --text: #e8eaed;
  --muted: #9aa3b2;
  --accent: #4caf7d;
  --danger: #e05a5a;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
}

.hidden { display: none !important; }

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}

header h1 { font-size: 1.1rem; margin: 0; }
.header-actions { display: flex; gap: 8px; }

.tabs {
  display: flex;
  gap: 4px;
  padding: 8px 12px;
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
}

.tabs button {
  background: none;
  border: none;
  color: var(--muted);
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 0.95rem;
  white-space: nowrap;
  cursor: pointer;
}

.tabs button.active { background: var(--card); color: var(--text); }

main { padding: 12px; max-width: 900px; margin: 0 auto; }

.tab { display: none; }
.tab.active { display: block; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 12px;
}

.card h2 { margin: 0 0 12px; font-size: 1rem; }

.grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }

label { display: block; font-size: 0.85rem; color: var(--muted); margin-bottom: 10px; }

input, select {
  display: block;
  width: 100%;
  margin-top: 4px;
  padding: 9px 10px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #171a20;
  color: var(--text);
  font-size: 1rem;
}

button {
  background: var(--accent);
  color: #0d1117;
  border: none;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
}

button:disabled { opacity: 0.5; cursor: not-allowed; }
button.danger { background: var(--danger); color: #fff; }
button.ghost { background: transparent; color: var(--muted); border: 1px solid var(--line); }
button.small { padding: 6px 10px; font-size: 0.85rem; }

.row-form { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); align-items: end; }
.row-form button { height: 40px; }

.days { border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; grid-column: 1 / -1; }
.days legend { font-size: 0.8rem; color: var(--muted); }
#day-checks { display: flex; flex-wrap: wrap; gap: 10px; }
#day-checks label { display: flex; align-items: center; gap: 4px; margin: 0; color: var(--text); }
#day-checks input { width: auto; margin: 0; }

table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-weight: 500; }

.list { list-style: none; margin: 0; padding: 0; }
.list li { padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 0.9rem; }

.muted { color: var(--muted); font-size: 0.85rem; }
.error { color: var(--danger); font-size: 0.85rem; min-height: 1em; }
.ok { color: var(--accent); }

.badge { font-size: 0.75rem; padding: 2px 8px; border-radius: 999px; background: var(--line); color: var(--muted); }
.badge.busy { background: var(--accent); color: #0d1117; }

.progress { height: 6px; background: var(--line); border-radius: 999px; overflow: hidden; margin: 8px 0; }
.progress div { height: 100%; background: var(--accent); }

.quick { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }

.camera-wrap { margin-top: 12px; }
.camera-wrap img { width: 100%; border-radius: 8px; background: #000; }

.login { display: flex; min-height: 100vh; align-items: center; justify-content: center; padding: 16px; }
.login .card { width: 100%; max-width: 340px; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  background: var(--card);
  border: 1px solid var(--line);
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 0.9rem;
  z-index: 10;
}
