/* ============================================================
   NightHawk Employee Field App — employee.css
   Mobile-first dark theme
   ============================================================ */

:root {
  --bg-0: #0d1117;
  --bg-1: #161b22;
  --bg-2: #21262d;
  --bg-3: #2d333b;
  --border: #30363d;
  --text-1: #e6edf3;
  --text-2: #8b949e;
  --text-3: #8b98a5; /* E13: lightened from #6e7681 for night readability */

  --red: #d90000;
  --red-hover: #b80000;
  --red-dim: rgba(217, 0, 0, 0.12);
  --blue: #58a6ff;
  --blue-dim: rgba(88, 166, 255, 0.12);

  --green: #3fb950;
  --green-dim: rgba(63, 185, 80, 0.12);

  --yellow: #e3b341;
  --yellow-dim: rgba(227, 179, 65, 0.12);

  --danger: #f85149;
  --danger-dim: rgba(248, 81, 73, 0.12);

  --orange: #f0883e;
  --orange-dim: rgba(240, 136, 62, 0.12);

  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 8px 32px rgba(0,0,0,0.5);
  --trans: 0.18s ease;
  --header-h: 56px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  height: 100%;
  /* Prevent pull-to-refresh interfering with scrollable content */
  overscroll-behavior: none;
}

body {
  /* Brand font app-wide (loaded from ../assets/css/Poppins.css) */
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg-0);
  color: var(--text-1);
  font-size: 15px;
  line-height: 1.5;
  min-height: 100%;
  /* Safe area insets for notched phones */
  padding-bottom: env(safe-area-inset-bottom);
}

/* ============================================================
   Boot Splash — covers the ~200ms gap between first paint and Firebase
   restoring a signed-in session on reload, so the login screen never
   flashes. Always #0c0c0c regardless of theme (shown before any theme/auth
   context exists). Removed for good by the first onAuthStateChanged
   callback — see the Auth section of the module script.
   ============================================================ */
#boot-splash {
  position: fixed;
  inset: 0;
  z-index: 100000; /* above every other overlay (highest existing is 10000) */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  background: #0c0c0c;
}

.boot-splash-logo {
  width: 64px;
  height: 64px;
  object-fit: contain;
}

.boot-splash-spinner {
  width: 28px;
  height: 28px;
  border: 3px solid rgba(255,255,255,0.15);
  border-top-color: #d90000;
  border-radius: 50%;
  animation: boot-splash-spin 0.8s linear infinite;
}

@keyframes boot-splash-spin {
  to { transform: rotate(360deg); }
}

/* ============================================================
   Screens
   ============================================================ */
.screen {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Centered card screens (login, unauthorized, success) */
.screen-centered {
  align-items: center;
  justify-content: center;
  padding: 24px 20px;
  background: radial-gradient(ellipse at 50% -10%, rgba(180,0,0,0.2) 0%, transparent 55%), var(--bg-0);
}

.screen-card {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 36px 28px;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow);
  text-align: center;
}

.app-logo {
  width: 140px;
  margin-bottom: 20px;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,0.4));
}

.screen-card h1 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 4px;
}

.screen-card h2 {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 10px;
}

.screen-subtitle {
  font-size: 13px;
  color: var(--text-2);
  margin-bottom: 28px;
}

/* ============================================================
   Login — NightHawk shared staff-login spec (matches the other
   staff portals exactly; portal badge is the differentiator)
   ============================================================ */
#screen-login {
  background: radial-gradient(1200px 600px at 50% -10%, rgba(217,0,0,.12), transparent 60%), #0c0c0c;
}

.login-card {
  max-width: 400px;
  width: 100%;
  background: #161616;
  border: 1px solid #262626;
  border-radius: 16px;
  padding: 36px 30px;
  box-shadow: 0 20px 60px rgba(0,0,0,.5);
  text-align: center;
}

.login-logo {
  height: 72px;
  width: auto;
  margin-bottom: 12px;
}

.login-wordmark {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-weight: 800;
  font-size: 18px;
  letter-spacing: .06em;
  color: #fff;
}
.login-wordmark span { color: #ff2020; }

.login-wordmark-sub {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .2em;
  color: #9aa0a6;
  margin-bottom: 14px;
}

.login-portal-badge {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  padding: 7px 16px;
  border-radius: 999px;
  background: rgba(217,0,0,.12);
  border: 1px solid rgba(217,0,0,.35);
  color: #ff6b6b;
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.login-descriptor {
  font-size: 12.5px;
  color: #9aa0a6;
  margin: 10px 0 22px;
}

#screen-login .field-group { margin-bottom: 16px; }

#screen-login .field-group label {
  font-size: 12px;
  font-weight: 600;
  color: #9aa0a6;
  text-align: left;
  text-transform: none;
  letter-spacing: 0;
}

#screen-login .field-group input {
  min-height: 48px;
  background: #0f0f0f;
  border: 1px solid #2a2a2a;
  border-radius: 10px;
  color: #e8e8e8;
  font-size: 16px;   /* 16px prevents iOS zoom-on-focus */
  padding: 12px 14px;
}

