:root {
  --card-bg: #fff;
  --card-radius: 18px;
  --card-shadow: 0 4px 24px rgba(34,34,59,0.07);
  --primary-color: #111827;
  --secondary-color: #6366f1;
  --link-hover: #4338ca;
  --btn-bg: #f3f4f6;
  --btn-hover-bg: #e5e7eb;
  --btn-active-bg: #e0e1e6;
  --btn-color: #22223b;
  --btn-hover-color: #6366f1;
  --border-color: #e5e7eb;
  --footer-color: #cbd5e1;
}

body {
  font-family: 'Inter', 'Montserrat', 'Roboto', Arial, sans-serif;
  background: var(--background-color);
  color: var(--primary-color);
  margin: 0;
  padding: 0;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 24px;
}

.card, .users-table, .main-table {
  background: var(--card-bg);
  border-radius: var(--card-radius);
  box-shadow: var(--card-shadow);
  padding: 32px;
  margin-bottom: 32px;
}

h1, h2, h3 {
  font-family: 'Inter', 'Montserrat', Arial, sans-serif;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 24px;
}

h3 {
  font-size: 0.85em !important;
}

h3.main-page-title {
  font-size: 1.20rem !important;
}

.main-btn {
  display: inline-flex;
  align-items: center;
  padding: 0.6rem 1.6rem;
  border-radius: 0.7rem;
  background: var(--btn-bg);
  color: var(--btn-color);
  font-size: 1.08rem;
  font-weight: 600;
  border: none;
  box-shadow: 0 2px 8px rgba(34,34,59,0.06);
  transition: background 0.18s, color 0.18s, box-shadow 0.18s;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  letter-spacing: 0.01em;
  margin-right: 12px;
}
.main-btn:hover, .main-btn:focus {
  background: var(--btn-hover-bg);
  color: var(--btn-hover-color);
  box-shadow: 0 4px 16px rgba(34,34,59,0.10);
}
.main-btn:active {
  background: var(--btn-active-bg);
  color: var(--secondary-color);
}

a {
  color: var(--secondary-color);
  font-weight: 100;
  text-decoration: none;
  transition: color 0.18s;
}
a:hover {
  color: var(--link-hover);
  text-decoration: underline;
}

.users-table th, .users-table td {
  border: none;
  padding: 18px 16px;
  font-size: 1.05rem;
}
.users-table th {
  background: var(--btn-bg);
  color: #6b7280;
  font-weight: 600;
}
.users-table tr {
  border-bottom: 1px solid var(--border-color);
}
.users-table tr:last-child {
  border-bottom: none;
}
.users-table td {
  color: var(--primary-color);
}

footer {
  color: var(--footer-color);
  font-size: 0.95rem;
  padding: 24px 0 8px 0;
  text-align: center;
  background: transparent;
  border: none;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

h1, h2, h3, h4, h5, h6 {
  color: var(--primary-color);
  font-weight: 100;
}

h1, .users-title {
  font-family: 'Montserrat', sans-serif !important;
  font-weight: 700 !important;
  font-size: 2.1rem !important;
  color: #111 !important;
  margin: 0 0 24px 0 !important;
}

.main-page-title {
  font-family: 'Montserrat', sans-serif !important;
  font-weight: 700 !important;
  color: #111 !important;
  margin: 0 0 24px 0 !important;
}

.btn {
  display: inline-block;
  padding: 10px 20px;
  background-color: var(--accent-color);
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 16px;
  transition: background-color 0.3s;
}

.btn:hover {
  background-color: #0056b3;
}

.btn-secondary {
  background-color: var(--secondary-color);
}

.btn-secondary:hover {
  background-color: #555;
}

.form-group {
  margin-bottom: 15px;
}

.form-control, select.form-control, textarea.form-control {
  padding: 10px 18px 10px 12px;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  font-size: 1rem;
  font-family: 'Montserrat', sans-serif;
  margin-top: 2px;
  background: #fafbfc;
  transition: border 0.2s, background 0.2s;
  box-sizing: border-box;
  width:550px;
}
select.form-control {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
}
select.form-control:focus, .form-control:focus, textarea.form-control:focus {
  border: 1.5px solid #6366f1;
  outline: none;
  background: #fff;
}

.alert {
  padding: 15px;
  margin-bottom: 20px;
  border-radius: 4px;
}

.alert-success {
  background-color: var(--success-color);
  color: white;
}

.alert-danger {
  background-color: var(--error-color);
  color: white;
}

.btn-primary {
  background: var(--mashinist-gold);
  color: #fff !important;
  border: none;
  border-radius: 6px;
  padding: 12px 24px;
  font-size: 18px;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.2s;
}

.btn-primary:hover {
  background: #a4844f;
}

.mashinist-welcome {
  max-width: 400px;
  margin: 60px auto;
  padding: 32px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 16px rgba(0,0,0,0.08);
  text-align: center;
}
.mashinist-welcome h1 {
  margin-bottom: 16px;
  color: var(--mashinist-gold);
}
.mashinist-welcome p {
  margin-bottom: 32px;
  color: var(--mashinist-text);
}

.btn-login {
  display: inline-block;
  padding: 10px 20px;
  background-color: var(--accent-color);
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 16px;
  transition: background-color 0.3s;
}

.btn-login:hover {
  background-color: #0056b3;
}

.btn-google {
  display: inline-block;
  padding: 10px 20px;
  background-color: var(--secondary-color);
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 16px;
  transition: background-color 0.3s;
}

.btn-google:hover {
  background-color: #555;
}

/* Глобальные стили для основных таблиц и контейнеров */
.main-content, .table-container, .users-container, .kanban-board-outer {
  max-width: 1100px;
  margin-left: auto !important;
  margin-right: auto !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
  box-sizing: border-box;
  width: 100%;
}

.users-table, .kanban-board, .main-table {
  width: 100%;
  margin: 0 !important;
  padding: 0 !important;
  box-sizing: border-box;
}

/* Убираем центрирование по умолчанию */
.users-table, .main-table, .kanban-board {
  margin-right: 0 !important;
}

.users-container {
  width: 100%;
  max-width: 100vw;
  margin: 0;
  padding: 32px 0 0 0;
  box-sizing: border-box;
}
.users-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  padding-left: 40px;
  padding-right: 40px;
}
.users-table {
  width: 100%;
  margin: 0;
  box-sizing: border-box;
}

