/* Desktop & tablet: never show mobile UI */
@media (min-width: 600px) {
  .topbar--mobile,
  #scrim,
  #mobileHome { display: none !important; }

  /* If mobile JS ever left this class on, neutralize it on larger screens */
  html.sidebar--open .sidebar {
    transform: none !important;
    box-shadow: none !important;
  }
}


/* Keep desktop topbar visible by default */
.main-content .topbar { display: flex; }

body {
      font-family: Arial, sans-serif;
      display: flex;
      height: 100vh;
      margin: 0;
      background-color: #f4f6f8;
    }
    .sidebar {
      width: 220px;
      background-color: #1e293b;
      color: white;
      padding-top: 1rem;
    }
    .sidebar h2 { text-align: center; margin-bottom: 2rem; }
    .sidebar ul { list-style: none; padding: 0; }
    .sidebar ul li {
      padding: 0.75rem 1.5rem;
      cursor: pointer;
    }
    .sidebar ul li:hover,
    .sidebar ul li.active {
      background-color: #334155;
    }
    .main-content {
      flex: 1;
      display: flex;
      flex-direction: column;
    }
    .topbar {
      background-color: #fff;
      padding: 1rem 2rem;
      display: flex;
      justify-content: space-between;
      align-items: center;
      box-shadow: 0 1px 4px rgba(0,0,0,0.1);
    }
    .topbar-left, .topbar-right {
      display: flex;
      gap: 1rem;
      align-items: center;
    }
    .topbar select, .topbar button {
      background-color: #e2e8f0;
      border: none;
      padding: 0.5rem 1rem;
      border-radius: 4px;
      cursor: pointer;
    }
    .topbar button:hover, .topbar select:hover {
      background-color: #cbd5e1;
    }
    .content {
      padding: 2rem;
      flex: 1;
      overflow-y: auto;
    }
 /* Sizes you can tweak */
:root{
  --col-left: 360px;   /* left column width */
  --row-h: 150px;      /* height for SMALL widgets */
  --gap: 20px;
  --header-h: 56px;    /* space for <h3> */
}

/* Two-column grid: Open Assignments | Low Stock on row 1 */
.dashboard-grid{
  display: grid;
  grid-template-columns: var(--col-left) 1fr;
  grid-auto-rows: var(--row-h);   /* small by default */
  gap: var(--gap);
  align-items: stretch;
  width: 100%;
  box-sizing: border-box;
}

/* Card baseline */
.dashboard-grid > .dashboard-box{
  --box-h: var(--row-h);                 /* default height (small) */
  height: var(--box-h);
  display: flex;
  flex-direction: column;
  overflow: hidden;                      /* the page won't grow */
  margin: 0; padding: 0;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 6px 12px rgba(20,20,20,.06);
}

/* Header */
.dashboard-grid .dashboard-box h3{
  margin: 12px 16px 8px;
  font-size: 1.05rem;
  line-height: 1.2;
  flex: 0 0 auto;
}

/* Scrollable body inside a fixed-height card */
.dashboard-grid .dashboard-box > ul,
.dashboard-grid .dashboard-box > div{
  margin: 0 16px 12px;
  padding: 0;
  overflow-y: auto;
  overflow-x: hidden;                    /* kill horizontal bar */
  max-height: calc(var(--box-h) - var(--header-h));
  word-break: break-word;
}

/* Make these specific boxes TALL (span 2 small rows) */
.dashboard-grid > .box-tall{
  grid-row: span 2;
  --box-h: calc(var(--row-h) * 2 + var(--gap));
}

/* Pin the first row explicitly (side-by-side) */
.dashboard-grid > .box-open-assignments { grid-column: 1; grid-row: 1; }
.dashboard-grid > .box-low-stock       { grid-column: 2; grid-row: 1; }

/* Nuke any leftover "wide" rules from older CSS */
.dashboard-grid > .dashboard-box.widget-wide,
.dashboard-grid > .dashboard-box:nth-child(2){ grid-column: auto !important; }

/* Responsive: single column */
@media (max-width: 900px){
  .dashboard-grid{
    grid-template-columns: 1fr;
  }
  .dashboard-grid > .box-open-assignments,
  .dashboard-grid > .box-low-stock{
    grid-column: auto; grid-row: auto;
  }
}

    .inventory-header {
      padding: 1.5rem;
      background-color: #dbeafe;
      border-radius: 20px 20px 0 0;
      display: flex;
      justify-content: space-between;
      align-items: center;
    }
    .inventory-header h2 {
      font-size: 28px;
      margin: 0;
      display: flex;
      align-items: center;
      gap: 0.5rem;
    }
    .inventory-header .header-actions {
      display: flex;
      gap: 1rem;
      align-items: center;
      
    }
    .inventory-header button {
      background-color: #3b82f6;
      color: white;
      border: none;
      padding: 0.5rem 1rem;
      border-radius: 6px;
      cursor: pointer;
    }
    .inventory-header button:hover {
      background-color: #2563eb;
    }
    .inventory-table {
      width: 100%;
      border-collapse: collapse;
      background: white;
      border-radius: 0 0 20px 20px;
      overflow: hidden;
      box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    }
    .inventory-table th, .inventory-table td {
      padding: 14px;
      text-align: left;
      border-bottom: 1px solid #e5e7eb;
    }
   .inventory-table input {
  width: 100%;
  padding: 0.4rem 0.6rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  box-sizing: border-box;
}
     .status-dot {
      height: 12px;
      width: 12px;
      border-radius: 50%;
      display: inline-block;
      margin-right: 8px;
    }
    .status-green { background-color: #22c55e; }
    .status-yellow { background-color: #facc15; }
    .status-red { background-color: #ef4444; }
    .pagination {
      text-align: center;
      margin: 1rem 0;
    }
    .pagination button {
      padding: 0.5rem 1rem;
      margin: 0 0.25rem;
      border: none;
      background-color: #3b82f6;
      color: white;
      border-radius: 4px;
      cursor: pointer;
    }
    .pagination button:hover {
      background-color: #2563eb;
    }

  
  
.inventory-table tbody tr:hover {
  background-color: #e0f2fe; /* Light blue on hover */
  cursor: pointer;
}

.profile-container {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  justify-content: space-between;
  margin: 2rem auto;
  max-width: 1000px;
  font-family: 'Segoe UI', sans-serif;
}

.profile-section {
  flex: 1;
  min-width: 300px;
  background: white;
  padding: 2rem;
  border-radius: 16px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}


.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  font-weight: bold;
  display: block;
  margin-bottom: 0.5rem;
}

.profile-card input,
.profile-card select {
  width: 100%;
  padding: 0.6rem;
  border-radius: 8px;
  border: 1px solid #ccc;
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
}

.btn-primary {
  background-color: #2563eb;
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  cursor: pointer;
}

.btn-primary:hover {
  background-color: #1e40af;
}

.btn-danger {
  background-color: #dc2626;
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  cursor: pointer;
}

.btn-danger:hover {
  background-color: #b91c1c;
}

.modal-actions {
  margin-top: 20px;
  text-align: right;
}

.modal-actions button {
  margin-left: 10px;
}

.barcode-wrapper {
  text-align: center;
  margin-top: 20px;
}

#barcodeCanvas {
  max-width: 100%;
  height: auto;
}
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  padding: 1rem;
}

.dashboard-box {
  background-color: white;
  border-radius: 8px;
  padding: 1rem;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  cursor: pointer;
}

.dashboard-box:hover {
  box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}
.dashboard-box h3 {
  margin: 0 0 0.5rem;
  font-size: 1.2rem;
  color: #1f2937;
}
.dashboard-box p {
  margin: 0;
  color: #4b5563;
}
.analytics-widgets {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin-top: 2rem;
}
.pagination button.active {
  background-color: #444;
  color: white;
  font-weight: bold;
}

.styled-select {
  padding: 6px;
  border-radius: 6px;
  border: 1px solid #ccc;
  background-color: #fff;
  font-size: 14px;
}



.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  padding: 20px;
}

.calendar-day {
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 10px;
  min-height: 100px;
  background-color: #fff;
  position: relative;
}

.calendar-day .day-number {
  font-weight: bold;
  position: absolute;
  top: 5px;
  right: 10px;
  font-size: 12px;
}

.assignment-badge {
  margin-top: 18px;
  font-size: 11px;
  background-color: #f2f2f2;
  padding: 2px 6px;
  border-radius: 4px;
}


/* Modal Actions */
.modal-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 20px;
  gap: 10px;
}


/* Animation */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-10px); }
  to   { opacity: 1; transform: translateY(0); }
}
/* Weekday labels inside the first row of the grid */
#calendarContainer > .calendar-day:nth-child(-n+7) {
  position: relative;
  padding-top: 22px;                 /* make room for the label */
}

/* Base look for the label */
#calendarContainer > .calendar-day:nth-child(-n+7)::before {
  position: absolute;
  top: 4px; left: 6px; right: 6px;
  content: "";
  display: block;
  text-align: center;
  font-weight: 600;
  font-size: 12px;
  color: #64748b;                    /* slate-500 */
  pointer-events: none;              /* purely visual */
}

/* Column-specific labels (Sunday → Saturday) */
#calendarContainer > .calendar-day:nth-child(1)::before { content: "Sunday"; }
#calendarContainer > .calendar-day:nth-child(2)::before { content: "Monday"; }
#calendarContainer > .calendar-day:nth-child(3)::before { content: "Tuesday"; }
#calendarContainer > .calendar-day:nth-child(4)::before { content: "Wednesday"; }
#calendarContainer > .calendar-day:nth-child(5)::before { content: "Thursday"; }
#calendarContainer > .calendar-day:nth-child(6)::before { content: "Friday"; }
#calendarContainer > .calendar-day:nth-child(7)::before { content: "Saturday"; }

/* (Optional) smaller labels on narrow screens */
@media (max-width: 599px){
  #calendarContainer > .calendar-day:nth-child(-n+7) { padding-top: 18px; }
  #calendarContainer > .calendar-day:nth-child(-n+7)::before { font-size: 11px; top: 3px; }
}

/* Grid layout for the month */
#calendarContainer{
  display:grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 1px;                    /* grid lines */
  background: #e5e7eb;         /* grid line color */
}

/* Even day cell height; adjust to taste */
#calendarContainer{
  grid-auto-rows: 9.5rem;      /* base day height (tablet friendly) */
}

@media (min-width:600px) and (max-width:1024px){
  #calendarContainer{ grid-auto-rows: 8.5rem; }
}
@media (max-width:599px){
  #calendarContainer{ grid-auto-rows: 7.5rem; }
}

/* Day cell as a column with a scrollable content area */
.calendar-day{
  background:#fff;
  display:flex;
  flex-direction:column;
  overflow:hidden;   /* prevents the row from growing */
  min-height:0;      /* critical with flex children */
}

.calendar-day.empty{ background: #f9fafb; }

/* Date number header */
.calendar-day .day-number{
  flex:0 0 auto;
  padding:.35rem .5rem;
  font-weight:600;
  font-size:.9rem;
}

/* Scrollable area for badges/chips */
.calendar-day .day-events{
  flex:1 1 auto;
  min-height:0;                 /* ⭐ lets this area shrink */
  overflow:auto;                /* scroll inside the cell, not the row */
  padding:.25rem .5rem .5rem;
  display:flex;
  flex-direction:column;
  gap:.25rem;
  -webkit-overflow-scrolling: touch;
}
/* Ensure flex containers don't choke child overflow */
.main-content { display:flex; flex-direction:column; min-height:0; }

/* If you have a wrapper between .main-content and the page body, allow it to shrink */
.page-body, .content-wrapper { min-height:0; }

/* Calendar area gets the scroll, not the whole page */
.calendar-wrapper { 
  flex: 1 1 auto; 
  min-height: 0;             /* critical for flex children to scroll */
  overflow-y: auto; 
  -webkit-overflow-scrolling: touch;
}

/* Keep grid content from stretching weirdly */
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  align-content: start;       /* prevents filling full height and killing scroll */
}


/* Project deadline chips */
.project-deadline-chip{
  font-size:.75rem;
  line-height:1.1;
  padding:.2rem .4rem;
  border-radius:.5rem;
  background:#fee2e2;           /* light red */
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.project-deadline-more{ background:#eef2ff; }

/* Today highlight */
.calendar-day.today { outline: 2px solid #3b82f6; outline-offset:-2px; }


.projects-container {
  padding: 20px;
  box-sizing: border-box;
}

.equipmentField {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.5rem;
}

.equipmentField input {
  flex: 1;
}

.removeEquipmentBtn {
  background: none;
  border: none;
  font-size: 1rem;
  color: #dc2626;
  cursor: pointer;
  padding: 0.3rem;
  border-radius: 4px;
  transition: background-color 0.2s;
}

.removeEquipmentBtn:hover {
  background-color: #fee2e2;
}

.addEquipmentBtn {
  background-color: #3b82f6;
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
}

.addEquipmentBtn:hover {
  background-color: #2563eb;
}

.close {
  float: right;
  font-size: 1.5rem;
  cursor: pointer;
}
.status-select{
  appearance:none;padding:6px 28px 6px 10px;border:1px solid #d0d7de;border-radius:8px;
  font-size:14px;background:#fff url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 20 20"><path d="M5.5 7.5l4.5 4.5 4.5-4.5" fill="none" stroke="%23666" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg>') no-repeat right 8px center;
  min-width:140px;transition:border-color .15s,box-shadow .15s;
}
.status-select:focus{outline:none;border-color:#60a5fa;box-shadow:0 0 0 3px rgba(59,130,246,.2)}
.status-select.is-open{background-color:#fff}
.status-select.is-pending{background-color:#fff7ed}   /* subtle amber */
.status-select.is-completed{background-color:#ecfdf5} /* subtle green */
/* ---- Completed Assignment modal: final override ---- */
/* Prevent the hidden readonly list from blocking the textarea */
#completionEquipmentReadonly[style*="display:none"],
#completionEquipmentReadonly:empty {
  display: none !important;
  pointer-events: none !important;
}

#completedAssignmentDetailModal .modal-content {
  background: #fff;
  padding: 20px 30px;
  border-radius: 12px;
  width: 90%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
}
/* Completed Assignment Detail modal layout */
#completedAssignmentDetailModal {
  /* use the same flex centering as other modals */
  justify-content: center;
  align-items: flex-start;      /* or center if you prefer */
  padding: 2rem 1rem;           /* a bit of breathing room on small screens */
  overflow-x: hidden;           /* prevent sideways scroll from this overlay */
}

#completedAssignmentDetailModal .modal-content {
  width: 100%;
  max-width: 900px;             /* adjust to match your other modals */
  margin: 0 auto;
  box-sizing: border-box;
  overflow-x: hidden;           /* clamp any child that tries to be too wide */
}
#completedAssignmentDetailModal input,
#completedAssignmentDetailModal select,
#completedAssignmentDetailModal textarea {
  max-width: 100%;
}
#completedAssignmentDetailModal .ca-summary-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

#completedAssignmentDetailModal .ca-summary-label {
  font-weight: 600;
}

#completedAssignmentDetailModal .ca-summary-value {
  min-width: 0;
}