#screen-login .field-group input:focus {
  border-color: #d90000;
  box-shadow: 0 0 0 3px rgba(217,0,0,.18);
}

#screen-login .btn-primary {
  width: 100%;
  min-height: 48px;
  border-radius: 10px;
  background: linear-gradient(135deg, #d90000, #a30000);
  color: #fff;
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-weight: 700;
  font-size: 15px;
}
#screen-login .btn-primary:hover    { background: linear-gradient(135deg, #d90000, #a30000); filter: brightness(1.1); }
#screen-login .btn-primary:disabled { opacity: .6; }

#screen-login .error-msg {
  background: rgba(255,48,48,.1);
  border: 1px solid rgba(255,48,48,.4);
  color: #ff8585;
  border-radius: 10px;
  font-size: 13px;
  padding: 10px 12px;
}

/* Forgot-password success copy — visually distinct from the red error-msg
   above (same anti-enumeration message shows for both a real account and
   auth/user-not-found, so it must never look alarming). */
#screen-login .success-info {
  background: rgba(63,185,80,.12);
  border: 1px solid rgba(63,185,80,.4);
  color: #7ee2a8;
  border-radius: 10px;
  font-size: 13px;
  padding: 10px 12px;
}

#screen-login .btn-link { color: #9aa0a6; }
#screen-login .btn-link:hover { color: #fff; }

.login-footer {
  font-size: 11px;
  color: #6e6e6e;
  margin-top: 18px;
}

/* ============================================================
   App Header (property / violation screens)
   ============================================================ */
.app-header {
  height: var(--header-h);
  background: var(--bg-1);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 50;
  flex-shrink: 0;
}


.header-title {
  flex: 1;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-1);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.header-subtitle {
  font-size: 11px;
  color: var(--text-2);
  font-weight: 400;
  display: block;
}

/* ============================================================
   Screen Content (scrollable body below header)
   ============================================================ */
.screen-body {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 20px 16px 32px;
}

.screen-heading {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 4px;
}

.screen-sub {
  font-size: 13px;
  color: var(--text-2);
  margin-bottom: 20px;
}

/* ============================================================
   Buttons
   ============================================================ */
.btn-primary {
  font-family: inherit; /* buttons don't inherit by default — keep Poppins */
  background: var(--red);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 14px 20px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background var(--trans);
  -webkit-tap-highlight-color: transparent;
}
.btn-primary:hover { background: var(--red-hover); }
.btn-primary:active { opacity: 0.85; }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary.btn-full { width: 100%; }

.btn-secondary {
  font-family: inherit;
  background: var(--bg-2);
  color: var(--text-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 20px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background var(--trans);
  -webkit-tap-highlight-color: transparent;
}
.btn-secondary:hover { background: var(--bg-3); }
.btn-secondary.btn-full { width: 100%; }

.btn-icon-only {
  font-family: inherit;
  background: none;
  border: none;
  color: var(--text-2);
  font-size: 18px;
  cursor: pointer;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
  min-width: 40px;
  min-height: 40px;
}
.btn-icon-only:hover { color: var(--text-1); background: var(--bg-2); }

.btn-back {
  font-family: inherit;
  background: none;
  border: none;
  color: var(--text-2);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  padding: 8px;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
  min-width: 40px;
  min-height: 40px;
}
.btn-back:hover { color: var(--text-1); }

/* Link-style button (Forgot password? / Email me a reset link instead) —
   text-only, no border/background, so it reads as secondary to the
   btn-primary/btn-secondary actions above it. */
.btn-link {
  display: block;
  width: 100%;
  margin-top: 4px;
  background: none;
  border: none;
  font-family: inherit;
  color: var(--text-2);
  font-size: 12.5px;
  text-decoration: underline;
  text-align: center;
  padding: 10px 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.btn-link:hover { color: var(--text-1); }

/* E10: two-step sign-out — armed state ("Tap again to sign out", 3s revert) */
.signout-armed,
.btn-icon-only.signout-armed,
.btn-secondary.signout-armed {
  background: var(--red);
  border: 1px solid var(--red);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  gap: 6px;
  white-space: nowrap;
  padding: 8px 12px;
}
.btn-icon-only.signout-armed:hover,
.btn-secondary.signout-armed:hover {
  background: var(--red-hover);
  color: #fff;
}

/* ============================================================
   Form Fields
   ============================================================ */
.field-group {
  margin-bottom: 20px;
}

.field-group label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-2);
  margin-bottom: 8px;
}

