/* Arctic Frost Neomorphism Design System */
@import url('https://fonts.googleapis.com/css2?family=DM+Mono:wght@400;500&family=Outfit:wght@300;400;500;600;700&display=swap');

/* ─────────────────────────────────────── */
/* PART 1: ROOT COLOR SYSTEM              */
/* ─────────────────────────────────────── */

:root {
  /* Surfaces */
  --bg:         #EEF4FA;
  --bg2:        #E5EDF6;

  /* Shadows */
  --shadow-d:   #BDD0E4;
  --shadow-l:   #FFFFFF;

  /* Blue accent family */
  --blue:       #1B6BAA;
  --blue-mid:   #3A7EC7;
  --blue-light: #5B9DD4;
  --blue-pale:  #A8CCE8;
  --blue-tint:  #DCEEf8;

  /* Text hierarchy */
  --text-1:     #1A3A5C;
  --text-2:     #3D6A8A;
  --text-3:     #7AAABF;

  /* Semantic */
  --red:        #D94F6A;
  --yellow:     #C98A00;

  /* Neomorphic shadows */
  --neo-out:    6px 6px 14px #BDD0E4, -6px -6px 14px #FFFFFF;
  --neo-out-sm: 4px 4px 10px #BDD0E4, -4px -4px 10px #FFFFFF;
  --neo-out-xs: 3px 3px 7px #BDD0E4, -3px -3px 7px #FFFFFF;
  --neo-in:     inset 3px 3px 8px #BDD0E4, inset -3px -3px 8px #FFFFFF;
  --neo-in-sm:  inset 2px 2px 5px #BDD0E4, inset -2px -2px 5px #FFFFFF;
  --neo-in-input: inset 1.5px 1.5px 3px #BDD0E4, inset -1.5px -1.5px 3px #FFFFFF;

  /* Border radius */
  --radius-lg:  22px;
  --radius-md:  14px;
  --radius-sm:  10px;
  --radius-xs:  8px;
}

/* ─────────────────────────────────────── */
/* PART 2: GLOBAL STYLES                  */
/* ─────────────────────────────────────── */

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

html, body {
  height: 100%;
  width: 100%;
}

body {
  background: var(--bg);
  color: var(--text-1);
  font-family: 'Outfit', sans-serif;
  font-size: 0.9rem;
  font-weight: 400;
  line-height: 1.5;
}

/* ─────────────────────────────────────── */
/* PART 3: LOGIN SCREEN                   */
/* ─────────────────────────────────────── */

#screen-login {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.5rem;
  background: linear-gradient(150deg, #EEF4FA 0%, #E0ECF7 50%, #D8E8F5 100%);
  position: relative;
  overflow: hidden;
}

/* Decorative radial glow */
#screen-login::before {
  content: '';
  position: absolute;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(27, 107, 170, 0.07) 0%, transparent 65%);
  top: -150px;
  right: -150px;
  pointer-events: none;
  z-index: 2;
}

/* ─────────────────────────────────────── */
/* LOGIN BOX */
/* ─────────────────────────────────────── */

.login-box {
  width: 100%;
  max-width: 380px;
  background: var(--bg);
  border-radius: var(--radius-lg);
  box-shadow: var(--neo-out);
  padding: 2.5rem 2rem;
  position: relative;
  z-index: 3;
  animation: fadeUp 0.6s ease;
  border: 1px solid rgba(255, 255, 255, 0.9);
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.login-forgot {
  margin-top: 1.25rem;
  text-align: center;
  font-size: 0.85rem;
}
.login-forgot a {
  color: var(--blue);
  text-decoration: none;
  font-weight: 600;
}
.login-forgot a:hover {
  text-decoration: underline;
}
.login-forgot .resend-form {
  display: inline;
}
.login-forgot .link-button {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  color: var(--blue);
  font-weight: 600;
  cursor: pointer;
}
.login-forgot .link-button:hover {
  text-decoration: underline;
}

/* ─────────────────────────────────────── */
/* LOGO */
/* ─────────────────────────────────────── */

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 2rem;
}

.logo-icon {
  width: 48px;
  height: 48px;
  background: var(--bg);
  border-radius: var(--radius-md);
  box-shadow: var(--neo-out-sm);
  border: 1px solid rgba(255, 255, 255, 0.8);
  object-fit: contain;
  padding: 6px;
  flex-shrink: 0;
}

.logo-text {
  font-family: 'DM Mono', monospace;
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--text-1);
  letter-spacing: 2px;
}

.logo-sub {
  font-size: 0.62rem;
  color: var(--text-3);
  font-family: 'DM Mono', monospace;
  letter-spacing: 2.5px;
  margin-top: 2px;
}

/* ─────────────────────────────────────── */
/* LOGIN HEADINGS */
/* ─────────────────────────────────────── */

.login-title {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text-1);
  margin-bottom: 0.25rem;
}

.login-sub {
  font-size: 0.85rem;
  color: var(--text-2);
  margin-bottom: 1.8rem;
}

/* ─────────────────────────────────────── */
/* FORM ELEMENTS */
/* ─────────────────────────────────────── */

.input-group {
  margin-bottom: 1rem;
}
.input-group.error .input-label {
  color: var(--red);
}

.input-label {
  font-size: 0.72rem;
  color: var(--text-2);
  margin-bottom: 7px;
  display: block;
  font-weight: 600;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

.input-field {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg);
  box-shadow: var(--neo-in-input);
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-1);
  font-family: 'Outfit', sans-serif;
  font-size: 0.9rem;
  outline: none;
  transition: box-shadow 0.2s ease;
}

.input-field:focus {
  box-shadow: var(--neo-in-input), 0 0 0 2px rgba(27, 107, 170, 0.2);
}

.input-field::placeholder {
  color: var(--text-3);
}

select.input-field option {
  background: #d6e8f5;
  color: var(--text-1);
}

/* Password visibility toggle */
.pw-field {
  position: relative;
}
.pw-field .input-field {
  padding-right: 44px;
}
.pw-toggle {
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--text-3);
  cursor: pointer;
  border-radius: var(--radius-xs);
}
.pw-toggle:hover {
  color: var(--text-2);
}
.pw-toggle:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(27, 107, 170, 0.3);
}

/* ─────────────────────────────────────── */
/* BUTTONS */
/* ─────────────────────────────────────── */

.btn-primary {
  width: 100%;
  padding: 14px;
  background: var(--bg);
  box-shadow: var(--neo-out-sm);
  border: none;
  border-radius: var(--radius-sm);
  color: var(--blue);
  font-family: 'Outfit', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-top: 0.5rem;
}

.btn-primary:hover {
  box-shadow: var(--neo-out);
  color: var(--blue-mid);
}

.btn-primary:active {
  box-shadow: var(--neo-in-sm);
}

/* ─────────────────────────────────────── */
/* ALERTS & FEEDBACK */
/* ─────────────────────────────────────── */

.alert {
  padding: 12px 16px;
  margin-bottom: 1.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  line-height: 1.4;
  border: 1px solid rgba(217, 79, 106, 0.3);
}

.alert-danger {
  background: rgba(217, 79, 106, 0.08);
  color: var(--red);
}

.alert-success {
  background: rgba(27, 107, 170, 0.08);
  color: var(--blue);
  border-color: rgba(27, 107, 170, 0.3);
}

/* ─────────────────────────────────────── */
/* RESPONSIVE */
/* ─────────────────────────────────────── */

@media (max-width: 600px) {
  .login-box {
    padding: 2rem 1.5rem;
  }

  .login-title {
    font-size: 1.4rem;
  }

  .logo {
    margin-bottom: 1.5rem;
  }
}

/* ─────────────────────────────────────── */
/* PART 4: TOP NAVIGATION                 */
/* ─────────────────────────────────────── */

.topnav {
  background: var(--bg);
  box-shadow: 0 3px 10px var(--shadow-d);
  padding: 1rem 1.2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid rgba(255, 255, 255, 0.8);
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-logo {
  height: 28px;
  width: auto;
}

.nav-page {
  font-size: 0.8rem;
  color: var(--text-3);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.avatar {
  width: 34px;
  height: 34px;
  background: var(--bg);
  box-shadow: var(--neo-out-xs);
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--blue);
}

.nav-username {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-1);
  max-width: 9rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.btn-logout {
  background: var(--bg);
  box-shadow: var(--neo-out-xs);
  border: none;
  color: var(--text-3);
  padding: 6px 12px;
  border-radius: var(--radius-xs);
  font-size: 0.75rem;
  font-family: 'Outfit', sans-serif;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-logout:hover {
  color: var(--red);
  box-shadow: var(--neo-out-sm);
}

/* ─────────────────────────────────────── */
/* PART 5: FLASH MESSAGES                 */
/* ─────────────────────────────────────── */

.flash-message {
  margin: 0.75rem 0;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  line-height: 1.4;
}

.flash-notice {
  background: rgba(27, 107, 170, 0.08);
  color: var(--blue);
  border: 1px solid rgba(27, 107, 170, 0.3);
}

.flash-alert {
  background: rgba(217, 79, 106, 0.08);
  color: var(--red);
  border: 1px solid rgba(217, 79, 106, 0.3);
}

/* ─────────────────────────────────────── */
/* PART 6: APP BODY                       */
/* ─────────────────────────────────────── */

.app-body {
  padding: 1.25rem 1.2rem;
  max-width: 560px;
  margin: 0 auto;
}

/* ─────────────────────────────────────── */
/* PART 7: FIELD CHECK-IN                 */
/* ─────────────────────────────────────── */

.field-body {
  padding: 1.2rem;
  flex: 1;
}

/* Status card */
.status-card {
  background: var(--bg);
  box-shadow: var(--neo-out-sm);
  border-radius: var(--radius-lg);
  padding: 1.4rem 1.2rem;
  margin-bottom: 1.4rem;
  border: 1px solid rgba(255, 255, 255, 0.9);
}

.status-card--in {
  border-left: 4px solid var(--blue);
}

.status-label {
  font-size: 0.7rem;
  color: var(--text-3);
  letter-spacing: 1.2px;
  text-transform: uppercase;
  font-weight: 600;
  margin-bottom: 4px;
}

.status-value {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-1);
  margin-bottom: 0.6rem;
}

.status-value--in {
  color: var(--blue);
}

.status-time {
  font-family: 'DM Mono', monospace;
  font-size: 0.82rem;
  color: var(--text-3);
  margin-top: 4px;
}

.status-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 0.4rem;
  flex-wrap: wrap;
}

.status-task-badge {
  background: var(--blue-tint);
  color: var(--blue);
  border-radius: var(--radius-xs);
  padding: 3px 10px;
  font-size: 0.75rem;
  font-weight: 600;
}

.status-site-text {
  font-family: 'DM Mono', monospace;
  font-size: 0.78rem;
  color: var(--text-2);
}

.status-since {
  font-family: 'DM Mono', monospace;
  font-size: 0.72rem;
  color: var(--text-3);
}

.status-gps-warn {
  margin-top: 6px;
  font-size: 0.72rem;
  color: var(--yellow);
}

/* Locked notice */
.locked-notice {
  font-size: 0.82rem;
  color: var(--text-3);
  text-align: center;
  margin-bottom: 1.2rem;
}

/* Section title */
.section-title {
  font-size: 0.72rem;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-3);
  font-weight: 600;
  margin-bottom: 0.7rem;
}

/* Task grid */
.task-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 1.2rem;
}

.task-card {
  background: var(--bg);
  box-shadow: var(--neo-out-xs);
  border-radius: var(--radius-md);
  padding: 1rem;
  text-align: center;
  cursor: pointer;
  transition: box-shadow 0.2s, color 0.2s;
  border: 2px solid transparent;
  user-select: none;
}

.task-card:active {
  box-shadow: var(--neo-in-sm);
}

.task-card.selected {
  box-shadow: var(--neo-in-sm);
  border-color: var(--blue-pale);
  background: var(--blue-tint);
}

.task-icon {
  font-size: 1.6rem;
  margin-bottom: 6px;
  line-height: 1;
}

.task-name {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-1);
  line-height: 1.25;
}

.task-card.selected .task-name {
  color: var(--blue);
}

/* Camera grid */
.camera-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 1.2rem;
}

.camera-box {
  background: var(--bg);
  box-shadow: var(--neo-in-sm);
  border-radius: var(--radius-md);
  padding: 1rem;
  text-align: center;
  cursor: pointer;
  transition: box-shadow 0.2s;
  position: relative;
  overflow: hidden;
  min-height: 110px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 2px dashed var(--blue-pale);
}

.camera-box:active {
  box-shadow: var(--neo-in);
}

.camera-box.captured {
  border-style: solid;
  border-color: var(--blue);
  background-size: cover;
  background-position: center;
}

.camera-box.captured .camera-icon {
  display: none;
}

.camera-box img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
  z-index: 0;
}

.camera-icon {
  font-size: 1.6rem;
  margin-bottom: 6px;
  position: relative;
  z-index: 1;
}

.camera-label {
  font-size: 0.74rem;
  color: var(--text-3);
  font-weight: 500;
  position: relative;
  z-index: 1;
}

.camera-box.captured .camera-label {
  background: rgba(255, 255, 255, 0.75);
  border-radius: var(--radius-xs);
  padding: 2px 8px;
  color: var(--text-2);
}

/* GPS bar */
.gps-bar {
  background: var(--bg);
  box-shadow: var(--neo-in-sm);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 1.2rem;
}

.gps-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-3);
  flex-shrink: 0;
}

@keyframes gps-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.4; transform: scale(1.4); }
}

.gps-dot.active {
  background: var(--blue);
  animation: gps-pulse 1.5s ease-in-out infinite;
}

.gps-dot.acquiring {
  background: var(--text-3);
  animation: gps-pulse 1.5s ease-in-out infinite;
}

.gps-dot.error {
  background: var(--red);
}

.gps-text {
  font-family: 'DM Mono', monospace;
  font-size: 0.72rem;
  color: var(--text-3);
  flex: 1;
}

.gps-retry {
  flex-shrink: 0;
  font-family: 'Outfit', sans-serif;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--blue);
  background: var(--bg);
  box-shadow: var(--neo-out-xs);
  border: none;
  border-radius: var(--radius-xs);
  padding: 4px 12px;
  cursor: pointer;
}

.gps-retry:active {
  box-shadow: var(--neo-in-sm);
}

/* Cancel confirmation card (inline) */
.cancel-confirm-card {
  display: none;
  background: var(--bg);
  box-shadow: var(--neo-out);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.85);
  padding: 1.4rem;
  margin-bottom: 1rem;
  animation: fadeUp 0.25s ease;
}

.cancel-confirm-card.active { display: block; }

.cancel-confirm-title {
  font-family: 'Outfit', sans-serif;
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--text-1);
  margin-bottom: 6px;
}

.cancel-confirm-sub {
  font-family: 'Outfit', sans-serif;
  font-size: 0.8rem;
  color: var(--text-2);
  line-height: 1.45;
  margin-bottom: 1rem;
}

.cancel-confirm-row {
  display: flex;
  gap: 10px;
}

.cancel-btn-yes {
  flex: 1;
  padding: 12px;
  background: var(--bg);
  box-shadow: var(--neo-out-sm);
  border: none;
  border-radius: var(--radius-sm);
  font-family: 'Outfit', sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--blue);
  cursor: pointer;
  transition: all 0.2s;
}

.cancel-btn-yes:hover { box-shadow: var(--neo-out); }
.cancel-btn-yes:active { box-shadow: var(--neo-in-sm); }

.cancel-btn-no {
  flex: 1;
  padding: 12px;
  background: var(--bg);
  box-shadow: var(--neo-in-sm);
  border: none;
  border-radius: var(--radius-sm);
  font-family: 'Outfit', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-3);
  cursor: pointer;
  transition: all 0.2s;
}

.cancel-btn-no:hover { color: var(--red); }

/* Action row */
.action-row {
  display: flex;
  gap: 10px;
  align-items: stretch;
}

.btn-cancel {
  background: var(--bg);
  box-shadow: var(--neo-out-xs);
  border: none;
  border-radius: var(--radius-md);
  color: var(--text-3);
  font-family: 'Outfit', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 16px 18px;
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
}

.btn-cancel:active {
  box-shadow: var(--neo-in-sm);
}

/* Check-in / Check-out button */
.checkin-btn {
  flex: 1;
  width: 100%;
  padding: 18px;
  border: none;
  border-radius: var(--radius-md);
  font-family: 'Outfit', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.25s;
  letter-spacing: 0.3px;
}

.checkin-btn--in {
  background: var(--blue);
  color: #fff;
  box-shadow: 4px 4px 12px rgba(27, 107, 170, 0.35), -2px -2px 8px rgba(255, 255, 255, 0.6);
}

.checkin-btn--in:hover:not(:disabled) {
  background: var(--blue-mid);
}

.checkin-btn--in:active:not(:disabled) {
  box-shadow: var(--neo-in-sm);
}

.checkin-btn--in:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.checkin-btn--out {
  background: var(--bg);
  box-shadow: var(--neo-out-sm);
  color: var(--red);
  border: 2px solid rgba(217, 79, 106, 0.4);
}

.checkin-btn--out:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ── CM Job Sheet Bottom Sheet ── */
.checkout-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(26, 58, 92, 0.45);
  z-index: 200;
  align-items: flex-end;
  justify-content: center;
}

