/* Clarkes of Cavan — modern blue theme, responsive workshop UI */

*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  /* Blue scale */
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-muted: #3b82f6;
  --primary-soft: #eff6ff;
  --primary-border: #bfdbfe;
  --accent: #0ea5e9;
  /* Neutrals */
  --sidebar-bg: #0f172a;
  --sidebar-bg-elevated: #1e293b;
  --sidebar-text: #f1f5f9;
  --sidebar-muted: #94a3b8;
  --sidebar-hover: rgba(255, 255, 255, 0.08);
  --sidebar-active: rgba(37, 99, 235, 0.35);
  --text: #0f172a;
  --muted: #64748b;
  --border: #e2e8f0;
  --surface: #ffffff;
  --surface-muted: #f8fafc;
  --page-bg: #f1f5f9;
  --danger: #dc2626;
  --danger-soft: #fef2f2;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 4px 16px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 12px 40px rgba(15, 23, 42, 0.12);
  --radius: 10px;
  --radius-sm: 8px;
  /* Job status (harmonised with blue UI) */
  --status-unscheduled: #94a3b8;
  --status-open: #2563eb;
  --status-progress: #d97706;
  --status-complete: #059669;
  --status-collected: #475569;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

body.site {
  margin: 0;
  min-height: 100vh;
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  color: var(--text);
  background: var(--page-bg);
  display: flex;
  letter-spacing: -0.01em;
}

a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
}

a:hover {
  color: var(--primary-hover);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Sidebar */

.sidebar {
  width: 240px;
  flex-shrink: 0;
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  min-height: 100vh;
  padding: 1rem 0 1.25rem;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 4px 0 24px rgba(15, 23, 42, 0.12);
  transition: width 0.22s ease, padding 0.22s ease;
}

.sidebar__head {
  padding: 0 0.65rem 0.5rem;
  margin-bottom: 0.35rem;
}

.sidebar-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin-bottom: 0.5rem;
  padding: 0.4rem 0.5rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-sm);
  background: var(--sidebar-bg-elevated);
  color: var(--sidebar-muted);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.sidebar-toggle:hover {
  background: var(--sidebar-hover);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.2);
}

.sidebar-toggle__chev {
  font-weight: 700;
  user-select: none;
}

.sidebar-brand {
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
  padding: 0 0.6rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 0.75rem;
  color: #fff;
  transition: opacity 0.18s ease, font-size 0.18s ease;
}

.sidebar-brand::before {
  content: '';
  display: block;
  width: 36px;
  height: 4px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  margin-bottom: 0.65rem;
  transition: margin 0.22s ease;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0 0.75rem;
}

.sidebar-link {
  position: relative;
  display: block;
  padding: 0.65rem 0.85rem;
  color: var(--sidebar-muted);
  text-decoration: none;
  border-radius: var(--radius-sm);
  font-weight: 500;
  transition: background 0.15s ease, color 0.15s ease;
}

.sidebar-link:hover {
  background: var(--sidebar-hover);
  color: #fff;
  text-decoration: none;
}

.sidebar-link__txt {
  display: inline;
}

/* Collapsed rail (desktop): more room for main content */
@media (min-width: 768px) {
  body.site--sidebar-collapsed .sidebar {
    width: 72px;
    padding-left: 0.35rem;
    padding-right: 0.35rem;
  }

  body.site--sidebar-collapsed .sidebar__head {
    padding-left: 0.25rem;
    padding-right: 0.25rem;
  }

  body.site--sidebar-collapsed .sidebar-brand {
    font-size: 0;
    padding: 0.35rem 0.25rem 0.65rem;
    margin-bottom: 0.5rem;
    overflow: hidden;
    white-space: nowrap;
    border-bottom-color: rgba(255, 255, 255, 0.06);
  }

  body.site--sidebar-collapsed .sidebar-brand::before {
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 0;
  }

  body.site--sidebar-collapsed .sidebar-nav {
    padding: 0 0.2rem;
  }

  body.site--sidebar-collapsed .sidebar-link {
    padding: 0.55rem 0.25rem;
    text-align: center;
    min-height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  body.site--sidebar-collapsed .sidebar-link__txt {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }

  body.site--sidebar-collapsed .sidebar-link::after {
    content: attr(data-abbr);
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    line-height: 1.15;
    text-align: center;
    color: #cbd5e1;
    text-transform: uppercase;
  }

  body.site--sidebar-collapsed .sidebar-link:hover::after {
    color: #fff;
  }
}

@media (max-width: 767px) {
  .sidebar-toggle {
    display: none;
  }

  body.site--sidebar-collapsed .sidebar {
    width: 100%;
  }

  body.site--sidebar-collapsed .sidebar-brand {
    font-size: 1.05rem;
  }

  body.site--sidebar-collapsed .sidebar-link__txt {
    position: static;
    width: auto;
    height: auto;
    margin: 0;
    overflow: visible;
    clip: auto;
  }

  body.site--sidebar-collapsed .sidebar-link::after {
    display: none;
  }

  body.site--sidebar-collapsed .sidebar-link {
    display: block;
    text-align: left;
    justify-content: flex-start;
    min-height: 0;
  }
}

/* Main column */

.site-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding: 1rem 1.5rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.topbar-title {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text);
}

