:root {
  --bg: #0b0f14;
  --text: #f3f5f7;
  --hint: rgba(243, 245, 247, 0.72);
  --btn: var(--tg-theme-button-color, #2f7fc1);
  --btn-text: var(--tg-theme-button-text-color, #fff);
  --sec: rgba(255, 255, 255, 0.08);
  --bad: #ff6b6b;
  --line: rgba(255, 255, 255, 0.14);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Noto Sans SC", sans-serif;
  font-size: 16px;
  color: var(--text);
  background: var(--bg);
  text-align: center;
}
#app { max-width: 480px; margin: 0 auto; padding: 12px 16px 48px; }
.view { display: flex; flex-direction: column; align-items: center; }
.view > * { width: 100%; }
.hidden { display: none !important; }
.heading { font-size: 1.25rem; font-weight: 700; margin: 8px 0 12px; text-align: center; }
.muted { color: var(--hint); font-size: 0.9rem; text-align: center; }
.error {
  background: rgba(255, 107, 107, 0.15);
  border: 1px solid rgba(255, 107, 107, 0.45);
  color: #ffb4b4;
  padding: 10px 12px;
  border-radius: 10px;
  margin-bottom: 12px;
}
.home-nav { display: grid; gap: 10px; margin-top: 20px; }
.nav-btn, .primary, .secondary, .danger, .secondary-block {
  border: 0;
  border-radius: 12px;
  padding: 12px 14px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.nav-btn, .primary { background: var(--btn); color: var(--btn-text); width: 100%; }
.secondary, .secondary-block { background: var(--sec); color: var(--text); }
.secondary-block { width: 100%; margin-bottom: 12px; }
.danger { background: rgba(255, 107, 107, 0.2); color: #ffb4b4; }
.card {
  background: var(--sec);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  margin: 8px 0;
  text-align: center;
}
.card .title { font-weight: 600; }
.card .meta { color: var(--hint); font-size: 0.85rem; margin-top: 4px; }
.card .actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; justify-content: center; }
.row-form, .col-form { display: grid; gap: 8px; margin-bottom: 12px; justify-items: center; }
.row-form { grid-template-columns: 1fr; }
.row-form .primary { width: 100%; }
.col-form input, .col-form select, .row-form input,
input, select, textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(0,0,0,0.25);
  color: var(--text);
  font: inherit;
}
textarea {
  resize: none;
  height: 110px;
  text-align: left;
  line-height: 1.4;
}
.bulk-form { display: grid; gap: 8px; margin: 8px 0 16px; width: 100%; }
.duty-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  width: 100%;
}
.duty-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--sec);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 6px;
  margin: 0;
  cursor: pointer;
  min-width: 0;
}
.duty-row input { width: 18px; height: 18px; flex-shrink: 0; accent-color: var(--btn); cursor: pointer; }
.duty-row .title {
  font-weight: 600;
  font-size: 0.85rem;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