/* Make close buttons keyboard-friendly */
.modal .close,
button.close {
  cursor: pointer;
}

.modal .close:focus-visible,
button.close:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}
/* wherever you set user-select: none; */
.close { 
  -webkit-user-select: none; /* Safari */
  user-select: none;
}
/* Center the pager under the table (supports both id styles) */
.pagination,
#pagination-parts,
#parts-pagination {
  display: flex !important;
  justify-content: center !important;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding: 12px 0;
}

.pagination button.active {
  font-weight: 600;
  outline: 1px solid #d0d0d0;
  border-radius: 6px;
}

body.modal-open { overflow: hidden; }  /* stop background scroll */


/* Optional: specific tweaks for the recurring modal */
#recurringAssignmentModal .modal-content {
  width: min(700px, 92vw);
}
/* Reusable UI tokens */
.btn {
  background-color: #4a90e2;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.2s ease, box-shadow 0.2s ease;
}
.btn:hover { background-color: #357abd; }

.btn-danger { background-color: #e74c3c; }
.btn-danger:hover { background-color: #c0392b; }

.select {
  padding: 6px 10px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 0.9rem;
  background: #fff;
  cursor: pointer;
}
.select:focus {
  outline: none;
  border-color: #4a90e2;
  box-shadow: 0 0 0 3px rgba(74,144,226,0.15);
}
/* 🔽 Project status dropdown styling */
.project-status-select {
  padding: 0.4rem 0.6rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 0.95rem;
  background-color: #fff;
  color: #333;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
  min-width: 110px;
}

.project-status-select:focus {
  outline: none;
  border-color: #007bff;
  box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

/* Optional: color coding */
.project-status-select option[value="Open"] {
  color: #e67e22; /* orange */
}
.project-status-select option[value="Completed"] {
  color: #27ae60; /* green */
}
.delete-btn {
  background-color: #e74c3c;  /* red */
  color: white;
  border: none;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: background-color 0.2s, transform 0.1s;
}

.delete-btn:hover {
  background-color: #c0392b;  /* darker red */
}

.delete-btn:active {
  transform: scale(0.95); /* click effect */
}

.modal-header, .modal-footer { padding:12px 16px; border-color:#e5e7eb; }
.modal-header { border-bottom:1px solid #e5e7eb; }
.modal-footer { border-top:1px solid #e5e7eb; justify-content:flex-end; gap:8px; }
.modal-body   { padding:16px; overflow:auto; }

.audit-list { display:grid; gap:14px; }
.audit-row  { display:grid; gap:6px; text-align:left; }
.audit-row hr { border:0; border-top:1px solid #e5e7eb; margin:8px 0 0; }
.audit-topline { font-weight:600; }
.audit-parts, .audit-cost { color:#374151; }
/* equipment autocomplete dropdown */
.ea-wrap input { width: 100%; }
.ea-dropdown .ea-row:hover { background: rgba(0,0,0,0.06); }


/* Center barcode block */
.barcode-block { text-align: center; margin: 12px 0 6px; }
#partBarcode {
  display: block;
  margin: 8px auto 0;
  max-width: none;  /* avoid responsive shrinking that thins bars */
}

/* If a parent created a stacking context, neutralize it (CSS-only) */
.app, .main-content, .content {
  transform: none !important;
  filter: none !important;
  perspective: none !important;
}
/* ===== Canonical modal system (ARIA-driven) ===== */

/* Base overlay (hidden by default) */
.modal {
  position: fixed;
  inset: 0;
  display: none;                 /* hidden by default */
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,.55);
  z-index: 2147483647;
  padding: 24px;
  pointer-events: none;          /* hidden modals must not block clicks */
  visibility: hidden;
  opacity: 0;
}

/* Hidden vs visible states (authoritative) */
.modal[aria-hidden="true"] {
  display: none !important;
  pointer-events: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
}

.modal[aria-hidden="false"] {
  display: flex !important;      /* flex → easy centering */
  pointer-events: auto !important;
  visibility: visible !important;
  opacity: 1 !important;
}

/* (Optional) Back-compat: honor old classes if they’re still toggled somewhere */
.modal.open,
.modal.show,
.modal.is-open {
  display: flex !important;
  pointer-events: auto !important;
  visibility: visible !important;
  opacity: 1 !important;
}

/* Dialog panel */
.modal .modal-content {
  background: #fff;
  width: min(760px, 92vw);
  max-height: min(85vh, 100dvh - 48px);
  overflow: auto;
  border-radius: 12px;
  padding: 20px 24px;
  box-shadow: 0 8px 24px rgba(0,0,0,.2);
  pointer-events: auto;
  animation: fadeIn 0.2s ease-in-out;
}

/* Prevent background scroll when a modal is open */
body.modal-open { overflow: hidden; }

/* ---------- Modal theme v2 ---------- */

:root{
  --ui-bg:#fff; --ui-text:#0f172a; --ui-muted:#6b7280;
  --ui-border:#e5e7eb; --ui-ring:#4f46e5; --ui-danger:#dc2626; --ui-ok:#16a34a;
  --ui-header:#0b1b4d; /* deep indigo for headers */
}

/* Sizes you can opt into with data-size="sm|md|lg|xl" */
.modal .modal-content[data-size="sm"] { width:min(520px, 92vw); }
.modal .modal-content[data-size="md"] { width:min(720px, 92vw); }
.modal .modal-content[data-size="lg"] { width:min(920px, 92vw); }
.modal .modal-content[data-size="xl"] { width:min(1100px, 96vw); }

/* Header: dark bar w/ subtle gradient, white text */
.modal-header {
  position: sticky; top: 0; z-index: 1;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 18px;
  background: linear-gradient(180deg, color-mix(in oklab, var(--ui-header) 92%, #000 0%), var(--ui-header));
  color: #fff;
  border-bottom: 1px solid color-mix(in oklab, #fff 15%, var(--ui-header));
  border-top-left-radius: 12px; border-top-right-radius: 12px;
}
.modal-header .modal-title { margin: 0; font-size: 1.05rem; font-weight: 700; letter-spacing: .2px; }
.modal-header .subtitle { font-weight: 500; opacity: .85; font-size: .9rem; }

/* Body + footer */
.modal-body  { padding: 18px 18px 16px; background: var(--ui-bg); }
.modal-footer{
  display: flex; gap: 10px; justify-content: flex-end;
  padding: 12px 18px; background: linear-gradient(0deg, #f8fafc, #fff);
  border-top: 1px solid var(--ui-border);
  border-bottom-left-radius: 12px; border-bottom-right-radius: 12px;
}

/* Close button */
.modal .modal-close{
  appearance: none; background: transparent; border: 0; color: #e5e7eb;
  width: 34px; height: 34px; display: grid; place-items: center; border-radius: 8px; cursor: pointer;
}
.modal .modal-close:hover{ background: rgba(255,255,255,.12); }

/* ================================
   Add Equipment Modal (scoped)
   – Visual style like the reference
   ================================ */

#addEquipmentModal {
  position: fixed;
  inset: 0;
  background: rgba(17, 24, 39, 0.55);        /* dim backdrop */
  z-index: 1000;
}

/* Panel */
#addEquipmentModal .modal-content {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: min(720px, 92vw);
  max-height: 88vh;
  overflow: auto;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 18px 40px rgba(2, 6, 23, 0.28), 0 2px 8px rgba(2, 6, 23, 0.12);

  /* ✨ this is what was missing */
  padding: 0; /* keep header/footer flush */
}

/* Header (dark navy bar) */
#addEquipmentModal .modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  background: #0b1b4d;
  color: #fff;
  border-top-left-radius: 12px;
  border-top-right-radius: 12px;
}
#addEquipmentModal .modal-header h3 {
  margin: 0;
  font: 700 18px/1.2 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  letter-spacing: .2px;
}

/* Optional small helper text row under the header */
#addEquipmentModal .modal-subhead {
  padding: 10px 18px;
  font: 500 13px/1.35 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color: #475569;
  background: #f8fafc;
  border-bottom: 1px solid #e5e7eb;
}

/* Body */
#addEquipmentModal .modal-body {
  padding: 20px;              /* spacing inside */
}

/* Groups + labels */
#addEquipmentModal .form-group {
  margin: 0 0 14px 0;
}
#addEquipmentModal .form-group label {
  display: block;
  margin: 0 0 6px 0;
  font: 600 13px/1.2 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color: #0f172a;
}

/* Inputs — 44px tall, rounded, subtle border */
#addEquipmentModal input[type="text"],
#addEquipmentModal select {
  width: 100%;
  min-height: 44px;
  box-sizing: border-box;
  padding: 12px 14px;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  background: #fff;
  font-size: 14px;
  color: #111827;
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
#addEquipmentModal input[type="text"]::placeholder { color: #9aa4b2; }
#addEquipmentModal input[type="text"]:focus,
#addEquipmentModal select:focus {
  border-color: #4f46e5;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.20);
}

/* Select chevron (matches ref style) */
/* Select chevron (matches ref style) — FIXED */
#addEquipmentModal select{
  -webkit-appearance:none; -moz-appearance:none; appearance:none;
  background-color:#fff;
  background-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%234f46e5' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat:no-repeat;
  background-position:right 14px center;
  background-size:12px 12px;
  padding-right:40px;
}
#addEquipmentModal select::-ms-expand{ display:none; }


/* Two-column rows (Location/Sub-location, Serial/Model) */
#addEquipmentModal .form-row.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 8px 0 14px;
}
@media (max-width: 720px) {
  #addEquipmentModal .form-row.two-col { grid-template-columns: 1fr; gap: 12px; }
}

/* Light divider (like the thin lines in the reference) */
#addEquipmentModal .divider {
  height: 1px;
  background: #e5e7eb;
  margin: 12px 0 16px;
}


/* Footer */
#addEquipmentModal .modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 14px 20px;         /* balanced spacing */
  border-top: 1px solid #e5e7eb;
  border-bottom-left-radius: 12px;
  border-bottom-right-radius: 12px;
  background: #fff;
}
#addEquipmentModal .btn {
  height: 40px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid transparent;
  font: 600 14px/1 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  cursor: pointer;
}

#addEquipmentModal .btn-cancel {
  background: #ffffff;
  color: #4f46e5;
  border-color: #c7d2fe;            /* subtle purple outline */
}
#addEquipmentModal .btn-cancel:hover {
  background: #f5f7ff;
}

#addEquipmentModal .btn-save {
  background: #4f46e5;
  color: #fff;
}
#addEquipmentModal .btn-save:hover { background: #4338ca; }

/* Small screens */
@media (max-width: 480px) {
  #addEquipmentModal .modal-content {
    width: calc(100vw - 20px);
    max-height: calc(100vh - 20px);
  }
  #addEquipmentModal .modal-body { padding: 14px; }
  #addEquipmentModal .modal-footer { padding: 14px; }
}
/* ================================
   Equipment Detail Modal (scoped)
   ================================ */

#equipmentDetailModal {
  position: fixed;
  inset: 0;
  background: rgba(17,24,39,.55);
  z-index: 1000;
}

/* Panel */
#equipmentDetailModal .modal-content{
  position:absolute; top:50%; left:50%;
  transform:translate(-50%,-50%);
  width:min(720px,92vw);
  max-height:88vh;
  overflow:auto;
  background:#fff;
  border-radius:12px;
  box-shadow:0 18px 40px rgba(2,6,23,.28), 0 2px 8px rgba(2,6,23,.12);
  padding:12px;                         /* insets content so edges aren’t cut */
}

/* Full-bleed header using your existing <h3> */
#equipmentDetailModal h3{
  margin:-12px -12px 12px;              /* cancel panel padding on top/sides */
  padding:14px 18px;
  background:#0b1b4d;
  color:#fff;
  border-top-left-radius:12px;
  border-top-right-radius:12px;
  font:700 18px/1.2 system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif;
  letter-spacing:.2px;
}

/* Labels */
#equipmentDetailModal label{
  display:block;
  margin:10px 0 6px;
  color:#0f172a;
  font:600 13px/1.2 system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif;
}

/* Inputs, selects, textarea */
#equipmentDetailModal input,
#equipmentDetailModal select,
#equipmentDetailModal textarea{
  width:100%;
  box-sizing:border-box;
  min-height:44px;
  padding:12px 14px;
  border:1px solid #d1d5db;
  border-radius:10px;
  background:#fff;
  font-size:14px;
  color:#111827;
  outline:none;
  transition:border-color .15s, box-shadow .15s;
}
#equipmentDetailModal input::placeholder,
#equipmentDetailModal textarea::placeholder{ color:#9aa4b2; }

#equipmentDetailModal input:focus,
#equipmentDetailModal select:focus,
#equipmentDetailModal textarea:focus{
  border-color:#4f46e5;
  box-shadow:0 0 0 3px rgba(79,70,229,.20);
}

#equipmentDetailModal textarea{
  min-height:72px;
  resize:vertical;
  padding:12px 14px;
}

/* Select chevron (single line so editors don’t break syntax highlighting) */
#equipmentDetailModal select{
  -webkit-appearance:none; -moz-appearance:none; appearance:none;
  background-color:#fff;
  background-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%234f46e5' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat:no-repeat;
  background-position:right 14px center;
  background-size:12px 12px;
  padding-right:40px;
}
#equipmentDetailModal select::-ms-expand{ display:none; }

/* Barcode block */
#equipmentDetailModal .barcode-wrapper{
  margin:16px 0 0;
  padding:16px 0 0;
  border-top:1px solid #e5e7eb;        /* subtle divider like the reference */
  text-align:center;
}
#equipmentDetailModal #barcodeLabelEquipment{
  margin:0 0 6px;
  font-weight:700;
  color:#334155;
}
#equipmentDetailModal #equipmentBarcodeCanvas{
  display:block;
  margin:12px auto 0;
  max-width:calc(100% - 64px);
  height:auto;
}

/* Footer / actions */
#equipmentDetailModal .modal-actions{
  display:flex;
  flex-wrap:wrap;
  justify-content:flex-end;
  gap:12px;
  margin-top:18px;
  padding-top:12px;
  border-top:1px solid #e5e7eb;
}

#equipmentDetailModal .modal-actions button{
  height:40px;
  padding:0 14px;
  border-radius:10px;
  border:1px solid transparent;
  font:600 14px/1 system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif;
  cursor:pointer;
}

/* Button variants by ID (keeps your existing buttons exactly as-is) */
#btnCloseEquipment{
  background:#fff; color:#4f46e5; border-color:#c7d2fe;   /* ghost */
}
#btnCloseEquipment:hover{ background:#f5f7ff; }

#btnSaveEquipment{
  background:#4f46e5; color:#fff;                          /* solid primary */
}
#btnSaveEquipment:hover{ background:#4338ca; }

