/* ==========================================================================
   VARIABLES
   ========================================================================== */
:root {
  /* Primary palette */
  --clr-primary: #164a5c;
  --clr-primary-dark: #0f3b4b;
  --clr-secondary: #91a9a9;
  --clr-secondary-dark: #718282;
  /* Status & actions */
  --clr-success: #10b981;
  --clr-success-dark: #059669;
  --clr-danger: #ef4444;
  --clr-danger-dark: #dc2626;
  /* Neutral / accents */
  --clr-grey: #6b7280;
  --clr-grey-dark: #4b5563;
  --clr-bg-light: #f5f7fa;
  --clr-bg-alt: #f9fafb;
  --clr-bg-accent: #eef2ff;
  --clr-border: #e5e7eb;
  --clr-text: #333;
  --radius-lg: 20px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --radius-pill: 999px;
  --shadow-card: 0 18px 36px rgba(15, 59, 75, 0.08);
  --shadow-soft: 0 10px 24px rgba(15, 59, 75, 0.06);
  /* Typography */
  --font-base: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

/* ==========================================================================
   IMPORT FONT
   ========================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600;700&display=swap');

/* ==========================================================================
   RESET & BASE
   ========================================================================== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
body {
  font-family: var(--font-base);
  background: linear-gradient(180deg, #f5f7fa 0%, #edf2f5 100%);
  color: var(--clr-text);
  line-height: 1.55;
  min-height: 100vh;
}

input,
select,
textarea,
button {
  font-family: inherit;
}

input,
select,
textarea {
  border-radius: var(--radius-md);
  border: 1px solid rgba(15, 59, 75, 0.18);
  background: #fff;
  padding: 0.75rem 0.9rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--clr-primary);
  box-shadow: 0 0 0 3px rgba(22, 74, 92, 0.15);
  outline: none;
}

/* ==========================================================================
   NAVBAR
   ========================================================================== */
.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--clr-primary);
  color: #fff;
  padding: 0.75rem 1.5rem;
  position: relative;
  z-index: 1100;
}
.navbar .brand {
  font-size: 1.5rem;
  font-weight: 600;
  text-decoration: none;
  color: #fff;
}
.nav-links {
  display: flex;
  list-style: none;
  gap: 1.5rem;
}
.nav-links li a {
  color: #f0f0f0;
  text-decoration: none;
  font-weight: 500;
  padding: 0.25rem;
  transition: color 0.2s;
}
.nav-links li a:hover,
.nav-links li a.active {
  color: #fff;
  border-bottom: 2px solid #fff;
}
.user-menu {
  position: relative;
  display: flex;
  align-items: center;
  cursor: pointer;
}
.user-menu img {
  width: 32px !important;
  height: 32px !important;
  max-width: none !important;
  object-fit: cover;   /* preserve aspect ratio and crop if needed */
  border-radius: 50%;
}
.user-menu .dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  background: #fff;
  color: var(--clr-text);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-sm);
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  display: none;
  min-width: 160px;
  overflow: hidden;
  z-index: 1150;
}
.user-menu:hover .dropdown {
  display: block;
}
.user-menu .dropdown a {
  display: block;
  padding: 0.5rem 1rem;
  font-size: 0.95rem;
  color: var(--clr-text);
}
.user-menu .dropdown a:hover {
  background: var(--clr-bg-accent);
}
.hamburger {
  display: none;
  background: transparent;
  border: none;
  font-size: 1.5rem;
  color: #fff;
  cursor: pointer;
}

/* ──────────────────────────────────────────────────────────────
   MOBILE NAVIGATION
─────────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .nav-links {
    display: none;             /* hide by default */
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--clr-primary);
    flex-direction: column;
    gap: 0;
  }
  .nav-links.open {
    display: flex;             /* show when .open is toggled */
  }
  .nav-links li {
    border-top: 1px solid rgba(255,255,255,0.2);
  }
  .nav-links li a {
    padding: 1rem;
  }
  .hamburger {
    display: block;            /* ensure it’s visible */
  }
}

/* ──────────────────────────────────────────────────────────────
   HORIZONTAL SCROLL FOR TABLES
─────────────────────────────────────────────────────────────── */
#tableSection {
  overflow-x: auto;                   /* allow scrolling */
  -webkit-overflow-scrolling: touch;   /* smooth on iOS */
}
/* Optional: prevent the rest of the body from overflowing */
body {
  overflow-x: hidden;
}

/* ──────────────────────────────────────────────────────────────
   Mobile: Show only Name, Status, More, Delete columns
─────────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
 #jobsTable,
  #jobsTable tbody,
  #jobsTable tr,
  #jobsTable td,
  #jobsTable th {
    display: block;
    width: 100%;
  }

  #jobsTable thead {
    display: none;
  }

  #jobsTable tbody tr {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 12px 24px rgba(22, 74, 92, 0.08);
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
  }

  #jobsTable tbody tr.details-row {
    padding: 0;
    box-shadow: none;
    background: transparent;
  }

  #jobsTable tbody tr td {
    border: none;
    padding: 0.4rem 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
  }

  #jobsTable tbody tr td::before {
    content: attr(data-label);
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--clr-grey-dark);
    text-transform: none;
  }

  #jobsTable tbody tr td.action-cell {
    justify-content: flex-start;
    gap: 0.5rem;
  }

  #jobsTable tbody tr td.action-cell::before,
  #jobsTable tbody tr.details-row td::before {
    content: '';
  }

.empty-state {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--clr-grey-dark);
}

/* ==========================================================================
   REPORTS PAGE LAYOUT
   ========================================================================== */
