/* style.css — базовые стили LIGNUM CRM
   ✅ Batch 3A: исправлен селектор без запятых
      (.status-kromka .status-raspil .status-prisadka = вложенность, а не список)
      и добавлен канонический набор классов из js/config.js STATUS_CLASSES. */

:root {
  --primary: #3b82f6;
  --primary-light: #dbeafe;
  --secondary: #0ea5e9;
  --text: #1e293b;
  --border: #e2e8f0;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Segoe UI', sans-serif;
  background-color: #f1f5f9;
  color: var(--text);
  line-height: 1.6;
}

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

header {
  background-color: var(--primary);
  color: inherit;                 /* было #666 на синем фоне — низкий контраст */
  padding: 1rem 0;
  text-align: left;
  border-radius: 8px 8px 0 0;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}
header h1 { font-size: 1.8rem; font-weight: bold; }

main { margin-top: 20px; }

.card {
  background: white;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  padding: 20px;
  margin-bottom: 20px;
}

.btn {
  padding: 8px 16px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: background 0.3s;
}
.btn-primary   { background-color: var(--primary); color: white; }
.btn-secondary { background-color: #64748b; color: white; }
.btn-success   { background-color: var(--success); color: white; }
.btn-danger    { background-color: var(--danger); color: white; }
.btn:hover     { opacity: 0.9; }
.btn:disabled  { opacity: 0.55; cursor: not-allowed; }

input, select, textarea {
  width: 100%;
  padding: 10px;
  margin: 8px 0;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 1rem;
}

table { width: 100%; border-collapse: collapse; margin-top: 10px; }
th, td { padding: 12px; text-align: left; border-bottom: 1px solid var(--border); }
th { background-color: var(--primary-light); color: var(--text); }

/* ============================================================
   СТАТУСЫ: канонический набор (js/config.js → STATUS_CLASSES)
   ============================================================ */
.status-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  color: white;
}

.status-new               { color: #1f2937; background: #e2e8f0; }
.status-sawing            { color: white; background: #f59e0b; }
.status-transfer-edging   { color: white; background: #6366f1; }
.status-edging            { color: white; background: #3b82f6; }
.status-transfer-drilling { color: white; background: #a855f7; }
.status-drilling          { color: white; background: #8b5cf6; }
.status-qc                { color: white; background: #f97316; }
.status-ready             { color: white; background: #10b981; }
.status-assembly          { color: white; background: #06b6d4; }
.status-installation      { color: white; background: #ec4899; }
.status-completed         { color: white; background: #059669; }
.status-cnc               { color: white; background: #a78bfa; }
.status-generic           { color: white; background: #94a3b8; }

/* Легаси-слаги (старые версии worker.js).
   ✅ БЫЛО: .status-kromka .status-raspil .status-prisadka { … }
      — это селектор потомков, правило не применялось ни к одному бейджу.
   ✅ СТАЛО: перечисление через запятую. */
.status-kromka,
.status-raspil,
.status-prisadka { color: white; background: #3b82f6; }

.status-otk      { color: white; background: #0ea5e9; }
.status-sborka   { color: white; background: #8b5cf6; }
.status-montazh  { color: white; background: #ec4899; }
.status-gotov    { color: white; background: #10b981; }
.status-zakryt   { color: white; background: #6b7280; }

/* ============================================================
   МОДАЛЬНЫЕ ОКНА
   ============================================================ */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0; top: 0;
  width: 100%; height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  overflow: auto;
}
.modal-content {
  background-color: white;
  margin: 10% auto;
  padding: 20px;
  border-radius: 10px;
  width: 90%;
  max-width: 550px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}
.close { float: right; font-size: 28px; font-weight: bold; cursor: pointer; }

.footer {
  text-align: center;
  margin-top: 40px;
  color: #64748b;
  font-size: 0.9rem;
}