.checkout-overlay.open {
  display: flex;
}

.checkout-sheet {
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  background: var(--bg);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  box-shadow: 0 -6px 24px rgba(26, 58, 92, 0.2);
  padding: 1.25rem 1.25rem 2rem;
  transform: translateY(100%);
  transition: transform 0.3s ease;
}

.checkout-overlay.open .checkout-sheet {
  transform: translateY(0);
}

.sheet-handle {
  width: 40px;
  height: 4px;
  background: var(--blue-pale);
  border-radius: 2px;
  margin: 0 auto 1rem;
}

.sheet-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-1);
  margin-bottom: 0.25rem;
  text-align: center;
}
.sheet-sub {
  font-family: 'Outfit', sans-serif;
  font-size: 0.82rem;
  color: var(--text-3);
  text-align: center;
  margin-bottom: 1.25rem;
}

.sheet-section-title {
  font-family: 'Outfit', sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin: 1.25rem 0 0.6rem;
}

.required-star {
  color: var(--red);
}

/* Resolution & Station Status cards */
.resolution-cards,
.station-cards {
  display: grid;
  gap: 8px;
}

.resolution-cards {
  grid-template-columns: repeat(2, 1fr);
}

.station-cards {
  grid-template-columns: repeat(2, 1fr);
}

.resolution-card,
.station-card {
  background: var(--bg);
  box-shadow: var(--neo-out-xs);
  border-radius: var(--radius-sm);
  padding: 10px 6px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  border: 2px solid transparent;
}

.resolution-card:active,
.station-card:active {
  box-shadow: var(--neo-in-sm);
}

.resolution-card.selected,
.station-card.selected {
  box-shadow: inset 1px 1px 3px var(--shadow-d), 0 0 0 1.5px var(--blue);
  background: var(--bg);
}

.res-icon {
  font-size: 1.3rem;
  margin-bottom: 4px;
}

.res-label {
  font-family: 'Outfit', sans-serif;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-2);
}

/* Select dropdown */
.input-select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%237AAABF' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

/* TomSelect — match Arctic Frost input sizing */
.ts-wrapper {
  min-height: auto !important;
  padding: 0 !important;
}
.ts-wrapper .ts-control {
  padding: 12px 16px !important;
  background: var(--bg) !important;
  box-shadow: var(--neo-in-input) !important;
  border: none !important;
  border-radius: var(--radius-sm) !important;
  color: var(--text-1) !important;
  font-family: 'Outfit', sans-serif !important;
  font-size: 0.9rem !important;
  line-height: 1.4 !important;
}
.ts-wrapper.focus .ts-control {
  box-shadow: var(--neo-in-input), 0 0 0 2px rgba(27, 107, 170, 0.2) !important;
}
.ts-wrapper .ts-control > input {
  font-family: 'Outfit', sans-serif !important;
  font-size: 0.9rem !important;
  color: var(--text-1) !important;
}
.ts-wrapper.single .ts-control {
  background-image: none !important;
}
.ts-wrapper.single .ts-control:after {
  border-color: var(--text-3) transparent transparent !important;
  right: 14px !important;
}
.ts-wrapper.single.dropdown-active .ts-control:after {
  border-color: transparent transparent var(--text-3) !important;
}
.ts-dropdown {
  border-radius: var(--radius-sm) !important;
  border: 1px solid rgba(27, 107, 170, 0.15) !important;
  box-shadow: var(--neo-out-sm) !important;
  background: var(--bg) !important;
  font-family: 'Outfit', sans-serif !important;
  font-size: 0.85rem !important;
}
.ts-dropdown .option {
  padding: 8px 12px !important;
  color: var(--text-1) !important;
}
.ts-dropdown .active {
  background: var(--blue-tint) !important;
  color: var(--blue) !important;
}
.ts-wrapper.disabled .ts-control {
  opacity: 0.5 !important;
  background: var(--bg2) !important;
}

/* Textarea */
.input-textarea {
  resize: vertical;
  min-height: 70px;
}

/* Parts toggle */
.parts-toggle-row {
  display: flex;
  gap: 8px;
  margin-bottom: 0.5rem;
}

.parts-toggle-btn {
  flex: 1;
  padding: 10px;
  border: none;
  border-radius: var(--radius-sm);
  font-family: 'Outfit', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  background: var(--bg);
  box-shadow: var(--neo-out-xs);
  color: var(--text-3);
  transition: all 0.2s;
}

.parts-toggle-btn--active {
  background: var(--blue-tint);
  color: var(--blue);
  box-shadow: var(--neo-in-sm);
}

/* Part rows */
.parts-container {
  background: var(--bg2);
  border-radius: var(--radius-sm);
  padding: 10px;
  margin-top: 6px;
}

.part-row {
  display: grid;
  grid-template-columns: 1fr 1fr 56px auto;
  gap: 6px;
  align-items: center;
  margin-bottom: 8px;
}

/* tom-select replaces the part <select> — keep it inside its 1fr grid track */
.part-row .ts-wrapper { min-width: 0; }
.part-row .ts-wrapper.single .ts-control .item {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.part-remove-btn {
  background: none;
  border: none;
  color: var(--red);
  font-size: 0.85rem;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: var(--radius-xs);
  line-height: 1;
}

.add-part-btn {
  width: 100%;
  margin-top: 4px;
  padding: 9px;
  border: 2px dashed var(--blue-pale);
  border-radius: var(--radius-sm);
  background: none;
  color: var(--blue-mid);
  font-family: 'Outfit', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.add-part-btn:hover {
  background: var(--blue-tint);
  border-color: var(--blue);
}

/* ── KPI BAR ── */
.manager-body { padding: 1.2rem; }
.hr-body { padding: 1.2rem; }
.kpi-bar { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; margin-bottom: 1.2rem; }
.kpi-card { display: block; text-decoration: none; color: inherit; background: var(--bg); box-shadow: var(--neo-out-sm); border-radius: var(--radius-md); padding: 0.875rem 0.5rem; text-align: center; cursor: pointer; transition: box-shadow 0.15s; }
.kpi-card:hover { box-shadow: var(--neo-out); }
.kpi-card--active { box-shadow: var(--neo-out-sm), 0 0 0 2px var(--blue); }
.kpi-card--warn { box-shadow: var(--neo-out-sm), 0 0 0 2px var(--red); }
.kpi-big { font-size: 1.5rem; font-weight: 700; font-family: 'DM Mono', monospace; line-height: 1; color: var(--blue); }
.kpi-big--warn { color: var(--red); }
.kpi-sub { font-size: 0.6rem; color: var(--text-3); margin-top: 4px; text-transform: uppercase; letter-spacing: 0.8px; }
.kpi-meta { font-size: 0.6rem; color: var(--text-3); margin-top: 2px; }

/* ── FIELD SECTION (Live Worker List) ── */
.field-section { margin-top: 0.5rem; }
.field-summary { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; margin-bottom: 1.2rem; }

.field-group-title {
  font-family: 'Outfit', sans-serif;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin: 1rem 0 0.5rem;
}

.worker-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 0.5rem; }

.worker-row {
  background: var(--bg);
  box-shadow: var(--neo-out-sm);
  border-radius: var(--radius-md);
  padding: 0.75rem 0.9rem;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: box-shadow 0.15s ease;
}
.worker-row:active { box-shadow: var(--neo-in-sm); }

.worker-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bg);
  box-shadow: var(--neo-in-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}
.worker-avatar img { width: 100%; height: 100%; object-fit: cover; }
.worker-avatar-initials {
  font-family: 'Outfit', sans-serif;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--blue);
}

.worker-info { flex: 1; min-width: 0; }
.worker-name {
  font-family: 'Outfit', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-1);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.worker-flag { font-size: 0.8rem; }
.worker-ot {
  background: var(--red);
  color: #fff;
  font-size: 0.6rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: var(--radius-xs);
  letter-spacing: 0.5px;
}
.worker-task {
  font-family: 'Outfit', sans-serif;
  font-size: 0.72rem;
  color: var(--text-2);
  margin-top: 2px;
}

.worker-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex-shrink: 0; }
.worker-elapsed { font-family: 'DM Mono', monospace; font-size: 0.7rem; color: var(--text-2); }
.worker-status {
  font-family: 'Outfit', sans-serif;
  font-size: 0.6rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-xs);
  letter-spacing: 0.5px;
}
.worker-status--in { background: var(--blue-tint); color: var(--blue); }
.worker-status--out { background: var(--bg2); color: var(--text-3); }

.worker-empty {
  text-align: center;
  color: var(--text-3);
  font-family: 'Outfit', sans-serif;
  font-size: 0.85rem;
  padding: 2rem 1rem;
  background: var(--bg);
  box-shadow: var(--neo-in-sm);
  border-radius: var(--radius-md);
}

/* ── Worker Detail Modal ── */
.worker-modal-sub {
  font-family: 'Outfit', sans-serif;
  font-size: 0.8rem;
  color: var(--text-2);
  text-align: center;
  margin-top: -0.75rem;
  margin-bottom: 1rem;
}

.worker-modal-photos {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 1rem;
}
.worker-modal-photo {
  background: var(--bg);
  box-shadow: var(--neo-in-sm);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.worker-modal-photo img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; }
.worker-modal-photo-caption {
  padding: 4px 6px; width: 100%; text-align: center;
  font-family: 'Outfit', sans-serif; font-size: 0.62rem; color: var(--text-3);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.worker-modal-photo-placeholder { font-size: 1.75rem; color: var(--text-3); }
.worker-modal-photos-label {
  font-family: 'Outfit', sans-serif;
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 0.3rem;
}

.worker-detail-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 8px 4px;
  border-bottom: 1px solid var(--bg2);
  font-family: 'Outfit', sans-serif;
  font-size: 0.82rem;
}
.worker-detail-row:last-child { border-bottom: none; }
.worker-detail-key { color: var(--text-3); flex-shrink: 0; }
.worker-detail-val { color: var(--text-1); text-align: right; max-width: 60%; word-break: break-word; }
.worker-detail-val.mono { font-family: 'DM Mono', monospace; font-size: 0.75rem; }
a.worker-gps-link, a.site-gps-link { color: var(--blue); text-decoration: none; }
a.worker-gps-link:hover, a.site-gps-link:hover { text-decoration: underline; }

.worker-jobsheet-block {
  margin-top: 1rem;
  padding: 0.9rem;
  background: var(--bg);
  box-shadow: var(--neo-in-sm);
  border-radius: var(--radius-md);
}
.worker-jobsheet-title {
  font-family: 'Outfit', sans-serif;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-1);
  margin-bottom: 0.5rem;
}
.worker-jobsheet-subtitle {
  font-family: 'Outfit', sans-serif;
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin: 0.6rem 0 0.3rem;
}
.bss-badge {
  display: inline-block; font-size: 0.55rem; padding: 1px 6px; border-radius: 6px;
  background: rgba(201, 138, 0, 0.12); color: var(--yellow);
  font-family: 'DM Mono', monospace; font-weight: 700; letter-spacing: 0.5px;
  margin-left: 6px; vertical-align: middle;
}
.worker-modal-after-photo { margin-top: 0.6rem; }
.worker-modal-after-photo img {
  width: 100%;
  border-radius: var(--radius-sm);
  box-shadow: var(--neo-in-sm);
}

.worker-jobsheet-pending {
  margin-top: 1rem;
  padding: 0.75rem;
  background: var(--bg);
  box-shadow: var(--neo-in-sm);
  border-radius: var(--radius-sm);
  font-family: 'Outfit', sans-serif;
  font-size: 0.78rem;
  color: var(--yellow);
  text-align: center;
}

.worker-modal-close {
  width: 100%;
  margin-top: 1.25rem;
  padding: 0.85rem;
  background: var(--bg);
  box-shadow: var(--neo-out-sm);
  border: none;
  border-radius: var(--radius-md);
  font-family: 'Outfit', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-2);
  cursor: pointer;
}
.worker-modal-close:active { box-shadow: var(--neo-in-sm); }

/* Cancel / Complete pair on a still-checked-in record */
.worker-modal-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 1.25rem;
}

/* Manager's reason inside the job sheet block — above a sheet, or in place of one */
.worker-jobsheet-note { margin-bottom: 0.75rem; }
.worker-modal-note-label {
  font-family: 'Outfit', sans-serif;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-3);
  margin-bottom: 3px;
}
.worker-modal-note-text {
  font-family: 'Outfit', sans-serif;
  font-size: 0.85rem;
  color: var(--text-1);
  line-height: 1.45;
}

/* ─────────────────────────────────────── */
/* PM JOB SHEET                           */
/* ─────────────────────────────────────── */

.evcs-capsule-row { display: flex; justify-content: flex-end; margin-bottom: 0.6rem; }
.evcs-capsule {
  display: inline-flex; align-items: center; gap: 5px; padding: 4px 12px;
  background: var(--bg); box-shadow: var(--neo-out-xs);
  border-radius: 999px;
  color: var(--blue-mid); font-family: 'DM Mono', monospace;
  font-size: 0.68rem; font-weight: 700; letter-spacing: 1.5px;
  border: 1px solid rgba(255,255,255,0.8);
  text-transform: uppercase;
}
.evcs-capsule::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%;
  background: var(--blue-mid); animation: pulse 1.5s infinite;
}
.bss-capsule {
  display: inline-flex; align-items: center; gap: 5px; padding: 4px 12px;
  background: var(--bg); box-shadow: var(--neo-out-xs);
  border-radius: 999px;
  color: #00BFFF; font-family: 'DM Mono', monospace;
  font-size: 0.68rem; font-weight: 700; letter-spacing: 1.5px;
  border: 1px solid rgba(255,255,255,0.8);
  text-transform: uppercase;
}
.bss-capsule::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%;
  background: #00BFFF; animation: pulse 1.5s infinite;
}

