/* artelteh — часть legacy-overrides.css. Загружается под body.newui.
 * Не редактировать вручную в продакшене без согласования.
 */
/* ══════════════════════════════════════════
   ADMIN PANEL / MAP — page-adminpanel, page-adminmap
   ══════════════════════════════════════════ */
body.newui .admin-panel,
body.newui .adm_panel,
body.newui .admin-tables {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.25rem;
  box-shadow: var(--card-shadow);
  margin-bottom: 1.25rem;
}

/* Wrapper — без рамки, только отступ */
body.newui .admin-table-wrapper {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  padding: 0 !important;
  margin: 0 0 2rem !important;
}
body.newui .admin-table-wrapper > h2,
body.newui .admin-table-wrapper > h2 a {
  color: var(--text) !important;
  font-size: 18px !important; font-weight: 700 !important;
  letter-spacing: -0.3px !important;
  border-bottom: 0 !important;
  padding-bottom: 0 !important;
  margin: 0 0 0.75rem !important;
  text-decoration: none !important;
}
body.newui .admin-table-wrapper > h2 a:hover {
  color: var(--accent) !important;
}

/* Карточка таблицы — единственная рамка */
body.newui .admin-table-card {
  background: var(--bg2) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius) !important;
  overflow: hidden !important;
  box-shadow: var(--card-shadow) !important;
  padding: 0 !important;
  margin: 0 !important;
}
body.newui .admin-table-card table {
  width: 100%; border-collapse: collapse; margin: 0;
  background: transparent !important;
}
body.newui .admin-table-card thead {
  background: var(--bg3) !important;
  border-bottom: 1px solid var(--border) !important;
}
body.newui .admin-table-card thead tr td,
body.newui .admin-table-card thead tr th {
  padding: 10px 14px !important;
  font-size: 11px !important; font-weight: 600 !important;
  letter-spacing: 0.5px !important; text-transform: uppercase !important;
  color: var(--text3) !important;
  border-right: 0 !important;
  border-bottom: 0 !important;
  text-align: left !important;
  background: transparent !important;
}
body.newui .admin-table-card tbody tr {
  border-bottom: 1px solid var(--border) !important;
}
body.newui .admin-table-card tbody tr:last-child { border-bottom: 0 !important; }
body.newui .admin-table-card tbody tr:hover {
  background: var(--bg3) !important;
}
body.newui .admin-table-card tbody td {
  padding: 10px 14px !important; font-size: 13px !important;
  color: var(--text) !important;
  background: transparent !important;
  border: 0 !important;
}
body.newui .admin-table-card a {
  color: var(--accent) !important;
}

/* Map height */
body.newui .single_map_wrapper {
  min-height: 460px;
  margin-top: 1rem;
}

/* ══════════════════════════════════════════
   ADMIN TABLES — mobile card view
   ══════════════════════════════════════════ */