#btnDeleteEquipment{
  background:#ef4444; color:#fff;                          /* danger */
}
#btnDeleteEquipment:hover{ background:#dc2626; }

#btnPrintEquipment,
#viewAuditBtn{
  background:#fff; color:#111827; border-color:#d1d5db;    /* neutral outline */
}
#btnPrintEquipment:hover,
#viewAuditBtn:hover{ background:#f9fafb; }

/* Small screens */
@media (max-width:480px){
  #equipmentDetailModal .modal-content{
    width:calc(100vw - 20px);
    max-height:calc(100vh - 20px);
  }
}
/* ================================
   New Assignment Modal (scoped)
   ================================ */
.sortable {
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}

.sortable .sort-indicator {
  margin-left: 4px;
  font-size: 0.75rem;
  color: #475569; /* slate-600 */
  opacity: 0;     /* hidden unless active */
  transition: opacity 0.15s ease;
}

.sortable.active .sort-indicator {
  opacity: 1;
}
#assignedToFilterDropdown {
  position: absolute;
  background: white;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
  padding: 6px 0;
  z-index: 5000;
  min-width: 180px;
}

#assignedToFilterDropdown div {
  padding: 6px 12px;
  cursor: pointer;
  white-space: nowrap;
}

#assignedToFilterDropdown div:hover {
  background: #f1f5f9;
}

.filter-indicator {
  margin-left: 4px;
  font-size: 0.75rem;
  color: #475569;
}

#newAssignmentModal{
  position: fixed;
  inset: 0;
  background: rgba(17,24,39,.55);
  z-index: 1000;
}

/* Panel */
#newAssignmentModal .modal-content{
  position:absolute; top:50%; left:50%;
  transform:translate(-50%,-50%);
  width:min(760px,92vw);
  max-height:88vh;
  overflow:auto;
  background:#fff;
  border-radius:12px;
  box-shadow:0 18px 40px rgba(2,6,23,.28), 0 2px 8px rgba(2,6,23,.12);
  padding:0; /* header/body/footer own padding */
}

/* Header */
#newAssignmentModal .modal-header{
  display:flex; align-items:center; justify-content:space-between; gap:12px;
  padding:14px 18px;
  background:#0b1b4d; color:#fff;
  border-top-left-radius:12px; border-top-right-radius:12px;
}
#newAssignmentModal .modal-title{ margin:0; font:700 18px/1.2 system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif; letter-spacing:.2px; }
#newAssignmentModal .subtitle{ font:500 13px/1.35 system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif; opacity:.9; }
#newAssignmentModal .modal-close{
  appearance:none; background:transparent; border:0; color:#e5e7eb;
  width:34px; height:34px; display:grid; place-items:center; border-radius:8px; cursor:pointer;
}
#newAssignmentModal .modal-close:hover{ background:rgba(255,255,255,.12); }

/* Body */
#newAssignmentModal .modal-body{ padding:18px; }

/* Grid */
#newAssignmentModal .form-grid{
  display:grid; grid-template-columns:1fr 1fr; gap:16px;
}
#newAssignmentModal .field{ display:flex; flex-direction:column; gap:6px; }
#newAssignmentModal .field.col-2{ grid-column:1 / -1; }

/* Labels */
#newAssignmentModal label{
  font:600 13px/1.2 system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif;
  color:#0f172a;
}

/* Inputs / selects / textarea */
#newAssignmentModal input,
#newAssignmentModal select,
#newAssignmentModal textarea{
  width:100%; box-sizing:border-box;
  min-height:44px; padding:12px 14px;
  border:1px solid #d1d5db; border-radius:10px; background:#fff;
  font-size:14px; color:#111827; outline:none;
  transition:border-color .15s, box-shadow .15s;
}
#newAssignmentModal textarea{ min-height:96px; resize:vertical; }
#newAssignmentModal input:focus,
#newAssignmentModal select:focus,
#newAssignmentModal textarea:focus{
  border-color:#4f46e5; box-shadow:0 0 0 3px rgba(79,70,229,.20);
}

/* Select chevron */
#newAssignmentModal select{
  -webkit-appearance:none; -moz-appearance:none; appearance:none;
  background-color:#fff;
  background-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%234f46e5' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat:no-repeat; background-position:right 14px center; background-size:12px 12px;
  padding-right:40px;
}
#newAssignmentModal select::-ms-expand{ display:none; }

/* Segmented control (Pending / Open / Completed) */
#newAssignmentModal .segmented{
  display:inline-flex; border:1px solid #d1d5db; border-radius:10px; overflow:hidden;
}
#newAssignmentModal .segmented input[type="radio"]{
  position:absolute; opacity:0; pointer-events:none;
}
#newAssignmentModal .segmented label{
  padding:10px 14px; font:600 13px/1 system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif;
  color:#111827; background:#fff; cursor:pointer; user-select:none;
  border-right:1px solid #d1d5db;
}
#newAssignmentModal .segmented label:first-of-type{ border-top-left-radius:10px; border-bottom-left-radius:10px; }
#newAssignmentModal .segmented label:last-of-type{ border-right:0; border-top-right-radius:10px; border-bottom-right-radius:10px; }
#newAssignmentModal .segmented input:checked + label{
  background:#4f46e5; color:#fff; border-color:#4f46e5; box-shadow:inset 0 0 0 1px #4f46e5;
}

/* Footer */
#newAssignmentModal .modal-footer{
  display:flex; justify-content:flex-end; gap:12px; flex-wrap:wrap;
  padding:12px 18px 16px;
  border-top:1px solid #e5e7eb;
  border-bottom-left-radius:12px; border-bottom-right-radius:12px;
  background:#fff;
}

/* Buttons */
#newAssignmentModal .btn{
  height:40px; padding:0 14px; border-radius:10px; border:1px solid transparent;
  font:600 14px/1 system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif; cursor:pointer;
}
#newAssignmentModal .btn-primary{ background:#4f46e5; color:#fff; }
#newAssignmentModal .btn-primary:hover{ background:#4338ca; }

#newAssignmentModal .btn-ghost{
  background:#fff; color:#4f46e5; border-color:#c7d2fe;
}
#newAssignmentModal .btn-ghost:hover{ background:#f5f7ff; }

#newAssignmentModal .btn-danger{ background:#ef4444; color:#fff; }
#newAssignmentModal .btn-danger:hover{ background:#dc2626; }

/* Small screens */
@media (max-width:720px){
  #newAssignmentModal .form-grid{ grid-template-columns:1fr; }
}
/* Fuzzy dropdown */
.ea-wrap { position: relative; }
.ea-dropdown {
  position: absolute; left: 0; right: 0; top: calc(100% + 4px);
  max-height: 240px; overflow: auto;
  background: #fff; border: 1px solid #e5e7eb; border-radius: 10px;
  box-shadow: 0 8px 16px rgba(0,0,0,.08);
  display: none; z-index: 2147483647;
}
.ea-row { padding: 10px 12px; cursor: pointer; }
.ea-row:hover, .ea-row.active { background: #eef2ff; }

/* ensure internal scrollers actually scroll inside flex parents */
#main-content, .inventory-header { min-height: 0; }

/* ================= Completed Assignment Modal (scoped) ================= */
#completedAssignmentDetailModal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(2px);
  z-index: 1000;
}
#completedAssignmentDetailModal[aria-hidden="false"] {
  display: flex !important;
}

/* Card */
#completedAssignmentDetailModal .modal-content {
  width: min(900px, 96vw);          /* same width feel as New Assignment */
  max-height: 92vh;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(2, 6, 23, 0.35);
  display: grid;
  grid-template-rows: auto auto 1fr auto; /* header, subtitle, body, edit/footer */
  overflow: hidden;
}

/* Header (navy band) */
#completedAssignmentDetailModal > .modal-content > h2 {
  margin: 0;
  padding: 16px 20px 14px;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: .2px;
  color: #fff;
  background: #0b1740;              /* deep navy */
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

/* Subtitle (small, under header) */
#completedAssignmentDetailModal .na-subtitle {
  margin: 0;
  padding: 8px 20px 6px;
  font-size: 13px;
  color: #0f172a;
  background: #fff;
}

/* Body with scroll */
#completedAssignmentDetailModal .na-body {
  padding: 12px 20px 4px;
  overflow: auto;
}

/* Label/value rows like the screenshot */
#completedAssignmentDetailModal .na-kv {
  margin: 10px 0;
  display: grid;
  grid-template-columns: 200px 1fr;   /* label | value */
  align-items: baseline;
  gap: 12px;
  font-size: 14px;
  color: #0f172a;
}
#completedAssignmentDetailModal .na-kv strong {
  font-weight: 600;
  color: #0f172a;
  opacity: .85;
  white-space: nowrap;
}
#completedAssignmentDetailModal .na-kv span {
  min-height: 18px;
}

/* Divider before edit area */
#completedAssignmentDetailModal .na-divider {
  height: 1px;
  background: rgba(15,23,42,0.06);
  margin: 0;
}

/* Edit/footer zone (light gray like the form’s lower section) */
#completedAssignmentDetailModal .na-edit {
  background: #fafafa;
  padding: 14px 20px 16px;
  overflow: auto;
}

/* Inputs inside the edit area should match the form style */
#completedAssignmentDetailModal .na-edit input[type="text"],
#completedAssignmentDetailModal .na-edit input[type="search"],
#completedAssignmentDetailModal .na-edit select,
#completedAssignmentDetailModal .na-edit textarea {
  width: 100%;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 14px;
  background: #fff;
  color: #0f172a;
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
#completedAssignmentDetailModal .na-edit textarea { min-height: 120px; resize: vertical; }
#completedAssignmentDetailModal .na-edit input:focus,
#completedAssignmentDetailModal .na-edit select:focus,
#completedAssignmentDetailModal .na-edit textarea:focus {
  border-color: #6366f1;                 /* indigo focus */
  box-shadow: 0 0 0 3px rgba(99,102,241,.15);
}

/* Buttons you place inside #completionEditArea */
#completedAssignmentDetailModal .btn-primary {
  appearance: none;
  border: 1px solid #5a47ea;
  background: #5a47ea;
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  padding: 10px 18px;
  border-radius: 12px;
  cursor: pointer;
  transition: filter .15s ease, transform .02s ease;
}
#completedAssignmentDetailModal .btn-primary:hover { filter: brightness(0.98); }
#completedAssignmentDetailModal .btn-primary:active { transform: translateY(1px); }

#completedAssignmentDetailModal .btn-ghost {
  appearance: none;
  border: 1px solid #e5e7eb;
  background: #fff;
  color: #4f46e5;
  font-weight: 700;
  font-size: 14px;
  padding: 10px 16px;
  border-radius: 12px;
  cursor: pointer;
  transition: background .15s ease, transform .02s ease;
}
#completedAssignmentDetailModal .btn-ghost:hover { background: #f8fafc; }
#completedAssignmentDetailModal .btn-ghost:active { transform: translateY(1px); }

/* Mobile */
@media (max-width: 700px) {
  #completedAssignmentDetailModal .modal-content { width: 96vw; }
  #completedAssignmentDetailModal .na-kv { grid-template-columns: 140px 1fr; }
}
/* Let the completed modal card scroll if content is taller than the viewport */
#completedAssignmentDetailModal .modal-content {
  max-height: 92vh;           /* tall but within viewport */
  overflow: auto;              /* ← adds scrollbar */
  -webkit-overflow-scrolling: touch; /* smooth iOS scrolling */
}
/* Completed modal — hover cues bound to the actual IDs */
#completedAssignmentDetailModal #completionSaveBtn,
#completedAssignmentDetailModal #completionCancelBtn {
  transition: transform .08s ease, box-shadow .15s ease, filter .15s ease, background-color .15s ease, border-color .15s ease;
  will-change: transform, box-shadow, filter;
}

/* Hover: tiny lift + soft shadow */
#completedAssignmentDetailModal #completionSaveBtn:hover,
#completedAssignmentDetailModal #completionCancelBtn:hover {
  transform: translateY(-1px) !important;
  box-shadow: 0 6px 14px rgba(2, 6, 23, 0.12) !important;
}

/* Keep colors subtle on hover (matches your theme) */
#completedAssignmentDetailModal #completionSaveBtn:hover {
  filter: brightness(0.98) !important;
}
#completedAssignmentDetailModal #completionCancelBtn:hover {
  background-color: #f8fafc !important;
  border-color: #e5e7eb !important;
}

/* Active press */
#completedAssignmentDetailModal #completionSaveBtn:active,
#completedAssignmentDetailModal #completionCancelBtn:active {
  transform: translateY(0) !important;
  box-shadow: 0 3px 8px rgba(2, 6, 23, 0.10) !important;
}

/* Keyboard focus ring */
#completedAssignmentDetailModal #completionSaveBtn:focus-visible,
#completedAssignmentDetailModal #completionCancelBtn:focus-visible {
  outline: 0;
  box-shadow: 0 0 0 3px rgba(99,102,241,.18) !important;
}
/* === Top fields: inline pairs ======================= */

/* ================================
   Part Detail Modal (scoped)
   ================================ */

/* Overlay */
#partDetailModal {
  position: fixed;
  inset: 0;
  background: rgba(17, 24, 39, .55);
  z-index: 1000;
}

/* Panel */
#partDetailModal .modal-content {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(720px, 92vw);
  max-height: 90vh;
  overflow: hidden;
  background: #fff;
  border-radius: 12px;
  box-shadow:
    0 18px 40px rgba(2, 6, 23, .28),
    0 2px 8px rgba(2, 6, 23, .12);
  display: flex;
  flex-direction: column;
}

/* Header */
#partDetailModal .modal-header {
  background: #0b1b4d;
  color: #fff;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

#partDetailModal h3.modal-title {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
}

#partDetailModal .subtitle {
  font-size: 13px;
  opacity: 0.9;
}

#partDetailModal .modal-close {
  background: transparent;
  border: none;
  color: #fff;
  font-size: 18px;
  cursor: pointer;
}

/* Body scrolls; header/footer stay fixed */
#partDetailModal .modal-body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 12px 16px 16px;
}

/* ===== Form layout ================================= */

/* Grid for the main fields */
#partDetailModal .form-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  column-gap: 16px;
  row-gap: 12px;
}

#partDetailModal .field {
  min-width: 0;
}

#partDetailModal .col-2 {
  grid-column: 1 / -1;     /* spans both columns */
}

/* Labels */
#partDetailModal .field > label {
  display: block;
  margin: 4px 0 4px;
  font-weight: 600;
  font-size: 13px;
  color: #111827;
}

/* Inputs / selects / textarea – restore pretty style */
#partDetailModal input,
#partDetailModal select,
#partDetailModal textarea {
  width: 100%;
  box-sizing: border-box;
  min-height: 40px;
  padding: 10px 12px;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  background: #fff;
  font-size: 14px;
  color: #111827;
  outline: none;
  transition: border-color .15s, box-shadow .15s, background-color .15s;
}

#partDetailModal textarea {
  min-height: 72px;
  resize: vertical;
}