.reports-main {
  gap: 2rem;
}

.card-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.card-header h1,
.card-header h2 {
  margin: 0;
}

.card-subtitle {
  color: var(--clr-grey-dark);
  margin: 0.25rem 0 0;
}

.timestamp {
  font-size: 0.9rem;
  color: var(--clr-grey-dark);
  align-self: flex-end;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.reports-alert {
  border-radius: 0.75rem;
  padding: 1rem 1.25rem;
  background: #fdecea;
  color: #611a15;
  border: 1px solid rgba(97, 26, 21, 0.2);
  font-weight: 500;
  margin-top: 1rem;
}

.metric-card {
  background: var(--clr-bg-alt);
  border-radius: 0.75rem;
  padding: 1.25rem;
  box-shadow: inset 0 0 0 1px var(--clr-border);
}

.metric-card h2 {
  font-size: 1rem;
  margin-bottom: 0.5rem;
  color: var(--clr-grey-dark);
}

.metric-value {
  font-size: 2rem;
  font-weight: 600;
  color: var(--clr-primary);
  margin: 0;
}

.metric-footnote {
  display: block;
  margin-top: 0.4rem;
  font-size: 0.85rem;
  color: var(--clr-grey-dark);
}

.reports-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.75rem;
  align-items: stretch;
}

.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-md);
  box-shadow: inset 0 0 0 1px rgba(15, 59, 75, 0.08);
}

.table-wrapper table {
  background: #fff;
}

.reports-table th {
  background: var(--clr-bg-accent);
  color: inherit;
  text-transform: none;
  font-weight: 600;
}

.reports-table td,
.reports-table th {
  text-align: left;
}

.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.timeline li {
  display: flex;
  gap: 1rem;
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  background: var(--clr-bg-alt);
  box-shadow: inset 0 0 0 1px var(--clr-border);
}

.timeline-date {
  font-weight: 600;
  min-width: 110px;
  color: var(--clr-primary);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
 }
 
@media (max-width: 768px) {
  .reports-main {
    margin-top: 1.5rem;
  }

  .metric-grid {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  }

  .timeline li {
    flex-direction: column;
  }
  .timeline-date {
    min-width: auto;
  }
}
}
/* ==========================================================================
   DETAILS OVERLAY BACKDROP
   ========================================================================== */
.details-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.4);
  z-index: 900;
  opacity: 0;
  /* Prevent it from catching clicks when hidden: */
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.details-overlay.visible {
  opacity: 1;
  /* Now that it’s visible, allow clicks (so you can click to dismiss, etc) */
  pointer-events: auto;
}

/* ==========================================================================
   HEADER & LOGOUT (OLD)
   ========================================================================== */
header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  position: relative;
  background: var(--clr-primary);
  color: var(--clr-bg-alt);
}
header h1 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.75rem;
}
.index-logo-top {
  width: 36px;
  height: auto;
}
.logout-btn {
  position: absolute;
  top: 1rem; right: 1rem;
  border: 2px solid #fff;
  color: #fff;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: background 0.2s;
}
.logout-btn:hover {
  background: rgba(255,255,255,0.2);
}

/* ==========================================================================
   LAYOUT & CARDS
   ========================================================================== */
main {
  width: 100%;
  max-width: 1800px;
  margin: clamp(1.5rem, 3vw, 3rem) auto;
  padding: 0 clamp(1.75rem, 6vw, 4.5rem);
  display: flex;
  flex-direction: column;
  gap: clamp(1.5rem, 2.5vw, 2.75rem);
}

.card {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: clamp(1.5rem, 2vw, 2.25rem);
  box-shadow: var(--shadow-card);
  border: 1px solid rgba(15, 59, 75, 0.05);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* Full-width table section */
#tableSection {
  width: 100%;
  padding: clamp(1.5rem, 2vw, 2.25rem);
}

/* ==========================================================================
   FORM
   ========================================================================== */
#jobForm {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
#jobForm input,
#jobForm select {
  font-size: 1rem;
}

#jobForm button {
   grid-column: 1 / -1;        /* span all columns */
   width: 100%;                /* fill container */
   margin: 0;                  /* reset any offsets */
   padding: 0.75rem;
   background: var(--clr-primary);
   color: #fff;
   border: none;
   cursor: pointer;
   transition: background 0.2s;
}
#jobForm fieldset {
  border: 1px solid rgba(15, 59, 75, 0.12);
  border-radius: var(--radius-md);
  padding: 0.75rem;
}
#jobForm legend {
  padding: 0 0.5rem;
}
#jobForm button {
  background: var(--clr-primary);
  color: #fff;
  border: none;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s ease, box-shadow 0.2s ease;
  border-radius: var(--radius-pill);
  font-weight: 600;
  padding: 0.75rem 1.1rem;
  box-shadow: var(--shadow-soft);
}
#jobForm button:hover {
  background: var(--clr-primary-dark);
  transform: translateY(-1px);
}


/* ==========================================================================
   JOBS TOOLBAR & QUICK FILTERS
   ========================================================================== */
.jobs-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.5rem;
  align-items: flex-end;
  margin: 0;
  padding: clamp(1.25rem, 2vw, 1.75rem);
  background: #fff;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(15, 59, 75, 0.08);
  box-shadow: var(--shadow-soft);
}

.jobs-toolbar .toolbar-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.jobs-toolbar label {
  font-weight: 600;
  color: var(--clr-grey-dark);
}