.field-group input[type="text"],
.field-group input[type="email"],
.field-group input[type="password"],
.field-group textarea,
.field-group select {
  width: 100%;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-1);
  padding: 13px 14px;
  font-size: 16px; /* 16px prevents iOS zoom on focus */
  font-family: inherit;
  outline: none;
  transition: border-color var(--trans), box-shadow var(--trans);
}

.field-group input:focus,
.field-group textarea:focus,
.field-group select:focus {
  border-color: var(--red);
  box-shadow: 0 0 0 3px var(--red-dim);
}

.field-group textarea {
  resize: vertical;
  min-height: 88px;
}

.field-hint {
  font-size: 11px;
  color: var(--text-3);
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
}

.req { color: var(--danger); }

/* ============================================================
   Error Message
   ============================================================ */
.error-msg {
  background: var(--danger-dim);
  border: 1px solid rgba(248,81,73,0.35);
  color: var(--danger);
  border-radius: var(--radius-sm);
  padding: 11px 14px;
  font-size: 13px;
  margin-bottom: 16px;
  text-align: left;
}

/* ============================================================
   Success / Info Message — same shape as .error-msg, green instead of
   red (e.g. "password updated", "reset link sent"). Kept visually
   distinct from .error-msg so a success copy never reads as alarming.
   ============================================================ */
.success-info {
  background: var(--green-dim);
  border: 1px solid rgba(63,185,80,0.35);
  color: var(--green);
  border-radius: var(--radius-sm);
  padding: 11px 14px;
  font-size: 13px;
  margin-bottom: 16px;
  text-align: left;
}

/* ============================================================
   Loading Screen
   ============================================================ */
.loading-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  gap: 14px;
  color: var(--text-2);
}

.loading-icon { font-size: 32px; color: var(--red); }

/* ============================================================
   Unauthorized Screen
   ============================================================ */
.unauth-icon {
  font-size: 48px;
  color: var(--danger);
  margin-bottom: 16px;
}

.unauth-msg {
  font-size: 14px;
  color: var(--text-2);
  margin-bottom: 24px;
  line-height: 1.6;
}

/* ============================================================
   Property Cards
   ============================================================ */
.prop-card {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  transition: background var(--trans), border-color var(--trans);
  -webkit-tap-highlight-color: transparent;
}

.prop-card:hover,
.prop-card:active {
  background: var(--bg-2);
  border-color: var(--red);
}

.prop-card-icon {
  width: 44px;
  height: 44px;
  background: var(--red-dim);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--red);
  font-size: 18px;
  flex-shrink: 0;
}

.prop-card-body { flex: 1; overflow: hidden; }

.prop-card-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-1);
  margin-bottom: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.prop-card-loc {
  font-size: 13px;
  color: var(--text-2);
  display: flex;
  align-items: center;
  gap: 5px;
}

.prop-card-arrow {
  color: var(--text-3);
  font-size: 13px;
  flex-shrink: 0;
}

.props-loading {
  text-align: center;
  padding: 40px 0;
  color: var(--text-2);
}

/* ============================================================
   Violation Type Chips
   ============================================================ */
.vtype-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.vtype-chip {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 13px 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  transition: all var(--trans);
  -webkit-tap-highlight-color: transparent;
  min-height: 48px;
}

.vtype-chip:hover,
.vtype-chip:active {
  background: var(--bg-3);
  border-color: var(--text-2);
}

.vtype-chip.selected {
  background: var(--red-dim);
  border-color: var(--red);
}

.vtype-chip.selected .vtype-label { color: var(--text-1); font-weight: 700; }

.vtype-label {
  font-size: 14px;
  color: var(--text-1);
  flex: 1;
}

.severity-badge {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 2px 7px;
  border-radius: 99px;
  flex-shrink: 0;
}

.severity-badge.high   { background: var(--danger-dim);  color: var(--danger); }
.severity-badge.medium { background: var(--orange-dim);  color: var(--orange); }
.severity-badge.low    { background: var(--bg-3);        color: var(--text-3); }

.vtype-check {
  color: var(--red);
  font-size: 16px;
  display: none;
  flex-shrink: 0;
}

.vtype-chip.selected .vtype-check { display: block; }

