/* =========================================================
   EHRplus Dashboard - Compact SENAITE-like styles
   ========================================================= */

.ehrplus-dashboard {
  padding: 10px 0;
}

.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

.dashboard-header h1 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
  color: #2c3e50;
}

.dashboard-header h1 i {
  color: #3498db;
  margin-right: 8px;
}

.dashboard-controls {
  display: flex;
  gap: 6px;
  align-items: center;
}

.preset-buttons {
  display: flex;
  gap: 3px;
}

.preset-buttons .btn {
  padding: 4px 10px;
  font-size: 0.75rem;
}

/* Stat Cards - Compact */
.stat-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 15px;
}

@media (max-width: 992px) {
  .stat-cards { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 576px) {
  .stat-cards { grid-template-columns: 1fr; }
}

.stat-card {
  background: white;
  border-radius: 4px;
  padding: 12px 15px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  border-left: 3px solid #3498db;
}

.stat-card.primary { border-left-color: #3498db; }
.stat-card.success { border-left-color: #27ae60; }
.stat-card.warning { border-left-color: #f39c12; }
.stat-card.info { border-left-color: #17a2b8; }

.stat-card-icon {
  font-size: 1rem;
  margin-bottom: 4px;
  opacity: 0.6;
}

.stat-card.primary .stat-card-icon { color: #3498db; }
.stat-card.success .stat-card-icon { color: #27ae60; }
.stat-card.warning .stat-card-icon { color: #f39c12; }
.stat-card.info .stat-card-icon { color: #17a2b8; }

.stat-card-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: #2c3e50;
  line-height: 1;
}

.stat-card-label {
  font-size: 0.75rem;
  color: #7f8c8d;
  margin-top: 2px;
}

.stat-card-detail {
  font-size: 0.7rem;
  color: #95a5a6;
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid #ecf0f1;
}

/* Dashboard Sections - Compact */
.dashboard-sections {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 12px;
}

@media (max-width: 900px) {
  .dashboard-sections { grid-template-columns: 1fr; }
}

.dashboard-section {
  background: white;
  border-radius: 4px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  overflow: hidden;
}

.section-header {
  padding: 10px 12px;
  background: #f8f9fa;
  border-bottom: 1px solid #ecf0f1;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.section-header h3 {
  margin: 0;
  font-size: 0.85rem;
  font-weight: 600;
  color: #2c3e50;
}

.section-header h3 i {
  margin-right: 6px;
  color: #7f8c8d;
}

.section-body {
  padding: 12px;
}

/* Bar Chart - Compact */
.bar-chart {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.bar-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.bar-label {
  min-width: 70px;
  font-size: 0.75rem;
  color: #2c3e50;
}

.bar-track {
  flex: 1;
  height: 18px;
  background: #ecf0f1;
  border-radius: 3px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: 3px;
}

.bar-fill.success { background: #27ae60; }
.bar-fill.primary { background: #3498db; }
.bar-fill.info { background: #1abc9c; }
.bar-fill.warning { background: #f39c12; }
.bar-fill.danger { background: #e74c3c; }
.bar-fill.secondary { background: #95a5a6; }
.bar-fill.dark { background: #34495e; }

.bar-value {
  min-width: 35px;
  text-align: right;
  font-size: 0.75rem;
  font-weight: 600;
  color: #2c3e50;
}

/* Result Pills - Compact */
.result-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.result-pill {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  background: #f8f9fa;
  border-radius: 12px;
  border: 1px solid #ecf0f1;
  font-size: 0.75rem;
}

.result-pill-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.result-pill-dot.success { background: #27ae60; }
.result-pill-dot.danger { background: #e74c3c; }
.result-pill-dot.warning { background: #f39c12; }
.result-pill-dot.secondary { background: #95a5a6; }

.result-pill-label { color: #2c3e50; }
.result-pill-value { font-weight: 600; color: #2c3e50; }
.result-pill-pct { font-size: 0.65rem; color: #7f8c8d; }

/* Top Tests - Compact */
.top-tests-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.top-test-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
}

.top-test-rank {
  width: 20px;
  height: 20px;
  background: #ecf0f1;
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: 600;
  color: #7f8c8d;
}

.top-test-name {
  flex: 1;
  font-size: 0.8rem;
  color: #2c3e50;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.top-test-bar {
  width: 80px;
  height: 6px;
  background: #ecf0f1;
  border-radius: 3px;
  overflow: hidden;
}

.top-test-bar-fill {
  height: 100%;
  background: #3498db;
  border-radius: 3px;
}

.top-test-count {
  min-width: 30px;
  text-align: right;
  font-size: 0.75rem;
  font-weight: 600;
  color: #2c3e50;
}

/* Microorganisms Section - Simple */
.microorganisms-section {
  background: white;
  border-radius: 4px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  margin-bottom: 12px;
}

.microorganisms-header {
  padding: 10px 12px;
  background: #667eea;
  color: white;
  border-radius: 4px 4px 0 0;
}

.microorganisms-header h3 {
  margin: 0;
  font-size: 0.85rem;
  font-weight: 600;
}

.microorganisms-body {
  padding: 12px;
}

.organism-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.organism-list li {
  padding: 6px 0;
  border-bottom: 1px solid #ecf0f1;
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
}

.organism-list li:last-child { border-bottom: none; }
.organism-name { color: #2c3e50; font-style: italic; }
.organism-count { font-weight: 600; color: #667eea; }

/* Quick Actions - Button style */
.quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.quick-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 4px;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.8rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s;
}

.quick-action-btn i { font-size: 0.75rem; }

.quick-action-btn.primary {
  background: #3498db;
  color: white;
  border-color: #3498db;
}
.quick-action-btn.primary:hover {
  background: #2980b9;
  border-color: #2980b9;
  text-decoration: none;
  color: white;
}

.quick-action-btn.warning {
  background: #f39c12;
  color: white;
  border-color: #f39c12;
}
.quick-action-btn.warning:hover {
  background: #d68910;
  border-color: #d68910;
  text-decoration: none;
  color: white;
}

.quick-action-btn.info {
  background: #17a2b8;
  color: white;
  border-color: #17a2b8;
}
.quick-action-btn.info:hover {
  background: #138496;
  border-color: #138496;
  text-decoration: none;
  color: white;
}

.quick-action-btn.success {
  background: #27ae60;
  color: white;
  border-color: #27ae60;
}
.quick-action-btn.success:hover {
  background: #1e8449;
  border-color: #1e8449;
  text-decoration: none;
  color: white;
}

.quick-action-btn.secondary {
  background: white;
  color: #495057;
  border-color: #ced4da;
}
.quick-action-btn.secondary:hover {
  background: #f8f9fa;
  border-color: #adb5bd;
  text-decoration: none;
  color: #212529;
}

/* Sync Status */
.sync-status {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #ecf0f1;
  font-size: 0.75rem;
  color: #7f8c8d;
}

.sync-status-indicator {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.sync-status-indicator.connected { color: #27ae60; }
.sync-status-indicator.disconnected { color: #e74c3c; }

/* Error State */
.analytics-error {
  text-align: center;
  padding: 30px 15px;
  background: #fff5f5;
  border-radius: 4px;
  margin-bottom: 12px;
}

.analytics-error i {
  font-size: 2rem;
  color: #e74c3c;
  margin-bottom: 10px;
}

.analytics-error h3 {
  color: #c0392b;
  margin: 0 0 5px 0;
  font-size: 1rem;
}

.analytics-error p {
  color: #7f8c8d;
  margin: 0;
  font-size: 0.85rem;
}

/* Footer */
.dashboard-footer {
  text-align: center;
  padding: 10px;
  font-size: 0.7rem;
  color: #95a5a6;
}

/* Turnaround Stats - Compact */
.tat-grid {
  display: flex;
  gap: 20px;
  margin-bottom: 12px;
}

.tat-main-stat {
  font-size: 1.5rem;
  font-weight: 700;
  color: #2c3e50;
}

.tat-main-label {
  font-size: 0.7rem;
  color: #7f8c8d;
  background: #e9ecef;
  padding: 2px 6px;
  border-radius: 3px;
  display: inline-block;
  margin-top: 2px;
}

.tat-breakdown {
  display: flex;
  gap: 8px;
}

.tat-item {
  flex: 1;
  text-align: center;
  padding: 8px;
  border-radius: 4px;
}

.tat-item.good { background: #d4edda; }
.tat-item.good .tat-item-value, .tat-item.good .tat-item-label { color: #155724; }

.tat-item.warning { background: #fff3cd; }
.tat-item.warning .tat-item-value, .tat-item.warning .tat-item-label { color: #856404; }

.tat-item.bad { background: #f8d7da; }
.tat-item.bad .tat-item-value, .tat-item.bad .tat-item-label { color: #721c24; }

.tat-item-value { font-weight: 600; font-size: 0.9rem; }
.tat-item-label { font-size: 0.65rem; }

/* Trend summary */
.trend-summary {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid #ecf0f1;
  font-size: 0.75rem;
}

.trend-row {
  display: flex;
  justify-content: space-between;
  padding: 3px 0;
}

.trend-label { color: #7f8c8d; }
.trend-value { font-weight: 600; color: #2c3e50; }

/* Status Action Grid - Sample counts */
.status-action-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
}

@media (max-width: 768px) {
  .status-action-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
  .status-action-grid { grid-template-columns: repeat(1, 1fr); }
}

.status-action-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 8px;
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 4px;
  text-decoration: none;
  transition: all 0.15s;
}

.status-action-item:hover {
  background: #e9ecef;
  border-color: #dee2e6;
  text-decoration: none;
}

.status-action-count {
  font-size: 1.25rem;
  font-weight: 700;
  color: #2c3e50;
  line-height: 1;
}

.status-action-label {
  font-size: 0.7rem;
  color: #6c757d;
  margin-top: 4px;
  text-align: center;
}

.status-action-label i {
  margin-right: 3px;
}

/* Link List - Simple navigation links */
.link-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.link-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid #f1f3f4;
  text-decoration: none;
  color: #495057;
  font-size: 0.8rem;
  transition: color 0.15s;
}

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

.link-item:hover {
  color: #3498db;
  text-decoration: none;
}

.link-item i:first-child {
  width: 16px;
  color: #7f8c8d;
}

.link-item span {
  flex: 1;
}

.link-item i:last-child {
  color: #ced4da;
  font-size: 0.65rem;
}

.link-item:hover i:last-child {
  color: #3498db;
}