.jobs-toolbar .form-control {
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(15, 59, 75, 0.16);
  font-size: 0.95rem;
  background: #fff;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.jobs-toolbar .form-control:focus {
  border-color: var(--clr-primary);
  box-shadow: 0 0 0 3px rgba(22, 74, 92, 0.12);
  outline: none;
}

.search-group {
  flex: 1 1 260px;
}

.search-group input {
  width: 100%;
}

.select-group {
  gap: 0.5rem;
}

.chips-group {
  flex: 1 1 100%;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.status-chip {
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--clr-border);
  background: var(--clr-bg-light);
  color: var(--clr-grey-dark);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s, transform 0.15s;
}

.status-chip:hover {
  transform: translateY(-1px);
  border-color: var(--clr-primary);
}

.status-chip.active {
  background: var(--clr-primary);
  color: #fff;
  border-color: var(--clr-primary);
}

@media (max-width: 640px) {
  .jobs-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .jobs-toolbar .toolbar-group {
    width: 100%;
  }

  .chips-group {
    justify-content: flex-start;
  }
}




/* Sorting indicators */
.sortable {
  cursor: pointer;
  position: relative;
  user-select: none;
}
.sortable::after {
  content: ' ↕';
  font-size: 0.8rem;
  color: var(--clr-bg-light);
  position: absolute;
  right: 0.5rem;
}
.sortable.asc::after { content: ' ↑'; }
.sortable.desc::after { content: ' ↓'; }

/* ==========================================================================
   GLOBAL TABLE STYLES
   ========================================================================== */
table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  min-width: 100%;
}

th,
td {
  padding: 0.9rem 1rem;
  text-align: left;
  border-bottom: 1px solid rgba(15, 59, 75, 0.1);
  vertical-align: middle;
}

thead {
  background: rgba(22, 74, 92, 0.06);
}

tbody tr:hover {
  background: rgba(22, 74, 92, 0.05);
}

/* ==========================================================================
   JOBS TABLE
   ========================================================================== */
/* #jobsTable {
  border: 1px solid var(--clr-border);
}
#jobsTable thead th {
  background: var(--clr-primary);
  color: #fff;
  font-weight: 600;
  border: none;
}

#jobsTable th:first-child,
#jobsTable td:first-child,
#jobsTable th:last-child,
#jobsTable td:last-child,
#jobsTable th:nth-last-child(2),
#jobsTable td:nth-last-child(2) {
  text-align: center;
}

#jobsTable tbody tr {
  transition: background 0.2s ease, transform 0.15s ease;
}

#jobsTable tbody tr:hover {
  background: #fffdfa;
  transform: translateY(-1px);
}

#jobsTable tbody td:nth-child(2),
#jobsTable tbody td:nth-child(3) {
  text-align: left;
}
#jobsTable td .edit-btn,
#jobsTable td .more-btn,
#jobsTable td .delete-btn {
  display: block;
  margin: auto;
  font-size: 1.2rem;
  width: 50%;
} */

/* Actions cell: keeps icons centered even when the row gets tall */
#jobsTable td.actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  white-space: nowrap;
  min-width: 132px; /* prevents squeeze */
}
#jobsTable thead th {
  background: var(--clr-primary);
  color: #fff;
  font-weight: 600;
  border: none;
}

#jobsTable td:nth-child(3) {
  max-width: 360px;
  white-space: normal;
  word-break: break-word;
}

/* ==========================================================================
   TABLE ACTION ICONS — reset the old neon blocks
   ========================================================================== */
/* Make the two buttons share the same cell and line up nicely */
#jobsTable td:last-child,
#jobsTable td:nth-last-child(2) {
  padding: 0.5rem;
  /* ensure they don’t wrap or get squashed */
  white-space: nowrap;
}

/* Compact icon buttons used in tables */
.action-btn {
  background: transparent;
  border: none;
  color: var(--clr-grey-dark);
  font-size: 1rem;
  line-height: 1;
  padding: 0.4rem;
  margin: 0 0.15rem;
  border-radius: var(--radius-pill);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, transform 0.15s ease;
}

.action-btn:hover {
  background: rgba(22, 74, 92, 0.12);
  color: var(--clr-primary);
  transform: translateY(-1px);
}

.action-btn.more-btn {
  color: var(--clr-secondary-dark);
}

.action-btn.more-btn:hover {
  color: var(--clr-primary);
}

.action-btn.delete-btn {
  color: var(--clr-danger);
}

.action-btn.delete-btn:hover {
  color: var(--clr-danger-dark);
}

/* ==========================================================================
   BUTTONS
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.65rem 1.3rem;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: var(--radius-pill);
  border: none;
  background: var(--clr-primary);
  color: #fff;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease;
  text-decoration: none;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-soft);
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.btn.btn-secondary {
  background: rgba(22, 74, 92, 0.1);
  color: var(--clr-primary);
  border: 1px solid rgba(22, 74, 92, 0.18);
  box-shadow: none;
}

.btn.btn-secondary:hover {
  background: rgba(22, 74, 92, 0.18);
  box-shadow: none;
}

.btn.btn-danger {
  background: var(--clr-danger);
  color: #fff;
}

.btn.btn-danger:hover {
  background: var(--clr-danger-dark);
}

/* ==========================================================================
   DETAILS PANEL
   ========================================================================== */
.details-row td {
  background: var(--clr-bg-alt);
  padding: 1rem;
}
#detailsPanel {
  position: fixed;
  top: 0; right: -100%;
  width: 80%; max-width: 1600px;
  height: 100%;
  background: #fff;
  box-shadow: -4px 0 12px rgba(0,0,0,0.1);
  overflow-y: auto;
  transition: right 0.3s ease;
  padding: 1.5rem;
  z-index: 1000;
}
#detailsPanel.visible {
  right: 0;
}
#detailsPanel .close-btn {
  background: none;
  border: none;
  font-size: 1.75rem;
  color: var(--clr-grey);
  cursor: pointer;
  transition: color 0.2s ease, transform 0.2s ease;
}