/* BSS Slot Function Test */
.bss-slot-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.bss-slot-card { background: var(--bg); box-shadow: var(--neo-in-sm); border-radius: var(--radius-sm); overflow: hidden; }
.bss-slot-head {
  padding: 10px 12px; display: flex; align-items: center; gap: 8px;
  cursor: pointer; user-select: none; transition: background 0.2s;
}
.bss-slot-head:hover { background: rgba(27,107,170,0.04); }
.bss-slot-num {
  width: 28px; height: 28px; border-radius: 8px;
  background: rgba(27,107,170,0.1); border: 1px solid rgba(27,107,170,0.25);
  display: flex; align-items: center; justify-content: center;
  font-family: 'DM Mono', monospace; font-size: 0.68rem; font-weight: 700;
  color: var(--blue-mid); flex-shrink: 0; transition: all 0.2s;
}
.bss-slot-num.tested-ok {
  background: rgba(0,196,140,0.12); border-color: rgba(0,196,140,0.3); color: #00C48C;
}
.bss-slot-num.tested-fail {
  background: rgba(217,79,106,0.12); border-color: rgba(217,79,106,0.3); color: var(--red);
}
.bss-slot-label { font-size: 0.78rem; font-weight: 600; flex: 1; color: var(--text-1); }
.bss-slot-status { font-size: 0.63rem; color: var(--text-3); font-family: 'DM Mono', monospace; }
.bss-slot-body { display: none; padding: 0 10px 10px; border-top: 1px solid rgba(0,0,0,0.04); }
.bss-slot-body.open { display: block; }
.bss-slot-field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: 8px 0; }
.bss-slot-field { display: flex; flex-direction: column; gap: 3px; }
.bss-slot-field-label { font-size: 0.6rem; color: var(--text-3); letter-spacing: 0.8px; text-transform: uppercase; font-weight: 600; }
.bss-slot-field-input {
  padding: 7px 8px; background: var(--bg); box-shadow: var(--neo-in-sm);
  border: none; border-radius: var(--radius-xs);
  color: var(--text-1); font-family: 'DM Mono', monospace; font-size: 0.78rem;
  text-align: center; outline: none; width: 100%;
}
.bss-slot-field-input:focus { box-shadow: var(--neo-in-sm), 0 0 0 2px #00BFFF; }
.bss-ejection-label { font-size: 0.64rem; color: var(--text-3); letter-spacing: 0.8px; text-transform: uppercase; font-weight: 600; margin-bottom: 5px; }
.bss-ejection-row { display: flex; gap: 6px; }
.bss-eject-btn {
  flex: 1; padding: 6px 4px; background: var(--bg); box-shadow: var(--neo-out-xs);
  border: none; border-radius: var(--radius-xs);
  color: var(--text-3); font-family: 'Outfit', sans-serif; font-size: 0.72rem;
  font-weight: 600; cursor: pointer; transition: all 0.2s;
}
.bss-eject-btn.sel-ok { box-shadow: var(--neo-in-sm); color: #00C48C; }
.bss-eject-btn.sel-fail { box-shadow: var(--neo-in-sm); color: var(--red); }
.pm-header-row {
  display: flex; justify-content: space-between; align-items: flex-start;
  margin-bottom: 1rem; gap: 12px;
}
.pm-header-row .sheet-title { text-align: left; margin-bottom: 0.2rem; }
.pm-header-row .sheet-sub { text-align: left; margin-bottom: 0; }

.pm-record-header {
  display: flex; justify-content: space-between; align-items: center;
  gap: 12px; margin-bottom: 4px;
}
.pm-doc-id-label { font-size: 0.6rem; color: var(--text-3); letter-spacing: 0.8px; text-transform: uppercase; font-weight: 600; }
.pm-doc-id-pill-wrap { display: flex; justify-content: flex-end; margin-bottom: 0.8rem; }

.pm-charger-group, .pm-charger-panel {
  padding: 10px 12px; margin-bottom: 8px;
  background: var(--bg); box-shadow: var(--neo-out-xs);
  border-radius: var(--radius-sm);
}
.pm-charger-title {
  font-family: 'Outfit', sans-serif; font-size: 0.72rem; font-weight: 600;
  color: var(--text-2); margin-bottom: 8px; text-transform: uppercase; letter-spacing: 0.8px;
}

.connectivity-toggle { display: flex; gap: 6px; }
.connectivity-pill {
  flex: 1; padding: 8px 12px; border: none; cursor: pointer;
  background: var(--bg); box-shadow: var(--neo-out-xs);
  border-radius: var(--radius-xs);
  font-family: 'DM Mono', monospace; font-size: 0.72rem; font-weight: 600;
  color: var(--text-3); letter-spacing: 1px; text-transform: uppercase;
  transition: all 0.2s;
}
.connectivity-pill.active {
  box-shadow: var(--neo-in-sm);
  color: var(--blue); background: var(--blue-tint);
}

.pm-impl-auto {
  display: flex; align-items: center; gap: 8px; padding: 9px 14px;
  background: var(--bg); box-shadow: var(--neo-in-sm);
  border-radius: var(--radius-xs);
  color: var(--text-1); font-family: 'Outfit', sans-serif; font-size: 0.85rem; font-weight: 600;
  margin-bottom: 1rem;
}
.impl-icon { font-size: 1rem; }
.impl-name { flex: 1; }
.impl-tag { font-size: 0.6rem; color: var(--blue-mid); background: var(--blue-tint); padding: 2px 6px; border-radius: 10px; letter-spacing: 0.5px; font-family: 'DM Mono', monospace; }

.pm-doc-id-pill {
  padding: 4px 10px;
  background: var(--bg); box-shadow: var(--neo-in-sm);
  border-radius: var(--radius-xs);
  color: var(--blue); font-family: 'DM Mono', monospace; font-size: 0.68rem; font-weight: 700;
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  display: flex; align-items: center; gap: 5px;
}

.pm-meta-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 1rem; }
.pm-meta-row { display: flex; flex-direction: column; gap: 4px; margin-bottom: 8px; }
.pm-meta-label { font-size: 0.64rem; color: var(--text-3); letter-spacing: 0.8px; text-transform: uppercase; font-weight: 600; }
.pm-meta-readonly {
  padding: 9px 12px;
  background: var(--bg); box-shadow: var(--neo-in-sm);
  border-radius: var(--radius-xs);
  color: var(--text-1); font-family: 'Outfit', sans-serif; font-size: 0.82rem;
  display: flex; align-items: center; gap: 6px;
}
.pm-meta-readonly .auto-tag { margin-left: auto; }
.pm-meta-input {
  padding: 9px 12px;
  background: var(--bg); box-shadow: var(--neo-in-sm);
  border: none; border-radius: var(--radius-xs);
  color: var(--text-1); font-family: 'DM Mono', monospace; font-size: 0.76rem;
  outline: none; width: 100%;
}
.pm-meta-input:focus { box-shadow: var(--neo-in-sm), 0 0 0 2px rgba(27,107,170,0.2); }
.pm-meta-input::placeholder { color: var(--text-3); }
.pm-meta-input option { background: #d6e8f5; color: var(--text-1); }

.auto-tag {
  font-size: 0.6rem; color: var(--blue-mid);
  background: var(--blue-tint); padding: 2px 6px; border-radius: 8px;
  letter-spacing: 0.5px; font-family: 'DM Mono', monospace;
}

.pm-progress-wrap { margin-bottom: 1.2rem; }
.pm-progress-label { display: flex; justify-content: space-between; font-size: 0.72rem; color: var(--text-2); margin-bottom: 7px; }
.pm-prog-pct { color: var(--blue); font-weight: 700; font-family: 'DM Mono', monospace; }
.pm-progress-bar { height: 8px; background: var(--bg); box-shadow: var(--neo-in-sm); border-radius: 6px; overflow: hidden; }
.pm-progress-fill { height: 100%; background: linear-gradient(90deg, var(--blue), var(--blue-pale)); border-radius: 6px; transition: width 0.35s; }

.pm-findings-summary {
  background: var(--bg); box-shadow: var(--neo-in-sm);
  border-radius: var(--radius-sm);
  padding: 10px 14px; margin-bottom: 1rem;
  display: none;
  border-left: 3px solid var(--yellow);
}
.pm-findings-summary.show { display: block; }
.pm-findings-title { font-size: 0.74rem; font-weight: 700; color: var(--yellow); margin-bottom: 4px; }
.pm-findings-list { font-size: 0.74rem; color: var(--text-1); line-height: 1.55; }

.pm-section-group { background: var(--bg); box-shadow: var(--neo-out-sm); border-radius: var(--radius-md); margin-bottom: 10px; overflow: hidden; border: 1px solid rgba(255,255,255,0.7); }
.pm-section-head { padding: 0.9rem 1.1rem; display: flex; align-items: center; gap: 10px; cursor: pointer; transition: background 0.2s; user-select: none; }
.pm-section-head:hover { background: rgba(27,107,170,0.04); }
.pm-section-icon { width: 32px; height: 32px; border-radius: var(--radius-xs); background: var(--bg); box-shadow: var(--neo-out-xs); display: flex; align-items: center; justify-content: center; font-size: 0.95rem; flex-shrink: 0; }
.pm-section-name { font-weight: 600; font-size: 0.85rem; color: var(--text-1); flex: 1; }
.pm-section-count { font-size: 0.7rem; color: var(--text-3); font-family: 'DM Mono', monospace; }
.pm-section-chev { color: var(--text-3); font-size: 0.7rem; transition: transform 0.2s; margin-left: 6px; }
.pm-section-body { display: none; }
.pm-section-body.open { display: block; }
.pm-item { padding: 0.9rem 1.1rem; border-top: 1px solid rgba(189,208,228,0.40); }
.pm-item:last-child { border: none; }
.pm-item-title { font-size: 0.83rem; font-weight: 500; margin-bottom: 4px; color: var(--text-1); }
.pm-item-desc { font-size: 0.72rem; color: var(--text-3); line-height: 1.4; margin-bottom: 8px; }

.pm-result-row { display: flex; gap: 6px; }
.pm-result-btn {
  flex: 1; padding: 8px 4px;
  background: var(--bg); box-shadow: var(--neo-out-xs);
  border: none; border-radius: var(--radius-xs);
  color: var(--text-3); font-family: 'Outfit', sans-serif; font-size: 0.72rem; font-weight: 600;
  transition: all 0.2s; cursor: pointer;
}
.pm-result-btn:hover { box-shadow: var(--neo-out-sm); }
.pm-result-btn.sel-ok   { box-shadow: var(--neo-in-sm), 0 0 0 1.5px var(--blue);   color: var(--blue); }
.pm-result-btn.sel-na   { box-shadow: var(--neo-in-sm), 0 0 0 1.5px var(--text-3); color: var(--text-2); }
.pm-result-btn.sel-fail { box-shadow: var(--neo-in-sm), 0 0 0 1.5px var(--red);    color: var(--red); }

.pm-item-note { width: 100%; margin-top: 6px; padding: 8px 10px; background: var(--bg); box-shadow: var(--neo-in-sm); border: none; border-radius: var(--radius-xs); color: var(--text-1); font-family: 'Outfit', sans-serif; font-size: 0.78rem; outline: none; display: none; }
.pm-item-note.show { display: block; }
.pm-item-note:focus { box-shadow: var(--neo-in-sm), 0 0 0 2px rgba(27,107,170,0.2); }
.pm-fail-label {
  margin-bottom: 3px; padding-left: 2px;
  font-family: 'Outfit', sans-serif; font-size: 0.72rem; font-weight: 500;
  color: var(--text-2);
}

.pm-submit-errors {
  margin: 0.8rem 1.1rem 0.8rem; padding: 10px 14px;
  background: rgba(217, 79, 106, 0.06);
  border: 1px solid rgba(217, 79, 106, 0.25);
  border-radius: var(--radius-sm);
  font-family: 'Outfit', sans-serif; font-size: 0.75rem; color: var(--red);
}
.pm-submit-errors-title { font-weight: 600; margin-bottom: 4px; }
.pm-submit-error-item { padding-left: 4px; line-height: 1.5; }


.pm-section-note-label { font-size: 0.64rem; color: var(--text-3); letter-spacing: 0.8px; text-transform: uppercase; font-weight: 600; margin: 10px 0 5px; }
.pm-section-note { width: 100%; padding: 8px 10px; background: var(--bg); box-shadow: var(--neo-in-sm); border: none; border-radius: var(--radius-xs); color: var(--text-1); font-family: 'Outfit', sans-serif; font-size: 0.78rem; outline: none; resize: none; min-height: 50px; }
.pm-section-note:focus { box-shadow: var(--neo-in-sm), 0 0 0 2px rgba(27,107,170,0.2); }

.pm-voltage-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px; margin-top: 6px; margin-bottom: 1.2rem; }
.pm-voltage-cell { padding: 8px; background: var(--bg); box-shadow: var(--neo-in-sm); border-radius: var(--radius-xs); }
.pm-voltage-label { font-size: 0.62rem; color: var(--text-3); margin-bottom: 4px; text-align: center; }
.pm-voltage-input { width: 100%; padding: 5px; background: transparent; border: none; color: var(--text-1); font-family: 'DM Mono', monospace; font-size: 0.78rem; text-align: center; outline: none; }

.pm-photo-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; margin-bottom: 1.2rem; }
.pm-photo-slot { display: flex; flex-direction: column; gap: 4px; }
.pm-photo-box {
  background: var(--bg); box-shadow: var(--neo-in-sm);
  border-radius: var(--radius-sm); padding: 0.6rem; text-align: center;
  position: relative; overflow: hidden; min-height: 78px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  transition: all 0.2s; cursor: pointer;
}
.pm-photo-box:hover { box-shadow: var(--neo-in-sm), 0 0 0 1.5px rgba(27,107,170,0.3); }
.pm-photo-box.captured { box-shadow: var(--neo-in-sm), 0 0 0 1.5px var(--blue); background-size: cover; background-position: center; }
.pm-photo-box img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: var(--radius-sm); opacity: 0.7; }
.pm-photo-icon { font-size: 1.1rem; position: relative; z-index: 1; }
.pm-photo-label { font-size: 0.6rem; color: var(--text-3); line-height: 1.2; text-align: center; }
.pm-photo-badge { position: absolute; bottom: 3px; right: 3px; background: var(--blue); color: #fff; border-radius: 50%; width: 16px; height: 16px; font-size: 0.6rem; font-weight: 700; display: flex; align-items: center; justify-content: center; z-index: 2; }

/* ── Photo Upload States ──────────────────────────────────────────── */
.photo-spinner { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,0.35); border-radius: var(--radius-sm); z-index: 3; }
.photo-spinner[hidden] { display: none; }
.photo-spinner::after { content: ""; width: 24px; height: 24px; border: 3px solid rgba(255,255,255,0.3); border-top-color: #fff; border-radius: 50%; animation: photo-spin 0.8s linear infinite; }
@keyframes photo-spin { to { transform: rotate(360deg); } }
.photo-uploading { pointer-events: none; opacity: 0.7; }
.photo-error { box-shadow: var(--neo-in-sm), 0 0 0 1.5px #e53935 !important; }
.photo-error-msg { font-size: 0.6rem; color: #e53935; line-height: 1.2; text-align: center; margin-top: 2px; }
.photo-error-retry { font-size: 0.55rem; color: var(--blue); cursor: pointer; text-decoration: underline; background: none; border: none; padding: 0; margin-top: 2px; }
.photo-uploaded .pm-photo-badge { background: #43a047; }

/* ── ATP Charger Tabs ─────────────────────────────────────────────── */
.atp-charger-tabs-wrap { margin-bottom: 1rem; background: var(--bg); box-shadow: var(--neo-in-sm); border-radius: var(--radius-md); padding: 10px; }
.atp-charger-tabs-label { font-size: 0.62rem; color: var(--text-3); letter-spacing: 1px; text-transform: uppercase; font-weight: 600; margin-bottom: 8px; display: flex; justify-content: space-between; align-items: center; }
.atp-charger-count { color: var(--blue-mid); font-family: 'DM Mono', monospace; }
.atp-charger-tabs { display: flex; gap: 6px; overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 4px; }
.atp-charger-tab { flex-shrink: 0; padding: 8px 12px; background: var(--bg); box-shadow: var(--neo-out-xs); border: none; border-radius: var(--radius-xs); color: var(--text-3); font-family: 'Outfit', sans-serif; font-size: 0.78rem; font-weight: 500; white-space: nowrap; display: flex; align-items: center; gap: 6px; transition: all 0.2s; cursor: pointer; }
.atp-charger-tab:hover { box-shadow: var(--neo-out-sm); }
.atp-charger-tab.active { box-shadow: var(--neo-in-sm), 0 0 0 1.5px var(--blue); color: var(--blue); font-weight: 700; }
.charger-status-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--text-3); flex-shrink: 0; }
.atp-charger-tab.complete .charger-status-dot { background: var(--blue); }
.atp-charger-tab.partial .charger-status-dot { background: var(--yellow); }
.atp-charger-tab.fail .charger-status-dot { background: var(--red); }
.atp-charger-remove {
  margin-left: 4px; font-size: 0.65rem; color: var(--text-3);
  cursor: pointer; padding: 0 2px; border-radius: 3px; line-height: 1;
}
.atp-charger-remove:hover { color: var(--red); background: rgba(217, 79, 106, 0.1); }
.atp-charger-add { flex-shrink: 0; padding: 8px 12px; background: transparent; border: 2px dashed rgba(189,208,228,0.7); border-radius: var(--radius-xs); color: var(--text-3); font-family: 'Outfit', sans-serif; font-size: 0.78rem; font-weight: 500; transition: all 0.2s; white-space: nowrap; cursor: pointer; margin-top: 6px; width: 100%; }
.atp-charger-add:hover { border-color: var(--blue); color: var(--blue-mid); }

/* ── ATP BSS Tab Variant ──────────────────────────────────────── */
.atp-charger-tab.bss-tab { border-left: 3px solid var(--yellow); }
.atp-charger-tab.bss-tab.active { box-shadow: var(--neo-in-sm), 0 0 0 1.5px var(--yellow); color: var(--yellow); }
.atp-charger-tab.bss-tab .charger-status-dot { background: rgba(201, 138, 0, 0.5); }
.atp-charger-tab.bss-tab.complete .charger-status-dot { background: var(--yellow); }
.atp-charger-tab.bss-tab.fail .charger-status-dot { background: var(--red); }
.atp-charger-tab.bss-tab.partial .charger-status-dot { background: rgba(201, 138, 0, 0.7); }
.bss-tab-badge {
  font-size: 0.55rem; padding: 1px 5px; border-radius: 6px;
  background: rgba(201, 138, 0, 0.12); color: var(--yellow);
  font-family: 'DM Mono', monospace; font-weight: 700; letter-spacing: 0.5px;
}

/* ── ATP Per-Item Attachment Buttons ─────────────────────────────── */
.pm-attach-row { display: flex; gap: 6px; margin-top: 8px; }
.pm-attach-btn { flex: 1; padding: 7px 8px; background: var(--bg); box-shadow: var(--neo-out-xs); border: none; border-radius: var(--radius-xs); color: var(--text-3); font-family: 'Outfit', sans-serif; font-size: 0.7rem; font-weight: 500; display: flex; align-items: center; justify-content: center; gap: 5px; transition: all 0.2s; cursor: pointer; }
.pm-attach-btn:hover { box-shadow: var(--neo-out-sm); color: var(--blue-mid); }
.pm-attach-btn.has-files { box-shadow: var(--neo-in-sm), 0 0 0 1.5px var(--blue); color: var(--blue); font-weight: 600; }
.attach-count { font-family: 'DM Mono', monospace; font-size: 0.66rem; background: var(--blue-tint); padding: 1px 5px; border-radius: 8px; color: var(--blue-mid); }

/* ── ATP Conclusion Cards ────────────────────────────────────────── */
.conclusion-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 1.2rem; }
.conclusion-card { padding: 16px 10px; background: var(--bg); box-shadow: var(--neo-out-xs); border-radius: var(--radius-md); text-align: center; cursor: pointer; transition: all 0.2s; border: 1px solid rgba(255,255,255,0.6); }
.conclusion-card:hover { box-shadow: var(--neo-out-sm); }
.conclusion-icon { font-size: 1.6rem; margin-bottom: 6px; }
.conclusion-label { font-size: 0.9rem; font-weight: 700; color: var(--text-2); }
.conclusion-card--pass.selected { box-shadow: var(--neo-in-sm), 0 0 0 2px var(--blue); }
.conclusion-card--pass.selected .conclusion-label { color: var(--blue); }
.conclusion-card--fail.selected { box-shadow: var(--neo-in-sm), 0 0 0 2px var(--red); }
.conclusion-card--fail.selected .conclusion-label { color: var(--red); }
.conclusion-card.disabled { opacity: 0.4; pointer-events: none; cursor: not-allowed; }

/* ─────────────────────────────────────── */
/* MANAGER TABS                           */
/* ─────────────────────────────────────── */

.mgr-tabs {
  display: flex;
  gap: 5px;
  background: var(--bg2);
  box-shadow: var(--neo-in-sm);
  border-radius: var(--radius-sm);
  padding: 4px;
  margin-bottom: 1.2rem;
}
.mgr-tab {
  flex: 1;
  padding: 9px 4px;
  border: none;
  background: transparent;
  color: var(--text-3);
  border-radius: var(--radius-xs);
  cursor: pointer;
  font-family: 'Outfit', sans-serif;
  font-size: 0.72rem;
  font-weight: 500;
  text-align: center;
  text-decoration: none;
  position: relative;
  transition: all 0.2s;
  display: block;
}
.mgr-tab--active {
  background: var(--blue);
  color: #fff;
  font-weight: 700;
  box-shadow: var(--neo-out-xs);
}
.mgr-tab--disabled {
  opacity: 0.4;
  cursor: default;
  pointer-events: none;
}
.tab-badge {
  position: absolute;
  top: -3px;
  right: -3px;
  background: var(--red);
  color: #fff;
  border-radius: 50%;
  width: 15px;
  height: 15px;
  font-size: 0.55rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mgr-section-label {
  font-family: 'Outfit', sans-serif;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-3);
  margin: 1.2rem 0 0.6rem;
}
.mgr-section-label--acked { opacity: 0.6; }

/* ─────────────────────────────────────── */
/* ESCALATION CARDS (esc-card)            */
/* ─────────────────────────────────────── */

.esc-list { display: flex; flex-direction: column; gap: 10px; }

.esc-empty {
  text-align: center;
  padding: 2.5rem 1rem;
  background: var(--bg);
  box-shadow: var(--neo-in-sm);
  border-radius: var(--radius-md);
  font-family: 'Outfit', sans-serif;
  font-size: 0.9rem;
  color: var(--text-2);
}

.esc-card {
  background: var(--bg);
  border: 1px solid var(--red);
  border-radius: var(--radius-md);
  padding: 1rem 1.1rem;
  position: relative;
}
.esc-card--acked {
  border-color: var(--shadow-d);
  opacity: 0.65;
}

/* Header row: dot · name · time */
.esc-header {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 5px;
}
.esc-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--red);
  flex-shrink: 0;
  animation: esc-pulse 1.5s ease-in-out infinite;
}
.esc-card--acked .esc-dot {
  background: var(--text-3);
  animation: none;
}
@keyframes esc-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.75); }
}
.esc-name {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--text-1);
  flex: 1;
}
.esc-time {
  font-family: 'DM Mono', monospace;
  font-size: 0.68rem;
  color: var(--text-3);
  white-space: nowrap;
}