.main-btn {
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 1.5rem;
  border-radius: 0.7rem;
  background: #f5f6fa;
  color: #22223b;
  font-size: 1.08rem;
  font-weight: 600;
  border: none;
  box-shadow: 0 2px 8px rgba(34,34,59,0.06);
  transition: background 0.18s, color 0.18s, box-shadow 0.18s;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  letter-spacing: 0.01em;
}

.main-btn:hover, .main-btn:focus {
  background: #e9ecef;
  color: #b99765;
  box-shadow: 0 4px 16px rgba(34,34,59,0.10);
  text-decoration: none;
}

.main-btn:active {
  background: #e0e1e6;
  color: #a4844f;
  box-shadow: 0 2px 8px rgba(34,34,59,0.08);
}

/* Cursor-style Header and Buttons */
.header-cursor {
  background: #fff;
  box-shadow: 0 2px 8px rgba(34,34,59,0.06);
  height: 56px;
  display: flex;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-inner {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
}
.header-logo {
  font-family: 'Inter', 'Montserrat', Arial, sans-serif;
  font-weight: 700;
  font-size: 1.25rem;
  color: #22223b;
  letter-spacing: 0.5px;
}
.header-nav {
  display: flex;
  align-items: center;
  gap: 12px;
}
.cursor-btn {
  display: inline-flex;
  align-items: center;
  padding: 0.45rem 1.2rem;
  border-radius: 12px;
  background: #f3f4f6;
  color: #22223b;
  font-size: 1rem;
  font-weight: 100;
  border: none;
  transition: background 0.16s, color 0.16s;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}
.cursor-btn:hover, .cursor-btn:focus {
  background: #e5e7eb;
  /* color: #6366f1; */
}
.cursor-btn:active {
  background: #e0e1e6;
  color: #4338ca;
}

.action-btn {
  display: inline-flex;
  align-items: center;
  padding: 0.45rem 1.2rem;
  border-radius: 12px;
  background: #f3f4f6;
  color: #22223b;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  transition: background 0.16s, color 0.16s;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  margin-right: 8px;
}
.action-btn:hover, .action-btn:focus {
  background: #e5e7eb;
  color: #6366f1;
}
.action-btn:active {
  background: #e0e1e6;
  color: #4338ca;
}
.action-btn--primary {
  background: #6366f1;
  color: #fff;
}
.action-btn--primary:hover, .action-btn--primary:focus {
  background: #4338ca;
  color: #fff;
}
.action-btn--danger {
  background: #fee2e2;
  color: #b91c1c;
}
.action-btn--danger:hover, .action-btn--danger:focus {
  background: #fecaca;
  color: #991b1b;
}
.action-btn--secondary {
  background: #f3f4f6;
  color: #22223b;
}
.action-btn--secondary:hover, .action-btn--secondary:focus {
  background: #e5e7eb;
  color: #6366f1;
}

.tab-btn {
  display: inline-block;
  background: #f7f7f7;
  color: #333;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 500;
  border: none;
  border-radius: 7px;
  padding: 0.38em 1.2em;
  margin: 0 8px 0 0;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  text-decoration: none !important;
  box-shadow: none;
  outline: none;
}
.tab-btn:last-child { margin-right: 0; }
.tab-btn:hover, .tab-btn:focus {
  background: #e0e0e0;
  color: #111;
  text-decoration: none !important;
}
.tab-btn:active {
  background: #d4d4d4;
  color: #111;
  text-decoration: none !important;
}
.tab-btn--danger {
  color: #b91c1c !important;
  background: #fee2e2;
}
.tab-btn--danger:hover, .tab-btn--danger:focus {
  background: #fecaca;
  color: #991b1b !important;
}

.cursor-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 2px 16px rgba(0,0,0,0.08);
  overflow: hidden;
  margin: 0 auto 32px auto;
  table-layout: auto;
}
.cursor-table th, .cursor-table td {
  padding: 16px 18px;
  text-align: left;
  font-size: 1rem;
  border-bottom: 1px solid #e0e0e0;
}
.cursor-table th {
  font-weight: 600;
  color: #666;
  background: #fafbfc;
}
.cursor-table tr:last-child td {
  border-bottom: none;
}
.cursor-table tr:hover td {
  background: #fafbfc;
}