#detailsPanel .close-btn:hover {
  color: var(--clr-primary);
  transform: scale(1.05);
}

.details-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.75rem;
}

.details-title h3 {
  margin: 0;
  font-size: 1.75rem;
}

.details-subtitle {
  margin: 0.25rem 0 0;
  color: var(--clr-grey);
  font-size: 0.95rem;
}

.details-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-left: auto;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  background: var(--clr-bg-accent);
  color: var(--clr-primary);
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: none;
}

.detail-nav {
  display: inline-flex;
  gap: 0.35rem;
}

.detail-nav .btn {
  border: 1px solid var(--clr-border);
  background: #fff;
  color: var(--clr-grey-dark);
  padding: 0.35rem 0.6rem;
  border-radius: 6px;
  font-weight: 600;
}

.detail-nav .btn:hover {
  border-color: var(--clr-primary);
  color: var(--clr-primary);
}

.detail-nav .btn[disabled],
.detail-nav .btn[aria-disabled="true"] {
  opacity: 0.45;
  cursor: not-allowed;
  border-color: var(--clr-border);
  color: var(--clr-grey);
}

@media (max-width: 640px) {
  .details-controls {
    width: 100%;
    justify-content: space-between;
    flex-wrap: wrap;
  }

  .detail-nav {
    width: 100%;
    justify-content: flex-end;
  }
}

/* Section & form controls inside panel */
#detailsPanel .section {
  margin-bottom: 1.5rem;
}
#detailsPanel .section h4 {
  margin-bottom: 0.75rem;
  border-bottom: 1px solid var(--clr-border);
  padding-bottom: 0.25rem;
  color: var(--clr-primary);
}
#detailsPanel input,
#detailsPanel select,
#detailsPanel textarea {
  width: 100%;
  padding: 0.75rem;
  font-size: 1rem;
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-sm);
  box-sizing: border-box;
  margin-bottom: 0.75rem;
  text-align: center;
}

/* + Add Material & Save Details */
#det-addMat {
  background: var(--clr-primary);
  color: #fff;
  border: none;
  padding: 0.75rem;
  font-weight: 600;
  width: 100%;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.2s;
}
#det-addMat:hover { background: var(--clr-primary-dark); }
#det-save {
  background: var(--clr-success);
  color: #fff;
  border: none;
  padding: 0.75rem;
  font-weight: 600;
  width: 100%;
  border-radius: var(--radius-sm);
  cursor: pointer;
}
#det-save:hover { background: var(--clr-success-dark); }
/* stick Save button on long panels */
#det-save { position: sticky; bottom: 0; margin-top: 1rem; }

/* ==========================================================================
   MATERIALS TABLE INSIDE PANEL
   ========================================================================== */
.materials-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1rem;
}
.materials-table thead th {
  background: var(--clr-secondary);
  color: var(--clr-text);
  padding: 0.75rem;
  border-bottom: 2px solid var(--clr-border);
  font-weight: 600;
}
.materials-table tbody td {
  padding: 0.75rem;
  border-bottom: 1px solid var(--clr-border);
  vertical-align: middle;
}
.materials-table tbody tr:nth-child(even) {
  background: var(--clr-bg-accent);
}
/* Inputs & selects in materials */
.materials-table input,
.materials-table select {
  text-align: center;
  padding: 0.5rem;
  font-size: 1rem;
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-sm);
  background: #fff;
  width: 100%;
  box-sizing: border-box;
}

