:root {
  color-scheme: dark;
  --bg: #000;
  --panel: #1c1c1e;
  --card: #1c1c1e;
  --raised: #2c2c2e;
  --text: #f5f5f7;
  --muted: #8e8e93;
  --accent: #0a84ff;
  --accent-text: #fff;
  --line: #38383a;
  --danger: #ff453a;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

body {
  min-height: 100vh;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

button, input, textarea { font: inherit; }
button { color: inherit; -webkit-tap-highlight-color: transparent; }

.shell {
  width: min(100%, 600px);
  min-height: 100vh;
  margin: 0 auto;
  padding: max(10px, env(safe-area-inset-top)) 16px calc(88px + env(safe-area-inset-bottom));
}

.topbar {
  display: flex;
  min-height: 48px;
  align-items: center;
  gap: 11px;
  padding: 3px 4px 15px;
}

.brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 11px;
  background: var(--accent);
  color: #fff;
  font-size: 18px;
  font-weight: 800;
}

.eyebrow {
  color: var(--muted);
  font-size: 9px;
  font-weight: 750;
  letter-spacing: .12em;
}

.brand-title { margin-top: 2px; font-size: 16px; font-weight: 700; }

.avatar {
  display: grid;
  width: 34px;
  height: 34px;
  margin-left: auto;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--raised);
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
}

.content { display: grid; gap: 13px; }
.loading-card, .card {
  border: 1px solid #2c2c2e;
  border-radius: 19px;
  background: var(--panel);
}
.loading-card { padding: 22px; color: var(--muted); }
.card { padding: 17px; }

.hero-card {
  padding: 21px 18px 18px;
  background: linear-gradient(145deg, #202023, #171719 78%);
}

.hero-date { color: var(--muted); font-size: 13px; }
.hero-name { margin-top: 5px; font-size: 23px; font-weight: 760; letter-spacing: -.025em; }
.hero-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 19px; }
.stat {
  min-width: 0;
  padding: 12px;
  border: 1px solid #38383a;
  border-radius: 14px;
  background: #252527;
}
.stat-label { color: var(--muted); font-size: 10px; font-weight: 750; letter-spacing: .06em; }
.stat-value { margin-top: 6px; font-size: 13px; font-weight: 650; overflow-wrap: anywhere; }

.section-head { display: flex; align-items: end; justify-content: space-between; gap: 12px; }
.section-title { font-size: 18px; font-weight: 750; letter-spacing: -.02em; }
.section-subtitle { margin-top: 4px; color: var(--muted); font-size: 12px; line-height: 1.4; }
.section-icon { color: var(--muted); font-size: 19px; }

.actions { display: grid; gap: 9px; }
.action-button, .primary-button, .secondary-button, .danger-button, .date-button, .shift-button, .employee-button {
  width: 100%;
  border: 0;
  cursor: pointer;
  text-align: left;
  -webkit-tap-highlight-color: transparent;
  transition: background .12s ease, transform .12s ease;
}
button:active { transform: scale(.985); }

.action-button {
  display: flex;
  min-height: 54px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px 10px 15px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--raised);
  font-size: 14px;
  font-weight: 650;
}
.action-icon {
  display: grid;
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 11px;
  background: #343438;
  color: var(--accent);
  font-size: 17px;
}

.primary-button, .secondary-button, .danger-button {
  display: flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  padding: 12px 15px;
  border-radius: 13px;
  font-weight: 700;
  text-align: center;
}
.primary-button { background: var(--accent); color: var(--accent-text); }
.secondary-button { border: 1px solid var(--line); background: var(--raised); color: var(--text); }
.danger-button { border: 1px solid #5b2929; background: #301c1d; color: var(--danger); }

.date-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px; }
.date-button {
  display: flex;
  min-height: 55px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 7px 3px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--raised);
  text-align: center;
  font-size: 11px;
  font-weight: 700;
}
.date-button.active { border-color: var(--accent); background: #142a40; color: #64b5ff; }
.date-shift { max-width: 100%; overflow: hidden; color: var(--muted); font-size: 9px; font-weight: 550; text-overflow: ellipsis; white-space: nowrap; }

.shift-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.shift-button {
  display: block;
  min-height: 62px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--raised);
}
.shift-button.selected { border-color: var(--accent); background: #142a40; }
.shift-name { font-size: 13px; font-weight: 750; }
.shift-hours { margin-top: 5px; color: var(--muted); font-size: 10px; }

.employee-list {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: #222224;
}
.employee-button {
  display: flex;
  min-height: 66px;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  text-align: left;
}
.employee-list > .employee-button:last-child { border-bottom: 0; }
.employee-list > button.employee-button:active { background: #303034; }
.employee-avatar {
  display: grid;
  width: 37px;
  height: 37px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  background: #353538;
  color: #d9d9de;
  font-size: 13px;
  font-weight: 750;
}
.employee-main { min-width: 0; flex: 1; }
.employee-name { overflow: hidden; font-size: 13px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.employee-detail { margin-top: 3px; color: var(--muted); font-size: 11px; line-height: 1.35; overflow-wrap: anywhere; }

.form-stack { display: grid; gap: 11px; }
.field-label { display: block; margin-bottom: 7px; color: var(--muted); font-size: 12px; font-weight: 650; }
.input, .textarea {
  width: 100%;
  min-height: 47px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  outline: none;
  background: #2c2c2e;
  color: var(--text);
}
.textarea { min-height: 88px; resize: vertical; }
.input:focus, .textarea:focus { border-color: var(--accent); }
.hint { color: var(--muted); font-size: 11px; line-height: 1.45; }
.empty { padding: 20px 10px; color: var(--muted); text-align: center; font-size: 12px; }
.back-row { display: grid; grid-template-columns: 1fr; margin-top: 3px; }

.bottom-nav {
  position: fixed;
  z-index: 5;
  right: 0;
  bottom: 0;
  left: 0;
  display: flex;
  justify-content: center;
  gap: 3px;
  padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
  border-top: 1px solid #2b2b2d;
  background: rgba(20, 20, 22, .96);
  backdrop-filter: blur(18px);
}
.nav-button {
  display: grid;
  min-width: 70px;
  min-height: 47px;
  place-items: center;
  gap: 2px;
  padding: 4px 10px;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: var(--muted);
  font-size: 10px;
  font-weight: 650;
}
.nav-button.active { color: #4da3ff; }
.nav-icon { font-size: 17px; line-height: 1; }

.toast {
  position: fixed;
  z-index: 10;
  right: 18px;
  bottom: calc(78px + env(safe-area-inset-bottom));
  left: 18px;
  max-width: 560px;
  margin: auto;
  padding: 12px 15px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #29292c;
  box-shadow: 0 8px 26px #0008;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: .18s ease;
  text-align: center;
  font-size: 12px;
  font-weight: 650;
}
.toast.show { opacity: 1; transform: translateY(0); }
.error-card { border-color: #673638; color: var(--danger); }

@media (min-width: 560px) {
  .shell { padding-right: 22px; padding-left: 22px; }
}
