/* PMIS Live Dashboard — shared styles */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
  --bg-base: #282828;
  --bg-card: #202020;
  --bg-elev: #2a2a2a;
  --accent: #ccfa59;
  --accent-dim: rgba(204, 250, 89, 0.15);
  --accent-glow: 0 0 24px rgba(204, 250, 89, 0.45);
  --text-primary: #f5f5f5;
  --text-secondary: #a3a3a3;
  --text-muted: #6b6b6b;
  --status-active: #ccfa59;
  --status-hold: #f59e0b;
  --status-done: #22c55e;
  --status-pending: #6b6b6b;
  --status-overdue: #ef4444;
  --radius-pill: 999px;
  --radius-card: 24px;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
}

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

html, body {
  width: 100%;
  min-height: 100vh;
  background: var(--bg-base);
  color: var(--text-primary);
  font-family: var(--font-family);
  font-size: 16px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

/* Frame container — fixed 1920x1080 canvas scaled to viewport */
.frame-canvas {
  width: 1920px;
  height: 1080px;
  position: relative;
  overflow: hidden;
  background: var(--bg-base);
  transform-origin: top left;
}

@media (max-width: 1919px) {
  .frame-canvas { transform: scale(calc(100vw / 1920)); }
}

/* Scanline overlay */
.scanlines {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    0deg,
    rgba(255, 255, 255, 0.015) 0px,
    rgba(255, 255, 255, 0.015) 1px,
    transparent 1px,
    transparent 3px
  );
  z-index: 50;
}

/* Glow */
.glow { box-shadow: var(--accent-glow); }

/* Top bar */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-5) var(--space-7);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-weight: 800;
  font-size: 20px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.brand-dot {
  width: 12px; height: 12px;
  border-radius: var(--radius-pill);
  background: var(--accent);
  box-shadow: var(--accent-glow);
}
.brand-name { color: var(--text-primary); }
.brand-tag { color: var(--text-muted); font-weight: 500; }
.clock {
  font-variant-numeric: tabular-nums;
  font-size: 18px;
  font-weight: 600;
  color: var(--text-secondary);
}
.clock .live {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: var(--radius-pill);
  background: var(--accent);
  margin-right: var(--space-2);
  box-shadow: var(--accent-glow);
  animation: pulse 1.6s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* Frame content */
.frame {
  padding: var(--space-5) var(--space-7) 96px;
  height: calc(1080px - 96px);
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}
.frame-title {
  display: flex;
  align-items: baseline;
  gap: var(--space-4);
}
.frame-title h1 {
  font-size: 36px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.frame-title .subtitle {
  font-size: 14px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

/* Metric card */
.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-5);
}
.metric-card {
  background: var(--bg-card);
  border-radius: var(--radius-card);
  padding: var(--space-5) var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  border: 1px solid rgba(255, 255, 255, 0.04);
}
.metric-card .label {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  font-weight: 600;
}
.metric-card .value {
  font-size: 56px;
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
  text-shadow: 0 0 30px rgba(204, 250, 89, 0.25);
  font-variant-numeric: tabular-nums;
}
.metric-card .value.trend-up { color: var(--accent); }
.metric-card .value.trend-down { color: var(--status-overdue); }
.metric-card .delta {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 14px;
  color: var(--text-secondary);
}
.arrow-up { color: var(--accent); }
.arrow-down { color: var(--status-overdue); }

/* News ticker */
.ticker-wrap {
  background: var(--bg-card);
  border-radius: var(--radius-card);
  padding: var(--space-5);
  border: 1px solid rgba(255, 255, 255, 0.04);
  display: flex;
  flex: 1;
  gap: var(--space-5);
  min-height: 0;
}
.ticker-label {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  min-width: 180px;
  border-right: 1px solid rgba(255, 255, 255, 0.05);
  padding-right: var(--space-5);
}
.ticker-label .label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-muted);
}
.ticker-label h2 {
  font-size: 22px;
  font-weight: 700;
}
.ticker-viewport {
  flex: 1;
  overflow: hidden;
  position: relative;
}
.ticker-track {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  animation: ticker-scroll 30s linear infinite;
}
.ticker-wrap:hover .ticker-track { animation-play-state: paused; }
.ticker-item {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-3) var(--space-4);
  background: var(--bg-elev);
  border-radius: 12px;
  font-size: 15px;
}
.ticker-time {
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  min-width: 70px;
  font-size: 13px;
}
.ticker-tag {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 2px 10px;
  border-radius: var(--radius-pill);
  background: var(--accent-dim);
  color: var(--accent);
  font-weight: 700;
}
.ticker-tag.tag-hold { background: rgba(245, 158, 11, 0.15); color: var(--status-hold); }
.ticker-tag.tag-done { background: rgba(34, 197, 94, 0.15); color: var(--status-done); }
.ticker-tag.tag-overdue { background: rgba(239, 68, 68, 0.15); color: var(--status-overdue); }
@keyframes ticker-scroll {
  0% { transform: translateY(0); }
  100% { transform: translateY(-50%); }
}
@keyframes project-scroll {
  0% { transform: translateY(0); }
  100% { transform: translateY(-50%); }
}
@keyframes invoice-scroll {
  0% { transform: translateY(0); }
  100% { transform: translateY(-50%); }
}