/* Placeholder color */
#partDetailModal input::placeholder,
#partDetailModal textarea::placeholder {
  color: #9aa4b2;
}

/* Focus state */
#partDetailModal input:focus,
#partDetailModal select:focus,
#partDetailModal textarea:focus {
  border-color: #4f46e5;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, .20);
  background: #fff;
}

/* Custom dropdown arrow */
#partDetailModal select {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-color: #fff;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%234f46e5' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 12px 12px;
  padding-right: 32px;
}
#partDetailModal select::-ms-expand {
  display: none;
}

/* Stock Item row: checkbox + label inline */
#partDetailModal .field.inline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

#partDetailModal .field.inline input[type="checkbox"] {
  width: 15px;
  height: 15px;
  margin: 0;
  accent-color: #4f46e5;
}

#partDetailModal .field.inline label {
  margin: 0;
  white-space: nowrap;
}

/* Small numeric inputs (Quantity, Reorder) –
   compact but still full-column on desktop */
#partDetailModal .field input.num-sm {
  text-align: right;
}

/* Notes helper text */
#partDetailModal .help {
  margin-top: 4px;
  font-size: 12px;
  color: #6b7280;
}

/* ===== Locations & Stock =========================== */

#partDetailModal #multiLocStock h4 {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
}

#partDetailModal #stockRows {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}

#partDetailModal .stock-row {
  display: grid;
  grid-template-columns:
    minmax(160px, 2.2fr)   /* Location select */
    80px                   /* Qty */
    100px                  /* Reorder */
    minmax(140px, 2fr)     /* Sub-location */
    auto;                  /* X button */
  gap: 8px;
  align-items: center;
}

#partDetailModal .stock-row .sr-loc,
#partDetailModal .stock-row .sr-qty,
#partDetailModal .stock-row .sr-rp,
#partDetailModal .stock-row .sr-sub {
  width: 100%;
  box-sizing: border-box;
}

#partDetailModal .stock-row .sr-qty,
#partDetailModal .stock-row .sr-rp {
  text-align: right;
}

/* ===== QR section ================================== */

#partDetailModal #barcodeSection {
  text-align: center;
  margin-top: 12px;
}

#partDetailModal #partQR {
  display: inline-block;
}

#partDetailModal #partQRLabel {
  margin-top: 4px;
  font-size: 13px;
  font-weight: 600;
}

/* ===== Transfer Stock block ======================== */

#partDetailModal .field-group {
  margin-top: 24px;
  border-top: 1px solid #e5e7eb;
  padding-top: 16px;
}

#partDetailModal .field-group .label {
  font-weight: 600;
  font-size: 13px;
}

#partDetailModal .field-group .hint {
  font-size: 12px;
  color: #6b7280;
}

#partDetailModal .field-group .row {
  margin-top: 8px;
}

/* ===== Footer / buttons ============================ */

#partDetailModal .modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 10px 16px;
  border-top: 1px solid #e5e7eb;
  background: #fff;
}

#partDetailModal .modal-footer .btn {
  height: 40px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid transparent;
  font: 600 14px/1 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  cursor: pointer;
}

/* Variants by ID */
#partDetailModal #partDeleteBtn {
  background: #ef4444;
  color: #fff;
}
#partDetailModal #partDeleteBtn:hover {
  background: #dc2626;
}

#partDetailModal #partPrintBtn {
  background: #fff;
  color: #111827;
  border-color: #d1d5db;
}
#partDetailModal #partPrintBtn:hover {
  background: #f9fafb;
}

#partDetailModal #partSaveBtn {
  background: #4f46e5;
  color: #fff;
}
#partDetailModal #partSaveBtn:hover {
  background: #4338ca;
}

#partDetailModal .btn-ghost {
  background: #fff;
  color: #4b5563;
  border-color: #e5e7eb;
}
#partDetailModal .btn-ghost:hover {
  background: #f9fafb;
}

/* ===== Responsive tweaks =========================== */

/* Phones: stack form into a single column,
   keep the same pretty styles */
@media (max-width: 600px) {
  #partDetailModal .modal-content {
    width: calc(100vw - 20px);
    max-height: calc(100vh - 20px);
  }

  #partDetailModal .form-grid {
    grid-template-columns: 1fr;
  }

  #partDetailModal .stock-row {
    grid-template-columns: 1fr 1fr;
    grid-auto-rows: auto;
  }
}
.part-media-row {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
}

.part-media-col {
  display: flex;
  flex-direction: column;
  align-items: center; /* or flex-start if you prefer */
}



/* ===========================
   Supplies Request Modal (scoped)
   =========================== */
#suppliesRequestModal .modal-content{
  width:min(780px,92vw);
  max-height:90vh;
  border-radius:12px;
  overflow:hidden;
  background:#fff;
  box-shadow:0 18px 40px rgba(2,6,23,.28), 0 2px 8px rgba(2,6,23,.12);
  display:flex;               /* so footer can be sticky */
  flex-direction:column;
}

/* Header */
#suppliesRequestModal .modal-header{
  display:flex; align-items:center; justify-content:space-between;
  padding:14px 18px;
  background:#0b1b4a; color:#fff;
}
#suppliesRequestModal .modal-header h3{ margin:0; font:700 18px/1.2 system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif; }
#suppliesRequestModal .modal-header .close{
  border:0; background:transparent; color:#cbd5e1; cursor:pointer;
  padding:6px 8px; border-radius:8px; font-size:18px; line-height:1;
}
#suppliesRequestModal .modal-header .close:hover{ background:rgba(255,255,255,.08); color:#fff; }

/* Body */
#suppliesRequestModal .modal-body{ padding:18px; overflow:auto; }
#suppliesRequestModal label{
  display:block; margin:8px 0 6px; color:#0b1b4d; font-weight:600; font-size:13px;
}

/* Controls */
#suppliesRequestModal input,
#suppliesRequestModal select,
#suppliesRequestModal textarea{
  width:100%; box-sizing:border-box;
  min-height:40px; padding:10px 12px; font-size:14px;
  border:1px solid #e2e8f0; border-radius:10px; background:#fff; outline:none;
  transition:border-color .15s, box-shadow .15s;
}
#suppliesRequestModal textarea{ min-height:72px; resize:vertical; }
#suppliesRequestModal input:focus,
#suppliesRequestModal select:focus,
#suppliesRequestModal textarea:focus{
  border-color:#4f46e5; box-shadow:0 0 0 3px rgba(79,70,229,.2);
}

/* Pretty select chevron */
#suppliesRequestModal select{
  appearance:none;
  padding-right:36px;
  background-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%234f46e5' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat:no-repeat; background-position:right 12px center; background-size:12px;
}

/* Two-column meta grid (collapses on small screens) */
#suppliesRequestModal .grid{ display:grid; grid-template-columns:1fr 1fr; gap:14px; margin-bottom:14px; }
@media (max-width:720px){ #suppliesRequestModal .grid{ grid-template-columns:1fr; } }

/* Items section */
#suppliesRequestModal h4{ margin:8px 0 4px; font-size:14px; color:#0b1b4d; }
#suppliesRequestModal .add-item-btn{
  border:1px solid #e2e8f0; background:#fff; border-radius:10px; padding:8px 12px;
  font-weight:600; cursor:pointer;
}
#suppliesRequestModal .add-item-btn:hover{ background:#f9fafb; }

#suppliesRequestModal .supplies-grid-header{
  display:grid; grid-template-columns:2fr 1fr 2fr auto; gap:8px;
  margin-top:8px; padding:10px 12px;
  background:#f8fafc; border:1px solid #eef2f7; border-radius:10px;
  color:#334155; font-weight:600;
}
#suppliesRequestModal #suppliesRows{ display:flex; flex-direction:column; gap:8px; margin-top:8px; }
#suppliesRequestModal .supplies-row{
  display:grid; grid-template-columns:2fr 1fr 2fr auto; gap:8px; align-items:center;
}
#suppliesRequestModal .supplies-row .sr-qty{ text-align:center; }

/* Row delete button */
#suppliesRequestModal .supplies-row .danger{
  height:40px; width:40px; display:flex; align-items:center; justify-content:center;
  border:1px solid #fecaca; background:#fee2e2; color:#991b1b; border-radius:10px; cursor:pointer;
}
#suppliesRequestModal .supplies-row .danger:hover{ background:#fecaca; }

/* Footer (sticky like the example) */
#suppliesRequestModal .modal-footer{
  position:sticky; bottom:0; background:#fff;
  border-top:1px solid #eef2f7; padding:12px 18px;
  display:flex; gap:10px; justify-content:flex-end;
}
#suppliesRequestModal .btn{
  padding:10px 16px; border-radius:10px; border:1px solid #e2e8f0;
  background:#fff; font-weight:600; cursor:pointer;
}
#suppliesRequestModal .btn:hover{ background:#f5f7ff; }
#suppliesRequestModal .btn-primary{ background:#4f46e5; color:#fff; border-color:#4f46e5; }
#suppliesRequestModal .btn-primary:hover{ background:#4338ca; }
#suppliesRequestModal .btn-ghost{ background:#fff; color:#111827; }

/* ===== Generic modal shell (works with your aria-hidden pattern) ===== */
.modal {
  position: fixed;
  inset: 0;
  display: flex;               /* toggled by aria-hidden or inline style */
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(2, 6, 23, 0.55); /* slate/indigo-ish overlay */
  z-index: 1000;
}

/* Hide via aria (keeps your global pattern consistent) */
.modal[aria-hidden="true"] {
  display: none !important;
  pointer-events: none !important;
}

/* ===== Card ===== */
.modal .modal-content {
  width: 100%;
  max-width: 720px;              /* roomy like the template */
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(2, 6, 23, 0.25);
  overflow: hidden;              /* keeps header radius clean */
  display: grid;
  grid-template-rows: auto 1fr auto;
}

/* ===== Header (dark band with title) ===== */
#addContactModalTitle {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: #fff;
  line-height: 1;
  padding: 16px 20px;
  background: #0f172a;           /* deep slate */
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

/* remove the empty .modal-content block */

#addContactModal .modal-content > label,
#addContactModal .modal-content > input,
#addContactModal .modal-content > .modal-actions {
  padding-left: 20px;
  padding-right: 20px;
}


#addContactModal label {
  margin-top: 16px;
  margin-bottom: 6px;
  font-size: 12.5px;
  font-weight: 600;
  color: #475569;                /* slate-500 */
  letter-spacing: .02em;
}

#addContactModal input[type="text"],
#addContactModal input[type="email"] {
  height: 40px;
  border: 1px solid #e2e8f0;     /* slate-200 */
  border-radius: 10px;
  padding: 0 12px;
  font-size: 14px;
  color: #0f172a;
  background: #fff;
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
#addContactModal input::placeholder { color: #94a3b8; }
#addContactModal input:focus {
  border-color: #6366f1;         /* indigo */
  box-shadow: 0 0 0 3px rgba(99,102,241,.18);
}

/* Two-column layout on wider screens (like the template’s tidy alignment) */
/* Replace your empty @media block with this */
@media (min-width: 720px) {
  /* Make the modal body a 2-column grid */
  #addContactModal .modal-content {
    display: grid;
    grid-template-columns: 180px 1fr; /* label | field */
    row-gap: 10px;
  }

  /* Title bar and footer span both columns */
  #addContactModal h3,
  #addContactModal .modal-actions {
    grid-column: 1 / -1;
  }

  /* Labels stay in the left column */
  #addContactModal label {
    grid-column: 1;
    align-self: center;
    margin-top: 12px; /* optional to tighten spacing on wide screens */
  }

  /* Inputs sit in the right column */
  #addContactModal input[type="text"],
  #addContactModal input[type="email"] {
    grid-column: 2;
    margin-top: 8px;
  }
}


/* ===== Footer (actions) ===== */
#addContactModal .modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  padding: 16px 20px 20px;
  border-top: 1px solid #e2e8f0;
  margin-top: 20px;              /* space from fields */
}

/* Buttons */
#saveContactBtn,
#cancelContactBtn {
  appearance: none;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: transform .04s ease, box-shadow .15s ease, background-color .15s ease, border-color .15s ease, color .15s ease;
}

/* Primary (Save) */
#saveContactBtn {
  background: #4f46e5;          /* indigo-600 */
  color: #fff;
  box-shadow: 0 6px 16px rgba(79,70,229,.25);
}
#saveContactBtn:hover { background: #4338ca; }
#saveContactBtn:active { transform: translateY(1px); }

/* Secondary (Cancel) */
#cancelContactBtn {
  background: #ffffff;
  color: #0f172a;
  border-color: #cbd5e1;
}
#cancelContactBtn:hover {
  background: #f8fafc;
  border-color: #94a3b8;
}

/* Small helper for compact spacing on very small screens */
@media (max-width: 380px) {
  #addContactModalTitle { padding: 14px 16px; }
  #addContactModal .modal-actions { padding: 12px 16px 16px; }
}

/* ===== New Project Modal ===== */


/* Card */
#newProjectModal .modal-content {
  width: 100%;
  max-width: 760px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(2, 6, 23, 0.25);
  overflow: hidden;
  display: grid;
  grid-template-rows: auto 1fr auto;
}

/* Header */
#newProjectModalTitle {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: #0f172a;
  line-height: 1;
  padding: 16px 20px;
  background: #0f172a; /* dark slate band to match template */
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

/* Body spacing */
#newProjectModal .modal-content > label,
#newProjectModal .modal-content > input,
#newProjectModal .modal-content > select,
#newProjectModal .modal-content > textarea,
#newProjectModal .modal-content > .modal-actions {
  padding-left: 20px;
  padding-right: 20px;
}

/* Labels */
#newProjectModal label {
  margin-top: 16px;
  margin-bottom: 6px;
  font-size: 12.5px;
  font-weight: 600;
  color: #475569; /* slate-500 */
  letter-spacing: .02em;
}

/* Inputs / Selects / Date / Textarea */
#newProjectModal input[type="text"],
#newProjectModal input[type="date"],
#newProjectModal select,
#newProjectModal textarea {
  width: 100%;
  border: 1px solid #e2e8f0;   /* slate-200 */
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px;
  color: #0f172a;
  background: #fff;
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
  min-height: 40px;
}

#newProjectModal textarea {
  min-height: 110px;
  resize: vertical;
}

#newProjectModal select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, #64748b 50%),
                    linear-gradient(135deg, #64748b 50%, transparent 50%),
                    linear-gradient(to right, #e2e8f0, #e2e8f0);
  background-position: calc(100% - 18px) 50%, calc(100% - 12px) 50%, 100% 0;
  background-size: 6px 6px, 6px 6px, 2.4rem 100%;
  background-repeat: no-repeat;
}

#newProjectModal input:focus,
#newProjectModal select:focus,
#newProjectModal textarea:focus {
  border-color: #6366f1;      /* indigo */
  box-shadow: 0 0 0 3px rgba(99,102,241,.18);
}