.esc-site {
  font-family: 'Outfit', sans-serif;
  font-size: 0.76rem;
  color: var(--text-2);
  margin-bottom: 7px;
}
.esc-location {
  font-family: 'Outfit', sans-serif;
  font-size: 0.72rem;
  color: var(--text-3);
  margin-top: -3px;
  margin-bottom: 7px;
}
.esc-coords {
  font-family: 'DM Mono', monospace;
  font-size: 0.68rem;
  color: var(--text-3);
  margin-top: -4px;
  margin-bottom: 7px;
}
.esc-fault {
  font-family: 'Outfit', sans-serif;
  font-size: 0.82rem;
  color: var(--text-1);
  line-height: 1.45;
  margin-bottom: 10px;
}
.esc-location {
  font-size: 0.7rem;
  color: var(--text-3);
  font-weight: 400;
}
/* Meta row — Review beside Job Sheet History on an acknowledged card, which
   has no action row to carry the button. */
.esc-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}
.esc-meta-link {
  font-family: 'Outfit', sans-serif;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--blue);
  background: none;
  border: none;
  padding: 0;
  border-radius: var(--radius-xs);
  cursor: pointer;
  text-decoration: none;
  transition: color 0.15s;
}
.esc-meta-link:hover { color: var(--blue-mid); }
.esc-meta-link:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(27, 107, 170, 0.3);
}
.esc-meta-sep {
  width: 1px;
  height: 11px;
  background: var(--shadow-d);
  flex-shrink: 0;
}

/* Escalated fault, restated at the top of the Review pop-up */
.review-fault {
  margin: 0.75rem 0 0.25rem;
  padding: 0.6rem 0.7rem;
  background: var(--bg);
  box-shadow: var(--neo-in-sm);
  border-radius: var(--radius-sm);
  font-family: 'Outfit', sans-serif;
  font-size: 0.78rem;
  line-height: 1.45;
  color: var(--text-1);
}
.review-fault-label {
  display: block;
  margin-bottom: 3px;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--red);
}

.esc-history {
  margin-bottom: 10px;
}
.esc-history-link {
  font-family: 'Outfit', sans-serif;
  font-size: 0.72rem;
  color: var(--blue);
  text-decoration: none;
  transition: color 0.15s;
}
.esc-history-link:hover {
  color: var(--blue-mid);
  text-decoration: underline;
}
.esc-ack-note {
  font-family: 'Outfit', sans-serif;
  font-size: 0.76rem;
  color: var(--text-2);
  font-style: italic;
}

/* Action buttons row */
.esc-actions {
  display: flex;
  gap: 8px;
  width: 100%;
}
.btn-ack {
  flex: 1;
  padding: 8px;
  background: var(--blue);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-family: 'Outfit', sans-serif;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
}
.btn-ack:active { box-shadow: var(--neo-in-sm); opacity: 0.9; }

.btn-cancel {
  flex: 1;
  padding: 8px;
  background: transparent;
  color: var(--text-3);
  border: 1px solid var(--shadow-d);
  border-radius: var(--radius-sm);
  font-family: 'Outfit', sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.btn-cancel:active { color: var(--text-1); }

.btn-redeploy {
  flex: 1;
  padding: 8px;
  background: transparent;
  color: var(--yellow);
  border: 1px solid var(--yellow);
  border-radius: var(--radius-sm);
  font-family: 'Outfit', sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.btn-redeploy:active { background: rgba(201, 138, 0, 0.1); }

/* Review shares the outlined vocabulary of Redeploy so the action row reads as
   one control set, rather than a raised surface sitting on the flat card. */
.btn-review {
  flex: 1;
  padding: 8px;
  background: transparent;
  color: var(--blue);
  border: 1px solid var(--blue);
  border-radius: var(--radius-sm);
  font-family: 'Outfit', sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.btn-review:hover { background: rgba(27, 107, 170, 0.07); }
.btn-review:active { background: rgba(27, 107, 170, 0.13); }
.btn-review:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(27, 107, 170, 0.3);
}

/* Inline ack note form (hidden until Acknowledge clicked) */
.esc-ack-form {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
  width: 100%;
}
.esc-ack-form--hidden { display: none; }

.esc-ack-textarea {
  width: 100%;
  padding: 0.55rem 0.7rem;
  background: var(--bg);
  box-shadow: var(--neo-in-sm);
  border: none;
  border-radius: var(--radius-sm);
  font-family: 'Outfit', sans-serif;
  font-size: 0.82rem;
  color: var(--text-1);
  resize: none;
  box-sizing: border-box;
}
.esc-ack-textarea:focus {
  outline: none;
  box-shadow: var(--neo-in-sm), 0 0 0 2px var(--blue);
}

.esc-confirm-row {
  display: flex;
  gap: 8px;
}

/* Redeploy modal form fields */
.escalation-form-group { display: flex; flex-direction: column; gap: 4px; margin-bottom: 0.75rem; }
.escalation-form-group label {
  font-family: 'Outfit', sans-serif;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-3);
}
.escalation-form-select,
.escalation-form-input,
.escalation-form-textarea {
  width: 100%;
  padding: 0.6rem 0.75rem;
  background: var(--bg);
  box-shadow: var(--neo-in-sm);
  border: none;
  border-radius: var(--radius-sm);
  font-family: 'Outfit', sans-serif;
  font-size: 0.85rem;
  color: var(--text-1);
  box-sizing: border-box;
  appearance: none;
  resize: none;
}
.escalation-form-select:focus,
.escalation-form-input:focus,
.escalation-form-textarea:focus {
  outline: none;
  box-shadow: var(--neo-in-sm), 0 0 0 2px var(--blue);
}
.escalation-form-textarea { resize: vertical; }
.escalation-form-input--readonly {
  color: var(--text-2);
  box-shadow: none;
  background: var(--bg2);
  cursor: default;
}

/* ── Region → Vendors picker (TomSelect, Arctic Frost) ──
   Matches the modal's recessed inputs; linked vendors read as clear,
   removable rows so it's obvious which vendors are attached. */
.vendor-picker .ts-wrapper { width: 100%; position: relative; }
/* Keep the native <select> visually hidden (it still submits its values); the
   styled TomSelect control below is the actual UI. */
.vendor-picker select.tomselected {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  border: 0;
}
.vendor-picker .ts-wrapper .ts-control {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 5px;
  padding: 0.45rem 0.5rem;
  background: var(--bg);
  box-shadow: var(--neo-in-sm);
  border: none;
  border-radius: var(--radius-sm);
  min-height: 2.4rem;
}
.vendor-picker .ts-wrapper.focus .ts-control {
  box-shadow: var(--neo-in-sm), 0 0 0 2px var(--blue);
}
.vendor-picker .ts-wrapper .ts-control > .item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  box-sizing: border-box;
  margin: 0;
  padding: 6px 8px 6px 11px;
  background: var(--blue-tint);
  color: var(--blue);
  border-radius: var(--radius-xs);
  font-family: 'Outfit', sans-serif;
  font-size: 0.82rem;
  font-weight: 500;
}
.vendor-picker .ts-wrapper .ts-control > .item .remove {
  border: none;
  color: var(--blue);
  opacity: 0.55;
  padding: 0 2px;
  font-size: 1.05rem;
  line-height: 1;
  text-decoration: none;
}
.vendor-picker .ts-wrapper .ts-control > .item .remove:hover {
  color: var(--red);
  opacity: 1;
  background: transparent;
}
/* Hide the bare placeholder stub the dropdown_input plugin leaves in the
   control; the real search lives in the styled dropdown, opened via the well
   or the add button. */
.vendor-picker .ts-wrapper .ts-control > input { display: none; }
/* Empty state teaches the next action instead of leaving a blank well. */
.vendor-picker .ts-wrapper:not(.has-items) .ts-control::before {
  content: "No vendors linked yet";
  padding: 3px 2px 3px 4px;
  font-family: 'Outfit', sans-serif;
  font-size: 0.8rem;
  color: var(--text-3);
}
/* Explicit add trigger (rendered by the tom-select controller) opens the picker. */
.vendor-picker .ts-add-btn {
  align-self: flex-start;
  margin-top: 4px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 13px;
  background: var(--bg);
  box-shadow: var(--neo-out-xs);
  border: none;
  border-radius: var(--radius-xs);
  color: var(--blue);
  font-family: 'Outfit', sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
}
.vendor-picker .ts-add-btn:hover { color: var(--blue-mid); }
.vendor-picker .ts-add-btn:active { box-shadow: var(--neo-in-sm); }
.vendor-picker .ts-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 10;
  background: var(--bg);
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 10px 28px rgba(26, 58, 92, 0.20);
  border-radius: var(--radius-sm);
  padding: 4px;
}
.vendor-picker .ts-dropdown .dropdown-input-wrap { padding: 4px 4px 8px; }
.vendor-picker .ts-dropdown .dropdown-input {
  width: 100%;
  padding: 0.45rem 0.6rem;
  background: var(--bg);
  box-shadow: var(--neo-in-sm);
  border: none;
  border-radius: var(--radius-xs);
  font-family: 'Outfit', sans-serif;
  font-size: 0.82rem;
  color: var(--text-1);
}
.vendor-picker .ts-dropdown .option {
  padding: 0.5rem 0.65rem;
  border-radius: var(--radius-xs);
  font-family: 'Outfit', sans-serif;
  font-size: 0.85rem;
  color: var(--text-1);
}
.vendor-picker .ts-dropdown .option.active { background: var(--blue-tint); color: var(--blue); }
.vendor-picker .ts-dropdown .no-results { padding: 0.5rem 0.65rem; color: var(--text-2); font-size: 0.82rem; }
.vendor-picker .field-hint {
  margin: 6px 0 0;
  font-family: 'Outfit', sans-serif;
  font-size: 0.72rem;
  color: var(--text-2);
  line-height: 1.4;
}
.modal-errors {
  background: rgba(217, 79, 106, 0.08);
  color: var(--red);
  border: 1px solid rgba(217, 79, 106, 0.3);
  border-radius: var(--radius-xs);
  padding: 10px 14px;
  margin-bottom: 1rem;
  font-size: 0.82rem;
}
.modal-errors p { margin: 2px 0; line-height: 1.5; }

.escalation-actions { display: flex; flex-direction: column; gap: 6px; margin-top: 0.5rem; }
.escalation-btn {
  width: 100%;
  padding: 0.75rem;
  border: none;
  border-radius: var(--radius-sm);
  font-family: 'Outfit', sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
}
.escalation-btn--primary {
  background: var(--blue);
  color: #fff;
}
.escalation-btn--primary:active { opacity: 0.88; }
.escalation-btn--ghost {
  background: transparent;
  color: var(--text-3);
}
.escalation-btn--ghost:active { color: var(--text-1); }

/* ─────────────────────────────────────── */
/* TOM SELECT — Arctic Frost theme        */
/* ─────────────────────────────────────── */

.ts-wrapper { min-height: unset; }

.ts-wrapper.single .ts-control,
.ts-wrapper.single.input-active .ts-control {
  background: var(--bg);
  box-shadow: var(--neo-in-sm);
  border: none;
  border-radius: var(--radius-sm);
  padding: 0.6rem 2.2rem 0.6rem 0.75rem;
  font-family: 'Outfit', sans-serif;
  font-size: 0.85rem;
  color: var(--text-1);
  cursor: pointer;
}
.ts-wrapper.single .ts-control:after {
  border-color: var(--text-3) transparent transparent;
  right: 0.75rem;
}
.ts-wrapper.single.dropdown-active .ts-control:after {
  border-color: transparent transparent var(--blue);
}
.ts-wrapper.focus .ts-control,
.ts-wrapper.single.input-active .ts-control {
  box-shadow: var(--neo-in-sm), 0 0 0 2px var(--blue);
}
.ts-wrapper.single .ts-control input {
  font-family: 'Outfit', sans-serif;
  font-size: 0.85rem;
  color: var(--text-1);
}

.ts-dropdown,
.ts-dropdown.single {
  background: var(--bg);
  border: none;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  box-shadow: var(--neo-out-sm);
  margin-top: 2px;
  z-index: 100;
}
.ts-dropdown .option {
  font-family: 'Outfit', sans-serif;
  font-size: 0.85rem;
  color: var(--text-1);
  padding: 8px 12px;
}
.ts-dropdown .option:hover,
.ts-dropdown .active {
  background: var(--blue-tint);
  color: var(--blue);
}
.ts-dropdown .no-results {
  font-family: 'Outfit', sans-serif;
  font-size: 0.82rem;
  color: var(--text-3);
  padding: 10px 12px;
}

/* Search input inside dropdown (dropdown_input plugin) */
.plugin-dropdown_input .dropdown-input {
  background: var(--bg);
  box-shadow: var(--neo-in-sm);
  border: none;
  border-bottom: 1px solid var(--shadow-d);
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  padding: 8px 12px;
  font-family: 'Outfit', sans-serif;
  font-size: 0.82rem;
  color: var(--text-1);
  width: 100%;
  box-sizing: border-box;
}
.plugin-dropdown_input .dropdown-input:focus { outline: none; }
.plugin-dropdown_input.focus.dropdown-active .ts-control {
  box-shadow: var(--neo-in-sm), 0 0 0 2px var(--blue);
}

/* Field check-in form — match input-field sizing */
.field-body .ts-wrapper.single .ts-control,
.field-body .ts-wrapper.single.input-active .ts-control {
  box-shadow: var(--neo-in);
  padding: 12px 2.5rem 12px 16px;
  font-size: 0.9rem;
}
.field-body .ts-wrapper.single .ts-control:after { right: 16px; }
.field-body .plugin-dropdown_input.focus.dropdown-active .ts-control {
  box-shadow: var(--neo-in), 0 0 0 2px rgba(27, 107, 170, 0.2);
}

/* ─────────────────────────────────────── */
/* STATION HEALTH BOARD                   */
/* ─────────────────────────────────────── */

.health-summary {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 8px;
}

