/* ===== MASTER STYLESHEET ===== */
/* Material Design with Indigo Theme */

/* ===== SECTION 1: CSS RESET & VARIABLES ===== */

:root {
  /* Primary Colors (Indigo) */
  --primary-color: #3f51b5;
  --primary-hover: #303f9f;
  --primary-active: #283593;
  --primary-light: rgba(63, 81, 181, 0.04);
  --primary-medium: rgba(63, 81, 181, 0.12);
  --primary-contrast: #ffffff;

  /* Accent Color (Clock-out red) */
  --accent-color: #e53935;
  --accent-hover: #c62828;

  /* Greys (3 levels) */
  --bg-grey: #fafafa;
  --grey-hover: #eeeeee;
  --grey-border: #e0e0e0;

  /* Text Colors */
  --text-primary: #212121;
  --text-secondary: #424242;
  --text-tertiary: #616161;
  --text-disabled: rgba(0, 0, 0, 0.38);
  --text-hint: rgba(0, 0, 0, 0.12);

  /* Surface Colors */
  --surface-white: #ffffff;
  --surface-raised: #ffffff;
  --surface-muted: #f4f4f4;
  --surface-overlay: rgba(0, 0, 0, 0.04);
  --surface-overlay-hover: rgba(0, 0, 0, 0.06);
  --surface-hover: rgba(0, 0, 0, 0.06);
  --modal-backdrop: rgba(0, 0, 0, 0.5);

  /* Runsheet Status Surfaces */
  --task-surface: #ffffff;
  --task-border: #d7d7d7;
  --task-accent-unconfirmed: #d7dbe0;
  --task-accent-confirmed: #b0bec5;
  --task-accent-despatched: #4dd0e1;
  --task-accent-in-progress: #ffb74d;
  --task-accent-completed: #81c784;
  --task-accent-postponed: #fff59d;
  --task-accent-cancelled: #ef9a9a;
  --task-accent-booked-out: #d13c1e;
  --task-accent-loaded: #cdabed;
  --task-accent-layed-out: #cdabed;
  --task-accent-prepped: #81bc00;

  /* Toolbar Colors */
  --toolbar-bg: var(--primary-color);
  --toolbar-overlay: rgba(255, 255, 255, 0.2);
  --toolbar-overlay-hover: rgba(255, 255, 255, 0.3);
  --toolbar-border: rgba(255, 255, 255, 0.5);
  --date-selected-bg: #303f9f;
  --date-selected-border: #283593;
  --date-selected-text: #ffffff;
  --date-selected-subtext: rgba(255, 255, 255, 0.82);
  --date-subtle-text: #4b5563;
  --app-nav-offset: 0px;
}

/* ===== SECTION: RUNSHEET ===== */

.hidden {
  display: none !important;
}

.shift-unpublished-icon {
  width: 0.9rem;
  height: 0.9rem;
  flex: 0 0 auto;
}
.runsheet-shift-action-row {
  display: flex;
  gap: 0.5rem;
}

.runsheet-body {
  margin: 0;
  background: var(--bg-grey);
  color: var(--text-primary);
  font-family: "Segoe UI", sans-serif;
  --runsheet-nav-height: 56px;
  --app-nav-offset: var(--runsheet-nav-height);
  height: 100vh;
  overflow: hidden;
  max-width: 100vw;
}

.runsheet-nav {
  background: var(--toolbar-bg);
  color: #ffffff;
  padding: 0 1rem;
  position: sticky;
  top: 0;
  z-index: 1100;
  height: var(--runsheet-nav-height);
}

.runsheet-nav-inner {
  display: flex;
  align-items: center;
  height: var(--runsheet-nav-height);
  gap: 0.75rem;
}

.runsheet-nav-link {
  color: #ffffff;
  text-decoration: none;
  font-weight: 600;
}

.runsheet-nav-spacer {
  flex: 1;
}

.runsheet-nav-user {
  max-width: min(24rem, 40vw);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 0.2rem 0.65rem;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  font-size: 0.9rem;
  line-height: 1.2;
}

.runsheet-nav-menu {
  position: relative;
  display: inline-flex;
  align-items: center;
  margin: 0;
}

.runsheet-nav-menu > summary {
  list-style: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.runsheet-nav-menu > summary::-webkit-details-marker {
  display: none;
}

.runsheet-nav-menu-toggle {
  color: #ffffff;
  width: 36px;
  height: 36px;
  line-height: 0;
}

.runsheet-nav-menu-icon {
  width: 22px;
  height: 22px;
  min-width: 22px;
  min-height: 22px;
  display: block;
  color: #ffffff;
}

.runsheet-nav-menu[open] .runsheet-nav-menu-toggle {
  background: var(--toolbar-overlay-hover);
  border-color: var(--toolbar-border);
}

.runsheet-nav-menu-panel {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  min-width: 200px;
  max-height: calc(100vh - var(--runsheet-nav-height) - 1rem);
  max-height: calc(100dvh - var(--runsheet-nav-height) - 1rem);
  background: var(--surface-white);
  color: var(--text-primary);
  border: 1px solid var(--grey-border);
  box-shadow:
    0 6px 16px rgba(0, 0, 0, 0.18),
    0 2px 6px rgba(0, 0, 0, 0.12);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.5rem;
  overflow-y: auto;
  z-index: 30;
}

.runsheet-nav-menu-item {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.4rem;
  padding: 0.45rem 0.6rem;
  border-radius: 0;
  border: 1px solid transparent;
  color: var(--text-primary);
  text-decoration: none;
  background: transparent;
  cursor: pointer;
  font: inherit;
}

.runsheet-nav-menu-item:hover {
  background: var(--surface-overlay-hover);
  border-color: var(--grey-border);
}

.runsheet-nav-menu-separator {
  height: 1px;
  background-color: var(--grey-border);
  margin: 0.25rem 0;
}

.runsheet-nav-menu-heading {
  padding: 0.4rem 0.6rem 0.2rem 0.6rem;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
  opacity: 0.7;
  cursor: default;
}

.runsheet-nav-menu-panel .theme-toggle {
  color: var(--text-primary);
  border: 1px solid var(--grey-border);
  background: var(--surface-white);
  width: 100%;
  justify-content: flex-start;
}

.runsheet-nav-menu-panel .theme-toggle:hover {
  background: var(--surface-overlay-hover);
}

.runsheet-nav-clock-desktop {
  display: flex;
  align-items: center;
}

.runsheet-nav-clock-mobile,
.runsheet-nav-menu-separator-clock,
.runsheet-nav-menu-heading-clock {
  display: none;
}

/* ===== CLOCK IN/OUT CONTROLS ===== */

.clock-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-right: 0.25rem;
}

.runsheet-nav-clock .clock-controls {
  margin-right: 0;
}

.clock-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition:
    background 0.15s,
    opacity 0.15s,
    transform 0.1s;
  line-height: 1;
}

.clock-btn:active {
  transform: scale(0.96);
}

.clock-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.clock-btn-icon {
  display: inline-flex;
  align-items: center;
}

.clock-btn-icon svg {
  display: block;
}

/* Clock In — green */
.clock-btn-in {
  background: #43a047;
  color: #fff;
}
.clock-btn-in:hover:not(:disabled) {
  background: #388e3c;
}

/* Clock Out — red */
.clock-btn-out {
  background: #e53935;
  color: #fff;
}
.clock-btn-out:hover:not(:disabled) {
  background: #c62828;
}

/* Start Break — amber */
.clock-btn-break {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.4);
}
.clock-btn-break:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.25);
}

/* End Break — amber solid */
.clock-btn-break-end {
  background: #fb8c00;
  color: #fff;
}
.clock-btn-break-end:hover:not(:disabled) {
  background: #ef6c00;
}

/* Status labels (no shift / clocked out) */
.clock-status-none {
  color: rgba(255, 255, 255, 0.5);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}

.clock-status-done {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: rgba(255, 255, 255, 0.8);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
}

.clock-status-done svg {
  color: #66bb6a;
}

/* Toast notifications */
.clock-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  padding: 10px 24px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  z-index: 10000;
  opacity: 0;
  transition:
    opacity 0.25s,
    transform 0.25s;
  pointer-events: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.clock-toast-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.clock-toast-success {
  background: #2e7d32;
  color: #fff;
}

.clock-toast-error {
  background: #c62828;
  color: #fff;
}

.clock-toast-info {
  background: #1565c0;
  color: #fff;
}

/* Responsive: hide label on small screens, keep icon */
@media (max-width: 600px) {
  .clock-btn-label {
    display: none;
  }
  .clock-btn {
    padding: 6px 10px;
  }
  .clock-status-none {
    font-size: 11px;
  }

  .runsheet-nav-clock-mobile .clock-btn-label {
    display: inline;
  }

  .runsheet-nav-clock-mobile .clock-btn {
    padding: 0.65rem 0.75rem;
  }
}

@media (max-width: 768px) {
  .runsheet-nav-clock-desktop {
    display: none;
  }

  .runsheet-nav-clock-mobile {
    display: block;
  }

  .runsheet-nav-menu-separator-clock {
    display: block;
  }

  .runsheet-nav-menu-heading-clock {
    display: block;
  }

  .runsheet-nav-clock-mobile .clock-controls {
    flex-direction: column;
    align-items: stretch;
    gap: 0.4rem;
  }

  .runsheet-nav-clock-mobile .clock-btn {
    width: 100%;
    justify-content: flex-start;
  }

  .runsheet-nav-clock-mobile .clock-status-none,
  .runsheet-nav-clock-mobile .clock-status-done {
    color: var(--text-secondary);
    font-size: 0.875rem;
  }

  .runsheet-nav-clock-mobile .clock-status-done svg {
    color: #43a047;
  }
}

#resource-panel-toggle-button {
  color: #ffffff;
}

#resource-panel-toggle-button svg {
  display: block;
  width: 22px;
  height: 22px;
  min-width: 22px;
  min-height: 22px;
}

/* ===== NAV DATEPICKER ===== */

.nav-datepicker-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.75rem;
  height: 36px;
  background: var(--toolbar-overlay);
  color: #ffffff;
  border: 1px solid var(--toolbar-border);
  border-radius: 0;
  cursor: pointer;
  transition:
    background-color 0.2s,
    border-color 0.2s;
  font-size: 0.85rem;
  font-weight: 500;
  white-space: nowrap;
}

.nav-datepicker-btn:hover {
  background: var(--toolbar-overlay-hover);
  border-color: var(--toolbar-border);
}

.nav-datepicker-btn:active {
  background: var(--toolbar-overlay-hover);
}

.nav-datepicker-btn svg {
  display: block;
  width: 18px;
  height: 18px;
  min-width: 18px;
  min-height: 18px;
  flex-shrink: 0;
}

.nav-datepicker-label {
  display: none;
}

/* Show label on larger screens */
@media (min-width: 768px) {
  .nav-datepicker-label {
    display: inline;
  }
}

@media (max-width: 768px) {
  .runsheet-main {
    padding-bottom: calc(var(--runsheet-nav-height) + 1rem);
  }
}

.runsheet-layout {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - var(--runsheet-nav-height));
  height: calc(100vh - var(--runsheet-nav-height));
}

.runsheet-shell {
  display: flex;
  flex: 1;
  overflow: visible;
  height: 100%;
}

.runsheet-panel {
  width: 280px;
  background: var(--surface-raised);
  border-right: 1px solid var(--grey-border);
  transition:
    width 0.2s ease,
    padding 0.2s ease;
}

.runsheet-panel.is-collapsed {
  width: 0;
  padding: 0;
  border-right: none;
  overflow: hidden;
}

.runsheet-panel-content {
  padding: 0.75rem;
}

.runsheet-main {
  flex: 1;
  overflow: auto;
  padding: 0;
  container-type: inline-size;
}

.runsheet-main > .runsheet-sse-block {
  padding: 0.75rem;
}

.panel-stack {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

@media (min-width: 769px) {
  .runsheet-panel {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
  }

  .runsheet-panel-content {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
  }
}

/* ===== QUICK LINKS DASHBOARD ===== */

.quick-links-container {
  padding: 0;
}

.quick-links-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.75rem;
  width: 100%;
}

.quick-links-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.quick-links-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 1rem;
  border-radius: 4px;
  border: 1px solid var(--grey-border);
  background-color: var(--surface-white);
  text-decoration: none;
  color: var(--text-primary);
  font-weight: 500;
  cursor: pointer;
  transition:
    background-color 0.2s,
    border-color 0.2s;
}

.quick-links-card .quick-links-item {
  flex: 1;
  border-radius: 4px 4px 0 0;
  border-bottom: 0;
}

.quick-links-item:hover {
  background-color: var(--grey-hover);
  border-color: var(--primary-color);
}

.quick-links-item.quick-links-link:hover {
  background-color: var(--primary-light);
}

.quick-links-item.quick-links-disabled {
  cursor: not-allowed;
  background-color: var(--surface-white);
  border-color: var(--grey-border);
  color: var(--text-disabled);
}

.quick-links-item.quick-links-disabled:hover {
  background-color: var(--surface-white);
  border-color: var(--grey-border);
  color: var(--text-disabled);
}

.quick-links-label {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.quick-links-item.quick-links-disabled .quick-links-label {
  color: var(--text-secondary);
}

.quick-links-item.quick-links-disabled .quick-links-qty {
  color: var(--text-tertiary);
}

.quick-links-qty {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.quick-links-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  padding: 0.45rem 0.75rem;
  border: 1px solid var(--grey-border);
  border-top: 0;
  border-radius: 0 0 4px 4px;
  background: var(--surface-white);
  color: var(--text-secondary);
  cursor: pointer;
  transition:
    background-color 0.2s,
    border-color 0.2s,
    color 0.2s;
}

.quick-links-toggle:hover {
  background: var(--primary-light);
  border-color: var(--primary-color);
  color: var(--primary-color);
}

.quick-links-card.is-open .quick-links-toggle svg {
  transform: rotate(180deg);
}

.quick-links-toggle svg {
  transition: transform 0.2s;
}

.quick-link-task-list-container {
  margin-top: 0.75rem;
}

.quick-links-grid > .quick-link-task-list-container {
  grid-column: 1 / -1;
  margin-top: 0;
}

.quick-link-task-list-panel {
  border: 1px solid var(--primary-color);
  background: var(--surface-raised);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

.install-agenda-card {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 0.75rem;
  border: 1px solid var(--grey-border);
  background: var(--surface-raised);
}

.install-agenda-card.install-agenda-implemented {
  background: var(--surface-muted);
  border-left: 6px solid var(--task-accent-confirmed);
}

.install-agenda-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.install-agenda-implemented-info {
  position: relative;
}

.install-agenda-implemented-info > summary {
  list-style: none;
}

.install-agenda-implemented-info > summary::-webkit-details-marker {
  display: none;
}

.install-agenda-implemented-info-panel {
  position: absolute;
  top: calc(100% + 0.35rem);
  left: 0;
  z-index: 10;
  min-width: 14rem;
  padding: 0.6rem 0.7rem;
  border: 1px solid var(--grey-border);
  background: var(--surface-raised);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
  color: var(--text-secondary);
  font-size: 0.75rem;
  line-height: 1.35;
}

.install-agenda-implemented-info-label {
  color: var(--text-primary);
  font-weight: 600;
}

.install-agenda-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.install-agenda-text {
  min-height: 2.5rem;
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.install-agenda-text.is-empty {
  color: var(--text-hint);
}

.install-agenda-form textarea {
  width: 100%;
  min-height: 16rem;
  resize: vertical;
}

.install-agenda-form.hidden,
.install-agenda-text.hidden {
  display: none !important;
}

.install-agenda-form:not(.hidden) {
  display: block;
}

.install-agenda-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.4rem;
  margin-top: 0.4rem;
}

.install-agenda-footer {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.6rem;
}

.install-agenda-footer-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: flex-end;
  gap: 0.4rem;
}

.install-agenda-footer-actions form {
  display: flex;
}

.install-agenda-resources {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.5rem;
}

.install-agenda-resource-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.install-agenda-resource-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.install-agenda-resource-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.install-agenda-derived-staff {
  display: inline-flex;
  align-items: center;
  height: 28px;
  padding: 0 0.5rem;
  border: 1px solid var(--grey-border);
  border-radius: 4px;
  background: var(--surface-white);
  font-size: 0.65rem;
}

.install-agenda-derived-empty {
  display: inline-flex;
  align-items: center;
  height: 28px;
  font-size: 0.7rem;
  font-style: italic;
  color: var(--text-secondary);
}

.install-agenda-resource-buttons .btn-xs {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 28px;
  padding: 0.5rem;
  font-size: 0.65rem;
  line-height: 1.18;
  background: var(--surface-raised);
  border-color: var(--grey-border);
  box-shadow:
    0 1px 3px rgba(0, 0, 0, 0.12),
    0 1px 2px rgba(0, 0, 0, 0.08);
}

.install-agenda-resource-buttons .btn-xs:hover,
.install-agenda-resource-buttons .btn-xs:focus-visible {
  background: var(--surface-hover);
  box-shadow:
    0 2px 4px rgba(0, 0, 0, 0.15),
    0 1px 2px rgba(0, 0, 0, 0.1);
}

@media (max-width: 767px) {
  .install-agenda-mobile-hidden {
    display: none;
  }
}

.quick-link-task-list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--grey-border);
  background: var(--primary-light);
}

.quick-link-task-list-title {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-primary);
}

.quick-link-task-list-count {
  min-width: 1.75rem;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: var(--surface-white);
  color: var(--primary-color);
  font-size: 0.8rem;
  font-weight: 700;
  text-align: center;
}

.quick-link-task-list-items {
  list-style: none;
  margin: 0;
  padding: 0;
}

.quick-link-task-list-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto auto;
  grid-template-areas: "status content items-state vehicles actions";
  gap: 0.9rem;
  align-items: center;
  padding: 0.7rem 1rem;
  border-top: 1px solid var(--grey-border);
}

.quick-link-task-list-item:first-child {
  border-top: 0;
}

.quick-link-task-list-status-wrap {
  grid-area: status;
  min-width: 7.5rem;
}

.quick-link-task-list-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 6.25rem;
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  border: 1px solid var(--grey-border);
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.quick-link-task-list-content {
  grid-area: content;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.2rem;
  min-width: 0;
  white-space: normal;
  overflow: visible;
}

.quick-link-task-list-link,
.quick-link-task-list-text,
.quick-link-task-list-empty {
  font-size: 0.85rem;
  color: var(--text-primary);
}

.quick-link-task-list-link,
.quick-link-task-list-text {
  display: block;
  width: 100%;
  min-width: 0;
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
  overflow-wrap: anywhere;
}

.quick-link-task-list-link {
  text-decoration: none;
}

.quick-link-task-list-link:hover {
  color: var(--primary-color);
  text-decoration: underline;
}

.quick-link-task-list-notes {
  display: block;
  width: 100%;
  min-width: 0;
  font-size: 0.78rem;
  line-height: 1.45;
  color: var(--text-secondary);
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
  overflow-wrap: anywhere;
}

.quick-link-task-list-vehicles {
  grid-area: vehicles;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.45;
  color: var(--text-secondary);
  text-align: right;
  justify-self: end;
}

.quick-link-task-list-items-state {
  grid-area: items-state;
  font-size: 0.78rem;
  line-height: 1.4;
  color: var(--text-secondary);
  text-align: right;
  white-space: nowrap;
  margin-left: auto;
}