/* give the ‘Name’ column (2nd column) about 40% of the table width */
.materials-table thead th:nth-child(2),
.materials-table tbody td:nth-child(2) {
  width: 40%;
}
/* now make the input fill the cell and scroll */
.materials-table td input[data-field="name"] {
  width: 100%;
  box-sizing: border-box;
  white-space: nowrap;
  overflow-x: auto;
}
/* “Action” header for remove buttons */
.materials-table thead th:last-child {
  text-align: center;
  width: 80px;
}
/* Remove button cell */
.remove-material-btn {
  background: var(--clr-danger);
  color: #fff;
  border: none;
  padding: 0.5rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.remove-material-btn:hover {
  background: var(--clr-danger-dark);
}
/* 1) Allow the Name input to grow & wrap */
.materials-table td input[data-field="name"] {
  flex: 1;                /* fill available space */
  min-width: 120px;       /* never shrink below this */
  padding: 0.5em;         /* more comfortable touch target */
  font-size: 0.9rem;
}

/* 2) Turn table rows into stacked cards on narrow screens */
@media (max-width: 600px) {
  .materials-table,
  .materials-table thead,
  .materials-table tbody,
  .materials-table tr,
  .materials-table td {
    display: block;
    width: 100%;
  }
  .materials-table thead {
    /* hide the header row on mobile */
    display: none;
  }
  .materials-table tr {
    margin-bottom: 1rem;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: var(--radius-sm);
    padding: 0.5em;
  }
  .materials-table td {
    /* label each field for clarity */
    position: relative;
    padding-left: 50%;
    margin-bottom: 0.5em;
  }
  .materials-table td:nth-of-type(1)::before { content: "Type"; }
  .materials-table td:nth-of-type(2)::before { content: "Name"; }
  .materials-table td:nth-of-type(3)::before { content: "Qty"; }
  .materials-table td:nth-of-type(4)::before { content: "Unit Price"; }
  .materials-table td:nth-of-type(5)::before { content: "Total Cost"; }
  .materials-table td:nth-of-type(6)::before { content: "Status"; }
  .materials-table td:nth-of-type(7)::before { content: ""; } /* remove "Remove" label */
  .materials-table td::before {
    position: absolute;
    left: 0.5em;
    width: 45%;
    font-weight: bold;
  }
}

.pdfviewer-iframe {
  width: 100%;
  height: 600px;
  border: none;
  overflow: auto;
}

/* ==========================================================================
   STATUS DROPDOWN COLORS
   ========================================================================== */
.status-select {
  padding: 0.3rem 0.6rem;
  font-size: 0.85rem;
  border: none;
  border-radius: var(--radius-sm);
  color: #fff;
  cursor: pointer;
}
.status-select.status-take-off,
.status-pill.status-take-off { background: var(--clr-primary); color: #fff; }
.status-select.status-take-off-finished,
.status-pill.status-take-off-finished { background: var(--clr-success); color: #fff; }
.status-select.status-bidding,
.status-pill.status-bidding { background: var(--clr-secondary); color: var(--clr-text); }
.status-select.status-bidding-accepted,
.status-pill.status-bidding-accepted { background: var(--clr-success); color: #fff; }
.status-select.status-bidding-declined,
.status-pill.status-bidding-declined { background: var(--clr-danger); color: #fff; }
.status-select.status-materials,
.status-pill.status-materials { background: var(--clr-secondary-dark); color: #fff; }
.status-select.status-on-going,
.status-pill.status-on-going { background: var(--clr-grey); color: #fff; }

/* ==========================================================================
   SQUARE FOOTAGE CONTROLS
   ========================================================================== */
.sqft-row {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-end;
  margin: 1rem 0;
}
.sqft-row label {
  display: flex;
  flex-direction: column;
  font-size: 0.9rem;
}
.sqft-row input {
  padding: 0.5rem;
  font-size: 1rem;
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-sm);
  width: 100%;
  box-sizing: border-box;
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
@media (max-width: 800px) {
  #jobForm {
    grid-template-columns: 1fr !important;
  }
  th, td {
    font-size: 0.85rem;
    padding: 0.5rem;
  }
  #jobForm button[type="submit"] {
    grid-column: 1 / -1;       /* span that one column */
    width: 100%;               /* fill the column */
    max-width: 100%;           /* never exceed its parent */
    box-sizing: border-box;    /* include any padding/borders */
    left: 0%;
  }
}

@media (max-width: 600px) {
  #detailsPanel {
    position: fixed;
    top:   0;
    right: -100%;           /* start hidden off-screen to the right */
    width: 100%;
    height: 100%;
    max-width: 100%;
    box-shadow: -4px 0 12px rgba(0,0,0,0.1);
    transition: right 0.3s ease;
  }
  /* When JS toggles these classes… */
  #detailsPanel.hidden {
    right: -100%;          /* keep it off-screen */
  }
  #detailsPanel.visible {
    right: 0;              /* slide into view */
  }
}
  /* Bigger touch targets */
  body, button, input, select, textarea {
    font-size: 1rem;
  }
  button, .btn {
    padding: 0.75rem 1rem;
  }
}
/* ──────────────────────────────────────────────────────────────
   Contacts form: logical rows
─────────────────────────────────────────────────────────────── */
#contactForm {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  align-items: start;
}

/* 1st row: Full Name | Company */
/* 2nd row: Role | Email */
/* 3rd row: Phone spans both columns */
/* 4th row: Button spans both columns */
#contactForm .form-group:nth-child(5) { /* Phone is 5th .form-group */
  grid-column: 1 / -1;
}
#contactForm button {
  grid-column: 1 / -1;
  margin-top: 0.5rem;
  justify-content: center;
}

/* Tidy up labels & inputs */
#contactForm .form-group {
  display: flex;
  flex-direction: column;
}
#contactForm label {
  margin-bottom: 0.25rem;
  font-weight: 500;
  color: var(--clr-grey-dark);
}
#contactForm input,
#contactForm textarea,
#contactForm select {
  font-size: 1rem;
  box-sizing: border-box;
}

/* Responsive: fall back to one column on mobile */
@media (max-width: 600px) {
  #contactForm {
    grid-template-columns: 1fr;
  }
  #contactForm .form-group:nth-child(5),
  #contactForm button {
    grid-column: 1 / -1;
  }
}
#contactForm button:hover {
  transform: translateY(-1px);
}

/* ──────────────────────────────────────────────────────────────
   CONTACTS TABLE (same as #jobsTable)
─────────────────────────────────────────────────────────────── */
/* Contacts form grid & labels */
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}
.form-group {
  display: flex;
  flex-direction: column;
}
.form-group label {
  margin-bottom: 0.25rem;
  font-weight: 500;
  color: var(--clr-grey-dark);
}
.form-group input {
  padding: 0.75rem;
  font-size: 1rem;
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-sm);
}
.full-width {
  grid-column: 1 / -1;
  padding: 0.75rem;
  font-size: 1rem;
}

/* Contact table header aligns with jobs table */
#contactsTable thead th {
  background: var(--clr-primary);
  color: #fff;
  font-weight: 600;
  border: none;
}

#contactsTable th:first-child,
#contactsTable td:first-child,
#contactsTable th:last-child,
#contactsTable td:last-child {
  text-align: center;
}

/* Responsive: one column on small screens */
@media (max-width: 600px) {
  .form-grid {
    grid-template-columns: 1fr;
  }
}

