/* ═══════════════════════════════════════════════════════════
   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; }

/* ── 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-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; }
}