/* ============================================================
   Photo Upload
   ============================================================ */
.photo-upload-area {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 20px;
  background: var(--bg-2);
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 12px;
}

.photo-thumb {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg-3);
}

.photo-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.photo-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  background: rgba(0,0,0,0.7);
  border: none;
  color: #fff;
  /* E6: glove-sized hit area (was 26px) */
  width: 38px;
  height: 38px;
  border-radius: 50%;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
}

.btn-add-photo {
  width: 100%;
  background: var(--bg-3);
  border: 1px solid var(--border);
  color: var(--text-2);
  border-radius: var(--radius-sm);
  padding: 12px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all var(--trans);
  min-height: 48px;
  -webkit-tap-highlight-color: transparent;
}

.btn-add-photo:hover { background: var(--bg-2); color: var(--text-1); border-color: var(--text-2); }

/* E3: camera-first — Take Photo (primary) + Gallery (secondary) side by side */
.photo-btn-row {
  display: flex;
  gap: 8px;
}
.photo-btn-row .btn-add-photo { flex: 1 1 0; }
.btn-take-photo {
  background: var(--red-dim);
  border-color: rgba(217, 0, 0, 0.5);
  color: #ff6b6b;
}
.btn-take-photo:hover {
  background: rgba(217, 0, 0, 0.2);
  color: #ff8585;
  border-color: var(--red);
}

.photo-count-msg {
  font-size: 12px;
  color: var(--text-3);
  text-align: center;
  margin-top: 8px;
}

/* ============================================================
   Success Screen
   ============================================================ */
.success-icon {
  font-size: 52px;
  color: var(--green);
  margin-bottom: 16px;
}

.success-detail {
  font-size: 14px;
  color: var(--text-2);
  margin-bottom: 28px;
  line-height: 1.6;
}

.success-detail strong { color: var(--text-1); }

.success-types {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin: 10px 0 8px;
}

.success-vtype {
  font-size: 12px;
  padding: 3px 10px;
}

.success-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* ============================================================
   Toast
   ============================================================ */
.toast {
  position: fixed;
  bottom: calc(20px + env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: var(--shadow);
  z-index: 9999;
  font-size: 14px;
  max-width: calc(100vw - 32px);
  min-width: 260px;
  animation: toastIn 0.22s ease;
}

.toast.toast-success { border-color: rgba(63,185,80,0.4); }
.toast.toast-success .toast-icon { color: var(--green); }
.toast.toast-error   { border-color: rgba(248,81,73,0.4); }
.toast.toast-error   .toast-icon { color: var(--danger); }
.toast.toast-warning { border-color: rgba(227,179,65,0.4); }
.toast.toast-warning .toast-icon { color: var(--yellow); }

/* E5: toast with a tap action (e.g. jump to the new request's card) */
.toast.toast-tappable {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.toast.toast-tappable:active { transform: translateX(-50%) scale(0.98); }

@keyframes toastIn {
  from { transform: translateX(-50%) translateY(20px); opacity: 0; }
  to   { transform: translateX(-50%) translateY(0);    opacity: 1; }
}

/* ============================================================
   Employee name chip in header
   ============================================================ */
.employee-chip {
  font-size: 12px;
  color: var(--text-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 120px;
}

/* ============================================================
   Divider
   ============================================================ */
.section-divider {
  height: 1px;
  background: var(--border);
  margin: 20px 0;
}

/* ============================================================
   Property Detail Screen
   ============================================================ */
.pd-card {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.pd-hero {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 18px;
  background: linear-gradient(135deg, rgba(217,0,0,0.07) 0%, transparent 60%);
  border-bottom: 1px solid var(--border);
}

.pd-hero-icon {
  width: 54px;
  height: 54px;
  background: var(--red-dim);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--red);
  font-size: 22px;
  flex-shrink: 0;
}

.pd-hero-text { flex: 1; overflow: hidden; }

.pd-name {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-1);
  margin-bottom: 2px;
  line-height: 1.3;
}

.pd-city { font-size: 13px; color: var(--text-2); }

.pd-rows { padding: 4px 0; }

.pd-row {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}
.pd-row:last-child { border-bottom: none; }

.pd-icon {
  width: 36px;
  height: 36px;
  background: var(--bg-2);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--red);
  font-size: 14px;
  flex-shrink: 0;
  margin-top: 1px;
}

.pd-icon-green { background: var(--green-dim); color: var(--green); }

.pd-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
  min-width: 0;
}

.pd-label {
  font-size: 11.5px; /* E13: bumped from 10px for night readability */
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-3);
  font-weight: 700;
}