.quick-link-task-list-actions {
  grid-area: actions;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.quick-link-task-list-play {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  border: 1px solid var(--grey-border);
  color: var(--primary-color);
  background: var(--surface-primary, #fff);
  text-decoration: none;
  transition:
    background-color 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease,
    transform 0.15s ease;
}

.quick-link-task-list-play:hover {
  background: var(--primary-color);
  border-color: var(--primary-color);
  color: #fff;
  transform: translateX(1px);
}

.quick-link-task-list-play:focus-visible {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

.quick-link-task-list-empty {
  padding: 0.9rem 1rem;
  color: var(--text-secondary);
}

/* Mobile responsive: stack vertically */
@media (max-width: 640px) {
  .quick-links-grid {
    grid-template-columns: 1fr;
  }

  .quick-links-card {
    flex-direction: row;
    align-items: stretch;
  }

  .quick-links-card .quick-links-item {
    flex: 1;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    border-radius: 4px 0 0 4px;
    border-bottom: 1px solid var(--grey-border);
    border-right: 0;
  }

  .quick-links-label {
    flex: 1;
    min-width: 0;
  }

  .quick-links-qty {
    flex: 0 0 auto;
    font-size: 1rem;
    line-height: 1;
  }

  .quick-links-toggle {
    flex: 0 0 auto;
    width: 2.85rem;
    padding: 0;
    border-top: 1px solid var(--grey-border);
    border-left: 1px solid var(--grey-border);
    border-radius: 0 4px 4px 0;
  }

  .quick-link-task-list-item {
    grid-template-columns: 1fr;
    grid-template-areas:
      "status"
      "content"
      "vehicles"
      "actions";
    gap: 0.25rem;
    align-items: start;
  }

  .quick-link-task-list-status-wrap {
    min-width: 0;
  }

  .quick-link-task-list-content {
    align-items: flex-start;
    flex-wrap: wrap;
    white-space: normal;
    overflow: visible;
    gap: 0.25rem 0.5rem;
  }

  .quick-link-task-list-vehicles {
    grid-area: vehicles;
    justify-self: start;
    text-align: left;
  }

  .quick-link-task-list-link,
  .quick-link-task-list-text,
  .quick-link-task-list-notes,
  .quick-link-task-list-vehicles {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
  }

  .quick-link-task-list-items-state {
    grid-area: status;
    justify-self: end;
    align-self: center;
    text-align: left;
    white-space: normal;
    margin-left: 0;
  }

  .quick-link-task-list-actions {
    justify-content: flex-start;
  }
}

.runsheet-sse-block {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

/* ===== SECTION: ROSTERER ===== */

.rosterer-grid-wrap {
  position: relative;
  overflow: visible;
  border: 1px solid var(--grey-border);
  background: var(--surface-white);
  max-width: 100%;
}

.rosterer-grid {
  position: relative;
  width: 100%;
  min-width: 1000px;
}

.rosterer-row {
  display: grid;
  grid-template-columns: 120px repeat(7, minmax(105px, 1fr)) 80px;
}

@media (min-width: 1501px) {
  .rosterer-row {
    grid-template-columns: 180px repeat(7, minmax(130px, 1fr)) 100px;
  }
}

.rosterer-row-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--bg-grey);
  border-bottom: 1px solid var(--grey-border);
}

.rosterer-row-header::before {
  content: none;
}

.rosterer-row-footer {
  --rosterer-footer-bottom-offset: 0px;
  position: sticky;
  bottom: var(--rosterer-footer-bottom-offset);
  z-index: 45;
  background: var(--bg-grey);
  border-top: 1px solid var(--grey-border);
  box-shadow: 0 -3px 10px rgba(15, 23, 42, 0.08);
}

.rosterer-row-footer-daily-totals {
  --rosterer-footer-bottom-offset: 39px;
  z-index: 46;
}

.rosterer-row-footer-required {
  --rosterer-footer-bottom-offset: 78px;
  z-index: 47;
}

.rosterer-row-footer-forecast-total {
  --rosterer-footer-bottom-offset: 0px;
  z-index: 45;
}

.rosterer-row-footer-required .rosterer-cell {
  background: #fff8e6;
}

.rosterer-row-footer .rosterer-cell {
  border-bottom: none;
}

.rosterer-row-header .rosterer-cell,
.rosterer-row-footer .rosterer-cell {
  background: var(--bg-grey);
}

.rosterer-staff-footer-cell,
.rosterer-daily-total-cell,
.rosterer-grand-total-cell {
  font-weight: 700;
}

.rosterer-daily-total-cell,
.rosterer-grand-total-cell {
  font-size: 0.82rem;
}

.rosterer-cell {
  border-right: 1px solid var(--grey-border);
  border-bottom: 1px solid var(--grey-border);
  min-height: 38px;
  padding: 0.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.15rem;
  flex-wrap: wrap;
}

.rosterer-day-cell {
  position: relative;
  align-items: stretch;
}

.rosterer-day-layout {
  width: 100%;
  min-height: 38px;
  display: flex;
  align-items: center;
  gap: 0.15rem;
  position: relative;
  padding-left: 1.4rem;
  padding-right: 1.4rem;
}

.rosterer-day-main {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.15rem;
  flex-wrap: wrap;
  flex: 1;
  min-width: 0;
}

.rosterer-day-menu-wrap {
  position: absolute;
  top: 0;
  right: 0;
  width: 1.15rem;
}

@media (max-width: 768px) {
  .rosterer-row-footer-required {
    --rosterer-footer-bottom-offset: 70px;
  }

  .rosterer-row-footer-daily-totals {
    --rosterer-footer-bottom-offset: 35px;
  }

  .rosterer-cell {
    min-height: 34px;
    padding: 0.15rem;
    gap: 0.1rem;
  }
}

.rosterer-row .rosterer-cell:last-child {
  border-right: none;
}

.rosterer-staff-cell {
  position: sticky;
  left: 0;
  z-index: 30;
  justify-content: flex-start;
  background: var(--surface-white);
  overflow: hidden;
  box-shadow:
    1px 0 0 var(--grey-border),
    8px 0 14px rgba(15, 23, 42, 0.04);
}

.rosterer-row-header .rosterer-staff-cell {
  z-index: 50;
}

.rosterer-row-footer .rosterer-staff-cell {
  z-index: 55;
}

.rosterer-staff-header {
  font-weight: 600;
  background: var(--bg-grey);
}

.rosterer-staff-header-inner {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.rosterer-staff-header-title {
  font-size: 0.85rem;
  font-weight: 700;
}

.rosterer-staff-name {
  font-size: 0.8rem;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rosterer-header-cell {
  position: relative;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.rosterer-header-cell-has-prev {
  padding-left: 1.9rem;
}

.rosterer-header-cell-has-next {
  padding-right: 1.9rem;
}

.rosterer-header-cell.is-selected {
  background: var(--primary-light);
}

.rosterer-week-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  min-width: 1.35rem;
  min-height: 1.35rem;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.rosterer-week-nav-btn-prev {
  left: 0.3rem;
}

.rosterer-week-nav-btn-next {
  right: 0.3rem;
}

.rosterer-header-day {
  font-size: 0.8rem;
  font-weight: 600;
}

.rosterer-header-date {
  font-size: 0.75rem;
  color: var(--text-tertiary);
}

.rosterer-actions-header-cell {
  align-items: flex-start;
}

.rosterer-row-end-cell {
  position: relative;
  justify-content: space-between;
  align-items: center;
  flex-wrap: nowrap;
  gap: 0.2rem;
}

.rosterer-section-row {
  background: var(--bg-grey);
}

.rosterer-section-cell {
  grid-column: 1 / -1;
  justify-content: flex-start;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--bg-grey);
}

.rosterer-synthetic-row .rosterer-staff-cell {
  background: #fafafa;
}

.rosterer-total-hours {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
}

.rosterer-action-menu {
  position: absolute;
  top: 2px;
  right: 2px;
}

.rosterer-action-menu > summary {
  list-style: none;
}

.rosterer-action-menu > summary::-webkit-details-marker {
  display: none;
}

.rosterer-menu-btn {
  min-width: 28px;
  min-height: 28px;
  padding: 0.2rem;
}

.rosterer-action-menu-panel {
  position: absolute;
  top: calc(100% + 0.25rem);
  right: 0;
  min-width: 9.5rem;
  padding: 0.25rem;
  border: 1px solid var(--grey-border);
  background: var(--surface-white);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.14);
  z-index: 50;
}

.rosterer-action-menu-item {
  display: block;
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
  padding: 0.45rem 0.5rem;
  font-size: 0.85rem;
  color: var(--text-primary);
  cursor: pointer;
}

.rosterer-action-menu-item:hover,
.rosterer-action-menu-item:focus-visible {
  background: var(--surface-hover);
  outline: none;
}

/* ---- Rosterer: reset .btn within grid (beats the late .btn definition) ---- */
.rosterer-grid .btn {
  font-family: inherit;
  font-size: inherit;
  font-weight: inherit;
  letter-spacing: normal;
  line-height: normal;
  padding: 0;
  border: 1px solid var(--grey-border);
  transition: none;
}

.rosterer-grid .btn.btn-primary {
  border-color: var(--primary-color);
}

.rosterer-grid .btn.btn-ghost {
  border-color: transparent;
}

/* ---- Rosterer: shift chips ---- */
.rosterer-grid .rosterer-shift {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 26px;
  padding: 0 0.25rem;
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}

.rosterer-grid .rosterer-shift[draggable="true"] {
  cursor: grab;
}

.rosterer-grid .rosterer-shift.rosterer-dragging-shift {
  opacity: 0.45;
  cursor: grabbing;
}

.rosterer-day-cell.rosterer-drop-target {
  background: var(--primary-light);
  box-shadow: inset 0 0 0 2px var(--primary-color);
}

.rosterer-day-cell.rosterer-drop-copy-target {
  background: #eaf6ee;
  box-shadow: inset 0 0 0 2px #2f855a;
}

.rosterer-shift-quantity-badge {
  margin-left: 0.2rem;
  padding: 0.05rem 0.35rem;
}

.rosterer-grid .rosterer-shift-unpublished {
  background: var(--surface-white);
  color: var(--text-primary);
  border: 1px solid var(--grey-border);
}

.rosterer-row-footer-required .rosterer-shift {
  height: auto;
  min-height: 26px;
}

.rosterer-required-shift-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1.05;
}

/* ---- Rosterer: unavailability chips ---- */
.rosterer-grid .rosterer-unavailability-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  min-height: 26px;
  max-width: 100%;
  padding: 0 0.45rem;
  font-size: 0.78rem;
  font-weight: 600;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  flex-shrink: 1;
  border: 1px solid var(--grey-border);
  background: #eef2f7;
  color: #324154;
  text-align: center;
}

.rosterer-grid .rosterer-unavailability-chip.rosterer-unavailability-unapproved {
  background: var(--surface-white);
  color: var(--text-primary);
  border-color: var(--grey-border);
}

.rosterer-grid .rosterer-unavailability-source {
  font-size: 0.68rem;
  font-weight: 500;
}

.rosterer-grid .rosterer-unavailability-type-holiday-paid {
  background: #d9f6db;
  color: #1f5a2b;
  border-color: #8bc998;
}

.rosterer-grid .rosterer-unavailability-type-personal-paid {
  background: #d8e9ff;
  color: #184f87;
  border-color: #8cb6e6;
}

.rosterer-grid .rosterer-unavailability-type-unpaid {
  background: #ffe3bd;
  color: #8a4f00;
  border-color: #efba74;
}

.rosterer-grid .rosterer-unavailability-type-unknown {
  background: #eef2f7;
  color: #324154;
  border-color: #c3cfda;
}

/* ---- Rosterer: add button ---- */
.rosterer-grid .rosterer-add-btn {
  min-width: 28px;
  min-height: 28px;
  padding: 0;
  color: var(--text-primary);
}

.rosterer-grid .rosterer-add-btn:hover {
  background-color: var(--surface-overlay-hover);
  color: var(--primary-color);
}

.rosterer-grid .rosterer-add-btn svg {
  width: 20px;
  height: 20px;
}

/* ---- Rosterer: menu buttons ---- */
.rosterer-grid .rosterer-menu-btn {
  min-width: 18px;
  min-height: 18px;
  padding: 0;
  line-height: 1;
  color: var(--text-tertiary);
  border: none;
}

.rosterer-grid .rosterer-day-menu-btn {
  min-width: 18px;
  min-height: 18px;
  padding: 0;
  line-height: 1;
  color: var(--text-tertiary);
  border: none;
}

@media (max-width: 768px) {
  .rosterer-grid .rosterer-shift {
    font-size: 0.72rem;
    height: 22px;
  }
}

/* ---- Rosterer: unavailability add button (hover reveal) ---- */
.rosterer-unavailability-add-btn {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 20px;
  min-height: 20px;
  padding: 0;
  opacity: 0;
  transform: translateY(-2px);
  transition:
    opacity 0.2s ease,
    transform 0.2s ease;
  color: var(--text-secondary);
}

.rosterer-day-cell:hover .rosterer-unavailability-add-btn,
.rosterer-day-cell:focus-within .rosterer-unavailability-add-btn {
  opacity: 1;
  transform: translateY(0);
}

.rosterer-unavailability-add-btn:hover {
  color: var(--danger-color);
}

@media (max-width: 900px) {
  .rosterer-unavailability-add-btn {
    opacity: 1;
    transform: none;
  }
}

/* ---- Rosterer: day-cell kebab menu ---- */
.rosterer-day-menu {
  position: absolute;
  top: 2px;
  right: 2px;
}

.rosterer-day-menu > summary {
  list-style: none;
}

.rosterer-day-menu > summary::-webkit-details-marker {
  display: none;
}

.date-selector {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-grey);
  padding: 0.5rem;
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid var(--grey-border);
}

.date-selector-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.4rem;
  flex: 1;
}

.date-button {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  padding: 0.35rem;
  background: var(--surface-white);
  border: 1px solid var(--grey-border);
  border-radius: 0;
  text-decoration: none;
  color: var(--text-primary);
  font-size: 0.85rem;
}

.date-button.is-selected {
  border-color: var(--date-selected-border);
  background: var(--date-selected-bg);
  color: var(--date-selected-text);
}

.date-label {
  font-weight: 600;
}

.date-button.is-selected .date-label {
  color: var(--date-selected-text);
}

.date-sub {
  font-size: 0.75rem;
  color: var(--date-subtle-text);
}

.date-button.is-selected .date-sub {
  color: var(--date-selected-subtext);
}

.btn {
  border: 1px solid var(--grey-border);
  background: var(--surface-raised);
  color: var(--text-primary);
  border-radius: 0;
  padding: 0.35rem 0.65rem;
  cursor: pointer;
  font: inherit;
}

.btn:hover {
  background: var(--surface-hover);
}

.btn-primary {
  background: var(--primary-color);
  color: var(--primary-contrast);
  border-color: var(--primary-color);
}

.btn-primary:hover {
  background: var(--primary-hover);
}

.btn.btn-outline {
  background: transparent;
  color: var(--primary-color);
  border: 1px solid var(--primary-color);
}

.btn.btn-outline:hover {
  background: var(--primary-color);
  color: var(--primary-contrast);
}

.btn-ghost {
  background: transparent;
  border-color: transparent;
}

.btn-ghost:hover,
.btn-ghost:focus-visible {
  background: var(--surface-hover);
}

.btn:disabled,
.btn[disabled] {
  background: var(--surface-muted);
  color: var(--text-disabled);
  border-color: var(--grey-border);
  box-shadow: none;
  cursor: not-allowed;
}

.btn-square {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
}

.btn-sm {
  padding: 0.2rem 0.4rem;
  font-size: 0.75rem;
  line-height: 1.2;
}

.btn-xs {
  padding: 0.15rem 0.3rem;
  font-size: 0.7rem;
  line-height: 1.2;
}

.btn.is-active,
.btn.is-selected {
  border-color: var(--primary-color);
  background: var(--primary-medium);
}

.rs-select {
  border: 1px solid var(--grey-border);
  border-radius: 0;
  padding: 0.2rem 0.3rem;
  background: var(--surface-white) !important;
  color: var(--text-primary);
  line-height: 1.2;
  font-size: 0.75rem;
}

.rs-select-sm {
  font-size: 0.7rem;
  padding: 0.15rem 0.25rem;
  line-height: 1.2;
}

/* Status select - transparent when closed, keeps native chevron */
.rs-select-status {
  border-color: transparent;
  background: transparent !important;
  transition:
    background-color 0.15s,
    border-color 0.15s;
}

.rs-select-status:focus {
  outline: none;
  border-color: var(--grey-border);
  background: inherit;
}

/* Time select styling - appears as text when closed */
.rs-select-time {
  appearance: none;
  border: 1px solid transparent;
  border-radius: 0;
  padding: 0.2rem 0.15rem;
  background: transparent;
  color: var(--text-primary);
  line-height: 1.2;
  font-size: 0.75rem;
  font-weight: bold;
  cursor: pointer;
  width: auto;
  min-width: fit-content;
  transition:
    background-color 0.15s,
    border-color 0.15s;
}

.rs-select-time:focus {
  outline: none;
  border: 1px solid var(--grey-border);
  background: var(--surface-white);
}

.rs-select-time:focus-visible {
  outline: 2px solid var(--primary-color);
  outline-offset: -1px;
}

.rs-select-time.rs-select-sm {
  font-size: 0.7rem;
  padding: 0.2rem 0.1rem 0.05rem;
  line-height: 1;
}

button.task-time-tba-button {
  grid-row: 2;
  align-self: center;
  border: none;
  border-radius: 0;
  padding: 0.1rem 0.05rem;
  background: transparent;
  color: var(--text-primary);
  line-height: 1.2;
  font-size: 0.8rem;
  cursor: pointer;
  width: auto;
  font-family: inherit;
  transition: background 0.15s;
}

button.task-time-tba-button:hover {
  background: var(--surface-overlay-hover);
}

button.task-time-tba-button:focus-visible {
  outline: 1px solid var(--primary-color);
  outline-offset: -1px;
}

.shift-tools-wrapper {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.shift-tools {
  display: flex;
  gap: 0.4rem;
  align-items: center;
}

.shift-tools .btn {
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  height: 36px;
}

.shift-tools .btn svg {
  flex-shrink: 0;
}

.shift-sort-wrapper {
  position: relative;
}

#shift-sort-button {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.4rem 0.6rem;
  font-size: 0.85rem;
  white-space: nowrap;
  height: 36px;
}

#shift-sort-button span {
  display: none;
}

#shift-sort-button:hover {
  background-color: var(--surface-hover);
}

.shift-sort-menu {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 0.2rem;
  background: var(--surface-raised);
  border: 1px solid var(--grey-border);
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  z-index: 100;
  min-width: 120px;
}

.shift-sort-item {
  padding: 0.6rem 1rem;
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--text-primary);
  border-bottom: 1px solid var(--grey-border);
}

.shift-sort-item:last-child {
  border-bottom: none;
}

.shift-sort-item:hover {
  background-color: var(--surface-hover);
  color: var(--primary-color);
}

.shift-row {
  display: grid;
  grid-template-columns: 6rem 1fr auto;
  gap: 0.4rem;
  align-items: center;
}

.shift-staff {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  width: 100%;
  overflow: visible;
}