@media (max-width: 768px) {
  body.newui .admin-table-card {
    overflow: visible !important;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    padding: 0 !important;
  }
  body.newui .admin-table-card table {
    display: block !important;
    min-width: 0 !important;
    background: transparent !important;
  }
  body.newui .admin-table-card thead { display: none !important; }
  body.newui .admin-table-card tbody {
    display: flex !important;
    flex-direction: column;
    gap: 8px;
    background: transparent !important;
  }
  body.newui .admin-table-card tbody tr {
    display: block !important;
    padding: 12px 14px !important;
    background: var(--bg2) !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius) !important;
    box-shadow: var(--card-shadow);
    position: relative;
    overflow: hidden;
  }
  body.newui .admin-table-card tbody tr:hover { background: var(--bg2) !important; }
  body.newui .admin-table-card tbody td {
    display: block !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    font-size: 13px;
    line-height: 1.45;
    color: var(--text2);
  }

  /* ── Projects table: ID,Создание,Название,Автор,Статус,Исполнитель,Действия ── */
  /* ID — мелкий бейдж сверху-слева */
  body.newui .projects_table tbody td:nth-child(1) {
    display: inline-block !important;
    font-size: 10px !important; font-weight: 600;
    padding: 2px 8px !important;
    background: var(--bg3); border-radius: 100px;
    color: var(--text3) !important;
    margin-bottom: 6px;
  }
  body.newui .projects_table tbody td:nth-child(1)::before { content: '#'; }
  /* Дата создания — справа от ID */
  body.newui .projects_table tbody td:nth-child(2) {
    display: inline-block !important;
    font-size: 11px !important; color: var(--text3) !important;
    margin-left: 8px;
    font-variant-numeric: tabular-nums;
  }
  /* Название — крупное, основной заголовок */
  body.newui .projects_table tbody td:nth-child(3) {
    font-size: 15px !important; font-weight: 500 !important;
    color: var(--text) !important;
    margin: 6px 0 8px;
  }
  body.newui .projects_table tbody td:nth-child(3) a {
    color: var(--text) !important;
  }
  body.newui .projects_table tbody td:nth-child(3) a:hover { color: var(--accent) !important; }
  /* Автор */
  body.newui .projects_table tbody td:nth-child(4) {
    display: inline-block !important;
    font-size: 12px !important; color: var(--text3) !important;
    margin-right: 12px;
  }
  body.newui .projects_table tbody td:nth-child(4)::before {
    content: 'Автор: '; color: var(--text3);
  }
  /* Статус — pill */
  body.newui .projects_table tbody td:nth-child(5) {
    display: inline-block !important;
    font-size: 10px !important; font-weight: 600 !important;
    padding: 2px 8px !important;
    background: rgba(86,211,100,0.12) !important;
    color: var(--success) !important;
    border-radius: 100px;
    text-transform: uppercase;
  }
  /* Исполнитель */
  body.newui .projects_table tbody td:nth-child(6) {
    display: block !important;
    font-size: 12px !important; color: var(--text2) !important;
    margin-top: 8px;
  }
  body.newui .projects_table tbody td:nth-child(6)::before {
    content: 'Исполнитель: '; color: var(--text3);
  }
  /* Действия — внизу справа */
  body.newui .projects_table tbody td.table-actions {
    display: flex !important;
    gap: 6px; justify-content: flex-end;
    margin-top: 10px;
    padding-top: 10px !important;
    border-top: 1px solid var(--border) !important;
  }
  body.newui .projects_table tbody td.table-actions .action-link {
    width: 36px; height: 36px;
    border-radius: var(--radius-sm);
    background: var(--bg3);
    display: inline-flex !important; align-items: center; justify-content: center;
    font-size: 14px !important; margin: 0 !important;
  }

  /* ── Workers/Users table: ID,Регистрация,Логин,Имя,Компания,Телефон,Почта,Проекты ── */
  body.newui .users_table tbody td:nth-child(1),
  body.newui .new_big_table tbody td:nth-child(1) {
    display: inline-block !important;
    font-size: 10px !important; font-weight: 600;
    padding: 2px 8px !important;
    background: var(--bg3); border-radius: 100px;
    color: var(--text3) !important; margin-bottom: 6px;
  }
  body.newui .users_table tbody td:nth-child(1)::before,
  body.newui .new_big_table tbody td:nth-child(1)::before { content: '#'; }
  /* Регистрация (date) — рядом с ID */
  body.newui .users_table tbody td:nth-child(2) {
    display: inline-block !important;
    font-size: 11px !important; color: var(--text3) !important;
    margin-left: 8px;
    font-variant-numeric: tabular-nums;
  }
  /* Логин — крупно */
  body.newui .users_table tbody td:nth-child(3) {
    font-size: 16px !important; font-weight: 500 !important;
    margin: 6px 0 4px;
  }
  body.newui .users_table tbody td:nth-child(3) a {
    color: var(--text) !important;
  }
  body.newui .users_table tbody td:nth-child(3) a:hover { color: var(--accent) !important; }
  /* Имя */
  body.newui .users_table tbody td:nth-child(4) {
    font-size: 13px !important; color: var(--text2) !important;
    margin-bottom: 8px;
  }
  /* Компания / Телефон / Почта — список с лейблами */
  body.newui .users_table tbody td:nth-child(5),
  body.newui .users_table tbody td:nth-child(6),
  body.newui .users_table tbody td:nth-child(7) {
    font-size: 12px !important; color: var(--text2) !important;
    padding: 4px 0 !important;
    border-top: 1px dashed var(--border) !important;
  }
  body.newui .users_table tbody td:nth-child(5):empty,
  body.newui .users_table tbody td:nth-child(6):empty,
  body.newui .users_table tbody td:nth-child(7):empty { display: none !important; }
  body.newui .users_table tbody td:nth-child(5)::before { content: 'Компания: '; color: var(--text3); }
  body.newui .users_table tbody td:nth-child(6)::before { content: 'Телефон: '; color: var(--text3); }
  body.newui .users_table tbody td:nth-child(7)::before { content: 'E-mail: '; color: var(--text3); }
  /* Проекты count — pill */
  body.newui .users_table tbody td:nth-child(8) {
    display: inline-flex !important; align-items: center; gap: 4px;
    margin-top: 10px; padding: 4px 10px !important;
    background: var(--accent-dim); color: var(--accent) !important;
    border-radius: 100px;
    font-size: 11px !important; font-weight: 600 !important;
  }
  body.newui .users_table tbody td:nth-child(8)::before {
    content: 'проектов: ';
  }
}

/* ══════════════════════════════════════════
   AUTH — login/register
   ══════════════════════════════════════════ */
body.newui section.auth-page {
  background: transparent;
  padding: 1.5rem 0 3rem !important;
}
body.newui section.auth-page > .wrap { display: block !important; }