.topbar-logout {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.topbar-user {
  font-size: 0.875rem;
  color: var(--muted);
  font-weight: 500;
}

.content {
  flex: 1;
  padding: 1.25rem clamp(1rem, 2vw, 2rem) 2rem;
  width: 100%;
  max-width: none;
  margin: 0;
}

.footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border);
  background: var(--surface);
}

.footer-text {
  margin: 0;
  font-size: 0.8rem;
  color: var(--muted);
}

/* Panels & tables */

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow-sm);
}

.panel-title {
  margin: 0 0 0.75rem;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

.panel-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
}

.table thead th {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
  color: var(--muted);
  background: var(--surface-muted);
  border-bottom: 1px solid var(--border);
}

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

.table tbody tr {
  transition: background 0.12s ease;
}

.table tbody tr:hover {
  background: var(--primary-soft);
}

.table-striped tbody tr:nth-child(even) {
  background: var(--surface-muted);
}

.table-striped tbody tr:nth-child(even):hover {
  background: var(--primary-soft);
}

.cell-clip {
  max-width: min(48rem, 58vw);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Buttons */

.btn {
  display: inline-block;
  padding: 0.5rem 1rem;
  font-size: 0.9375rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  font-family: inherit;
  line-height: 1.35;
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
}

.btn:active {
  transform: translateY(1px);
}

.btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.45);
}

.btn-sm {
  padding: 0.35rem 0.65rem;
  font-size: 0.8125rem;
}

.btn-block {
  width: 100%;
  text-align: center;
}

.btn-primary {
  background: linear-gradient(180deg, var(--primary-muted) 0%, var(--primary) 100%);
  color: #fff;
  border-color: var(--primary-hover);
  box-shadow: 0 1px 2px rgba(37, 99, 235, 0.35);
}

.btn-primary:hover {
  background: var(--primary-hover);
  color: #fff;
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
}

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
  box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
  background: var(--surface-muted);
  border-color: var(--primary-border);
  text-decoration: none;
}

.btn-ghost {
  background: transparent;
  color: var(--muted);
  border-color: transparent;
}

.btn-ghost:hover {
  background: var(--surface-muted);
  color: var(--text);
  text-decoration: none;
}

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

.btn-danger:hover {
  background: #b91c1c;
  text-decoration: none;
}

.inline-form {
  display: inline;
}

/* Forms */

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem 1.15rem;
}

.form-max {
  max-width: 640px;
}

.form-label {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
}

.form-input {
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-family: inherit;
  background: var(--surface);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-input:hover {
  border-color: #cbd5e1;
}

.form-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

.span-2 {
  grid-column: span 2;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.form-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: flex-end;
  margin-top: 0.5rem;
}

.filters {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.15rem 1.25rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow-sm);
}

.filters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.85rem;
}

.filters-actions {
  margin-top: 0.85rem;
  display: flex;
  gap: 0.5rem;
}

/* Badges */

.badge-status {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #fff;
}

.badge-status--unscheduled {
  background: var(--status-unscheduled);
}
.badge-status--open {
  background: var(--status-open);
}
.badge-status--in-progress {
  background: var(--status-progress);
  color: #fff;
}
.badge-status--complete {
  background: var(--status-complete);
}
.badge-status--collected {
  background: var(--status-collected);
}