.shift-staff.shift-staff-has-role {
  border: 1px solid var(--grey-border);
}

.shift-badge-stack {
  position: absolute;
  top: -0.45rem;
  right: -0.3rem;
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  pointer-events: none;
  z-index: 1;
}

.shift-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  border: 1px solid var(--grey-border);
  border-radius: 999px;
  background: var(--surface-white);
  color: var(--text-secondary);
}

.shift-badge svg {
  display: block;
  width: 0.9rem;
  height: 0.9rem;
}

.shift-badge .shift-unpublished-icon {
  width: 100%;
  height: 100%;
}

.shift-unpublished-badge {
  color: var(--text-secondary);
}

.shift-staff-label {
  display: block;
  width: 100%;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shift-staff.is-selected .shift-badge {
  background: var(--surface-white);
  color: var(--text-primary);
}

/* Staff section */
.staff-section {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding-bottom: 0.75rem;
}

.staff-section > .btn-outline,
.vehicles-section > .runsheet-sse-block .btn-outline {
  margin-top: 0.25rem;
}

.staff-section .runsheet-sse-block,
.vehicles-section .runsheet-sse-block {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.shift-time {
  height: 100%;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.35rem 0.5rem;
  border: 1px solid var(--grey-border);
  border-radius: 0;
  background: var(--surface-raised);
  text-align: center;
  font-size: 0.85rem;
  overflow: visible;
}

.shift-time-badge {
  position: absolute;
  top: -0.45rem;
  right: -0.3rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  border: 1px solid var(--grey-border);
  border-radius: 999px;
  background: var(--surface-raised);
  color: var(--text-secondary);
  pointer-events: none;
}

.task-row {
  display: grid;
  grid-template-columns: auto auto 1fr 1fr 1fr 1fr;
  gap: 0.4rem;
  align-items: center;
  padding: 0.6rem;
  border-radius: 0;
  border: 1px solid var(--grey-border);
  background: var(--surface-white);
  line-height: 1.2;
}

.task-row > * {
  min-width: 0;
}

@container (min-width: 951px) {
  .task-row {
    grid-template-columns:
      110px 90px minmax(0, 1.4fr) minmax(0, 1.4fr) minmax(0, 0.85fr)
      minmax(0, 0.85fr) minmax(0, 1.7fr) minmax(120px, 1fr);
    gap: 0.6rem;
  }
}

@container (max-width: 720px) {
  .task-row {
    grid-template-columns: auto auto minmax(100px, 1fr);
    gap: 0.3rem;
  }
}

.task-row a {
  color: inherit;
  text-decoration: none;
  font-size: 0.8rem;
  line-height: 1.2;
}

.task-row a:hover {
  text-decoration: underline;
}

.runsheet-tasks-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 220px;
  padding: 1rem;
  border: 1px dashed var(--grey-border);
  background: var(--surface-white);
}

.runsheet-tasks-empty-image {
  display: block;
  width: min(100%, 320px);
  height: auto;
}

.task-time {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: 1fr 1fr 1fr;
  align-items: center;
  line-height: 1.2;
  font-size: 0.8rem;
}

.task-schedule-menu {
  position: relative;
  grid-row: 2;
  align-self: center;
  justify-self: start;
  display: inline-flex;
}

.task-schedule-trigger {
  list-style: none;
  cursor: pointer;
  padding: 0.1rem 0.25rem;
  border: 1px solid transparent;
  border-radius: 0;
  background: transparent;
  color: var(--text-primary);
  line-height: 1.2;
  font-size: 0.8rem;
  font-weight: normal;
  font-family: inherit;
  transition: background 0.15s;
}

.task-schedule-trigger::-webkit-details-marker {
  display: none;
}

.task-schedule-trigger:hover,
.task-schedule-menu[open] > .task-schedule-trigger {
  background: var(--surface-overlay-hover);
}

.task-schedule-trigger:focus-visible {
  outline: 1px solid var(--primary-color);
  outline-offset: -1px;
}

.task-schedule-panel {
  position: absolute;
  top: calc(100% + 0.25rem);
  left: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  min-width: 10.5rem;
  padding: 0.5rem;
  border: 1px solid var(--grey-border);
  background: var(--surface-white);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.14);
  z-index: 50;
  border-radius: 4px;
}

.task-schedule-field {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.task-schedule-field-label {
  font-size: 0.68rem;
  line-height: 1.1;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.task-schedule-value {
  font-size: 0.8rem;
  line-height: 1.2;
  color: var(--text-primary);
}

input.task-schedule-input[type="time"],
input.task-schedule-input[type="date"] {
  width: 100%;
  padding: 0.2rem 0.25rem;
  border: 1px solid var(--grey-border);
  border-radius: 0;
  background: var(--surface-white);
  color: var(--text-primary);
  line-height: 1.2;
  font-size: 0.8rem;
  font-family: inherit;
  cursor: pointer;
}

input.task-schedule-input[type="time"]:focus,
input.task-schedule-input[type="date"]:focus {
  outline: none;
  background: var(--surface-white);
  border: 1px solid var(--primary-color);
  padding: 0.2rem 0.25rem;
}

input.task-schedule-input[type="time"]:focus-visible,
input.task-schedule-input[type="date"]:focus-visible {
  outline: 1px solid var(--primary-color);
  outline-offset: -1px;
}

.task-duration {
  position: static;
  grid-row: 3;
  align-self: start;
}

.task-duration-button {
  padding: 0.1rem 0.25rem;
  border: 1px solid transparent;
  border-radius: 0;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.68rem;
  line-height: 1.1;
  cursor: pointer;
}

.task-duration-button:hover {
  background: var(--surface-overlay-hover);
}

.task-duration-button:focus-visible {
  outline: 1px solid var(--primary-color);
  outline-offset: 1px;
}

input.task-duration-input[type="number"] {
  appearance: none;
  border: none !important;
  border-radius: 0;
  padding: 0.05rem 0.05rem !important;
  background: transparent !important;
  color: var(--text-primary);
  line-height: 1.2;
  font-size: 0.75rem;
  font-weight: normal;
  width: 72px;
  font-family: inherit;
  transition: background 0.15s;
}

input.task-duration-input[type="number"]:focus {
  outline: none;
  background: var(--surface-white) !important;
  border: none !important;
}

input.task-duration-input[type="number"]:focus-visible {
  outline: 1px solid var(--primary-color);
  outline-offset: -1px;
}

.task-time-sep {
  font-weight: 600;
  padding-bottom: 1px;
}

.task-type,
.task-job {
  font-weight: 600;
  line-height: 1.2;
  font-size: 0.8rem;
}

.task-staff,
.task-vehicles {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  line-height: 1;
}

.task-staff .btn-xs,
.task-vehicles .btn-xs {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 28px;
  padding: 0.5rem;
  font-size: 0.65rem;
  line-height: 1.18;
  background: var(--surface-raised);
  border-color: var(--grey-border);
  box-shadow:
    0 1px 3px rgba(0, 0, 0, 0.12),
    0 1px 2px rgba(0, 0, 0, 0.08);
}

.task-staff .btn-xs:hover,
.task-vehicles .btn-xs:hover {
  background: var(--grey-hover);
  box-shadow:
    0 2px 4px rgba(0, 0, 0, 0.15),
    0 1px 2px rgba(0, 0, 0, 0.1);
}

.task-staff .btn-xs.task-resource-red,
.task-vehicles .btn-xs.task-resource-red {
  background: #ef4444;
  border-color: #dc2626;
  color: #ffffff;
}

.task-staff .btn-xs.task-resource-yellow,
.task-vehicles .btn-xs.task-resource-yellow {
  background: #facc15;
  border-color: #ca8a04;
  color: #1f2937;
}

.task-staff .btn-xs.task-resource-purple,
.task-vehicles .btn-xs.task-resource-purple {
  background: #7c3aed;
  border-color: #6d28d9;
  color: #ffffff;
}

.task-staff .btn-xs.task-resource-purple:hover,
.task-staff .btn-xs.task-resource-purple:focus-visible,
.task-vehicles .btn-xs.task-resource-purple:hover,
.task-vehicles .btn-xs.task-resource-purple:focus-visible {
  background: #6d28d9;
  border-color: #5b21b6;
  color: #ffffff;
}

.task-staff .btn-xs.task-resource-blue,
.task-vehicles .btn-xs.task-resource-blue {
  background: #3b82f6;
  border-color: #2563eb;
  color: #ffffff;
}

.task-staff .btn-xs.task-resource-blue:hover,
.task-staff .btn-xs.task-resource-blue:focus-visible,
.task-vehicles .btn-xs.task-resource-blue:hover,
.task-vehicles .btn-xs.task-resource-blue:focus-visible {
  background: #2563eb;
  border-color: #1d4ed8;
  color: #ffffff;
}

.task-staff .btn-xs.task-resource-teal,
.task-vehicles .btn-xs.task-resource-teal {
  background: #0d9488;
  border-color: #0f766e;
  color: #ffffff;
}

.task-staff .btn-xs.task-resource-teal:hover,
.task-staff .btn-xs.task-resource-teal:focus-visible,
.task-vehicles .btn-xs.task-resource-teal:hover,
.task-vehicles .btn-xs.task-resource-teal:focus-visible {
  background: #0f766e;
  border-color: #115e59;
  color: #ffffff;
}

.task-staff .btn-xs.task-resource-orange,
.task-vehicles .btn-xs.task-resource-orange {
  background: #ea580c;
  border-color: #c2410c;
  color: #ffffff;
}

.task-staff .btn-xs.task-resource-orange:hover,
.task-staff .btn-xs.task-resource-orange:focus-visible,
.task-vehicles .btn-xs.task-resource-orange:hover,
.task-vehicles .btn-xs.task-resource-orange:focus-visible {
  background: #c2410c;
  border-color: #9a3412;
  color: #ffffff;
}

.task-staff .btn-xs.task-resource-slate,
.task-vehicles .btn-xs.task-resource-slate {
  background: #334155;
  border-color: #1e293b;
  color: #ffffff;
}

.task-staff .btn-xs.task-resource-slate:hover,
.task-staff .btn-xs.task-resource-slate:focus-visible,
.task-vehicles .btn-xs.task-resource-slate:hover,
.task-vehicles .btn-xs.task-resource-slate:focus-visible {
  background: #1e293b;
  border-color: #0f172a;
  color: #ffffff;
}

.task-staff .btn-xs.task-resource-red:hover,
.task-staff .btn-xs.task-resource-red:focus-visible,
.task-vehicles .btn-xs.task-resource-red:hover,
.task-vehicles .btn-xs.task-resource-red:focus-visible {
  background: #dc2626;
  border-color: #b91c1c;
  color: #ffffff;
}

.task-staff .btn-xs.task-resource-yellow:hover,
.task-staff .btn-xs.task-resource-yellow:focus-visible,
.task-vehicles .btn-xs.task-resource-yellow:hover,
.task-vehicles .btn-xs.task-resource-yellow:focus-visible {
  background: #eab308;
  border-color: #a16207;
  color: #111827;
}

html[data-theme="dark"] .task-staff .btn-xs.task-resource-yellow,
html[data-theme="dark"] .task-vehicles .btn-xs.task-resource-yellow {
  background: #facc15;
  border-color: #f59e0b;
  color: #1f2329;
}

html[data-theme="dark"] .task-staff .btn-xs.task-resource-yellow:hover,
html[data-theme="dark"] .task-staff .btn-xs.task-resource-yellow:focus-visible,
html[data-theme="dark"] .task-vehicles .btn-xs.task-resource-yellow:hover,
html[data-theme="dark"] .task-vehicles .btn-xs.task-resource-yellow:focus-visible {
  background: #f59e0b;
  border-color: #d97706;
  color: #1f2329;
}

.task-resource {
  position: relative;
  display: inline-flex;
  align-items: stretch;
}

.task-clash-popover {
  position: static;
}

.task-clash-popover > summary {
  list-style: none;
  cursor: pointer;
  position: absolute;
  top: -6px;
  right: -6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 15px;
  height: 15px;
  padding: 0 4px;
  border: 1px solid var(--surface-white);
  border-radius: 999px;
  background: var(--grey-border);
  color: var(--text-primary);
  font-size: 9px;
  font-weight: 700;
  line-height: 1;
  box-sizing: border-box;
  z-index: 2;
}

.task-clash-indicator.task-resource-red {
  background: #ef4444;
  color: #ffffff;
}

.task-clash-indicator.task-resource-yellow {
  background: #facc15;
  color: #1f2937;
}

.task-clash-indicator.task-resource-purple {
  background: #7c3aed;
  color: #ffffff;
}

.task-clash-indicator.task-resource-orange {
  background: #ea580c;
  color: #ffffff;
}

.task-clash-indicator.task-resource-blue {
  background: #3b82f6;
  color: #ffffff;
}

.task-clash-indicator.task-resource-teal {
  background: #0d9488;
  color: #ffffff;
}

.task-clash-indicator.task-resource-slate {
  background: #334155;
  color: #ffffff;
}

.task-clash-popover > summary::-webkit-details-marker {
  display: none;
}

.task-clash-popover-panel {
  position: absolute;
  top: calc(100% + 0.25rem);
  left: 0;
  min-width: 16rem;
  max-width: 22rem;
  display: grid;
  gap: 0.25rem;
  padding: 0.35rem;
  border: 1px solid var(--grey-border);
  border-radius: 8px;
  background: var(--surface-white);
  box-shadow:
    0 10px 24px rgba(15, 23, 42, 0.14);
  z-index: 50;
  box-sizing: border-box;
  overflow-wrap: anywhere;
}

.task-clash-finding {
  display: grid;
  gap: 0.15rem;
  padding: 0.35rem 0.4rem;
  border-radius: 6px;
  text-align: left;
}

.task-clash-heading {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.task-clash-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--grey-border);
}

.task-clash-dot.task-resource-red {
  background: #ef4444;
}

.task-clash-dot.task-resource-yellow {
  background: #facc15;
}

.task-clash-dot.task-resource-purple {
  background: #7c3aed;
}

.task-clash-dot.task-resource-orange {
  background: #ea580c;
}

.task-clash-dot.task-resource-blue {
  background: #3b82f6;
}

.task-clash-dot.task-resource-teal {
  background: #0d9488;
}

.task-clash-dot.task-resource-slate {
  background: #334155;
}

.task-clash-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-primary);
}

.task-clash-line {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.task-clash-finding.is-dismissed .task-clash-label,
.task-clash-finding.is-dismissed .task-clash-line {
  text-decoration: line-through;
  color: var(--text-secondary);
}

.task-clash-dismissed-by {
  font-size: 0.7rem;
  font-style: italic;
  color: var(--text-secondary);
}

.task-clash-form {
  margin: 0;
}

.task-clash-action {
  border: 0;
  padding: 0;
  background: transparent;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-primary);
  text-decoration: underline;
  cursor: pointer;
  text-align: left;
}

.task-notes {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1.2;
  min-height: 52px;
  padding: 4px 6px !important;
  background: inherit;
}

.task-notes-text {
  width: 100%;
  font-size: 0.75rem;
  color: var(--text-secondary);
  line-height: 1.3;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.task-notes-edit-button {
  position: absolute;
  right: 0.35rem;
  bottom: 0;
  transform: translateY(50%);
  z-index: 1;
  border: 1px solid var(--grey-border);
  background: inherit;
  padding: 0 2px !important;
  min-width: 0 !important;
  min-height: 0 !important;
}

.task-actions {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  align-items: flex-end;
  line-height: 1.2;
}

.task-actions-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  justify-content: flex-end;
}

.task-action-btn {
  min-width: 28px;
  min-height: 28px;
}

.task-action-btn.is-loading {
  opacity: 0.55;
  cursor: wait;
}

.task-action-menu {
  position: relative;
  display: inline-flex;
}

.task-action-menu > summary {
  list-style: none;
  cursor: pointer;
}

.task-action-menu > summary::-webkit-details-marker {
  display: none;
}

.task-action-menu-panel {
  position: absolute;
  top: calc(100% + 0.25rem);
  right: 0;
  min-width: 9.5rem;
  padding: 0.25rem;
  border: 1px solid var(--grey-border);
  background: var(--surface-white);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.14);
  z-index: 50;
  border-radius: 4px;
}

.task-action-menu-item {
  display: block;
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
  padding: 0.45rem 0.5rem;
  font-size: 0.85rem;
  color: var(--text-primary);
  cursor: pointer;
}

.task-action-menu-item:hover,
.task-action-menu-item:focus-visible {
  background: var(--surface-hover);
  outline: none;
}

.task-history-panel {
  grid-column: 1 / -1;
  padding-top: 0.15rem;
}

.task-history-card {
  border: 1px solid var(--grey-border);
  background: rgba(255, 255, 255, 0.52);
  padding: 0.7rem 0.85rem;
}

.task-history-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.45rem;
}

.task-history-heading {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.task-history-list {
  margin: 0;
  padding-left: 1.1rem;
}

.task-history-item {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.4;
  white-space: pre-wrap;
  tab-size: 2;
}

.task-history-item + .task-history-item {
  margin-top: 0.25rem;
}

.task-history-empty {
  margin: 0;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.task-status-unconfirmed {
  background: white;
}

.task-status-confirmed {
  background: #e5e5e5;
}

.task-status-despatched {
  background: #c2ebed;
}

.task-status-in-progress {
  background: #ffb347;
}

.task-status-completed {
  background: #77dd77;
}

.task-status-postponed {
  background: #fff9aa;
}

.task-status-cancelled {
  background: #ffb9b3;
}
.task-status-booked-out {
  background: #d13c1e;
}
.task-status-loaded,
.task-status-layed-out {
  background: #cdabed;
}
.task-status-prepped {
  background: #81bc00;
}
/* Viewport-based: shell/panel layout for mobile screens */
@media (max-width: 768px) {
  .runsheet-shell {
    flex-direction: row;
  }

  .runsheet-panel {
    position: fixed;
    left: 0;
    top: var(--runsheet-nav-height);
    width: 80vw;
    height: calc(100vh - var(--runsheet-nav-height));
    z-index: 1000;
    background: var(--surface-white);
    border-right: 1px solid var(--grey-border);
    border-bottom: none;
    overflow-x: hidden;
    overflow-y: auto;
    box-shadow: none;
    transition: transform 0.2s ease;
    transform: translateX(-100%);
    border-right: none;
  }

  .runsheet-panel[data-mobile-open="true"] {
    transform: translateX(0);
    border-right: 1px solid var(--grey-border);
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.15);
  }

  .runsheet-panel.is-collapsed {
    width: 80vw;
    padding: 0;
    border-right: none;
    overflow: hidden;
    transform: translateX(-100%);
    box-shadow: none;
  }
}

/* Popover backdrop overlay - only visible on mobile */
.popover-backdrop {
  display: none;
}

@media (max-width: 768px) {
  .popover-backdrop {
    position: fixed;
    top: var(--runsheet-nav-height);
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    display: block;
  }

  .popover-backdrop.hidden {
    display: none;
  }
}

/* Container-based: task row responds to runsheet main width */
@container (max-width: 950px) {
  .task-row {
    grid-template-columns: auto auto 1fr 1fr 1fr 1fr;
    grid-template-rows: auto auto auto auto auto;
    gap: 0.4rem;
  }

  .task-time {
    grid-column: 1;
    grid-row: 1;
  }

  .task-type {
    grid-column: 2;
    grid-row: 1;
  }

  .task-job {
    grid-column: 3 / -1;
    grid-row: 1;
  }

  .task-address {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .task-staff {
    grid-column: 1 / 4;
    grid-row: 3;
  }

  .task-vehicles {
    grid-column: 4 / -1;
    grid-row: 3;
  }

  .task-notes {
    grid-column: 1 / -1;
    grid-row: 4;
  }

  .task-actions {
    grid-column: 1 / -1;
    grid-row: 5;
    flex-direction: column;
    align-items: flex-start;
  }

  .task-history-panel {
    grid-column: 1 / -1;
    grid-row: 6;
  }
}

/* ===== RESPONSIVE DATE SELECTOR ===== */

/* Desktop: show week view, hide mobile toggle */
.date-selector-mobile {
  display: none;
}

.date-selector-mobile-toggle {
  display: none;
}

.date-selector-mobile-nav {
  display: none;
}

.date-selector-desktop {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
}

/* Mobile: show single date button, hide week view */
@media (max-width: 640px) {
  .date-selector-mobile {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
  }

  .date-selector-mobile-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    min-width: 0;
    padding: 0.5rem 1rem;
    background: var(--surface-white);
    border: 1px solid var(--grey-border);
    border-radius: 0;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    transition: background-color 0.2s;
  }

  .date-selector-mobile-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .date-selector-mobile-nav {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    min-width: 2.5rem;
    height: 2.5rem;
    background: var(--surface-white);
    border: 1px solid var(--grey-border);
    color: var(--text-primary);
    text-decoration: none;
  }

  .date-selector-mobile-toggle:hover {
    background: var(--surface-overlay-hover);
  }

  .date-selector-mobile-nav:hover {
    background: var(--surface-overlay-hover);
  }

  .date-selector-desktop {
    display: none;
  }
}

/* ===== NOTES MODAL ===== */

.notes-modal {
  position: fixed;
  top: var(--app-nav-offset);
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  overflow-y: auto;
}

.notes-modal.hidden {
  display: none;
}

.notes-modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--modal-backdrop);
  cursor: pointer;
}

