/* azimuth.css - Sensor Azimuth QC Dashboard Styling */

.az-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  max-width: 1680px;
  margin: 0 auto;
  padding: 16px 20px 40px 20px;
  box-sizing: border-box;
}

/* Header Card */
.az-header-card {
  background: #ffffff;
  border-radius: 12px;
  padding: 20px 24px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.az-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.az-title-row h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  color: #0f172a;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.az-subtitle {
  font-size: 13px;
  font-weight: 400;
  color: #64748b;
}

/* Control Panel */
.az-control-panel {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.az-mode-selector {
  display: flex;
  gap: 10px;
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 12px;
  flex-wrap: wrap;
}

.az-mode-btn {
  padding: 8px 16px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #475569;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 6px;
}

.az-mode-btn:hover {
  background: #f1f5f9;
  color: #1e293b;
}

.az-mode-btn.active {
  background: #2563eb;
  color: #ffffff;
  border-color: #1d4ed8;
  box-shadow: 0 2px 4px rgba(37, 99, 235, 0.25);
}

.az-filters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  align-items: flex-end;
}

.az-field-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.az-field-label {
  font-size: 12px;
  font-weight: 600;
  color: #475569;
}

.az-input, .az-select {
  padding: 7px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 13px;
  background: #ffffff;
  color: #1e293b;
  outline: none;
  transition: border-color 0.2s;
}

.az-input:focus, .az-select:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}

.az-btn-run {
  background: #2563eb;
  color: #ffffff;
  border: none;
  border-radius: 6px;
  padding: 9px 18px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.3);
}

.az-btn-run:hover:not(:disabled) {
  background: #1d4ed8;
  box-shadow: 0 3px 8px rgba(29, 78, 216, 0.4);
}

.az-btn-run:disabled {
  background: #94a3b8;
  cursor: not-allowed;
  box-shadow: none;
}

/* Neighbor Badge Styles */
.az-neighbor-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  background: #e0f2fe;
  border: 1px solid #7dd3fc;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  color: #0369a1;
}

.az-neighbor-badge .az-dir-icon {
  font-size: 13px;
  color: #0284c7;
}

.az-neighbor-badge .az-sector-tag {
  background: #0284c7;
  color: #ffffff;
  font-size: 10px;
  padding: 1px 4px;
  border-radius: 3px;
  margin-left: 2px;
}

.az-ref-mini-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 6px;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  color: #334155;
  margin: 1px 2px;
}

/* Progress Box */
.az-progress-box {
  background: #ffffff;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  padding: 14px 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.03);
}

.az-progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  font-weight: 600;
  color: #334155;
}

.az-progress-bar-bg {
  width: 100%;
  height: 8px;
  background: #e2e8f0;
  border-radius: 4px;
  overflow: hidden;
}

.az-progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #3b82f6, #1d4ed8);
  width: 0%;
  border-radius: 4px;
  transition: width 0.3s ease;
}

/* KPI Cards */
.az-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.az-kpi-card {
  background: #ffffff;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.03);
}

.az-kpi-title {
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.az-kpi-val {
  font-size: 24px;
  font-weight: 700;
  color: #0f172a;
}

.az-kpi-sub {
  font-size: 11px;
  color: #94a3b8;
}

/* View Switcher */
.az-view-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid #e2e8f0;
  padding-bottom: 6px;
  margin-top: 6px;
  flex-wrap: wrap;
  gap: 10px;
}

.az-view-tabs {
  display: flex;
  gap: 8px;
}

.az-view-tab {
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 6px;
  border: 1px solid transparent;
  background: transparent;
  color: #64748b;
  cursor: pointer;
  transition: all 0.2s;
}

.az-view-tab:hover {
  background: #f1f5f9;
  color: #1e293b;
}

.az-view-tab.active {
  background: #eff6ff;
  color: #1d4ed8;
  border-color: #bfdbfe;
}

/* Results Table */
.az-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  text-align: left;
}

.az-table th {
  background: #f8fafc;
  color: #475569;
  font-weight: 600;
  padding: 10px 12px;
  border-bottom: 2px solid #e2e8f0;
  white-space: nowrap;
}

.az-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #f1f5f9;
  color: #1e293b;
  vertical-align: middle;
}

.az-table tbody tr:hover {
  background: #f8fafc;
}

/* Status Badges */
.az-badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
}

.az-badge-normal {
  background: #dcfce7;
  color: #15803d;
}

.az-badge-suspect {
  background: #fef9c3;
  color: #a16207;
}

.az-badge-bad {
  background: #fee2e2;
  color: #b91c1c;
}

.az-badge-nodata {
  background: #f1f5f9;
  color: #64748b;
}

/* Charts Panel */
.az-chart-panel {
  background: #ffffff;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  padding: 20px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.az-canvas-wrap {
  width: 100%;
  position: relative;
}

/* Modal */
.az-modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(4px);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  box-sizing: border-box;
}

.az-modal-box {
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3);
  width: 100%;
  max-width: 880px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid #cbd5e1;
}

.az-modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.az-modal-header h3 {
  margin: 0;
  font-size: 16px;
  color: #0f172a;
}

.az-modal-close {
  background: transparent;
  border: none;
  font-size: 24px;
  color: #94a3b8;
  cursor: pointer;
}

.az-modal-close:hover {
  color: #0f172a;
}

.az-modal-body {
  padding: 20px;
  overflow-y: auto;
}

/* History Bar & Banner */
.az-history-bar {
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 10px 14px;
  transition: border-color 0.2s;
}

.az-history-bar:hover {
  border-color: #94a3b8;
}

.az-history-banner {
  animation: fadeIn 0.25s ease-in-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}



/* --- Leaflet Vector Map & Split Inspector Styling --- */
.az-leaflet-marker {
  background: transparent !important;
  border: none !important;
}

.az-ranking-item:hover {
  background: #f1f5f9 !important;
  border-color: #94a3b8 !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

#az-map-ranking-list::-webkit-scrollbar {
  width: 5px;
}
#az-map-ranking-list::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 4px;
}
#az-map-ranking-list::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}
#az-map-ranking-list::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

@media (max-width: 1100px) {
  .az-map-split-grid {
    grid-template-columns: 1fr !important;
  }
  #az-leaflet-map-container {
    height: 650px !important;
  }
}