/* ──────────────────────────────────────────────────────────────────────────
   Contacts Search Bar
   ────────────────────────────────────────────────────────────────────────── */
.search-card {
  padding: 1rem;
  margin-bottom: 0.5rem;
  background-color: var(--clr-grey-light);
}
#contactSearch {
  width: 100%;
  padding: 0.75rem;
  font-size: 1rem;
  border: 1px solid var(--clr-grey-light);
  border-radius: 0.375rem;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.05);
  transition: border-color 0.2s;
}
#contactSearch:focus {
  outline: none;
  border-color: var(--clr-primary);
}

#jobSearch {
  width: 100%;
  max-width: none;
}
#jobSearch:focus {
  outline: none;
  border-color: var(--clr-primary);
}


/* ──────────────────────────────────────────────────────────────
   LOGIN PAGE STYLING
─────────────────────────────────────────────────────────────── */

/* 1) Full‐viewport background blur/image */
body.login-page {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: var(--clr-bg-light);
}
body.login-page::before {
  content: "";
  position: fixed;
  inset: 0;
  background: url('../images/bg.jpg') center/cover no-repeat;
  filter: blur(6px) brightness(0.75);
  z-index: -1;
}

/* 2) Centered login card */
.login-container {
  width: 100%;
  max-width: 400px;
  text-align: center;
}
.login-card {
  background: rgba(255,255,255,0.9);
  padding: 2rem;
  border-radius: 8px;
  box-shadow: 0 6px 16px rgba(0,0,0,0.16);
}

/* 3) Logo or brand at top */
.login-logo-top {
  display: block;
  margin: 0 auto 1.5rem;
  max-width: 180px;
  width: 100%;
}

/* 4) Form fields */
.login-card .form-group {
  margin-bottom: 1rem;
  text-align: left;
}
.login-card .form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
}
.login-card .form-group input {
  width: 100%;
  padding: 0.75rem;
  font-size: 1rem;
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-sm);
}

/* 5) Primary button */
.btn-primary {
  display: block;
  width: 100%;
  padding: 0.75rem;
  font-size: 1rem;
  background: var(--clr-primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.2s;
}
.btn-primary:hover {
  background: var(--clr-primary-dark);
}

/* 6) Error messages */
.error {
  background: #fee2e2;
  color: var(--clr-danger);
  padding: 0.75rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
}

/* 7) Helper links (e.g. “Forgot password?”) */
.helper-link {
  margin-top: 0.5rem;
}
.helper-link a {
  color: var(--clr-primary);
  text-decoration: none;
  font-size: 0.9rem;
}
.helper-link a:hover {
  text-decoration: underline;
}

/* ─────────────────────────────────────────────────────────────
   CUSTOM CONFIRM MODAL
───────────────────────────────────────────────────────────── */
.modal.hidden {
  display: none;
}
.modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.5);
}
.modal-content {
  position: relative;
  background: #fff;
  border-radius: 8px;
  padding: 1.5rem;
  max-width: 320px;
  width: 90%;
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
  text-align: center;
}
.modal-content p {
  margin-bottom: 1.25rem;
  font-size: 1rem;
}
.modal-buttons {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
}
.modal-buttons .btn {
  flex: 1;
  padding: 0.5rem;
  font-size: 0.9rem;
}
.modal-buttons .btn-danger {
  background: var(--clr-danger);
  color: #fff;
}
.modal-buttons .btn-danger:hover {
  background: var(--clr-danger-dark);
}

/* ───────────────────────────────────────────────────────────────────────── */
/* Profile page enhancements                                              */
/* ───────────────────────────────────────────────────────────────────────── */

.profile-card {
  max-width: 700px;
  margin: 2rem auto;
  padding: 2rem;
}

.profile-header {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 1.5rem;
  align-items: center;
  margin-bottom: 2rem;
}

.profile-header .avatar {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: #eef2f5;
  object-fit: cover;
}

.profile-info h2 {
  margin: 0 0 0.5rem;
  font-size: 1.5rem;
  color: var(--text-dark);
}

.profile-info p {
  margin: 0.25rem 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.profile-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.profile-stats .stat {
  background: var(--primary-dark);
  color: var(--primary) !important;
  padding: 1rem;
  border-radius: var(--radius-sm);
  text-align: center;
}

.profile-stats .stat strong {
  display: block;
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}

.profile-stats .stat span {
  font-size: 1.3rem;
  font-weight: bold;
}

.readonly-field {
  background-color: #f5f5f5;
  cursor: not-allowed;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px,1fr));
  gap: 1rem;
  margin: 1.5rem 0;
  text-align: center;
}
.stat h5 {
  margin: 0;
  font-size: .9rem;
  color: #555;
}
.stat p {
  margin: .5rem 0 0;
  font-size: 1.5rem;
  font-weight: bold;
}

/* ---------------------------------- */
/*  users/add.php form refinements    */
/* ---------------------------------- */

.user-card {
  max-width: 800px;
  margin: 2rem auto;
  padding: 1.5rem;
}

.user-card h2 {
  margin-bottom: 1rem;
  font-size: 1.5rem;
  border-bottom: 2px solid var(--primary);
  padding-bottom: 0.25rem;
}

.user-card .form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem 1.5rem;
}

.user-card .form-group label {
  display: block;
  margin-bottom: 0.25rem;
  font-weight: 600;
}

.user-card .form-group input,
.user-card .form-group select {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid #ccc;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  transition: border-color .2s;
}
.user-card .form-group input:focus,
.user-card .form-group select:focus {
  outline: none;
  border-color: var(--primary-dark);
}