/* Two-column grid on wide screens (labels + fields align nicely) */
@media (min-width: 760px) {
  #newProjectModal .modal-content {
    row-gap: 6px;
  }
  /* make Title/Location/Assigned/Deadline 2-up, Notes full width */
  #projectTitle,
  #projectLocation,
  #projectAssignedTo,
  #projectDeadline {
    max-width: 100%;
  }
#addContactModal .modal-content {
  padding-top: 8px; /* anything real to avoid empty ruleset */
}
}

/* Footer */
#newProjectModal .modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  padding: 16px 20px 20px;
  border-top: 1px solid #e2e8f0;
  margin-top: 20px;
}

/* Buttons (reuse your existing primary/secondary styles if global) */
#newProjectModal .modal-actions button {
  appearance: none;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: transform .04s ease, box-shadow .15s ease, background-color .15s ease, border-color .15s ease, color .15s ease;
}

#newProjectModal .modal-actions button[data-i18n="save"] {
  background: #4f46e5;    /* primary */
  color: #fff;
  box-shadow: 0 6px 16px rgba(79,70,229,.25);
}
#newProjectModal .modal-actions button[data-i18n="save"]:hover { background: #4338ca; }
#newProjectModal .modal-actions button[data-i18n="save"]:active { transform: translateY(1px); }

#newProjectModal .modal-actions button[data-i18n="cancel"] {
  background: #ffffff;
  color: #0f172a;
  border-color: #cbd5e1;
}
#newProjectModal .modal-actions button[data-i18n="cancel"]:hover {
  background: #f8fafc;
  border-color: #94a3b8;
}
/* Scrollable middle section */
#newProjectModal .modal-body {
  overflow: auto;                 /* ← scrollbar here */
  -webkit-overflow-scrolling: touch;
  padding: 0 20px 16px;           /* match your content padding */
  min-height: 0;                  /* required for grid children to shrink/scroll */
}
/* Make the middle row actually scroll and keep header/footer fixed */
#newProjectModal .modal-content {
  grid-template-rows: auto minmax(0,1fr) auto;  /* critical: allow shrink */
  max-height: 92vh;
  overflow: hidden;                              /* contain scroll to body */
}

#newProjectModal .modal-body {
  overflow: auto;                                /* scrollbar lives here */
  -webkit-overflow-scrolling: touch;
  padding: 16px 20px 0;                          /* match your spacing */
  display: grid;
  row-gap: 14px;
  min-height: 0;                                 /* critical for scrolling */
}

/* Consistent field blocks */
#newProjectModal .field {
  display: grid;
  row-gap: 6px;
}

/* Divider that matches your style */
#newProjectModal .divider {
  height: 1px;
  background: #e2e8f0;
  border: 0;
  margin: 10px 0;
  border-radius: 999px;
}
/* Header cell itself */
.assign-filter-header {
  position: relative;
  text-align: left;
}

/* The clickable "Assigned To" button */
.assign-filter-header .assign-filter-btn {
  background: transparent;
  border: none;
  padding: 4px 10px;
  border-radius: 999px;
  font: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #0f172a;          /* dark slate */
  appearance: none;
}

/* Hover effect */
.assign-filter-header .assign-filter-btn:hover {
  background: #e0f2fe;      /* light blue */
}

/* Small “current user” label after the title, e.g. "· Alex" */
.assign-filter-current {
  font-size: 0.75rem;
  color: #64748b;           /* slate-500 */
}

/* Tiny caret */
.assign-filter-caret {
  font-size: 0.7rem;
  margin-left: 2px;
}


.assign-filter-btn {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.assign-filter-current {
  font-size: 0.75rem;
  color: #475569; /* slate-600 */
}

.assign-filter-caret {
  font-size: 0.75rem;
}

.assign-filter-menu {
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 4px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.15);
  min-width: 180px;
  z-index: 50;
  overflow: hidden;
}

.assign-filter-menu div {
  padding: 8px 12px;
  cursor: pointer;
  white-space: nowrap;
  font-size: 0.9rem;
}

.assign-filter-menu div:hover {
  background: #f1f5f9;
}


/* -------- Assignments Time Tracker -------- */
#newAssignmentModal .tt-divider { border:0; border-top:1px solid #e5e7eb; margin:8px 0 16px; }

#newAssignmentModal .tt-headrow { display:flex; align-items:center; justify-content:space-between; margin-bottom:8px; }
#newAssignmentModal .tt-titlewrap { display:flex; align-items:center; gap:8px; }
#newAssignmentModal .tt-title { font-weight:600; }

#newAssignmentModal .tt-grid {
  display:grid;
  grid-template-columns: 200px 220px 1fr; /* date | hrs:min | note */
  gap:12px; align-items:end;
}


#newAssignmentModal .tt-field label { display:block; font-size:12px; color:#64748b; margin-bottom:6px; }
#newAssignmentModal .tt-input { width:100%; padding:10px 12px; border:1px solid #e5e7eb; border-radius:10px; background:#fff; }
#newAssignmentModal .tt-hm { display:flex; align-items:center; gap:10px; }
#newAssignmentModal .tt-num { width:64px; text-align:center; }
#newAssignmentModal .tt-colon { opacity:.7; }

#newAssignmentModal .tt-actions { display:flex; align-items:flex-end; justify-content:flex-end; }
#newAssignmentModal .tt-btn { border:0; border-radius:12px; padding:10px 16px; cursor:pointer; }
#newAssignmentModal .tt-primary { background:#5b5ce2; color:#fff; box-shadow:0 2px 8px rgba(91,92,226,.25); }
#newAssignmentModal .tt-ghost { background:#fff; border:1px solid #e5e7eb; }

#newAssignmentModal .tt-toolbar { display:flex; align-items:center; justify-content:space-between; margin:16px 0 10px; }
#newAssignmentModal .tt-totalpill { display:inline-flex; align-items:center; gap:10px; background:#f1f5f9; border-radius:999px; padding:6px 12px; }
#newAssignmentModal .tt-totalpill strong { font-weight:600; }

#newAssignmentModal .tt-card { background:#fff; border:1px solid #e5e7eb; border-radius:12px; max-height:260px; overflow:auto; }

#newAssignmentModal .tt-list .tt-empty { padding:14px; color:#64748b; }

/* List row: Date | Dur | Note | Contributors | Delete */
#newAssignmentModal .tt-row {
  display:grid;
  grid-template-columns: 140px 90px 1fr 220px 56px;
  gap:12px; align-items:center;
  padding:14px; border-bottom:1px solid #f1f5f9;
}
#newAssignmentModal .tt-row:last-child { border-bottom:0; }
#newAssignmentModal .tt-row div { white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }

#newAssignmentModal .tt-iconbtn {
  width:36px; height:36px; border-radius:10px; border:1px solid #e5e7eb; background:#fff; cursor:pointer;
}
#newAssignmentModal .tt-iconbtn:hover { background:#f8fafc; }

/* Contributor chips in the list */
#newAssignmentModal .tt-row .chip {
  display:inline-flex; align-items:center; padding:4px 10px; border-radius:999px;
  border:1px solid #e2e8f0; background:#f8fafc; font-size:12px; margin-right:8px;
}
#newAssignmentModal .tt-toolbar {
  display:flex; align-items:center; justify-content:space-between;
  margin:16px 0 10px;
}
#newAssignmentModal .tt-toolbar-actions {
  display:flex; gap:8px; align-items:center;
}
/* Layout */
#newAssignmentModal .tt-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

/* New button row under notes */
#newAssignmentModal .tt-button-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  margin: 12px 0 14px;
  gap: 10px;
}

/* Keep buttons grouped on right */
#newAssignmentModal .tt-button-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

 #newAssignmentModal .tt-input { 
   width: 100%;   box-sizing: border-box; 
   box-sizing: border-box; 
 }
 #newAssignmentModal .tt-hm input {
   width: 72px;          /* was 100% – this keeps H/M compact */
   box-sizing: border-box;
   text-align: right;
 }

/* Total pill */
#newAssignmentModal .tt-totalpill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: #f1f5f9;
  border-radius: 999px;
  padding: 6px 12px;
}

/* Buttons */
#newAssignmentModal .tt-btn {
  border: none;
  border-radius: 12px;
  padding: 10px 16px;
  cursor: pointer;
}
#newAssignmentModal .tt-primary {
  background: #5b5ce2;
  color: #fff;
}
#newAssignmentModal .tt-ghost {
  background: #fff;
  border: 1px solid #e5e7eb;
}

/* Prevent horizontal scroll entirely */
#newAssignmentModal .modal-content {
  overflow-x: hidden;
}


/* Tidy the big textarea so it doesn’t look like an extra panel */
#newProjectModal textarea {
  resize: vertical;
}
/* Center modal and give it breathing room */
#newProjectModal.modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;                 /* avoids clipping on small screens */
}

/* 3 rows: header | scrollable body | fixed footer */
#newProjectModal .modal-content {
  display: grid;
  grid-template-rows: auto minmax(0,1fr) auto;
  max-height: calc(100vh - 32px); /* fit viewport minus padding */
  width: 100%;
  max-width: 760px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(2, 6, 23, 0.25);
  overflow: hidden;              /* contain scroll to .modal-body */
}

/* Scrollbar lives here */
#newProjectModal .modal-body {
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  min-height: 0;                 /* critical for grids */
  padding: 16px 20px 0;
}

/* Footer stays visible */
#newProjectModal .modal-actions {
  position: sticky;              /* pinned at the bottom of the card */
  bottom: 0;
  background: #fff;
  border-top: 1px solid #e2e8f0;
  padding: 16px 20px 20px;
  z-index: 1;
}
/* ---------- Assignments Time Tracker (clean UI) ---------- */
#newAssignmentModal .tt-divider { border:0; border-top:1px solid #e5e7eb; margin: 8px 0 16px; }

#newAssignmentModal .tt-headrow {
  display:flex; align-items:center; justify-content:space-between; margin-bottom:8px;
}
#newAssignmentModal .tt-titlewrap { display:flex; align-items:center; gap:8px; }
#newAssignmentModal .tt-icon { font-size:16px; line-height:1; }
#newAssignmentModal .tt-title { font-weight:600; }

#newAssignmentModal .tt-rowgrid {
   display: grid;
   gap: 12px;
 }

#newAssignmentModal .tt-field label {
  display:block; font-size:12px; color:#64748b; margin-bottom:6px;
}
#newAssignmentModal .tt-input {
  width:100%; padding:10px 12px; border:1px solid #e5e7eb; border-radius:10px; background:#fff;
}
#newAssignmentModal .tt-note .tt-input { min-width: 240px; }

#newAssignmentModal .tt-hm { display:flex; align-items:center; gap:10px; }
#newAssignmentModal .tt-num { width: 64px; text-align:center; }
#newAssignmentModal .tt-colon { opacity:.7; }

#newAssignmentModal .tt-actions {
  display:flex; align-items:flex-end; justify-content:flex-end;
}
#newAssignmentModal .tt-btn {
  border:0; border-radius:12px; padding:10px 16px; cursor:pointer;
}
#newAssignmentModal .tt-primary { background:#5b5ce2; color:#fff; box-shadow: 0 2px 8px rgba(91,92,226,.25); }
#newAssignmentModal .tt-primary:hover { filter:brightness(0.95); }

#newAssignmentModal .tt-toolbar{
  display:flex; align-items:center; justify-content:space-between;
  margin:16px 0 10px;
}
#newAssignmentModal .tt-totalpill{
  display:inline-flex; align-items:center; gap:10px;
  background:#f1f5f9; color:#111827; border-radius:999px; padding:6px 12px; font-size:14px;
}
#newAssignmentModal .tt-totalpill strong{ font-weight:600; }
#newAssignmentModal .tt-ghost { background:#fff; border:1px solid #e5e7eb; }

#newAssignmentModal .tt-card{
  background:#fff; border:1px solid #e5e7eb; border-radius:12px; padding:0;
  max-height: 260px; overflow:auto; -webkit-overflow-scrolling:touch;
}

#newAssignmentModal .tt-list .tt-empty{
  padding:14px; color:#64748b;
}

#newAssignmentModal .tt-row{
  display:grid; grid-template-columns: 140px 90px 1fr 160px 56px;
  gap: 12px; align-items:center;
  padding:14px; border-bottom:1px solid #f1f5f9;
}
#newAssignmentModal .tt-row:last-child { border-bottom:0; }
#newAssignmentModal .tt-row div { white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }

#newAssignmentModal .tt-iconbtn{
  width:36px; height:36px; border-radius:10px; border:1px solid #e5e7eb;
  background:#fff; cursor:pointer;
}
#newAssignmentModal .tt-iconbtn:hover{ background:#f8fafc; }

/* Keep your 3-row grid */
#newProjectModal .modal-content{
  display:grid;
  grid-template-rows:auto minmax(0,1fr) auto;
  max-height:calc(100vh - 32px);
  overflow:hidden;
}

/* The scroll area; leave bottom space for the sticky footer */
#newProjectModal .modal-body{
  overflow:auto;
  -webkit-overflow-scrolling:touch;
  min-height:0;
  padding:16px 20px 16px;             /* JS will increase bottom padding */
  scroll-padding-bottom: 16px;         /* JS will increase too */
  overscroll-behavior:contain;
}

/* Sticky footer */
#newProjectModal .modal-actions{
  position:sticky;
  bottom:0;
  background:#fff;
  border-top:1px solid #e2e8f0;
  padding:16px 20px 20px;
  z-index:2;
}

/* --- Time Tracking layout polish --- */
#newProjectModal .tt-rowgrid{
  display:grid;
  grid-template-columns: 160px 160px 1fr auto;
  gap:12px;
  align-items:end;        /* align fields nicely */
}
@media (max-width: 720px){
  #newProjectModal .tt-rowgrid{
    grid-template-columns:1fr 1fr;
  }
  #newProjectModal .tt-actions{ grid-column:1/-1; justify-self:start; }
}
/* ---- Time Tracking: de-overlap + tidy ---- */

/* Ensure inputs measure inside their cell */
#newProjectModal .tt-input { box-sizing: border-box; }

/* 3 columns for fields; actions forced to a new line */
#newProjectModal .tt-rowgrid{
  display: grid;
  grid-template-columns: 180px 160px 1fr; /* Date | Hrs/Min | Note */
  gap: 12px;
  align-items: end;
}

/* Put the Add button on its own row, full width, aligned right */
#newProjectModal .tt-actions{
  grid-column: 1 / -1;        /* new line below the fields */
  justify-self: end;          /* right-aligned */
  align-self: start;
  margin-top: 6px;
  position: static;           /* guard against any global absolute btn styles */
  z-index: 0;                 /* avoid covering inputs */
}

/* Make sure the Note input never hides under the button shadow */
#newProjectModal .tt-note .tt-input{ width: 100%; }

/* Optional: keep things graceful on narrow screens */
@media (max-width: 720px){
  #newProjectModal .tt-rowgrid{
    grid-template-columns: 1fr; /* stack fields on phones */
  }
  #newProjectModal .tt-actions{ justify-self: stretch; }
}