.badge-part {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-part--na {
  background: var(--surface-muted);
  color: var(--muted);
  border: 1px solid var(--border);
}
.badge-part--order {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
}
.badge-part--received {
  background: #d1fae5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.badge-alert {
  display: inline-block;
  margin-left: 0.35rem;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 700;
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
}

/* Stat cards */

.grid-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.15rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  opacity: 0.9;
}

.stat-label {
  font-size: 0.8125rem;
  color: var(--muted);
  font-weight: 600;
}

.stat-value {
  font-size: 1.85rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--primary);
  line-height: 1.1;
}

/* Job detail */

.job-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.job-number {
  margin: 0;
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.job-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}

.dl-grid {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 0.4rem 1rem;
  font-size: 0.9375rem;
}

.dl-grid dt {
  margin: 0;
  color: var(--muted);
  font-weight: 600;
  font-size: 0.875rem;
}

.dl-grid dd {
  margin: 0;
}

.job-item {
  margin-top: 0.85rem;
  line-height: 1.5;
}

.timeline {
  list-style: none;
  padding: 0;
  margin: 0;
}

.timeline li {
  border-left: 3px solid var(--primary);
  padding-left: 1.1rem;
  margin-bottom: 0.85rem;
}

.timeline-date {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.timeline-body {
  white-space: pre-wrap;
  line-height: 1.5;
}

.mech-dot {
  display: inline-block;
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 50%;
  background: var(--c, var(--primary));
  vertical-align: middle;
  margin-right: 0.3rem;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.9);
}

.muted {
  color: var(--muted);
}

.small {
  font-size: 0.85rem;
}

.subheading {
  margin: 1rem 0 0.5rem;
  font-size: 1rem;
  font-weight: 700;
}

/* Login */