.health-sum-card {
  display: block;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  background: var(--bg);
  box-shadow: var(--neo-out-sm);
  border-radius: var(--radius-md);
  padding: 0.8rem 0.5rem;
  text-align: center;
  border-top: 3px solid transparent;
  transition: box-shadow 0.15s;
}
.health-sum-card:hover { box-shadow: var(--neo-out); }
.health-sum-card--active { box-shadow: var(--neo-out-sm), 0 0 0 2px var(--blue); }
.hsc-op    { border-top-color: #2a9d5c; }
.hsc-down  { border-top-color: var(--red); }

.hsc-num {
  font-family: 'DM Mono', monospace;
  font-size: 1.6rem;
  font-weight: 600;
  color: var(--text-1);
  line-height: 1;
}
.hsc-label {
  font-family: 'Outfit', sans-serif;
  font-size: 0.7rem;
  color: var(--text-2);
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Map view — frosted dark island */
.map-view {
  background: linear-gradient(135deg, #1a2e45, #0f2030);
  border-radius: var(--radius-lg);
  margin-bottom: 1rem;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.map-canvas {
  width: 100%;
  height: 320px;
  position: relative;
  z-index: 0;
  background: #1a2e45;
}

/* Site form map picker — Leaflet canvas in a recessed well */
.site-map-picker {
  height: 220px;
  margin-top: 0.6rem;
  border-radius: var(--radius-md);
  overflow: hidden;
  position: relative;
  z-index: 0;
  background: var(--bg2);
  box-shadow: var(--neo-in-sm);
  cursor: crosshair;
}
.site-map-hint {
  font-family: 'Outfit', sans-serif;
  font-size: 0.7rem;
  color: var(--text-3);
  margin-top: 0.4rem;
}
.site-pin-wrap { position: relative; }
.site-pin {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--blue);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.9), 0 3px 8px rgba(26, 58, 92, 0.35);
}

/* Leaflet station markers (divIcon) */
.stn-marker-wrap { position: relative; }
.stn-marker {
  position: absolute;
  inset: 0;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.42rem;
  font-weight: 700;
  font-family: 'DM Mono', monospace;
  color: rgba(15, 32, 48, 0.85);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
  transition: transform 0.2s;
  z-index: 1;
}
.stn-marker-wrap:hover .stn-marker { transform: scale(1.3); }
.stn-marker--down        { background: #d94f6a; }

.stn-marker-pulse {
  position: absolute;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation: mapPulse 2s infinite;
  z-index: 0;
}
.stn-marker-wrap:has(.stn-marker--down) .stn-marker-pulse { background: rgba(217, 79, 106, 0.4); }

@keyframes mapPulse {
  0%   { transform: translate(-50%, -50%) scale(0.5); opacity: 0.8; }
  100% { transform: translate(-50%, -50%) scale(2.5); opacity: 0; }
}

/* Leaflet tooltip — dark frosted theme */
.leaflet-tooltip.leaflet-tooltip-top {
  background: rgba(26, 46, 69, 0.96);
  border: 1px solid rgba(91, 157, 212, 0.25);
  border-radius: 10px;
  padding: 7px 11px;
  font-size: 0.72rem;
  font-family: 'Outfit', sans-serif;
  color: #dff0fb;
  white-space: nowrap;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
}
.leaflet-tooltip-top::before { border-top-color: rgba(26, 46, 69, 0.96); }
.map-tip-status {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
}
.map-tip-status--operational { color: #2a9d5c; }
.map-tip-status--down        { color: #d94f6a; }

.map-legend {
  display: flex;
  gap: 12px;
  padding: 8px 12px;
  border-top: 1px solid rgba(91, 157, 212, 0.12);
}
.map-leg-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.68rem;
  font-family: 'Outfit', sans-serif;
  color: rgba(168, 204, 232, 0.8);
}
.map-leg-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Job sheet GPS map — the same map inside a bottom sheet, so the canvas is
   shorter and the legend wraps rather than pushing the sheet wide. */
.map-view--sheet { margin: 0.75rem 0 1rem; }
.map-view--sheet .map-canvas { height: 200px; }
.map-view--sheet .map-legend { flex-wrap: wrap; gap: 8px 12px; }

.gps-marker {
  position: absolute;
  inset: 0;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.5rem;
  font-weight: 700;
  font-family: 'DM Mono', monospace;
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
  transition: transform 0.2s;
}
.stn-marker-wrap:hover .gps-marker { transform: scale(1.2); }

.gps-marker--in,   .map-leg-dot--in   { background: var(--blue); }
.gps-marker--out,  .map-leg-dot--out  { background: #2a9d5c; }
.gps-marker--site, .map-leg-dot--site { background: var(--yellow); }

/* Station list rows */
.health-board { display: flex; flex-direction: column; gap: 8px; }

.station-row {
  background: var(--bg);
  box-shadow: var(--neo-out-xs);
  border-radius: var(--radius-md);
  padding: 0.85rem 1.1rem;
  display: flex;
  align-items: center;
  gap: 10px;
}

.stn-row-body { flex: 1; min-width: 0; }

.stn-id {
  font-family: 'DM Mono', monospace;
  font-size: 0.72rem;
  color: var(--text-3);
}
.stn-row-name {
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--text-1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.stn-row-meta {
  font-family: 'Outfit', sans-serif;
  font-size: 0.72rem;
  color: var(--text-2);
  margin-top: 2px;
}
.stn-row-loc {
  font-family: 'Outfit', sans-serif;
  font-size: 0.72rem;
  color: var(--text-3);
  margin-top: 3px;
}
.stn-row-coords {
  font-family: 'DM Mono', monospace;
  font-size: 0.66rem;
  color: var(--text-3);
  margin-top: 2px;
}
.stn-row-dates {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-family: 'DM Mono', monospace;
  font-size: 0.66rem;
  color: var(--text-3);
  margin-top: 4px;
}
.stn-row-jobsheets {
  margin-top: 8px;
  font-size: 0.7rem;
  padding: 4px 10px;
}

.stn-row-status {
  padding: 4px 10px;
  border-radius: 20px;
  font-family: 'Outfit', sans-serif;
  font-size: 0.68rem;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
}
.stn-row-status--operational { background: #d4f0e2; color: #1a6b42; }
.stn-row-status--down        { background: #fde2e8; color: #a3002a; }

/* Station row health badges (repeat fault + SLA breach) */
.station-row.repeat-fault {
  box-shadow: var(--neo-out-xs), inset 3px 0 0 var(--yellow);
}

.repeat-badge,
.sla-breach-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 20px;
  font-family: 'Outfit', sans-serif;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  white-space: nowrap;
  margin-left: 6px;
  vertical-align: middle;
}

.repeat-badge {
  background: rgba(201, 138, 0, 0.15);
  color: var(--yellow);
  border: 1px solid rgba(201, 138, 0, 0.35);
}

.sla-breach-badge {
  background: rgba(217, 79, 106, 0.15);
  color: var(--red);
  border: 1px solid rgba(217, 79, 106, 0.4);
  animation: slaBreachPulse 1.6s ease-in-out infinite;
}

@keyframes slaBreachPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(217, 79, 106, 0.35); }
  50%      { box-shadow: 0 0 0 4px rgba(217, 79, 106, 0); }
}

/* ─────────────────────────────────────── */
/* TASK ASSIGNMENTS PAGE                  */
/* ─────────────────────────────────────── */

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

.assign-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-1);
}

.btn-new-assign {
  background: var(--blue);
  color: #fff;
  font-family: 'Outfit', sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 8px 14px;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  box-shadow: var(--neo-out-xs);
}
.btn-new-assign:active { box-shadow: var(--neo-in-sm); }

.assign-header-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.btn-bulk-assign {
  background: var(--bg2);
  color: var(--text-3);
  font-family: 'Outfit', sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 8px 14px;
  border: 1px dashed var(--shadow-d);
  border-radius: var(--radius-sm);
  cursor: not-allowed;
  box-shadow: none;
}

.task-assign-list { display: flex; flex-direction: column; gap: 10px; }

.assign-card {
  background: var(--bg);
  border: 1px solid var(--shadow-d);
  border-radius: var(--radius-md);
  padding: 1rem 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.assign-card.pending  { border-color: rgba(27, 107, 170, 0.3); }
.assign-card.accepted { border-color: rgba(42, 157, 92, 0.3); }

.assign-top {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.assign-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--blue-tint);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 0.8rem;
  color: var(--blue);
  flex-shrink: 0;
}

.assign-worker {
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--text-1);
  flex: 1;
}

.assign-status-badge {
  padding: 3px 8px;
  border-radius: 20px;
  font-family: 'Outfit', sans-serif;
  font-size: 0.68rem;
  font-weight: 700;
  white-space: nowrap;
}
.asb-pending  { background: rgba(27, 107, 170, 0.12); color: var(--blue); }
.asb-accepted { background: rgba(42, 157, 92, 0.12);  color: #1a6b42; }

.assign-task-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 20px;
  font-family: 'Outfit', sans-serif;
  font-size: 0.7rem;
  font-weight: 600;
  background: var(--blue-tint);
  color: var(--blue);
  margin-bottom: 2px;
}

.assign-site-inline {
  font-family: 'Outfit', sans-serif;
  font-size: 0.72rem;
  color: var(--text-2);
  margin-left: 6px;
}

/* EVCS / BSS site type badge on the assignment site line */
.site-type-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 20px;
  font-family: 'Outfit', sans-serif;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  white-space: nowrap;
  margin-left: 6px;
  vertical-align: middle;
  background: var(--blue-tint);
  color: var(--blue);
  border: 1px solid var(--blue-pale);
}

.assign-detail {
  font-family: 'Outfit', sans-serif;
  font-size: 0.78rem;
  color: var(--text-2);
  margin-bottom: 2px;
}
.assign-uuid { font-family: 'DM Mono', monospace; font-size: 0.62rem; color: var(--text-3); word-break: break-all; }
.assign-priority--urgent   { color: var(--yellow); }
.assign-priority--critical { color: var(--red); }
.assign-priority--normal   { color: var(--text-3); }

.btn-cancel-assign {
  background: transparent;
  border: 1px solid var(--shadow-d);
  color: var(--text-2);
  padding: 5px 12px;
  border-radius: var(--radius-xs);
  font-family: 'Outfit', sans-serif;
  font-size: 0.75rem;
  cursor: pointer;
  align-self: flex-start;
  transition: border-color 0.15s, color 0.15s;
  margin-top: 2px;
}
.btn-cancel-assign:hover {
  border-color: var(--red);
  color: var(--red);
}

.assign-actions {
  display: flex;
  gap: 6px;
  margin-top: 6px;
  align-items: center;
}

.btn-job-sheets {
  display: inline-block;
  background: transparent;
  border: 1px solid var(--shadow-d);
  color: var(--text-2);
  padding: 5px 12px;
  border-radius: var(--radius-xs);
  font-family: 'Outfit', sans-serif;
  font-size: 0.75rem;
  text-decoration: none;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}
.btn-job-sheets:hover {
  border-color: var(--blue);
  color: var(--blue);
}

.assign-location {
  font-size: 0.75rem;
  color: var(--text-3);
  margin-top: 2px;
}
.assign-chargers {
  font-family: 'DM Mono', monospace;
  font-size: 0.72rem;
  color: var(--text-2);
  margin-top: 2px;
}

/* Assignments filter bar — scoped under .filter-bar so it does not collide
   with the HR/audit-log .filter-* classes defined later in this file. */
.filter-bar {
  margin-bottom: 14px;
}
.filter-bar .filter-row {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
}
.filter-bar .filter-top {
  display: flex;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
}
.filter-bar .filter-top .filter-search {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 520px;
}
.filter-bar .filter-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
  padding-left: 16px;
  border-left: 1px solid var(--shadow-d);
}
/* Stations filter bar — uniform field anatomy: label above BOTH search and
   province, matched border-box 38px control heights, bar capped at 820px so
   it never stretches across a wide desktop (#203). Scoped by the --uniform
   modifier so the Assign page's shared filter classes are unaffected. */
.filter-bar .filter-top--uniform {
  align-items: flex-end;
  flex-wrap: nowrap;
  gap: 10px;
  max-width: 820px;
}
.filter-bar .filter-top--uniform .filter-field {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.filter-bar .filter-top--uniform .filter-field--search { flex: 2 1 0; }
.filter-bar .filter-top--uniform .filter-field--province { flex: 1 1 0; min-width: 170px; }
.filter-bar .filter-top--uniform .filter-field--site-type { flex: 1 1 0; min-width: 150px; }
.filter-bar .filter-top--uniform .filter-field-label { margin-bottom: 4px; }
.filter-bar .filter-top--uniform .filter-search,
.filter-bar .filter-top--uniform .filter-select {
  /* flex/box-shadow pinned explicitly: the bare HR/audit `.filter-select`
     rule later in this file sets flex: 1 (which makes flex-basis override
     the fixed height inside the column field) and an inset shadow. */
  flex: none;
  box-sizing: border-box;
  box-shadow: none;
  width: 100%;
  min-width: 0;
  max-width: none;
  height: 38px;
  padding: 0 12px;
  font-size: 0.8rem;
  border: 1px solid var(--shadow-d);
  border-radius: var(--radius-sm);
}
.filter-bar .filter-top--uniform .filter-actions {
  height: 38px;
  padding-left: 0;
  border-left: 0;
}
.filter-bar .filter-top--uniform .filter-btn {
  box-sizing: border-box;
  height: 38px;
}
.filter-bar .filter-adv {
  border-radius: var(--radius-md);
}
.filter-bar .filter-adv-summary {
  list-style: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: 'Outfit', sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-2);
  padding: 4px 2px;
  user-select: none;
  width: max-content;
}
.filter-bar .filter-adv-summary::-webkit-details-marker {
  display: none;
}
.filter-bar .filter-adv-caret {
  display: inline-flex;
  color: var(--text-3);
  transition: transform 0.18s cubic-bezier(0.22, 1, 0.36, 1);
}
.filter-bar .filter-adv[open] .filter-adv-caret {
  transform: rotate(90deg);
}
.filter-bar .filter-adv-count {
  font-family: 'DM Mono', monospace;
  font-size: 0.7rem;
  color: var(--blue);
  background: var(--blue-tint);
  border-radius: var(--radius-xs);
  padding: 1px 7px;
}
.filter-bar .filter-grid {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 14px;
  margin-top: 10px;
}
.filter-bar .filter-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.filter-bar .filter-field--date {
  grid-column: span 2;
}
/* Controls fill their grid cell so the row stays one line on desktop,
   overriding the compact filter-select/ts-wrapper max-widths used elsewhere. */
.filter-bar .filter-grid .filter-select,
.filter-bar .filter-grid .filter-date {
  max-width: none;
  width: 100%;
  box-sizing: border-box;
}
.filter-bar .filter-grid .ts-wrapper {
  max-width: none;
  width: 100%;
}
@media (min-width: 761px) and (max-width: 1200px) {
  .filter-bar .filter-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
@media (max-width: 760px) {
  .filter-bar .filter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .filter-bar .filter-field--date {
    grid-column: span 2;
  }
  /* The uniform row holds three fields once site type is in it — stack them
     rather than squeezing everything onto one phone-width line. */
  .filter-bar .filter-top--uniform { flex-wrap: wrap; }
  .filter-bar .filter-top--uniform .filter-field--search,
  .filter-bar .filter-top--uniform .filter-field--province,
  .filter-bar .filter-top--uniform .filter-field--site-type { flex: 1 1 100%; }
}
.filter-bar .filter-field-label {
  font-family: 'Outfit', sans-serif;
  font-size: 0.66rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-2);
}
.filter-bar .filter-dates {
  display: flex;
  align-items: center;
  gap: 6px;
}
.filter-bar .filter-dash {
  color: var(--text-3);
}
@media (prefers-reduced-motion: reduce) {
  .filter-bar .filter-adv-caret { transition: none; }
}
.filter-bar .filter-search {
  padding: 6px 12px;
  border: 1px solid var(--shadow-d);
  border-radius: var(--radius-sm);
  font-family: 'Outfit', sans-serif;
  font-size: 0.8rem;
  color: var(--text-1);
  background: var(--bg);
  min-width: 180px;
  height: 34px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.filter-bar .filter-search:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 2px var(--blue-tint);
}
.filter-bar .filter-search::placeholder {
  color: var(--text-3);
}
.filter-bar .filter-select {
  padding: 6px 10px;
  border: 1px solid var(--shadow-d);
  border-radius: var(--radius-sm);
  font-family: 'Outfit', sans-serif;
  font-size: 0.78rem;
  color: var(--text-1);
  background: var(--bg);
  max-width: 150px;
  height: 34px;
  outline: none;
  cursor: pointer;
}
.filter-bar .filter-select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 2px var(--blue-tint);
}

/* TomSelect dropdowns inside the filter row — match the compact filter sizing
   and keep long selected values on a single truncated line. */
.filter-bar .ts-wrapper {
  min-width: 130px;
  max-width: 160px;
}
.filter-bar .ts-wrapper.single .ts-control {
  padding: 6px 24px 6px 10px !important;
  box-shadow: none !important;
  border: 1px solid var(--shadow-d) !important;
  border-radius: var(--radius-sm) !important;
  font-size: 0.78rem !important;
  min-height: 34px !important;
  display: flex;
  align-items: center;
}
.filter-bar .ts-wrapper.single .ts-control .item {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.filter-bar .ts-wrapper.focus .ts-control {
  border-color: var(--blue) !important;
  box-shadow: 0 0 0 2px var(--blue-tint) !important;
}

.filter-bar .filter-date {
  padding: 5px 8px;
  border: 1px solid var(--shadow-d);
  border-radius: var(--radius-sm);
  font-family: 'Outfit', sans-serif;
  font-size: 0.78rem;
  color: var(--text-1);
  background: var(--bg);
  width: 130px;
  height: 34px;
  outline: none;
}
.filter-bar .filter-date:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 2px var(--blue-tint);
}
.filter-bar .filter-dates .filter-date {
  flex: 1 1 0;
  width: auto;
  min-width: 0;
}
.filter-bar .filter-btn {
  padding: 6px 14px;
  border: none;
  border-radius: var(--radius-sm);
  font-family: 'Outfit', sans-serif;
  font-size: 0.78rem;
  color: #fff;
  background: var(--blue);
  cursor: pointer;
  height: 34px;
  transition: background 0.15s;
}
.filter-bar .filter-btn:hover {
  background: var(--blue-mid);
}
.filter-bar .filter-clear {
  font-size: 0.78rem;
  color: var(--text-3);
  text-decoration: none;
  padding: 6px 8px;
  transition: color 0.15s;
}
.filter-bar .filter-clear:hover {
  color: var(--red);
}