.user-card .required {
  color: var(--danger);
  margin-left: 2px;
}

.user-card .form-actions {
  margin-top: 1.5rem;
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
}

@media (max-width: 600px) {
  .user-card .form-actions {
    flex-direction: column;
  }
}

/* ── Dashboard / Admin Grid ────────────────────────────────────────── */

.container {
  max-width: 1000px;
  margin: 2rem auto;
  padding: 0 1rem;
}

.admin-grid h3 {
  margin-bottom: 1rem;
  font-size: 1.25rem;
  border-bottom: 2px solid var(--primary);
  padding-bottom: 0.25rem;
}

.admin-grid .grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  
}

.dash-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 1rem;
  text-decoration: none;
  color: var(--text);
  transition: box-shadow .2s, transform .1s;
}

.dash-card i {
  font-size: 1.75rem;
  margin-bottom: 0.5rem;
}

.dash-card span {
  font-weight: 600;
  text-align: center;
}

.dash-card:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  transform: translateY(-2px);
}

@media (max-width: 600px) {
  .admin-grid .grid {
    grid-template-columns: 1fr 1fr;
  }
}

.dashboard-links {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 2rem;
}

.dashboard-links a {
  background: #fff;
  border: 1px solid var(--clr-border);
  border-radius: 8px;
  padding: 1.25rem;
  text-align: center;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--clr-text);
  text-decoration: none;
  transition: all 0.2s ease;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.dashboard-links a:hover {
  background: var(--clr-primary);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-left: 4px solid var(--clr-primary);
  padding-left: calc(1.25rem - 4px); /* adjust so layout doesn’t jump */
}

.dashboard-links i {
  display: inline-block;
  margin-right: 0.5rem;
  font-size: 1.1rem;
  color: inherit;
}

.dashboard-links a {
  animation: fadeInUp 0.6s ease both;
}

@keyframes fadeInUp {
  0% {
    opacity: 0;
    transform: translateY(12px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 600px) {
  .dashboard-links {
    flex-direction: column;
    align-items: stretch;
  }

  .dashboard-links a {
    font-size: 1rem;
    padding: 1rem;
  }
}
/* ==========================================================================
   PAGINATION CONTROLS
   ========================================================================== */
.pagination-bar {
  margin-top: 1.5rem;
  padding: 0.85rem clamp(1rem, 2vw, 1.5rem);
  background: rgba(22, 74, 92, 0.06);
  border-radius: var(--radius-pill);
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  border: 1px solid rgba(22, 74, 92, 0.12);
}

.pagination-bar .page-size-group,
.pagination-bar .page-info-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.pagination-bar label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--clr-grey-dark);
}

.pagination-bar select {
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(15, 59, 75, 0.16);
  background: #fff;
  min-width: 80px;
}

.pagination-bar .page-stepper {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.pagination-bar .page-label {
  font-weight: 600;
  color: var(--clr-grey-dark);
}

.pagination-bar .range-label {
  color: var(--clr-grey);
  font-size: 0.9rem;
}

.pagination-bar button {
  min-width: 2.5rem;
}

.pagination-bar button[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ==========================================================================
   CONTACTS HUB
   ========================================================================== */
.contacts-main {
  gap: clamp(1.5rem, 2vw, 2rem);
}

.page-heading {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0 clamp(0.75rem, 1.5vw, 1.25rem);
}

.page-heading h1 {
  font-size: clamp(2rem, 3vw, 2.5rem);
  font-weight: 700;
}

.page-heading__subtitle {
  color: var(--clr-grey-dark);
  font-size: 1rem;
  max-width: 60ch;
}

.page-heading--compact {
  padding: 0;
  gap: 0.25rem;
}

.contact-form-card .card-header {
  margin-bottom: 1rem;
}

.contact-form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(200px, 1fr));
  gap: 1rem;
}

.contact-form-grid .form-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.contact-form-grid label {
  font-weight: 600;
  color: var(--clr-grey-dark);
}

.contact-form-grid input,
.contact-form-grid textarea {
  border: 1px solid var(--clr-border);
  border-radius: 0.5rem;
  padding: 0.75rem;
  font-size: 1rem;
  background: #fff;
}

.contact-form-grid textarea {
  resize: vertical;
  min-height: 90px;
}

.contact-form-grid button[type="submit"] {
  grid-column: 1 / -1;
  justify-self: flex-start;
}

.contact-viewer-note {
  background: #fff8ed;
  border-left: 4px solid #f59e0b;
  color: #92400e;
  padding: 1rem 1.25rem;
}

.contact-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
}

.contact-toolbar .toolbar-group {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
}

.contact-toolbar input,
.contact-toolbar select {
  min-width: 200px;
}

.contact-toolbar .chips-group .chip {
  border: 1px solid var(--clr-border);
  border-radius: 999px;
  padding: 0.4rem 0.9rem;
  background: #fff;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.contact-toolbar .chips-group .chip.active {
  background: var(--clr-primary);
  color: #fff;
  border-color: var(--clr-primary);
}

.link {
  color: var(--clr-primary);
  text-decoration: none;
}

.link:hover {
  text-decoration: underline;
}

.contact-table-card .table-wrapper {
  overflow-x: auto;
}

.icon-btn {
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 0.95rem;
  line-height: 1;
  padding: 0.4rem 0.55rem;
  border-radius: 999px;
  transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease;
  color: var(--clr-grey-dark);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: 600;
}

.icon-btn:hover {
  background: rgba(22,74,92,0.08);
  transform: translateY(-1px);
}