.pd-value { font-size: 14px; color: var(--text-1); }

.pd-link {
  font-size: 14px;
  color: var(--blue);
  text-decoration: none;
  word-break: break-word;
}
.pd-link:hover { text-decoration: underline; }

.pd-notes-wrap {
  padding: 14px 18px;
  border-top: 1px solid var(--border);
  background: rgba(227, 179, 65, 0.04);
}

.pd-notes {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.6;
}

.pd-notes i { color: var(--yellow); margin-top: 2px; flex-shrink: 0; }

/* ============================================================
   Responsive — tablet (540px) and desktop (900px)
   ============================================================ */
@media (min-width: 540px) {
  .screen-centered { background: var(--bg-0); }

  .app-header { padding: 0 24px; }

  .screen-body {
    max-width: 580px;
    margin: 0 auto;
    padding-left: 28px;
    padding-right: 28px;
  }
}

@media (min-width: 900px) {
  .screen-body {
    max-width: 720px;
    padding: 28px 32px 48px;
  }

  /* Property cards: 2-column grid */
  #property-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
  }
  .prop-card { margin-bottom: 0; }

  /* Violation type chips: 2-column grid */
  .vtype-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  /* Larger photo grid on desktop */
  .photo-grid {
    grid-template-columns: repeat(3, 140px);
  }
}

/* ══════════════════════════════════════════════════════════════
   Open Pickup Requests
   ══════════════════════════════════════════════════════════════ */
.pr-section { margin-top: 22px; }
.pr-section-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.pr-section-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-1);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}
.pr-section-title i { color: var(--red); }
.pr-count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  background: var(--red);
  border-radius: 10px;
}
.pr-list { display: flex; flex-direction: column; gap: 10px; }
.pr-empty {
  font-size: 13px;
  color: var(--text-3);
  padding: 12px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}
.pr-empty .fa-check-circle { color: var(--green); }
.pr-empty-err { color: var(--danger); }

.pr-card {
  background: var(--bg-1);
  border: 1px solid var(--border);
  /* E11: constant-width left rail so the urgency tint never shifts layout */
  border-left-width: 3px;
  border-radius: var(--radius);
  padding: 13px 14px;
}
/* E11: urgency escalation — amber ≥30 min waiting, red ≥60 min (subtle rail
   + time tint only; no full repaint) */
.pr-card.pr-age-warn { border-left-color: var(--yellow); }
.pr-card.pr-age-late { border-left-color: var(--danger); }
.pr-card.pr-age-warn .pr-time { color: var(--yellow); }
.pr-card.pr-age-late .pr-time { color: var(--danger); }
.pr-card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}
.pr-unit {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-1);
}
.pr-unit i { color: var(--red); margin-right: 5px; }
.pr-time { font-size: 12px; color: var(--text-3); white-space: nowrap; }
.pr-note {
  margin-top: 8px;
  font-size: 13px;
  color: var(--text-2);
  background: var(--bg-2);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
}
.pr-note i { color: var(--text-3); margin-right: 5px; }

.pr-actions { display: flex; gap: 8px; margin-top: 12px; }
.pr-btn {
  flex: 1 1 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  padding: 9px 10px;
  min-height: 48px; /* E6: glove-sized targets (also covers Confirm/Cancel) */
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-2);
  color: var(--text-1);
  cursor: pointer;
  transition: background var(--trans), border-color var(--trans), opacity var(--trans);
  -webkit-tap-highlight-color: transparent;
}
.pr-btn:active { transform: translateY(1px); }
/* Both completion buttons share the same neutral look until one is chosen */
.pr-btn-done,
.pr-btn-not        { background: var(--bg-2); color: var(--text-1); }
.pr-btn-done:hover,
.pr-btn-not:hover  { background: var(--bg-3); }
/* Selected state — Picked Up turns green, Not Out turns red */
.pr-btn-done.is-active {
  background: var(--green-dim);
  border-color: rgba(63, 185, 80, 0.5);
  color: var(--green);
}
.pr-btn-not.is-active {
  background: var(--danger-dim);
  border-color: rgba(248, 81, 73, 0.5);
  color: var(--danger);
}

.pr-complete {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.pr-complete-label { font-size: 12.5px; color: var(--text-2); margin: 0 0 9px; }
.pr-note-input {
  width: 100%;
  min-height: 60px;
  resize: vertical;
  background: var(--bg-0);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-1);
  font-size: 13px;
  padding: 9px 11px;
  font-family: inherit;
}
.pr-note-input:focus { outline: none; border-color: var(--red); }
.pr-photo-input { display: none; }
/* E3 + E6: Take Photo / Gallery as full-width, 48px bordered buttons
   (consistent with .btn-add-photo) */
