:root {
  --rws-primary: #8B1414;
  --rws-primary-dark: #6B0F0F;
  --rws-secondary: #E0E0E0;
  --rws-text-on-primary: #ffffff;
}

body {
  background-color: #f7f7f7;
  font-family: 'Segoe UI', Roboto, Arial, sans-serif;
}

.rws-navbar {
  background-color: var(--rws-primary);
}

.rws-btn-outline {
  border: 1px solid #fff;
  color: #fff;
}
.rws-btn-outline:hover {
  background-color: #fff;
  color: var(--rws-primary);
}

.btn-primary,
.btn-rws {
  background-color: var(--rws-primary);
  border-color: var(--rws-primary);
  color: #fff;
}
.btn-primary:hover,
.btn-rws:hover {
  background-color: var(--rws-primary-dark);
  border-color: var(--rws-primary-dark);
  color: #fff;
}

.badge-progress {
  background-color: #E0A200;
  color: #fff;
}
.badge-complete {
  background-color: #2e7d32;
  color: #fff;
}
.badge-issue {
  background-color: var(--rws-primary);
  color: #fff;
}
.badge-damage {
  background-color: #6a1b9a;
  color: #fff;
}

.card-header.rws-header {
  background-color: var(--rws-primary);
  color: #fff;
  font-weight: 600;
}

.bg-rws-secondary {
  background-color: var(--rws-secondary) !important;
}

.login-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--rws-primary) 0%, var(--rws-primary-dark) 100%);
}

.login-card {
  max-width: 420px;
  width: 100%;
  border: none;
  border-radius: 14px;
  box-shadow: 0 15px 35px rgba(0,0,0,0.25);
}

.role-tab.active {
  background-color: var(--rws-primary) !important;
  color: #fff !important;
  border-color: var(--rws-primary) !important;
}

.stat-card {
  border-left: 5px solid var(--rws-primary);
  background: #fff;
  border-radius: 10px;
}

.table thead {
  background-color: var(--rws-secondary);
}

.sku-tag {
  background-color: var(--rws-secondary);
  border-radius: 20px;
  padding: 3px 12px;
  margin: 2px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.photo-thumb {
  width: 110px;
  height: 110px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--rws-secondary);
}

#signaturePad {
  border: 2px dashed var(--rws-primary);
  border-radius: 8px;
  touch-action: none;
  background: #fff;
}

/* ---------------------------------------------------------------------
   RESPONSIVE / TOUCH TARGETS
--------------------------------------------------------------------- */

/* Ultrawide monitors (29"-34"): cap content width so it doesn't stretch
   edge-to-edge. Laptop widths (1280-1920px) stay full fluid width. */
@media (min-width: 1900px) {
  .rws-main {
    max-width: 1800px;
    margin-left: auto;
    margin-right: auto;
  }
}

/* Touch devices (iPad primary target): min 44px tap targets per Apple HIG.
   Scoped to actual touch/no-hover devices so mouse-driven laptops/desktops
   at similar widths are unaffected. */
@media (hover: none) and (pointer: coarse) {
  .form-control,
  .form-select,
  .btn,
  .btn-outline-rws,
  .card-header[data-bs-toggle="collapse"] {
    min-height: 44px;
  }
  .form-check-input {
    min-width: 24px;
    min-height: 24px;
  }
}

/* ---------------------------------------------------------------------
   COLLAPSIBLE SECTION CARDS
--------------------------------------------------------------------- */
.card-header[data-bs-toggle="collapse"] {
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.card-header[data-bs-toggle="collapse"] .chevron-icon {
  transition: transform 0.2s ease;
}
.card-header[data-bs-toggle="collapse"].collapsed .chevron-icon {
  transform: rotate(-90deg);
}

/* ---------------------------------------------------------------------
   SEGMENTED YES/NO CONTROL
--------------------------------------------------------------------- */
.btn-outline-rws {
  border: 1px solid var(--rws-primary);
  color: var(--rws-primary);
  background-color: #fff;
  min-width: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
}
.btn-check:checked + .btn-outline-rws {
  background-color: var(--rws-primary);
  border-color: var(--rws-primary);
  color: #fff;
}
.btn-check:focus + .btn-outline-rws {
  box-shadow: 0 0 0 0.2rem rgba(139, 20, 20, 0.25);
}

/* ---------------------------------------------------------------------
   PHOTO PICKERS (single: Start/End Photo · multi: Activity Photos)
   #editExistingPhotos (Update Issue modal's existing-photo thumbnails)
   reuses this same .preview-item/.remove-btn markup outside of a
   .single-photo-picker/.multi-photo-picker wrapper, so it needs the same
   rules applied directly or its images render at native/unfitted size.
--------------------------------------------------------------------- */
.single-photo-picker .preview-list,
.multi-photo-picker .preview-list {
  min-height: 0;
}
.single-photo-picker .preview-item,
.multi-photo-picker .preview-item,
#editExistingPhotos .preview-item {
  position: relative;
  width: 90px;
  height: 90px;
}
.single-photo-picker .preview-item img,
.multi-photo-picker .preview-item img,
#editExistingPhotos .preview-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--rws-secondary);
}
.single-photo-picker .preview-item .remove-btn,
.multi-photo-picker .preview-item .remove-btn,
#editExistingPhotos .preview-item .remove-btn {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 24px;
  height: 24px;
  padding: 0;
  border-radius: 50%;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ---------------------------------------------------------------------
   CUSTOMER JOB CARDS (clickable / expandable)
--------------------------------------------------------------------- */
.job-card {
  cursor: pointer;
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}
.job-card:hover {
  box-shadow: 0 0.5rem 1.25rem rgba(0, 0, 0, 0.15);
  transform: translateY(-2px);
}

.lightbox-trigger {
  cursor: pointer;
}

/* ---------------------------------------------------------------------
   CLICKABLE TABLE ROWS (Team Leader Job Overview)
--------------------------------------------------------------------- */
.clickable-row {
  cursor: pointer;
}

/* ---------------------------------------------------------------------
   ACTIVE DASHBOARD FILTER CARD (Customer Job Monitor)
--------------------------------------------------------------------- */
.stat-card-active {
  border: 2px solid var(--rws-primary);
  box-shadow: 0 0.25rem 0.75rem rgba(139, 20, 20, 0.25);
}

/* ---------------------------------------------------------------------
   MANDATORY FIELD VALIDATION HIGHLIGHT
--------------------------------------------------------------------- */
.field-missing {
  outline: 2px solid var(--rws-primary);
  outline-offset: 3px;
  border-radius: 8px;
}