.notes-modal-content {
  position: relative;
  background: var(--surface-raised);
  border: 1px solid var(--grey-border);
  border-radius: 0;
  max-width: 600px;
  width: 100%;
  max-height: calc(100vh - var(--app-nav-offset) - 2rem);
  max-height: calc(100dvh - var(--app-nav-offset) - 2rem);
  padding: 1.5rem;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  z-index: 1001;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.notes-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--grey-border);
}

.notes-modal-header h3 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.notes-modal-body {
  margin-bottom: 1.5rem;
  min-height: 0;
  overflow-y: auto;
}

.notes-modal-body textarea {
  width: 100%;
  min-height: 200px;
  padding: 0.75rem;
  border: 1px solid var(--grey-border);
  background-color: var(--surface-muted);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.875rem;
  line-height: 1.5;
  resize: vertical;
  border-radius: 0;
}

.notes-modal-body textarea:focus {
  outline: none;
  border-color: var(--primary-color);
  background-color: var(--surface-overlay-hover);
}

.form-helper-text {
  margin: 0.4rem 0 0;
  color: var(--text-secondary);
  font-size: 0.85rem;
  line-height: 1.4;
}

.notes-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  flex-shrink: 0;
}

.task-info-empty {
  margin: 0;
  color: var(--text-secondary);
}

.task-info-row {
  display: grid;
  grid-template-columns: minmax(0, 160px) minmax(0, 1fr) auto;
  gap: 0.5rem;
  align-items: center;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--grey-border);
}

.task-info-row:last-child {
  border-bottom: 0;
}

.task-info-label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.task-info-value {
  min-width: 0;
  color: var(--text-primary);
  overflow-wrap: anywhere;
}

@media (max-width: 640px) {
  .task-info-row {
    grid-template-columns: 1fr auto;
  }

  .task-info-label,
  .task-info-value {
    grid-column: 1 / 2;
  }

  .task-info-row .btn {
    grid-column: 2 / 3;
    grid-row: 1 / span 2;
    align-self: center;
  }
}

.shift-validation-panel {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin: 1rem 0;
  padding: 0.875rem 1rem;
  border: 1px solid var(--grey-border);
  background: var(--surface-overlay);
}

.shift-validation-section {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.shift-validation-section strong {
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.shift-validation-section:first-child strong {
  color: #a33a2b;
}

.shift-validation-section:last-child strong {
  color: #8a5b00;
}

.shift-validation-list {
  margin: 0;
  padding-left: 1.2rem;
  color: var(--text-primary);
  font-size: 0.9rem;
  line-height: 1.5;
}

/* ===== CALENDAR MODAL ===== */

.calendar-modal {
  position: fixed;
  top: var(--app-nav-offset);
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  overflow-y: auto;
}

.calendar-modal.hidden {
  display: none;
}

.calendar-modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--modal-backdrop);
  cursor: pointer;
}

.calendar-modal-content {
  position: relative;
  background: var(--surface-raised);
  border: 1px solid var(--grey-border);
  border-radius: 0;
  max-width: 400px;
  width: 100%;
  max-height: calc(100vh - var(--app-nav-offset) - 2rem);
  max-height: calc(100dvh - var(--app-nav-offset) - 2rem);
  padding: 1.5rem;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  z-index: 1001;
  overflow-y: auto;
}

@media (max-width: 768px) {
  .notes-modal,
  .calendar-modal {
    align-items: flex-start;
    padding: 0.5rem;
  }

  .notes-modal-content,
  .calendar-modal-content {
    max-height: calc(100vh - var(--app-nav-offset) - 1rem);
    max-height: calc(100dvh - var(--app-nav-offset) - 1rem);
    padding: 1rem;
  }

  .notes-modal-footer {
    flex-wrap: wrap;
  }
}

.calendar-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--grey-border);
}

.calendar-month-year {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  flex: 1;
  text-align: center;
}

.calendar-nav-btn {
  background: transparent;
  border: 1px solid var(--grey-border);
  border-radius: 0;
  padding: 0.3rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s;
}

.calendar-nav-btn:hover {
  background: var(--surface-overlay-hover);
}

.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.25rem;
  margin-bottom: 0.5rem;
}

.calendar-weekdays > div {
  text-align: center;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-tertiary);
  padding: 0.5rem 0;
}

.calendar-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.25rem;
  margin-bottom: 1rem;
}

.calendar-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-raised);
  border: 1px solid var(--grey-border);
  border-radius: 0;
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.2s;
  text-decoration: none;
  color: var(--text-primary);
}

.calendar-day:hover {
  background: var(--surface-overlay-hover);
  border-color: var(--primary-color);
}

.calendar-day.is-selected {
  background: var(--primary-color);
  color: var(--primary-contrast);
  border-color: var(--primary-color);
  font-weight: 600;
}

.calendar-day.is-today {
  border-color: var(--primary-color);
  border-width: 2px;
}

.calendar-day.is-other-month {
  color: var(--text-disabled);
  background: var(--surface-muted);
}

.calendar-day.is-other-month:hover {
  background: var(--grey-hover);
}

.calendar-close-btn {
  width: 100%;
  padding: 0.6rem;
  background: var(--primary-color);
  color: var(--primary-contrast);
  border: none;
  border-radius: 0;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
  transition: background-color 0.2s;
}

.calendar-close-btn:hover {
  background: var(--primary-hover);
}

html {
  color-scheme: light;
}

html[data-theme="dark"] {
  color-scheme: dark;

  --primary-color: rgba(245, 245, 245, 0.18);
  --primary-hover: #ffffff;
  --primary-active: #dcdcdc;
  --primary-light: rgba(245, 245, 245, 0.12);
  --primary-medium: rgba(245, 245, 245, 0.18);
  --primary-contrast: #1f2329;

  --bg-grey: #2f3136;
  --grey-hover: #3d4046;
  --grey-border: #5a5f67;

  --text-primary: #f5f5f5;
  --text-secondary: #d6d6d6;
  --text-tertiary: #b0b0b0;
  --text-disabled: rgba(245, 245, 245, 0.45);
  --text-hint: rgba(245, 245, 245, 0.2);

  --surface-white: #404349;
  --surface-raised: #4a4e55;
  --surface-muted: #36393f;
  --surface-primary: rgba(255, 255, 255, 0.06);
  --surface-overlay: rgba(255, 255, 255, 0.06);
  --surface-overlay-hover: rgba(255, 255, 255, 0.1);
  --surface-hover: rgba(255, 255, 255, 0.12);
  --modal-backdrop: rgba(6, 8, 12, 0.72);

  --toolbar-bg: #22252b;
  --toolbar-overlay: rgba(255, 255, 255, 0.18);
  --toolbar-overlay-hover: rgba(255, 255, 255, 0.28);
  --toolbar-border: rgba(255, 255, 255, 0.5);
  --date-selected-bg: #dfe4ec;
  --date-selected-border: #f5f5f5;
  --date-selected-text: #111827;
  --date-selected-subtext: #374151;
  --date-subtle-text: #d1d5db;

  --task-surface: #3a3d44;
  --task-border: #5d636d;
  --task-accent-unconfirmed: #d7dbe0;
  --task-accent-confirmed: #b0bec5;
  --task-accent-despatched: #4dd0e1;
  --task-accent-in-progress: #ffb74d;
  --task-accent-completed: #81c784;
  --task-accent-postponed: #fff59d;
  --task-accent-cancelled: #ef9a9a;
  --task-accent-booked-out: #ff7043;
  --task-accent-loaded: #ce93d8;
  --task-accent-layed-out: #ce93d8;
  --task-accent-prepped: #aed581;
}

html[data-theme="dark"] .task-row {
  background: var(--task-surface);
  border-color: var(--task-border);
}

html[data-theme="dark"] .runsheet-tasks-empty {
  background: var(--task-surface);
  border-color: var(--task-border);
}

html[data-theme="dark"] .task-status-unconfirmed {
  background: #4a4e55;
  border-color: var(--task-accent-unconfirmed);
  border-left: 6px solid var(--task-accent-unconfirmed);
}

html[data-theme="dark"] .task-status-confirmed {
  border-color: var(--task-accent-confirmed);
  border-left: 6px solid var(--task-accent-confirmed);
}

html[data-theme="dark"] .task-status-despatched {
  border-color: var(--task-accent-despatched);
  border-left: 6px solid var(--task-accent-despatched);
}

html[data-theme="dark"] .task-status-in-progress {
  border-color: var(--task-accent-in-progress);
  border-left: 6px solid var(--task-accent-in-progress);
}

html[data-theme="dark"] .task-status-completed {
  border-color: var(--task-accent-completed);
  border-left: 6px solid var(--task-accent-completed);
}

html[data-theme="dark"] .task-status-postponed {
  border-color: var(--task-accent-postponed);
  border-left: 6px solid var(--task-accent-postponed);
}

html[data-theme="dark"] .task-status-cancelled {
  border-color: var(--task-accent-cancelled);
  border-left: 6px solid var(--task-accent-cancelled);
}

html[data-theme="dark"] .task-status-booked-out {
  border-color: var(--task-accent-booked-out);
  border-left: 6px solid var(--task-accent-booked-out);
}

html[data-theme="dark"] .task-status-loaded,
html[data-theme="dark"] .task-status-layed-out {
  border-color: var(--task-accent-loaded);
  border-left: 6px solid var(--task-accent-loaded);
}

html[data-theme="dark"] .task-status-prepped {
  border-color: var(--task-accent-prepped);
  border-left: 6px solid var(--task-accent-prepped);
}

html[data-theme="dark"] .quick-link-task-list-status.task-status-unconfirmed {
  background: #f4f5f6;
  border-color: #d7dbe0;
  color: #3d434a;
}

html[data-theme="dark"] .quick-link-task-list-status.task-status-confirmed {
  background: #d9e0e5;
  border-color: #b7c2ca;
  color: #27323a;
}

html[data-theme="dark"] .quick-link-task-list-status.task-status-booked-out {
  background: #ff7043;
  border-color: #ff8a65;
  color: #fff4ef;
}

html[data-theme="dark"] .quick-link-task-list-status.task-status-loaded,
html[data-theme="dark"] .quick-link-task-list-status.task-status-layed-out {
  background: #d2a8ef;
  border-color: #e0bfff;
  color: #35213f;
}

html[data-theme="dark"] .quick-link-task-list-status.task-status-prepped {
  background: #b8d978;
  border-color: #cae58f;
  color: #24320e;
}

html[data-theme="dark"] .quick-link-task-list-status.task-status-completed {
  background: #8fd39c;
  border-color: #a7e3b2;
  color: #17341f;
}

html[data-theme="dark"] .quick-link-task-list-status.task-status-in-progress {
  background: #ffc36b;
  border-color: #ffd08e;
  color: #3f2a06;
}

html[data-theme="dark"] .quick-link-task-list-status.task-status-despatched {
  background: #70d7e6;
  border-color: #94e4ef;
  color: #12313a;
}

html[data-theme="dark"] .quick-link-task-list-status.task-status-postponed {
  background: #f3eb9e;
  border-color: #fbf3ba;
  color: #40380b;
}

html[data-theme="dark"] .quick-link-task-list-status.task-status-cancelled {
  background: #eea4a4;
  border-color: #f4bbbb;
  color: #471818;
}

html[data-theme="dark"] .quick-link-task-list-count {
  background: #dfe4ec;
  color: #111827;
}

html[data-theme="dark"] .quick-link-task-list-play {
  background: #dfe4ec;
  border-color: #f5f5f5;
  color: #111827;
}

html[data-theme="dark"] .quick-link-task-list-play:hover,
html[data-theme="dark"] .quick-link-task-list-play:focus-visible {
  background: #f5f5f5;
  border-color: #ffffff;
  color: #111827;
}

html[data-theme="dark"] .btn-primary,
html[data-theme="dark"] .btn-raised {
  background: #dfe4ec;
  border-color: #f5f5f5;
  color: #111827;
}

html[data-theme="dark"] .btn-primary:hover,
html[data-theme="dark"] .btn-primary:focus-visible,
html[data-theme="dark"] .btn-raised:hover,
html[data-theme="dark"] .btn-raised:focus-visible {
  background: #f5f5f5;
  border-color: #ffffff;
  color: #111827;
}

html[data-theme="dark"] .btn-primary:disabled,
html[data-theme="dark"] .btn-primary[disabled],
html[data-theme="dark"] .btn-raised:disabled,
html[data-theme="dark"] .btn-raised[disabled],
html[data-theme="dark"] .btn:disabled,
html[data-theme="dark"] .btn[disabled] {
  background: #9ca3af;
  border-color: #cbd5e1;
  color: #111827;
  box-shadow: none;
}

html[data-theme="dark"] .shift-staff,
html[data-theme="dark"] .vehicle-button,
html[data-theme="dark"] .staff-section > .btn-outline,
html[data-theme="dark"] .vehicles-section > .runsheet-sse-block .btn-outline {
  background: var(--surface-raised);
  border-color: var(--grey-border);
  color: var(--text-primary);
}

html[data-theme="dark"] .shift-staff:hover,
html[data-theme="dark"] .vehicle-button:hover,
html[data-theme="dark"] .staff-section > .btn-outline:hover,
html[data-theme="dark"] .vehicles-section > .runsheet-sse-block .btn-outline:hover {
  border-color: #7a808a;
  background: #555961;
}

html[data-theme="dark"] .vehicle-button.is-selected,
html[data-theme="dark"] .shift-staff.is-selected {
  background: #4d5fc9;
  border-color: #7f90ff;
  color: #ffffff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}

html[data-theme="dark"] .shift-staff.is-selected .shift-badge {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.28);
  color: #ffffff;
}

html[data-theme="dark"] .shift-time-badge {
  background: #5e4b2f;
  border-color: #c59752;
  color: #ffe6c7;
}

html[data-theme="dark"] .shift-time-badge .shift-unpublished-icon,
html[data-theme="dark"] .shift-unpublished-badge {
  color: inherit;
}

html[data-theme="dark"] .rs-select {
  background: inherit !important;
}

html[data-theme="dark"] .rs-select-status {
  background: transparent !important;
}

html[data-theme="dark"] .rs-select-status:focus {
  background: inherit !important;
}

html[data-theme="dark"] select {
  color-scheme: dark;
  color: var(--text-primary);
}

html[data-theme="dark"] select option,
html[data-theme="dark"] select optgroup {
  background: var(--surface-raised);
  color: var(--text-primary);
}

html[data-theme="dark"] .rosterer-unavailability-chip {
  background: #2e3c4c;
  color: #eef2f7;
  border-color: #4c6178;
}

html[data-theme="dark"] .rosterer-unavailability-unapproved {
  background: var(--surface-white);
  color: var(--text-primary);
}

html[data-theme="dark"] .rosterer-unavailability-type-holiday-paid {
  background: #21452d;
  color: #d9f6db;
  border-color: #4f8a60;
}

html[data-theme="dark"] .rosterer-unavailability-type-personal-paid {
  background: #183750;
  color: #d8e9ff;
  border-color: #4b7aa8;
}

html[data-theme="dark"] .rosterer-unavailability-type-unpaid {
  background: #503515;
  color: #ffe3bd;
  border-color: #9d6c29;
}

html[data-theme="dark"] .rosterer-unavailability-type-unknown {
  background: #2e3c4c;
  color: #eef2f7;
  border-color: #4c6178;
}

/* ===== SECTION: TESTER PAGE ===== */

.tester-scan-card label {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--text-secondary);
}

.tester-scan-card input {
  width: 100%;
}

.tester-stale-card {
  display: grid;
  gap: 0.9rem;
}

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

.tester-stale-title {
  margin: 0 0 0.25rem;
  font-size: 1.1rem;
  line-height: 1.25;
}

.tester-stale-summary {
  color: var(--text-tertiary);
  font-size: 0.9rem;
}

.tester-stale-summary.is-error {
  color: var(--accent-color);
}

.tester-stale-summary.is-loading {
  color: var(--primary-color);
}

.tester-stale-refresh {
  flex: 0 0 auto;
}

.tester-stale-list {
  display: grid;
  gap: 0.65rem;
  max-height: 280px;
  overflow-y: auto;
}

.tester-stale-item {
  display: block;
  width: 100%;
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--grey-border);
  border-radius: 0;
  background: var(--bg-grey);
  color: var(--text-primary);
  text-align: left;
  cursor: pointer;
}

.tester-stale-item:hover {
  border-color: var(--primary-color);
  background: var(--surface-overlay);
}

.tester-stale-empty {
  color: var(--text-tertiary);
  font-size: 0.9rem;
}

.tester-alerts {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin: 0.85rem 0;
}

.tester-alert {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1rem;
  border-radius: 0;
  border: 1px solid var(--accent-color);
  background-color: rgba(245, 0, 87, 0.08);
  color: var(--text-primary);
}

.tester-alert-message {
  flex: 1;
}

.tester-alert-dismiss {
  border: none;
  background: transparent;
  color: var(--accent-color);
  font-weight: 600;
  cursor: pointer;
  padding: 0;
}

.tester-alert-dismiss:hover {
  color: var(--accent-hover);
}

.tester-alert-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.tester-alert-checkin {
  border: none;
  background: transparent;
  color: var(--primary-color);
  font-weight: 600;
  cursor: pointer;
  padding: 0;
}

.tester-alert-checkin:hover {
  color: var(--primary-hover);
}