.login-page {
  min-height: 100vh;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(145deg, #0f172a 0%, #1e3a5f 45%, #1e40af 100%);
  padding: 1rem;
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
}

.login-card {
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border-radius: var(--radius);
  padding: 2rem 2rem 2.25rem;
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.login-brand {
  margin: 0 0 0.35rem;
  color: var(--primary);
  font-size: 1.65rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.login-sub {
  margin: 0 0 1.75rem;
  color: var(--muted);
  font-size: 0.9375rem;
  font-weight: 500;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

/* Alerts */

.alert {
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
  font-size: 0.9375rem;
}

.alert-error {
  background: var(--danger-soft);
  color: #991b1b;
  border: 1px solid #fecaca;
}

.alert-success {
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.alert ul {
  margin: 0;
  padding-left: 1.1rem;
}

/* Autocomplete */

.autocomplete {
  position: absolute;
  z-index: 20;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  max-height: 220px;
  overflow-y: auto;
  box-shadow: var(--shadow-md);
}

.form-label {
  position: relative;
}

.autocomplete-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.55rem 0.75rem;
  border: 0;
  background: none;
  cursor: pointer;
  font-size: 0.9375rem;
  font-family: inherit;
}

.autocomplete-item:hover {
  background: var(--primary-soft);
}

.autocomplete-item--active {
  background: var(--primary-soft);
  outline: 1px solid var(--primary);
}

/* Calendar */

.calendar-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  margin-bottom: 1.15rem;
}

.calendar-sidebar-toggle {
  flex-shrink: 0;
}

.calendar-toggle {
  display: flex;
  gap: 0.4rem;
}

.calendar-nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.calendar-range {
  font-weight: 700;
  min-width: 10rem;
  text-align: center;
  color: var(--text);
  font-size: 0.95rem;
}

.calendar-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 1.15rem;
  align-items: start;
}

.calendar-layout--no-sidebar {
  grid-template-columns: 1fr;
}

.calendar-layout--no-sidebar .calendar-sidebar {
  display: none;
}

@media (max-width: 900px) {
  .calendar-layout {
    grid-template-columns: 1fr;
  }

  .calendar-layout--no-sidebar .calendar-sidebar {
    display: none;
  }
}

.calendar-sidebar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  max-height: 70vh;
  overflow-y: auto;
  box-shadow: var(--shadow-sm);
}

.sidebar-heading {
  margin: 0 0 0.4rem;
  font-size: 1rem;
  font-weight: 700;
}

.unscheduled-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.calendar-empty-hint {
  margin: 0 0 0.65rem;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.cal-dow-label {
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
  padding: 0.5rem;
  text-align: center;
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.cal-day {
  background: var(--surface);
  min-height: 120px;
  display: flex;
  flex-direction: column;
  padding: 0.45rem;
}

.cal-day--empty {
  background: var(--surface-muted);
  min-height: 80px;
}

.cal-day--hover {
  outline: 2px dashed var(--primary);
  outline-offset: -2px;
  background: var(--primary-soft);
}

.cal-day-head {
  font-size: 0.8rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
  color: var(--muted);
}

.cal-day-stack {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  overflow-y: auto;
}

.cal-card {
  position: relative;
  padding: 0.4rem 0.45rem 0.4rem 0.6rem;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  cursor: pointer;
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: var(--shadow-sm);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
  touch-action: pan-y;
}

.cal-card--draggable[draggable='true'] {
  cursor: grab;
  -webkit-user-select: none;
  user-select: none;
}

.cal-card--draggable[draggable='true']:active {
  cursor: grabbing;
}

.cal-card--dragging {
  opacity: 0.88;
  transform: scale(0.98);
  box-shadow: var(--shadow-md);
  z-index: 5;
}

.cal-card:hover:not(.cal-card--dragging) {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.cal-card__mech {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}

.cal-card__mech-btn {
  position: absolute;
  top: 0.15rem;
  right: 0.15rem;
  width: 1.45rem;
  height: 1.45rem;
  padding: 0;
  border: none;
  border-radius: var(--radius-sm);
  background: rgba(15, 23, 42, 0.07);
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1;
  cursor: pointer;
  z-index: 2;
}

.cal-card__mech-btn:hover {
  background: rgba(15, 23, 42, 0.14);
  color: var(--text);
}

.cal-card--has-mech-btn {
  padding-right: 1.65rem;
}

.cal-card__num {
  font-weight: 800;
}

.cal-card__cust {
  color: var(--muted);
  font-size: 0.72rem;
}

.cal-card__item {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.cal-card--sidebar {
  border-left: 4px solid var(--primary);
}

.job-status--unscheduled {
  background: #f1f5f9;
}
.job-status--open {
  background: var(--primary-soft);
}
.job-status--in-progress {
  background: #fffbeb;
}
.job-status--complete {
  background: #ecfdf5;
}
.job-status--collected {
  background: #f1f5f9;
}

/* App modals (new job / customer / user on list pages) */

.app-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.app-modal.is-open {
  display: flex;
}

.app-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(3px);
}

.app-modal__panel {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 520px;
  max-height: min(92vh, 880px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
}

.app-modal__panel--wide {
  max-width: 720px;
}

.app-modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface-muted);
  flex-shrink: 0;
}

.app-modal__head h2 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.app-modal__close {
  border: 0;
  background: transparent;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  color: var(--muted);
  padding: 0.15rem 0.35rem;
  border-radius: var(--radius-sm);
}

.app-modal__close:hover {
  color: var(--text);
  background: rgba(15, 23, 42, 0.06);
}

.app-modal__body {
  padding: 1.25rem;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.app-modal__body .form-grid {
  margin: 0;
}

/* Calendar assign modal */

.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal[hidden] {
  display: none;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(2px);
}

.modal-card {
  position: relative;
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1.5rem;
  max-width: 420px;
  width: 100%;
  z-index: 1;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
}

.modal-card h3 {
  margin: 0 0 0.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 1.15rem;
}

.checkbox-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-top: 0.85rem;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.9375rem;
}

#change-mech-form label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  margin: 0.75rem 0 0.35rem;
}

#change-mech-form .form-input {
  width: 100%;
}

/* Tablet */

@media (min-width: 768px) {
  .content {
    padding: 1.5rem 1.75rem 2rem;
  }

  .form-grid {
    gap: 1rem 1.25rem;
  }
}

@media (max-width: 767px) {
  body.site {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    min-height: 0;
  }

  .sidebar-nav {
    flex-direction: row;
    flex-wrap: wrap;
  }

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

  .span-2 {
    grid-column: span 1;
  }
}