/* Engineer cards (Overview horizontal scroll) */
.engineers-section {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.section-label {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-muted);
  font-weight: 600;
}
.engineer-row {
  display: flex;
  gap: var(--space-4);
  overflow: hidden;
}
.engineer-card {
  min-width: 280px;
  background: var(--bg-card);
  border-radius: var(--radius-card);
  padding: var(--space-4);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  border: 1px solid rgba(255, 255, 255, 0.04);
}
.avatar {
  width: 48px; height: 48px;
  border-radius: var(--radius-pill);
  background: linear-gradient(135deg, #3a3a3a, #1f1f1f);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
  color: var(--accent);
  border: 1px solid rgba(204, 250, 89, 0.2);
}
.engineer-meta { flex: 1; min-width: 0; }
.engineer-name {
  font-weight: 700;
  font-size: 15px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.engineer-role {
  display: inline-block;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-secondary);
  font-weight: 700;
  margin-top: 4px;
}
.engineer-project {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.engineer-pct {
  font-size: 18px;
  font-weight: 800;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

/* Project table */
.project-table {
  background: var(--bg-card);
  border-radius: var(--radius-card);
  padding: var(--space-3);
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}
.project-table:hover .project-scroll { animation-play-state: paused; }
.project-scroll {
  display: block;
  animation: project-scroll 20s linear infinite;
}
.project-table table {
  width: 100%;
  border-collapse: collapse;
}
.project-table th {
  text-align: left;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  font-weight: 700;
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.project-table td {
  padding: var(--space-4);
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  font-size: 15px;
  vertical-align: middle;
}
.project-table tr:last-child td { border-bottom: none; }
.project-name { font-weight: 700; }
.project-client { color: var(--text-secondary); }
.project-updated { color: var(--text-muted); font-variant-numeric: tabular-nums; font-size: 13px; }

/* Status pill */
.pill {
  display: inline-block;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 700;
  background: rgba(204, 250, 89, 0.12);
  color: var(--accent);
}
.pill.hold { background: rgba(245, 158, 11, 0.15); color: var(--status-hold); }
.pill.done { background: rgba(34, 197, 94, 0.15); color: var(--status-done); }
.pill.pending { background: rgba(107, 107, 107, 0.25); color: var(--text-secondary); }
.pill.overdue { background: rgba(239, 68, 68, 0.15); color: var(--status-overdue); }

/* Progress bar */
.progress {
  width: 180px;
  height: 8px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-pill);
  overflow: hidden;
  position: relative;
}
.progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: var(--radius-pill);
  box-shadow: 0 0 10px rgba(204, 250, 89, 0.4);
}
.progress-pct {
  font-size: 13px;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
  margin-left: var(--space-3);
}

/* Resource grid (4x3) */
.resource-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(3, 1fr);
  gap: var(--space-4);
  flex: 1;
  min-height: 0;
}
.resource-card {
  background: var(--bg-card);
  border-radius: var(--radius-card);
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  border: 1px solid rgba(255, 255, 255, 0.04);
}
.resource-head {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}
.resource-head .avatar { width: 44px; height: 44px; font-size: 15px; }
.resource-head .meta { flex: 1; min-width: 0; }
.resource-head .name { font-weight: 700; font-size: 15px; }
.resource-head .role {
  display: inline-block;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  background: rgba(204, 250, 89, 0.12);
  color: var(--accent);
  font-weight: 700;
  margin-top: 2px;
}
.resource-util {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}
.resource-util .pct {
  font-weight: 800;
  font-size: 18px;
  font-variant-numeric: tabular-nums;
  min-width: 52px;
  text-align: right;
}
.resource-project {
  font-size: 12px;
  color: var(--text-muted);
  padding: 4px 10px;
  background: var(--bg-elev);
  border-radius: var(--radius-pill);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Utilization bar */
.util-bar {
  flex: 1;
  height: 8px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-pill);
  overflow: hidden;
}
.util-fill { height: 100%; border-radius: var(--radius-pill); }
.util-fill.ok { background: var(--accent); box-shadow: 0 0 8px rgba(204, 250, 89, 0.4); }
.util-fill.warn { background: var(--status-hold); box-shadow: 0 0 8px rgba(245, 158, 11, 0.4); }
.util-fill.over { background: var(--status-overdue); box-shadow: 0 0 8px rgba(239, 68, 68, 0.4); }

/* Capacity summary */
.capacity {
  background: var(--bg-card);
  border-radius: var(--radius-card);
  padding: var(--space-4) var(--space-5);
  display: flex;
  align-items: center;
  gap: var(--space-6);
  border: 1px solid rgba(255, 255, 255, 0.04);
}
.capacity .stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 120px;
}
.capacity .stat .v { font-size: 28px; font-weight: 800; color: var(--text-primary); font-variant-numeric: tabular-nums; }
.capacity .stat .l { font-size: 11px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--text-muted); font-weight: 700; }
.capacity .bar-wrap { flex: 1; }
.capacity .bar-segments {
  height: 14px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-pill);
  overflow: hidden;
  display: flex;
}
.capacity .seg-alloc { background: var(--accent); box-shadow: 0 0 8px rgba(204, 250, 89, 0.4); }
.capacity .seg-bench { background: rgba(255, 255, 255, 0.08); }