/* make buttons sit within their grid cell (no overlap) */
#newProjectModal .tt-actions{ justify-self:end; align-self:end; }
#newProjectModal .tt-btn{ min-height:38px; }

/* give the list a little extra bottom space so it never tucks under footer */
#newProjectModal .tt-list{ margin-top:10px; margin-bottom:12px; }

/* Optional: tidy webkit scrollbar */
#newProjectModal .modal-body::-webkit-scrollbar { width: 10px; }
#newProjectModal .modal-body::-webkit-scrollbar-thumb { background: #e2e8f0; border-radius: 8px; }
#newProjectModal .modal-body::-webkit-scrollbar-thumb:hover { background: #cbd5e1; }
/* Time list: add a delete column + icon button */
#newProjectModal .tt-list .tt-row{
  display:grid;
  grid-template-columns:160px 100px 1fr 36px; /* + delete column */
  gap:10px;
  padding:10px 12px;
  border-bottom:1px solid #eef2f7;
  align-items:center;
}
#newProjectModal .tt-list .tt-row:last-child{ border-bottom:0; }

#newProjectModal .tt-iconbtn{
  width:32px; height:32px; border-radius:8px;
  border:1px solid #e2e8f0; background:#fff; cursor:pointer;
  display:flex; align-items:center; justify-content:center;
  font-size:14px;
  transition:background .15s, border-color .15s, transform .04s;
}
#newProjectModal .tt-iconbtn:hover{
  background:#fff5f5; border-color:#fecaca;
}
#newProjectModal .tt-iconbtn:active{ transform:translateY(1px); }
/* ----- Projects modal: time inputs only ----- */
#newProjectModal .tt-timewrap {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

#newProjectModal #ttHours,
#newProjectModal #ttMinutes {
  box-sizing: border-box;
  width: 86px;                /* keep both equal */
  height: 40px;
  padding: 8px 12px;
  text-align: center;
  font-size: 16px;
  line-height: 1;
  border: 1px solid #cbd5e1;  /* slate-300 */
  border-radius: 10px;
  background: #fff;
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}

/* hover/focus polish */
#newProjectModal #ttHours:hover,
#newProjectModal #ttMinutes:hover {
  border-color: #94a3b8;      /* slate-400 */
}

#newProjectModal #ttHours:focus,
#newProjectModal #ttMinutes:focus {
  border-color: #0ea5e9;      /* sky-500 */
  box-shadow: 0 0 0 3px rgba(14,165,233,.15);
}

/* nice centered colon */
#newProjectModal .tt-colon {
  display: inline-block;
  min-width: 10px;
  text-align: center;
  font-weight: 600;
  color: #64748b;             /* slate-500 */
  transform: translateY(1px);
}

/* remove number spinners (keeps look clean) */
#newProjectModal input[type="number"]{
  appearance: textfield;      /* standard */
  -moz-appearance: textfield; /* Firefox */
}

#newProjectModal input[type="number"]::-webkit-outer-spin-button,
#newProjectModal input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* optional: tighten the grid so Hrs/Min don’t stretch oddly */
#newProjectModal .tt-rowgrid {
  display: grid;
  grid-template-columns: 260px 220px 1fr; /* Date | Hrs/Min | (Contrib/empty) */
  gap: 16px 20px;
}
.equip-mode--active {
  border-color:#0ea5e9 !important;
  box-shadow:0 0 0 3px rgba(14,165,233,.15);
  background:#f0f9ff !important;
}


/* ===========================================
   Recurring Assignment — Template-aligned UI
   =========================================== */
#recurringAssignmentModal .modal-content{
  width:100%;
  max-width:880px;
  max-height:80vh;
  overflow:auto;
  background:#fff;
  border-radius:12px;
  box-shadow:0 16px 48px rgba(2,6,23,.25);
  padding:0 20px 20px;                 /* body padding, header is edge-to-edge */
  display:grid;
  grid-template-columns: 1fr;          /* becomes 4 cols on wide screens */
  row-gap:14px;
  box-sizing:border-box;
}

/* Header bar (template) */
#recurringAssignmentModalTitle{
  grid-column:1 / -1;
  margin:0 0 14px;
  padding:14px 20px;
  background:#0b1c54;
  color:#fff;
  font-weight:700;
  font-size:18px;
  line-height:1;
  border-top-left-radius:12px;
  border-top-right-radius:12px;
}

/* Labels (left column look) */
#recurringAssignmentModal label{
  font-size:13px;
  font-weight:600;
  color:#334155;
  margin:0 0 6px;
}

/* Inputs/selects/textarea — compact, capped width like template */
#recurringAssignmentModal input:not([type="checkbox"]):not([type="radio"]),
#recurringAssignmentModal select,
#recurringAssignmentModal textarea,
#recurringAssignmentModal #recTitle{
  width:100%;
  max-width:440px;                      /* prevents giant full-width fields */
  min-height:38px;
  border:1px solid #e2e8f0;
  border-radius:8px;
  padding:8px 12px;
  font-size:14px;
  color:#0f172a;
  background:#fff;
  box-sizing:border-box;
  outline:none;
  transition:border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
}
#recurringAssignmentModal textarea{ min-height:110px; resize:vertical; }
#recurringAssignmentModal input::placeholder,
#recurringAssignmentModal textarea::placeholder{ color:#94a3b8; }
#recurringAssignmentModal input:focus,
#recurringAssignmentModal select:focus,
#recurringAssignmentModal textarea:focus,
#recurringAssignmentModal #recTitle:focus{
  border-color:#6366f1;
  box-shadow:0 0 0 2px rgba(99,102,241,.16);
}

/* Select caret (subtle) */
#recurringAssignmentModal select{
  appearance:none;
  background-image:
    linear-gradient(45deg, transparent 50%, #64748b 50%),
    linear-gradient(135deg, #64748b 50%, transparent 50%),
    linear-gradient(to right, #e2e8f0, #e2e8f0);
  background-position: calc(100% - 18px) 50%, calc(100% - 12px) 50%, 100% 0;
  background-size: 6px 6px, 6px 6px, 2.4rem 100%;
  background-repeat:no-repeat;
}
#recAssignee {
  --ctl-h: 40px;
  height: var(--ctl-h);
  min-height: var(--ctl-h);
  line-height: calc(var(--ctl-h) - 2px);
  padding-block: 6px !important;
  box-sizing: border-box;
}


/* Equipment search spacing (remove big gap) */
#recurringAssignmentModal label[for="recEquipSearch"]{ margin-bottom:6px; }
#recurringAssignmentModal #recEquipSearch{ max-width: 440px; }

/* Blue “Add Another Asset” button (full width of field column) */
#recurringAssignmentModal .modal-content > button:not(.removeEquipmentBtn):not(.recRemoveDateBtn){
  height:42px;
  max-width:440px;
  border:1px solid transparent;
  border-radius:8px;
  background:#4f7de9;
  color:#fff;
  font-weight:700;
  cursor:pointer;
  transition:filter .15s ease, transform .04s ease;
}
#recurringAssignmentModal .modal-content > button:not(.removeEquipmentBtn):not(.recRemoveDateBtn):hover{ filter:brightness(.97); }
#recurringAssignmentModal .modal-content > button:not(.removeEquipmentBtn):not(.recRemoveDateBtn):active{ transform:translateY(1px); }

/* Dynamic equipment rows */
#recurringAssignmentModal .equipmentField{
  display:grid;
  grid-template-columns: 1fr auto;
  gap:8px;
  max-width:440px;
}
#recurringAssignmentModal .equipmentField .recEquipInput{
  min-height:38px;
  border:1px solid #e2e8f0;
  border-radius:8px;
  padding:8px 12px;
  font-size:14px;
}
#recurringAssignmentModal .equipmentField .removeEquipmentBtn,
#recurringAssignmentModal .recRemoveDateBtn{
  height:38px; min-width:38px;
  border-radius:8px;
  border:1px solid #fecaca;
  background:#fff1f2;
  font-weight:700;
  cursor:pointer;
}

/* Footer (template: right-aligned, CANCEL + SAVE) */
#recurringAssignmentModal .modal-actions{
  grid-column:1 / -1;
  display:flex;
  gap:10px;
  justify-content:flex-end;            /* right-aligned like screenshot */
  padding-top:12px;
  margin-top:8px;
  border-top:1px solid #e2e8f0;
}
#recurringAssignmentModal .modal-actions button{
  appearance:none;
  border:1px solid transparent;
  border-radius:8px;
  padding:10px 16px;
  font-size:14px;
  font-weight:700;
  cursor:pointer;
}
#recurringAssignmentModal .modal-actions [data-i18n="cancel"]{
  background:#fff; color:#475569; border-color:#cbd5e1;
}
#recurringAssignmentModal .modal-actions [data-i18n="cancel"]:hover{
  background:#f8fafc; border-color:#94a3b8;
}
#recurringAssignmentModal .modal-actions [data-i18n="saveRecurring"]{
  background:#4f46e5; color:#fff;
  box-shadow:0 6px 16px rgba(79,70,229,.25);
}
#recurringAssignmentModal .modal-actions [data-i18n="saveRecurring"]:hover{ background:#4338ca; }

/* -------------------------------------------
   Wide screens: exact template grid alignment
   label | field | label | field
   ------------------------------------------- */
@media (min-width: 940px){
  #recurringAssignmentModal .modal-content{
    grid-template-columns: 160px 1fr 160px 1fr;   /* label/field pairs */
    column-gap:16px;
  }

  /* Title spans the field columns (2 → 4) */
  #recurringAssignmentModal label[for="recTitle"]{ grid-column:1; }
  #recurringAssignmentModal #recTitle{ grid-column:2 / 5; max-width:none; }

  /* Start Date | Frequency on the same row */
  #recurringAssignmentModal label[for="recStart"]{ grid-column:1; }
  #recurringAssignmentModal #recStart{ grid-column:2; }
  #recurringAssignmentModal label[for="recFrequency"]{ grid-column:3; }
  #recurringAssignmentModal #recFrequency{ grid-column:4; }

  /* Equipment (label on left, controls in field columns) */
  #recurringAssignmentModal label[for="recEquipSearch"]{ grid-column:1; }
  #recurringAssignmentModal #recEquipSearch{ grid-column:2 / 5; max-width:none; }
  #recurringAssignmentModal .modal-content > button:not(.removeEquipmentBtn):not(.recRemoveDateBtn){ grid-column:2 / 5; max-width:none; }
  #recurringAssignmentModal #recEquipContainer{ grid-column:2 / 5; }

  /* Assigned To (single field; not giant due to max-width) */
  #recurringAssignmentModal label[for="recAssignee"]{ grid-column:1; }
  #recurringAssignmentModal #recAssignee{ grid-column:2; }

  /* Notes full-width across field columns */
  #recurringAssignmentModal label[for="recNotes"]{ grid-column:1; }
  #recurringAssignmentModal #recNotes{ grid-column:2 / 5; max-width:none; }

  /* Footer spans full width */
  #recurringAssignmentModal .modal-actions{ grid-column:1 / 5; }
}
/* --- Header seam / divider under navy bar --- */
#recurringAssignmentModalTitle{
  margin: 0 -20px 12px;
  padding: 18px 20px;
  background: #0b1c54;
  color: #fff;
  font-weight: 700;
  font-size: 18px;
  line-height: 1;
  border-top-left-radius: 12px;
  border-top-right-radius: 12px;
  border-bottom: 0;
  box-shadow: inset 0 -1px 0 rgba(255,255,255,.10);
}

/* Mobile: keep button stacked (no change) */
#recurringAssignmentModal .modal-content > button:not(.removeEquipmentBtn):not(.recRemoveDateBtn){
  height: 40px;
  border-radius: 8px;
}

/* Desktop: equipment input + button on the SAME row */
@media (min-width: 940px){
  /* Grid already set to: 160px 1fr 160px 1fr (label|field|label|field).
     Place label in col 1, input across cols 2–3, button in col 4. */
  #recurringAssignmentModal label[for="recEquipSearch"]{
    grid-column: 1; align-self: center; margin-bottom: 0;
  }
  #recurringAssignmentModal #recEquipSearch{
    grid-column: 2 / 4;              /* spans columns 2 & 3 */
    max-width: none;                  /* let it fill those columns */
    margin-top: 0;
  }
  #recurringAssignmentModal .modal-content > button:not(.removeEquipmentBtn):not(.recRemoveDateBtn){
    grid-column: 4;                   /* right side of the row */
    justify-self: end;
    align-self: center;
    width: auto;                      /* small button, not full width */
    min-width: 160px;
    padding: 8px 14px;
    margin: 0;                        /* same row, no top margin */
  }
  /* The dynamic equipment list still spans full field width below */
  #recurringAssignmentModal #recEquipContainer{
    grid-column: 2 / 5;
  }
}

/* modal footer layout */
.modal-actions,
.modal-footer {
  display: flex;
  gap: .75rem;
  justify-content: flex-end;
  align-items: center;
}

/* danger button (Delete) */
.btn-danger {
  background: #ef4444;
  border: 1px solid #ef4444;
  color: #fff;
  border-radius: 10px;
  padding: .625rem 1rem;
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(0,0,0,.06);
  transition: transform .05s ease, box-shadow .2s ease, background .2s ease, border-color .2s ease;
}
/* Hidden modals must not intercept pointer events */
.modal[aria-hidden="true"] { display: none !important; }
.modal:not(.open)         { display: none !important; }

/* If you use a backdrop element inside .modal */
.modal[aria-hidden="true"] * { pointer-events: none !important; }
:root{
  --brand:#3b5cff; --brand-600:#2e46c7; --brand-700:#2539a5;
  --ink:#0f172a; --text:#1f2937; --sub:#6b7280;
  --stroke:#e5e7eb; --stroke-2:#d1d5db; --focus:rgba(59,92,255,.35);
  --card:#fff; --shadow:0 10px 24px rgba(15,23,42,.08);
}

/* Panel shell */
.settings-panel{
  max-width: 860px; margin: 28px auto; background: var(--card);
  border:1px solid var(--stroke); border-radius:14px; box-shadow:var(--shadow);
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
  color:var(--text); overflow:hidden;
}

/* Header bar like the right screenshot */
.settings-panel .settings-header{
  background: linear-gradient(0deg, var(--brand-700), var(--brand));
  color:#fff; padding:16px 22px; display:flex; align-items:center; gap:12px;
}
.settings-panel .settings-header .title{ font-weight:700; font-size:18px; }
.settings-panel .settings-header .subtitle{ margin-left:auto; opacity:.9; font-size:13px; }

/* Body */
.settings-panel .settings-body{ padding:20px clamp(20px,4vw,28px); }

/* Section blocks */
.settings-panel .section{
  border:1px solid var(--stroke); border-radius:12px; background:#fff;
  padding:16px; margin-bottom:16px;
}
.settings-panel .section-header{
  display:flex; align-items:center; gap:10px; margin-bottom:10px;
  color:var(--ink); font-weight:700;
}
.settings-panel .section-header .icon{
  width:22px;height:22px;display:grid;place-items:center;border-radius:6px;
  background:rgba(59,92,255,.12); color:#2e46c7;
}

