/* === Dashboard overrides === */
body { overflow-x: hidden; }

/* Nav CTA button */
.nav-cta {
  font-size: 13px;
  font-weight: 600;
  background: var(--accent);
  color: white;
  padding: 8px 18px;
  border-radius: 8px;
  text-decoration: none;
  transition: background 0.2s;
  letter-spacing: 0.01em;
}
.nav-cta:hover { background: #0a3030; }

/* Hero override for dashboard header */
.dash-hero {
  background: var(--accent);
  color: white;
  padding: 32px 40px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.dash-hero-inner { max-width: 1200px; margin: 0 auto; display: flex; justify-content: space-between; align-items: center; }
.dash-title { font-family: var(--font-display); font-size: 24px; font-weight: 700; margin-bottom: 4px; }
.dash-subtitle { font-size: 13px; opacity: 0.65; }
.live-badge { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 600; background: rgba(255,255,255,0.12); padding: 5px 12px; border-radius: 20px; text-transform: uppercase; letter-spacing: 0.08em; color: #7ED8A6; }
.live-dot { width: 7px; height: 7px; background: #7ED8A6; border-radius: 50%; animation: pulse 2s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }

/* Summary strip */
.dash-summary {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 16px 40px;
}
.dash-summary-inner { max-width: 1200px; margin: 0 auto; display: flex; gap: 40px; align-items: center; }
.summary-item { display: flex; flex-direction: column; }
.summary-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--fg-muted); margin-bottom: 4px; }
.summary-value { font-size: 20px; font-weight: 700; color: var(--fg); }
.summary-value.danger { color: #D63A3A; }
.summary-value.warn { color: #E8920D; }
.summary-value.good { color: #2A9D4E; }
.summary-divider { width: 1px; background: var(--border); align-self: stretch; }

/* Main content */
.dash-content { max-width: 1200px; margin: 0 auto; padding: 32px 40px; }
.section-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em; color: var(--accent); margin-bottom: 16px; }

/* Shift cards grid */
.shift-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; margin-bottom: 40px; }
.shift-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.shift-card:hover { border-color: var(--accent); box-shadow: 0 2px 12px rgba(13,61,61,0.08); }
.shift-card-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 16px; }
.machine-name { font-size: 15px; font-weight: 600; color: var(--fg); }
.shift-meta { font-size: 12px; color: var(--fg-muted); margin-top: 2px; }
.shift-badge { font-size: 10px; font-weight: 600; padding: 3px 9px; border-radius: 20px; text-transform: uppercase; letter-spacing: 0.06em; }
.badge-active { background: #E8F5EE; color: #2A9D4E; }
.badge-warning { background: #FDF3E3; color: #B86E00; }
.badge-critical { background: #FDE8E8; color: #D63A3A; }
.badge-info { background: var(--accent-light); color: var(--accent); }

/* Metrics row in shift card */
.metrics-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: 8px; overflow: hidden; margin-bottom: 16px; }
.metric-cell { background: var(--surface); padding: 10px 12px; text-align: center; }
.metric-cell .val { display: block; font-size: 17px; font-weight: 700; margin-bottom: 2px; }
.metric-cell .key { display: block; font-size: 10px; color: var(--fg-muted); text-transform: uppercase; letter-spacing: 0.05em; }
.metric-cell .val.ok { color: #2A9D4E; }
.metric-cell .val.warn { color: #E8920D; }
.metric-cell .val.danger { color: #D63A3A; }

/* Target ranges */
.target-range { font-size: 11px; color: var(--fg-muted); margin-top: 6px; }

/* Mini bar */
.mini-bar-wrap { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.mini-bar-label { font-size: 11px; color: var(--fg-muted); width: 50px; }
.mini-bar { flex: 1; height: 5px; background: var(--border); border-radius: 3px; overflow: hidden; }
.mini-bar-fill { height: 100%; border-radius: 3px; transition: width 0.4s ease; }
.mini-bar-fill.good { background: #2A9D4E; }
.mini-bar-fill.warn { background: #E8920D; }
.mini-bar-fill.danger { background: #D63A3A; }

/* Alert panel */
.alerts-panel { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.alerts-header { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; background: #FAFAF8; }
.alerts-header h3 { font-size: 14px; font-weight: 600; }
.alert-count-badge { font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 20px; }
.alert-count-badge.critical { background: #FDE8E8; color: #D63A3A; }
.alert-count-badge.warning { background: #FDF3E3; color: #B86E00; }
.alert-list { max-height: 320px; overflow-y: auto; }
.alert-item { padding: 14px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: flex-start; gap: 14px; }
.alert-item:last-child { border-bottom: none; }
.alert-severity-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; margin-top: 4px; }
.dot-critical { background: #D63A3A; }
.dot-warning { background: #E8920D; }
.dot-info { background: var(--accent); }
.alert-body { flex: 1; }
.alert-message { font-size: 13px; font-weight: 500; color: var(--fg); margin-bottom: 4px; }
.alert-detail { font-size: 11px; color: var(--fg-muted); }
.alert-meta { font-size: 11px; color: var(--fg-muted); white-space: nowrap; }
.no-alerts { padding: 32px 20px; text-align: center; color: var(--fg-muted); font-size: 14px; }
.no-alerts-icon { display: block; font-size: 28px; margin-bottom: 8px; }

/* Section heading with link */
.section-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.section-link { font-size: 12px; color: var(--accent); text-decoration: none; font-weight: 500; }
.section-link:hover { text-decoration: underline; }

/* Last updated footer */
.dash-footer { text-align: center; padding: 24px; color: var(--fg-muted); font-size: 11px; }

/* Live indicator in shift card */
.live-indicator { display: inline-flex; align-items: center; gap: 4px; font-size: 10px; color: #2A9D4E; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; }
.live-indicator .dot { width: 5px; height: 5px; background: #2A9D4E; border-radius: 50%; animation: pulse 2s infinite; }

/* Two column layout */
.dash-grid { display: grid; grid-template-columns: 1fr 380px; gap: 24px; align-items: start; }

/* Shift detail: operator line */
.operator-line { font-size: 12px; color: var(--fg-muted); margin-bottom: 10px; display: flex; align-items: center; gap: 6px; }

/* Refresh button */
.refresh-btn { font-size: 11px; background: none; border: 1px solid var(--border); padding: 4px 12px; border-radius: 6px; cursor: pointer; color: var(--fg-muted); }
.refresh-btn:hover { border-color: var(--accent); color: var(--accent); }

/* Responsive */
@media (max-width: 900px) {
  .dash-grid { grid-template-columns: 1fr; }
  .shift-grid { grid-template-columns: 1fr; }
  .dash-summary-inner { flex-wrap: wrap; gap: 20px; }
}
@media (max-width: 600px) {
  .dash-hero { padding: 20px; }
  .dash-content { padding: 20px; }
  .dash-summary { padding: 12px 20px; }
  .metrics-row { grid-template-columns: repeat(2, 1fr); }
}