:root {
  color-scheme: dark;
  --navy: #101a33;
  --navy-card: #182545;
  --gold: #cda05a;
  --gold-light: #e4c384;
  --cream: #f7f1e3;
  --text-dim: rgba(255, 255, 255, 0.55);
  --text-dim-strong: rgba(255, 255, 255, 0.7);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Manrope', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--navy);
  color: #ffffff;
}

h1, h2, h3 {
  font-family: 'Sora', 'Manrope', sans-serif;
  margin: 0;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 22px 12px;
  background: var(--navy);
  position: sticky;
  top: 0;
  z-index: 5;
}

.topbar__brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar__icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--navy-card);
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
}

.topbar__icon-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--gold);
}

.topbar__title {
  font-family: 'Sora', sans-serif;
  font-weight: 700;
  font-size: 17px;
}

.topbar__user {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-dim);
}

.tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 0 16px 14px;
  background: var(--navy);
  position: sticky;
  top: 58px;
  z-index: 5;
}

.tab {
  flex: 1 0 auto;
  border: none;
  background: transparent;
  padding: 10px 4px;
  border-radius: 14px;
  font-family: 'Manrope', sans-serif;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-dim);
  cursor: pointer;
}

.tab.active {
  background: var(--gold);
  color: var(--navy);
}

#content {
  padding: 0 22px 32px;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.card {
  background: var(--cream);
  color: var(--navy);
  border-radius: 24px;
  padding: 22px;
  margin-bottom: 12px;
}

.status-line {
  font-family: 'Manrope', sans-serif;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.5;
  color: rgba(16, 26, 51, 0.7);
  margin-bottom: 14px;
  padding-top: 18px;
  border-top: 1px solid rgba(16, 26, 51, 0.1);
}

.status-line--warning {
  color: #b3261e;
  font-weight: 700;
}

.section-title {
  font-family: 'Manrope', sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dim);
  margin: 18px 0 10px;
}

.btn[hidden] {
  display: none;
}

.btn {
  display: inline-block;
  border: none;
  border-radius: 16px;
  padding: 15px 16px;
  font-family: 'Sora', sans-serif;
  font-size: 15px;
  font-weight: 700;
  margin-right: 8px;
  margin-top: 4px;
  cursor: pointer;
  background: var(--navy-card);
  color: #ffffff;
}

.btn-primary {
  background: var(--gold);
  color: var(--navy);
  width: 100%;
  margin-right: 0;
}

.btn-danger {
  background: #b3261e;
  color: #ffffff;
}

.month-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 14px 0 16px;
}

.month-nav span {
  font-family: 'Sora', sans-serif;
  font-weight: 700;
  font-size: 15px;
}

.month-nav button {
  width: 34px;
  height: 34px;
  border: none;
  background: var(--navy-card);
  color: var(--gold);
  border-radius: 12px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}

.picker {
  margin-bottom: 12px;
  position: sticky;
  top: 104px; /* запасное значение, реальное выставляется в JS под фактическую высоту шапки+табов */
  z-index: 4;
  background: var(--navy);
  padding-top: 4px;
  padding-bottom: 4px;
}

.picker select {
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: none;
  background: var(--navy-card);
  color: #ffffff;
  font-family: 'Manrope', sans-serif;
  font-weight: 600;
  font-size: 13px;
}

.list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.row {
  background: var(--navy-card);
  border-radius: 16px;
  padding: 14px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.row.weekend {
  opacity: 0.75;
}

.row__label {
  font-family: 'Manrope', sans-serif;
  font-size: 13px;
  font-weight: 600;
}

.row__label small {
  display: inline;
  opacity: 0.6;
  font-weight: 500;
  font-size: 12px;
  margin-left: 4px;
}

.row__value {
  font-family: 'Manrope', sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-dim);
  text-align: right;
}

.row.clickable {
  cursor: pointer;
}

/* ---- Schedule day card: заголовок дня + список людей внутри ---- */

.day-card {
  background: var(--navy-card);
  border-radius: 16px;
  padding: 14px 16px;
}

.day-card.weekend {
  opacity: 0.75;
}

.day-card.clickable {
  cursor: pointer;
}

.day-card__header {
  display: flex;
  gap: 10px;
  align-items: baseline;
  margin-bottom: 8px;
}