.main-page-title {
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  color: #111;
  margin: 0 0 24px 0;
  text-align: left;
}
.status-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 4px;
  font-size: 0.95rem;
  font-weight: 600;
}
.status-badge.active {
  background: #e8f5e9;
  color: #2e7d32;
}
.status-badge.blocked {
  background: #ffebee;
  color: #c62828;
}
.status-badge.gray {
  background: #ececec;
  color: #222;
  font-weight: 600;
}
.actions {
  display: flex;
  gap: 12px;
}
@media (max-width: 900px) {
  .cursor-table, .users-header { padding-left: 8px; }
  .cursor-table { width: 100%; }
}
@media (max-width: 600px) {
  .users-header { padding-left: 4px; }
  .cursor-table th, .cursor-table td { padding: 8px 6px; font-size: 0.92rem; }
}

.form-card {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 2px 16px rgba(0,0,0,0.08);
  padding: 32px 28px;
  max-width: 700px;
  margin: 100px auto 32px auto;
}
.form-group {
  margin-bottom: 18px;
}
.form-label {
  font-weight: 600;
  color: #222;
  margin-bottom: 6px;
  margin-top: 6px;
  display: block;
  font-size: 1rem;
}
.form-label-inline {
  font-weight: 500;
  color: #222;
  margin-left: 8px;
  font-size: 1rem;
}
.form-checkbox {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  border: 1px solid #e0e0e0;
  vertical-align: middle;
  margin-right: 4px;
}
.form-actions {
  display: flex;
  gap: 16px;
  margin-top: 24px;
}
.checkbox-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.page-top-space {
  height: 32px;
}

/* Удаляю .select-wrapper и все связанные стили */
/* --- Кастомная обертка для select и стрелка --- */
.select-wrapper {
  position: relative;
  width: 100%;
}
.select-wrapper select.form-control {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background: #fafbfc;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 10px 18px 10px 12px;
  font-size: 1rem;
  font-family: 'Montserrat', sans-serif;
  color: #22223b;
  transition: border 0.2s, background 0.2s;
  width: 100%;
  box-sizing: border-box;
  height: 44px;
  line-height: 1.4;
}
.select-wrapper select.form-control:focus {
  border: 1.5px solid #6366f1;
  background: #fff;
  outline: none;
}
.select-wrapper select.form-control::-ms-expand { display: none; }
.select-wrapper select.form-control::-webkit-inner-spin-button,
.select-wrapper select.form-control::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.select-wrapper::after {
  content: '';
  position: absolute;
  top: 50%;
  right: 16px;
  width: 14px;
  height: 14px;
  pointer-events: none;
  transform: translateY(-50%);
  background: url('data:image/svg+xml;utf8,<svg fill="none" stroke="gray" stroke-width="2" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M19 9l-7 7-7-7"></path></svg>') no-repeat center/contain;
  opacity: 0.7;
}

