/* ==========================================
   LOVABLE DASHBOARD LAYOUT
   ========================================== */

.dashboard-container {
  padding: 40px;
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

/* Header styling */
.dash-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 24px;
}

.dash-header-title h2 {
  font-size: 2.25rem; /* 36px */
  letter-spacing: -0.9px;
  line-height: 1.1;
  margin-bottom: 6px;
}

.dash-header-title p {
  font-size: 0.95rem;
  color: var(--text-muted);
}

.dash-actions {
  display: flex;
  gap: 12px;
}

/* Stats Metrics Cards Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
}

.stat-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px;
  border: 1px solid var(--border-color);
  background: var(--bg-app);
}

.stat-info {
  display: flex;
  flex-direction: column;
}

.stat-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-bottom: 6px;
}

.stat-value {
  font-size: 2.25rem; /* 36px */
  font-weight: 600;
  letter-spacing: -0.9px;
  color: var(--charcoal);
  line-height: 1.1;
}

.stat-change {
  font-size: 0.75rem;
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 4px;
  font-weight: 500;
}

.stat-change.up {
  color: var(--color-pass);
}

.stat-change.down {
  color: var(--color-warn);
}

.stat-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-pill);
  background: var(--bg-hover);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  color: var(--charcoal);
  border: 1px solid var(--border-color);
}

/* Main Dashboard Sections Split */
.dashboard-sections {
  display: grid;
  grid-template-columns: 1.4fr 0.6fr;
  gap: 32px;
}

/* Tables and filters */
.dashboard-table-card {
  padding: 0;
  overflow: hidden;
}

.card-header {
  padding: 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.card-header h3 {
  font-size: 1.25rem;
  font-weight: 500;
}

.table-filters {
  display: flex;
  gap: 4px;
}

.filter-tab {
  padding: 6px 12px;
  border-radius: var(--radius-btn);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
  border: 1px solid transparent;
  transition: all var(--transition-fast);
}

.filter-tab:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

.filter-tab.active {
  color: var(--text-primary);
  background: var(--bg-app);
  border-color: var(--border-interactive);
}

/* Table Design */
.table-wrapper {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

th {
  background: var(--bg-tint);
  padding: 14px 20px;
  font-size: 0.82rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-color);
}

td {
  padding: 16px 20px;
  font-size: 0.92rem;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-body);
}

tr:last-child td {
  border-bottom: none;
}

tr:hover td {
  background: var(--bg-tint);
}

/* Custom form inputs inside tables */
.tech-assign-select {
  padding: 4px 8px;
  border-radius: var(--radius-btn);
  border: 1px solid var(--border-color);
  background: var(--bg-app);
  font-size: 0.85rem;
  cursor: pointer;
  color: var(--text-primary);
}

.tech-assign-select:focus {
  border-color: var(--border-interactive);
}

/* SVG Chart details */
.chart-container {
  height: 180px;
  margin-top: 16px;
  position: relative;
  width: 100%;
}

.chart-svg {
  overflow: visible;
}

/* Point hover glow effects */
.chart-point:hover {
  r: 6;
  fill: var(--charcoal) !important;
}

/* Side Info Columns */
.side-cards-col {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Warning & Alerts panel lists */
.alerts-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.alert-item {
  display: flex;
  gap: 12px;
  padding: 12px;
  border-radius: var(--radius-compact);
  background: rgba(220, 38, 38, 0.03);
  border: 1px solid rgba(220, 38, 38, 0.15);
}

.alert-item.warning {
  background: rgba(217, 119, 6, 0.03);
  border: 1px solid rgba(217, 119, 6, 0.15);
}

.alert-item-icon {
  margin-top: 2px;
  font-size: 0.95rem;
}

.alert-item-icon i {
  color: var(--color-fail);
}

.alert-item.warning .alert-item-icon i {
  color: var(--color-warn);
}

.alert-item-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.alert-title {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-primary);
}

.alert-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.3;
}

/* Techs Monitor list item */
.tech-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.tech-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-color);
}

.tech-item:last-child {
  border-bottom: none;
}

.tech-profile {
  display: flex;
  align-items: center;
  gap: 12px;
}

.tech-avatar {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-pill);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 600;
  font-size: 0.85rem;
}

.tech-info {
  display: flex;
  flex-direction: column;
}

.tech-name {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-primary);
}

.tech-status-txt {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Report details layouts */
.inspection-report-viewer {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.insp-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 16px;
}

.insp-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.insp-meta h4 {
  font-size: 1.5rem;
  letter-spacing: -0.5px;
}

.insp-meta-row {
  display: flex;
  gap: 16px;
  font-size: 0.88rem;
  color: var(--text-body);
}

.score-display {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.score-circle {
  width: 60px;
  height: 60px;
  border-radius: var(--radius-pill);
  border: 3px solid var(--color-pass);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--color-pass);
}

.score-circle.warning {
  border-color: var(--color-warn);
  color: var(--color-warn);
}

.score-circle.danger {
  border-color: var(--color-fail);
  color: var(--color-fail);
}

.score-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 600;
}

.report-notes {
  background: var(--bg-hover);
  padding: 16px;
  border-radius: var(--radius-compact);
  font-size: 0.9rem;
  border-left: 3px solid var(--charcoal);
  color: var(--text-body);
  line-height: 1.4;
}

.report-checklist-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin-top: 10px;
}

.report-checklist-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  border-radius: var(--radius-compact);
  background: var(--bg-app);
  border: 1px solid var(--border-color);
}

.report-checklist-name {
  font-size: 0.85rem;
  color: var(--text-primary);
  font-weight: 500;
}

.search-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.search-wrapper i {
  position: absolute;
  left: 12px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.search-wrapper .input-control {
  padding-left: 36px;
  width: 240px;
}

/* ==========================================
   RESPONSIVE DESIGN
   ========================================== */
@media (max-width: 1024px) {
  .dashboard-sections {
    grid-template-columns: 1fr;
  }
  
  .dashboard-container {
    padding: 24px;
  }
}