.day-card__date {
  font-family: 'Sora', sans-serif;
  font-weight: 700;
  font-size: 15px;
}

.day-card__weekday {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-dim);
}

.day-card__empty {
  font-size: 12.5px;
  color: var(--text-dim);
}

.person-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
}

.person-row--selected {
  border-radius: 8px;
  margin: 0 -6px;
  padding: 6px;
  background: rgba(205, 160, 90, 0.12);
}

.person-row__dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--dot-color, var(--gold));
  flex: none;
}

.person-row__name {
  font-family: 'Manrope', sans-serif;
  font-size: 12.5px;
  font-weight: 600;
}

.person-row__time {
  font-family: 'Manrope', sans-serif;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-dim);
  margin-left: auto;
}

.color-input {
  width: 36px;
  height: 32px;
  padding: 2px;
  border-radius: 8px;
  border: none;
  background: var(--navy);
  cursor: pointer;
}

.staff-row {
  background: var(--navy-card);
  border-radius: 18px;
  padding: 16px;
}

.staff-row .name {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: 'Sora', sans-serif;
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 12px;
}

.staff-row .name::before {
  content: "";
  width: 26px;
  height: 26px;
  border-radius: 9px;
  background: var(--avatar-color, var(--gold));
  flex: none;
}

.staff-row .fields {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.staff-row select,
.staff-row input[type="number"] {
  padding: 9px 12px;
  border-radius: 10px;
  border: none;
  background: var(--navy);
  color: #ffffff;
  font-family: 'Manrope', sans-serif;
  font-weight: 600;
  font-size: 12.5px;
}

.staff-row input[type="number"] {
  width: 70px;
  text-align: center;
}

.staff-row .btn {
  margin-top: 8px;
}

/* ---- Тумблер "активен" (визуальный рестайл чекбокса, логика не меняется) ---- */

.toggle {
  position: relative;
  display: inline-flex;
  width: 34px;
  height: 22px;
  flex: none;
  cursor: pointer;
}

.toggle input {
  position: absolute;
  inset: 0;
  opacity: 0;
  margin: 0;
  cursor: pointer;
}

.toggle-track {
  position: absolute;
  inset: 0;
  background: var(--navy);
  border-radius: 11px;
  transition: background 0.15s;
}

.toggle-track::before {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #ffffff;
  transition: transform 0.15s;
}

.toggle input:checked + .toggle-track {
  background: var(--gold);
}

.toggle input:checked + .toggle-track::before {
  transform: translateX(12px);
  background: var(--navy);
}

.payroll-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
}

.payroll-summary .name {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: 'Manrope', sans-serif;
  font-weight: 600;
  font-size: 14px;
}

.payroll-summary .name::before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--dot-color, var(--gold));
  flex: none;
}

.payroll-summary .amount {
  font-family: 'Sora', sans-serif;
  font-weight: 700;
  font-size: 14px;
  color: var(--gold-light);
}

.payroll-shifts {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 12px;
  color: var(--text-dim);
  display: none;
}

.payroll-shifts.open {
  display: block;
}

.payroll-shifts div {
  display: flex;
  justify-content: space-between;
  padding: 3px 0;
}

.payroll-shifts div.clickable {
  cursor: pointer;
  text-decoration: underline dotted;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: flex-end;
  z-index: 20;
}

.modal-backdrop[hidden] {
  display: none;
}

.modal {
  background: var(--navy-card);
  color: #ffffff;
  width: 100%;
  border-radius: 20px 20px 0 0;
  padding: 20px;
}

.modal h3 {
  font-family: 'Sora', sans-serif;
  font-weight: 700;
  font-size: 16px;
  margin-bottom: 4px;
}

.modal label {
  display: block;
  font-family: 'Manrope', sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-dim);
  margin-bottom: 10px;
}

.modal input {
  display: block;
  width: 100%;
  padding: 10px 12px;
  margin-top: 4px;
  border-radius: 10px;
  border: none;
  background: var(--navy);
  color: #ffffff;
  font-family: 'Manrope', sans-serif;
  font-size: 14px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px;
}

.empty {
  text-align: center;
  color: var(--text-dim);
  padding: 24px 0;
  font-size: 14px;
}
