/* SMF Exec Ops Board v2 - TV Display Styles */

:root {
  --primary: #00d4ff;
  --accent: #ff006e;
  --ok: #00ff00;
  --warning: #ffa500;
  --critical: #ff0000;
  --bg-dark: #070b14;
  --bg-panel: #0f1419;
  --text-primary: #ffffff;
  --text-secondary: #a0aac0;
  --border: #1a1f2e;
  --font-mono: "SF Mono", Monaco, "Courier New", monospace;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
}

body {
  font-family: var(--font-sans);
  background: var(--bg-dark);
  color: var(--text-primary);
  line-height: 1.5;
  font-size: 16px;
}

body.tv {
  display: flex;
  flex-direction: column;
}

/* Cross-page nav (main ↔ gate baseline) */
.back-link {
  color: var(--primary);
  text-decoration: none;
  font-size: 0.8rem;
  opacity: 0.9;
  margin-left: 0.5rem;
  white-space: nowrap;
}
.back-link:hover {
  opacity: 1;
  text-decoration: underline;
}

/* Gate (access control) */
.gate {
  position: fixed;
  inset: 0;
  background: var(--bg-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  transition: opacity 0.3s;
}

.gate.hidden {
  pointer-events: none;
  opacity: 0;
}

.gate-card {
  width: 100%;
  max-width: 400px;
  padding: 3rem 2rem;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  text-align: center;
}

.gate-mark {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.8;
}

.gate-title {
  font-size: 1.8rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  letter-spacing: 0.1em;
}

.gate-sub {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 2rem;
}

#gate-input {
  width: 100%;
  padding: 0.8rem 1rem;
  background: rgba(0, 212, 255, 0.05);
  border: 1px solid var(--primary);
  border-radius: 4px;
  color: var(--text-primary);
  font-family: var(--font-mono);
  margin-bottom: 1rem;
  font-size: 0.95rem;
}

#gate-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 12px rgba(0, 212, 255, 0.2);
}

#gate-btn {
  width: 100%;
  padding: 0.8rem 1rem;
  background: var(--primary);
  color: var(--bg-dark);
  border: none;
  border-radius: 4px;
  font-weight: 600;
  cursor: pointer;
  font-size: 0.95rem;
  letter-spacing: 0.05em;
  transition: all 0.2s;
}

#gate-btn:hover:not(:disabled) {
  box-shadow: 0 0 20px rgba(0, 212, 255, 0.4);
}

#gate-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.gate-foot {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 1.5rem;
}

/* Dashboard shell */
.tv-shell {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  overflow: hidden;
}

.tv-shell.hidden {
  display: none;
}

/* Ribbon (header band) */
.ribbon {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: 1fr 2fr 1fr;
  gap: 2rem;
  padding: 1.5rem 2rem;
  background: var(--bg-panel);
  border-bottom: 1px solid var(--border);
  align-items: center;
}

.ribbon-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.mark {
  font-size: 1.5rem;
  opacity: 0.8;
}

.brand-text {
  min-width: 0;
}

.title {
  font-size: 1.3rem;
  font-weight: 600;
  letter-spacing: 0.05em;
}

.sub {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 0.2rem;
}

.ribbon-center {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
}

.ribbon-item {
  text-align: center;
}

.ribbon-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.3rem;
}

.ribbon-value {
  font-size: 1.1rem;
  font-weight: 600;
  font-family: var(--font-mono);
  color: var(--primary);
}

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

.clock {
  font-size: 1.2rem;
  font-family: var(--font-mono);
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.privacy-badge {
  font-size: 0.7rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Main grid (⅔ timeline + ⅓ attention) */
.main-grid {
  flex: 1;
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1.5rem;
  padding: 1.5rem 2rem;
  overflow: hidden;
}

.timeline-panel,
.attention-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.timeline-panel h2,
.attention-panel h2 {
  font-size: 0.95rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 1rem;
  color: var(--text-secondary);
}

.timeline {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  overflow-y: auto;
  flex: 1;
}

.timeline-item {
  padding: 0.8rem 1rem;
  background: var(--bg-panel);
  border-left: 3px solid var(--primary);
  border-radius: 4px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 1rem;
  align-items: center;
}

.timeline-item.past {
  border-left-color: var(--text-secondary);
  opacity: 0.6;
}

.timeline-item.today {
  border-left-color: var(--ok);
  background: rgba(0, 255, 0, 0.05);
}

.timeline-date {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.timeline-label {
  font-weight: 600;
  text-align: center;
}

.timeline-time {
  font-size: 0.85rem;
  color: var(--text-secondary);
  text-align: right;
  font-family: var(--font-mono);
}

.attention {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  overflow-y: auto;
  flex: 1;
}

.attention-item {
  padding: 0.8rem 1rem;
  background: var(--bg-panel);
  border-left: 3px solid var(--primary);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
}

.attention-item:hover {
  border-left-color: var(--accent);
  background: rgba(255, 0, 110, 0.05);
}

.attention-item.critical {
  border-left-color: var(--critical);
  background: rgba(255, 0, 0, 0.05);
}

.attention-item.high {
  border-left-color: var(--warning);
  background: rgba(255, 165, 0, 0.05);
}

.attention-item.ok {
  border-left-color: var(--ok);
  background: rgba(0, 255, 0, 0.05);
}

.attention-title {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.3rem;
  line-height: 1.3;
}

.attention-source {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

/* Department panels */
.depts-grid {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 1.5rem;
  padding: 1.5rem 2rem;
  border-top: 1px solid var(--border);
  overflow-x: auto;
  min-height: auto;
}

.dept-card {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  min-width: 200px;
}

.dept-header {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
  color: var(--primary);
}

.dept-theme {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 0.8rem;
  line-height: 1.4;
  min-height: 2.4rem;
}

.dept-metrics {
  font-size: 0.75rem;
  color: var(--text-secondary);
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.dept-metric-row {
  display: flex;
  justify-content: space-between;
}

.dept-metric-label {
  font-weight: 500;
}

.dept-metric-value {
  font-family: var(--font-mono);
  color: var(--text-primary);
}

/* Footer */
.tv-foot {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  padding: 1rem 2rem;
  background: var(--bg-panel);
  border-top: 1px solid var(--border);
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-align: center;
}

#updated {
  text-align: left;
}

#sources {
  text-align: center;
}

#privacy-note {
  text-align: right;
}

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-secondary);
}

/* Responsive */
@media (max-width: 1600px) {
  .depts-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 1200px) {
  .main-grid {
    grid-template-columns: 1fr;
  }

  .ribbon {
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
  }

  .ribbon-center {
    grid-template-columns: repeat(2, 1fr);
  }

  .depts-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  body {
    font-size: 14px;
  }

  .ribbon {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .ribbon-center {
    grid-template-columns: repeat(2, 1fr);
  }

  .depts-grid {
    grid-template-columns: 1fr;
  }

  .tv-foot {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }

  #updated,
  #sources,
  #privacy-note {
    text-align: center;
  }
}