/* Rows */
.settings-panel .row{
  display:grid; grid-template-columns: 220px 1fr auto; gap:12px;
  align-items:center; padding:10px 0; border-top:1px dashed var(--stroke);
}
.settings-panel .row:first-of-type{ border-top:0; }
.settings-panel label{ color:var(--sub); font-size:13px; font-weight:600; }

/* Inputs */
.settings-panel select,
.settings-panel input[type="email"],
.settings-panel input[type="password"]{
  height:38px; border-radius:10px; border:1px solid var(--stroke-2);
  background:#fff; padding:0 12px; font-size:14px; outline:none;
  transition: box-shadow .15s, border-color .15s, background .15s;
}
.settings-panel select:focus,
.settings-panel input:focus{
  border-color:var(--brand); box-shadow:0 0 0 4px var(--focus);
}

/* Buttons */
.settings-panel .btn{
  height:36px; padding:0 14px; border-radius:10px; border:1px solid transparent;
  background:#f8fafc; color:var(--text); font-weight:600; font-size:14px;
  display:inline-flex; align-items:center; gap:8px; cursor:pointer;
  transition: transform .04s, box-shadow .15s, background .15s, border-color .15s;
}
.settings-panel .btn:hover{ background:#eef2ff; }
.settings-panel .btn:active{ transform:translateY(1px); }

.settings-panel .btn.primary{ background:var(--brand); color:#fff; box-shadow:0 6px 16px rgba(59,92,255,.25); }
.settings-panel .btn.primary:hover{ background:var(--brand-600); }
.settings-panel .btn.primary:active{ background:var(--brand-700); }

.settings-panel .btn.ghost{ background:#fff; border-color:var(--stroke-2); color:var(--ink); }
.settings-panel .btn.ghost:hover{ border-color:var(--brand); background:#fff; box-shadow:0 0 0 4px var(--focus); }

.settings-panel .btn.danger{ background:#fee2e2; color:#b91c1c; border-color:#fecaca; }
.settings-panel .btn.danger:hover{ background:#fecaca; }

/* Cards / separators */
.settings-panel .card{ border:1px solid var(--stroke); border-radius:12px; padding:16px; background:#fff; }
.settings-panel .card-title{ font-weight:700; color:var(--ink); margin-bottom:10px; }
.settings-panel .controls-inline{ display:flex; gap:10px; align-items:center; flex-wrap:wrap; }
.settings-panel .stack{ display:grid; gap:8px; }
.settings-panel .divider{ height:1px; background:var(--stroke); margin:16px 0; }
.settings-panel .footer-actions{ margin-top:14px; }

#equipmentAuditModal { z-index: 1100; } /* higher than your base .modal */
.pwa-install { padding:.45rem .8rem; border-radius:6px; border:1px solid #0ea5e9; }

#modalBackdrop[aria-hidden="true"]  { display:none !important; pointer-events:none !important; }
#modalBackdrop[aria-hidden="false"] { display:block !important; pointer-events:auto !important; }
/* Works whether the element has .modal or just role="dialog" */
.modal[aria-hidden="true"],
[role="dialog"][aria-hidden="true"]  { display:none !important; pointer-events:none !important; }

.modal[aria-hidden="false"],
[role="dialog"][aria-hidden="false"] { display:flex !important; pointer-events:auto !important; }

/* Calendar completion badge */
.calendar-day { position: relative; } /* safe, doesn't reflow */
.calendar-day .cal-complete-badge {
  position: absolute; right: 6px; bottom: 6px;
  width: 16px; height: 16px; border-radius: 50%;
  background: #22c55e; color: #fff; font-size: 11px; line-height: 16px;
  text-align: center; font-weight: 700; pointer-events: none;
}
.calendar-day .cal-complete-badge::before { content: "✓"; }
/* 🔹 Compact checkbox style for supplier create-contact option */
/* Base: desktop remains unchanged */
/* Assignments page: let the header stay, list area scrolls */
.assignments-layout {
  display: grid;
  grid-template-rows: auto 1fr;     /* header / list */
  gap: 12px;
  min-height: calc(100vh - 120px);  /* leaves room for topbar & padding */
}
/* nudge the Assignments block down a bit */
.assignments-layout {
  margin-top: 20px;  /* tweak 8–20px to taste */
}

/* The table/list wrapper you render into */
.assignments-scroll {
  overflow: auto;
  /* subtract any local toolbars above the list; tweak the constant to taste */
  max-height: calc(100vh - 220px);
}

/* Make sure the page itself isn’t height-capped */
.main-content { min-height: 100vh; }
body { overflow-y: auto; }

/* hidden on desktop by default */
header.topbar.topbar--mobile { display: none; }
@media (min-width: 768px){
  .modal[aria-hidden="true"] { display: none !important; }
}

/* Scope to BOTH modals */
:is(#newProjectModal,#newAssignmentModal) .form-grid #timeTrackSection{
  grid-column: 1 / -1;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  box-sizing: border-box;
}

/* Card styling */
:is(#newProjectModal,#newAssignmentModal) #timeTrackSection{
  background:#f8fafc;
  border:1px solid #e5e7eb;
  border-radius:12px;
  padding:16px;
  margin-top:14px;
}

/* Row 1: Date | Hrs:Min | Note | Add */
:is(#newProjectModal,#newAssignmentModal) #timeTrackSection > div:nth-of-type(1){
  display:grid;
  grid-template-columns:
    minmax(150px, 1fr)     /* Date */
    minmax(160px, 1fr)     /* Hrs:Min (inner grid below) */
    minmax(220px, 2fr)     /* Note */
    minmax(88px, auto);    /* Add */
  gap:14px;
  align-items:end;
}

:is(#newProjectModal,#newAssignmentModal) #timeTrackSection > div:nth-of-type(1) > *{ min-width:0; }
:is(#newProjectModal,#newAssignmentModal) #timeTrackSection input,
:is(#newProjectModal,#newAssignmentModal) #timeTrackSection button{
  min-width:0;
  box-sizing:border-box;
  height:36px;             /* uniform control height */
}
:is(#newProjectModal,#newAssignmentModal) #timeTrackSection label{
  display:block;
  font-size:.9rem;
  margin-bottom:4px;
}

/* Hrs:Min tiny grid — apply this to the wrapper that contains ttHours/ttMinutes */
:is(#newProjectModal,#newAssignmentModal) #timeTrackSection .tt-hm{
  display:grid;
  grid-template-columns: 80px 16px 80px; /* Hrs | : | Min */
  align-items:center;
  gap:8px;
}
:is(#newProjectModal,#newAssignmentModal) #timeTrackSection .tt-hm .tt-colon{
  text-align:center;
  font-weight:600;
}

/* Row 2: total / refresh */
:is(#newProjectModal,#newAssignmentModal) #timeTrackSection > div:nth-of-type(2){
  margin-top:12px;
  display:flex;
  justify-content:space-between;
  align-items:center;
}

/* Inputs look + spinner cleanup */
:is(#newProjectModal,#newAssignmentModal) #timeTrackSection input[type="date"],
:is(#newProjectModal,#newAssignmentModal) #timeTrackSection input[type="number"],
:is(#newProjectModal,#newAssignmentModal) #timeTrackSection input[type="text"]{
  width:100%;
  padding:8px 10px;
  border:1px solid #d1d5db;
  border-radius:8px;
  background:#fff;
}
:is(#newProjectModal,#newAssignmentModal) #timeTrackSection input[type="number"]{
  text-align:center;
 
}
:is(#newProjectModal,#newAssignmentModal) #timeTrackSection input[type="number"]::-webkit-outer-spin-button,
:is(#newProjectModal,#newAssignmentModal) #timeTrackSection input[type="number"]::-webkit-inner-spin-button{
  -webkit-appearance:none; margin:0;
}

/* Button alignment */
:is(#newProjectModal,#newAssignmentModal) #timeTrackSection #ttAddBtn{
  justify-self:end;
  padding:0 14px;
}

/* Responsive: never overflow */
@media (max-width: 900px){
  :is(#newProjectModal,#newAssignmentModal) #timeTrackSection > div:nth-of-type(1){
    grid-template-columns: 1fr 1fr;
  }
  :is(#newProjectModal,#newAssignmentModal) #timeTrackSection > div:nth-of-type(1) > :nth-child(3){ grid-column:1 / -1; } /* Note spans */
  :is(#newProjectModal,#newAssignmentModal) #timeTrackSection > div:nth-of-type(1) > :nth-child(4){
    grid-column:2 / 3; justify-self:end;
  }
}
@media (max-width: 560px){
  :is(#newProjectModal,#newAssignmentModal) #timeTrackSection > div:nth-of-type(1){
    grid-template-columns: 1fr;
  }
  :is(#newProjectModal,#newAssignmentModal) #timeTrackSection > div:nth-of-type(1) > :nth-child(4){
    grid-column:1 / -1; width:100%;
  }
}

/* Mark days that have assignments (fallback class + :has) */
#calendarContainer .calendar-day.has-assignments,
#calendarContainer .calendar-day:has(.assignment-badge, .project-deadline-chip) {
  box-shadow: inset 0 0 0 1px #94a3b8; /* subtle default ring */
  transition: box-shadow .15s ease, background-color .15s ease, transform .05s ease;
}

/* Hover cue only on days that have content */
#calendarContainer .calendar-day.has-assignments:hover,
#calendarContainer .calendar-day:has(.assignment-badge, .project-deadline-chip):hover {
  cursor: pointer;
  background-color: #f8fafc;
  box-shadow: inset 0 0 0 2px #3b82f6;
  transform: translateY(-1px);
}

/* Optional: make badges pop a bit on hover */
#calendarContainer .calendar-day.has-assignments:hover .assignment-badge,
#calendarContainer .calendar-day:has(.assignment-badge, .project-deadline-chip):hover .assignment-badge {
  background-color: #e0e7ff;
}
/* Calendar: closed occurrence styling */
.cal-occurrence--closed {
  text-decoration: line-through;
  opacity: .55;
}

/* optional: small checkmark pill */
.cal-occurrence--closed::before {
  content: "✓ ";
  font-weight: 700;
  opacity: .9;
}
.assignment-badge--closed {
  text-decoration: line-through;
  opacity: .65;
}

/* Keep 'today' ring visible with hover */
#calendarContainer .calendar-day.today.has-assignments:hover,
#calendarContainer .calendar-day.today:has(.assignment-badge, .project-deadline-chip):hover {
  outline: 2px solid #3b82f6;
  outline-offset: -2px;
}

/* Scroll container */
#main-content.reports-scroll{
  display:flex;
  flex-direction:column;
  height:calc(100vh - 64px);
  overflow:hidden;
}
#main-content.reports-scroll .reports-page{
  flex:1;
  overflow-y:auto;
  padding:16px 24px;
  background:#f9fafb;
  border-radius:6px;
}

/* Grid */
.reports-row{ display:grid; gap:16px; margin-bottom:20px; }
@media (min-width:800px){
  .reports-row--summary{ grid-template-columns:repeat(3,1fr); }
  .reports-row--lists{ grid-template-columns:repeat(2,1fr); }
}

/* Cards */
.report-card{
  background:#fff;
  border-radius:12px;
  box-shadow:0 1px 3px rgba(0,0,0,.1);
  padding:16px 20px;
  display:flex;
  flex-direction:column;
}

/* Default canvases (line/bar) get reliable heights */
.report-card canvas{
  display:block;
  width:100% !important;
  height:220px !important;
}
.report-card--wide canvas{ height:300px !important; }

/* Donut cards keep perfect circles via a square wrapper */
.report-card--donut .chart-donut{
  position:relative;
  width:100%;
  max-width:420px;
  aspect-ratio:1/1;
  margin:8px auto 0;
}
.report-card--donut .chart-donut canvas{
  position:absolute;
  inset:0;
  width:100% !important;
  height:100% !important;
}

.spinner {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 3px solid rgba(0,0,0,0.1);
  border-top-color: rgba(0,0,0,0.4);
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}
.cleanup-btn {
  background-color: #3b82f6;      /* Blue */
  color: white;
  padding: 8px 18px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-size: 14px;
  transition: background-color .2s;
}

.cleanup-btn:hover {
  background-color: #2563eb;     /* Slightly darker blue */
}
/* Base modal layer (if you don't already have z-index on it) */
.modal {
  z-index: 1000;
}

/* Scanner modal should always be above other modals */
#barcodeScannerModal {
  z-index: 2000;
}
/* ===== Rental Properties page layout ===== */

.rentals-page {
  padding: 1.5rem 2rem;
  max-width: 100%;
  box-sizing: border-box;
}

/* Header bar similar to Assignments */
.rentals-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 1.5rem;
  margin-bottom: 1rem;
  border-radius: 0.75rem;
  background: #e5f0ff;               /* light blue banner */
}

.rentals-title {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 600;
  color: #111827;                     /* gray-900 */
}

.rentals-header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.rentals-add-btn {
  font-weight: 500;
}

/* Card containing the table, like Assignments list */
.rentals-card {
  background: #ffffff;
  border-radius: 0.75rem;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
  padding: 1rem 1.5rem 1.25rem;
  max-width: 100%;
  overflow-x: auto;   /* if it ever overflows, only the card scrolls */
}

/* Table spacing */
.rentals-card .data-table {
  width: 100%;
  border-collapse: collapse;
}

/* let headers stay on one line, body cells can wrap */
.rentals-card .data-table th,
.rentals-card .data-table td {
  padding: 0.65rem 0.75rem;
}

.rentals-card .data-table th {
  font-weight: 600;
  border-bottom: 1px solid #e5e7eb;
  white-space: nowrap;
}

.rentals-card .data-table td {
  white-space: normal;  /* long addresses wrap instead of forcing sideways scroll */
}

/* Slight zebra striping like other lists, if you want */
.rentals-card .data-table tbody tr:nth-child(even) {
  background-color: #f9fafb;
}

/* Responsive padding */
@media (max-width: 640px) {
  .rentals-page {
    padding: 1rem;
  }
  .rentals-card {
    padding: 0.75rem 1rem 1rem;
  }
}
/* Keep action buttons on one line with spacing */
.rentals-card .actions-cell {
  white-space: nowrap;
}

.rentals-card .actions-cell .rentals-action-btn {
  margin-right: 0.4rem;
}

.rentals-card .actions-cell .rentals-action-btn:last-child {
  margin-right: 0;
}
/* ===== Rental Property modal styling (match New Assignment) ===== */

#rentalPropertyModal .rental-modal {
  max-width: 900px;              /* similar width to assignment modal */
  margin: 2rem auto;
  border-radius: 1.25rem;
  overflow: hidden;
}

/* header already has the blue gradient from your global .modal-header */

/* Body: two-column grid on desktop */
#rentalPropertyModal .rental-modal-body {
  padding: 1.5rem 2rem;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem 1.5rem;              /* row / column gap */
  background: #f9fafb;
}

/* Full-width rows (name + address) */
#rentalPropertyModal .form-row--full {
  grid-column: 1 / -1;
}

/* Labels */
#rentalPropertyModal .form-row label {
  font-size: 0.85rem;
  font-weight: 600;
  color: #4b5563;                /* gray-700 */
  margin-bottom: 0.25rem;
}

/* Inputs & selects */
#rentalPropertyModal .form-row input,
#rentalPropertyModal .form-row select,
#rentalPropertyModal .form-row textarea {
  width: 100%;
  border-radius: 0.5rem;
  border: 1px solid #d1d5db;     /* gray-300 */
  padding: 0.5rem 0.75rem;
  font-size: 0.95rem;
  background-color: #ffffff;
  box-sizing: border-box;
}

#rentalPropertyModal .form-row input:focus,
#rentalPropertyModal .form-row select:focus {
  outline: none;
  border-color: #2563eb;         /* blue-600 */
  box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.25);
}