body.newui .auth-shell {
  max-width: 420px; margin: 0 auto;
  display: flex; flex-direction: column; gap: 1.5rem;
  align-items: stretch;
}
@media (min-width: 600px) {
  body.newui .auth-shell { padding-top: 2rem; }
}

body.newui .auth-brand {
  display: flex; align-items: center; gap: 10px;
  justify-content: center;
  font-size: 18px; font-weight: 600; color: var(--text);
  letter-spacing: -0.3px;
}
body.newui .auth-brand-logo {
  width: 36px; height: 36px;
  background: var(--accent-surface);
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
body.newui .auth-brand-logo svg { width: 18px; height: 18px; }

body.newui .auth-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem 1.75rem;
  box-shadow: var(--card-shadow);
}
body.newui .auth-title {
  font-size: 22px; font-weight: 600;
  color: var(--text); letter-spacing: -0.4px;
  margin: 0 0 0.5rem;
}
body.newui .auth-sub {
  font-size: 13px; color: var(--text2);
  margin: 0 0 1.5rem; line-height: 1.5;
}

body.newui .auth-alert {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px; line-height: 1.4;
  margin: 0 0 1rem;
}
body.newui .auth-alert-error {
  background: rgba(255,107,99,0.10) !important;
  color: var(--danger) !important;
  border: 1px solid rgba(255,107,99,0.25) !important;
}
body.newui .auth-alert-success {
  background: rgba(86,211,100,0.10) !important;
  color: var(--success) !important;
  border: 1px solid rgba(86,211,100,0.25) !important;
}

body.newui .auth-form {
  display: flex; flex-direction: column; gap: 14px;
}
body.newui .auth-field-row {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 12px;
}
@media (max-width: 460px) {
  body.newui .auth-field-row { grid-template-columns: 1fr; }
}

body.newui .auth-field {
  display: flex; flex-direction: column; gap: 6px;
  position: relative;
}
body.newui .auth-field label {
  font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.5px;
  color: var(--text3);
}
body.newui .auth-field input {
  width: 100% !important;
  background: var(--bg) !important;
  border: 1px solid var(--border2) !important;
  border-radius: var(--radius-sm) !important;
  padding: 11px 14px !important;
  font-size: 15px !important;
  color: var(--text) !important;
  min-height: 44px;
  font-family: inherit;
  transition: border-color var(--transition), box-shadow var(--transition);
}
body.newui .auth-field input:focus {
  outline: none !important;
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 3px var(--accent-dim) !important;
}
body.newui .auth-hint {
  font-size: 11px; color: var(--text3);
  margin-top: 2px;
}

/* Password toggle */
body.newui .auth-pwd-wrap { position: relative; }
body.newui .auth-pwd-wrap input { padding-right: 44px !important; }
body.newui .auth-pwd-toggle {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  width: 36px; height: 36px;
  background: transparent !important; border: 0 !important;
  display: flex; align-items: center; justify-content: center;
  color: var(--text3); cursor: pointer;
  border-radius: var(--radius-xs);
}
body.newui .auth-pwd-toggle:hover { color: var(--accent); background: var(--bg3) !important; }
body.newui .auth-pwd-toggle .ico-eye-off { display: none; }
body.newui .auth-pwd-toggle.is-shown .ico-eye { display: none; }
body.newui .auth-pwd-toggle.is-shown .ico-eye-off { display: block; }

body.newui .auth-submit {
  background: var(--accent-surface) !important;
  color: #000 !important;
  border: 0 !important;
  padding: 13px 22px !important;
  border-radius: var(--radius-sm) !important;
  font-weight: 600 !important; font-size: 15px !important;
  min-height: 48px; cursor: pointer;
  transition: background var(--transition), transform var(--transition);
  margin-top: 6px;
  width: 100%;
}
body.newui .auth-submit:hover { background: var(--accent-surface-hover) !important; }
body.newui .auth-submit:active { transform: scale(0.98); }

body.newui .auth-honeypot {
  position: absolute !important; left: -9999px !important;
  width: 1px; height: 1px; overflow: hidden;
}

body.newui .auth-terms {
  font-size: 11px; color: var(--text3);
  line-height: 1.5; margin: 8px 0 0; text-align: center;
}
body.newui .auth-terms a { color: var(--text2); text-decoration: underline; text-underline-offset: 2px; }
body.newui .auth-terms a:hover { color: var(--accent); }

body.newui .auth-footer {
  margin-top: 1.25rem; padding-top: 1.25rem;
  border-top: 1px solid var(--border);
  text-align: center; font-size: 13px; color: var(--text2);
}
body.newui .auth-footer a {
  color: var(--accent); font-weight: 600;
  text-decoration: none;
}
body.newui .auth-footer a:hover { text-decoration: underline; }