/* --- Новый стиль flash-сообщений в стиле Cursor/docs --- */
.custom-flash {
  display: flex;
  align-items: center;
  gap: 14px;
  background: #fcfdff;
  border: 2px solid #e3e8f0;
  border-radius: 15px;
  box-shadow: 0 2px 12px rgba(34,34,59,0.07);
  padding: 12px 18px;
  margin: 24px auto 40px auto;
  max-width: 420px;
  font-size: 0.85rem;
  font-family: 'Montserrat', 'Inter', Arial, sans-serif;
  font-weight: 500;
  color: #1a2540;
  transition: box-shadow 0.2s, border 0.2s;
  position: relative;
}
.custom-flash-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.7em;
  height: 1.7em;
  min-width: 1.7em;
  min-height: 1.7em;
  border-radius: 50%;
  font-size: 1em;
  font-weight: 700;
  background: #e3e8f0;
  color: #3182ce;
  box-shadow: 0 1px 4px rgba(49,130,206,0.07);
}
.custom-flash.success {
  border-color: #b7e7c3;
  background: #f6fff8;
}
.custom-flash.success .custom-flash-icon {
  background: #b7e7c3;
  color: #22543d;
  box-shadow: 0 1px 4px rgba(34,197,94,0.08);
}
.custom-flash.error, .custom-flash.alert {
  border-color: #feb2b2;
  background: #fff5f5;
}
.custom-flash.error .custom-flash-icon, .custom-flash.alert .custom-flash-icon {
  background: #feb2b2;
  color: #c53030;
  box-shadow: 0 1px 4px rgba(245,101,101,0.08);
}
.custom-flash.info, .custom-flash.notice {
  border-color: #b6e0fe;
  background: #f8fdff;
}
.custom-flash.info .custom-flash-icon, .custom-flash.notice .custom-flash-icon {
  background: #b6e0fe;
  color: #3182ce;
  box-shadow: 0 1px 4px rgba(49,130,206,0.08);
}
.custom-flash-message {
  flex: 1;
  font-size: 1em;
  line-height: 1.4;
  word-break: break-word;
  color: #1a2540;
}
@media (max-width: 700px) {
  .custom-flash {
    max-width: 98vw;
    padding: 8px 4px;
    
    margin-left: auto;
    margin-right: auto;
  }
  .custom-flash-icon { width: 1.2em; height: 1.2em; font-size: 0.9em; }
}

/* --- Универсальный отступ между topbar и основным контейнером --- */
.form-card, .main-card, .main-content, .container {
  margin-top: 48px;
}

/* --- Таблица внутри карточки (form-card) --- */
.form-card .card-table {
  background: #fff;
  border-radius: 0;
  box-shadow: none;
  margin: 0 auto 24px auto;
  width: 100%;
  max-width: 700px;
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
}
.form-card .card-table th, .form-card .card-table td {
  padding: 18px 16px;
  text-align: left;
  font-size: 1rem;
  border-bottom: 1px solid #f0f0f0;
  background: #fff;
}
.form-card .card-table th {
  font-weight: 600;
  color: #666;
  background: #fff;
}
.form-card .card-table tr:last-child td {
  border-bottom: none;
}
.form-card .card-table tr:hover td {
  background: #fafbfc;
}

.filters-container {
  margin-bottom: 20px;
  padding: 15px;
  background: #fff;
  border-radius: 8px;
}

.filters-flex-row {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
  align-items: flex-end;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.filter-btns {
  display: flex;
  flex-direction: row;
  gap: 10px;
  align-items: flex-end;
  margin-top: 22px;
}

.filter-input {
  min-width: 220px;
  max-width: 220px;
  width: 220px;
  height: 44px;
  box-sizing: border-box;
  background: #fcfcfc;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 16px;
  font-family: inherit;
  color: #222;
  padding: 0 16px;
  transition: border 0.2s;
}
.filter-input:focus {
  border: 1.5px solid #6366f1;
  outline: none;
}
.filters-flex-row select.filter-input {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background: #fcfcfc url('data:image/svg+xml;utf8,<svg fill="%23999" height="20" viewBox="0 0 20 20" width="20" xmlns="http://www.w3.org/2000/svg"><path d="M7.293 8.293a1 1 0 011.414 0L10 9.586l1.293-1.293a1 1 0 111.414 1.414l-2 2a1 1 0 01-1.414 0l-2-2a1 1 0 010-1.414z"/></svg>') no-repeat right 12px center/18px 18px;
}

.pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  list-style: none;
  padding: 0;
  margin: 0;
}
.pagination li {
  display: inline-block;
}
.pagination a, .pagination span {
  font-family: 'Montserrat', sans-serif;
  font-size: 1rem;
  color: #111 !important;
  text-decoration: none;
  transition: color 0.15s;
}
.pagination a:hover, .pagination a:focus, .pagination span.current {
  /* color: #6366f1 !important; */
  text-decoration: underline;
} 