/* =============================================
   INVENSYS CRM — Engineering Modules CSS
   Modules: Site Engineering, DB Layout, File Manager,
            Site Photos, Closure Workflow, Tech Library,
            Push Notifications
   Version: 6.0 (April 2026)
   ============================================= */

/* ---- SITE ENGINEERING — SUB-TABS ---- */
.site-eng-wrap { padding: 0; }
.site-eng-header {
  background: linear-gradient(135deg, #1e3a5f 0%, #2d6a9f 100%);
  color: #fff;
  padding: 20px 24px 0;
  border-radius: 14px 14px 0 0;
}
.site-eng-title { font-size: 20px; font-weight: 700; margin-bottom: 4px; }
.site-eng-meta { font-size: 12px; opacity: 0.75; display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.site-eng-meta span { display: flex; align-items: center; gap: 5px; }
.site-status-badge {
  display: inline-block; padding: 3px 10px; border-radius: 20px;
  font-size: 11px; font-weight: 600; background: rgba(255,255,255,0.18); color: #fff;
  letter-spacing: 0.5px;
}
.site-status-badge.active { background: rgba(52,199,89,0.28); }
.site-status-badge.closed { background: rgba(255,59,48,0.28); }
.site-status-badge.pending { background: rgba(255,149,0,0.28); }

/* Sub-tabs */
.subtab-bar {
  display: flex; overflow-x: auto; background: rgba(0,0,0,0.18);
  padding: 0 8px; gap: 2px; border-bottom: 1px solid rgba(255,255,255,0.1);
  scrollbar-width: none;
}
.subtab-bar::-webkit-scrollbar { display: none; }
.subtab-btn {
  flex-shrink: 0; padding: 10px 16px; font-size: 12px; font-weight: 600;
  color: rgba(255,255,255,0.65); background: transparent; border: none;
  border-bottom: 3px solid transparent; cursor: pointer;
  transition: all 0.2s; white-space: nowrap; font-family: 'Inter', sans-serif;
  letter-spacing: 0.3px;
}
.subtab-btn:hover { color: #fff; }
.subtab-btn.active { color: #fff; border-bottom-color: #4fc3f7; }
.subtab-content { padding: 20px; background: #fff; border-radius: 0 0 14px 14px; }

/* ---- OVERVIEW TAB ---- */
.overview-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 20px; }
@media (max-width: 768px) { .overview-stats { grid-template-columns: repeat(2, 1fr); } }
.ov-stat-card {
  background: #f8fafc; border-radius: 10px; padding: 14px;
  border: 1px solid #e8edf2; text-align: center;
}
.ov-stat-val { font-size: 26px; font-weight: 700; color: #1e3a5f; }
.ov-stat-label { font-size: 11px; color: #64748b; margin-top: 3px; text-transform: uppercase; letter-spacing: 0.5px; }
.tech-desc-box {
  background: #f0f7ff; border-left: 4px solid #2d6a9f;
  border-radius: 8px; padding: 16px; margin-bottom: 18px;
  font-size: 14px; line-height: 1.7; color: #334155;
}
.activity-feed { display: flex; flex-direction: column; gap: 8px; }
.activity-item {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 14px; background: #f8fafc; border-radius: 8px;
  border: 1px solid #e8edf2;
}
.activity-icon {
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; flex-shrink: 0;
}
.activity-icon.photo { background: #fef3c7; color: #d97706; }
.activity-icon.file { background: #dbeafe; color: #2563eb; }
.activity-icon.db { background: #d1fae5; color: #059669; }
.activity-icon.closure { background: #ede9fe; color: #7c3aed; }
.activity-text { flex: 1; }
.activity-title { font-size: 13px; font-weight: 600; color: #1e293b; }
.activity-sub { font-size: 11px; color: #94a3b8; margin-top: 2px; }

/* ---- DB LAYOUT MODULE ---- */
.db-toolbar {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
  padding: 14px 0; border-bottom: 1px solid #e8edf2; margin-bottom: 18px;
}
.db-toolbar h3 { font-size: 15px; font-weight: 700; color: #1e3a5f; flex: 1; }
.db-version-select {
  padding: 6px 12px; border-radius: 8px; border: 1px solid #d1d5db;
  font-size: 12px; font-family: 'Inter', sans-serif; cursor: pointer;
}
.btn-db-primary {
  background: #1e3a5f; color: #fff; border: none; border-radius: 8px;
  padding: 8px 14px; font-size: 12px; font-weight: 600; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px; font-family: 'Inter', sans-serif;
  transition: background 0.2s;
}
.btn-db-primary:hover { background: #2d6a9f; }
.btn-db-secondary {
  background: #f1f5f9; color: #334155; border: 1px solid #e2e8f0;
  border-radius: 8px; padding: 8px 14px; font-size: 12px; font-weight: 600;
  cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
  font-family: 'Inter', sans-serif; transition: all 0.2s;
}
.btn-db-secondary:hover { background: #e2e8f0; }
.btn-danger-sm {
  background: #fee2e2; color: #dc2626; border: none; border-radius: 6px;
  padding: 5px 10px; font-size: 11px; cursor: pointer; font-weight: 600; font-family: 'Inter', sans-serif;
}
.btn-success-sm {
  background: #d1fae5; color: #059669; border: none; border-radius: 6px;
  padding: 5px 10px; font-size: 11px; cursor: pointer; font-weight: 600; font-family: 'Inter', sans-serif;
}

/* Zones */
.zone-list { display: flex; flex-direction: column; gap: 18px; }
.zone-card {
  background: #fff; border: 1px solid #e2e8f0;
  border-radius: 12px; overflow: hidden;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.zone-header {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; background: #f0f7ff; border-bottom: 1px solid #dbeafe;
  cursor: pointer;
}
.zone-name { font-size: 14px; font-weight: 700; color: #1e3a5f; flex: 1; }
.zone-circuit-count {
  font-size: 11px; color: #64748b; background: #fff;
  padding: 2px 8px; border-radius: 12px; border: 1px solid #e2e8f0;
}
.zone-actions { display: flex; gap: 6px; }
.zone-body { padding: 14px; }

/* Circuit table */
.circuit-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.circuit-table th {
  text-align: left; padding: 8px 10px;
  background: #f8fafc; border-bottom: 2px solid #e2e8f0;
  color: #64748b; font-weight: 600; font-size: 11px; text-transform: uppercase;
}
.circuit-table td { padding: 9px 10px; border-bottom: 1px solid #f1f5f9; vertical-align: middle; }
.circuit-table tr:last-child td { border-bottom: none; }
.circuit-table tr:hover td { background: #f8fafc; }
.circuit-type-chip {
  display: inline-block; padding: 2px 8px; border-radius: 10px;
  font-size: 10px; font-weight: 700; letter-spacing: 0.4px;
}
.circuit-type-chip.Lighting { background: #fef9c3; color: #854d0e; }
.circuit-type-chip.Power { background: #fee2e2; color: #991b1b; }
.circuit-type-chip.HVAC { background: #dbeafe; color: #1e40af; }
.circuit-type-chip.DataControl, .circuit-type-chip.Data-Control { background: #d1fae5; color: #065f46; }
.circuit-type-chip.AV { background: #ede9fe; color: #4c1d95; }
.circuit-status-chip {
  display: inline-block; padding: 2px 8px; border-radius: 10px;
  font-size: 10px; font-weight: 700;
}
.circuit-status-chip.Active { background: #d1fae5; color: #059669; }
.circuit-status-chip.Inactive { background: #f1f5f9; color: #64748b; }
.circuit-status-chip.Fault { background: #fee2e2; color: #dc2626; }
.circuit-status-chip.Testing { background: #fef3c7; color: #d97706; }
.protocol-chip {
  display: inline-block; padding: 2px 6px; border-radius: 6px;
  font-size: 10px; font-weight: 600; background: #e0e7ff; color: #3730a3;
}

/* Panel Grid */
.panel-grid-wrap {
  margin-top: 18px; background: #1a2332; border-radius: 12px;
  padding: 20px; overflow-x: auto;
}
.panel-grid-title { color: #94a3b8; font-size: 12px; font-weight: 600; margin-bottom: 14px; text-transform: uppercase; }
.panel-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 6px; max-width: 100%;
}
.panel-slot {
  background: #2d3748; border-radius: 6px; padding: 10px 6px;
  text-align: center; min-height: 70px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  border: 1px solid #374151; cursor: pointer; transition: all 0.15s;
  position: relative;
}
.panel-slot:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.3); }
.panel-slot.empty { opacity: 0.3; cursor: default; }
.panel-slot.empty:hover { transform: none; box-shadow: none; }
.panel-slot-id { font-size: 13px; font-weight: 700; color: #fff; }
.panel-slot-type { font-size: 9px; color: rgba(255,255,255,0.6); margin-top: 2px; text-transform: uppercase; }
.panel-slot-breaker { font-size: 10px; color: rgba(255,255,255,0.8); margin-top: 4px; font-weight: 600; }
.panel-slot.Lighting { border-left: 3px solid #fbbf24; }
.panel-slot.Power { border-left: 3px solid #f87171; }
.panel-slot.HVAC { border-left: 3px solid #60a5fa; }
.panel-slot.Data-Control { border-left: 3px solid #34d399; }
.panel-slot.AV { border-left: 3px solid #a78bfa; }
.panel-slot.Fault { background: #450a0a; border: 1px solid #dc2626; animation: faultPulse 1.5s infinite; }
@keyframes faultPulse { 0%,100%{opacity:1} 50%{opacity:0.6} }

/* DB Diff view */
.diff-added { background: #d1fae5; }
.diff-removed { background: #fee2e2; text-decoration: line-through; }
.diff-changed { background: #fef3c7; }

/* Version history */
.version-timeline { display: flex; flex-direction: column; gap: 10px; }
.version-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; background: #f8fafc; border-radius: 10px;
  border: 1px solid #e2e8f0;
}
.version-badge {
  background: #1e3a5f; color: #fff; font-size: 11px; font-weight: 700;
  padding: 4px 10px; border-radius: 20px; white-space: nowrap;
}
.version-info { flex: 1; }
.version-label { font-size: 13px; font-weight: 600; color: #1e293b; }
.version-meta { font-size: 11px; color: #94a3b8; margin-top: 2px; }

/* ---- FILE MANAGER ---- */
.fm-upload-zone {
  border: 2px dashed #93c5fd; border-radius: 12px;
  padding: 36px; text-align: center; background: #eff6ff;
  cursor: pointer; transition: all 0.2s; margin-bottom: 20px;
}
.fm-upload-zone:hover, .fm-upload-zone.drag-over {
  border-color: #2563eb; background: #dbeafe;
}
.fm-upload-icon { font-size: 36px; margin-bottom: 10px; }
.fm-upload-text { font-size: 15px; font-weight: 600; color: #1e40af; }
.fm-upload-sub { font-size: 12px; color: #64748b; margin-top: 6px; }
.fm-file-list { display: flex; flex-direction: column; gap: 8px; }
.fm-file-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; background: #fff; border-radius: 10px;
  border: 1px solid #e2e8f0; transition: all 0.15s;
}
.fm-file-item:hover { background: #f8fafc; box-shadow: 0 2px 8px rgba(0,0,0,0.06); }
.fm-file-icon {
  width: 42px; height: 42px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center; font-size: 20px;
  flex-shrink: 0;
}
.fm-file-icon.pdf { background: #fee2e2; }
.fm-file-icon.dwg { background: #dbeafe; }
.fm-file-icon.rvt { background: #f3e8ff; }
.fm-file-icon.img { background: #fef3c7; }
.fm-file-icon.video { background: #d1fae5; }
.fm-file-icon.other { background: #f1f5f9; }
.fm-file-info { flex: 1; min-width: 0; }
.fm-file-name { font-size: 13px; font-weight: 600; color: #1e293b; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fm-file-meta { font-size: 11px; color: #94a3b8; margin-top: 2px; display: flex; gap: 10px; flex-wrap: wrap; }
.fm-file-tag {
  display: inline-block; padding: 2px 8px; border-radius: 10px;
  font-size: 10px; font-weight: 600;
}
.fm-file-tag.As-Built { background: #d1fae5; color: #065f46; }
.fm-file-tag.Approved-for-Construction { background: #dbeafe; color: #1e40af; }
.fm-file-tag.Client-Copy { background: #ede9fe; color: #4c1d95; }
.fm-file-tag.Internal-Only { background: #f1f5f9; color: #64748b; }
.fm-file-actions { display: flex; gap: 6px; flex-shrink: 0; }
.btn-fm { 
  padding: 5px 10px; border-radius: 7px; font-size: 11px; font-weight: 600;
  cursor: pointer; border: none; font-family: 'Inter', sans-serif; display: inline-flex; align-items: center; gap: 4px;
  transition: all 0.15s;
}
.btn-fm.view { background: #dbeafe; color: #1e40af; }
.btn-fm.view:hover { background: #bfdbfe; }
.btn-fm.share { background: #d1fae5; color: #059669; }
.btn-fm.share:hover { background: #a7f3d0; }
.btn-fm.download { background: #f1f5f9; color: #475569; }
.btn-fm.download:hover { background: #e2e8f0; }
.fm-version-badge {
  background: #f8fafc; border: 1px solid #e2e8f0;
  border-radius: 6px; padding: 2px 7px; font-size: 10px; font-weight: 700;
  color: #475569; white-space: nowrap;
}
.audit-log-list { display: flex; flex-direction: column; gap: 4px; max-height: 200px; overflow-y: auto; }
.audit-log-item {
  display: flex; align-items: center; gap: 8px;
  font-size: 11px; color: #64748b; padding: 4px 8px; background: #f8fafc; border-radius: 6px;
}
.audit-icon { font-size: 12px; }

/* PDF Viewer */
.pdf-viewer-wrap {
  background: #1a1a2e; border-radius: 12px; overflow: hidden;
  margin: 16px 0;
}
.pdf-viewer-bar {
  display: flex; align-items: center; gap: 10px; padding: 10px 14px;
  background: #16213e; border-bottom: 1px solid #0f3460;
}
.pdf-viewer-bar .pdf-title { color: #fff; font-size: 12px; font-weight: 600; flex: 1; }
.pdf-nav-btn {
  background: #0f3460; color: #fff; border: none; border-radius: 6px;
  padding: 6px 12px; font-size: 12px; cursor: pointer; font-family: 'Inter', sans-serif;
}
.pdf-page-info { color: #94a3b8; font-size: 12px; }
.pdf-iframe-wrap { position: relative; }
.pdf-iframe { width: 100%; height: 520px; border: none; }

/* ---- SITE PHOTOS MODULE ---- */
.sph-toolbar {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
  margin-bottom: 18px;
}
.sph-filter-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.sph-chip {
  padding: 5px 12px; border-radius: 20px; font-size: 12px; font-weight: 600;
  cursor: pointer; background: #f1f5f9; color: #475569; border: 1px solid #e2e8f0;
  transition: all 0.15s; font-family: 'Inter', sans-serif;
}
.sph-chip.active { background: #1e3a5f; color: #fff; border-color: #1e3a5f; }

.sph-camera-btn {
  display: flex; align-items: center; gap: 8px;
  background: linear-gradient(135deg, #1e3a5f, #2d6a9f);
  color: #fff; border: none; border-radius: 12px;
  padding: 12px 20px; font-size: 14px; font-weight: 700;
  cursor: pointer; font-family: 'Inter', sans-serif;
  box-shadow: 0 4px 14px rgba(30,58,95,0.35);
  transition: all 0.2s;
}
.sph-camera-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(30,58,95,0.45); }
.sph-camera-btn i { font-size: 18px; }

.sph-photo-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}
.sph-photo-card {
  background: #fff; border-radius: 10px; overflow: hidden;
  border: 1px solid #e2e8f0; cursor: pointer;
  transition: all 0.2s; position: relative;
}
.sph-photo-card:hover { transform: translateY(-3px); box-shadow: 0 6px 20px rgba(0,0,0,0.12); }
.sph-photo-thumb {
  width: 100%; aspect-ratio: 4/3; object-fit: cover; display: block;
  background: #f1f5f9;
}
.sph-photo-thumb-placeholder {
  width: 100%; aspect-ratio: 4/3; background: #f1f5f9;
  display: flex; align-items: center; justify-content: center;
  font-size: 32px; color: #94a3b8;
}
.sph-photo-info { padding: 8px 10px; }
.sph-photo-label { font-size: 12px; font-weight: 600; color: #1e293b; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sph-photo-meta { font-size: 10px; color: #94a3b8; margin-top: 2px; }
.sph-photo-zone {
  display: inline-block; padding: 1px 6px; border-radius: 6px;
  background: #dbeafe; color: #1e40af; font-size: 10px; font-weight: 600;
  margin-right: 4px;
}
.sph-shared-badge {
  position: absolute; top: 6px; right: 6px;
  background: rgba(0,0,0,0.55); color: #fff;
  font-size: 10px; padding: 2px 6px; border-radius: 8px;
  display: flex; align-items: center; gap: 3px;
}

/* Photo Viewer / Markup */
.sph-viewer-wrap {
  background: #000; border-radius: 12px; overflow: hidden; position: relative;
}
.sph-viewer-img { width: 100%; max-height: 420px; object-fit: contain; display: block; }
.sph-viewer-canvas {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  cursor: crosshair;
}
.sph-markup-tools {
  display: flex; gap: 8px; padding: 10px; background: #1a1a2e;
  align-items: center; flex-wrap: wrap;
}
.markup-tool-btn {
  padding: 6px 12px; border-radius: 8px; border: none;
  font-size: 12px; font-weight: 600; cursor: pointer; font-family: 'Inter', sans-serif;
  background: #2d3748; color: #fff; transition: all 0.15s;
}
.markup-tool-btn:hover, .markup-tool-btn.active { background: #4fc3f7; color: #000; }
.sph-comment-thread { padding: 14px 0; }
.sph-comment {
  display: flex; gap: 10px; margin-bottom: 12px;
}
.sph-comment-avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: #dbeafe; color: #1e40af; font-size: 11px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.sph-comment-body { flex: 1; }
.sph-comment-name { font-size: 12px; font-weight: 700; color: #1e293b; }
.sph-comment-text { font-size: 13px; color: #334155; margin-top: 2px; line-height: 1.5; }
.sph-comment-time { font-size: 11px; color: #94a3b8; margin-top: 3px; }
.sph-mention { color: #2563eb; font-weight: 600; }
.sph-comment-input-wrap { display: flex; gap: 8px; align-items: flex-end; margin-top: 10px; }
.sph-comment-input {
  flex: 1; border: 1px solid #e2e8f0; border-radius: 10px;
  padding: 8px 12px; font-size: 13px; font-family: 'Inter', sans-serif;
  resize: none; min-height: 40px; outline: none;
}
.sph-comment-input:focus { border-color: #2563eb; }

/* Upload photo modal */
.upload-photo-form { display: flex; flex-direction: column; gap: 14px; }
.upload-preview {
  width: 100%; aspect-ratio: 4/3; object-fit: cover;
  border-radius: 10px; border: 1px solid #e2e8f0;
  background: #f1f5f9; display: flex; align-items: center; justify-content: center;
  font-size: 32px; color: #94a3b8;
}
.upload-preview img { width: 100%; height: 100%; object-fit: cover; border-radius: 10px; }
.engineer-multi-select { display: flex; flex-wrap: wrap; gap: 6px; }
.eng-select-chip {
  padding: 5px 12px; border-radius: 20px; font-size: 12px; font-weight: 600;
  cursor: pointer; background: #f1f5f9; color: #475569; border: 1px solid #e2e8f0;
  transition: all 0.15s; font-family: 'Inter', sans-serif;
}
.eng-select-chip.selected { background: #1e3a5f; color: #fff; border-color: #1e3a5f; }

/* ---- CLOSURE WORKFLOW ---- */
.closure-progress-bar-wrap {
  background: #f1f5f9; border-radius: 12px; padding: 16px;
  margin-bottom: 18px; border: 1px solid #e2e8f0;
}
.closure-progress-label {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 10px;
}
.closure-progress-title { font-size: 14px; font-weight: 700; color: #1e3a5f; }
.closure-progress-pct { font-size: 22px; font-weight: 800; color: #059669; }
.closure-progress-bar {
  height: 10px; background: #e2e8f0; border-radius: 10px; overflow: hidden;
}
.closure-progress-fill {
  height: 100%; background: linear-gradient(90deg, #059669, #34d399);
  border-radius: 10px; transition: width 0.5s ease;
}
.closure-checklist { display: flex; flex-direction: column; gap: 8px; }
.closure-item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 13px 16px; background: #fff; border-radius: 10px;
  border: 1px solid #e2e8f0; transition: all 0.15s;
}
.closure-item.done { background: #f0fdf4; border-color: #bbf7d0; }
.closure-item.fault { background: #fff5f5; border-color: #fecaca; }
.closure-check-wrap {
  width: 24px; height: 24px; border-radius: 50%;
  border: 2px solid #d1d5db; display: flex; align-items: center;
  justify-content: center; flex-shrink: 0; cursor: pointer; margin-top: 1px;
  transition: all 0.2s;
}
.closure-check-wrap.done { background: #059669; border-color: #059669; color: #fff; }
.closure-item-content { flex: 1; }
.closure-item-text { font-size: 13px; font-weight: 600; color: #1e293b; }
.closure-item-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.closure-assigned { font-size: 11px; color: #64748b; display: flex; align-items: center; gap: 4px; }
.closure-evidence-btn {
  font-size: 11px; padding: 3px 10px; border-radius: 6px;
  background: #dbeafe; color: #1e40af; border: none; cursor: pointer;
  font-family: 'Inter', sans-serif; font-weight: 600;
}
.closure-evidence-thumb {
  width: 36px; height: 36px; border-radius: 6px; object-fit: cover;
  border: 1px solid #e2e8f0; cursor: pointer;
}
.closure-best-practice-panel {
  background: linear-gradient(135deg, #1e3a5f 0%, #2d6a9f 100%);
  border-radius: 12px; padding: 18px; margin-top: 20px; color: #fff;
}
.closure-bp-title { font-size: 14px; font-weight: 700; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.closure-bp-list { display: flex; flex-direction: column; gap: 8px; }
.closure-bp-item {
  display: flex; align-items: flex-start; gap: 10px;
  font-size: 12px; opacity: 0.9; line-height: 1.5;
}
.closure-bp-item i { margin-top: 2px; color: #4fc3f7; }
.handover-btn {
  background: linear-gradient(135deg, #059669, #34d399);
  color: #fff; border: none; border-radius: 12px;
  padding: 14px 24px; font-size: 15px; font-weight: 700;
  cursor: pointer; font-family: 'Inter', sans-serif;
  box-shadow: 0 4px 14px rgba(5,150,105,0.35);
  display: flex; align-items: center; gap: 10px;
  width: 100%; justify-content: center; margin-top: 18px;
  transition: all 0.2s;
}
.handover-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(5,150,105,0.45); }

/* ---- TECH LIBRARY ---- */
.tl-search-bar {
  display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap;
}
.tl-search-input {
  flex: 1; min-width: 200px; padding: 10px 14px; border-radius: 10px;
  border: 1px solid #e2e8f0; font-size: 13px; font-family: 'Inter', sans-serif;
  outline: none; transition: border-color 0.2s;
}
.tl-search-input:focus { border-color: #2563eb; }
.tl-filter-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.tl-filter-select {
  padding: 7px 12px; border-radius: 8px; border: 1px solid #e2e8f0;
  font-size: 12px; font-family: 'Inter', sans-serif; cursor: pointer; background: #fff;
}
.tl-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}
.tl-card {
  background: #fff; border-radius: 12px; border: 1px solid #e2e8f0;
  overflow: hidden; cursor: pointer; transition: all 0.2s;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.tl-card:hover { transform: translateY(-3px); box-shadow: 0 6px 20px rgba(0,0,0,0.1); }
.tl-card-thumb {
  width: 100%; aspect-ratio: 16/9; background: #1a2332;
  display: flex; align-items: center; justify-content: center;
  font-size: 40px; position: relative; overflow: hidden;
}
.tl-card-thumb img { width: 100%; height: 100%; object-fit: cover; }
.tl-card-type-badge {
  position: absolute; top: 8px; right: 8px;
  background: rgba(0,0,0,0.6); color: #fff;
  font-size: 10px; font-weight: 700; padding: 3px 8px; border-radius: 8px;
  letter-spacing: 0.5px;
}
.tl-card-body { padding: 12px; }
.tl-card-title { font-size: 13px; font-weight: 700; color: #1e293b; margin-bottom: 5px; }
.tl-card-desc { font-size: 11px; color: #64748b; margin-bottom: 8px; }
.tl-card-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.tl-tag {
  padding: 2px 7px; border-radius: 6px; background: #e0e7ff; color: #3730a3;
  font-size: 10px; font-weight: 600;
}
.tl-bookmark-btn {
  background: none; border: none; cursor: pointer;
  color: #94a3b8; font-size: 16px; padding: 4px; transition: color 0.15s;
}
.tl-bookmark-btn.bookmarked { color: #f59e0b; }

/* Video Player */
.video-player-wrap { background: #000; border-radius: 12px; overflow: hidden; margin: 16px 0; }
.video-player-elem { width: 100%; max-height: 420px; }
.video-controls {
  background: #1a1a2e; padding: 10px 14px;
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
}
.video-speed-label { color: #94a3b8; font-size: 11px; }
.video-speed-btn {
  padding: 4px 10px; border-radius: 6px; border: 1px solid #374151;
  background: #2d3748; color: #fff; font-size: 11px; font-weight: 600;
  cursor: pointer; font-family: 'Inter', sans-serif; transition: all 0.15s;
}
.video-speed-btn:hover, .video-speed-btn.active { background: #4fc3f7; color: #000; border-color: #4fc3f7; }
.video-chapters { padding: 0 14px 12px; background: #1a1a2e; }
.video-chapters-title { color: #94a3b8; font-size: 11px; font-weight: 600; margin-bottom: 6px; text-transform: uppercase; }
.chapter-pill {
  display: inline-block; padding: 4px 12px; border-radius: 20px;
  background: #2d3748; color: #a0aec0; font-size: 11px; cursor: pointer;
  margin-right: 6px; margin-bottom: 6px; border: 1px solid #374151;
  transition: all 0.15s;
}
.chapter-pill:hover { background: #374151; color: #fff; }

/* ---- PUSH NOTIFICATIONS ---- */
.notif-bell-wrap { position: relative; display: inline-block; }
.notif-count-badge {
  position: absolute; top: -6px; right: -8px;
  background: #ef4444; color: #fff; font-size: 10px; font-weight: 700;
  min-width: 18px; height: 18px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid #fff; animation: notifPop 0.4s ease;
}
@keyframes notifPop { 0%{transform:scale(0)} 60%{transform:scale(1.3)} 100%{transform:scale(1)} }
.push-notif-toast {
  position: fixed; bottom: 80px; right: 20px; z-index: 9999;
  background: #fff; border-radius: 14px; padding: 14px 16px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.18);
  display: flex; gap: 12px; align-items: flex-start;
  max-width: 340px; border: 1px solid #e2e8f0;
  animation: slideInRight 0.35s ease;
}
@keyframes slideInRight { from{transform:translateX(120%);opacity:0} to{transform:translateX(0);opacity:1} }
.push-notif-toast.exit { animation: slideOutRight 0.3s ease forwards; }
@keyframes slideOutRight { to{transform:translateX(120%);opacity:0} }
.pnt-icon {
  width: 40px; height: 40px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; flex-shrink: 0;
}
.pnt-icon.photo { background: #fef3c7; }
.pnt-icon.file { background: #dbeafe; }
.pnt-icon.comment { background: #ede9fe; }
.pnt-icon.general { background: #d1fae5; }
.pnt-body { flex: 1; }
.pnt-title { font-size: 13px; font-weight: 700; color: #1e293b; }
.pnt-text { font-size: 12px; color: #64748b; margin-top: 2px; line-height: 1.4; }
.pnt-close {
  background: none; border: none; cursor: pointer; color: #94a3b8; font-size: 16px; padding: 2px;
}

/* Shared With Me inbox */
.swm-inbox { display: flex; flex-direction: column; gap: 8px; }
.swm-item {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 16px; background: #fff; border-radius: 10px;
  border: 1px solid #e2e8f0; cursor: pointer; transition: all 0.15s;
}
.swm-item:hover { background: #f0f7ff; border-color: #93c5fd; }
.swm-item.unread { border-left: 4px solid #2563eb; background: #eff6ff; }
.swm-thumb {
  width: 48px; height: 48px; border-radius: 8px; object-fit: cover;
  background: #f1f5f9; display: flex; align-items: center; justify-content: center;
  font-size: 20px; flex-shrink: 0; overflow: hidden;
}
.swm-thumb img { width: 100%; height: 100%; object-fit: cover; border-radius: 8px; }
.swm-info { flex: 1; min-width: 0; }
.swm-title { font-size: 13px; font-weight: 600; color: #1e293b; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.swm-sub { font-size: 11px; color: #64748b; margin-top: 2px; }
.swm-time { font-size: 11px; color: #94a3b8; white-space: nowrap; }
.swm-type-icon {
  width: 28px; height: 28px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center; font-size: 13px;
  flex-shrink: 0;
}
.swm-type-icon.photo { background: #fef3c7; }
.swm-type-icon.file { background: #dbeafe; }

/* Notification dropdown panel */
.notif-panel {
  position: fixed; top: 60px; right: 60px; z-index: 8000;
  width: 340px; max-height: 500px; overflow-y: auto;
  background: #fff; border-radius: 14px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.18);
  border: 1px solid #e2e8f0;
  animation: panelFadeIn 0.25s ease;
}
@keyframes panelFadeIn { from{opacity:0;transform:translateY(-10px)} to{opacity:1;transform:translateY(0)} }
.notif-panel-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 16px; border-bottom: 1px solid #f1f5f9;
  font-size: 14px; font-weight: 700; color: #1e293b;
  position: sticky; top: 0; background: #fff; z-index: 1;
}
.notif-panel-clear {
  font-size: 12px; color: #2563eb; cursor: pointer; font-weight: 600;
  background: none; border: none; font-family: 'Inter', sans-serif;
}
.notif-panel-item {
  display: flex; gap: 10px; padding: 12px 16px;
  border-bottom: 1px solid #f8fafc; cursor: pointer;
  transition: background 0.15s;
}
.notif-panel-item:hover { background: #f8fafc; }
.notif-panel-item.unread { background: #eff6ff; }
.notif-panel-item.unread::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%;
  background: #2563eb; flex-shrink: 0; margin-top: 6px;
  display: block;
}
.npitem-icon { font-size: 18px; flex-shrink: 0; }
.npitem-body { flex: 1; }
.npitem-title { font-size: 12px; font-weight: 600; color: #1e293b; }
.npitem-text { font-size: 11px; color: #64748b; margin-top: 2px; line-height: 1.4; }
.npitem-time { font-size: 10px; color: #94a3b8; margin-top: 3px; }

/* ---- SITE ENGINEERING SELECTOR ---- */
.site-eng-selector {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px; padding: 20px 0;
}
.site-eng-select-card {
  background: #fff; border-radius: 12px; border: 1px solid #e2e8f0;
  padding: 18px; cursor: pointer; transition: all 0.2s;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.site-eng-select-card:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(0,0,0,0.1); border-color: #93c5fd; }
.sec-header { display: flex; align-items: flex-start; gap: 12px; }
.sec-icon {
  width: 44px; height: 44px; border-radius: 10px;
  background: linear-gradient(135deg, #1e3a5f, #2d6a9f);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; color: #fff; flex-shrink: 0;
}
.sec-info { flex: 1; }
.sec-name { font-size: 15px; font-weight: 700; color: #1e293b; }
.sec-sub { font-size: 12px; color: #64748b; margin-top: 2px; }
.sec-stats { display: flex; gap: 12px; margin-top: 12px; padding-top: 12px; border-top: 1px solid #f1f5f9; }
.sec-stat { text-align: center; }
.sec-stat-val { font-size: 16px; font-weight: 700; color: #1e3a5f; }
.sec-stat-label { font-size: 10px; color: #94a3b8; text-transform: uppercase; }
.sec-status { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 600; margin-top: 10px; }
.sec-status.active { background: #d1fae5; color: #059669; }
.sec-status.closed { background: #fee2e2; color: #dc2626; }
.sec-status.pending { background: #fef3c7; color: #d97706; }
.sec-status.in-progress { background: #dbeafe; color: #1e40af; }

/* ---- FORM STYLES (shared) ---- */
.eng-form { display: flex; flex-direction: column; gap: 14px; }
.eng-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 500px) { .eng-form-row { grid-template-columns: 1fr; } }
.eng-label {
  display: block; font-size: 12px; font-weight: 600; color: #475569;
  margin-bottom: 5px; text-transform: uppercase; letter-spacing: 0.3px;
}
.eng-input, .eng-select, .eng-textarea {
  width: 100%; padding: 9px 12px; border: 1px solid #e2e8f0;
  border-radius: 8px; font-size: 13px; font-family: 'Inter', sans-serif;
  outline: none; transition: border-color 0.2s; background: #fff;
  box-sizing: border-box;
}
.eng-input:focus, .eng-select:focus, .eng-textarea:focus { border-color: #2563eb; }
.eng-textarea { min-height: 80px; resize: vertical; }

/* Offline queue indicator */
.offline-queue-bar {
  position: fixed; bottom: 60px; left: 50%; transform: translateX(-50%);
  background: #1e3a5f; color: #fff; border-radius: 20px;
  padding: 8px 18px; font-size: 12px; font-weight: 600;
  display: none; align-items: center; gap: 8px; z-index: 8500;
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
}
.offline-queue-bar.show { display: flex; animation: slideUp 0.3s ease; }
@keyframes slideUp { from{transform:translateX(-50%) translateY(20px);opacity:0} to{transform:translateX(-50%) translateY(0);opacity:1} }

/* Share modal */
.share-modal-engineers { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.share-eng-chip {
  display: flex; align-items: center; gap: 6px;
  padding: 7px 14px; border-radius: 20px; cursor: pointer;
  background: #f1f5f9; border: 2px solid #e2e8f0; transition: all 0.15s;
  font-size: 13px; font-weight: 600; font-family: 'Inter', sans-serif;
}
.share-eng-chip.selected { background: #1e3a5f; color: #fff; border-color: #1e3a5f; }
.share-eng-avatar {
  width: 26px; height: 26px; border-radius: 50%;
  background: #dbeafe; color: #1e40af; font-size: 10px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.share-eng-chip.selected .share-eng-avatar { background: rgba(255,255,255,0.2); color: #fff; }

/* GPS tag */
.gps-tag {
  display: inline-flex; align-items: center; gap: 5px;
  background: #f0fdf4; color: #059669; padding: 4px 10px;
  border-radius: 8px; font-size: 11px; font-weight: 600;
  border: 1px solid #bbf7d0; cursor: pointer;
}
.gps-tag:hover { background: #dcfce7; }

/* Handover PDF preview */
.handover-preview {
  background: #fff; border: 2px solid #e2e8f0; border-radius: 12px;
  padding: 24px; max-width: 680px; margin: 0 auto;
}
.handover-preview-header { text-align: center; padding-bottom: 18px; border-bottom: 2px solid #1e3a5f; margin-bottom: 18px; }
.handover-company { font-size: 22px; font-weight: 800; color: #1e3a5f; }
.handover-doc-title { font-size: 15px; font-weight: 600; color: #475569; margin-top: 4px; }
.handover-field { display: flex; justify-content: space-between; padding: 7px 0; border-bottom: 1px solid #f1f5f9; font-size: 13px; }
.handover-field-label { color: #64748b; font-weight: 600; }
.handover-field-val { color: #1e293b; font-weight: 600; }
.handover-section-title { font-size: 13px; font-weight: 700; color: #1e3a5f; text-transform: uppercase; margin: 16px 0 8px; letter-spacing: 0.5px; }
.sig-box {
  border: 2px dashed #d1d5db; border-radius: 8px; padding: 20px;
  text-align: center; color: #94a3b8; font-size: 13px; margin-top: 16px;
}
.sig-canvas { width: 100%; height: 100px; cursor: crosshair; background: #f9fafb; border-radius: 6px; }

/* ---- DB Diff View ---- */
.diff-view-wrap { overflow-x: auto; }
.diff-legend { display: flex; gap: 14px; margin-bottom: 12px; font-size: 12px; }
.diff-legend-item { display: flex; align-items: center; gap: 5px; }
.diff-legend-dot { width: 12px; height: 12px; border-radius: 3px; }

/* ---- Responsive ---- */
@media (max-width: 600px) {
  .sph-photo-grid { grid-template-columns: repeat(2, 1fr); }
  .tl-grid { grid-template-columns: 1fr 1fr; }
  .overview-stats { grid-template-columns: 1fr 1fr; }
  .panel-grid { grid-template-columns: repeat(auto-fill, minmax(65px, 1fr)); }
  .notif-panel { width: calc(100vw - 24px); right: 12px; }
}
@media (max-width: 400px) {
  .sph-photo-grid { grid-template-columns: 1fr; }
  .tl-grid { grid-template-columns: 1fr; }
}

/* ---- jsPDF button ---- */
.pdf-export-btn {
  background: linear-gradient(135deg, #dc2626, #ef4444);
  color: #fff; border: none; border-radius: 10px;
  padding: 10px 18px; font-size: 13px; font-weight: 700;
  cursor: pointer; display: inline-flex; align-items: center; gap: 8px;
  font-family: 'Inter', sans-serif; box-shadow: 0 4px 12px rgba(220,38,38,0.3);
  transition: all 0.2s;
}
.pdf-export-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(220,38,38,0.4); }
.csv-export-btn {
  background: linear-gradient(135deg, #059669, #34d399);
  color: #fff; border: none; border-radius: 10px;
  padding: 10px 18px; font-size: 13px; font-weight: 700;
  cursor: pointer; display: inline-flex; align-items: center; gap: 8px;
  font-family: 'Inter', sans-serif; box-shadow: 0 4px 12px rgba(5,150,105,0.3);
  transition: all 0.2s;
}
.csv-export-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(5,150,105,0.4); }

/* Upload progress */
.upload-progress-wrap { margin: 10px 0; }
.upload-progress-bar { height: 6px; background: #e2e8f0; border-radius: 6px; overflow: hidden; }
.upload-progress-fill { height: 100%; background: linear-gradient(90deg, #2563eb, #60a5fa); border-radius: 6px; transition: width 0.3s ease; }
.upload-progress-text { font-size: 11px; color: #64748b; margin-top: 4px; }

/* Inline edit for DB circuit */
.inline-edit-input {
  border: 1px solid #93c5fd; border-radius: 5px; padding: 2px 6px;
  font-size: 12px; font-family: 'Inter', sans-serif; outline: none; width: 80px;
}