.pr-photo-row {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}
.pr-photo-label {
  flex: 1 1 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 48px;
  padding: 10px 12px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  cursor: pointer;
  transition: all var(--trans);
  -webkit-tap-highlight-color: transparent;
}
.pr-photo-label:hover { background: var(--bg-2); color: var(--text-1); border-color: var(--text-2); }
.pr-photo-take {
  background: var(--red-dim);
  border-color: rgba(217, 0, 0, 0.5);
  color: #ff6b6b;
}
.pr-photo-take:hover {
  background: rgba(217, 0, 0, 0.2);
  color: #ff8585;
  border-color: var(--red);
}
.pr-photo-msg { font-size: 12px; color: var(--text-3); margin: 6px 0 0; }

.pr-confirm-row { display: flex; gap: 8px; margin-top: 12px; }
.pr-btn-cancel  { flex: 0 0 auto; min-width: 84px; }
.pr-btn-confirm {
  flex: 1 1 auto;
  background: var(--red);
  border-color: var(--red);
  color: #fff;
}
.pr-btn-confirm:hover    { background: var(--red-hover); }
.pr-btn-confirm:disabled { opacity: 0.6; cursor: default; }

/* ══════════════════════════════════════════════════════════════
   E2: "My Night" shift summary
   ══════════════════════════════════════════════════════════════ */
.mn-chips {
  display: flex;
  flex-wrap: wrap;    /* Phase 7: three chips now — never overflow a 320px phone */
  gap: 8px;
  margin-bottom: 16px;
}
.mn-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-size: 13px;
  font-weight: 700;
}
.mn-chip-viol { background: var(--red-dim);   border-color: rgba(217, 0, 0, 0.35);   color: #ff6b6b; }
.mn-chip-pick { background: var(--green-dim); border-color: rgba(63, 185, 80, 0.4);  color: var(--green); }
.mn-chip-serv { background: var(--blue-dim);  border-color: rgba(88, 166, 255, 0.4); color: var(--blue); }   /* Phase 7 */

.mn-loading,
.mn-empty {
  font-size: 13px;
  color: var(--text-3);
  padding: 12px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.mn-error { text-align: center; padding: 18px 0; }
.mn-error p {
  font-size: 13px;
  color: var(--danger);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

/* ══════════════════════════════════════════════════════════════
   E1: Offline queue — banner + "Saved Offline" screen
   ══════════════════════════════════════════════════════════════ */
/* ONE reparented element (see placeOfflineBanner): sits in flow directly
   under the active screen's sticky header and sticks just below it while
   scrolling; on header-less screens it moves to the top of the page. */
.offline-banner {
  position: sticky;
  top: var(--header-h);
  z-index: 49;               /* just below the sticky .app-header (50) */
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 32px;
  padding: 6px 14px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--yellow);
  background: #2b2415;       /* opaque — content scrolls beneath it */
  border-bottom: 1px solid rgba(227, 179, 65, 0.35);
  flex-shrink: 0;
}
.offline-banner i { font-size: 12px; }
.offline-banner.offline-banner-top { top: 0; }
/* Back online, draining the queue — flip the tint green */
.offline-banner.offline-banner-sending {
  color: var(--green);
  background: #14251a;
  border-bottom-color: rgba(63, 185, 80, 0.35);
}

/* "Saved Offline" screen — amber, so it never reads as the green success */
.offline-saved-icon {
  font-size: 52px;
  color: var(--yellow);
  margin-bottom: 16px;
}

.mn-list { display: flex; flex-direction: column; gap: 10px; }
.mn-item {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.mn-item-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
  margin-top: 1px;
}
.mn-icon-viol { background: var(--red-dim);   color: #ff6b6b; }
.mn-icon-pick { background: var(--green-dim); color: var(--green); }
.mn-icon-serv { background: var(--blue-dim);  color: var(--blue); }   /* Phase 7 */
.mn-item-body { flex: 1; min-width: 0; }
.mn-item-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}
.mn-item-unit { font-size: 14px; font-weight: 700; color: var(--text-1); overflow-wrap: anywhere; }
.mn-item-time { font-size: 12px; color: var(--text-3); white-space: nowrap; }
.mn-item-sub  { font-size: 13px; color: var(--text-2); margin-top: 2px; }
.mn-item-prop { font-size: 12px; color: var(--text-3); margin-top: 2px; }

/* ══════════════════════════════════════════════════════════════
   Phase 7: Start / Finish Property service run
   ══════════════════════════════════════════════════════════════ */
.sr-section { margin-bottom: 16px; }

.sr-card {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
}
.sr-card-active { border-color: rgba(63, 185, 80, 0.45); }
/* Brief "Completed — {duration}" state — green tint, like the sending banner */
.sr-card-done   { border-color: rgba(63, 185, 80, 0.45); background: #14251a; }
.sr-card-err    { border-color: rgba(248, 81, 73, 0.4); }

/* Shared run-card button base — glove-sized (52px ≥ the 48px spec minimum) */
.sr-btn {
  font-family: inherit;
  width: 100%;
  min-height: 52px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-size: 15px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: background var(--trans), border-color var(--trans), opacity var(--trans);
  -webkit-tap-highlight-color: transparent;
}
.sr-btn:active   { transform: translateY(1px); }
.sr-btn:disabled { opacity: 0.6; cursor: default; }

/* Start Service — the prominent green arrival action */
.sr-btn-start {
  background: var(--green);
  border-color: var(--green);
  color: #0b2912;
  font-size: 16px;
}
.sr-btn-start:hover { filter: brightness(1.08); }

/* Finish Property — primary red, below the in-progress status */
.sr-btn-finish {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
  margin-top: 12px;
}
.sr-btn-finish:hover { background: var(--red-hover); }
/* Armed two-step confirm state ("Tap to confirm", 3s revert) */
.sr-btn-finish.sr-finish-armed {
  background: var(--yellow);
  border-color: var(--yellow);
  color: #241c05;
}
.sr-btn-finish.sr-finish-armed:hover { background: var(--yellow); }

.sr-btn-retry {
  background: var(--bg-2);
  border-color: var(--border);
  color: var(--text-1);
  font-weight: 600;
}
.sr-btn-retry:hover { background: var(--bg-3); }

/* "Service in progress" status row */
.sr-status-row { display: flex; align-items: flex-start; gap: 10px; }
.sr-live-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--green);
  margin-top: 6px;
  flex-shrink: 0;
  animation: srPulse 2s ease-in-out infinite;
}
@keyframes srPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(63, 185, 80, 0.5); }
  50%      { box-shadow: 0 0 0 6px rgba(63, 185, 80, 0); }
}
.sr-status-text  { flex: 1; min-width: 0; }
.sr-status-title { font-size: 14px; font-weight: 700; color: var(--green); margin: 0; }
.sr-status-sub   { font-size: 12.5px; color: var(--text-2); margin: 2px 0 0; }
.sr-elapsed      { color: var(--text-1); font-weight: 600; white-space: nowrap; }

