/* MAG Engineer App – PWA Technician Portal
   Brand: MAG Sales & Service blue. Professional, modern, mobile-first.
   Fonts loaded in includes/header_script.php.
*/
:root {
  /* MAG brand */
  --primary: #1a5fb4;
  --primary-hover: #144a8f;
  --primary-light: #3b82f6;
  --primary-dark: #0a1628;
  --accent: #60a5fa;
  --accent-hover: #3b82f6;
  --success: #059669;
  --success-hover: #047857;
  /* Alerts */
  --warning: #eab308;
  --warning-bg: #fef9c3;
  --error: #dc2626;
  --error-bg: #fee2e2;
  /* Neutrals */
  --text: #0f172a;
  --text-muted: #64748b;
  --bg: #f0f4f8;
  --card: #ffffff;
  --border: #e2e8f0;
  /* UI */
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 3px rgba(26, 95, 180, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 8px 24px rgba(26, 95, 180, 0.12), 0 2px 8px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 16px 48px rgba(10, 22, 40, 0.18);
  --font-heading: 'Montserrat', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --safe-top: env(safe-area-inset-top);
  --safe-bottom: env(safe-area-inset-bottom);
  --gradient-brand: linear-gradient(135deg, #1a5fb4 0%, #2563eb 50%, #1e40af 100%);
  --gradient-dark: linear-gradient(160deg, #0a1628 0%, #1a3a6b 60%, #1a5fb4 100%);
}

* { box-sizing: border-box; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  padding-top: var(--safe-top);
  padding-bottom: var(--safe-bottom);
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
}

h1, h2, h3, h4, h5, h6, .eng-card h2, .dash-card h3 {
  font-family: var(--font-heading);
  font-weight: 600;
}

/* ----- Header ----- */
.eng-header-wrap { position: relative; }

.eng-header {
  position: sticky;
  top: 0;
  z-index: 99;
  background: var(--gradient-brand);
  padding: 12px 16px;
  padding-left: calc(16px + env(safe-area-inset-left));
  padding-right: calc(16px + env(safe-area-inset-right));
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  gap: 12px;
}
.eng-header-left { flex-shrink: 0; }
.eng-header-center { flex: 1; min-width: 0; }
.eng-header-right { flex-shrink: 0; }

/* Balances back button / nav toggle (40px) for centered titles & search */
.eng-header-spacer {
  display: inline-block;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
}
.eng-header-title {
  width: 100%;
  text-align: center;
  color: #fff;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1rem;
  line-height: 40px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.eng-header-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  font-size: 1.125rem;
  text-decoration: none;
  transition: background 0.2s;
}
.eng-header-back:hover { background: rgba(255, 255, 255, 0.3); color: #fff; }

.eng-header .nav-toggle {
  width: 40px;
  height: 40px;
  border: none;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.125rem;
  transition: background 0.2s;
}
.eng-header .nav-toggle:hover { background: rgba(255, 255, 255, 0.3); color: #fff; }

.eng-notif-btn {
  width: 40px;
  height: 40px;
  border: none;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  position: relative;
}
.eng-notif-btn:hover { background: rgba(255, 255, 255, 0.3); color: #fff; }
.eng-notif-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--error);
  color: #fff;
  font-size: 10px;
  line-height: 16px;
  font-weight: 700;
}
.eng-notif-dropdown {
  width: min(360px, calc(100vw - 24px));
  z-index: 1051;
}
.eng-notif-list {
  max-height: min(360px, calc(100vh - 160px));
  overflow-y: auto;
}
.eng-notif-item {
  border-bottom: 1px solid var(--border);
  padding: 12px 14px;
}
.eng-notif-item:last-child { border-bottom: 0; }
.eng-notif-item:hover { background: #f8fafc; }

.eng-header-search-row { width: 100%; min-width: 0; }
.eng-header-logo {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}
.eng-header-logo img {
  height: 36px;
  width: auto;
  max-width: 72px;
  object-fit: contain;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.95);
  padding: 2px 4px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
}
.eng-header .search-wrap { width: 100%; min-width: 0; }
.eng-escalation-box {
  border-width: 1px;
  border-style: solid;
}
.eng-escalation-box.escalation-card-critical,
.job-card.escalation-card-critical,
.current-task-card.escalation-card-critical {
  background-color: rgba(220, 53, 69, 0.14) !important;
  border-color: rgba(220, 53, 69, 0.35) !important;
}
.eng-escalation-box.escalation-card-high,
.job-card.escalation-card-high,
.current-task-card.escalation-card-high {
  background-color: rgba(255, 193, 7, 0.18) !important;
  border-color: rgba(255, 193, 7, 0.4) !important;
}
.eng-escalation-box.escalation-card-medium,
.job-card.escalation-card-medium,
.current-task-card.escalation-card-medium {
  background-color: rgba(13, 202, 240, 0.12) !important;
  border-color: rgba(13, 202, 240, 0.35) !important;
}
.eng-escalation-box.escalation-card-low,
.job-card.escalation-card-low,
.current-task-card.escalation-card-low {
  background-color: rgba(108, 117, 125, 0.10) !important;
  border-color: rgba(108, 117, 125, 0.3) !important;
}
.eng-escalation-inline .badge { font-size: 0.7rem; }
.eng-header .search-wrap .form-control {
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.95);
  font-family: var(--font-body);
}
.eng-header .search-wrap .btn-search {
  background: var(--success);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-family: var(--font-heading);
  padding: 8px 14px;
  transition: background 0.2s;
}
.eng-header .search-wrap .btn-search:hover { background: var(--success-hover); color: #fff; }

/* Nav dropdown */
.eng-nav-dropdown .card {
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}
.eng-nav-dropdown .card-body { padding: 0.5rem 0; }
.eng-nav-dropdown .dropdown-item {
  padding: 10px 1rem;
  font-family: var(--font-body);
  font-size: 0.9375rem;
  color: var(--text);
  display: flex;
  align-items: center;
  transition: background 0.15s;
}
.eng-nav-dropdown .dropdown-item:hover { background: var(--bg); color: var(--primary); }
.eng-nav-dropdown .dropdown-item i { opacity: 0.85; margin-right: 0.5rem; }
.eng-nav-dropdown .dropdown-item.text-danger:hover { color: var(--error); }
.eng-nav-dropdown .small.text-muted { font-family: var(--font-body); }
.eng-nav-dropdown .fw-bold { font-family: var(--font-heading); }

/* ----- Flash messages ----- */
.eng-flash-wrap {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  padding: 12px 16px;
  padding-top: calc(12px + env(safe-area-inset-top));
  padding-left: calc(16px + env(safe-area-inset-left));
  padding-right: calc(16px + env(safe-area-inset-right));
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.eng-flash {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius);
  font-size: 0.9375rem;
  font-weight: 500;
  font-family: var(--font-body);
  box-shadow: var(--shadow-md);
  pointer-events: auto;
  animation: eng-flash-in 0.3s ease-out;
}
@keyframes eng-flash-in {
  from { opacity: 0; transform: translateY(-12px); }
  to { opacity: 1; transform: translateY(0); }
}
.eng-flash--success { background: linear-gradient(135deg, var(--success), var(--success-hover)); color: #fff; }
.eng-flash--error   { background: linear-gradient(135deg, #dc2626, #b91c1c); color: #fff; }
.eng-flash--warning { background: linear-gradient(135deg, var(--warning), #ca8a04); color: #1f2937; }
.eng-flash i { flex-shrink: 0; font-size: 1.25rem; }
.eng-flash-close {
  margin-left: auto;
  background: rgba(255, 255, 255, 0.25);
  border: none;
  color: #fff;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ----- Main content ----- */
.eng-main {
  padding: 16px;
  padding-left: calc(16px + env(safe-area-inset-left));
  padding-right: calc(16px + env(safe-area-inset-right));
  max-width: 960px;
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
}
@media (min-width: 768px) { .eng-main { padding: 20px 24px; padding-left: calc(24px + env(safe-area-inset-left)); padding-right: calc(24px + env(safe-area-inset-right)); } }

/* ----- Back bar ----- */
.eng-back-bar {
  background: var(--primary-hover);
  padding: 10px 16px;
  padding-left: calc(16px + env(safe-area-inset-left));
}
.eng-back-link {
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  font-family: var(--font-body);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.eng-back-link:hover { color: rgba(255, 255, 255, 0.9); }

/* ----- Cards ----- */
.eng-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}
.eng-card h2 {
  font-family: var(--font-heading);
  font-size: 0.8125rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 12px;
}

/* ----- Dashboard ----- */
.dash-hero {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  padding: 14px 16px;
  padding-left: calc(16px + env(safe-area-inset-left));
  padding-right: calc(16px + env(safe-area-inset-right));
  box-shadow: var(--shadow);
}
.dash-hero-title {
  margin: 0;
  font-family: var(--font-heading);
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--primary-dark);
  line-height: 1.3;
}
.dash-hero-sub {
  margin: 4px 0 0;
  font-size: 0.8125rem;
  color: var(--text-muted);
  line-height: 1.4;
}
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
@media (min-width: 768px) {
  .dashboard-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 992px) {
  .dashboard-grid { grid-template-columns: repeat(6, 1fr); }
}
.dash-card {
  border-radius: var(--radius);
  padding: 20px 16px;
  color: #fff;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow);
  text-decoration: none;
  display: block;
  transition: transform 0.2s, box-shadow 0.2s;
}
.dash-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.12) 0%, transparent 60%);
  pointer-events: none;
}
.dash-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); color: #fff; }
.dash-card h3 { margin: 0; font-size: 1.5rem; font-weight: 700; font-family: var(--font-heading); }
.dash-card p { margin: 6px 0 0; font-size: 0.8125rem; opacity: 0.95; font-family: var(--font-body); }
.dash-card .fa { position: absolute; right: 12px; bottom: 10px; font-size: 1.75rem; opacity: 0.35; }
.dash-pending   { background: linear-gradient(135deg, #0dcaf0, #1e40af);}
.dash-completed { background: linear-gradient(135deg, var(--success), var(--success-hover)); }
.dash-cancelled { background: linear-gradient(135deg, #ffc107, #a1df80) }
.dash-defective { background: linear-gradient(135deg, #7c3aed, #6d28d9); }
.dash-intransit { background: linear-gradient(135deg, #0284c7, #0369a1); }
.dash-stock     { background: linear-gradient(135deg, #0d9488, #0f766e); }
.dash-review    { background: linear-gradient(135deg, #0dcaf0, #1e40af);}
.dash-escalation { background: linear-gradient(135deg, #dc2626, #b91c1c); }

/* ----- Dashboard current task ----- */
.current-task-section,
.current-task-empty {
  margin-bottom: 16px;
}
.current-task-card {
  position: relative;
  overflow: hidden;
  border-radius: calc(var(--radius) + 2px);
  padding: 18px 16px 16px;
  color: #fff;
  background: var(--gradient-brand);
  box-shadow: var(--shadow-md);
  border: 1px solid rgba(255, 255, 255, 0.14);
}
.current-task-card__glow {
  position: absolute;
  top: -40%;
  right: -20%;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.22) 0%, rgba(255, 255, 255, 0) 70%);
  pointer-events: none;
}
.current-task-card__header {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.current-task-card__badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.current-task-card__id {
  margin: 8px 0 0;
  font-family: var(--font-heading);
  font-size: 1.375rem;
  font-weight: 700;
  line-height: 1.2;
}
.current-task-card__status {
  flex-shrink: 0;
  max-width: 42%;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.95);
  color: var(--primary-dark);
  font-size: 0.6875rem;
  font-weight: 700;
  text-align: center;
  line-height: 1.3;
}
.current-task-card__body {
  position: relative;
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  padding: 14px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(6px);
}
@media (min-width: 640px) {
  .current-task-card__body {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .current-task-card__row--full {
    grid-column: 1 / -1;
  }
}
.current-task-card__row {
  min-width: 0;
}
.current-task-card__label {
  display: block;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  opacity: 0.82;
  margin-bottom: 2px;
}
.current-task-card__value {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.45;
  word-break: break-word;
}
.current-task-card__value--name {
  font-size: 0.9375rem;
  font-weight: 700;
}
.current-task-card__meta {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 2px;
}
.current-task-card__chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  font-size: 0.75rem;
  font-weight: 500;
}
.current-task-card__actions {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}
.current-task-card__btn {
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-heading);
  font-weight: 600;
  padding: 8px 14px;
}
.current-task-card__btn--primary {
  background: #fff;
  color: var(--primary-dark);
}
.current-task-card__btn--primary:hover {
  background: rgba(255, 255, 255, 0.92);
  color: var(--primary-dark);
}
.current-task-card__btn--call {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.28);
}
.current-task-card__btn--call:hover {
  background: rgba(255, 255, 255, 0.24);
  color: #fff;
}
.current-task-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 22px 18px;
  border-radius: var(--radius);
  background: var(--card);
  border: 1px dashed var(--border);
  box-shadow: var(--shadow);
}
.current-task-empty__icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(26, 95, 180, 0.1);
  color: var(--primary);
  font-size: 1.125rem;
  margin-bottom: 10px;
}
.current-task-empty__title {
  margin: 0;
  font-family: var(--font-heading);
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--text);
}
.current-task-empty__sub {
  margin: 6px 0 14px;
  font-size: 0.8125rem;
  color: var(--text-muted);
}
.current-task-empty__btn {
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-weight: 600;
  padding: 8px 14px;
}
.current-task-empty__btn:hover {
  background: var(--primary-hover);
  color: #fff;
}

/* ----- Tabs ----- */
.tabs-bar { background: var(--primary); padding: 0 16px 12px; }
.tabs-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.tabs-wrap::-webkit-scrollbar { display: none; }
.tabs { display: flex; gap: 8px; padding-bottom: 4px; min-width: max-content; }
.tab-btn {
  flex: 0 0 auto;
  padding: 10px 14px;
  border: none;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.95);
  font-size: 0.8125rem;
  font-weight: 600;
  font-family: var(--font-body);
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s;
}
.tab-btn:hover { background: rgba(255, 255, 255, 0.3); color: #fff; }
.tab-btn.active { background: #fff; color: var(--primary); }
.panel { display: none; }
.panel.active { display: block; }

/* ----- Job cards ----- */
.job-list { display: flex; flex-direction: column; gap: 12px; }
.job-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}
.job-card .badge {
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.6875rem;
  font-weight: 600;
  font-family: var(--font-heading);
  text-transform: uppercase;
}
.job-card .id { font-size: 1rem; font-weight: 700; font-family: var(--font-heading); margin-bottom: 4px; }
.job-card .meta { font-size: 0.8125rem; color: var(--text-muted); margin-bottom: 2px; font-family: var(--font-body); }
.job-card .customer { font-size: 0.9375rem; font-weight: 600; margin-top: 6px; font-family: var(--font-body); }
.job-card .address { font-size: 0.8125rem; color: var(--text-muted); margin-top: 4px; word-break: break-word; }
.job-card .phone { font-size: 0.8125rem; font-weight: 600; color: var(--primary); margin-top: 4px; }
.job-card .actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.job-card .btn-details { background: var(--primary); color: #fff; border-radius: var(--radius-sm); font-weight: 600; }
.job-card .btn-update { background: var(--warning); color: #1f2937; border-radius: var(--radius-sm); font-weight: 600; }
.job-card .btn-complete { background: var(--success); color: #fff; border-radius: var(--radius-sm); font-weight: 600; }
.job-card .btn-cancel { background: var(--error); color: #fff; border-radius: var(--radius-sm); font-weight: 600; }
.badge-today { background: #d1fae5; color: #065f46; }
.badge-tomorrow { background: #ccfbf1; color: #0f766e; }
.badge-future { background: #e0f2fe; color: #155e75; }
.badge-Rescheduled { background: #ffedd5; color: #c2410c; }
.badge-inprocess { background: #fee2e2; color: #b91c1c; }
.badge-intimated { background: #ede9fe; color: #5b21b6; }
.badge-approval { background: var(--warning-bg); color: #92400e; }
.badge-escalation { background: #fee2e2; color: #b91c1c; }
.badge-pending { background: var(--warning-bg); color: #92400e; }
.badge-approved { background: #d1fae5; color: #065f46; }
.badge-rejected { background: #fee2e2; color: #b91c1c; }

/* ----- My Tasks page – fit tabs & cards to screen ----- */
.eng-mytask-page .tabs-bar {
  background: var(--gradient-brand);
  padding: 0 12px 12px;
}
.eng-mytask-page .tabs-wrap {
  overflow: visible;
}
.eng-mytask-page .tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  min-width: 0;
  width: 100%;
  padding-bottom: 0;
}
.eng-mytask-page .tab-btn {
  width: 100%;
  padding: 8px 4px;
  font-size: 0.7rem;
  line-height: 1.25;
  text-align: center;
  white-space: normal;
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
}
@media (min-width: 480px) {
  .eng-mytask-page .tab-btn {
    font-size: 0.75rem;
    padding: 9px 6px;
  }
}
@media (min-width: 768px) {
  .eng-mytask-page .tabs {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 8px;
  }
  .eng-mytask-page .tab-btn {
    font-size: 0.8125rem;
    padding: 10px 8px;
    min-height: 40px;
  }
}
.eng-mytask-page .eng-main {
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 10px;
  padding-left: max(10px, env(safe-area-inset-left));
  padding-right: max(10px, env(safe-area-inset-right));
  box-sizing: border-box;
}
.eng-mytask-page .panel {
  width: 100%;
  max-width: 100%;
}
.eng-mytask-page .job-list {
  width: 100%;
  max-width: 100%;
  gap: 12px;
  margin: 0;
  padding: 0;
}
.eng-mytask-page .job-card {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  padding: 16px;
  overflow: hidden;
  margin: 0;
}
.eng-mytask-page .job-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
  min-width: 0;
}
.eng-mytask-page .job-card-header .id {
  font-size: 1rem;
  font-weight: 700;
  font-family: var(--font-heading);
  margin: 0;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.eng-mytask-page .job-card-header .badge {
  flex-shrink: 0;
  padding: 4px 10px;
  font-size: 0.6875rem;
}
.eng-mytask-page .job-card-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}
.eng-mytask-page .job-row {
  display: grid;
  grid-template-columns: minmax(68px, 22%) minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  font-size: 0.875rem;
  line-height: 1.4;
  width: 100%;
}
.eng-mytask-page .job-label {
  color: var(--text-muted);
  font-size: 0.8125rem;
  font-weight: 500;
  flex-shrink: 0;
}
.eng-mytask-page .job-value {
  color: var(--text);
  font-weight: 500;
  min-width: 0;
  flex: 1;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.eng-mytask-page .job-value--name {
  font-weight: 600;
}
.eng-mytask-page .job-value--phone {
  color: var(--primary);
  font-weight: 600;
}
.eng-mytask-page .job-card .actions {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}
.eng-mytask-page .job-card .btn-details {
  width: 100%;
  padding: 10px 14px;
  font-size: 0.875rem;
  text-align: center;
}
.eng-mytask-page .job-list .text-center {
  padding: 2rem 1rem !important;
  font-size: 0.875rem;
}

/* ----- Details grid ----- */
.details-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px 20px;
}
@media (min-width: 768px) { .details-grid { grid-template-columns: repeat(4, 1fr); } }
.detail-row { margin-bottom: 0; min-width: 0; }
.detail-row.full { grid-column: 1 / -1; }
.detail-label { font-size: 0.75rem; color: var(--text-muted); display: block; margin-bottom: 2px; font-family: var(--font-body); }
.detail-value { font-size: 0.9375rem; font-weight: 500; word-break: break-word; font-family: var(--font-body); }
.detail-value.phone { color: var(--primary); font-weight: 600; }
.form-error { font-size: 0.8125rem; color: var(--error); margin-top: 4px; }

/* ----- Buttons & forms (Bootstrap overrides) ----- */
.btn {
  font-family: var(--font-body);
  font-weight: 600;
  border-radius: var(--radius-sm);
}
.btn-primary { background: var(--primary); border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn-outline-primary { color: var(--primary); border-color: var(--primary); }
.btn-outline-primary:hover { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-outline-secondary { color: var(--text-muted); border-color: var(--border); }
.btn-outline-secondary:hover { background: var(--bg); color: var(--text); border-color: var(--border); }
.form-control, .form-select {
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  font-family: var(--font-body);
}
.form-control:focus, .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}
.form-label { font-family: var(--font-body); font-weight: 500; color: var(--text); }

/* ----- Profile (shared) ----- */
.profile-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-hover));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 700;
  font-family: var(--font-heading);
  margin: 0 auto 12px;
}
.profile-name { font-size: 1.25rem; font-weight: 700; font-family: var(--font-heading); text-align: center; margin-bottom: 4px; }
.profile-role { text-align: center; color: var(--text-muted); font-size: 0.875rem; margin-bottom: 20px; font-family: var(--font-body); }

/* ----- Settings list ----- */
.settings-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: var(--text);
  font-family: var(--font-body);
  font-weight: 500;
  transition: color 0.2s;
}
.settings-item:last-child { border-bottom: 0; }
.settings-item:hover { color: var(--primary); }
.settings-item i { color: var(--text-muted); margin-right: 12px; width: 24px; text-align: center; }

/* ----- Advance search ----- */
.advance-search-page { max-width: 480px; margin: 0 auto; }
.or-div { text-align: center; margin: 12px 0; color: var(--text-muted); font-size: 0.8125rem; font-weight: 600; font-family: var(--font-body); }
.btn-search-submit {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, var(--success), var(--success-hover));
  border: none;
  border-radius: var(--radius);
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  font-family: var(--font-heading);
  cursor: pointer;
  margin-top: 8px;
  transition: opacity 0.2s;
}
.btn-search-submit:hover { color: #fff; opacity: 0.95; }
#form-err { color: var(--error); font-size: 0.875rem; margin-top: 8px; display: none; font-family: var(--font-body); }

/* ----- Login (standalone page) ----- */
body.eng-login-page {
  font-family: var(--font-body);
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  
  padding-top: calc(20px + var(--safe-top));
  padding-bottom: calc(20px + var(--safe-bottom));
  margin: 0;
  position: relative;
  overflow: hidden;
}
body.eng-login-page::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 20% 10%, rgba(59, 130, 246, 0.25) 0%, transparent 60%),
    radial-gradient(ellipse 60% 50% at 90% 90%, rgba(26, 95, 180, 0.2) 0%, transparent 55%);
  pointer-events: none;
}
.login-container {
  width: 100%;
  max-width: 420px;
  position: relative;
  z-index: 1;
}
.login-logo-container {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 1.25rem;
}
.login-logo-container img {
  max-width: 200px;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.3));
}
.login-brand-tag {
  text-align: center;
  color: #0d6efd;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 1.5rem;
}
#msg {
  display: none;
  font-size: 0.9rem;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  margin-bottom: 14px;
  text-align: left;
  font-family: var(--font-body);
}
#msg.alert { display: none; }
#msg.alert[style*="block"], #msg.error, #msg.success { display: block; }
.login-card {
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(12px);
  border-radius: calc(var(--radius) + 4px);
  padding: 32px 28px;
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(255, 255, 255, 0.2);
}
.login-card h1 {
  font-size: 1.35rem;
  font-weight: 700;
  font-family: var(--font-heading);
  color: var(--primary-dark);
  text-align: center;
  margin-bottom: 6px;
}
.login-card h1 i { color: var(--primary); }
.login-card .sub { color: var(--text-muted); font-size: 0.875rem; text-align: center; margin-bottom: 24px; font-family: var(--font-body); }
.login-card .form-group { margin-bottom: 16px; }
.login-card .form-group label { display: block; font-size: 0.85rem; font-weight: 600; color: var(--text); margin-bottom: 6px; font-family: var(--font-body); }
.login-card .form-group .form-control {
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  font-family: var(--font-body);
}
.login-card .form-group .form-control:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15); }
.btn-login {
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-weight: 600;
  font-family: var(--font-heading);
  background: var(--gradient-brand);
  color: #fff;
  cursor: pointer;
  margin-top: 8px;
  transition: transform 0.15s, box-shadow 0.15s, opacity 0.15s;
  box-shadow: 0 4px 14px rgba(26, 95, 180, 0.35);
}
.btn-login:hover { color: #fff; transform: translateY(-1px); box-shadow: 0 6px 20px rgba(26, 95, 180, 0.45); }
.btn-login:active { transform: translateY(0); }
.btn-login:disabled { opacity: 0.7; cursor: not-allowed; }
.login-card .forgot-link { color: var(--primary); font-weight: 600; font-size: 0.875rem; }
.login-card .forgot-link:hover { color: var(--primary-hover); }
#msg.error { background: var(--error-bg); color: var(--error); }
#msg.success { background: #d1fae5; color: #047857; }
#msg.alert-info,
body.eng-login-page #msg.alert-info {
  display: block;
  background: #e0f2fe;
  color: #0369a1;
  border: 1px solid #bae6fd;
}
body.eng-login-page #msg.alert-success {
  display: block;
  background: #d1fae5;
  color: #047857;
  border: 1px solid #a7f3d0;
}
body.eng-login-page #msg.alert-danger {
  display: block;
}
.loader {
  display: none;
  width: 22px; height: 22px;
  border: 3px solid rgba(255, 255, 255, 0.5);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 6px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.demo-btns { margin-top: 16px; display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.demo-btns .btn-sm { font-size: 0.75rem; padding: 6px 10px; border-radius: var(--radius-sm); }

/* ----- Forgot / Reset password (auth centering) ----- */
body.eng-auth-page {
  font-family: var(--font-body);
  background: var(--gradient-dark);
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  padding-top: calc(20px + var(--safe-top));
  padding-bottom: calc(20px + var(--safe-bottom));
  margin: 0;
  position: relative;
  overflow: hidden;
}
body.eng-auth-page::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 20% 10%, rgba(59, 130, 246, 0.25) 0%, transparent 60%),
    radial-gradient(ellipse 60% 50% at 90% 90%, rgba(26, 95, 180, 0.2) 0%, transparent 55%);
  pointer-events: none;
}
body.eng-auth-page .forgot-container,
body.eng-auth-page .reset-container { position: relative; z-index: 1; }
.forgot-container, .reset-container { width: 100%; max-width: 400px; }
.forgot-card, .reset-card {
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(12px);
  border-radius: calc(var(--radius) + 4px);
  padding: 32px 28px;
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(255, 255, 255, 0.2);
}
.forgot-card h1, .reset-card h1 { font-size: 1.35rem; font-weight: 700; font-family: var(--font-heading); color: var(--primary-dark); text-align: center; margin-bottom: 6px; }
.forgot-card h1 i, .reset-card h1 i { color: var(--primary); }
.forgot-card .sub, .reset-card .sub { color: var(--text-muted); font-size: 0.9rem; text-align: center; margin-bottom: 22px; font-family: var(--font-body); }
.forgot-card .form-group, .reset-card .form-group { margin-bottom: 16px; }
.forgot-card .form-group label, .reset-card .form-group label { font-family: var(--font-body); font-weight: 600; color: var(--text); }
.btn-send, .btn-reset {
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-weight: 600;
  font-family: var(--font-heading);
  background: var(--gradient-brand);
  color: #fff;
  cursor: pointer;
  margin-top: 8px;
  transition: transform 0.15s, box-shadow 0.15s;
  box-shadow: 0 4px 14px rgba(26, 95, 180, 0.35);
}
.btn-send:hover, .btn-reset:hover { color: #fff; transform: translateY(-1px); box-shadow: 0 6px 20px rgba(26, 95, 180, 0.45); }
.btn-send:disabled, .btn-reset:disabled { opacity: 0.7; cursor: not-allowed; }
.forgot-card #msg, .reset-card #msg { font-family: var(--font-body); }
.otp-type-tabs { display: flex; gap: 8px; margin-bottom: 16px; }
.otp-type-tabs .btn { flex: 1; border-radius: var(--radius-sm); }
.back-link { display: block; text-align: center; margin-top: 16px; color: var(--primary); font-weight: 600; text-decoration: none; font-family: var(--font-body); }
.back-link:hover { color: var(--primary-hover); }

/* ----- Complete booking steps ----- */
.step-panel { display: none; }
.step-panel.active { display: block; }
.step-indicator { display: flex; gap: 8px; margin-bottom: 20px; }
.step-dot {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--border);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.875rem;
  font-family: var(--font-heading);
}
.step-dot.done { background: var(--success); color: #fff; }
.step-dot.active { background: var(--primary); color: #fff; }
.img-preview { max-width: 120px; max-height: 120px; border: 1px solid var(--border); border-radius: var(--radius-sm); margin-top: 6px; }
.summary-row { padding: 8px 0; border-bottom: 1px solid var(--border); font-family: var(--font-body); }
.summary-row:last-child { border-bottom: 0; }

/* ----- Complaint info card (update/cancel) ----- */
.booking-info-card {
  background: var(--bg);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 16px;
  border: 1px solid var(--border);
}
.booking-info-card .row { margin-bottom: 8px; }
.booking-info-card .row:last-child { margin-bottom: 0; }
.booking-info-card .detail-label, .booking-info-card .detail-value { font-family: var(--font-body); }
.modal-lg .table td, .modal-lg .table th { vertical-align: middle; }
.gfq_sn { font-weight: 700; text-align: center; font-family: var(--font-body); }

/* ----- Complaint details / tables ----- */
.actions .btn { margin-right: 8px; margin-bottom: 8px; }
.table th { background: var(--primary); color: #fff; font-family: var(--font-heading); font-weight: 600; }
.table { font-family: var(--font-body); }

/* ----- Footer ----- */
.eng-footer {
  text-align: center;
  padding: 16px;
  padding-bottom: calc(16px + var(--safe-bottom));
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.8125rem;
  font-family: var(--font-body);
  background: var(--primary-dark);
  margin-top: auto;
}

/* ----- PWA Install Banner ----- */
.pwa-install-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 10000;
  padding: 12px 16px;
  padding-bottom: calc(12px + var(--safe-bottom));
  background: var(--card);
  border-top: 1px solid var(--border);
  box-shadow: 0 -8px 32px rgba(10, 22, 40, 0.15);
  animation: pwa-slide-up 0.35s ease-out;
}
@keyframes pwa-slide-up {
  from { transform: translateY(100%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
.pwa-install-banner.pwa-install-hide {
  animation: pwa-slide-down 0.3s ease-in forwards;
}
@keyframes pwa-slide-down {
  to { transform: translateY(100%); opacity: 0; }
}
.pwa-install-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 480px;
  margin: 0 auto;
}
.pwa-install-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--gradient-brand);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}
.pwa-install-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.pwa-install-text strong {
  font-family: var(--font-heading);
  font-size: 0.9rem;
  color: var(--text);
}
.pwa-install-text span {
  font-size: 0.75rem;
  color: var(--text-muted);
}
.pwa-install-btn {
  flex-shrink: 0;
  padding: 8px 16px;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--gradient-brand);
  color: #fff;
  font-weight: 600;
  font-size: 0.8125rem;
  font-family: var(--font-heading);
  cursor: pointer;
  transition: opacity 0.15s;
}
.pwa-install-btn:hover { opacity: 0.9; }
.pwa-install-close {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 8px;
  background: var(--bg);
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}
.pwa-install-close:hover { background: var(--border); color: var(--text); }

/* ----- Offline page ----- */
body.eng-offline-page {
  font-family: var(--font-body);
  background: var(--gradient-dark);
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  margin: 0;
}
.offline-container { width: 100%; max-width: 400px; }
.offline-card {
  background: rgba(255, 255, 255, 0.97);
  border-radius: var(--radius);
  padding: 40px 28px;
  text-align: center;
  box-shadow: var(--shadow-lg);
}
.offline-icon {
  position: relative;
  width: 72px;
  height: 72px;
  margin: 0 auto 20px;
  border-radius: 50%;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: var(--text-muted);
}
.offline-slash {
  position: absolute;
  width: 3px;
  height: 56px;
  background: var(--error);
  border-radius: 2px;
  transform: rotate(45deg);
}
.offline-card h1 {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  color: var(--primary-dark);
  margin-bottom: 8px;
}
.offline-card .sub { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 24px; }
.btn-retry {
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--gradient-brand);
  color: #fff;
  font-weight: 600;
  font-family: var(--font-heading);
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(26, 95, 180, 0.35);
}
.btn-outline-home {
  display: block;
  width: 100%;
  padding: 12px;
  border-radius: var(--radius-sm);
  border: 2px solid var(--border);
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
  text-align: center;
  transition: border-color 0.15s, color 0.15s;
}
.btn-outline-home:hover { border-color: var(--primary); color: var(--primary); }

/* ----- Page titles ----- */
.eng-main .h5, .eng-main h1, .eng-main h2.h5 {
  font-family: var(--font-heading);
  color: var(--text);
  font-weight: 600;
}
.text-muted { color: var(--text-muted) !important; }

/* ----- Global Loader Overlay ----- */
.global-loader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(2px);
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 16px;
}
.global-loader.show { display: flex; }
.global-loader .loader {
  width: 40px;
  height: 40px;
  border: 4px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}
.global-loader .text { color: var(--text); font-weight: 500; }

.completion-file-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.completion-file-box {
  width: 96px;
  height: 96px;
  border: 1px dashed var(--border, #cbd5e1);
  border-radius: 12px;
  background: #fff;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.completion-file-box--add {
  color: var(--primary, #0d6efd);
  background: #f8fafc;
  cursor: pointer;
  padding: 0;
}

.completion-file-box--add i {
  font-size: 1.5rem;
}

.completion-file-box--filled {
  border-style: solid;
}

.completion-file-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.completion-file-doc {
  font-size: 1.75rem;
  color: #64748b;
}

.completion-file-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.72);
  color: #fff;
  line-height: 1;
  font-size: 16px;
  cursor: pointer;
}