.tester-alert-actions button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.tester-tabs-card {
  padding: 0;
  overflow: hidden;
}

.tester-page .landing-content {
  grid-template-columns: 1fr;
  padding-bottom: 5.5rem;
}

.tester-page .landing-section .card {
  flex: initial;
}

.tester-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  padding: 0.75rem 1.5rem 0;
  background-color: var(--surface-white);
  border-bottom: 1px solid var(--grey-border);
}

.tester-tab {
  border: none;
  background-color: transparent;
  color: var(--text-tertiary);
  padding: 0 0 0.75rem;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.tester-tab.active {
  color: var(--text-primary);
  border-bottom-color: var(--primary-color);
  font-weight: 500;
}

.tester-tab:hover {
  color: var(--primary-hover);
}

.tester-tab-content {
  padding: 1.25rem;
}

.tester-empty {
  color: var(--text-tertiary);
  font-size: 0.95rem;
}

.tester-panel {
  display: none;
}

.tester-panel.active {
  display: block;
}

.tester-panel-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 1rem;
}

.tester-panel-title {
  width: 100%;
}

.tester-item-name {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.6rem;
  margin-bottom: 0;
  width: 100%;
}

.tester-item-name-text {
  font-weight: 600;
}

.tester-item-number {
  font-size: 0.95rem;
  color: var(--text-tertiary);
  font-weight: 500;
}

.tester-item-number .tester-asset-link {
  color: inherit;
  text-decoration: none;
}

html[data-theme="dark"] .tester-item-number .tester-asset-link {
  color: var(--text-secondary);
}

.tester-item-number .tester-asset-link:hover {
  text-decoration: underline;
}

.tester-item-number.is-hidden {
  display: none;
}

.tester-panel-status {
  font-size: 0.9rem;
  color: var(--text-tertiary);
}

.tester-panel-status.is-error {
  color: var(--accent-color);
}

.tester-panel-status.is-loading {
  color: var(--primary-color);
}

.tester-panel-body {
  display: grid;
  gap: 1.25rem;
  padding-bottom: 1rem;
}

.tester-section-label {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--text-secondary);
}

.tester-log {
  background-color: var(--bg-grey);
  border-radius: 0;
  padding: 0.85rem;
  min-height: 180px;
  max-height: 320px;
  overflow-y: auto;
  border: 1px solid var(--grey-border);
}

.tester-notes-input {
  width: 100%;
  min-height: 180px;
  max-height: 320px;
  resize: vertical;
  padding: 0.85rem;
  border-radius: 0;
  border: 1px solid var(--grey-border);
  background-color: var(--bg-grey);
  font-family: inherit;
  font-size: 1rem;
  color: var(--text-primary);
}

.tester-notes-input:focus {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

.tester-opportunity {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
  padding: 0.5rem 0.75rem;
  background-color: var(--surface-overlay);
  border-radius: 0;
}

.tester-opportunity.is-hidden {
  display: none;
}

.tester-opportunity-label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--text-tertiary);
}

.tester-opportunity-link {
  color: var(--primary-color);
  font-weight: 600;
  text-decoration: none;
}

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

.tester-log-list {
  display: grid;
  gap: 0.75rem;
}

.tester-log-item {
  border-radius: 0;
  padding: 0.85rem 1rem;
  display: grid;
  gap: 0.35rem;
  color: #1b1b1b;
  box-shadow:
    0 2px 2px -1px rgba(0, 0, 0, 0.1),
    0 1px 3px 0 rgba(0, 0, 0, 0.08);
}

.tester-log-item-pass {
  background-color: #6ee7b7;
}

.tester-log-item-fail {
  background-color: #fca5a5;
}

.tester-log-item-quarantine {
  background-color: #fde68a;
}

.tester-log-link {
  text-decoration: none;
  color: inherit;
}

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

.tester-log-status {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  opacity: 0.8;
}

.tester-log-title {
  font-size: 1.05rem;
  font-weight: 500;
}

.tester-log-details {
  font-size: 0.95rem;
  white-space: pre-wrap;
}

.tester-log-description {
  font-size: 0.85rem;
  white-space: pre-wrap;
  opacity: 0.8;
  margin-top: 0.5rem;
}

.tester-log-empty {
  color: var(--text-tertiary);
  font-size: 0.95rem;
}

.tester-actions {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 1rem;
  align-items: center;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 0.75rem 1.5rem;
  background-color: var(--surface-white);
  border-top: 1px solid var(--grey-border);
  box-shadow: 0 -2px 6px rgba(0, 0, 0, 0.08);
  z-index: 200;
}

.tester-action {
  min-width: 0;
  width: 100%;
}

.tester-action:disabled {
  cursor: not-allowed;
}

.tester-action-spacer {
  visibility: hidden;
  pointer-events: none;
}

.tester-action-pass {
  background-color: #6ee7b7;
  color: #1b1b1b;
}

.tester-action-pass:hover {
  background-color: #5fd9ab;
}

.tester-action-fail {
  background-color: #fca5a5;
  color: #1b1b1b;
}

.tester-action-fail:hover {
  background-color: #f98f8f;
}

.tester-action-remove {
  background-color: #9e9e9e;
  color: #fff;
}

.tester-action-remove:hover {
  background-color: #7e7e7e;
}

html[data-theme="dark"] .tester-action-remove {
  background-color: #616161;
  color: #f5f5f5;
}

html[data-theme="dark"] .tester-action-remove:hover {
  background-color: #707070;
}

@media (max-width: 720px) {
  .tester-stale-header {
    flex-direction: column;
  }

  .tester-stale-refresh {
    width: 100%;
  }

  .tester-panel-header {
    flex-direction: column;
  }

  .tester-actions {
    grid-template-columns: 1fr;
  }
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
}

body {
  font-family: "Roboto", "Helvetica", "Arial", sans-serif;
  background-color: var(--bg-grey);
  color: var(--text-primary);
  line-height: 1.5;
}

/* ===== SECTION 1.5: LOADING OVERLAY ===== */

.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 1;
  transition: opacity 0.3s ease-out;
}

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

.loading-overlay .spinner {
  display: block;
  width: 50px;
  height: 50px;
  border: 4px solid rgba(63, 81, 181, 0.2);
  border-top: 4px solid var(--primary-color);
  border-right: 4px solid var(--primary-color);
  border-radius: 50%;
  animation: spin-loader 1s linear infinite;
  margin-right: 0;
}

@keyframes spin-loader {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* ===== SECTION 2: TYPOGRAPHY ===== */

h1 {
  font-size: 3rem;
  font-weight: 300;
  letter-spacing: -0.015625em;
  line-height: 3.5rem;
  margin-bottom: 1rem;
}

h2 {
  font-size: 2.125rem;
  font-weight: 400;
  letter-spacing: 0.0125em;
  line-height: 2.5rem;
  margin-bottom: 0.875rem;
}

h3 {
  font-size: 1.5rem;
  font-weight: 500;
  letter-spacing: 0em;
  line-height: 2rem;
  margin-bottom: 0.75rem;
}

h4 {
  font-size: 1.25rem;
  font-weight: 500;
  letter-spacing: 0.0125em;
  line-height: 1.75rem;
  margin-bottom: 0.65rem;
}

h5 {
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: 0em;
  line-height: 1.5rem;
  margin-bottom: 0.5rem;
}

p {
  font-size: 1rem;
  font-weight: 400;
  letter-spacing: 0.03125em;
  line-height: 1.5rem;
  margin-bottom: 1rem;
}

label {
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.0125em;
}

/* ===== SECTION 3: LAYOUT COMPONENTS ===== */

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

/* Lists */
ul,
ol {
  margin-left: 1.25rem;
  margin-bottom: 1rem;
}

li {
  margin-bottom: 0.5rem;
}

/* Links */
a {
  color: var(--primary-color);
  text-decoration: none;
  transition: color 0.2s;
}

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

a:active {
  color: var(--primary-active);
}

html[data-theme="dark"] a {
  text-decoration: underline;
  text-decoration-color: rgba(209, 196, 233, 0.5);
}

html[data-theme="dark"] a:hover {
  color: #ede7f6;
  text-decoration-color: rgba(237, 231, 246, 0.7);
}

html[data-theme="dark"] a:active {
  color: #b39ddb;
}

/* Dividers */
.divider {
  height: 1px;
  background-color: var(--text-hint);
  margin: 1rem 0;
}

/* ===== SECTION 4: MATERIAL DESIGN COMPONENTS ===== */

/* Cards */
.card {
  background-color: var(--surface-white);
  border-radius: 0;
  box-shadow:
    0 2px 1px -1px rgba(0, 0, 0, 0.2),
    0 1px 1px 0 rgba(0, 0, 0, 0.14),
    0 1px 3px 0 rgba(0, 0, 0, 0.12);
  padding: 1rem;
  margin-bottom: 1.5rem;
}

.card:hover {
  box-shadow:
    0 3px 1px -2px rgba(0, 0, 0, 0.2),
    0 2px 2px 0 rgba(0, 0, 0, 0.14),
    0 1px 5px 0 rgba(0, 0, 0, 0.12);
}

.card.elevated {
  box-shadow:
    0 5px 5px -3px rgba(0, 0, 0, 0.2),
    0 8px 10px 1px rgba(0, 0, 0, 0.14),
    0 3px 14px 2px rgba(0, 0, 0, 0.12);
}

/* Buttons */
.btn {
  font-family: "Roboto", "Helvetica", "Arial", sans-serif;
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.0892857143em;
  line-height: 1.5rem;
  text-decoration: none;
  padding: 0.375rem 0.75rem;
  border: none;
  border-radius: 0;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  user-select: none;
}

.btn-raised {
  background-color: var(--primary-color);
  color: white;
  box-shadow:
    0 2px 1px -1px rgba(0, 0, 0, 0.2),
    0 1px 1px 0 rgba(0, 0, 0, 0.14),
    0 1px 3px 0 rgba(0, 0, 0, 0.12);
}

.btn-raised:hover {
  background-color: var(--primary-hover);
  box-shadow:
    0 3px 1px -2px rgba(0, 0, 0, 0.2),
    0 2px 2px 0 rgba(0, 0, 0, 0.14),
    0 1px 5px 0 rgba(0, 0, 0, 0.12);
}

.btn-raised:active {
  background-color: var(--primary-active);
  box-shadow:
    0 5px 5px -3px rgba(0, 0, 0, 0.2),
    0 8px 10px 1px rgba(0, 0, 0, 0.14),
    0 3px 14px 2px rgba(0, 0, 0, 0.12);
}

.btn-raised:disabled {
  background-color: var(--text-hint);
  color: var(--text-disabled);
  cursor: not-allowed;
  box-shadow: none;
}

.btn-flat {
  background-color: transparent;
  color: var(--primary-color);
}

.btn-flat:hover {
  background-color: var(--primary-light);
}

.btn-flat:active {
  background-color: var(--primary-medium);
}

.btn-flat:disabled {
  color: var(--text-disabled);
  cursor: not-allowed;
}

.btn-secondary {
  background-color: var(--accent-color);
  color: white;
}

.btn-secondary:hover {
  background-color: var(--accent-hover);
}

.btn-secondary:disabled,
.btn-primary:disabled {
  background: var(--surface-muted);
  color: var(--text-disabled);
  border-color: var(--grey-border);
}

/* Input fields */
input[type="text"],
input[type="number"],
input[type="date"],
input[type="time"],
input[type="email"],
input[type="password"],
textarea,
select {
  font-family: "Roboto", "Helvetica", "Arial", sans-serif;
  font-size: 1rem;
  width: 100%;
  padding: 0.75rem 0.75rem 0.5625rem 0.75rem;
  border: none;
  border-bottom: 1px solid var(--text-hint);
  background-color: var(--surface-overlay);
  border-radius: 0;
  transition: all 0.2s;
}

input[type="text"]::placeholder,
input[type="number"]::placeholder,
input[type="date"]::placeholder,
input[type="time"]::placeholder,
input[type="email"]::placeholder,
input[type="password"]::placeholder,
textarea::placeholder {
  color: var(--text-disabled);
}

input[type="text"]:focus,
input[type="number"]:focus,
input[type="date"]:focus,
input[type="time"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
textarea:focus,
select:focus {
  outline: none;
  background-color: var(--surface-overlay-hover);
  border-bottom-color: var(--primary-color);
  border-bottom-width: 2px;
  padding-bottom: 0.4375rem;
}

input[type="checkbox"],
input[type="radio"] {
  cursor: pointer;
  width: 1.25rem;
  height: 1.25rem;
  margin-right: 0.75rem;
  accent-color: var(--primary-color);
}

/* ===== SECTION 5: NAVIGATION COMPONENTS ===== */

/* Toolbar/Header */
.toolbar {
  background-color: var(--toolbar-bg);
  color: white;
  padding: 1rem 1.5rem;
  box-shadow:
    0 2px 4px -1px rgba(0, 0, 0, 0.2),
    0 4px 5px 0 rgba(0, 0, 0, 0.14),
    0 1px 10px 0 rgba(0, 0, 0, 0.12);
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
}

.toolbar h1 {
  margin: 0;
  font-size: 1.5rem;
}

/* Navigation */
.nav-group {
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
}

.nav-group input {
  background-color: var(--toolbar-overlay);
  color: white;
  border-bottom-color: var(--toolbar-border);
}

.nav-group input::placeholder {
  color: rgba(255, 255, 255, 0.7);
}

.nav-group input:focus {
  background-color: var(--toolbar-overlay-hover);
  border-bottom-color: white;
}

.nav-group label {
  color: white;
  margin: 0;
}

.nav-group a {
  color: white;
  padding: 0.5625rem 1rem;
  border-radius: 0;
  transition: background-color 0.2s;
}

.nav-group a:hover {
  background-color: rgba(0, 0, 0, 0.1);
  text-decoration: none;
}

/* ===== SECTION 6: PAGE-SPECIFIC COMPONENTS ===== */

/* === LOGIN PAGE === */

.login-container {
  background: var(--surface-white);
  border-radius: 0;
  box-shadow:
    0 5px 5px -3px rgba(0, 0, 0, 0.2),
    0 8px 10px 1px rgba(0, 0, 0, 0.14),
    0 3px 14px 2px rgba(0, 0, 0, 0.12);
  max-width: 400px;
  width: 100%;
  padding: 2.5rem;
  margin: 2rem auto;
}

.login-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
}

.logo {
  text-align: center;
  margin-bottom: 2rem;
}

.logo h1 {
  color: var(--primary-color);
  font-size: 2rem;
  margin-bottom: 0.5rem;
  font-weight: 400;
}

.logo p {
  color: var(--text-tertiary);
  font-size: 0.875rem;
  margin: 0;
}

.btn-login {
  width: 100%;
  background-color: var(--primary-color);
  color: white;
  padding: 0.75rem;
  border: none;
  border-radius: 0;
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.0892857143em;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  margin-top: 0.625rem;
  box-shadow:
    0 2px 1px -1px rgba(0, 0, 0, 0.2),
    0 1px 1px 0 rgba(0, 0, 0, 0.14),
    0 1px 3px 0 rgba(0, 0, 0, 0.12);
}

.btn-login:hover:not(:disabled) {
  background-color: var(--primary-hover);
  box-shadow:
    0 3px 1px -2px rgba(0, 0, 0, 0.2),
    0 2px 2px 0 rgba(0, 0, 0, 0.14),
    0 1px 5px 0 rgba(0, 0, 0, 0.12);
}

.btn-login:disabled {
  background-color: var(--text-hint);
  color: var(--text-disabled);
  cursor: not-allowed;
  opacity: 0.6;
}

.login-secondary-link {
  margin-top: 0.75rem;
  border: none;
  background: none;
  color: var(--primary-color);
  cursor: pointer;
  font-size: 0.8125rem;
  text-decoration: underline;
}

.login-secondary-link:hover {
  color: var(--primary-hover);
}

.info {
  background: #e3f2fd;
  padding: 0.75rem;
  border-radius: 0;
  margin-top: 1.25rem;
  font-size: 0.8125rem;
  color: #01579b;
  border-left: 4px solid #2196f3;
}

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

.info strong {
  display: block;
  margin-bottom: 0.3125rem;
}

.not-found-container {
  max-width: 460px;
  text-align: center;
}

.not-found-container .logo h1 {
  font-size: 4rem;
  line-height: 1;
  margin-bottom: 0.75rem;
}

.not-found-path {
  display: block;
  margin-top: 0.35rem;
  word-break: break-word;
  font-family: "Courier New", Courier, monospace;
}

.not-found-link {
  display: block;
  text-align: center;
  text-decoration: none;
}

/* === LANDING PAGE === */

.landing-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.landing-header {
  background: var(--toolbar-bg);
  color: white;
  padding: 0.75rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow:
    0 2px 4px -1px rgba(0, 0, 0, 0.2),
    0 4px 5px 0 rgba(0, 0, 0, 0.14),
    0 1px 10px 0 rgba(0, 0, 0, 0.12);
  position: sticky;
  top: 0;
  z-index: 100;
}

.landing-header h1 {
  margin: 0;
  font-size: 1.5rem;
}

.landing-header-right {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-shrink: 0;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.8rem;
  border-radius: 0;
  border: 1px solid transparent;
  background: transparent;
  color: white;
  font-size: 0.9rem;
  cursor: pointer;
  transition:
    background-color 0.2s ease,
    border-color 0.2s ease,
    opacity 0.2s ease;
}

.theme-toggle:hover {
  background: var(--toolbar-overlay-hover);
  border-color: var(--toolbar-border);
}

.theme-toggle:focus-visible {
  outline: 2px solid var(--surface-white);
  outline-offset: 2px;
}

.theme-toggle-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.theme-toggle-icon svg {
  width: 26px;
  height: 26px;
  stroke: currentColor;
}

.theme-icon-moon {
  display: none;
}

html[data-theme="dark"] .theme-icon-sun {
  display: none;
}

html[data-theme="dark"] .theme-icon-moon {
  display: inline;
}

.theme-toggle--floating {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 1000;
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--grey-border);
  box-shadow:
    0 2px 6px rgba(0, 0, 0, 0.2),
    0 1px 2px rgba(0, 0, 0, 0.1);
}

.theme-toggle--floating:hover {
  background: var(--grey-hover);
}

.user-name {
  font-size: 0.875rem;
  opacity: 0.95;
}

.btn-logout {
  padding: 0.5rem 1rem;
  background: var(--toolbar-overlay);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 0;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s;
  font-weight: 500;
}

.btn-logout:hover {
  background: var(--toolbar-overlay-hover);
  border-color: var(--toolbar-border);
}

.landing-header p {
  margin: 0;
  font-size: 0.875rem;
  opacity: 0.95;
  letter-spacing: 0.0125em;
}

.landing-content {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  padding: 1.5rem 2rem 2rem 2rem;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
}

.landing-section {
  display: flex;
  flex-direction: column;
}

.landing-section .card {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.landing-section h2 {
  margin-top: 0;
  color: var(--text-primary);
}

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

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.form-group input {
  margin-bottom: 0;
}

.form-group select {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--grey-border);
  border-radius: 0;
  font-size: 1rem;
  background-color: var(--surface-white);
  color: var(--text-secondary);
  cursor: pointer;
  margin-bottom: 0;
}

