/**
 * NAC MOM - Manufacturing Operations Management Styles
 * ISA-95 Level 3 - Operations Management
 * ISA-101 Neutral Color Scheme
 */

:root {
  --bg-dark: #1a1a1a;
  --bg-medium: #242424;
  --bg-light: #2e2e2e;
  --border: #3a3a3a;
  --text-primary: #e5e5e5;
  --text-secondary: #a3a3a3;
  --text-muted: #737373;
  --accent: #525252;
  --status-good: #4ade80;
  --status-warn: #fbbf24;
  --status-bad: #f87171;
  --status-info: #60a5fa;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg-dark);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  background: var(--bg-medium);
  border-bottom: 1px solid var(--border);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 20px;
}

.back-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 13px;
  padding: 6px 12px;
  border-radius: 4px;
  background: var(--bg-light);
  border: 1px solid var(--border);
}

.back-link:hover {
  background: var(--accent);
  color: var(--text-primary);
}

.header h1 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
}

.header h1 .subtitle {
  font-weight: 400;
  color: var(--text-muted);
  font-size: 13px;
  margin-left: 8px;
}

.header-right .datetime {
  text-align: right;
}

.header-right .time {
  font-size: 18px;
  font-weight: 600;
  font-family: 'SF Mono', Monaco, monospace;
  color: var(--text-primary);
}

.header-right .date {
  font-size: 11px;
  color: var(--text-muted);
}

/* Main Container */
.main-container {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
}

/* Operations Grid */
.ops-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}

/* Operations Card */
.ops-card {
  background: var(--bg-medium);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.ops-card.production { border-left: 3px solid var(--status-good); }
.ops-card.quality { border-left: 3px solid var(--status-info); }
.ops-card.maintenance { border-left: 3px solid var(--status-warn); }
.ops-card.inventory { border-left: 3px solid var(--text-muted); }

.ops-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}

.ops-icon {
  width: 32px;
  height: 32px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 14px;
  background: var(--bg-light);
  border: 1px solid var(--border);
  color: var(--text-secondary);
}

.ops-header h2 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.ops-body {
  padding: 16px;
  flex: 1;
}

.ops-desc {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 14px;
  line-height: 1.5;
}

/* KPI Row */
.kpi-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}

.kpi {
  text-align: center;
  padding: 10px;
  background: var(--bg-light);
  border: 1px solid var(--border);
  border-radius: 4px;
}

.kpi .value {
  display: block;
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
}

.kpi .label {
  font-size: 9px;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

/* Operations List */
.ops-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ops-item {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 10px;
  align-items: center;
  padding: 8px 10px;
  background: var(--bg-light);
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 12px;
}

.ops-item .name {
  font-weight: 500;
  color: var(--text-secondary);
}

.ops-item .status {
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 9px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.ops-item .status.good {
  background: rgba(74, 222, 128, 0.15);
  color: var(--status-good);
}

.ops-item .status.warning {
  background: rgba(251, 191, 36, 0.15);
  color: var(--status-warn);
}

.ops-item .status.error {
  background: rgba(248, 113, 113, 0.15);
  color: var(--status-bad);
}

.ops-item .metric {
  color: var(--text-muted);
  font-size: 11px;
  text-align: right;
}

.ops-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  background: var(--bg-light);
}

.ops-link {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 12px;
  font-weight: 500;
}

.ops-link:hover {
  color: var(--text-secondary);
}

/* Cross-Functional Metrics */
.cross-metrics {
  background: var(--bg-medium);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 16px;
}

.cross-metrics h3 {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.metrics-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.metric-card {
  background: var(--bg-light);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 14px;
  text-align: center;
}

.metric-header {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.metric-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.metric-trend {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 3px;
  display: inline-block;
}

.metric-trend.up {
  background: rgba(74, 222, 128, 0.15);
  color: var(--status-good);
}

.metric-trend.down {
  background: rgba(248, 113, 113, 0.15);
  color: var(--status-bad);
}

/* Responsive */
@media (max-width: 1024px) {
  .ops-grid {
    grid-template-columns: 1fr;
  }
  .metrics-row {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .metrics-row {
    grid-template-columns: 1fr;
  }
  .kpi-row {
    grid-template-columns: 1fr;
  }
}