.icon-btn .icon {
  font-size: 1.05rem;
}

.icon-btn .label {
  font-size: 0.9rem;
}

.icon-btn.edit-btn {
  color: var(--clr-primary);
}

.icon-btn.edit-btn:hover {
  color: var(--clr-primary-dark);
}

.icon-btn.delete-btn {
  color: var(--clr-danger);
}

.icon-btn.disabled {
  cursor: default;
  opacity: 0.4;
}

.star-btn {
  font-size: 1.1rem;
  color: #d1d5db;
}

.star-btn.active {
  color: #f59e0b;
}

.contact-name-btn {
  border: none;
  background: transparent;
  color: var(--clr-primary);
  font-weight: 600;
  cursor: pointer;
}

.actions-cell {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
}

.contact-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: min(360px, 100%);
  height: 100%;
  background: #fff;
  box-shadow: -12px 0 24px rgba(17, 24, 39, 0.12);
  transform: translateX(100%);
  transition: transform 0.3s ease;
  z-index: 1200;
  display: flex;
  flex-direction: column;
}

.contact-drawer.hidden {
  transform: translateX(100%);
}

.contact-drawer:not(.hidden) {
  transform: translateX(0);
}

.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(17, 24, 39, 0.35);
  backdrop-filter: blur(2px);
  z-index: 1190;
  opacity: 1;
  transition: opacity 0.3s ease;
}

.drawer-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.drawer-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--clr-border);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.drawer-subtitle {
  color: var(--clr-grey);
  font-size: 0.95rem;
}

.drawer-body {
  padding: 1.5rem;
  overflow-y: auto;
}

.drawer-list {
  display: grid;
  gap: 1rem;
}

.drawer-list dt {
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--clr-grey);
}

.drawer-list dd {
  font-size: 1rem;
  font-weight: 600;
}

@media (max-width: 900px) {
  .contact-form-grid {
    grid-template-columns: repeat(2, minmax(180px, 1fr));
  }
}

@media (max-width: 640px) {
  .contact-form-grid {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   REPORTS POLISH
   ========================================================================== */
.reports-main {
  gap: clamp(1.5rem, 2.5vw, 2.5rem);
}

.reports-controls {
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.reports-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.95rem;
  color: var(--clr-grey);
  flex-wrap: wrap;
}

.scope-pill {
  background: rgba(22, 74, 92, 0.08);
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-pill);
  font-weight: 600;
  color: var(--clr-primary);
}

.reports-toolbar {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(22, 74, 92, 0.18);
  background: #fff;
  box-shadow: 0 10px 20px rgba(15, 59, 75, 0.05);
  flex-wrap: wrap;
}

.reports-toolbar label {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--clr-grey-dark);
}

.reports-toolbar select {
  border-radius: var(--radius-pill);
  border: 1px solid rgba(22, 74, 92, 0.2);
  padding: 0.4rem 0.85rem;
  font-weight: 600;
  background: #f5fafc;
}

.reports-toolbar .btn {
  border-radius: var(--radius-pill);
  padding: 0.45rem 1.1rem;
}

.reports-main .metric-grid {
  display: grid;
  gap: clamp(1.25rem, 2vw, 1.75rem);
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.reports-main .metric-card {
  background: linear-gradient(180deg, #ffffff 0%, #f5fafc 100%);
  border-radius: var(--radius-lg);
  padding: clamp(1.25rem, 2vw, 1.75rem);
  box-shadow: 0 12px 26px rgba(15, 59, 75, 0.08);
  border: 1px solid rgba(22, 74, 92, 0.12);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.75rem;
  min-height: 0;
}

.reports-main .metric-card header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
}

.reports-main .metric-card h2 {
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--clr-grey-dark);
}

.reports-main .metric-footnote {
  font-size: 0.85rem;
  color: var(--clr-grey);
}

.reports-main .metric-value {
  font-size: clamp(1.9rem, 3vw, 2.2rem);
  font-weight: 700;
  color: var(--clr-primary);
}

.reports-main .metric-progress {
  width: 100%;
  height: 6px;
  background: rgba(22, 74, 92, 0.12);
  border-radius: 999px;
  overflow: hidden;
}

.reports-main .metric-progress span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--clr-primary) 0%, #2ec4b6 100%);
}

.reports-alert {
  background: #fff8ed;
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: 0.75rem;
  padding: 1rem 1.25rem;
  color: #92400e;
  margin-bottom: 1rem;
}

.reports-summary-grid {
  display: grid;
  gap: clamp(1.5rem, 2vw, 2rem);
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  align-items: stretch;
}

.reports-metrics {
  gap: clamp(1.25rem, 2vw, 1.5rem);
}

.reports-grid {
  display: grid;
  gap: clamp(1.5rem, 2vw, 2rem);
}

.reports-grid--halves {
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
}

.reports-grid--thirds {
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.reports-table {
  width: 100%;
  border-collapse: collapse;
}

.reports-table th,
.reports-table td {
  padding: 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--clr-border);
}

.reports-table thead th {
  background: var(--clr-bg-alt);
  font-weight: 600;
}

.timeline {
  list-style: none;
  display: grid;
  gap: 1rem;
}

.timeline li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  border: 1px solid var(--clr-border);
  border-radius: 0.75rem;
  background: #fff;
}

.timeline time {
  font-weight: 600;
  color: var(--clr-primary);
}

@media (max-width: 720px) {
  .reports-main {
    padding: 1rem;
  }

  .reports-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .reports-toolbar {
    width: 100%;
    justify-content: space-between;
    flex-wrap: wrap;
  }
}