.form-group select:focus {
  outline: none;
  border-color: var(--primary-hover);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.form-group input[type="file"] {
  padding: 0.5rem 0.75rem;
}

.file-list {
  margin-top: 1.5rem;
  max-height: 200px;
  overflow-y: auto;
  background-color: var(--bg-grey);
  border-radius: 0;
  padding: 1rem;
  display: none;
  border: 1px solid var(--text-hint);
}

.file-item {
  padding: 0.5rem 0;
  color: var(--text-secondary);
  font-size: 0.875rem;
  border-bottom: 1px solid var(--text-hint);
  word-break: break-word;
}

.file-item:last-child {
  border-bottom: none;
}

.button-group {
  display: flex;
  gap: 1rem;
  margin-top: 2rem;
}

.button-group .btn {
  flex: 1;
}

.message {
  margin-top: 1.5rem;
  padding: 1rem;
  border-radius: 0;
  display: none;
  font-size: 0.95rem;
  font-weight: 500;
}

.message.success {
  display: block;
  background-color: #c8e6c9;
  color: #2e7d32;
  border: 1px solid #a5d6a7;
}

.message.error {
  display: block;
  background-color: #ffebee;
  color: #c62828;
  border: 1px solid #ef9a9a;
}

.message.loading {
  display: block;
  background: #e3f2fd;
  color: #01579b;
  border: 1px solid #90caf9;
}

/* ===== Search Results Styles ===== */

.search-group {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.search-group input {
  flex: 1;
  padding: 0.75rem;
  border: 1px solid var(--grey-border);
  border-radius: 0;
  font-size: 1rem;
  color: var(--text-secondary);
}

.search-group input:focus {
  outline: none;
  border-color: var(--primary-hover);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.search-group .btn {
  padding: 0.75rem 1.5rem;
  white-space: nowrap;
}

.search-results {
  display: none;
  margin-top: 1rem;
  border: 1px solid var(--grey-border);
  border-radius: 0;
  max-height: 300px;
  overflow-y: auto;
  background-color: var(--surface-white);
}

.search-results.error {
  display: block;
}

.search-results.loading {
  display: block;
}

.task-search-page {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding: 1.5rem;
}

.task-search-form-card {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1.25rem;
  border: 1px solid var(--grey-border);
  border-radius: 1rem;
  background: var(--surface-white);
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.08);
}

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

.task-search-form-wide {
  grid-column: 1 / -1;
}

.task-search-actions {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.task-search-summary {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
}

.task-search-group {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.task-search-group-title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
}

.task-search-results-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.task-search-empty-state {
  padding: 1rem 1.25rem;
  border: 1px dashed rgba(100, 116, 139, 0.35);
  border-radius: 0.9rem;
  color: #475569;
  background: rgba(248, 250, 252, 0.72);
}

.task-search-time-cell {
  gap: 0.35rem;
}

.task-search-time-value {
  min-width: 4rem;
  font-weight: 600;
}

@media (max-width: 900px) {
  .task-search-form-grid {
    grid-template-columns: 1fr;
  }
}

html[data-theme="dark"] .task-search-form-card {
  background: rgba(15, 23, 42, 0.72);
  border-color: rgba(148, 163, 184, 0.18);
  box-shadow: 0 18px 42px rgba(2, 6, 23, 0.35);
}

html[data-theme="dark"] .task-search-empty-state {
  color: #cbd5e1;
  background: rgba(30, 41, 59, 0.55);
  border-color: rgba(148, 163, 184, 0.3);
}

.search-message {
  padding: 1rem;
  text-align: center;
  font-size: 0.95rem;
  color: var(--text-secondary);
}

.search-message.error {
  color: #c62828;
  background-color: #ffebee;
}

.search-message.loading {
  color: #01579b;
  background-color: #e3f2fd;
}

.result-item {
  padding: 1rem;
  border-bottom: 1px solid var(--grey-border);
  cursor: pointer;
  transition: background-color 0.2s;
}

.result-item:last-child {
  border-bottom: none;
}

.result-item:hover {
  background-color: var(--primary-light);
}

.result-content {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.result-subject {
  font-weight: 500;
  color: var(--text-primary);
  font-size: 0.95rem;
}

.result-number {
  font-size: 0.85rem;
  color: var(--text-tertiary);
}

.selected-opportunity {
  display: none;
  margin-top: 1rem;
  margin-bottom: 1rem;
}

.selected-item {
  background-color: #e8f5e9;
  border: 1px solid #81c784;
  border-radius: 0;
  padding: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.selected-text {
  flex: 1;
  font-size: 0.95rem;
  color: var(--text-primary);
}

.selected-text strong {
  display: block;
  margin-bottom: 0.25rem;
  color: #2e7d32;
}

.selected-text small {
  color: var(--text-tertiary);
}

.btn-clear {
  background-color: transparent;
  border: 1px solid #81c784;
  color: #2e7d32;
  padding: 0.5rem 1rem;
  border-radius: 0;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 500;
  transition: all 0.2s;
}

.btn-clear:hover {
  background-color: #81c784;
  color: var(--surface-white);
}

.route-item {
  background-color: var(--bg-grey);
  padding: 1.5rem;
  border-radius: 0;
  margin-bottom: 1.5rem;
  border-left: 4px solid var(--primary-color);
  transition: all 0.2s;
}

.route-item:hover {
  background-color: var(--grey-hover);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.route-item-title {
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  font-size: 1.125rem;
}

.route-item-description {
  color: var(--text-tertiary);
  font-size: 0.9375rem;
  margin-bottom: 1rem;
  line-height: 1.6;
}

.date-input-group {
  display: flex;
  gap: 0.75rem;
  align-items: flex-end;
}

.date-input-group input {
  flex: 1;
  min-width: 150px;
}

.date-input-group .btn {
  flex: 0;
  margin-bottom: 0;
}

/* === CUSTOMER COLLECTIONS PAGE === */

.collections-toolbar-nav {
  background-color: var(--toolbar-bg);
  color: white;
  padding: 0.75rem 1.5rem;
  box-shadow:
    0 2px 4px -1px rgba(0, 0, 0, 0.2),
    0 4px 5px 0 rgba(0, 0, 0, 0.14),
    0 1px 10px 0 rgba(0, 0, 0, 0.12);
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: nowrap;
  margin-bottom: 0;
  position: sticky;
  top: 0;
  z-index: 120;
}

.collections-toolbar {
  background-color: var(--toolbar-bg);
  color: white;
  padding: 0.75rem 1.5rem;
  box-shadow:
    0 2px 4px -1px rgba(0, 0, 0, 0.2),
    0 4px 5px 0 rgba(0, 0, 0, 0.14),
    0 1px 10px 0 rgba(0, 0, 0, 0.12);
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 0;
  position: sticky;
  top: 0;
  z-index: 110;
}

.btn-home.btn-home-desktop {
  display: none;
}

.date-picker-desktop {
  display: none;
}

.btn-go-desktop {
  display: none;
}

.toolbar-spacer {
  display: none;
}

.btn-home {
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  text-decoration: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.375rem;
  transition: opacity 0.2s;
  flex-shrink: 0;
}

.btn-home:hover {
  opacity: 0.8;
}

.btn-home svg {
  width: 24px;
  height: 24px;
}

.collections-toolbar h1 {
  margin: 0;
  font-size: 1.25rem;
  flex: 0 1 auto;
  min-width: auto;
}

.collections-toolbar-nav input {
  background-color: var(--toolbar-overlay);
  color: white;
  border-bottom-color: var(--toolbar-border);
  padding: 0.5rem 0.75rem;
  min-width: 140px;
  border: none;
  border-bottom: 1px solid var(--toolbar-border);
  font-size: 0.875rem;
}

.collections-toolbar-nav .theme-toggle {
  margin-left: auto;
}

.collections-toolbar-nav input[type="date"] {
  color: white;
  color-scheme: dark;
}

.collections-toolbar-nav input::placeholder {
  color: white;
}

.collections-toolbar-nav input:focus {
  outline: none;
  background-color: var(--toolbar-overlay-hover);
  border-bottom-color: white;
}

.collections-toolbar-nav .btn-raised {
  background-color: #757575;
  margin: 0;
  flex-shrink: 0;
}

.collections-toolbar-nav .btn-raised:hover {
  background-color: #616161;
}

.collections-nav a:hover {
  background-color: #555;
  text-decoration: none;
}

.collections-content {
  padding: 1.5rem 1.5rem 2rem 1.5rem;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
  --collections-sticky-offset: 0px;
}

.opportunity-container {
  margin-bottom: 2rem;
}

.opportunity-card {
  background-color: var(--surface-white);
  border-radius: 0;
  border: 1px solid var(--grey-border);
  box-shadow:
    0 6px 16px rgba(0, 0, 0, 0.08),
    0 2px 6px rgba(0, 0, 0, 0.06);
  overflow: hidden;
  transition:
    box-shadow 0.2s ease,
    transform 0.2s ease;
  overflow: visible;
}

.opportunity-card:hover {
  box-shadow:
    0 10px 24px rgba(0, 0, 0, 0.12),
    0 4px 10px rgba(0, 0, 0, 0.08);
  transform: translateY(-1px);
}

.opportunity-header {
  background-color: var(--surface-white);
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--grey-border);
  cursor: pointer;
  user-select: none;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: background-color 0.2s;
  position: sticky;
  top: var(--collections-sticky-offset);
  z-index: 90;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.opportunity-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  font-weight: 500;
  color: var(--primary-color);
  font-size: 1.25rem;
  flex-shrink: 0;
}

.opportunity-subject {
  color: var(--text-primary);
  font-weight: 500;
  font-size: 1.0625rem;
  flex: 1;
}

.refund-deposits-warning-badge {
  background-color: rgba(230, 126, 34, 0.16);
  color: #b05b12;
  flex-shrink: 0;
}

.opportunity-content {
  padding: 1.5rem;
  background-color: var(--surface-white);
  transition: max-height 0.3s ease-out;
}

.opportunity-content.collapsed {
  display: none;
}

.group-container-list {
  background-color: transparent;
}

.group-container {
  margin-bottom: 2rem;
  padding: 1.5rem;
  background-color: var(--bg-grey);
  border-radius: 0;
  border: 1px solid var(--grey-border);
  border-top-width: 3px;
}

.refund-deposits-summary {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
  align-items: baseline;
}

.refund-deposits-number {
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.refund-deposits-xero-card {
  display: grid;
  gap: 1rem;
}

.refund-deposits-xero-summary {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.refund-deposits-xero-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.refund-deposits-xero-description {
  margin-top: 0.35rem;
  color: var(--text-secondary);
}

.refund-deposits-xero-meta {
  margin-top: 0.25rem;
}

.refund-deposits-xero-notice,
.refund-deposits-xero-error {
  margin: 0;
  padding: 0.85rem 1rem;
  border: 1px solid var(--grey-border);
}

.refund-deposits-xero-notice-success {
  background-color: rgba(36, 122, 61, 0.08);
  border-color: rgba(36, 122, 61, 0.2);
  color: #247a3d;
}

.refund-deposits-xero-notice-error,
.refund-deposits-xero-error {
  background-color: rgba(165, 58, 42, 0.08);
  border-color: rgba(165, 58, 42, 0.2);
  color: #a53a2a;
}

.bulk-texts-top-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem;
}

.bulk-texts-page-loading {
  position: sticky;
  top: 1rem;
  z-index: 6;
  margin-bottom: 1rem;
}

.bulk-texts-page-loading-card {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--grey-border);
  background-color: var(--surface-white);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  color: var(--text-primary);
}

.bulk-texts-form {
  display: grid;
  gap: 0.5rem;
}

.bulk-texts-template-list {
  display: grid;
  gap: 0.75rem;
}

.bulk-texts-template-card {
  display: grid;
  gap: 0.35rem;
  padding: 1rem;
  border: 1px solid var(--grey-border);
  background-color: var(--surface-white);
  color: inherit;
  text-decoration: none;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.2s ease;
}

.bulk-texts-template-card:hover {
  border-color: var(--primary-color);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
  transform: translateY(-1px);
}

.bulk-texts-template-card.is-selected {
  border-color: var(--primary-color);
  box-shadow: inset 4px 0 0 var(--primary-color);
}

.bulk-texts-template-name {
  font-weight: 600;
  color: var(--text-primary);
}

.bulk-texts-template-meta,
.bulk-texts-template-path,
.bulk-texts-summary-label,
.bulk-texts-opportunity-number,
.bulk-texts-preview-meta,
.bulk-texts-toolbar-meta {
  color: var(--text-tertiary);
  font-size: 0.875rem;
}

.bulk-texts-template-path {
  word-break: break-word;
}

.bulk-texts-selection-summary {
  display: grid;
  gap: 1rem;
}

.bulk-texts-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}

.bulk-texts-summary-value,
.bulk-texts-opportunity-name {
  color: var(--text-primary);
  font-weight: 500;
}

.bulk-texts-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.bulk-texts-select-all {
  display: inline-flex;
  align-items: center;
  font-weight: 500;
  color: var(--text-primary);
}

.bulk-texts-select-all.is-disabled {
  color: var(--text-disabled);
}

.bulk-texts-table-wrap {
  overflow-x: auto;
}

.bulk-texts-table {
  width: 100%;
  border-collapse: collapse;
  background-color: var(--surface-white);
}

.bulk-texts-table th,
.bulk-texts-table td {
  padding: 0.875rem 0.75rem;
  border-bottom: 1px solid var(--grey-border);
  text-align: left;
  vertical-align: top;
}

.bulk-texts-table th {
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-tertiary);
}

.bulk-texts-phone-list {
  display: grid;
  gap: 0.5rem;
}

.bulk-texts-phone-option {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.bulk-texts-send-bar {
  margin-top: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.bulk-texts-send-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
}

.bulk-texts-send-loading {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-secondary);
  font-size: 0.9375rem;
}

.bulk-texts-send-loading .spinner,
.bulk-texts-page-loading .spinner {
  margin-right: 0;
}

.bulk-texts-send-count {
  font-weight: 600;
  color: var(--text-primary);
}

.bulk-texts-feedback,
.bulk-texts-notice {
  padding: 0.85rem 1rem;
  border: 1px solid var(--grey-border);
}

.bulk-texts-feedback {
  margin-top: 0.75rem;
}

.bulk-texts-feedback.is-success,
.bulk-texts-notice-success {
  background-color: rgba(36, 122, 61, 0.08);
  border-color: rgba(36, 122, 61, 0.2);
  color: #247a3d;
}

.bulk-texts-feedback.is-error,
.bulk-texts-notice-error {
  background-color: rgba(165, 58, 42, 0.08);
  border-color: rgba(165, 58, 42, 0.2);
  color: #a53a2a;
}

.bulk-texts-preview {
  margin: 0;
  padding: 1rem;
  white-space: pre-wrap;
  background-color: var(--surface-white);
  border: 1px solid var(--grey-border);
  color: var(--text-primary);
  font-family: "Roboto Mono", "Consolas", monospace;
}

.bulk-texts-preview-error {
  margin: 0;
  color: #a53a2a;
}

.refund-deposits-xero-connect[disabled] {
  opacity: 0.8;
}

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

.refund-deposits-meta-item {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.refund-deposits-meta-label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.refund-deposits-meta-value {
  color: var(--text-primary);
  word-break: break-word;
}

.refund-deposits-meta-value a,
.refund-deposits-external-link {
  color: inherit;
  text-decoration: none;
}

.refund-deposits-meta-value a:hover,
.refund-deposits-external-link:hover {
  text-decoration: underline;
}

.refund-deposits-loading-state,
.refund-deposits-error-state,
.refund-deposits-success-state,
.refund-deposits-fail-state {
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
}

.refund-deposits-loading-state {
  align-items: flex-start;
  color: var(--text-secondary);
}

.refund-deposits-spinner {
  width: 1.5rem;
  height: 1.5rem;
  border: 3px solid var(--grey-border);
  border-top-color: var(--primary-color);
  border-radius: 50%;
  animation: refund-deposits-spin 0.9s linear infinite;
}

.refund-deposits-error-state {
  color: #a53a2a;
  font-weight: 500;
}

.refund-deposits-status-message {
  margin: 0;
  color: var(--text-primary);
}

.refund-deposits-blocker-list {
  margin: 0;
  padding-left: 1.25rem;
  color: var(--text-primary);
}

.refund-deposits-fail-list {
  display: grid;
  gap: 1rem;
}

.refund-deposits-bulk-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.refund-deposits-bulk-select-all {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-primary);
}

.refund-deposits-bulk-summary,
.refund-deposits-bulk-message,
.refund-deposits-fail-inline-message {
  color: var(--text-secondary);
  font-size: 0.9375rem;
}

.refund-deposits-bulk-summary {
  flex: 1;
}

.refund-deposits-bulk-message,
.refund-deposits-fail-inline-message {
  color: #a53a2a;
}

.refund-deposits-bulk-menu {
  position: relative;
}

.refund-deposits-bulk-menu > summary {
  list-style: none;
}

.refund-deposits-bulk-menu > summary::-webkit-details-marker {
  display: none;
}

.refund-deposits-bulk-menu-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 0.5rem);
  min-width: 240px;
  display: grid;
  gap: 0.75rem;
  padding: 0.875rem;
  border: 1px solid var(--grey-border);
  background-color: var(--surface-white);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  z-index: 5;
}

.refund-deposits-fail-item {
  position: relative;
  padding: 1rem;
  border: 1px solid var(--grey-border);
  background-color: var(--surface-white);
}

.refund-deposits-fail-item.is-selectable {
  padding-top: 1.5rem;
}

.refund-deposits-card-select {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.refund-deposits-card-select input {
  width: 1rem;
  height: 1rem;
  margin: 0;
}

.refund-deposits-fail-title {
  font-weight: 600;
  color: var(--text-primary);
}

.refund-deposits-fail-meta {
  margin-top: 0.35rem;
  color: var(--text-secondary);
  font-size: 0.9375rem;
}

.refund-deposits-fail-reasons {
  margin: 0.75rem 0 0;
  padding-left: 1.25rem;
  color: var(--text-primary);
}

.refund-deposits-test-details {
  display: grid;
  gap: 0.75rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--grey-border);
}

.refund-deposits-fail-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--grey-border);
}

@media (max-width: 768px) {
  .refund-deposits-bulk-actions {
    align-items: flex-start;
    flex-direction: column;
  }

  .refund-deposits-bulk-menu-panel {
    left: 0;
    right: auto;
  }

  .refund-deposits-fail-actions {
    align-items: flex-start;
    flex-direction: column;
  }
}

.refund-deposits-test-detail {
  display: grid;
  gap: 0.35rem;
}

.refund-deposits-test-label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.refund-deposits-test-value {
  color: var(--text-primary);
}

.refund-deposits-test-log {
  margin: 0;
  padding: 0.75rem;
  background-color: var(--bg-grey);
  border: 1px solid var(--grey-border);
  color: var(--text-primary);
  font: inherit;
  white-space: pre-wrap;
  word-break: break-word;
}

@keyframes refund-deposits-spin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 720px) {
  .refund-deposits-xero-summary {
    flex-direction: column;
    align-items: stretch;
  }
}

.group-name {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  gap: 1rem;
  flex-wrap: wrap;
}

.group-header {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 1.0625rem;
  flex: 1;
  min-width: 150px;
}

.group-actions {
  display: flex;
  justify-content: flex-start;
  margin-top: 1.5rem;
  gap: 1rem;
}