.sr-done-msg {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--green);
  padding: 6px 0;
  margin: 0;
}

.sr-loading,
.sr-err-msg {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  margin: 0;
}
.sr-loading { color: var(--text-3); }
.sr-err-msg { color: var(--danger); margin-bottom: 10px; }

/* ══════════════════════════════════════════════════════════════
   Phase 8: Resident Reports (issueReports)
   ══════════════════════════════════════════════════════════════ */
.rr-section { margin-top: 22px; }

/* Collapsible header — the WHOLE row is the tap target (glove-sized ≥48px) */
.rr-section-head {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 4px 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.rr-section-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-1);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}
.rr-section-title i { color: var(--blue); }
/* Filled badge with DARK text (dark-on-light reads at night; white on the
   light blue would fail contrast — same trick as .sr-btn-start's dark text) */
.rr-count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  font-size: 12px;
  font-weight: 700;
  color: #0d1117;
  background: var(--blue);
  border-radius: 10px;
}
.rr-chevron {
  margin-left: auto;
  color: var(--text-3);
  font-size: 13px;
  transition: transform var(--trans);
}
.rr-chevron-open { transform: rotate(180deg); }

.rr-toolbar { display: flex; justify-content: flex-end; margin-bottom: 8px; }
.rr-refresh-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  min-height: 48px;
  padding: 8px 16px;
  background: var(--bg-2);
  color: var(--text-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--trans), color var(--trans), opacity var(--trans);
  -webkit-tap-highlight-color: transparent;
}
.rr-refresh-btn:hover    { background: var(--bg-3); color: var(--text-1); }
.rr-refresh-btn:active   { transform: translateY(1px); }
.rr-refresh-btn:disabled { opacity: 0.6; cursor: default; }

.rr-list { display: flex; flex-direction: column; gap: 10px; }
.rr-empty {
  font-size: 13px;
  color: var(--text-3);
  padding: 12px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}
