:root {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --border: #e4e6eb;
  --text: #1c1e21;
  --text-muted: #6b7280;
  --accent: #4f5bd5;
  --accent-hover: #3f4ab8;
  --danger: #d64545;
  --radius: 10px;
  --sidebar-w: 240px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
}

.layout {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 20px 0;
  display: flex;
  flex-direction: column;
}

.sidebar__brand {
  font-weight: 600;
  font-size: 15px;
  padding: 0 20px 20px 20px;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  margin-bottom: 12px;
}

.sidebar__nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 10px;
}

.sidebar__item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  text-decoration: none;
  color: var(--text-muted);
  font-weight: 500;
  transition: background 0.15s ease, color 0.15s ease;
}

.sidebar__item:hover {
  background: var(--bg);
  color: var(--text);
}

.sidebar__item--active {
  background: rgba(79, 91, 213, 0.1);
  color: var(--accent);
}

.sidebar__icon {
  font-size: 11px;
}

/* Content */
.content {
  flex: 1;
  padding: 32px 40px;
  max-width: 1100px;
}

.tab__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.tab__title {
  font-size: 22px;
  font-weight: 600;
  margin: 0;
}

/* Buttons */
.btn {
  border: none;
  border-radius: 8px;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s ease, opacity 0.15s ease;
}

.btn--primary {
  background: var(--accent);
  color: #fff;
}
.btn--primary:hover { background: var(--accent-hover); }
.btn--primary:disabled { opacity: 0.6; cursor: default; }

.btn--ghost {
  background: transparent;
  color: var(--text-muted);
}
.btn--ghost:hover { background: var(--bg); color: var(--text); }

/* Newbies list */
.newbies-list {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.newbie-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.1s ease;
}
.newbie-row:last-child { border-bottom: none; }
.newbie-row:hover { background: var(--bg); }

.newbie-row__name {
  font-weight: 500;
}

.newbie-row__phone {
  color: var(--text-muted);
  font-size: 14px;
}

.newbie-row__date {
  color: var(--text-muted);
  font-size: 13px;
}

/* Empty state */
.empty-state {
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 60px 20px;
  text-align: center;
}

.empty-state__icon { font-size: 28px; margin-bottom: 10px; }
.empty-state__title { font-weight: 600; margin: 0 0 4px 0; }
.empty-state__subtitle { color: var(--text-muted); margin: 0; font-size: 14px; }

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

/* Без этого правила атрибут hidden не скрывает модалку:
   класс .modal-overlay задаёт display:flex с той же специфичностью,
   что и стандартное [hidden]{display:none}, и побеждает как авторский стиль */
.modal-overlay[hidden] {
  display: none;
}

.modal {
  background: var(--surface);
  border-radius: var(--radius);
  width: 420px;
  max-width: calc(100vw - 32px);
  padding: 24px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.15);
}

.modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.modal__title { font-size: 17px; font-weight: 600; margin: 0; }

.modal__close {
  border: none;
  background: none;
  font-size: 20px;
  cursor: pointer;
  color: var(--text-muted);
  line-height: 1;
}
.modal__close:hover { color: var(--text); }

.form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}

.form-field label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
}

.form-field input,
.form-field select {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 14px;
  font-family: inherit;
  background: #fff;
  color: var(--text);
}

.form-field input:focus,
.form-field select:focus {
  outline: none;
  border-color: var(--accent);
}

.form-error {
  color: var(--danger);
  font-size: 13px;
  margin-bottom: 10px;
}

.modal__actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 20px;
}

/* Карточка новичка / курьера */
.tab__header--detail {
  justify-content: flex-start;
  margin-bottom: 20px;
}

.btn--back {
  padding-left: 4px;
}

.detail-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  max-width: 480px;
  margin-bottom: 32px;
}

.detail-form__actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 6px;
}

.btn--small {
  padding: 8px 12px;
  font-size: 13px;
}

/* Ограничения */
.restrictions-section {
  margin-bottom: 32px;
  max-width: 720px;
}

.restrictions-section__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.restrictions-section__title {
  font-size: 16px;
  font-weight: 600;
  margin: 0;
}

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

.restriction-card {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  background: #fdecec;
  border: 1px solid #f3b4b4;
  border-radius: 8px;
  padding: 12px 14px;
}

.restriction-card__text {
  font-size: 14px;
  line-height: 1.5;
  color: #7a1f1f;
}

.restriction-card__delete {
  border: none;
  background: none;
  color: #a33;
  font-size: 18px;
  cursor: pointer;
  line-height: 1;
  flex-shrink: 0;
}
.restriction-card__delete:hover { color: #7a1f1f; }

.empty-state--small {
  padding: 24px;
}

/* Responsive */
@media (max-width: 720px) {
  .layout { flex-direction: column; }
  .sidebar { width: 100%; border-right: none; border-bottom: 1px solid var(--border); }
  .content { padding: 20px; }
}