.btn-upload {
  background-color: var(--primary-color);
  color: white;
  border: none;
  padding: 0.5625rem 1rem;
  border-radius: 0;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.0892857143em;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow:
    0 2px 1px -1px rgba(0, 0, 0, 0.2),
    0 1px 1px 0 rgba(0, 0, 0, 0.14),
    0 1px 3px 0 rgba(0, 0, 0, 0.12);
  flex-shrink: 0;
}

.btn-upload:hover {
  background-color: var(--primary-hover);
  box-shadow:
    0 3px 1px -2px rgba(0, 0, 0, 0.2),
    0 2px 2px 0 rgba(0, 0, 0, 0.14),
    0 1px 5px 0 rgba(0, 0, 0, 0.12);
}

.btn-upload.is-success {
  background-color: #6ee7b7;
  color: #1b1b1b;
}

.btn-upload.is-success:hover {
  background-color: #5fd9ab;
}

.btn-upload.is-error {
  background-color: #fca5a5;
  color: #1b1b1b;
}

.btn-upload.is-error:hover {
  background-color: #f98f8f;
}

.btn-upload:active {
  background-color: var(--primary-active);
  box-shadow:
    0 5px 5px -3px rgba(0, 0, 0, 0.2),
    0 8px 10px 1px rgba(0, 0, 0, 0.14),
    0 3px 14px 2px rgba(0, 0, 0, 0.12);
}

.btn-upload:disabled {
  background-color: var(--text-hint);
  color: var(--text-disabled);
  cursor: not-allowed;
  box-shadow: none;
}

.file-input-wrapper {
  display: block;
  margin-bottom: 1rem;
}

.file-input-wrapper input[type="file"] {
  display: none;
}

.thumbnails-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 1rem;
  margin: 0 0 1.5rem 0;
  padding: 1rem;
  background-color: var(--surface-white);
  border-radius: 0;
  border: 1px solid var(--text-hint);
}

.thumbnail {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 0;
  overflow: hidden;
  box-shadow:
    0 2px 1px -1px rgba(0, 0, 0, 0.2),
    0 1px 1px 0 rgba(0, 0, 0, 0.14),
    0 1px 3px 0 rgba(0, 0, 0, 0.12);
  transition: all 0.2s;
  cursor: pointer;
}

.thumbnail:hover {
  box-shadow:
    0 3px 1px -2px rgba(0, 0, 0, 0.2),
    0 2px 2px 0 rgba(0, 0, 0, 0.14),
    0 1px 5px 0 rgba(0, 0, 0, 0.12);
  transform: scale(1.05);
}

.thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ID Photos Section */
.id-photos-section {
  margin-bottom: 2rem;
  padding: 1.5rem;
  background-color: var(--surface-white);
  border-radius: 0;
  border: 2px solid var(--primary-color);
}

.id-photos-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--primary-color);
  margin-top: 0;
  margin-bottom: 1.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--grey-border);
}

.id-photo-group {
  margin-bottom: 1.5rem;
  padding: 1rem;
  background-color: var(--bg-grey);
  border-radius: 0;
  border: 1px solid var(--grey-border);
}

.id-photo-group:last-child {
  margin-bottom: 0;
}

.id-photo-label {
  display: block;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
  font-size: 0.9375rem;
}

.id-photo-thumbnails {
  min-height: 50px;
  margin-bottom: 0.75rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 0.75rem;
}

.id-photo-thumbnails:empty::before {
  content: "No files uploaded";
  color: var(--text-tertiary);
  font-size: 0.875rem;
  font-style: italic;
  display: block;
  padding: 0.75rem;
  text-align: center;
}

.id-photo-controls {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.btn-upload-id {
  background-color: var(--primary-color);
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 0;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.0892857143em;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow:
    0 2px 1px -1px rgba(0, 0, 0, 0.2),
    0 1px 1px 0 rgba(0, 0, 0, 0.14),
    0 1px 3px 0 rgba(0, 0, 0, 0.12);
}

.btn-upload-id:hover {
  background-color: var(--primary-hover);
  box-shadow:
    0 3px 1px -2px rgba(0, 0, 0, 0.2),
    0 2px 2px 0 rgba(0, 0, 0, 0.14),
    0 1px 5px 0 rgba(0, 0, 0, 0.12);
}

.btn-upload-id:active {
  background-color: var(--primary-active);
  box-shadow:
    0 5px 5px -3px rgba(0, 0, 0, 0.2),
    0 8px 10px 1px rgba(0, 0, 0, 0.14),
    0 3px 14px 2px rgba(0, 0, 0, 0.12);
}

.btn-upload-id.uploaded {
  background-color: #6ee7b7;
  color: #1b1b1b;
}

.btn-upload-id.uploaded:hover {
  background-color: #5fd9ab;
}

.btn-upload-id.is-error {
  background-color: #fca5a5;
  color: #1b1b1b;
}

.btn-upload-id.is-error:hover {
  background-color: #f98f8f;
}

/* ===== EQUIPMENT PHOTOS SECTION ===== */

.equipment-photos-section {
  margin-top: 1.5rem;
  padding: 1rem;
  background-color: var(--surface-white);
  border-radius: 0;
  box-shadow:
    0 1px 3px 0 rgba(0, 0, 0, 0.1),
    0 1px 2px 0 rgba(0, 0, 0, 0.06);
}

.equipment-photos-title {
  font-size: 1.25rem;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 1rem;
}

/* ===== COLLECTION DATE SECTION ===== */

.opportunity-date-section {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
  padding: 0.75rem 1rem;
  background-color: var(--surface-white);
  border: 1px solid var(--grey-border);
}

.opportunity-date-label {
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 0.9375rem;
}

.opportunity-date-input {
  padding: 0.4rem 0.5rem;
  border: 1px solid var(--grey-border);
  border-radius: 0;
  background-color: var(--surface-white);
  color: var(--text-primary);
  font-size: 0.9375rem;
  font-family: inherit;
}

.opportunity-date-value {
  color: var(--text-primary);
  font-size: 0.9375rem;
}

.opportunity-date-link {
  margin-left: auto;
  color: var(--primary-color);
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.opportunity-date-link:hover {
  color: var(--primary-hover);
  text-decoration: underline;
}

/* ===== OPPORTUNITY DATES PAGE ===== */

.opportunity-dates-page {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1rem;
  max-width: 46rem;
}

.opportunity-dates-card {
  padding: 1rem;
  background-color: var(--surface-white);
  border: 1px solid var(--grey-border);
}

.opportunity-dates-title {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
}

.opportunity-dates-subtitle {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.opportunity-dates-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 0.5rem;
  color: var(--text-tertiary);
  font-size: 0.9375rem;
}

.opportunity-dates-note {
  margin: 0.5rem 0 0;
  color: var(--text-tertiary);
  font-size: 0.875rem;
}

.opportunity-date-field {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1rem;
}

.opportunity-date-field .opportunity-date-label {
  min-width: 3rem;
}

.opportunity-date-time {
  color: var(--text-tertiary);
  font-size: 0.875rem;
}

.opportunity-date-errors {
  margin-top: 0.75rem;
  padding: 0.5rem 0.75rem;
  border-left: 3px solid var(--accent-color);
  background-color: var(--surface-muted);
}

.opportunity-date-error {
  margin: 0.25rem 0;
  color: var(--accent-color);
  font-size: 0.875rem;
}

.opportunity-date-saved {
  margin: 0.75rem 0 0;
  color: var(--text-tertiary);
  font-size: 0.875rem;
}


/* ===== OPPORTUNITY ACTIONS SECTION ===== */

.opportunity-actions-section {
  margin-top: 1.5rem;
  padding: 1rem;
  display: flex;
  justify-content: center;
}

.btn-mark-layed-out {
  background-color: var(--accent-color);
  color: white;
  border: none;
  padding: 0.75rem 2rem;
  border-radius: 0;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.0892857143em;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow:
    0 2px 1px -1px rgba(0, 0, 0, 0.2),
    0 1px 1px 0 rgba(0, 0, 0, 0.14),
    0 1px 3px 0 rgba(0, 0, 0, 0.12);
}

.btn-mark-layed-out:hover {
  background-color: var(--accent-hover);
  box-shadow:
    0 3px 1px -2px rgba(0, 0, 0, 0.2),
    0 2px 2px 0 rgba(0, 0, 0, 0.14),
    0 1px 5px 0 rgba(0, 0, 0, 0.12);
}

.btn-mark-layed-out:active {
  background-color: #a00042;
  box-shadow:
    0 5px 5px -3px rgba(0, 0, 0, 0.2),
    0 8px 10px 1px rgba(0, 0, 0, 0.14),
    0 3px 14px 2px rgba(0, 0, 0, 0.12);
}

.btn-already-layed-out {
  background-color: #6ee7b7;
  color: #1b1b1b;
  border: none;
  padding: 0.75rem 2rem;
  border-radius: 0;
  cursor: not-allowed;
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.0892857143em;
  box-shadow:
    0 2px 1px -1px rgba(0, 0, 0, 0.2),
    0 1px 1px 0 rgba(0, 0, 0, 0.14),
    0 1px 3px 0 rgba(0, 0, 0, 0.12);
}

.btn-already-layed-out:disabled {
  opacity: 1;
  cursor: not-allowed;
}

/* ===== PRINT AGREEMENT SECTION ===== */

.print-agreement-section {
  margin-top: 1.5rem;
  padding: 1rem;
  display: flex;
  justify-content: center;
  border-top: 1px solid var(--grey-border);
}

.btn-print-agreement {
  background-color: var(--primary-color);
  color: white;
  border: none;
  padding: 0.75rem 2rem;
  border-radius: 0;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.0892857143em;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow:
    0 2px 1px -1px rgba(0, 0, 0, 0.2),
    0 1px 1px 0 rgba(0, 0, 0, 0.14),
    0 1px 3px 0 rgba(0, 0, 0, 0.12);
}

.btn-print-agreement:hover {
  background-color: var(--primary-hover);
  box-shadow:
    0 3px 1px -2px rgba(0, 0, 0, 0.2),
    0 2px 2px 0 rgba(0, 0, 0, 0.14),
    0 1px 5px 0 rgba(0, 0, 0, 0.12);
}

.btn-print-agreement:active {
  background-color: var(--primary-active);
  box-shadow:
    0 5px 5px -3px rgba(0, 0, 0, 0.2),
    0 8px 10px 1px rgba(0, 0, 0, 0.14),
    0 3px 14px 2px rgba(0, 0, 0, 0.12);
}

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

.customer-detail-placeholder-loading {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.customer-detail-placeholder-loading .spinner {
  margin-right: 0;
  flex-shrink: 0;
}

.customer-detail-placeholder-loading p {
  margin: 0;
}

.item {
  padding: 0.75rem 0;
  color: var(--text-secondary);
  font-size: 1rem;
  display: flex;
  align-items: center;
  user-select: none;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  gap: 0.75rem;
}

.item:last-child {
  border-bottom: none;
}

.item input[type="checkbox"] {
  flex-shrink: 0;
  margin: 0;
}

.item-content {
  display: flex;
  gap: 0.5rem;
  flex: 1;
  align-items: center;
  flex-wrap: wrap;
}

.item-quantity {
  font-weight: 600;
  color: var(--text-secondary);
  min-width: 40px;
  flex-shrink: 0;
}

.item-name {
  color: var(--text-secondary);
  flex: 1;
}

.item-status {
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.accessories-list {
  margin-left: 3rem;
  margin-top: 0.75rem;
  padding-left: 0;
  list-style: none;
}

.accessories-list .accessories-list {
  margin-top: 0.5rem;
}

.accessory {
  padding: 0.5rem 0;
  color: var(--text-tertiary);
  font-size: 0.9375rem;
  display: flex;
  align-items: center;
  user-select: none;
  cursor: pointer;
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
  gap: 0.75rem;
}

.accessory:last-child {
  border-bottom: none;
}

.accessory input[type="checkbox"] {
  flex-shrink: 0;
  margin: 0;
}

.accessory-content {
  display: flex;
  gap: 0.5rem;
  flex: 1;
  align-items: center;
  flex-wrap: wrap;
}

.accessory-quantity {
  font-weight: 600;
  color: var(--text-tertiary);
  min-width: 35px;
  flex-shrink: 0;
}

.accessory-name {
  color: var(--text-tertiary);
  flex: 1;
}

.no-opportunities {
  background-color: var(--surface-white);
  border-radius: 0;
  padding: 3rem 2rem;
  text-align: center;
  color: #9e9e9e;
  box-shadow:
    0 2px 1px -1px rgba(0, 0, 0, 0.2),
    0 1px 1px 0 rgba(0, 0, 0, 0.14),
    0 1px 3px 0 rgba(0, 0, 0, 0.12);
  font-size: 1.125rem;
  letter-spacing: 0.0125em;
}

/* ===== SECTION 7: UTILITY CLASSES ===== */

/* Color classes */
.text-primary {
  color: var(--primary-color);
}

.text-accent {
  color: var(--accent-color);
}

.text-secondary {
  color: #757575;
}

.bg-primary {
  background-color: var(--primary-color);
}

.bg-accent {
  background-color: var(--accent-color);
}

/* Spacing utilities */
.mt-1 {
  margin-top: 0.5rem;
}
.mt-2 {
  margin-top: 1rem;
}
.mt-3 {
  margin-top: 1.5rem;
}
.mb-1 {
  margin-bottom: 0.5rem;
}
.mb-2 {
  margin-bottom: 1rem;
}
.mb-3 {
  margin-bottom: 1.5rem;
}
.p-1 {
  padding: 0.5rem;
}
.p-2 {
  padding: 1rem;
}
.p-3 {
  padding: 1.5rem;
}

/* Flexbox utilities */
.d-flex {
  display: flex;
}
.align-items-center {
  align-items: center;
}
.justify-content-between {
  justify-content: space-between;
}
.justify-content-end {
  justify-content: flex-end;
}
.gap-1 {
  gap: 0.5rem;
}
.gap-2 {
  gap: 1rem;
}
.text-center {
  text-align: center;
}
.flex-wrap {
  flex-wrap: wrap;
}

/* ===== SECTION 7.5: HTMX INDICATORS ===== */

.htmx-indicator {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease-out;
}

.htmx-request .htmx-indicator,
.htmx-request.htmx-indicator {
  opacity: 1;
  pointer-events: auto;
}

/* ===== SECTION 8: ANIMATIONS ===== */

.spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(0, 0, 0, 0.1);
  border-top-color: #01579b;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  margin-right: 0.5rem;
}

html[data-theme="dark"] .spinner {
  border-color: rgba(209, 196, 233, 0.3);
}

html[data-theme="dark"] .loading-overlay {
  background-color: rgba(32, 32, 32, 0.7);
}

html[data-theme="dark"] .loading-overlay .spinner {
  border-color: rgba(209, 196, 233, 0.35);
}

html[data-theme="dark"] .info {
  background: #3a3a3a;
  color: #f0e8ff;
  border-left-color: #b39ddb;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ===== SECTION 9: RESPONSIVE DESIGN ===== */

@media (min-width: 961px) {
  .collections-toolbar-nav {
    display: none;
  }

  .collections-toolbar {
    display: flex;
    position: sticky;
    top: 0;
  }

  .btn-home.btn-home-desktop {
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    text-decoration: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.375rem;
    transition: opacity 0.2s;
    flex-shrink: 0;
  }

  .btn-home-desktop:hover {
    opacity: 0.8;
  }

  .toolbar-spacer {
    display: flex;
    flex: 1;
  }

  .collections-toolbar h1 {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .date-picker-desktop {
    display: block;
    background-color: var(--toolbar-overlay);
    color: white;
    color-scheme: dark;
    border: none;
    border-bottom: 1px solid var(--toolbar-border);
    padding: 0.5rem 0.75rem;
    min-width: 140px;
    max-width: 240px;
    width: 100%;
    font-size: 0.875rem;
    flex: 0 0 auto;
  }

  .date-picker-desktop::placeholder {
    color: white;
  }

  .date-picker-desktop:focus {
    outline: none;
    background-color: var(--toolbar-overlay-hover);
    border-bottom-color: white;
  }

  .btn-go-desktop {
    display: block;
    background-color: #757575;
    margin: 0;
    flex-shrink: 0;
  }

  .btn-go-desktop:hover {
    background-color: #616161;
  }
}

@media (max-width: 960px) {
  .landing-content {
    grid-template-columns: 1fr;
  }

  .landing-header h1 {
    font-size: 1.375rem;
  }

  .landing-section {
    margin-top: 0;
  }

  .collections-toolbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 1.5rem;
    position: static;
    top: auto;
  }

  .collections-toolbar h1 {
    min-width: auto;
    width: 100%;
  }

  .collections-toolbar-nav {
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .collections-toolbar-nav input {
    flex: 1;
    min-width: 120px;
  }
}

@media (max-width: 600px) {
  .landing-header {
    padding: 0.75rem 1rem;
  }

  .landing-header h1 {
    font-size: 1.25rem;
  }

  .landing-content {
    padding: 1rem;
    gap: 1rem;
  }

  .landing-section .card {
    padding: 1rem;
  }

  .button-group {
    flex-direction: column;
  }

  .date-input-group {
    flex-direction: column;
  }

  .date-input-group input,
  .date-input-group .btn {
    width: 100%;
  }

  .collections-toolbar {
    padding: 1rem;
  }

  .collections-toolbar h1 {
    font-size: 1.125rem;
  }

  .collections-content {
    padding: 1rem 1rem 1.5rem 1rem;
  }

  .opportunity-header {
    position: static;
    top: auto;
  }

  .group-container {
    padding: 1rem;
    border-top-width: 2px;
  }

  .bulk-texts-top-grid,
  .bulk-texts-summary-grid {
    grid-template-columns: 1fr;
  }

  .bulk-texts-toolbar,
  .bulk-texts-send-bar {
    flex-direction: column;
    align-items: flex-start;
  }

  .bulk-texts-send-actions {
    flex-direction: column;
    align-items: flex-start;
  }

  .group-name {
    flex-direction: column;
    align-items: stretch;
  }

  .group-header {
    min-width: auto;
  }

  .btn-upload {
    width: 100%;
  }

  .thumbnails-container {
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 0.75rem;
  }

  .item {
    padding: 0.5rem 0;
  }

  .accessories-list {
    margin-left: 2rem;
  }

  .collections-nav {
    flex-direction: column;
    gap: 0.75rem;
  }

  .collections-nav input {
    width: 100%;
  }

  .collections-nav .btn-raised,
  .collections-nav a {
    width: 100%;
  }
}

/* ===== SECTION: MY SHIFTS PAGE ===== */

.myshifts-container {
  padding: 1rem;
  /* max-width: 1200px; */
  margin: 0 auto;
}

.myshifts-header {
  margin-bottom: 2rem;
  display: flex;
  justify-content: center;
}

.myshifts-week-view {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

.myshifts-week-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr) auto;
  gap: 1rem;
}

.myshifts-day-header {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.75rem;
  padding: 0.75rem;
  background: var(--primary-light);
  border-radius: 0.5rem;
  border-left: 3px solid var(--primary-color);
}

.myshift-add-unavailability-button {
  align-self: flex-start;
}

.myshifts-day-heading {
  flex: 1;
  min-width: 0;
}

.myshifts-day-name {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-primary);
}

.myshifts-day-date {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 0.25rem;
}

.myshifts-total-column {
  display: flex;
  align-items: center;
  justify-content: center;
}

.myshifts-total-header {
  text-align: center;
  padding: 0.75rem 1rem;
  background: var(--primary-color);
  color: white;
  border-radius: 0.5rem;
  min-width: 120px;
}

.myshifts-total-label {
  font-size: 0.75rem;
  font-weight: 600;
  opacity: 0.9;
}

.myshifts-total-hours {
  font-size: 1.25rem;
  font-weight: 700;
  margin-top: 0.25rem;
}

.myshifts-day-section {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.myshifts-day-shifts {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.myshift-card {
  background: white;
  border: 1px solid var(--grey-border);
  border-radius: 0.5rem;
  padding: 1rem;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

.myshift-card:hover {
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
  border-color: var(--primary-color);
}

.myshift-card.myshift-submitted {
  border-left: 4px solid #4caf50;
}

.myshift-card.myshift-draft {
  border-left: 4px solid var(--grey-border);
  opacity: 0.85;
}

.myshift-card.myshift-total {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%);
  color: white;
  border: none;
  cursor: default;
}

.myshift-card.myshift-total:hover {
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
  border-color: var(--primary-color);
}

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

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

.myshift-status {
  display: flex;
  gap: 0.5rem;
}

.badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-primary {
  background-color: rgba(76, 175, 80, 0.2);
  color: #2e7d32;
}

.badge-outline {
  border: 1px solid var(--grey-border);
  background-color: transparent;
  color: var(--text-secondary);
}

.rosterer-grid .rosterer-shift.btn-primary .badge-outline {
  color: #ffffff;
}

.myshift-times {
  margin-bottom: 0.75rem;
}

.myshift-time-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.875rem;
  padding: 0.375rem 0;
  border-bottom: 1px solid var(--grey-border);
}

.myshift-time-row:last-child {
  border-bottom: none;
}

.myshift-card.myshift-total .myshift-time-row {
  border-bottom-color: rgba(255, 255, 255, 0.2);
}

.myshift-time-row.myshift-user-entered {
  background-color: rgba(63, 81, 181, 0.05);
  color: var(--primary-color);
  font-weight: 600;
  padding: 0.5rem;
  margin: 0.375rem 0;
  border-radius: 3px;
  border: 1px solid var(--primary-light);
}

.myshift-label {
  font-weight: 600;
  color: var(--text-secondary);
  min-width: 90px;
}

.myshift-value {
  text-align: right;
}

.myshift-hours {
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary-color);
  text-align: right;
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 2px solid var(--grey-border);
}

.myshift-card.myshift-total .myshift-hours {
  border-top-color: rgba(255, 255, 255, 0.3);
}

.myshift-notes {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--grey-border);
}

.myshift-notes-text {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-style: italic;
  margin-top: 0.375rem;
  line-height: 1.4;
}

.myshift-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100px;
  background: var(--bg-grey);
  border: 1px dashed var(--grey-border);
  border-radius: 0.5rem;
}

.myshift-empty-text {
  color: var(--text-tertiary);
  font-style: italic;
}

.myshift-unavailability {
  border-width: 1px;
  border-style: solid;
}

.myshift-unavailability .myshift-label,
.myshift-unavailability .myshift-notes-text {
  color: inherit;
}

.myshift-unavailability .myshift-time-row,
.myshift-unavailability .myshift-notes {
  border-color: currentColor;
}

.myshift-unavailability.rosterer-unavailability-type-holiday-paid {
  background: #d9f6db;
  color: #1f5a2b;
  border-color: #8bc998;
}

.myshift-unavailability.rosterer-unavailability-type-personal-paid {
  background: #d8e9ff;
  color: #184f87;
  border-color: #8cb6e6;
}

.myshift-unavailability.rosterer-unavailability-type-unpaid {
  background: #ffe3bd;
  color: #8a4f00;
  border-color: #efba74;
}

.myshift-unavailability.rosterer-unavailability-type-unknown {
  background: #eef2f7;
  color: #324154;
  border-color: #c3cfda;
}

.myshift-unavailability-pending {
  background: var(--surface-white) !important;
  color: var(--text-primary) !important;
  border-color: var(--grey-border) !important;
}

.myshift-modal-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.myshift-checkbox-group {
  margin-bottom: 1rem;
}

.myshift-checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.myshift-checkbox-label input[type="checkbox"] {
  width: auto;
  margin: 0;
  flex: 0 0 auto;
}

.myshift-modal-actions {
  justify-content: space-between;
}

.myshift-modal-error {
  margin-bottom: 1rem;
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  border: 1px solid #f0b6b6;
  background: #fff1f1;
  color: #8f1d1d;
  font-size: 0.875rem;
  line-height: 1.4;
}

.myshifts-total-section {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  align-items: center;
  justify-content: flex-start;
}

.myshift-total-display {
  text-align: center;
  width: 100%;
}

.myshift-total-label {
  font-size: 0.75rem;
  font-weight: 600;
  opacity: 0.9;
}

.myshift-total-value {
  font-size: 1.5rem;
  font-weight: 700;
  margin-top: 0.5rem;
}

/* Modal styles for My Shifts */
.myshifts-modal {
  width: min(500px, calc(100vw - 2rem));
  max-width: none;
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.myshifts-modal::backdrop {
  background: rgba(15, 23, 42, 0.45);
}

.myshifts-modal .modal-box {
  width: 100%;
  max-width: none;
  max-height: calc(100vh - var(--app-nav-offset) - 2rem);
  max-height: calc(100dvh - var(--app-nav-offset) - 2rem);
  overflow-y: auto;
  position: relative;
  background: white;
  border-radius: 0.75rem;
  border: 1px solid var(--grey-border);
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.28);
  padding: 1.5rem;
}

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

.myshifts-modal .form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: var(--text-primary);
}