.rr-empty .fa-check-circle { color: var(--green); }
.rr-empty-err { color: var(--danger); }

/* Blue left rail = resident ticket (pickups own red/amber urgency rails) */
.rr-card {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-left: 3px solid var(--blue);
  border-radius: var(--radius);
  padding: 13px 14px;
}
.rr-card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}
.rr-type {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-1);
  min-width: 0;
  overflow-wrap: anywhere; /* resident-typed type can be one long token */
}
.rr-type i { color: var(--blue); margin-right: 5px; }
.rr-time { font-size: 12px; color: var(--text-3); white-space: nowrap; }

.rr-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  margin-top: 6px;
  font-size: 13px;
  color: var(--text-2);
  overflow-wrap: anywhere;
}
.rr-meta i { color: var(--text-3); margin-right: 5px; }
.rr-unit { font-weight: 600; color: var(--text-1); }

/* Description — clamped to 3 lines; tapping toggles .rr-desc-open (full text) */
.rr-desc {
  margin-top: 8px;
  font-size: 13px;
  color: var(--text-2);
  background: var(--bg-2);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: anywhere;
  white-space: pre-line;   /* residents write paragraphs — keep their breaks */
  cursor: pointer;
}
.rr-desc.rr-desc-open {
  display: block;
  -webkit-line-clamp: unset;
}

.rr-foot {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  margin-top: 12px;
}
.rr-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  white-space: nowrap;
}
.rr-chip-new      { background: var(--blue-dim);   color: var(--blue);   border: 1px solid rgba(88, 166, 255, 0.4); }
.rr-chip-progress { background: var(--yellow-dim); color: var(--yellow); border: 1px solid rgba(227, 179, 65, 0.4); }

/* Action buttons — same glove-sized spec as .pr-btn */
.rr-actions { display: flex; gap: 8px; width: 100%; }
.rr-btn {
  flex: 1 1 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  padding: 9px 10px;
  min-height: 48px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-2);
  color: var(--text-1);
  cursor: pointer;
  transition: background var(--trans), border-color var(--trans), opacity var(--trans);
  -webkit-tap-highlight-color: transparent;
}
.rr-btn:active   { transform: translateY(1px); }
.rr-btn:disabled { opacity: 0.6; cursor: default; }
.rr-btn-start:hover { background: var(--bg-3); }
/* Resolve — primary red (the app's confirm color), armed → yellow two-step */
.rr-btn-resolve {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
}
.rr-btn-resolve:hover { background: var(--red-hover); }
.rr-btn-resolve.rr-armed {
  background: var(--yellow);
  border-color: var(--yellow);
  color: #241c05;
}
.rr-btn-resolve.rr-armed:hover { background: var(--yellow); }

/* == Google sign-in (Phase 14) — login screens are always dark == */
.login-or {
  display: flex; align-items: center; gap: 10px;
  margin: 14px 0; color: #6e6e6e; font-size: 11px;
  text-transform: uppercase; letter-spacing: .12em;
}
.login-or::before, .login-or::after {
  content: ''; flex: 1; height: 1px; background: #2a2a2a;
}
.btn-google {
  width: 100%; min-height: 48px; border-radius: 10px;
  background: #fff; color: #1f1f1f; border: 1px solid #2a2a2a;
  font: 600 14px 'Poppins', sans-serif; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  transition: filter .15s;
}
.btn-google:hover { filter: brightness(0.93); }
.btn-google:disabled { opacity: .6; }
.btn-google i { color: #4285f4; font-size: 16px; }

/* == Login method chooser + shared brand header (Phase 15) == */
.btn-method {
  width: 100%; min-height: 48px; border-radius: 10px;
  background: #0f0f0f; color: #e8e8e8; border: 1px solid #2a2a2a;
  font: 600 14px 'Poppins', sans-serif; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  transition: border-color .15s, background .15s;
}
.btn-method:hover { border-color: #d90000; background: #151515; }
.btn-method i { color: #ff6b6b; font-size: 15px; }
/* In-app header brand — identical treatment to the PM portal's. */
.app-brand { display: flex; align-items: center; gap: 9px; }
.app-brand-logo { height: 30px; width: auto; display: block; }
.app-brand-name {
  font-size: 14px; font-weight: 800; letter-spacing: .06em;
  color: var(--text-1); white-space: nowrap;
}
.app-brand-red { color: #ff2020; }
/* Narrow phones: the wordmark is the overflow risk in a header that also
   carries the name chip + up to four icon buttons — icon-only brand there
   (same discipline as the PM portal's own <=768px header). */
@media (max-width: 600px) {
  .app-brand-name { display: none; }
}
