/* ═══════════════════════════════════════════════════════════
   Proline Builders — Clean, Calm UI
   ═══════════════════════════════════════════════════════════ */

/* ── Sidebar ──────────────────────────────────────────── */
.sidebar {
  width: 220px;
  min-height: 100vh;
  background: #1e3a5f;
  color: #fff;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 40;
  transition: transform 0.2s;
}
.sidebar-brand {
  display: flex; align-items: center; gap: 0.625rem;
  padding: 1.25rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.sidebar-logo { width: 36px; height: 36px; border-radius: 0.375rem; object-fit: cover; }
.sidebar-title { font-size: 0.875rem; font-weight: 700; letter-spacing: 0.05em; }
.sidebar-subtitle { font-size: 0.625rem; color: #93c5fd; opacity: 0.8; }
.sidebar-nav { flex: 1; padding: 0.75rem 0; }
.nav-item {
  display: flex; align-items: center; gap: 0.625rem;
  width: 100%; padding: 0.625rem 1rem;
  font-size: 0.8125rem; font-weight: 500;
  color: rgba(255,255,255,0.7); background: none; border: none;
  cursor: pointer; transition: all 0.15s; text-align: left;
}
.nav-item:hover { color: #fff; background: rgba(255,255,255,0.08); }
.nav-item.active { color: #fff; background: rgba(255,255,255,0.12); border-right: 3px solid #93c5fd; font-weight: 600; }
.sidebar-footer { padding: 1rem; border-top: 1px solid rgba(255,255,255,0.1); }
.main-content { margin-left: 220px; flex: 1; padding: 1.5rem; min-height: 100vh; }
.mobile-menu-btn {
  display: none; position: fixed; top: 0.75rem; left: 0.75rem; z-index: 50;
  background: #1e3a5f; color: #fff; border: none; border-radius: 0.375rem;
  padding: 0.5rem; cursor: pointer;
}
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); box-shadow: 4px 0 20px rgba(0,0,0,0.3); }
  .main-content { margin-left: 0; padding: 1rem; padding-top: 3.5rem; }
  .mobile-menu-btn { display: flex; }
}

/* ── Summary Cards ────────────────────────────────────── */
.summary-card {
  background: #fff;
  border-radius: 0.5rem;
  padding: 1.25rem;
  box-shadow: 0 1px 2px rgba(0,0,0,0.06);
  text-align: center;
  border-top: 3px solid #e5e7eb;
}
.sc-value { font-size: 1.75rem; font-weight: 700; line-height: 1.2; }
.sc-label { font-size: 0.6875rem; font-weight: 500; color: #9ca3af; text-transform: uppercase; letter-spacing: 0.05em; margin-top: 0.25rem; }

/* ── Filter Bar ───────────────────────────────────────── */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}
.filter-bar label { font-size: 0.75rem; font-weight: 600; color: #6b7280; text-transform: uppercase; letter-spacing: 0.05em; }
.filter-chip {
  padding: 0.25rem 0.75rem;
  border-radius: 1rem;
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  border: 1.5px solid transparent;
  transition: all 0.15s;
  background: #f3f4f6;
  color: #6b7280;
}
.filter-chip:hover { background: #e5e7eb; }
.filter-chip.active { font-weight: 600; border-color: currentColor; }
.chip-critical.active { background: #fef2f2; color: #dc2626; }
.chip-high.active    { background: #fff7ed; color: #ea580c; }
.chip-medium.active  { background: #fefce8; color: #d97706; }
.chip-ontrack.active { background: #f0fdf4; color: #059669; }
.chip-done.active    { background: #eff6ff; color: #2563eb; }

/* ── Legend (subtle) ──────────────────────────────────── */
.legend {
  display: flex;
  gap: 1.25rem;
  font-size: 0.6875rem;
  color: #9ca3af;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.legend-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 4px;
  vertical-align: middle;
}

/* ── Category ─────────────────────────────────────────── */
.category-section { margin-bottom: 2rem; }
.category-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  padding-bottom: 0.375rem;
  border-bottom: 1px solid #e5e7eb;
}
.category-header h3 { font-size: 0.875rem; font-weight: 600; color: #374151; }
.cat-count {
  font-size: 0.6875rem;
  font-weight: 600;
  color: #6b7280;
  background: #f3f4f6;
  padding: 0.125rem 0.5rem;
  border-radius: 9999px;
}

/* ── Project Cards (calm) ─────────────────────────────── */
.project-card {
  background: #fff;
  border-radius: 0.5rem;
  padding: 0.875rem 1rem;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
  border-left: 3px solid #d1d5db;
  transition: box-shadow 0.2s;
}
.project-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.08); }
.project-card.sev-critical { border-left-color: #dc2626; }
.project-card.sev-high     { border-left-color: #ea580c; }
.project-card.sev-medium   { border-left-color: #f59e0b; }
.project-card.sev-ontrack  { border-left-color: #22c55e; }
.project-card.sev-activated { border-left-color: #2563eb; }

.pc-row1 { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.pc-site { font-size: 0.9375rem; font-weight: 700; color: #1f2937; }
.pc-days { font-size: 0.6875rem; font-weight: 600; padding: 0.125rem 0.5rem; border-radius: 9999px; }
.pc-days.sev-critical { background: #fef2f2; color: #dc2626; }
.pc-days.sev-high     { background: #fff7ed; color: #ea580c; }
.pc-days.sev-medium   { background: #fefce8; color: #d97706; }
.pc-days.sev-ontrack  { background: #f0fdf4; color: #059669; }
.pc-days.sev-activated { background: #eff6ff; color: #2563eb; }

.pc-meta { font-size: 0.75rem; color: #6b7280; margin-top: 0.25rem; line-height: 1.5; }
.pc-actions {
  display: flex;
  gap: 0.375rem;
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid #f3f4f6;
  flex-wrap: wrap;
}

/* ── Badges (quiet) ───────────────────────────────────── */
.badge {
  display: inline-block;
  padding: 0.0625rem 0.375rem;
  border-radius: 0.25rem;
  font-size: 0.625rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.badge-approved  { background: #d1fae5; color: #059669; }
.badge-completed { background: #dbeafe; color: #1d4ed8; }
.badge-draft     { background: #f3f4f6; color: #6b7280; }
.badge-pending   { background: #fef2f2; color: #dc2626; }
.badge-activated { background: #d1fae5; color: #059669; }
.badge-sent      { background: #ede9fe; color: #7c3aed; }
.badge-invoice   { background: #ede9fe; color: #7c3aed; }

/* ── Buttons ──────────────────────────────────────────── */
.btn-primary {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.25rem;
  padding: 0.5rem 1rem; background: #1e3a5f; color: #fff;
  font-size: 0.8125rem; font-weight: 600; border-radius: 0.375rem; border: none; cursor: pointer;
  transition: background 0.15s;
}
.btn-primary:hover { background: #172e4d; }
.btn-secondary {
  display: inline-flex; align-items: center; gap: 0.25rem;
  padding: 0.5rem 1rem; background: #fff; color: #374151;
  font-size: 0.8125rem; font-weight: 500; border-radius: 0.375rem;
  border: 1px solid #d1d5db; cursor: pointer; transition: all 0.15s;
}
.btn-secondary:hover { background: #f9fafb; }
.btn-sm { padding: 0.25rem 0.625rem; font-size: 0.6875rem; border-radius: 0.25rem; border: none; cursor: pointer; font-weight: 500; }
.btn-activate { background: #059669; color: #fff; }
.btn-activate:hover { background: #047857; }
.btn-report { background: #1e3a5f; color: #fff; }
.btn-report:hover { background: #172e4d; }
.btn-edit { background: #f3f4f6; color: #374151; }
.btn-edit:hover { background: #e5e7eb; }
.btn-del { background: #fff; color: #9ca3af; border: 1px solid #e5e7eb; }
.btn-del:hover { color: #dc2626; border-color: #dc2626; }
.btn-invoice { background: #7c3aed; color: #fff; }
.btn-invoice:hover { background: #6d28d9; }
.btn-invoice-email { background: #8b5cf6; color: #fff; }
.btn-invoice-email:hover { background: #7c3aed; }
.btn-danger { background: #dc2626; color: #fff; padding: 0.5rem 1rem; border-radius: 0.375rem; font-size: 0.8125rem; font-weight: 600; border: none; cursor: pointer; }

/* ── Forms ─────────────────────────────────────────────── */
.form-label { display: block; font-size: 0.75rem; font-weight: 600; color: #374151; margin-bottom: 0.25rem; }
.form-input {
  width: 100%; padding: 0.5rem 0.75rem;
  border: 1px solid #d1d5db; border-radius: 0.375rem;
  font-size: 0.875rem; color: #1f2937; background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.form-input:focus { outline: none; border-color: #1e3a5f; box-shadow: 0 0 0 2px rgba(30,58,95,0.1); }

/* ── Report List ──────────────────────────────────────── */
.report-card {
  background: #fff; border-radius: 0.5rem; padding: 0.75rem 1rem;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
  display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; flex-wrap: wrap;
}
.rc-site { font-weight: 600; color: #1f2937; font-size: 0.875rem; }
.rc-meta { font-size: 0.6875rem; color: #6b7280; margin-top: 0.125rem; }

/* ── Toast ─────────────────────────────────────────────── */
.toast {
  padding: 0.625rem 1rem; border-radius: 0.375rem; font-size: 0.8125rem; font-weight: 500;
  color: #fff; box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  animation: slideIn 0.3s ease, fadeOut 0.3s ease 3.5s forwards; max-width: 320px;
}
.toast-success { background: #059669; }
.toast-error { background: #dc2626; }
.toast-info { background: #1e3a5f; }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes fadeOut { from { opacity: 1; } to { opacity: 0; } }

/* ── FAB ───────────────────────────────────────────────── */
.fab {
  position: fixed; bottom: 1.25rem; right: 1.25rem;
  width: 3rem; height: 3rem; border-radius: 50%;
  background: #1e3a5f; color: #fff; font-size: 1.5rem;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 8px rgba(30,58,95,0.3);
  cursor: pointer; border: none; transition: all 0.15s; z-index: 20;
}
.fab:hover { background: #172e4d; transform: scale(1.05); }

/* ── Filter Bar Secondary (Category + Sort) ──────────── */
.filter-bar-secondary {
  margin-bottom: 1rem;
}
.filter-select {
  padding: 0.3125rem 0.625rem;
  border: 1px solid #d1d5db;
  border-radius: 0.375rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: #374151;
  background: #fff;
  cursor: pointer;
  outline: none;
  transition: border-color 0.15s;
}
.filter-select:focus { border-color: #1e3a5f; }
.sort-dir-btn {
  padding: 0.25rem 0.5rem;
  border: 1px solid #d1d5db;
  border-radius: 0.375rem;
  font-size: 0.6875rem;
  font-weight: 600;
  color: #6b7280;
  background: #fff;
  cursor: pointer;
  transition: all 0.15s;
}
.sort-dir-btn:hover { background: #f3f4f6; color: #374151; }

/* ── Project Table ───────────────────────────────────── */
.table-wrap {
  overflow-x: auto;
  border-radius: 0.5rem;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
  margin-bottom: 1.5rem;
}
.project-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  min-width: 800px;
}
.project-table th {
  background: #1e3a5f;
  color: #fff;
  padding: 0.5rem 0.625rem;
  text-align: left;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  transition: background 0.15s;
}
.project-table th:hover { background: #172e4d; }
.project-table th.th-active { background: #172e4d; }
.project-table td {
  padding: 0.5rem 0.625rem;
  font-size: 0.8125rem;
  color: #1f2937;
  border-bottom: 1px solid #f3f4f6;
  vertical-align: middle;
}
.project-table tbody tr:hover td { background: #f9fafb; }

/* Severity left border on rows */
.project-table tr.sev-critical td:first-child { border-left: 3px solid #dc2626; }
.project-table tr.sev-high td:first-child { border-left: 3px solid #ea580c; }
.project-table tr.sev-medium td:first-child { border-left: 3px solid #f59e0b; }
.project-table tr.sev-ontrack td:first-child { border-left: 3px solid #22c55e; }
.project-table tr.sev-activated td:first-child { border-left: 3px solid #2563eb; }

/* Column-specific */
.td-num { font-size: 0.6875rem; color: #9ca3af; font-weight: 600; width: 2rem; text-align: center; }
.td-site { font-weight: 600; white-space: nowrap; }
.td-cat { font-size: 0.75rem; color: #6b7280; white-space: nowrap; }
.td-desc { font-size: 0.75rem; color: #6b7280; max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.td-date { font-size: 0.75rem; white-space: nowrap; }
.td-days { white-space: nowrap; }
.td-cost { font-size: 0.8125rem; font-weight: 500; white-space: nowrap; text-align: right; }
.td-actions {
  white-space: nowrap;
  display: flex;
  gap: 0.25rem;
  flex-wrap: wrap;
}

/* ── Responsive ────────────────────────────────────────── */
@media (max-width: 768px) {
  .filter-bar-secondary {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.375rem;
  }
  .filter-bar-secondary label { margin-left: 0 !important; }
}
@media (max-width: 640px) {
  .tab-btn { padding: 0.5rem 0.75rem; font-size: 0.8125rem; }
  .pc-actions { flex-direction: column; }
  .pc-actions button { width: 100%; text-align: center; }
  .td-actions { flex-direction: column; }
  .td-actions button { font-size: 0.625rem; }
}

/* ═══════════════════════════════════════════════════════════
   Data Entry — Project Data Tab
   ═══════════════════════════════════════════════════════════ */

/* ── Collapsible Sections ─────────────────────────────── */
.de-section {
  background: #fff;
  border-radius: 0.5rem;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
  margin-bottom: 0.75rem;
  overflow: hidden;
}
.de-section-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  cursor: pointer;
  user-select: none;
  transition: background 0.15s;
}
.de-section-header:hover { background: #f9fafb; }
.de-section-num {
  font-size: 0.6875rem;
  font-weight: 700;
  color: #1e3a5f;
  background: #eff6ff;
  padding: 0.125rem 0.5rem;
  border-radius: 0.25rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
}
.de-section-title { font-size: 0.875rem; font-weight: 600; color: #1f2937; flex: 1; }
.de-section-arrow {
  font-size: 0.75rem;
  color: #9ca3af;
  transition: transform 0.2s;
}
.de-section.open .de-section-arrow { transform: rotate(180deg); }
.de-body {
  display: none;
  padding: 0 1rem 1rem;
}
.de-section.open .de-body { display: block; }

/* ── Hints ────────────────────────────────────────────── */
.de-hint {
  font-size: 0.75rem;
  color: #6b7280;
  margin-bottom: 0.75rem;
}

/* ── Checklists ───────────────────────────────────────── */
.de-checklist { display: flex; flex-direction: column; gap: 0.375rem; margin-bottom: 0.5rem; }
.de-check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8125rem;
  color: #374151;
  cursor: pointer;
  padding: 0.25rem 0;
}
.de-check input[type="checkbox"] {
  width: 1rem; height: 1rem;
  accent-color: #1e3a5f;
  cursor: pointer;
  flex-shrink: 0;
}
.de-custom-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0;
}
.de-custom-input { flex: 1; font-size: 0.8125rem; }
.de-add-custom { margin-top: 0.375rem; }

/* ── Dynamic Tables ───────────────────────────────────── */
.de-table-wrap { overflow-x: auto; margin-bottom: 0.5rem; }
.de-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 500px;
}
.de-table th {
  background: #1e3a5f;
  color: #fff;
  padding: 0.4375rem 0.5rem;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  text-align: left;
  white-space: nowrap;
}
.de-table td {
  padding: 0.25rem 0.375rem;
  border-bottom: 1px solid #f3f4f6;
  vertical-align: middle;
}
.de-table td .form-input {
  padding: 0.3125rem 0.5rem;
  font-size: 0.8125rem;
  border-color: #e5e7eb;
}
.de-table td .form-input:focus { border-color: #1e3a5f; }
.de-row-num {
  font-size: 0.6875rem;
  color: #9ca3af;
  font-weight: 600;
  text-align: center;
  width: 2rem;
}
.de-add-row { margin-top: 0.375rem; }

/* ── Photo Upload Zone ────────────────────────────────── */
.photo-upload {
  border: 2px dashed #d1d5db;
  border-radius: 0.5rem;
  padding: 0.25rem;
  transition: border-color 0.2s, background 0.2s;
  cursor: pointer;
}
.photo-upload:hover,
.photo-upload.drag-over {
  border-color: #1e3a5f;
  background: #f0f5ff;
}
.photo-upload-inner {
  padding: 1.5rem 1rem;
  text-align: center;
}
.photo-upload-text {
  font-size: 0.8125rem;
  font-weight: 500;
  color: #374151;
  margin-top: 0.5rem;
}
.photo-upload-hint {
  font-size: 0.6875rem;
  color: #9ca3af;
  margin-top: 0.25rem;
}

/* ── Photo Grid ───────────────────────────────────────── */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.75rem;
  margin-top: 0.75rem;
}
.photo-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 0.375rem;
  overflow: hidden;
  transition: box-shadow 0.15s;
}
.photo-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.08); }
.photo-thumb {
  width: 100%;
  height: 120px;
  object-fit: cover;
  display: block;
  background: #f3f4f6;
}
.photo-info {
  padding: 0.375rem 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.375rem;
}
.photo-num {
  font-size: 0.625rem;
  font-weight: 700;
  color: #1e3a5f;
  background: #eff6ff;
  padding: 0.0625rem 0.3125rem;
  border-radius: 0.1875rem;
  white-space: nowrap;
}
.photo-title-input {
  flex: 1;
  padding: 0.1875rem 0.375rem !important;
  font-size: 0.6875rem !important;
  border-color: #e5e7eb !important;
}
.photo-actions {
  display: flex;
  gap: 0.25rem;
  padding: 0 0.5rem 0.375rem;
}
.photo-counter {
  font-size: 0.75rem;
  font-weight: 600;
  color: #6b7280;
  margin-top: 0.5rem;
}

/* ── BOQ Total ────────────────────────────────────────── */
.de-boq-total {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 0.75rem 1rem;
  background: #f9fafb;
  border-radius: 0.375rem;
  margin: 0.5rem 0;
  font-size: 0.875rem;
  color: #1f2937;
}
.de-boq-compare {
  font-size: 0.75rem;
  color: #6b7280;
}

/* ── Save Bar ─────────────────────────────────────────── */
.de-save-bar {
  position: sticky;
  bottom: 0;
  background: #fff;
  padding: 0.75rem 0;
  border-top: 1px solid #e5e7eb;
  margin-top: 1rem;
  z-index: 10;
}
.de-save-btn { width: 100%; }

/* ── Responsive ───────────────────────────────────────── */
@media (max-width: 640px) {
  .photo-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 0.5rem; }
  .photo-thumb { height: 90px; }
  .de-table { min-width: 400px; }
  .de-boq-total { flex-direction: column; gap: 0.25rem; }
}

/* ═══════════════════════════════════════════════════════════
   Validation Modal
   ═══════════════════════════════════════════════════════════ */
.validation-modal-inner {
  background: #fff;
  border-radius: 0.625rem;
  box-shadow: 0 8px 30px rgba(0,0,0,0.18);
  max-width: 460px;
  width: 100%;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
}
.val-title {
  font-size: 0.9375rem;
  font-weight: 700;
  color: #1f2937;
  padding: 1rem 1.25rem 0.75rem;
  border-bottom: 1px solid #e5e7eb;
}
.val-body {
  padding: 0.75rem 1.25rem;
  overflow-y: auto;
  flex: 1;
}
.val-item {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.3125rem 0;
  font-size: 0.8125rem;
  line-height: 1.4;
}
.val-icon {
  flex-shrink: 0;
  width: 1.125rem;
  text-align: center;
  font-weight: 700;
  font-size: 0.8125rem;
  line-height: 1.4;
}
.val-text { color: #374151; }
.val-pass .val-icon { color: #059669; }
.val-pass .val-text { color: #374151; }
.val-error .val-icon { color: #dc2626; }
.val-error .val-text { color: #dc2626; font-weight: 500; }
.val-warn .val-icon { color: #d97706; }
.val-warn .val-text { color: #92400e; }
.val-divider {
  border-top: 1px solid #f3f4f6;
  margin: 0.375rem 0;
}
.val-summary {
  padding: 0.625rem 1.25rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-top: 1px solid #e5e7eb;
}
.val-summary-pass { background: #f0fdf4; color: #059669; }
.val-summary-warn { background: #fffbeb; color: #92400e; }
.val-summary-error { background: #fef2f2; color: #dc2626; }
.val-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
  padding: 0.75rem 1.25rem;
  border-top: 1px solid #e5e7eb;
}
.val-btn-blocked {
  opacity: 0.5;
  cursor: not-allowed !important;
  background: #9ca3af !important;
}
.val-btn-blocked:hover { background: #9ca3af !important; }
.val-btn-warn { background: #d97706 !important; }
.val-btn-warn:hover { background: #b45309 !important; }

@media (max-width: 640px) {
  .validation-modal-inner { max-width: 100%; margin: 0.5rem; }
}

/* ═══════════════════════════════════════════════════════════
   Auth — Login Screen, User Management, Role Badges
   ═══════════════════════════════════════════════════════════ */

/* ── Login Screen ─────────────────────────────────────── */
.login-screen {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: #f3f4f6;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.login-screen.hidden { display: none; }
.login-card {
  background: #fff;
  border-radius: 0.75rem;
  box-shadow: 0 4px 24px rgba(0,0,0,0.1);
  padding: 2.5rem 2rem;
  max-width: 360px;
  width: 100%;
  text-align: center;
}
.login-logo {
  width: 64px;
  height: 64px;
  border-radius: 0.5rem;
  object-fit: cover;
  margin: 0 auto 1rem;
}
.login-brand {
  font-size: 1rem;
  font-weight: 700;
  color: #1e3a5f;
  letter-spacing: 0.05em;
}
.login-subtitle {
  font-size: 0.75rem;
  color: #6b7280;
  margin-bottom: 1.5rem;
}
.login-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  text-align: left;
}
.login-input { font-size: 0.9375rem; }
.login-btn {
  width: 100%;
  margin-top: 0.25rem;
  padding: 0.625rem 1rem;
  font-size: 0.875rem;
}
.login-error {
  color: #dc2626;
  font-size: 0.8125rem;
  font-weight: 500;
  text-align: center;
  min-height: 1.25rem;
}

/* ── Sidebar User Block ──────────────────────────────── */
.sidebar-user {
  margin-bottom: 0.5rem;
}
.sidebar-user-name {
  font-size: 0.8125rem;
  font-weight: 600;
  color: #fff;
  margin-bottom: 0.25rem;
}
.sidebar-logout-btn {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  width: 100%;
  padding: 0.375rem 0;
  font-size: 0.75rem;
  font-weight: 500;
  color: rgba(255,255,255,0.6);
  background: none;
  border: none;
  cursor: pointer;
  transition: color 0.15s;
}
.sidebar-logout-btn:hover { color: #fca5a5; }

/* ── Role Badges ─────────────────────────────────────── */
.role-badge {
  display: inline-block;
  padding: 0.0625rem 0.5rem;
  border-radius: 9999px;
  font-size: 0.625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.role-viewer     { background: #f3f4f6; color: #6b7280; }
.role-supervisor { background: #dbeafe; color: #1d4ed8; }
.role-manager    { background: #fef3c7; color: #b45309; }
.role-admin      { background: #fef2f2; color: #dc2626; }

/* ── User Management Table ───────────────────────────── */
.user-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
}
.user-table th {
  background: #1e3a5f;
  color: #fff;
  padding: 0.5rem 0.75rem;
  text-align: left;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.user-table td {
  padding: 0.5rem 0.75rem;
  font-size: 0.8125rem;
  color: #1f2937;
  border-bottom: 1px solid #f3f4f6;
  vertical-align: middle;
}
.user-table tbody tr:hover td { background: #f9fafb; }
.user-form-card {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  padding: 1rem;
  margin-bottom: 1rem;
}

/* ── Disabled Button State ───────────────────────────── */
.btn-disabled {
  opacity: 0.4;
  cursor: not-allowed !important;
  pointer-events: none;
}