.charger-check-group.hidden {
  display: none;
}
.charger-checklist {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 180px;
  overflow-y: auto;
  padding: 8px;
  background: var(--bg2);
  border-radius: var(--radius-sm);
  border: 1px solid var(--shadow-d);
}
.charger-check-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: 'DM Mono', monospace;
  font-size: 0.75rem;
  color: var(--text-1);
  cursor: pointer;
  padding: 2px 0;
}
.charger-checkbox,
.charger-check {
  accent-color: var(--blue);
  cursor: pointer;
}
.charger-hint {
  font-size: 0.7rem;
  color: var(--text-3);
  margin: 4px 0 0 2px;
}

.per-page-bar {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  margin-top: 16px;
  margin-bottom: 8px;
}
.per-page-label {
  font-size: 0.75rem;
  color: var(--text-3);
}
.per-page-form {
  display: inline-block;
}
.per-page-dropdown {
  padding: 4px 8px;
  border: 1px solid var(--shadow-d);
  border-radius: var(--radius-xs);
  font-family: 'Outfit', sans-serif;
  font-size: 0.75rem;
  color: var(--text-1);
  background: var(--bg);
  cursor: pointer;
  outline: none;
}
.per-page-dropdown:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 2px var(--blue-tint);
}

.escalation-btn--primary:active { box-shadow: var(--neo-in-sm); }

/* Additional status colours on assignment cards */
.assign-card.in_progress { border-color: rgba(27, 107, 170, 0.45); }
.assign-card.completed   { border-color: rgba(42, 157, 92, 0.30); }
.assign-card.cancelled   { border-color: var(--shadow-d); }

/* Critical priority — red border, takes precedence over status border */
.assign-card.critical {
  border-color: var(--red);
  border-width: 2px;
  padding: calc(1rem - 1px) calc(1.2rem - 1px);
}

/* Status badges for in_progress / completed / cancelled */
.asb-in_progress { background: rgba(27, 107, 170, 0.15); color: var(--blue); }
.asb-completed   { background: rgba(42, 157, 92, 0.15);  color: #1a6b42; }
.asb-cancelled   { background: rgba(122, 138, 158, 0.15); color: var(--text-3); }

/* History section — faded cards */
.assign-card--history { opacity: 0.65; }

/* ─────────────────────────────────────── */
/* Field — Pending Assignments (read-only) */
/* ─────────────────────────────────────── */

.field-assigned-section {
  margin-bottom: 1.2rem;
}

.field-assigned-title {
  font-family: 'Outfit', sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: 1.8px;
  margin-bottom: 0.6rem;
}

.assign-card--readonly {
  cursor: default;
}

.assign-priority-badge {
  font-family: 'Outfit', sans-serif;
}
.asb-priority-normal   { background: rgba(122, 138, 158, 0.15); color: var(--text-3); }
.asb-priority-urgent   { background: rgba(201, 138, 0, 0.15);   color: var(--yellow); }
.asb-priority-critical { background: rgba(217, 79, 106, 0.15);  color: var(--red); }

.assign-meta {
  font-family: 'Outfit', sans-serif;
  font-size: 0.7rem;
  color: var(--text-3);
  margin-top: 4px;
}

/* Accept / cancel-accept buttons on field pending assignment cards */
.assign-card--field {
  display: flex;
  flex-direction: row !important;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.assign-card--field .assign-content-left {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.assign-card--field .assign-accept-col {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-accept-assign {
  background: var(--blue);
  color: #fff;
  border: none;
  box-shadow: 2px 2px 6px rgba(27, 107, 170, 0.25), -1px -1px 4px rgba(255, 255, 255, 0.6);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-family: 'Outfit', sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.btn-accept-assign:hover {
  background: var(--blue-mid);
}
.btn-accept-assign:active {
  box-shadow: var(--neo-in-sm);
}

.btn-cancel-accept {
  background: var(--bg);
  box-shadow: var(--neo-out-xs);
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-3);
  padding: 6px 12px;
  font-family: 'Outfit', sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.btn-cancel-accept:hover {
  color: var(--text-2);
}
.btn-cancel-accept:active {
  box-shadow: var(--neo-in-sm);
}

/* Accepted assignment card highlight */
.assign-card.accepted-active {
  border-color: rgba(42, 157, 92, 0.55);
  box-shadow: var(--neo-out-xs), inset 3px 0 0 rgba(42, 157, 92, 0.6);
}

/* Camera box error state (CI-b-iv) */
.camera-box.error {
  border-color: var(--red);
  border-style: solid;
  box-shadow: var(--neo-in-sm), 0 0 0 2px rgba(217, 79, 106, 0.25);
}

/* Task section error state */
.task-grid.error .task-card:not(.selected) {
  box-shadow: var(--neo-out-xs), 0 0 0 1px rgba(217, 79, 106, 0.4);
}
.task-grid.locked .task-card:not(.selected) {
  opacity: 0.35; pointer-events: none;
}
.check-in-error-msg {
  font-family: 'Outfit', sans-serif;
  font-size: 0.75rem;
  color: var(--red);
  margin-top: 4px;
}

/* Mismatch confirmation modal — body styling */
.mismatch-pending-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0.6rem 0 1rem;
  padding: 0.8rem 1rem;
  background: var(--bg);
  border-radius: var(--radius-sm);
  box-shadow: var(--neo-in-sm);
}

.mismatch-pending-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.mismatch-pending-more {
  font-family: 'Outfit', sans-serif;
  font-size: 0.72rem;
  color: var(--text-3);
}

/* ============================================================
   HR Dashboard
   ============================================================ */

/* Settings bar */
.hr-settings-bar {
  background: var(--bg);
  border-radius: var(--radius-md);
  box-shadow: var(--neo-out-sm);
  padding: 0.8rem 1.2rem;
  margin-bottom: 1.2rem;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.hr-setting-item { display: flex; align-items: center; gap: 8px; }
.hr-setting-label {
  font-family: 'Outfit', sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-3);
  white-space: nowrap;
}
.hr-setting-val {
  font-family: 'DM Mono', monospace;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--blue);
}
.hr-setting-box {
  font-family: 'DM Mono', monospace;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--blue);
  padding: 5px 10px;
  background: var(--bg);
  box-shadow: var(--neo-in-sm);
  border-radius: var(--radius-xs);
  min-width: 60px;
  text-align: center;
  display: inline-block;
}
.hr-setting-divider { width: 1px; height: 20px; background: var(--shadow-d); }
.btn-payroll-csv {
  padding: 7px 14px;
  background: var(--bg);
  box-shadow: var(--neo-out-xs);
  border: none;
  border-radius: var(--radius-xs);
  font-family: 'Outfit', sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--blue);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
}
.btn-payroll-csv:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-payroll-csv:not(:disabled):active { box-shadow: var(--neo-in-sm); }

/* Dashboard Tabs (HR + Manager share the same visual style) */
.hr-tabs,
.mgr-tabs {
  display: flex;
  gap: 6px;
  background: var(--bg2);
  box-shadow: var(--neo-in-sm);
  border-radius: var(--radius-sm);
  padding: 4px;
  margin-bottom: 1.2rem;
}
.hr-tab,
.mgr-tab {
  flex: 1;
  padding: 9px 4px;
  border: none;
  background: transparent;
  color: var(--text-3);
  border-radius: var(--radius-xs);
  cursor: pointer;
  font-family: 'Outfit', sans-serif;
  font-size: 0.74rem;
  font-weight: 500;
  transition: all 0.2s;
}
.hr-tab--active,
.mgr-tab--active {
  background: var(--bg);
  box-shadow: var(--neo-out-xs);
  color: var(--blue);
  font-weight: 700;
}
.hr-tab:disabled,
.mgr-tab:disabled { opacity: 0.35; cursor: not-allowed; }

/* Five manager tabs no longer fit a phone at equal width (#317). Each tab keeps
   its label on one line and grows to fill a wide screen; the bar scrolls when
   the labels together outrun the viewport. */
.mgr-tabs { overflow-x: auto; scrollbar-width: none; }
.mgr-tabs::-webkit-scrollbar { display: none; }
.mgr-tabs .mgr-tab {
  flex: 1 0 auto;
  white-space: nowrap;
  padding: 9px 10px;
}

/* Roll summary */
.roll-summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 1rem;
}
.rs-sum-card { border-radius: var(--radius-sm); padding: 0.7rem; text-align: center; }
.rs-sum-present { background: rgba(27,107,170,0.08);  border: 1px solid rgba(27,107,170,0.2); }
.rs-sum-late    { background: rgba(201,138,0,0.08);   border: 1px solid rgba(201,138,0,0.2); }
.rs-sum-absent  { background: rgba(217,79,106,0.08);  border: 1px solid rgba(217,79,106,0.2); }
.rs-sum-leave   { background: rgba(122,170,191,0.08); border: 1px solid rgba(122,170,191,0.2); }
.rs-sum-num {
  font-size: 1.3rem;
  font-weight: 700;
  font-family: 'DM Mono', monospace;
}
.rs-sum-present .rs-sum-num { color: var(--blue); }
.rs-sum-late    .rs-sum-num { color: var(--yellow); }
.rs-sum-absent  .rs-sum-num { color: var(--red); }
.rs-sum-leave   .rs-sum-num { color: var(--text-3); }
.rs-sum-label {
  font-size: 0.6rem;
  color: var(--text-3);
  margin-top: 2px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-family: 'Outfit', sans-serif;
}

/* Roll call list */
.roll-call-list { display: flex; flex-direction: column; gap: 8px; }
.roll-card {
  background: var(--bg);
  border-radius: var(--radius-sm);
  box-shadow: var(--neo-out-sm);
  padding: 0.9rem 1.2rem;
  display: flex;
  align-items: center;
  gap: 12px;
}
.roll-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--bg);
  box-shadow: var(--neo-in-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'DM Mono', monospace;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--blue);
  flex-shrink: 0;
}
.roll-info { flex: 1; min-width: 0; }
.roll-name { font-weight: 600; font-size: 0.88rem; color: var(--text-1); }
.roll-meta { font-size: 0.72rem; color: var(--text-3); margin-top: 2px; }
.roll-badge {
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  flex-shrink: 0;
  white-space: nowrap;
  font-family: 'Outfit', sans-serif;
}
.rb-present { background: rgba(27,107,170,0.12);  color: var(--blue); }
.rb-late    { background: rgba(201,138,0,0.12);   color: var(--yellow); }
.rb-absent  { background: rgba(217,79,106,0.12);  color: var(--red); }
.rb-on_leave { background: rgba(122,170,191,0.12); color: var(--text-3); }

/* Overtime panel */
.ot-summary {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 1rem;
}
.ot-sum-card {
  background: rgba(201,138,0,0.08);
  border: 1px solid rgba(201,138,0,0.2);
  border-radius: var(--radius-sm);
  padding: 0.7rem;
  text-align: center;
}
.ot-num {
  font-size: 1.3rem;
  font-weight: 700;
  font-family: 'DM Mono', monospace;
  color: var(--yellow);
}
.ot-label {
  font-size: 0.6rem;
  color: var(--text-3);
  margin-top: 2px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-family: 'Outfit', sans-serif;
}

.ot-list { display: flex; flex-direction: column; gap: 8px; }
.ot-card {
  background: var(--bg);
  border-radius: var(--radius-sm);
  box-shadow: var(--neo-out-sm);
  padding: 0.9rem 1.2rem;
  display: flex;
  align-items: center;
  gap: 12px;
}
.ot-info { flex: 1; min-width: 0; }
.ot-name { font-weight: 600; font-size: 0.88rem; color: var(--text-1); }
.ot-detail { font-size: 0.72rem; color: var(--text-3); margin-top: 2px; }
.ot-hours {
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 700;
  background: rgba(201,138,0,0.12);
  color: var(--yellow);
  font-family: 'DM Mono', monospace;
  flex-shrink: 0;
  white-space: nowrap;
}

/* Pagy navigation */
.pagy-nav {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 20px;
  flex-wrap: wrap;
}
.pagy-nav a,
.pagy-nav span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  padding: 0 8px;
  border-radius: var(--radius-xs);
  font-family: 'DM Mono', monospace;
  font-size: 0.78rem;
  color: var(--text-2);
  text-decoration: none;
  box-shadow: var(--neo-out-xs);
  background: var(--bg);
}
.pagy-nav a:hover { color: var(--blue); }
.pagy-nav span.current {
  box-shadow: var(--neo-in-sm);
  color: var(--blue);
  font-weight: 700;
}

/* hr-tab as <a> link */
a.hr-tab {
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}
a.hr-tab:hover { color: var(--blue); }

/* btn-payroll-csv as <a> link */
a.btn-payroll-csv { text-decoration: none; }
a.btn-payroll-csv:hover { box-shadow: var(--neo-out-sm); color: var(--blue); }

/* Attendance Log page */
.filter-row { display: flex; gap: 8px; margin-bottom: 1.2rem; flex-wrap: wrap; align-items: center; }
.filter-form { display: contents; }
.filter-select {
  flex: 1;
  min-width: 120px;
  padding: 9px 11px;
  background: var(--bg);
  box-shadow: var(--neo-in-sm);
  border: none;
  border-radius: var(--radius-xs);
  font-family: 'Outfit', sans-serif;
  font-size: 0.82rem;
  color: var(--text-1);
}
.log-filter-btn {
  padding: 9px 16px;
  background: var(--blue);
  color: #fff;
  border: none;
  border-radius: var(--radius-xs);
  font-family: 'Outfit', sans-serif;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}
.btn-export {
  padding: 9px 16px;
  background: var(--bg);
  box-shadow: var(--neo-out-xs);
  border-radius: var(--radius-xs);
  font-family: 'Outfit', sans-serif;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--blue);
  text-decoration: none;
  white-space: nowrap;
  display: inline-block;
}
.btn-export:hover { box-shadow: var(--neo-out-sm); }

/* ── Audit log ── */
.filter-date {
  padding: 9px 11px;
  background: var(--bg);
  box-shadow: var(--neo-in-sm);
  border: none;
  border-radius: var(--radius-xs);
  font-family: 'Outfit', sans-serif;
  font-size: 0.82rem;
  color: var(--text-1);
}

.audit-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.audit-row {
  background: var(--bg);
  box-shadow: var(--neo-out-xs);
  border: 1px solid rgba(255, 255, 255, 0.70);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.audit-rowbtn {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
  padding: 0.8rem 1rem;
  background: transparent;
  border: 0;
  font: inherit;
  text-align: left;
  color: inherit;
  cursor: pointer;
}
.audit-rowbtn:hover { background: var(--blue-tint); }
.audit-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 5px;
}
.ad-create { background: var(--blue); }
.ad-update { background: var(--yellow); }
.ad-delete { background: var(--red); }
.audit-body { flex: 1; min-width: 0; }
.audit-action {
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text-1);
}
.audit-meta {
  font-size: 0.7rem;
  color: var(--text-3);
  margin-top: 3px;
  font-family: 'DM Mono', monospace;
}
.audit-chevron {
  color: var(--text-3);
  font-size: 0.7rem;
  transition: transform 0.2s;
  flex-shrink: 0;
  margin-top: 4px;
}
.audit-row.open .audit-chevron { transform: rotate(180deg); }
.audit-detail { display: none; padding: 0 1rem 0.9rem; }
.audit-row.open .audit-detail { display: block; }
.audit-diff {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg);
  box-shadow: var(--neo-in-sm);
  border-radius: var(--radius-xs);
  overflow: hidden;
}
.audit-diff th {
  text-align: left;
  padding: 6px 10px;
  font-size: 0.64rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-3);
}
.audit-diff td {
  padding: 6px 10px;
  font-size: 0.74rem;
  color: var(--text-2);
  vertical-align: top;
  word-break: break-word;
}
.audit-diff-field { font-weight: 600; color: var(--text-1); }
.audit-diff .mono { font-family: 'DM Mono', monospace; font-size: 0.72rem; }

.stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 1rem;
}
.stat-card {
  background: var(--bg);
  box-shadow: var(--neo-out-xs);
  border-radius: var(--radius-sm);
  padding: 0.8rem;
  text-align: center;
}
.stat-num {
  font-size: 1.6rem;
  font-weight: 700;
  font-family: 'DM Mono', monospace;
  color: var(--blue);
}
.stat-label {
  font-size: 0.68rem;
  color: var(--text-3);
  margin-top: 3px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-family: 'Outfit', sans-serif;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--bg2);
  border-radius: var(--radius-md);
  background: var(--bg);
  box-shadow: var(--neo-out-xs);
}
.attendance-table { width: 100%; border-collapse: collapse; }
.attendance-table th {
  text-align: left;
  padding: 10px 12px;
  font-size: 0.72rem;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 1px;
  border-bottom: 1px solid var(--bg2);
  white-space: nowrap;
  font-family: 'Outfit', sans-serif;
}
.attendance-table td {
  padding: 10px 12px;
  font-size: 0.82rem;
  border-bottom: 1px solid var(--bg2);
  vertical-align: middle;
  white-space: nowrap;
  color: var(--text-1);
  font-family: 'Outfit', sans-serif;
}
.attendance-table tr:last-child td { border-bottom: none; }
.attendance-table tr:hover td { background: rgba(27,107,170,0.04); }
.attendance-table .mono { font-family: 'DM Mono', monospace; font-size: 0.78rem; color: var(--text-2); }
.log-empty {
  text-align: center;
  color: var(--text-3);
  font-family: 'Outfit', sans-serif;
  font-size: 0.85rem;
  padding: 2rem 0;
}

/* ── Monthly Summary ─────────────────────────── */
.month-nav { display: flex; align-items: center; gap: 10px; margin-bottom: 1rem; }
.month-btn {
  background: var(--bg);
  border: 1px solid var(--shadow-d);
  color: var(--text-3);
  width: 32px;
  height: 32px;
  border-radius: var(--radius-xs);
  cursor: pointer;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: all 0.2s;
  flex-shrink: 0;
}
.month-btn:hover { border-color: var(--blue); color: var(--blue); }
.month-btn.disabled { opacity: 0.35; pointer-events: none; }
a.month-btn { line-height: 32px; text-align: center; }
.month-label { font-weight: 600; font-size: 0.9rem; flex: 1; text-align: center; color: var(--text-1); font-family: 'Outfit', sans-serif; }
.monthly-grid { display: flex; flex-direction: column; gap: 8px; }
.monthly-card {
  background: var(--bg);
  box-shadow: var(--neo-out-sm);
  border-radius: 14px;
  padding: 1rem 1.2rem;
}
.monthly-top { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.monthly-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--blue);
  flex-shrink: 0;
}
.monthly-name { font-weight: 600; font-size: 0.88rem; color: var(--text-1); font-family: 'Outfit', sans-serif; }
.monthly-dept { font-size: 0.7rem; color: var(--text-3); font-family: 'Outfit', sans-serif; }
.monthly-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.ms-cell { text-align: center; padding: 6px 4px; background: var(--bg2); border-radius: var(--radius-xs); }
.ms-val { font-size: 0.95rem; font-weight: 700; font-family: 'DM Mono', monospace; color: var(--blue); }
.ms-val.warn   { color: var(--yellow); }
.ms-val.danger { color: var(--red); }
.ms-key { font-size: 0.6rem; color: var(--text-3); margin-top: 2px; text-transform: uppercase; font-family: 'Outfit', sans-serif; }

/* ============================================================
   Admin — User Account Management
   ============================================================ */

.admin-body { padding: 1.2rem; }

.admin-wrap { }

/* ── Scrollable tab bar ── */
.admin-tabs-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-bottom: 1.2rem;
}
.admin-tabs-inner {
  display: flex;
  gap: 6px;
  background: var(--bg2);
  border-radius: 12px;
  padding: 4px;
  min-width: max-content;
}
.admin-tab2 {
  padding: 9px 10px;
  border: none;
  background: transparent;
  color: var(--text-2);
  border-radius: 8px;
  cursor: pointer;
  font-family: 'Outfit', sans-serif;
  font-size: 0.75rem;
  font-weight: 500;
  white-space: nowrap;
  transition: all 0.2s;
  text-decoration: none;
  display: inline-block;
}
.admin-tab2.active {
  background: var(--blue);
  color: #fff;
  font-weight: 700;
  box-shadow: var(--neo-out-xs);
}
.admin-tab2:disabled {
  cursor: not-allowed;
  opacity: 0.4;
}

.admin-panel { }

/* ── Search + add row ── */
.search-add-row {
  display: flex;
  gap: 8px;
  margin-bottom: 1.2rem;
}
.search-field {
  flex: 1;
  padding: 10px 14px;
  background: var(--bg);
  border: none;
  border-radius: var(--radius-sm);
  box-shadow: var(--neo-in-sm);
  font-family: 'Outfit', sans-serif;
  font-size: 0.88rem;
  color: var(--text-1);
  outline: none;
  min-width: 0;
}
.search-field:focus {
  box-shadow: var(--neo-in), 0 0 0 2px rgba(27, 107, 170, 0.2);
}
.search-field::placeholder { color: var(--text-3); }

.btn-add {
  padding: 10px 18px;
  background: var(--blue);
  border: none;
  border-radius: var(--radius-sm);
  color: #fff;
  font-family: 'Outfit', sans-serif;
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  box-shadow: var(--neo-out-xs);
  white-space: nowrap;
  transition: box-shadow 0.15s;
}
.btn-add:hover { box-shadow: var(--neo-out-sm); color: #fff; }
.btn-add:active { box-shadow: var(--neo-in-sm); }

/* ── User cards ── */
.user-list { display: flex; flex-direction: column; gap: 8px; }

.user-card {
  background: var(--bg);
  border: 1px solid var(--shadow-d);
  border-radius: 14px;
  padding: 1rem 1.2rem;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: var(--neo-out-xs);
  transition: border-color 0.2s;
}
.user-card:hover { border-color: var(--blue-pale); }
.user-card--inactive { opacity: 0.5; }

.uc-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--blue-tint);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'DM Mono', monospace;
  font-weight: 700;
  font-size: 0.78rem;
  color: var(--blue);
  flex-shrink: 0;
}

.user-info { flex: 1; min-width: 0; }

.user-name {
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--text-1);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
}

.user-meta {
  font-family: 'DM Mono', monospace;
  font-size: 0.7rem;
  color: var(--text-3);
  margin-top: 3px;
}

.role-chip {
  padding: 2px 7px;
  border-radius: 20px;
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.rc-field   { background: rgba(27, 107, 170, 0.1);  color: var(--blue); }
.rc-manager { background: rgba(201, 138, 0, 0.12);  color: var(--yellow); }
.rc-hr      { background: rgba(91, 157, 212, 0.15); color: var(--blue-mid); }
.rc-admin   { background: rgba(217, 79, 106, 0.12); color: var(--red); }
.rc-reset   { background: rgba(201, 138, 0, 0.12);  color: var(--yellow); }

.user-actions {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-shrink: 0;
}

.status-toggle {
  padding: 4px 10px;
  border-radius: 20px;
  font-family: 'Outfit', sans-serif;
  font-size: 0.68rem;
  font-weight: 700;
  border: none;
  cursor: default;
}
.st-active   { background: rgba(42, 157, 92, 0.12); color: #1a6b42; }
.st-inactive { background: rgba(217, 79, 106, 0.1); color: var(--red); }

/* Region admin card list */
.region-list { display: flex; flex-direction: column; gap: 10px; }
.region-card { background: var(--bg); box-shadow: var(--neo-out-sm); border-radius: var(--radius-md); overflow: hidden; }
.region-card-head { display: flex; align-items: center; }
.region-card-head .region-row { flex: 1; width: auto; }
.region-card-actions { display: flex; align-items: center; gap: 6px; padding-right: 1.1rem; flex-shrink: 0; }
.region-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 1rem 1.2rem;
  background: transparent;
  border: 0;
  font: inherit;
  text-align: left;
  cursor: pointer;
  color: inherit;
}
.region-row:hover { background: var(--blue-tint); }
.region-icon { font-size: 1.3rem; flex-shrink: 0; }
.region-info { flex: 1; min-width: 0; }
.region-name { font-family: 'Outfit', sans-serif; font-weight: 600; font-size: 0.88rem; color: var(--text-1); }
.region-meta { font-family: 'DM Mono', monospace; font-size: 0.7rem; color: var(--text-3); margin-top: 3px; }
.region-chevron { color: var(--text-3); font-size: 0.7rem; transition: transform 0.2s; flex-shrink: 0; }
.region-card.open .region-chevron { transform: rotate(180deg); }
.region-body { display: none; padding: 0.4rem 1.2rem 1rem; border-top: 1px solid rgba(189, 208, 228, 0.4); }
.region-card.open .region-body { display: block; }
.region-body-label { font-family: 'Outfit', sans-serif; font-size: 0.65rem; color: var(--text-3); text-transform: uppercase; letter-spacing: 1px; margin: 0.6rem 0 0.4rem; }
.region-sub { display: flex; flex-wrap: wrap; gap: 6px; }
.region-tag {
  padding: 4px 10px;
  background: var(--blue-tint);
  border-radius: 20px;
  font-family: 'Outfit', sans-serif;
  font-size: 0.72rem;
  color: var(--text-2);
}

/* Site admin card list */
.site-list { display: flex; flex-direction: column; gap: 10px; }
.site-card { background: var(--bg); box-shadow: var(--neo-out-sm); border-radius: var(--radius-md); padding: 1rem 1.2rem; }
.site-row { display: flex; align-items: center; gap: 10px; }
.site-icon { font-size: 1.2rem; flex-shrink: 0; }
.site-info { flex: 1; min-width: 0; }
.site-name { font-family: 'Outfit', sans-serif; font-weight: 600; font-size: 0.88rem; color: var(--text-1); }
.site-loc { font-family: 'DM Mono', monospace; font-size: 0.7rem; color: var(--text-3); margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.charger-uuid { font-family: 'DM Mono', monospace; font-size: 0.62rem; color: var(--text-3); margin-top: 2px; word-break: break-all; }
.site-card-actions { display: flex; gap: 6px; flex-shrink: 0; }

/* Site status badges */
.site-status-badge { padding: 3px 10px; border-radius: 20px; font-family: 'Outfit', sans-serif; font-size: 0.7rem; font-weight: 700; white-space: nowrap; }
.site-status--live               { background: rgba(42, 157, 92, 0.12);  color: #1a6b42; }
.site-status--under_construction { background: rgba(201, 138, 0, 0.12);  color: var(--yellow); }
.site-status--planned            { background: rgba(27, 107, 170, 0.1);   color: var(--blue); }
.site-status--inactive           { background: rgba(122, 170, 191, 0.12); color: var(--text-3); }

/* Charger status badges */
.charger-status--active         { background: rgba(42, 157, 92, 0.12);  color: #1a6b42; }
.charger-status--inactive       { background: rgba(122, 170, 191, 0.12); color: var(--text-3); }
.charger-status--decommissioned { background: rgba(217, 79, 106, 0.12); color: var(--red); }

/* Site detail page */
.site-name-link { color: inherit; text-decoration: none; }
.site-name-link:hover { color: var(--blue); }
.site-detail-back {
  display: inline-block;
  font-family: 'Outfit', sans-serif;
  font-size: 0.8rem;
  color: var(--text-2);
  text-decoration: none;
  margin-bottom: 1rem;
}
.site-detail-back:hover { color: var(--blue); }
.site-detail-header {
  background: var(--bg);
  border-radius: var(--radius-md);
  box-shadow: var(--neo-out-sm);
  border: 1px solid rgba(255, 255, 255, 0.85);
  padding: 1rem 1.1rem;
  margin-bottom: 1.4rem;
}
.site-detail-title { font-family: 'Outfit', sans-serif; font-weight: 600; font-size: 1rem; color: var(--text-1); }
.site-detail-meta { font-family: 'DM Mono', monospace; font-size: 0.72rem; color: var(--text-3); margin: 4px 0 6px; }
.site-detail-uuid { font-family: 'DM Mono', monospace; font-size: 0.65rem; color: var(--text-3); word-break: break-all; }
.site-detail-section-title {
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.8px;
  font-size: 0.78rem;
  color: var(--text-2);
  margin-bottom: 0.8rem;
}

.btn-icon {
  background: transparent;
  border: 1px solid var(--shadow-d);
  border-radius: var(--radius-xs);
  padding: 5px 8px;
  cursor: pointer;
  font-size: 0.9rem;
  line-height: 1;
  text-decoration: none;
  transition: border-color 0.15s, background 0.15s;
  display: inline-flex;
  align-items: center;
}
.btn-icon:hover { border-color: var(--blue-pale); background: var(--blue-tint); }
.btn-icon--del:hover { border-color: var(--red); background: rgba(217,79,106,0.06); }

.users-empty-state {
  text-align: center;
  color: var(--text-3);
  font-family: 'Outfit', sans-serif;
  font-size: 0.88rem;
  padding: 2rem 0;
}

/* ── Admin form sheet (2-col row helper) ── */
.esc-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

/* ── Stream flash notice ── */
.flash-notice-stream:not(:empty) {
  display: block;
  margin: 0 0 0.8rem;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-family: 'Outfit', sans-serif;
  font-size: 0.85rem;
  background: rgba(27, 107, 170, 0.08);
  color: var(--blue);
  border: 1px solid rgba(27, 107, 170, 0.3);
}

/* ── Admin floating modal ── */
.admin-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(26, 58, 92, 0.5);
  backdrop-filter: blur(3px);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}
.admin-modal-overlay.open { display: flex; }

.admin-modal-card {
  background: var(--bg);
  border: 1px solid rgba(255, 255, 255, 0.90);
  border-radius: var(--radius-lg);
  padding: 2rem;
  width: 100%;
  max-width: 420px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 12px 40px rgba(26, 58, 92, 0.22);
  animation: fadeUp 0.25s ease;
}

.admin-modal-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-1);
  margin: 0 0 4px;
}
.admin-modal-sub {
  font-family: 'Outfit', sans-serif;
  font-size: 0.84rem;
  color: var(--text-2);
  margin: 0 0 1.4rem;
}

.admin-modal-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 1.2rem;
}

/* admin-tab2 used as <a> link */
a.admin-tab2 { text-decoration: none; }

/* ============================================================
   Admin — Department Cards
   ============================================================ */

.dept-list { display: flex; flex-direction: column; gap: 10px; }

.dept-card {
  background: var(--bg);
  border: 1px solid var(--shadow-d);
  border-radius: 14px;
  padding: 1rem 1.2rem;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: var(--neo-out-xs);
  transition: border-color 0.2s;
}
.dept-card:hover { border-color: var(--blue-pale); }
.dept-card--inactive { opacity: 0.5; }

.dept-icon-box {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-xs);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

/* Department color variants — icon box & employee badge */
.ic-green  { background: rgba(42,  157,  92, 0.12); color: #1a6b42; }
.ic-yellow { background: rgba(201, 138,   0, 0.12); color: var(--yellow); }
.ic-blue   { background: rgba(27,  107, 170, 0.10); color: var(--blue); }
.ic-red    { background: rgba(217,  79, 106, 0.12); color: var(--red); }

.dept-info { flex: 1; }

.dept-name {
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-1);
}

.dept-count {
  font-family: 'Outfit', sans-serif;
  font-size: 0.73rem;
  color: var(--text-3);
  margin-top: 2px;
}

.dept-actions { display: flex; gap: 6px; }

/* ============================================================
   Admin — Employee Cards
   ============================================================ */

.emp-list { display: flex; flex-direction: column; gap: 8px; }

.emp-card {
  background: var(--bg);
  border: 1px solid var(--shadow-d);
  border-radius: 16px;
  padding: 1rem 1.2rem;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: var(--neo-out-xs);
  transition: border-color 0.2s;
}
.emp-card:hover { border-color: var(--blue-pale); }
.emp-card--inactive { opacity: 0.5; }

/* Department badge shown on employee cards — reuses .ic-* color classes */
.dept-badge {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 20px;
  font-family: 'Outfit', sans-serif;
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

/* ── System Config ── */
.config-section {
  background: var(--bg);
  box-shadow: var(--neo-out-sm);
  border: 1px solid rgba(255,255,255,0.85);
  border-radius: var(--radius-md);
  padding: 1.2rem;
  margin-bottom: 1rem;
}
.config-section-title {
  font-family: 'Outfit', sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--blue);
  margin-bottom: 1rem;
}
.config-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
  min-height: 32px;
}
.config-tag {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg);
  box-shadow: var(--neo-out-xs);
  border: 1px solid rgba(255,255,255,0.85);
  border-radius: 20px;
  padding: 5px 12px;
  font-family: 'Outfit', sans-serif;
  font-size: 0.8rem;
  color: var(--text-1);
}
.config-tag-del {
  background: transparent;
  border: none;
  color: var(--text-3);
  cursor: pointer;
  font-size: 0.9rem;
  padding: 0;
  line-height: 1;
  transition: color 0.2s;
}
.config-tag-del:hover { color: var(--red); }
.config-add-row {
  display: flex;
  gap: 8px;
}
.config-add-input {
  flex: 1;
  padding: 8px 12px;
  background: var(--bg);
  box-shadow: var(--neo-in-sm);
  border: none;
  border-radius: var(--radius-xs);
  color: var(--text-1);
  font-family: 'Outfit', sans-serif;
  font-size: 0.82rem;
  outline: none;
}
.config-add-input:focus {
  box-shadow: var(--neo-in), 0 0 0 2px rgba(27,107,170,0.2);
}
.config-add-input::placeholder { color: var(--text-3); }
.btn-config-add {
  padding: 8px 14px;
  background: var(--blue);
  border: none;
  border-radius: var(--radius-xs);
  color: #fff;
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 0.8rem;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: var(--neo-out-xs);
}
.btn-config-add:hover { background: var(--blue-mid); }