.myshifts-modal .form-group input,
.myshifts-modal .form-group textarea,
.myshifts-modal .form-group select {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid var(--grey-border);
  border-radius: 0.25rem;
  font-family: inherit;
  font-size: 0.875rem;
}

.myshifts-modal .form-group input:focus,
.myshifts-modal .form-group textarea:focus,
.myshifts-modal .form-group select:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.myshifts-modal .form-group input:disabled,
.myshifts-modal .form-group select:disabled {
  background-color: var(--bg-grey);
  opacity: 0.7;
}

.myshifts-modal textarea {
  resize: vertical;
  min-height: 80px;
}

/* Responsive adjustments */
@media (max-width: 1024px) {
  .myshifts-week-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .myshifts-total-section {
    grid-column: 1 / -1;
  }

  .myshift-card {
    padding: 0.75rem;
    font-size: 0.875rem;
  }

  .myshifts-day-header,
  .myshift-header,
  .myshift-modal-row,
  .myshift-modal-actions {
    grid-template-columns: 1fr;
    flex-direction: column;
    align-items: stretch;
  }

  .myshift-time-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .myshift-value {
    text-align: left;
    margin-top: 0.25rem;
  }

  .myshift-hours {
    text-align: left;
  }
}

@media (max-width: 768px) {
  .myshifts-container {
    padding: 0.75rem;
  }

  .myshifts-week-grid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .myshifts-day-section {
    gap: 0.5rem;
  }

  .myshifts-day-shifts {
    gap: 0.5rem;
  }

  .myshift-card {
    padding: 0.75rem;
  }

  .myshift-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  #editMyShiftModal {
    width: 95vw;
  }

  #editMyShiftModal .modal-box {
    max-height: calc(100vh - var(--app-nav-offset) - 1rem);
    max-height: calc(100dvh - var(--app-nav-offset) - 1rem);
  }
}

/* ===== SECTION: TIMESHEETS USER-ENTERED TIMES ===== */

.has-user-entered-times {
  background-color: rgba(63, 81, 181, 0.04);
}

.timesheets-grid-wrap {
  overflow: visible;
}

.timesheets-grid {
  min-width: 1260px;
}

.timesheets-grid .rosterer-row {
  grid-template-columns: 120px repeat(7, minmax(135px, 1fr)) 80px;
}

@media (min-width: 1501px) {
  .timesheets-grid .rosterer-row {
    grid-template-columns: 180px repeat(7, minmax(145px, 1fr)) 100px;
  }
}

.timesheets-grid .rosterer-day-layout {
  align-items: flex-start;
  padding-left: 0;
  padding-right: 0;
}

.timesheet-day-main {
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  gap: 0.35rem;
  padding: 0.1rem 0;
}

.timesheet-empty-state {
  width: 100%;
  font-size: 0.75rem;
  color: var(--text-tertiary);
  text-align: center;
  padding: 0.5rem 0.25rem;
}

.timesheet-unavailability-chip {
  width: 100%;
  min-height: 30px;
  justify-content: space-between;
  gap: 0.5rem;
}

.timesheet-unavailability-status {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  white-space: nowrap;
  word-break: normal;
  flex: 0 0 auto;
}

.timesheet-shift-stack {
  width: 100%;
  border: 1px solid var(--grey-border);
  background: var(--surface-white);
  padding: 0.35rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.timesheet-shift-head {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.25rem;
}

.timesheet-shift-head-row {
  display: flex;
  align-items: center;
  align-content: flex-start;
  gap: 0.25rem;
  flex-wrap: wrap;
}

.timesheet-shift-head-row-primary {
  min-height: 0;
}

.timesheet-shift-head-row-status {
  justify-content: flex-start;
}

.timesheets-grid .timesheet-shift-chip {
  justify-content: flex-start;
  min-width: 0;
  max-width: 100%;
  flex: 1 1 6rem;
  padding: 0 0.4rem;
  border-color: var(--grey-border);
  background: var(--surface-white);
  color: var(--text-primary);
  overflow: hidden;
}

.timesheets-grid .timesheet-shift-chip span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
}

.timesheets-grid .timesheet-shift-chip .timesheet-primary-time {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--text-primary);
}

.timesheets-grid .timesheet-shift-chip:hover,
.timesheets-grid .timesheet-shift-chip:focus-visible {
  background: var(--surface-overlay-hover);
  outline: none;
}

.timesheet-status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  padding: 0 0.35rem;
  border: 1px solid var(--grey-border);
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
  flex: 0 0 auto;
}

.timesheet-action-menu {
  position: relative;
  top: auto;
  right: auto;
  display: inline-flex;
  margin-left: auto;
  flex: 0 0 auto;
}

.timesheets-grid .timesheet-action-menu .rosterer-menu-btn {
  min-width: 22px;
  min-height: 22px;
}

.timesheet-shift-meta {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.timesheet-meta-row {
  display: flex;
  justify-content: space-between;
  gap: 0.4rem;
  font-size: 0.74rem;
  color: var(--text-secondary);
}

.timesheet-meta-row-no-label {
  justify-content: flex-start;
}

.timesheet-meta-row-no-label span:last-child {
  text-align: left;
}

.timesheet-meta-row span:last-child {
  text-align: right;
}

.timesheet-meta-label {
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-tertiary);
}

.timesheet-user-submitted {
  color: var(--primary-color);
}

.timesheet-user-submitted .timesheet-meta-label {
  color: var(--primary-color);
}

.timesheet-shift-footer {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
}

.timesheet-shift-hours {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--text-primary);
}

.timesheet-break-length {
  margin-left: auto;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-align: right;
}

.timesheet-complete {
  border-left: 3px solid #2e7d32;
}

.timesheet-complete .timesheet-status-badge {
  color: #1b5e20;
  background: rgba(46, 125, 50, 0.08);
  border-color: rgba(46, 125, 50, 0.25);
}

.timesheet-clocked-in {
  border-left: 3px solid #ef6c00;
}

.timesheet-clocked-in .timesheet-status-badge {
  color: #b45309;
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.28);
}

.timesheet-not-started {
  border-left: 3px solid var(--primary-color);
}

.timesheet-not-started .timesheet-status-badge {
  color: var(--primary-color);
  background: rgba(63, 81, 181, 0.08);
  border-color: rgba(63, 81, 181, 0.22);
}

.timesheet-pending {
  border-left: 3px solid #c62828;
}

.timesheet-pending .timesheet-status-badge {
  color: #b91c1c;
  background: rgba(220, 38, 38, 0.08);
  border-color: rgba(220, 38, 38, 0.22);
}

.timesheet-total-cell {
  align-items: center;
}

.timesheet-total-hours {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
}

@media (max-width: 1280px) {
  .timesheet-shift-stack {
    padding: 0.3rem;
  }

  .timesheet-status-badge {
    min-height: 24px;
    padding: 0 0.3rem;
    font-size: 0.64rem;
  }
}

@media (max-width: 768px) {
  .timesheet-shift-stack {
    padding: 0.25rem;
  }

  .timesheet-status-badge {
    min-height: 22px;
  }
}

/* Vehicle Styles */
.vehicles-section {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  border-top: 1px solid var(--grey-border);
  padding-top: 0.75rem;
}

.vehicle-row {
  display: grid;
  grid-template-columns: 6rem 1fr auto;
  gap: 0.4rem;
  align-items: center;
  position: relative;
}

.vehicle-button {
  flex-shrink: 0;
  min-width: 100px;
}

.shift-menu {
  flex-shrink: 0;
  padding: 0.25rem;
  opacity: 0;
  transition: opacity 0.2s;
}

.shift-action-menu {
  position: relative;
}

.shift-action-menu > summary {
  list-style: none;
}

.shift-action-menu > summary::-webkit-details-marker {
  display: none;
}

.shift-row:hover .shift-menu {
  opacity: 1;
}

.shift-action-menu[open] .shift-menu {
  opacity: 1;
}

.shift-action-menu-panel {
  position: absolute;
  top: calc(100% + 0.25rem);
  right: 0;
  min-width: 9.5rem;
  padding: 0.25rem;
  border: 1px solid var(--grey-border);
  background: var(--surface-white);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.14);
  z-index: 20;
  border-radius: 6px;
}

.shift-action-menu-contact {
  display: grid;
  gap: 0.2rem;
  padding-bottom: 0.35rem;
  margin-bottom: 0.25rem;
  border-bottom: 1px solid var(--grey-border);
}

.shift-action-menu-item {
  display: block;
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
  padding: 0.45rem 0.5rem;
  font-size: 0.85rem;
  color: var(--text-primary);
  cursor: pointer;
}

.shift-action-menu-item.is-muted {
  color: var(--text-secondary);
  cursor: default;
}

.shift-action-menu-item.is-muted:hover,
.shift-action-menu-item.is-muted:focus-visible {
  background: transparent;
}

.shift-action-menu-contact-item {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  text-decoration: none;
}

.shift-action-menu-contact-label {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
}

.shift-action-menu-contact-value {
  font-size: 0.85rem;
  overflow-wrap: anywhere;
}

.shift-action-menu-heading {
  padding: 0.35rem 0.5rem 0.2rem 0.5rem;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
  opacity: 0.7;
  cursor: default;
}

.shift-action-menu-item:hover,
.shift-action-menu-item:focus-visible {
  background: var(--surface-hover);
  outline: none;
}

.vehicle-button.is-selected,
.shift-staff.is-selected {
  background-color: var(--primary-color);
  color: white;
}

.vehicle-rego {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  padding: 0.35rem 0.5rem;
  border: 1px solid var(--grey-border);
  border-radius: 0;
  background: var(--surface-white);
  text-align: center;
  font-size: 0.85rem;
}

.vehicle-status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  background: rgba(217, 119, 6, 0.12);
  color: #b45309;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
}

.vehicle-status-popover {
  position: static;
}

.vehicle-status-popover > summary {
  list-style: none;
}

.vehicle-status-popover > summary::-webkit-details-marker {
  display: none;
}

.vehicle-status-popover-panel {
  position: absolute;
  top: calc(100% - 0.15rem);
  left: 50%;
  transform: translateX(-50%);
  width: min(13rem, calc(100% - 0.5rem));
  display: none;
  padding: 0.35rem;
  border: 1px solid var(--grey-border);
  border-radius: 8px;
  background: var(--surface-white);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.14);
  z-index: 24;
  box-sizing: border-box;
  overflow-wrap: anywhere;
}

.vehicle-status-popover:hover .vehicle-status-popover-panel,
.vehicle-status-popover[open] .vehicle-status-popover-panel {
  display: grid;
  gap: 0.25rem;
}

.vehicle-status-popover-item {
  display: grid;
  gap: 0.2rem;
  width: 100%;
  min-width: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  text-align: left;
  padding: 0.45rem 0.5rem;
  cursor: pointer;
}

.vehicle-status-popover-item:hover,
.vehicle-status-popover-item:focus-visible {
  background: var(--surface-hover);
  outline: none;
}

.vehicle-status-popover-range {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-primary);
}

.vehicle-status-popover-reason {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.vehicle-menu {
  flex-shrink: 0;
  padding: 0.25rem;
  opacity: 0;
  transition: opacity 0.2s;
}

.vehicle-action-menu {
  position: relative;
}

.vehicle-action-menu > summary {
  list-style: none;
}

.vehicle-action-menu > summary::-webkit-details-marker {
  display: none;
}

.vehicle-row:hover .vehicle-menu {
  opacity: 1;
}

.vehicle-action-menu[open] .vehicle-menu {
  opacity: 1;
}

.vehicle-action-menu-panel {
  position: absolute;
  top: calc(100% + 0.25rem);
  right: 0;
  min-width: 9.5rem;
  padding: 0.25rem;
  border: 1px solid var(--grey-border);
  background: var(--surface-white);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.14);
  z-index: 20;
}

.vehicle-action-menu-item {
  display: block;
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
  padding: 0.45rem 0.5rem;
  font-size: 0.85rem;
  color: var(--text-primary);
  cursor: pointer;
}

.vehicle-action-menu-item-detail {
  white-space: normal;
  line-height: 1.35;
}

.vehicle-action-menu-item:hover,
.vehicle-action-menu-item:focus-visible {
  background: var(--surface-hover);
  outline: none;
}

.vehicle-tools {
  display: flex;
  gap: 0.4rem;
}

.vehicle-tools .btn {
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  height: 36px;
}

.vehicle-tools .btn svg {
  flex-shrink: 0;
}

.task-vehicle-chip {
  background-color: var(--success-color, #10b981);
  border-color: var(--success-color, #10b981);
}

.task-vehicle-chip:hover {
  background-color: var(--success-hover, #059669);
  border-color: var(--success-hover, #059669);
}

/* ── Autocomplete multi-select dropdown ── */
.autocomplete-wrapper {
  position: relative;
}

.autocomplete-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 1000;
  max-height: 220px;
  overflow-y: auto;
  background: var(--surface-white);
  border: 1px solid var(--grey-border);
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
  margin-top: 2px;
}

.autocomplete-dropdown.hidden {
  display: none;
}

.autocomplete-group-header {
  padding: 6px 10px 4px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-tertiary);
  pointer-events: none;
  user-select: none;
}

.autocomplete-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  font-size: 0.85rem;
  cursor: pointer;
  color: var(--text-primary);
}

.autocomplete-option:hover,
.autocomplete-option.highlighted {
  background: var(--surface-overlay-hover);
}

.autocomplete-option.selected {
  opacity: 0.55;
}

.autocomplete-option .ac-check {
  width: 14px;
  flex-shrink: 0;
  text-align: center;
  font-size: 0.75rem;
  color: var(--primary-color);
}

.autocomplete-option .ac-label {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.autocomplete-no-results {
  padding: 10px 12px;
  font-size: 0.82rem;
  color: var(--text-tertiary);
  text-align: center;
}
