/* ═══════════════════════════════════════════════════════════════════════════
   ADITION ELECTRIC SOLUTION — PWA stylesheet v9
   · 144Hz GPU compositing via will-change: transform, opacity
   · touch-action: pan-y  +  passive scroll for iQOO 13
   · All interactive elements ≥ 44px touch targets
   · visualViewport-safe sticky header
   · Scrollbars hidden, standalone PWA fullscreen feel
   · CSS Transitions via requestAnimationFrame-compatible transforms
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Reset ─────────────────────────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}
html, body {
  margin: 0; padding: 0;
  height: 100%; width: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  background: #1a1a2e;
  font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
  -webkit-font-smoothing: antialiased;
  font-size: 15px;
  color: #1a1a2e;
  /* Full-screen: use 100dvh for mobile to avoid bottom white space */
  height: 100dvh;
}

/* Hide scrollbars globally */
::-webkit-scrollbar { display: none; }
* { scrollbar-width: none; -ms-overflow-style: none; }

/* ── App shell ─────────────────────────────────────────────────────────────── */
#app {
  height: 100dvh;
  width: 100%;
}
.app-shell {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  max-width: 480px;
  margin: 0 auto;
  background: #f4f4f8;
  position: relative;
  overflow: hidden;
}

/* ── Sticky header ─────────────────────────────────────────────────────────── */
.app-header {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #1a1a2e;
  padding: 0 12px;
  height: 56px;
  min-height: 56px;
  position: sticky;
  top: 0;
  z-index: 100;
  will-change: transform;
  box-shadow: 0 2px 8px rgba(0,0,0,.25);
}
.hdr-left  { display: flex; align-items: center; gap: 8px; min-width: 0; }
.hdr-right { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.hdr-back  {
  background: rgba(255,255,255,.12);
  border: none; border-radius: 10px;
  color: #fff; cursor: pointer;
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  transition: background 0.15s;
}
.hdr-back:active { background: rgba(255,255,255,.22); }
.hdr-title {
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hdr-sub, .hdr-job-id {
  color: rgba(255,255,255,.55);
  font-size: 12px;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hdr-job-id { color: rgba(255,255,255,.75); font-weight: 600; }

/* ── View root (scrollable content) ───────────────────────────────────────── */
#view-root {
  flex: 1 1 0;           /* v50.5: 0 flex-basis forces min-height:0 behavior */
  min-height: 0;          /* v50.5: CRITICAL — allows flex child to shrink & scroll */
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  overscroll-behavior-y: contain;
  padding-bottom: 8px;
}

/* ── Bottom navigation ─────────────────────────────────────────────────────── */
.bottom-nav {
  display: flex;
  align-items: stretch;
  background: #1a1a2e;
  border-top: 1px solid rgba(255,255,255,.08);
  flex-shrink: 0;
  height: 56px;
  min-height: 56px;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  z-index: 100;
}
.nav-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background: transparent;
  border: none;
  cursor: pointer;
  color: rgba(255,255,255,.45);
  min-height: 44px;
  padding: 4px 0;
  transition: color 0.15s;
  will-change: transform, opacity;
}
.nav-btn:active { transform: scale(0.93); }
.nav-active { color: #E53935 !important; }
.nav-icon   { font-size: 20px; }
.nav-label  { font-size: 10px; font-weight: 600; }

/* ── Role badges ───────────────────────────────────────────────────────────── */
.role-badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.role-admin { background: #E53935; color: #fff; }
.role-director { background: #7B1FA2; color: #fff; }
.role-manager { background: #FB8C00; color: #fff; }
.role-staff { background: #1E88E5; color: #fff; }

/* ── Icon button ───────────────────────────────────────────────────────────── */
.icon-btn {
  background: rgba(255,255,255,.12);
  border: none; border-radius: 10px;
  color: #fff; cursor: pointer;
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  font-size: 17px;
  transition: background 0.15s;
}
.icon-btn:active { background: rgba(255,255,255,.22); }

/* ── Login ─────────────────────────────────────────────────────────────────── */
.login-bg {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100dvh;
  background: linear-gradient(160deg, #1a1a2e 0%, #0f3460 60%, #16213e 100%);
  padding: 24px 16px;
}
.login-card {
  background: #fff;
  border-radius: 24px;
  padding: 32px 24px 24px;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 20px 60px rgba(0,0,0,.4);
}
.login-logo { text-align: center; margin-bottom: 28px; }
.logo-icon {
  width: 72px; height: 72px;
  background: linear-gradient(135deg,#E53935,#B71C1C);
  border-radius: 20px;
  display: flex; align-items: center; justify-content: center;
  font-size: 36px; color: #fff;
  margin: 0 auto 14px;
}
.login-title {
  font-size: 22px; font-weight: 900; color: #1a1a2e;
  margin: 0; letter-spacing: 1px;
}
.login-sub   { color: #888; font-size: 13px; margin: 4px 0 0; }
.login-hint  { color: #aaa; font-size: 12px; text-align: center; margin-top: 12px; }
.login-footer { color: rgba(255,255,255,.4); font-size: 12px; margin-top: 20px; text-align: center; }

/* ── Filter bar ────────────────────────────────────────────────────────────── */
.filter-bar {
  display: flex;
  gap: 8px;
  padding: 10px 12px 6px;
  overflow-x: auto;
  flex-shrink: 0;
  background: #fff;
  border-bottom: 1px solid #f0f0f0;
  touch-action: pan-x;
}
.filter-chip {
  flex-shrink: 0;
  padding: 7px 14px;
  border-radius: 20px;
  border: 2px solid var(--chip-color, #1a1a2e);
  color: var(--chip-color, #1a1a2e);
  background: transparent;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  min-height: 36px;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}
.chip-active {
  background: var(--chip-color, #1a1a2e);
  color: #fff;
}

/* ── Search bar ────────────────────────────────────────────────────────────── */
.search-wrap {
  position: relative;
  padding: 8px 12px;
  background: #fff;
  border-bottom: 1px solid #f0f0f0;
  flex-shrink: 0;
}
.search-icon {
  position: absolute;
  left: 24px; top: 50%;
  transform: translateY(-50%);
  color: #aaa; font-size: 15px;
}
.search-input {
  width: 100%;
  height: 44px;
  padding: 0 12px 0 36px;
  border: 1.5px solid #e0e0e0;
  border-radius: 12px;
  font-size: 14px;
  background: #f9f9f9;
  outline: none;
  transition: border-color 0.15s;
}
.search-input:focus { border-color: #E53935; background: #fff; }

/* ── Virtual list ──────────────────────────────────────────────────────────── */
.vlist-wrap {
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  overscroll-behavior-y: contain;
}

/* ── Job row card ──────────────────────────────────────────────────────────── */
.job-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #fff;
  border-left: 5px solid #E53935;
  border-bottom: 1px solid #f0f0f0;
  padding: 12px;
  cursor: pointer;
  min-height: 88px;
  will-change: transform, opacity;
  transition: background 0.1s;
}
.job-row:active { background: #fafafa; transform: scale(0.99); }
.job-row-thumb {
  width: 56px; height: 56px;
  border-radius: 12px;
  background: #f5f5f5;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}
.thumb-img { width: 100%; height: 100%; object-fit: cover; border-radius: 12px; }
.job-row-body { flex: 1; min-width: 0; }
.job-row-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 3px;
}
.job-id    { font-size: 13px; font-weight: 800; color: #1a1a2e; }
.job-name  { font-size: 15px; font-weight: 600; color: #1a1a2e; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.job-row-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 4px;
}
.job-meta    { font-size: 12px; color: #888; }
.job-balance { font-size: 13px; font-weight: 700; }

/* ── Status chip ───────────────────────────────────────────────────────────── */
.status-chip {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 700;
  border: 1px solid;
  flex-shrink: 0;
}

/* ── Cards ─────────────────────────────────────────────────────────────────── */
.card {
  background: #fff;
  border-radius: 14px;
  padding: 10px;
  margin-bottom: 6px;
  box-shadow: 0 1px 4px rgba(0,0,0,.07);
}
/* v50.2: Added padding-bottom so content doesn't get hidden behind bottom nav (56px + safe area) */
/* v50.4: Increased to 96px for better coverage on all devices + safe area */
.view-pad { padding: 8px 8px 96px 8px; }
/* v50.5: Ensure detail page can scroll on all devices — no height constraints */
#detail-root { display: block; min-height: auto; }
.mt-3     { margin-top: 8px; }

/* ── Section title ─────────────────────────────────────────────────────────── */
.section-title {
  font-size: 15px;
  font-weight: 700;
  color: #1a1a2e;
  margin: 0 0 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

/* ── Info rows ─────────────────────────────────────────────────────────────── */
.info-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 7px 0;
  border-bottom: 1px solid #f5f5f5;
}
.info-row:last-child { border-bottom: none; }
.info-icon { font-size: 15px; margin-top: 2px; flex-shrink: 0; width: 18px; text-align: center; }
.info-val  { font-size: 14px; color: #333; line-height: 1.4; }
.fw-bold   { font-weight: 700 !important; }
.info-link { color: #1565C0; text-decoration: none; font-size: 14px; font-weight: 600; }
.ml-8      { margin-left: 8px; }
.text-muted { color: #888; }
.text-center { text-align: center; }

/* ── Detail banner ─────────────────────────────────────────────────────────── */
.detail-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  margin-bottom: 0;
  border-radius: 0;
}
.detail-job-id     { color: #fff; font-size: 28px; font-weight: 900; letter-spacing: 3px; }
.detail-status-label { color: rgba(255,255,255,.85); font-size: 14px; font-weight: 700; background: rgba(0,0,0,.18); padding: 4px 12px; border-radius: 8px; }

/* ── Financial panel ───────────────────────────────────────────────────────── */
.financial-panel { }
.fin-title {
  font-size: 14px; font-weight: 700; color: #888;
  text-transform: uppercase; letter-spacing: 1px;
  margin-bottom: 10px;
  display: flex; align-items: center; gap: 6px;
}
.fin-machine-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 0;
  font-size: 14px;
  color: #555;
}
.fin-machine-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fin-machine-amt  { font-weight: 600; color: #1a1a2e; flex-shrink: 0; margin-left: 8px; }
.fin-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
}
.fin-label  { font-size: 14px; color: #555; }
.fin-amount { font-size: 16px; font-weight: 700; }
.fin-balance { border-top: 1.5px solid #e0e0e0; margin-top: 4px; padding-top: 8px; }
.fin-edit-row { margin-top: 10px; padding-top: 10px; border-top: 1px dashed #e0e0e0; }

/* ── Delivery card ─────────────────────────────────────────────────────────── */
.delivery-card { border-left: 4px solid #1E88E5; }
.delivery-title {
  font-size: 14px; font-weight: 700; color: #1565C0;
  margin-bottom: 8px;
  display: flex; align-items: center; gap: 6px;
}

/* ── Action row ────────────────────────────────────────────────────────────── */
.action-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.action-btn {
  flex: 1;
  min-width: 72px;
  min-height: 52px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  background: #1a1a2e;
  color: #fff;
  border: none;
  border-radius: 14px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  will-change: transform, opacity;
  transition: transform 0.12s, opacity 0.12s;
}
.action-btn i    { font-size: 18px; }
.action-btn:active { transform: scale(0.92); opacity: 0.85; }

/* ── Machine card ──────────────────────────────────────────────────────────── */
.machine-card {
  background: #fafafa;
  border-left: 5px solid #E53935;
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 10px;
  will-change: transform, opacity;
  transition: box-shadow 0.15s;
}
.machine-top {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.machine-name {
  font-size: 15px;
  font-weight: 700;
  color: #1a1a2e;
  margin-bottom: 3px;
}
.machine-qty     { font-size: 13px; color: #888; font-weight: 600; }
.machine-complaint { font-size: 13px; color: #666; margin-bottom: 3px; }
.machine-staff   { font-size: 12px; color: #1E88E5; margin-top: 3px; }
.machine-right   { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex-shrink: 0; }
.machine-charges { font-size: 16px; font-weight: 800; color: #E53935; }

/* Status select */
.status-sel {
  min-height: 44px;
  padding: 0 10px;
  border-radius: 10px;
  border: 2px solid;
  font-size: 13px;
  font-weight: 700;
  background: #fff;
  cursor: pointer;
  max-width: 130px;
}

/* Images row */
.images-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.img-wrap {
  position: relative;
  width: 72px;
  height: 72px;
  border-radius: 10px;
  overflow: hidden;
}
.img-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 10px;
}
.img-del-btn {
  position: absolute;
  top: 2px; right: 2px;
  width: 22px; height: 22px;
  background: rgba(197,40,40,.85);
  color: #fff; border: none;
  border-radius: 50%;
  font-size: 14px; line-height: 22px;
  text-align: center; cursor: pointer;
  padding: 0;
}
.img-add-btn {
  width: 72px; height: 72px;
  background: #f0f0f0;
  border: 2px dashed #ccc;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; color: #bbb;
  cursor: pointer;
  transition: background 0.15s;
}
.img-add-btn:active { background: #e5e5e5; }

/* Image upload label (form-embedded) */
.img-upload-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border: 2px dashed #ccc;
  border-radius: 10px;
  background: #f9f9f9;
  color: #666;
  font-size: 14px;
  cursor: pointer;
  min-height: 44px;
  transition: border-color 0.15s, background 0.15s;
}
.img-upload-label:active { border-color: #E53935; background: #fff5f5; }

/* Audio row */
.audio-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid #ebebeb;
}
.audio-player {
  flex: 1;
  height: 40px;
  border-radius: 8px;
}

/* Machine actions */
.machine-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid #ebebeb;
}

/* ── Form elements ─────────────────────────────────────────────────────────── */
.form-group { margin-bottom: 14px; }
.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #555;
  margin-bottom: 5px;
}
.req { color: #E53935; }
.form-input {
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  border: 1.5px solid #e0e0e0;
  border-radius: 10px;
  font-size: 14px;
  background: #fff;
  color: #1a1a2e;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  display: block;
}
.form-input:focus {
  border-color: #E53935;
  box-shadow: 0 0 0 3px rgba(229,57,53,.12);
}
textarea.form-input {
  min-height: 80px;
  padding: 10px 12px;
  resize: vertical;
  line-height: 1.5;
}
select.form-input { padding-right: 32px; cursor: pointer; }
.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* ── Buttons ───────────────────────────────────────────────────────────────── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 20px;
  background: #E53935;
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  will-change: transform, opacity;
  transition: transform 0.12s, opacity 0.12s;
  text-decoration: none;
}
.btn-primary:active { transform: scale(0.95); opacity: 0.88; }
.btn-primary:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }
.btn-full { width: 100%; }

.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 16px;
  background: transparent;
  color: #555;
  border: 1.5px solid #ddd;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.12s;
}
.btn-ghost:active { background: #f0f0f0; }

/* Small buttons */
.btn-sm {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 12px;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  will-change: transform;
  transition: transform 0.1s;
  color: #fff;
}
.btn-sm:active   { transform: scale(0.93); }
.btn-red    { background: #E53935; }
.btn-green  { background: #43A047; }
.btn-orange { background: #FB8C00; }
.btn-blue   { background: #1E88E5; }

/* ── Modal / bottom sheet ──────────────────────────────────────────────────── */
#aes-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  z-index: 1000;
  display: flex;
  align-items: flex-end;
  will-change: opacity;
  animation: fadeIn .2s ease;
}
.modal-sheet {
  background: #fff;
  border-radius: 24px 24px 0 0;
  padding: 24px 20px 32px;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  max-height: 90vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  will-change: transform, opacity;
  transform: translateY(40px);
  opacity: 0;
  transition: transform 0.28s cubic-bezier(0.34,1.2,0.64,1), opacity 0.2s ease;
}
.modal-title {
  font-size: 18px;
  font-weight: 800;
  color: #1a1a2e;
  margin: 0 0 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.modal-footer {
  display: flex;
  gap: 10px;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid #f0f0f0;
}
.modal-footer > * { flex: 1; }

/* ── Empty state ───────────────────────────────────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  color: #ccc;
  text-align: center;
  gap: 12px;
}
.empty-state p { font-size: 15px; color: #aaa; margin: 0; }
.empty-sub { font-size: 13px; }

/* ── Loader ────────────────────────────────────────────────────────────────── */
.loader-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px;
  color: #ccc;
}

/* ── Staff cards ───────────────────────────────────────────────────────────── */
.staff-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: #fff;
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 10px;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.staff-name  { font-size: 15px; font-weight: 700; color: #1a1a2e; margin-bottom: 3px; }
.staff-email { font-size: 13px; color: #888; }
.badge-active   { background: #E8F5E9; color: #2E7D32; padding: 3px 10px; border-radius: 8px; font-size: 12px; font-weight: 700; }
.badge-inactive { background: #FFEBEE; color: #C62828; padding: 3px 10px; border-radius: 8px; font-size: 12px; font-weight: 700; }

/* ── Reports ───────────────────────────────────────────────────────────────── */
.report-card {
  background: #fff;
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.report-title { font-size: 15px; font-weight: 700; color: #1a1a2e; margin-bottom: 4px; display: flex; align-items: center; gap: 8px; }
.report-desc  { font-size: 13px; color: #888; }

/* ── Settings ──────────────────────────────────────────────────────────────── */
.settings-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fff;
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 10px;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
  min-height: 64px;
  will-change: transform;
  transition: transform 0.1s;
}
.settings-item:active { transform: scale(0.98); }
.settings-label { font-size: 15px; font-weight: 700; color: #1a1a2e; margin-bottom: 2px; display: flex; align-items: center; gap: 8px; }
.settings-desc  { font-size: 12px; color: #888; }
.settings-icon  { width: 18px; text-align: center; }

/* ── Requests panel ────────────────────────────────────────────────────────── */
.request-card {
  background: #fff;
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 10px;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
  border-left: 4px solid #E53935;
  will-change: transform, opacity;
}
.req-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}
.req-staff   { font-size: 15px; font-weight: 700; color: #1a1a2e; }
.req-status  {
  padding: 3px 10px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}
.status-pending  { background: #FFF3E0; color: #E65100; }
.status-approved { background: #E8F5E9; color: #2E7D32; }
.status-denied   { background: #FFEBEE; color: #C62828; }
.req-machine  { font-size: 14px; color: #333; margin-bottom: 4px; display: flex; align-items: center; }
.req-complaint { font-size: 13px; color: #666; margin-bottom: 4px; }
.req-note     { font-size: 13px; color: #555; background: #fafafa; border-radius: 8px; padding: 6px 8px; margin-bottom: 6px; }
.req-date     { font-size: 12px; color: #aaa; margin-bottom: 8px; }
.req-actions  { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }

/* ── Animations ────────────────────────────────────────────────────────────── */
@keyframes fadeIn  { from { opacity: 0; } to { opacity: 1; } }
@keyframes toastIn { from { transform: translateX(-50%) translateY(10px); opacity: 0; } to { transform: translateX(-50%) translateY(0); opacity: 1; } }

/* ── PWA standalone optimizations ─────────────────────────────────────────── */
@media (display-mode: standalone) {
  .app-header { padding-top: env(safe-area-inset-top); height: calc(56px + env(safe-area-inset-top)); }
  .bottom-nav { padding-bottom: env(safe-area-inset-bottom); }
}

/* ── Touch target enforcement ──────────────────────────────────────────────── */
button, a, label, select, input[type="file"] + label, [role="button"] {
  min-height: 44px;
  min-width: 44px;
}

/* ── Utility ───────────────────────────────────────────────────────────────── */
.d-none { display: none !important; }

/* ── Analytics stats bar ────────────────────────────────────────────────────── */
.stats-bar {
  display: flex;
  gap: 8px;
  padding: 8px 12px;
  overflow-x: auto;
  flex-shrink: 0;
  background: #fff;
  border-bottom: 1px solid #f0f0f0;
  touch-action: pan-x;
  min-height: 56px;
}
.stat-chip {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #f8f9fa;
  border-radius: 12px;
  padding: 6px 14px;
  min-width: 58px;
  cursor: pointer;
  border: 1.5px solid #ececec;
  transition: background 0.13s;
}
.stat-chip:active { background: #ede7e7; }
.stat-num {
  font-size: 18px;
  font-weight: 900;
  color: #1a1a2e;
  line-height: 1.1;
}
.stat-lbl {
  font-size: 10px;
  color: #999;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-top: 2px;
}

/* ── My Assigned Jobs bar (staff) ──────────────────────────────────────────── */
.my-jobs-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: #fff;
  border-bottom: 1px solid #f0f0f0;
  flex-shrink: 0;
}
.btn-my-assigned {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 20px;
  border: 1.5px solid #1E88E5;
  background: #fff;
  color: #1E88E5;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  min-height: 36px;
  transition: all 0.15s;
  white-space: nowrap;
}
.btn-my-assigned:active { transform: scale(0.96); }
.btn-my-active {
  background: #1E88E5 !important;
  color: #fff !important;
  box-shadow: 0 2px 8px rgba(30,136,229,.3);
}
.btn-my-clear {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 7px 12px;
  border-radius: 20px;
  border: 1.5px solid #E53935;
  background: #fff;
  color: #E53935;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  min-height: 36px;
  transition: all 0.15s;
}
.btn-my-clear:active { background: #FFEBEE; }

/* ── Notification badge (pending requests dot) ─────────────────────────────── */
.nav-badge-wrap { position: relative; display: inline-flex; }
.nav-dot {
  position: absolute;
  top: -2px;
  right: -4px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #43A047;
  border: 1.5px solid #1a1a2e;
  animation: pulse-dot 1.8s infinite;
}
@keyframes pulse-dot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50%       { transform: scale(1.3); opacity: 0.8; }
}

/* ── Complaint quick-tags ──────────────────────────────────────────────────── */
.complaint-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 6px 0 4px;
}
.ctag {
  padding: 5px 11px;
  border-radius: 16px;
  border: 1.5px solid #E53935;
  background: #fff;
  color: #E53935;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.12s;
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
}
.ctag:active { background: #FFEBEE; transform: scale(0.96); }

/* ── Mobile touch improvements ─────────────────────────────────────────────── */
.filter-chip {
  min-height: 36px;
  padding: 7px 14px;
}
.btn-sm {
  min-height: 36px;
}
.form-input {
  min-height: 44px;
}
.status-sel {
  min-height: 38px;
  font-size: 13px;
}
.audio-player {
  height: 36px;
}

/* ── Mobile UI refinements (Patch 5) ──────────────────────────────────────── */

/* Smooth scroll on all scrollable areas */
.vlist-wrap, .view-pad, .filter-bar, .stats-bar {
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
}

/* Better job row: larger thumbnail, tighter layout */
.job-row {
  padding: 14px 12px;
  gap: 14px;
  min-height: 84px;
}
.job-row-thumb {
  width: 60px;
  height: 60px;
  border-radius: 14px;
}
.job-name {
  font-size: 15px;
  font-weight: 700;
  margin: 2px 0;
}
.job-id { font-size: 12px; }
.status-chip { font-size: 11px; padding: 3px 9px; }

/* Machine card — cleaner, more breathing room */
.machine-card {
  padding: 14px;
  margin-bottom: 10px;
  border-radius: 14px;
  box-shadow: 0 1px 6px rgba(0,0,0,.08);
}
.machine-name { font-size: 15px; font-weight: 700; }
.machine-complaint { font-size: 13px; color: #666; margin-top: 3px; }
.machine-staff { font-size: 12px; color: #1E88E5; margin-top: 3px; }

/* Bigger action buttons */
.action-btn {
  min-height: 44px;
  padding: 10px 16px;
  font-size: 13px;
  border-radius: 12px;
}

/* Better form spacing */
.form-group { margin-bottom: 10px; }
.form-label { font-size: 13px; font-weight: 600; margin-bottom: 4px; display: block; }

/* Card header improvements */
.card { border-radius: 14px; padding: 10px; margin-bottom: 6px; }

/* Larger modal */
.modal-sheet {
  max-height: 90vh;
}

/* Better image thumbnails grid */
.images-row {
  gap: 8px;
  padding: 8px 0 4px;
}
.img-wrap {
  width: 72px;
  height: 72px;
}
.img-thumb {
  width: 72px;
  height: 72px;
  border-radius: 10px;
  object-fit: cover;
}

/* Smooth header shadow on scroll */
.app-header {
  box-shadow: 0 1px 8px rgba(0,0,0,.18);
}

/* ── Filter Panel Chips ───────────────────────────────────────────────── */
.fp-chip {
  background: #f0f2f5;
  color: var(--fp-color, #555);
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
  transition: all .15s;
}
.fp-chip.fp-active {
  background: var(--fp-color, #1a1a2e);
  color: #fff;
  border-color: var(--fp-color, #1a1a2e);
}
.fp-quick {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  color: #555;
  -webkit-tap-highlight-color: transparent;
}
.fp-quick:active { background: #f0f0f0; transform: scale(0.96); }