/* ─────────────────────────── CM Taxonomy (Config page) ───────────────── */
.cm-taxonomy-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.cm-group-card {
  background: var(--bg);
  border: 1px solid var(--shadow-d);
  border-radius: var(--radius-md);
  box-shadow: var(--neo-out-xs);
  overflow: hidden;
  transition: border-color 0.2s;
}
.cm-group-card:hover { border-color: var(--blue-pale); }

.cm-group-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0.8rem 1rem;
  cursor: pointer;
  user-select: none;
}
.cm-group-chevron {
  display: inline-block;
  width: 16px;
  font-size: 0.7rem;
  color: var(--text-3);
  flex-shrink: 0;
  transition: transform 0.15s;
}
.cm-group-name {
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--text-1);
  flex: 1;
}
.cm-group-count {
  font-family: 'DM Mono', monospace;
  font-size: 0.7rem;
  color: var(--text-3);
  background: var(--bg2);
  padding: 2px 8px;
  border-radius: 20px;
  white-space: nowrap;
}

.cm-group-body {
  border-top: 1px solid var(--shadow-d);
  padding: 0.5rem 1rem 0.8rem 2.2rem;
}
.cm-child-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
}
.cm-child-row + .cm-child-row { border-top: 1px solid rgba(189,208,228,0.3); }
.cm-child-name {
  flex: 1;
  font-family: 'Outfit', sans-serif;
  font-size: 0.82rem;
  color: var(--text-2);
}
.cm-child-edit-form {
  flex: 1;
  align-items: center;
  gap: 4px;
}
.cm-child-edit-form:not([hidden]) {
  display: flex;
}
.cm-child-edit-input {
  flex: 1;
  padding: 4px 8px;
  background: var(--bg2);
  border: 1px solid var(--blue-pale);
  border-radius: var(--radius-xs);
  color: var(--text-1);
  font-family: 'Outfit', sans-serif;
  font-size: 0.82rem;
  outline: none;
  box-shadow: var(--neo-in-sm);
}
.cm-child-edit-input:focus { border-color: var(--blue); }

.cm-child-empty {
  font-family: 'Outfit', sans-serif;
  font-size: 0.78rem;
  color: var(--text-3);
  padding: 4px 0;
  font-style: italic;
}
.cm-child-add-toggle {
  font-family: 'Outfit', sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--blue);
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 0;
  margin-top: 8px;
}
.cm-child-add-toggle:hover { color: var(--blue-mid); }

.cm-child-add-row {
  gap: 8px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--shadow-d);
}
.cm-child-add-row.is-open {
  display: flex;
}
.cm-child-add-input {
  flex: 1;
  padding: 6px 10px;
  background: var(--bg2);
  box-shadow: var(--neo-in-sm);
  border: none;
  border-radius: var(--radius-xs);
  color: var(--text-1);
  font-family: 'Outfit', sans-serif;
  font-size: 0.8rem;
  outline: none;
}
.cm-child-add-input:focus {
  box-shadow: var(--neo-in-sm), 0 0 0 2px rgba(27,107,170,0.2);
}
.cm-child-add-input::placeholder { color: var(--text-3); }

/* small icon button variant */
.btn-icon--sm {
  width: 26px;
  height: 26px;
  font-size: 0.75rem;
  justify-content: center;
}
/* ─────────────────────────── Parts Inventory ─────────────────────────── */
.parts-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 1rem;
}
.parts-stat {
  background: var(--bg);
  box-shadow: var(--neo-out-xs);
  border: 1px solid rgba(255, 255, 255, 0.85);
  border-radius: var(--radius-md);
  padding: 0.8rem 0.5rem;
  text-align: center;
}
.parts-stat-num {
  font-family: 'DM Mono', monospace;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--blue);
  line-height: 1.1;
}
.parts-stat-num--warn { color: var(--yellow); }
.parts-stat-label {
  font-family: 'Outfit', sans-serif;
  font-size: 0.62rem;
  letter-spacing: 1.4px;
  color: var(--text-3);
  margin-top: 4px;
  text-transform: uppercase;
}

.parts-list { display: flex; flex-direction: column; gap: 8px; }

.part-inv-card {
  background: var(--bg);
  box-shadow: var(--neo-out-sm);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: var(--radius-md);
  padding: 0.9rem 1.1rem;
  display: flex;
  align-items: center;
  gap: 12px;
}
.part-inv-card--low { box-shadow: var(--neo-out-sm), 0 0 0 2px var(--yellow); }
.part-inv-card--out { box-shadow: var(--neo-out-sm), 0 0 0 2px var(--red); }

.part-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  background: var(--blue-tint);
  box-shadow: var(--neo-out-xs);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.part-info { flex: 1; min-width: 0; }
.part-name {
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--text-1);
}
.part-meta {
  font-family: 'DM Mono', monospace;
  font-size: 0.7rem;
  color: var(--text-3);
  margin-top: 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.part-stock { text-align: right; flex-shrink: 0; }
.part-qty {
  font-family: 'DM Mono', monospace;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-1);
}
.part-qty--low { color: var(--yellow); }
.part-qty--out { color: var(--red); }
.part-unit {
  font-family: 'Outfit', sans-serif;
  font-size: 0.66rem;
  color: var(--text-3);
  margin-top: 2px;
}
.part-unit--out { color: var(--red); font-weight: 700; letter-spacing: 0.04em; }

.part-actions { display: flex; gap: 6px; flex-shrink: 0; }

/* Contractor badge — shown next to name on contractor cards */
.contractor-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 20px;
  font-family: 'Outfit', sans-serif;
  font-size: 0.65rem;
  font-weight: 700;
  background: rgba(122, 158, 148, 0.12);
  color: var(--text-3);
  border: 1px solid rgba(122, 158, 148, 0.2);
  margin-left: 6px;
}

/* Contract expiry warning — applied to dates within 30 days */
.expiry-warning {
  color: var(--yellow);
  font-weight: 600;
}

/* ── SLA configuration panel ── */
.sla-banner {
  background: var(--bg);
  box-shadow: var(--neo-in-sm);
  border-radius: var(--radius-md);
  padding: 0.85rem 1.1rem;
  margin-bottom: 1rem;
  font-family: 'Outfit', sans-serif;
  font-size: 0.8rem;
  color: var(--text-2);
  line-height: 1.45;
}
.sla-banner strong { color: var(--text-1); font-weight: 600; }

.sla-list { display: flex; flex-direction: column; gap: 10px; }

.sla-card-frame { display: block; }

.sla-card {
  background: var(--bg);
  box-shadow: var(--neo-out-sm);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: var(--radius-md);
  padding: 0.9rem 1.1rem;
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
}
.sla-card--breach { box-shadow: var(--neo-out-sm), 0 0 0 1px rgba(217, 79, 106, 0.35); }

.sla-status {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.sla-ok     { background: var(--blue-light); box-shadow: 0 0 0 3px rgba(91, 157, 212, 0.18); }
.sla-breach { background: var(--red);        box-shadow: 0 0 0 3px rgba(217, 79, 106, 0.22); animation: sla-pulse 1.4s infinite; }

@keyframes sla-pulse {
  0%   { box-shadow: 0 0 0 0   rgba(217, 79, 106, 0.55); }
  70%  { box-shadow: 0 0 0 8px rgba(217, 79, 106, 0);    }
  100% { box-shadow: 0 0 0 0   rgba(217, 79, 106, 0);    }
}

.sla-info { flex: 1; min-width: 0; }
.sla-station {
  font-family: 'DM Mono', monospace;
  font-weight: 500;
  font-size: 0.85rem;
  color: var(--text-1);
  letter-spacing: 0.4px;
}
.sla-type {
  font-family: 'Outfit', sans-serif;
  font-size: 0.72rem;
  color: var(--text-3);
  margin-top: 3px;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.sla-breach-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 20px;
  background: rgba(217, 79, 106, 0.12);
  color: var(--red);
  font-family: 'Outfit', sans-serif;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.3px;
}
.sla-down-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 20px;
  background: rgba(201, 138, 0, 0.10);
  color: var(--yellow);
  font-family: 'Outfit', sans-serif;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.3px;
}

.sla-threshold {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.sla-spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid rgba(91, 157, 212, 0.25);
  border-top-color: var(--blue);
  opacity: 0;
  transition: opacity 0.12s;
  animation: sla-spin 0.7s linear infinite;
}
.sla-spinner[data-loading] { opacity: 1; }

@keyframes sla-spin {
  to { transform: rotate(360deg); }
}

.sla-input {
  width: 64px;
  padding: 6px 8px;
  background: var(--bg);
  box-shadow: var(--neo-in-sm);
  border: none;
  border-radius: var(--radius-xs);
  font-family: 'DM Mono', monospace;
  font-size: 0.85rem;
  color: var(--text-1);
  text-align: center;
  outline: none;
  -moz-appearance: textfield;
}
.sla-input::-webkit-outer-spin-button,
.sla-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.sla-input:focus { box-shadow: var(--neo-in-sm), 0 0 0 2px var(--blue); }

.sla-unit {
  font-family: 'Outfit', sans-serif;
  font-size: 0.72rem;
  color: var(--text-3);
}

/* ─────────────────────────────────────── */
/* HR Leave Tracker                        */
/* ─────────────────────────────────────── */

/* Green token (introduced for leave tracker — Arctic-Frost-compatible cool green) */
:root {
  --green:      #2A9D5C;
  --green-deep: #1A6B42;
}

.leave-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}
.leave-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-1);
}

.btn-add-leave {
  background: var(--blue);
  color: #fff;
  font-family: 'Outfit', sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 8px 14px;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  box-shadow: var(--neo-out-xs);
}
.btn-add-leave:active { box-shadow: var(--neo-in-sm); }

.leave-list { display: flex; flex-direction: column; gap: 8px; }

.leave-card {
  background: var(--bg);
  border-radius: var(--radius-md);
  box-shadow: var(--neo-out-sm);
  border: 1px solid rgba(255, 255, 255, 0.7);
  padding: 0.9rem 1.1rem;
  display: flex;
  align-items: center;
  gap: 12px;
}

.leave-info { flex: 1; min-width: 0; }
.leave-name {
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--text-1);
}
.leave-detail {
  font-family: 'Outfit', sans-serif;
  font-size: 0.72rem;
  color: var(--text-3);
  margin-top: 3px;
  word-break: break-word;
}

.leave-type {
  padding: 4px 10px;
  border-radius: 20px;
  font-family: 'Outfit', sans-serif;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  flex-shrink: 0;
  white-space: nowrap;
}
.lt-annual   { background: rgba(42, 157, 92, 0.12);  color: var(--green-deep); }
.lt-sick     { background: rgba(217, 79, 106, 0.12); color: var(--red); }
.lt-personal { background: rgba(27, 107, 170, 0.12); color: var(--blue); }
.lt-unpaid   { background: rgba(122, 170, 191, 0.12); color: var(--text-3); }

.leave-days {
  font-family: 'DM Mono', monospace;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-3);
  flex-shrink: 0;
}

.btn-leave-edit,
.btn-leave-del {
  background: var(--bg);
  border: none;
  box-shadow: var(--neo-out-xs);
  border-radius: var(--radius-xs);
  padding: 6px 9px;
  font-size: 0.85rem;
  cursor: pointer;
  flex-shrink: 0;
  transition: box-shadow 0.15s;
}
.btn-leave-edit:active,
.btn-leave-del:active { box-shadow: var(--neo-in-sm); }

/* button_to wraps the delete button in an inline form — strip wrapper margin */
.leave-card form { margin: 0; display: inline-flex; flex-shrink: 0; }

/* Delete-confirm bottom-sheet */
.checkout-sheet--confirm { padding-bottom: 1.5rem; }
.checkout-sheet--confirm form.button_to { margin: 0; }
.leave-del-warn {
  font-family: 'Outfit', sans-serif;
  font-size: 0.82rem;
  color: var(--text-2);
  text-align: center;
  margin: 0.5rem 0 1.25rem;
  line-height: 1.45;
}
.escalation-btn--danger {
  width: 100%;
  background: var(--red);
  color: #fff;
}
.escalation-btn--danger:active { opacity: 0.88; }

/* Side-by-side date inputs in the leave modal */
.leave-date-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.leave-date-row .escalation-form-group { margin-bottom: 0.75rem; }

/* ── Success Overlay (check-in/out confirmation) ── */
.success-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  opacity: 0;
  transition: opacity 0.4s ease;
}

.success-overlay.visible { opacity: 1; }

.success-overlay__icon {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--blue);
  background: var(--bg);
  box-shadow: var(--neo-out);
  border: 2px solid rgba(27, 107, 170, 0.25);
  animation: successPop 0.5s ease 0.1s both;
}

.success-overlay__label {
  margin-top: 1.25rem;
  font-family: 'Outfit', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-1);
  animation: fadeUp 0.6s ease 0.25s both;
}

@keyframes successPop {
  0%   { transform: scale(0.5); opacity: 0; }
  60%  { transform: scale(1.1); }
  100% { transform: scale(1);   opacity: 1; }
}

/* ── CM After Photos Grid ──────────────────────────────────────────── */
.cm-photo-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 0.8rem;
}

.cm-photo-slot {
  background: var(--bg);
  border-radius: var(--radius-md);
  box-shadow: var(--neo-out-sm);
  padding: 10px;
  position: relative;
}

.cm-photo-slot .camera-box {
  margin-bottom: 8px;
}

.cm-photo-remove-wrap {
  position: absolute;
  top: 6px;
  right: 6px;
  z-index: 3;
}

.cm-photo-remove {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: none;
  background: var(--red);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.cm-photo-remove:active {
  transform: scale(0.9);
}

.cm-photo-desc-input {
  font-size: 0.75rem;
  min-height: 40px;
}

/* ── CM BSS Fault Diagnosis ────────────────────────────────────────── */
.cm-bss-fault-section {
  margin-bottom: 0.9rem;
}

.cm-bss-fault-section > .input-label {
  display: block;
  margin-bottom: 8px;
}

.cm-fault-card {
  background: var(--bg);
  box-shadow: var(--neo-out-sm);
  border-radius: var(--radius-md);
  margin-bottom: 10px;
  overflow: hidden;
}

.cm-fault-card-head {
  padding: 0.75rem 0.9rem;
  display: flex;
  align-items: center;
  gap: 10px;
}

.cm-fault-num {
  width: 26px;
  height: 26px;
  border-radius: var(--radius-xs);
  background: var(--bg);
  box-shadow: var(--neo-out-xs);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'DM Mono', monospace;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-3);
  flex-shrink: 0;
}

.cm-fault-num.has-type {
  color: var(--blue);
  box-shadow: var(--neo-in-sm), 0 0 0 1.5px var(--blue);
}

.cm-fault-label {
  flex: 1;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-1);
}

.cm-fault-remove {
  background: none;
  border: none;
  color: var(--red);
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1;
  padding: 4px 6px;
  border-radius: var(--radius-xs);
  cursor: pointer;
}

.cm-fault-remove:hover {
  background: rgba(217, 79, 106, 0.08);
}

.cm-fault-body {
  padding: 0 0.9rem 0.9rem;
}

.cm-fault-body .input-select {
  margin-bottom: 10px;
}

.cm-slot-label,
.cm-diag-label {
  font-size: 0.64rem;
  color: var(--text-3);
  letter-spacing: 0.8px;
  text-transform: uppercase;
  font-weight: 600;
  margin: 8px 0 6px;
}

.cm-slot-selector {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.cm-slot-chip {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-xs);
  background: var(--bg);
  box-shadow: var(--neo-out-xs);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'DM Mono', monospace;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-3);
  cursor: pointer;
  transition: color 0.15s;
}

.cm-slot-chip.affected {
  color: var(--blue);
  box-shadow: var(--neo-in-sm), 0 0 0 1.5px var(--blue);
}

.cm-diag-sub {
  color: var(--text-3);
  font-size: 0.9em;
}

/* ── CM Spare Parts (code-field matches PM) ────────────────────────── */
.part-code-field {
  flex: 1;
  min-width: 0;
}

.part-name-field {
  flex: 1;
  min-width: 0;
  background: var(--bg2);
  color: var(--text-3);
  cursor: default;
}

/* ── Manager Modal Photo Description ───────────────────────────────── */
.worker-modal-photo-desc {
  font-family: 'Outfit', sans-serif;
  font-size: 0.72rem;
  color: var(--text-2);
  margin-top: 4px;
  padding: 4px 6px;
  background: var(--bg2);
  border-radius: var(--radius-xs);
}

/* ── Watermark Overlay ──────────────────────────────────────────────── */
.watermark-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  overflow: hidden;
}

.watermark-container {
  position: absolute;
  top: -100%;
  left: -100%;
  width: 300%;
  height: 300%;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 80px 40px;
  padding: 80px;
  transform: rotate(-30deg);
}

.watermark-text {
  font-family: 'Outfit', sans-serif;
  font-size: 1.25rem;
  color: var(--text-1);
  opacity: 0.1;
  white-space: nowrap;
  user-select: none;
  text-align: center;
}


/* Reduced motion: collapse every animation and transition to near-zero. Kept
   near-zero rather than none so animationend/transitionend still fire for JS
   that waits on them (e.g. success_overlay_controller), and iteration count
   is forced to 1 so infinite pulse loops actually stop. */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0ms !important;
    scroll-behavior: auto !important;
  }
}