/* Footer buttons aligned to the right */
#rentalPropertyModal .rental-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  padding: 0.75rem 2rem 1.5rem;
  border-top: 1px solid #e5e7eb;
  background: #f9fafb;
}

/* Responsive: stack fields on small screens */
@media (max-width: 768px) {
  #rentalPropertyModal .rental-modal-body {
    grid-template-columns: 1fr;
  }
}
/* -------------- MOBILE ONLY (<600px) -------------- */
@media (max-width: 599px) {
  
  /* Main layout spacing */
  .main-content,
  #main-content {
    padding: 0.75rem !important;
    margin: 0 !important;
  }

  /* Sidebar turns into a slide-out drawer */
  .sidebar {
    position: fixed;
    top: 0;
    left: -260px;
    width: 230px;
    height: 100vh;
    background: #0f172a;  /* your dark navy */
    z-index: 50;
    transition: left 0.25s ease;
  }

  .sidebar.sidebar--open {
    left: 0;
  }

  /* Ensure topbar mobile UI displays ONLY on phones */
  .topbar--mobile {
    display: flex !important;
  }

  /* Mobile hamburger fixes */
  .hamburger-btn, #mobileMenuBtn {
    display: inline-flex !important;
  }

  /* Hide desktop-only topbar items */
  .topbar .topbar-right .desktop-only {
    display: none !important;
  }

  /* Dashboard tile stacking on mobile */
  .dashboard-grid,
  .quick-grid,
  .home-tiles {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .tile,
  .quick-tile,
  .dashboard-tile {
    width: 100%;
    max-width: 100%;
  }

  /* Widgets stack vertically */
  .dashboard-widgets,
  .widget-row {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
  }

  /* Tables fit screen */
  .data-table {
    width: 100%;
  }

  .data-table th,
  .data-table td {
    white-space: normal;
  }

  /* Cards full width */
  .rentals-card,
  .assignments-card,
  .parts-card,
  .equipment-card {
    padding: 0.75rem;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  /* Remove horizontal scroll across entire app */
  html, body {
    overflow-x: hidden !important;
  }
}
/* PHONE ONLY: stack dashboard tiles, full width */
@media (max-width: 480px) {

  /* Make main content breathe a bit but use full width */
  .main-content,
  #main-content {
    padding: 0.75rem !important;
    margin: 0 !important;
  }

  /* Stack the 4 home tiles: Assignments, Calendar, Parts, Equipment */
  .dashboard-grid,
  .home-tiles,
  .quick-grid {
    display: grid;
    grid-template-columns: 1fr !important;  /* override the 2-column rule */
    gap: 0.75rem;
    justify-items: stretch;
  }

  .dashboard-grid > * ,
  .home-tiles > * ,
  .quick-grid > * {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
  }

  /* Widgets (Open Assignments / Low Stock) also full-width stack */
  .dashboard-widgets,
  .widget-row {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
  }

  .dashboard-widget,
  .dashboard-card {
    width: 100% !important;
    max-width: 100% !important;
  }

  /* No sideways scroll on phones */
  html, body {
    overflow-x: hidden !important;
  }
}
/* Layout for Rental Assignment modal */
#rentalAssignmentModal .assignment-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px 24px; /* row / column gap */
}

/* Full-width rows (Title + Notes) */
#rentalAssignmentModal .form-group.full {
  grid-column: 1 / -1;
}
/* Labels */
#rentalAssignmentModal .form-group label {
  display: block;
  margin-bottom: 4px;
  font-weight: 600;
}

/* Inputs, selects, textareas */
#rentalAssignmentModal input,
#rentalAssignmentModal select,
#rentalAssignmentModal textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #d0d7e2;
  background: #ffffff;
  font-size: 14px;
  line-height: 1.4;
}

/* Textarea height + behavior */
#rentalAssignmentModal textarea {
  min-height: 120px;
  resize: vertical;
}
#rentalAssignmentModal .modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 16px;
}
.assignments-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #e9f2ff;
  padding: 18px 24px;
  border-radius: 12px;
  margin-bottom: 16px;
}

.assignments-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.assignments-header-left h1 {
  font-size: 24px;
  margin: 0;
}

.assignments-header-actions {
  display: flex;
  gap: 12px;
}

.badge.new {
  background: #1fa2ff;
  color: white;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 8px;
  border-radius: 6px;
}
/* Highlight rental assignment rows when hovering */
#rentalAssignmentsCard table.data-table tbody tr {
  transition: background-color 0.15s ease;
  cursor: pointer;
}

#rentalAssignmentsCard table.data-table tbody tr:hover {
  background-color: #f0f6ff; /* light blue highlight */
}
/* Rental assignment status dropdown */
.rental-status-select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;

  padding: 6px 34px 6px 12px;
  font-size: 14px;
  font-weight: 600;

  border-radius: 8px;
  border: 1px solid #cfd8e3;
  background-color: #f8fafc;
  color: #1f2937;

  cursor: pointer;
  transition: all 0.15s ease;

  /* custom caret */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%236b7280'%3E%3Cpath d='M5.5 7.5L10 12l4.5-4.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 16px;
}

/* Hover */
.rental-status-select:hover {
  background-color: #eef2ff;
  border-color: #4f46e5;
}

/* Focus */
.rental-status-select:focus {
  outline: none;
  border-color: #4f46e5;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

/* Disabled (just in case later) */
.rental-status-select:disabled {
  background-color: #e5e7eb;
  color: #9ca3af;
  cursor: not-allowed;
}

/* === Completed Assignments – reuse Assignments table look === */

#completedAssignmentsTable {
  width: 100%;
  border-collapse: collapse;
  table-layout: auto;              /* let browser size columns naturally */
}

/* Let global .assignments-table styles handle borders, fonts, striping.
   Only adjust wrapping so it feels like the Assignments page. */
#completedAssignmentsTable th,
#completedAssignmentsTable td {
  padding: 0.55rem 0.75rem;
  font-size: 0.9rem;
  vertical-align: middle;
}

/* Title can wrap (like Equipment column does) */
#completedAssignmentsTable td:nth-child(1) {
  white-space: normal;
  word-break: break-word;
}

/* Dates can wrap to a second line if needed */
#completedAssignmentsTable td:nth-child(5),
#completedAssignmentsTable td:nth-child(6) {
  white-space: normal;
  word-break: break-word;
}

/* Other text columns stay on one line */
#completedAssignmentsTable td:nth-child(2),
#completedAssignmentsTable td:nth-child(3),
#completedAssignmentsTable td:nth-child(4) {
  white-space: nowrap;
}

/* Last two columns: compact, aligned like Status column on Assignments */
#completedAssignmentsTable th:nth-child(7),
#completedAssignmentsTable td:nth-child(7),
#completedAssignmentsTable th:nth-child(8),
#completedAssignmentsTable td:nth-child(8) {
  white-space: nowrap;
  text-align: right;
}

/* Delete button – small pill, similar feel to status pill */
#completedAssignmentsTable .completed-delete-btn {
  padding: 3px 10px;
  font-size: 0.8rem;
  border-radius: 9999px;
  border: 1px solid #dc2626;
  background: #fee2e2;
  color: #b91c1c;
  cursor: pointer;
  line-height: 1.2;
}
#completedAssignmentsTable .completed-delete-btn:hover {
  background: #fecaca;
}

/* Status dropdown – compact pill, like Status on Assignments */
#completedAssignmentsTable .completed-status-select {
  padding: 3px 12px;
  font-size: 0.8rem;
  border-radius: 9999px;
  border: 1px solid #d1d5db;
  background: #ffffff;
  line-height: 1.2;
  max-width: 100%;
}

/* Keep controls tucked in a bit from the right edge */
#completedAssignmentsTable .completed-actions {
  text-align: right;
}
/* --- Completed Assignments Action Buttons Styling --- */

/* align right like assignments table status column */
#completedAssignmentsTable .action-cell {
  text-align: right;
  white-space: nowrap;
}

/* Delete button = small grey pill */
#completedAssignmentsTable .delete-btn {
  background: #f3f4f6;               /* same grey as assignments */
  border: 1px solid #d1d5db;         /* subtle border */
  color: #374151;                    /* text-gray-700 */
  padding: 4px 10px;
  font-size: 0.85rem;
  border-radius: 6px;
  cursor: pointer;
}

#completedAssignmentsTable .delete-btn:hover {
  background: #e5e7eb;
}

/* Status dropdown = small pill like "Open" dropdown */
#completedAssignmentsTable .status-select {
  padding: 4px 10px;
  font-size: 0.85rem;
  border-radius: 6px;
  border: 1px solid #d1d5db;
  background: #ffffff;
  color: #111827;
  cursor: pointer;
  margin-left: 6px;
}
/* icon-only action button */
.icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid rgba(0,0,0,.08);
  background: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  line-height: 1;
  padding: 0;
  transition: transform .06s ease, background .12s ease, border-color .12s ease;
}

.icon-btn:hover { transform: translateY(-1px); }

.icon-btn:active { transform: translateY(0px); }

.icon-btn.danger:hover {
  background: rgba(220,38,38,.08);        /* subtle red */
  border-color: rgba(220,38,38,.25);
}

.icon-btn:disabled {
  opacity: .55;
  cursor: not-allowed;
  transform: none;
}
.rental-assignments-filters{
  display:flex;
  justify-content:space-between;
  align-items:flex-end;
  gap:14px;
  margin: 10px 0 14px 0;
}

.raf-right{
  display:flex;
  align-items:flex-end;
  gap:14px;
  flex-wrap:wrap;
}

.raf-field{ display:flex; flex-direction:column; gap:6px; }

.raf-label{
  font-weight:700;
  font-size:14px;
  color:#111827;
  line-height:1;
}

.raf-control{
  height:36px;
  padding:0 10px;
  border:1px solid #cbd5e1;
  border-radius:10px;
  background:#fff;
  font-size:14px;
  outline:none;
}

.raf-control:focus{
  border-color:#3b82f6;
  box-shadow:0 0 0 3px rgba(59,130,246,.15);
}

.raf-range{
  display:flex;
  align-items:center;
  gap:10px;
}

.raf-to{
  opacity:.7;
  font-weight:600;
}

.raf-clear-btn{
  height:36px;
  padding:0 14px;
  border-radius:10px;
  border:1px solid #cbd5e1;
  background:#fff;
  font-weight:700;
  cursor:pointer;
}

.raf-clear-btn:hover{ filter:brightness(.98); }
/* ===== Completed Assignments: pretty actions ===== */

#completedAssignmentsTable th,
#completedAssignmentsTable td,
#rentalCompletedTable th,
#rentalCompletedTable td {
  vertical-align: middle;
}

/* Delete buttons (both tables) */
#completedAssignmentsTable button,
#rentalCompletedTable button {
  appearance: none;
  border: 1px solid rgba(17, 24, 39, 0.14);
  background: #fff;
  color: #111827;
  font-weight: 600;
  font-size: 13px;
  padding: 8px 12px;
  border-radius: 10px;
  cursor: pointer;
  line-height: 1;
  transition: transform 120ms ease, box-shadow 120ms ease, border-color 120ms ease, background 120ms ease;
}

/* Make ONLY the Delete buttons look danger */
#completedAssignmentsTable tbody td:nth-child(7) button,
#rentalCompletedTable tbody td:nth-child(7) button {
  border-color: rgba(220, 38, 38, 0.35);
  background: rgba(220, 38, 38, 0.10);
  color: #b91c1c;
}

#completedAssignmentsTable tbody td:nth-child(7) button:hover,
#rentalCompletedTable tbody td:nth-child(7) button:hover {
  background: rgba(220, 38, 38, 0.16);
  border-color: rgba(220, 38, 38, 0.55);
  box-shadow: 0 8px 18px rgba(220, 38, 38, 0.12);
  transform: translateY(-1px);
}

/* Other buttons (like Rental Property Completions / Back buttons) */
#completedAssignmentsWrapper .btn-row button,
#rentalCompletedWrapper .btn-row button {
  border-color: rgba(59, 130, 246, 0.25);
  background:  rgba(17, 24, 39, 0.04); 
  color: #fff;
}

#completedAssignmentsWrapper .btn-row button:hover,
#rentalCompletedWrapper .btn-row button:hover {
  background: rgba(59, 130, 246, 0.16);
  border-color: rgba(59, 130, 246, 0.45);
  box-shadow: 0 10px 18px rgba(59, 130, 246, 0.10);
  transform: translateY(-1px);
}

#completedAssignmentsTable button:active,
#rentalCompletedTable button:active,
#completedAssignmentsWrapper .btn-row button:active,
#rentalCompletedWrapper .btn-row button:active {
  transform: translateY(0px);
  box-shadow: none;
}

#completedAssignmentsTable button:disabled,
#rentalCompletedTable button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Dropdowns (status selects) inside the two tables */
#completedAssignmentsTable select,
#rentalCompletedTable select {
  appearance: none;
  border: 1px solid rgba(17, 24, 39, 0.18);
  background: #fff;
  color: #111827;
  font-weight: 600;
  font-size: 13px;
  padding: 8px 34px 8px 12px;
  border-radius: 10px;
  cursor: pointer;
  line-height: 1.1;
  min-width: 140px;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

/* Nice arrow */
#completedAssignmentsTable select,
#rentalCompletedTable select {
  background-image:
    linear-gradient(45deg, transparent 50%, rgba(17,24,39,.6) 50%),
    linear-gradient(135deg, rgba(17,24,39,.6) 50%, transparent 50%);
  background-position:
    calc(100% - 18px) 52%,
    calc(100% - 12px) 52%;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}

#completedAssignmentsTable select:hover,
#rentalCompletedTable select:hover {
  border-color: rgba(59, 130, 246, 0.55);
}

#completedAssignmentsTable select:focus,
#rentalCompletedTable select:focus {
  outline: none;
  border-color: rgba(59, 130, 246, 0.85);
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.18);
}





