/* Invoice list */
.invoice-list {
  background: var(--bg-card);
  border-radius: var(--radius-card);
  padding: var(--space-3);
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
}
.invoice-list:hover .invoice-scroll { animation-play-state: paused; }
.invoice-scroll {
  display: block;
  animation: invoice-scroll 8s linear infinite;
}
.invoice-row {
  display: grid;
  grid-template-columns: 140px 1fr 180px 140px 140px;
  align-items: center;
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  gap: var(--space-4);
}
.invoice-row:last-child { border-bottom: none; }
.invoice-row.head {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  font-weight: 700;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.invoice-id { color: var(--text-secondary); font-variant-numeric: tabular-nums; }
.invoice-client { font-weight: 700; }
.invoice-amount { font-variant-numeric: tabular-nums; font-weight: 700; text-align: right; }
.invoice-due { color: var(--text-muted); font-variant-numeric: tabular-nums; font-size: 13px; text-align: right; }

/* Frame navigator */
.nav {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: var(--space-3);
  z-index: 60;
}
.nav-dot {
  width: 10px;
  height: 10px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.15);
  border: none;
  cursor: pointer;
  transition: background 0.2s;
}
.nav-dot.active { background: var(--accent); box-shadow: var(--accent-glow); }
.nav-dot:hover { background: var(--accent-dim); }

/* Additional classes for HTML validation fixes */
.ticker-count {
  color: var(--accent);
  margin-top: var(--space-3);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 600;
}

.engineer-pct.over {
  color: var(--status-overdue);
}

.col-status { width: 140px; }
.col-client { width: 260px; }
.col-progress { width: 260px; }
.col-updated { width: 180px; }

.progress-wrap {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.pct-ok { color: var(--accent); }
.pct-warn { color: var(--status-hold); }
.pct-over { color: var(--status-overdue); }
.pct-bench { color: var(--text-muted); }

.stat-accent { color: var(--accent) !important; }
.stat-muted { color: var(--text-muted) !important; }

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

.util-fill.bench { background: rgba(255, 255, 255, 0.08); }

/* Width utilities (replaces inline style="width:N%") */
.w-0  { width: 0%; }
.w-22 { width: 22%; }
.w-34 { width: 34%; }
.w-41 { width: 41%; }
.w-45 { width: 45%; }
.w-47 { width: 47%; }
.w-50 { width: 50%; }
.w-55 { width: 55%; }
.w-60 { width: 60%; }
.w-65 { width: 65%; }
.w-68 { width: 68%; }
.w-70 { width: 70%; }
.w-73 { width: 73%; }
.w-75 { width: 75%; }
.w-80 { width: 80%; }
.w-82 { width: 82%; }
.w-88 { width: 88%; }
.w-95 { width: 95%; }
.w-100 { width: 100%; }
