/* ==========================================================================
   IP26 PRODUCTION PORTAL — MASTER STYLESHEET
   Design Language: Utilitarian Broadcast Command (Dual Theme: Dark Slate & Warm Linen)
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. CSS CUSTOM PROPERTIES & DESIGN TOKENS
   -------------------------------------------------------------------------- */
:root {
  /* Fonts */
  --font-display: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Spacing Scale */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;

  /* Radii */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-normal: 250ms cubic-bezier(0.16, 1, 0.3, 1);
  --transition-slow: 400ms cubic-bezier(0.16, 1, 0.3, 1);

  /* Layout */
  --max-width: 1240px;
  --header-height: 70px;
  --dock-height: 68px;

  /* Default Permanent Dark Theme Color Palette (Pure Neutral Grey / OLED Dark) */
  --bg-primary: #121212;
  --bg-secondary: #181818;
  --bg-surface: #1f1f1f;
  --bg-surface-elevated: #262626;
  --bg-surface-hover: #303030;

  --border-subtle: #2b3042;
  --border-strong: #3f455e;
  --border-focus: #00d2ff;

  --text-primary: #f8fafc;
  --text-secondary: #e2e8f0;
  --text-muted: #94a3b8;
  --text-inverse: #0c0d11;

  --accent-cyan: #00d2ff;
  --accent-cyan-subtle: rgba(0, 210, 255, 0.12);
  --accent-cyan-glow: rgba(0, 210, 255, 0.25);

  --accent-blue: #3b82f6;
  --accent-purple: #a855f7;
  --accent-amber: #f59e0b;
  --accent-amber-subtle: rgba(245, 158, 11, 0.15);
  --accent-emerald: #10b981;
  --accent-emerald-subtle: rgba(16, 185, 129, 0.15);

  --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 6px 16px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.6);
  --shadow-glow: 0 0 24px rgba(0, 210, 255, 0.15);

  --grid-line-color: rgba(255, 255, 255, 0.04);
}

/* --------------------------------------------------------------------------
   A. DARK THEME PALETTE (Pure Neutral Grey)
   -------------------------------------------------------------------------- */
[data-theme="dark"] {
  --bg-primary: #121212;
  --bg-secondary: #181818;
  --bg-surface: #1f1f1f;
  --bg-surface-elevated: #262626;
  --bg-surface-hover: #303030;

  --border-subtle: #2b3042;
  --border-strong: #3f455e;
  --border-focus: #00d2ff;

  --text-primary: #f8fafc;
  --text-secondary: #e2e8f0;
  --text-muted: #94a3b8;
  --text-inverse: #0c0d11;

  --accent-cyan: #00d2ff;
  --accent-cyan-subtle: rgba(0, 210, 255, 0.12);
  --accent-cyan-glow: rgba(0, 210, 255, 0.25);

  --accent-blue: #3b82f6;
  --accent-purple: #a855f7;
  --accent-amber: #f59e0b;
  --accent-amber-subtle: rgba(245, 158, 11, 0.15);
  --accent-emerald: #10b981;
  --accent-emerald-subtle: rgba(16, 185, 129, 0.15);

  --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 6px 16px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.6);
  --shadow-glow: 0 0 24px rgba(0, 210, 255, 0.15);

  --grid-line-color: rgba(255, 255, 255, 0.04);
}

/* --------------------------------------------------------------------------
   2. RESET & BASE STYLES
   -------------------------------------------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* Universal Focus Ring Reset: Eliminates sticky outlines after mouse clicks */
*:focus:not(:focus-visible) {
  outline: none !important;
}

*:focus-visible {
  outline: 2px solid var(--accent-cyan) !important;
  outline-offset: 2px !important;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + 16px);
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  transition: background-color var(--transition-normal), color var(--transition-normal);
  padding-bottom: 0;
}

/* Base Headings */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.25;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

p {
  color: var(--text-secondary);
}

a {
  color: var(--accent-cyan);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--accent-blue);
}

ul {
  list-style: none;
}

code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: var(--bg-surface-elevated);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid var(--border-subtle);
  color: var(--accent-cyan);
}

/* Global Container */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--space-6);
  padding-right: var(--space-6);
}

/* Utility Helpers */
.mt-4 { margin-top: var(--space-4); }
.mt-5 { margin-top: var(--space-6); }
.mb-3 { margin-bottom: var(--space-3); }

/* Text Gradient Accent */
.text-gradient {
  background: linear-gradient(135deg, var(--text-primary) 30%, var(--accent-cyan) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Accessibility Skip Link */
.skip-link {
  position: absolute;
  top: -100px;
  left: 1.5rem;
  background: var(--accent-cyan);
  color: #000;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 0.88rem;
  z-index: 9999;
  box-shadow: var(--shadow-lg);
  transition: top 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  text-decoration: none;
}

.skip-link:focus {
  top: 1.5rem;
}

/* --------------------------------------------------------------------------
   3. DESKTOP TOP HEADER & NAVIGATION
   -------------------------------------------------------------------------- */
.desktop-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(24, 26, 31, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
  height: var(--header-height);
  display: flex;
  align-items: center;
  transition: background-color var(--transition-normal), border-color var(--transition-normal);
}

/* Scroll Progress Bar */
.scroll-progress-bar {
  position: absolute;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, var(--accent-cyan), var(--accent-blue), var(--accent-emerald));
  z-index: 1001;
  transition: width 0.05s linear;
}

.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-6);
  gap: var(--space-4);
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  text-decoration: none;
  flex-shrink: 0;
}

.brand-badge-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.brand-badge {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.95rem;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-blue));
  color: #000;
  padding: 4px 9px;
  border-radius: var(--radius-sm);
  letter-spacing: 0.05em;
  box-shadow: 0 0 12px rgba(0, 210, 255, 0.3);
}

.brand-live-dot {
  position: absolute;
  top: -3px;
  right: -3px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #10b981;
  border: 2px solid var(--bg-surface);
  box-shadow: 0 0 8px #10b981;
  animation: pulse-ring-green 2s infinite;
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-primary);
  letter-spacing: 0.04em;
  line-height: 1.1;
}

.brand-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 500;
  letter-spacing: 0.08em;
}

.desktop-nav {
  display: flex;
  align-items: center;
}

.nav-links {
  display: flex;
  gap: 3px;
  align-items: center;
  background: var(--bg-surface);
  padding: 4px 6px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-sm);
}

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  padding: 6px 12px;
  border-radius: var(--radius-full);
  transition: all var(--transition-fast);
  text-decoration: none;
  white-space: nowrap;
}

.nav-link span {
  font-size: 0.9rem;
}

.nav-link:hover {
  color: var(--text-primary);
  background-color: var(--bg-surface-hover);
}

.nav-link.active {
  color: var(--accent-cyan);
  background-color: var(--accent-cyan-subtle);
  border: 1px solid rgba(0, 210, 255, 0.35);
  box-shadow: 0 0 12px rgba(0, 210, 255, 0.15);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-shrink: 0;
}

/* Theme Toggle Button */
.theme-toggle-btn {
  display: none !important;
}

.theme-toggle-btn:hover {
  border-color: var(--border-strong);
  background: var(--bg-surface-hover);
  transform: translateY(-1px);
}

.nav-actions .nav-cta-btn {
  display: none !important;
}

.desktop-header.header-fluid .nav-container {
  max-width: 100%;
  padding: 0 var(--space-6);
}

.nav-cta-btn .btn-icon {
  font-size: 0.95rem;
  line-height: 1;
}

[data-theme="dark"] .light-icon { display: none; }
[data-theme="dark"] .dark-icon { display: inline-block; }
/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 10px 18px;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition-normal);
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent-cyan);
  color: #000;
}

.btn-primary:hover {
  background: #38e1ff;
  box-shadow: var(--shadow-glow);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--bg-surface);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
}

.btn-secondary:hover {
  background: var(--bg-surface-elevated);
  border-color: var(--border-strong);
  transform: translateY(-1px);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.82rem;
}

/* --------------------------------------------------------------------------
   4. HERO SECTION
   -------------------------------------------------------------------------- */
.hero-section {
  position: relative;
  padding: var(--space-16) 0 var(--space-12);
  overflow: hidden;
  border-bottom: 1px solid var(--border-subtle);
}

.hero-bg-grid {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: 32px 32px;
  background-image: 
    linear-gradient(to right, var(--grid-line-color) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid-line-color) 1px, transparent 1px);
  pointer-events: none;
  z-index: 0;
}

.hero-ambient-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  opacity: 0.75;
}

.hero-content {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 960px;
  margin: 0 auto;
}

.hero-badges {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge-cyan {
  background: var(--accent-cyan-subtle);
  color: var(--accent-cyan);
  border: 1px solid transparent;
}

.badge-blue {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  border: 1px solid transparent;
}

.badge-purple {
  background: rgba(168, 85, 247, 0.15);
  color: #c084fc;
  border: 1px solid transparent;
}

.badge-emerald {
  background: var(--accent-emerald-subtle);
  color: var(--accent-emerald);
  border: 1px solid transparent;
}

.badge-amber {
  background: var(--accent-amber-subtle);
  color: var(--accent-amber);
  border: 1px solid transparent;
}

.badge-slate {
  background: var(--bg-surface-elevated);
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
}

.badge-outline {
  background: var(--bg-surface);
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
}

.pulse-dot {
  width: 8px;
  height: 8px;
  background-color: var(--accent-cyan);
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 8px var(--accent-cyan);
  animation: pulse-ring 1.8s infinite;
}

@keyframes pulse-ring {
  0% { transform: scale(0.9); opacity: 0.8; }
  50% { transform: scale(1.2); opacity: 1; box-shadow: 0 0 12px var(--accent-cyan); }
  100% { transform: scale(0.9); opacity: 0.8; }
}

.hero-title {
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 800;
  margin-bottom: var(--space-4);
  line-height: 1.15;
}

.hero-desc {
  font-size: clamp(1rem, 2vw, 1.15rem);
  color: var(--text-muted);
  max-width: 800px;
  margin: 0 auto var(--space-8);
}

/* Telemetry Grid */
.telemetry-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-4);
  margin-bottom: var(--space-8);
  text-align: left;
}

.telemetry-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-4) var(--space-5);
  display: flex;
  align-items: center;
  gap: var(--space-4);
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-fast), border-color var(--transition-fast);
}

.telemetry-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-strong);
}

.telemetry-icon {
  font-size: 1.8rem;
  background: var(--bg-surface-elevated);
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

.telemetry-data {
  display: flex;
  flex-direction: column;
}

.telemetry-value {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.telemetry-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 500;
}

.hero-cta-group {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: var(--space-3);
}

/* --------------------------------------------------------------------------
   5. GENERAL SECTIONS
   -------------------------------------------------------------------------- */
.section {
  padding: var(--space-12) 0;
  border-bottom: 1px solid var(--border-subtle);
}

.section-dark {
  background-color: var(--bg-secondary);
}

.section-header {
  margin-bottom: var(--space-8);
}

.section-tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent-cyan);
  letter-spacing: 0.1em;
  margin-bottom: var(--space-2);
}

.section-title {
  font-size: clamp(1.6rem, 3.5vw, 2.2rem);
  margin-bottom: var(--space-2);
}

.section-subtitle {
  font-size: 1rem;
  color: var(--text-muted);
  max-width: 700px;
}

.subsection-title {
  font-size: 1.25rem;
  margin-bottom: var(--space-4);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

/* --------------------------------------------------------------------------
   6. TEAM & ROLES SECTION
   -------------------------------------------------------------------------- */
.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--space-6);
  margin-bottom: var(--space-6);
}

.team-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  transition: transform var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.team-card:hover, .team-card:active {
  transform: translateY(-2px);
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 2px var(--accent-cyan-subtle), var(--shadow-md);
}

.card-highlight {
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
}

.card-highlight:hover, .card-highlight:active {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 2px var(--accent-cyan-subtle), var(--shadow-glow);
}

.team-card-header {
  margin-bottom: var(--space-4);
}

.team-badge {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  display: inline-block;
  margin-bottom: var(--space-2);
}

.team-role {
  font-size: 1.2rem;
  font-weight: 700;
}

.team-leader {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  background: var(--bg-surface-elevated);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  margin-bottom: var(--space-4);
}

.leader-crown {
  font-size: 1.5rem;
}

.leader-name {
  display: block;
  font-size: 1.05rem;
  color: var(--text-primary);
}

.leader-title {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.team-tasks {
  list-style: none;
  font-size: 0.88rem;
  color: var(--text-secondary);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.team-tasks li::before {
  content: "▹";
  color: var(--accent-cyan);
  margin-right: 6px;
  font-weight: bold;
}

.team-members {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.member-pill {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-surface-elevated);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  border: 1px solid var(--border-subtle);
}

.member-pill span {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.mermaid-container {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: var(--space-5);
  box-shadow: var(--shadow-md);
  margin-top: var(--space-4);
  margin-bottom: var(--space-4);
  overflow: hidden;
  transition: background var(--transition-normal), border-color var(--transition-normal);
}

.mermaid-title {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--space-3);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.mermaid {
  background: transparent !important;
  border: 1px dashed var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  overflow-x: auto;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 120px;
}

.mermaid svg {
  background: transparent !important;
  max-width: 100% !important;
  height: auto !important;
}

/* Mermaid SVG Transparency & Dynamic Theme Adaptations */
.mermaid svg g.node rect,
.mermaid svg g.node circle,
.mermaid svg g.node ellipse,
.mermaid svg g.node polygon,
.mermaid svg g.node path,
.mermaid svg .label-container,
.mermaid svg .basic.label-container {
  fill: transparent !important;
  stroke-width: 1px !important;
  transition: stroke 0.2s ease, stroke-width 0.2s ease, filter 0.2s ease;
}

[data-theme="dark"] .mermaid svg g.node rect,
[data-theme="dark"] .mermaid svg g.node circle,
[data-theme="dark"] .mermaid svg g.node ellipse,
[data-theme="dark"] .mermaid svg g.node polygon,
[data-theme="dark"] .mermaid svg g.node path,
[data-theme="dark"] .mermaid svg .label-container {
  fill: rgba(255, 255, 255, 0.03) !important;
  stroke: var(--border-subtle) !important;
  stroke-width: 1px !important;
}

[data-theme="dark"] .mermaid svg .nodeLabel,
[data-theme="dark"] .mermaid svg text,
[data-theme="dark"] .mermaid svg span,
[data-theme="dark"] .mermaid svg div,
[data-theme="dark"] .mermaid svg tspan,
[data-theme="dark"] .mermaid svg p {
  fill: #f5f5f5 !important;
  color: #f5f5f5 !important;
}

[data-theme="dark"] .mermaid svg .flowchart-link,
[data-theme="dark"] .mermaid svg .edgePaths path,
[data-theme="dark"] .mermaid svg path.flowchart-link {
  stroke: var(--accent-cyan) !important;
}

[data-theme="dark"] .mermaid svg marker path,
[data-theme="dark"] .mermaid svg .marker {
  fill: var(--accent-cyan) !important;
  stroke: var(--accent-cyan) !important;
}

[data-theme="dark"] .mermaid svg .cluster rect {
  fill: rgba(255, 255, 255, 0.02) !important;
  stroke: var(--border-subtle) !important;
}

[data-theme="dark"] .mermaid svg .cluster text,
[data-theme="dark"] .mermaid svg .cluster span {
  fill: var(--accent-cyan) !important;
  color: var(--accent-cyan) !important;
}

[data-theme="dark"] .mermaid svg .edgeLabel,
[data-theme="dark"] .mermaid svg .edgeLabel rect {
  background-color: var(--bg-surface) !important;
  fill: var(--bg-surface) !important;
  color: var(--text-secondary) !important;
}

[data-theme="dark"] .mermaid svg .edgeLabel text,
[data-theme="dark"] .mermaid svg .edgeLabel span {
  fill: var(--text-secondary) !important;
  color: var(--text-secondary) !important;
}

/* Dynamic Thick Outline & Glow ONLY on Hover or Active/Click */
.mermaid svg g.node:hover rect,
.mermaid svg g.node:hover circle,
.mermaid svg g.node:hover ellipse,
.mermaid svg g.node:hover polygon,
.mermaid svg g.node:hover path,
.mermaid svg g.node:hover .label-container,
.mermaid svg g.node:active rect,
.mermaid svg g.node:active circle,
.mermaid svg g.node:active ellipse,
.mermaid svg g.node:active polygon,
.mermaid svg g.node:active path,
.mermaid svg g.node:active .label-container {
  stroke: var(--accent-cyan) !important;
  stroke-width: 2.5px !important;
  filter: drop-shadow(0 0 8px var(--accent-cyan)) !important;
  cursor: pointer;
}

/* Callout Box */
.callout {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-4) var(--space-5);
  display: flex;
  gap: var(--space-4);
  align-items: flex-start;
  transition: all var(--transition-fast);
}

.callout:hover, .callout:active {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 2px var(--accent-cyan-subtle);
}

.callout-info {
  border-color: var(--border-subtle);
}

.callout-tip {
  border-color: var(--border-subtle);
}

.callout-icon {
  font-size: 1.4rem;
  line-height: 1;
}

.callout-title {
  font-size: 0.95rem;
  margin-bottom: 4px;
}

.callout-body p {
  font-size: 0.88rem;
  color: var(--text-secondary);
}

/* --------------------------------------------------------------------------
   7. INTERACTIVE FLOWCHART BOARD
   -------------------------------------------------------------------------- */
.flowchart-board {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  display: flex;
  align-items: stretch;
  gap: var(--space-3);
  overflow-x: auto;
  box-shadow: var(--shadow-md);
  margin-bottom: var(--space-4);
}

.flow-stage {
  flex: 1;
  min-width: 220px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.flow-stage:hover, .flow-stage:active {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 2px var(--accent-cyan-subtle);
}

.flow-stage-title {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent-cyan);
  padding-bottom: var(--space-3);
  margin-bottom: var(--space-3);
  border-bottom: 1px solid var(--border-subtle);
}

.flow-nodes {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  flex-grow: 1;
}

.node-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-3);
  display: flex;
  flex-direction: column;
  gap: 2px;
  position: relative;
  word-break: break-word;
  overflow-wrap: break-word;
  transition: all var(--transition-fast);
}

.node-box:hover, .node-box:active, .node-box:focus-visible {
  border-color: var(--accent-cyan);
  transform: translateY(-2px);
  box-shadow: 0 0 0 2px var(--accent-cyan-subtle), var(--shadow-glow);
}

.node-box strong {
  font-size: 0.9rem;
  color: var(--text-primary);
}

.node-box small {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.node-badge {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
}

.node-primary {
  border-color: var(--border-subtle);
  background: var(--bg-surface);
}

.node-primary:hover, .node-primary:active, .node-primary:focus-visible {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 2px var(--accent-cyan-subtle), var(--shadow-glow);
}

.node-success {
  border-color: var(--border-subtle);
  background: var(--bg-surface);
}

.node-success:hover, .node-success:active, .node-success:focus-visible {
  border-color: var(--accent-emerald);
  box-shadow: 0 0 0 2px var(--accent-emerald-subtle), var(--shadow-glow);
}

.node-accent {
  border-color: var(--border-subtle);
  background: var(--bg-surface);
}

.node-accent:hover, .node-accent:active, .node-accent:focus-visible {
  border-color: var(--accent-amber);
  box-shadow: 0 0 0 2px var(--accent-amber-subtle), var(--shadow-glow);
}

.flow-connector-horizontal {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 48px;
  position: relative;
}

.flow-line-pulse {
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, var(--border-strong), var(--accent-cyan), var(--border-strong));
  position: relative;
}

.connector-label {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-muted);
  text-align: center;
  margin-top: 6px;
  white-space: nowrap;
}

/* --------------------------------------------------------------------------
   8. SUBSYSTEMS DEEP-DIVE CARDS
   -------------------------------------------------------------------------- */
.subsystem-nav-pills {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-6);
  justify-content: center;
}

.subsystem-nav-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  transition: all var(--transition-fast);
}

.subsystem-nav-pill span {
  font-family: var(--font-mono);
  font-weight: 800;
  color: var(--accent-cyan);
  background: rgba(0, 210, 255, 0.1);
  padding: 1px 6px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
}

.subsystem-nav-pill:hover {
  background: var(--bg-surface-hover);
  border-color: var(--accent-cyan);
  color: #fff;
  transform: translateY(-1px);
}

.subsystems-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-5);
  align-items: stretch;
}

@media (max-width: 960px) {
  .desktop-nav {
    display: none !important;
  }
  .subsystems-grid {
    grid-template-columns: 1fr;
  }
}

.subsystem-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: var(--space-5);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  scroll-margin-top: calc(var(--header-height) + 20px);
}

.subsystem-card:hover {
  border-color: rgba(0, 210, 255, 0.45);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
}

.subsystem-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-3);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: var(--space-4);
}

.subsystem-header-left {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-width: 0;
  flex: 1;
}

.subsystem-badge {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  background: rgba(0, 210, 255, 0.1);
  border: 1px solid rgba(0, 210, 255, 0.3);
  color: var(--accent-cyan);
  flex-shrink: 0;
}

.subsystem-num {
  font-family: var(--font-mono);
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--accent-cyan);
  background: var(--accent-cyan-subtle);
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

.subsystem-title {
  font-size: 1.08rem;
  margin-bottom: 2px;
  line-height: 1.3;
}

.subsystem-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.3;
}

.subsystem-body {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  flex-grow: 1;
}

.subsystem-diagram {
  background: rgba(18, 18, 20, 0.85);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-3);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 0;
}

.subsystem-diagram .mermaid {
  min-width: max-content;
  border: none;
  padding: 0;
  justify-content: flex-start;
  margin: 0 auto;
}

.subsystem-details-grid {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  flex-grow: 1;
}

.subsystem-details-grid .tech-route-box {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  margin-bottom: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.route-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.route-tag {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent-cyan);
}

.route-item code {
  font-size: 0.8rem;
  word-break: break-all;
  white-space: pre-wrap;
  line-height: 1.4;
}

.subsystem-desc-card {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.subsystem-desc-card .desc-header {
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--accent-cyan);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.subsystem-desc-card .subsystem-desc {
  font-size: 0.84rem;
  line-height: 1.55;
  color: var(--text-secondary);
}

/* --------------------------------------------------------------------------
   9. CAMERAS SECTION
   -------------------------------------------------------------------------- */
.cameras-grid {
  display: grid;
  gap: var(--space-6);
}

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

.doc-grid {
  grid-template-columns: repeat(3, 1fr);
}

@media (max-width: 900px) {
  .broadcast-grid,
  .doc-grid {
    grid-template-columns: 1fr;
  }
}

.cam-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  transition: transform var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.cam-card:hover, .cam-card:active {
  transform: translateY(-2px);
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 2px var(--accent-cyan-subtle), var(--shadow-md);
}

.cam-card-badge {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-3);
}

.cam-name {
  font-size: 1.2rem;
  margin-bottom: var(--space-4);
}

.cam-specs-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
  flex-grow: 1;
}

.cam-spec-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--space-2);
  font-size: 0.85rem;
  border-bottom: 1px dashed var(--border-subtle);
  padding-bottom: 4px;
}

.cam-spec-row span {
  color: var(--text-muted);
  flex-shrink: 0;
}

.cam-spec-row strong {
  font-family: var(--font-mono);
  color: var(--text-primary);
  font-size: 0.82rem;
  text-align: right;
  word-break: break-word;
}

.cam-status-pill {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
  text-align: center;
  padding: 6px;
  border-radius: var(--radius-sm);
  background: var(--accent-emerald-subtle);
  color: var(--accent-emerald);
  border: 1px solid transparent;
}

/* --------------------------------------------------------------------------
   10. TABLES (WORKSTATIONS & INVENTORY)
   -------------------------------------------------------------------------- */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-sm);
  background: var(--bg-surface);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.9rem;
}

.data-table th, .data-table td {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border-subtle);
}

.data-table th {
  background: var(--bg-surface-elevated);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.data-table tbody tr:last-child td {
  border-bottom: none;
}

.data-table tbody tr:hover {
  background: var(--bg-surface-hover);
}

.row-warning {
  background: rgba(245, 158, 11, 0.04);
}

.user-tag {
  font-weight: 600;
  color: var(--text-primary);
}

/* --------------------------------------------------------------------------
   11. INVENTORY CONTROLS & SEARCH
   -------------------------------------------------------------------------- */
.inventory-controls {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}

.search-bar-wrapper {
  position: relative;
  width: 100%;
}

.search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.1rem;
  color: var(--text-muted);
  pointer-events: none;
}

.search-input {
  width: 100%;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 14px 44px 14px 48px;
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--text-primary);
  outline: none;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-fast);
}

.search-input:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 3px var(--accent-cyan-subtle);
}

.search-box-wrap .clear-btn,
.search-wrapper .clear-btn {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--bg-surface-elevated);
  border: none;
  color: var(--text-muted);
  width: 24px;
  height: 24px;
  border-radius: 50%;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
}

.search-box-wrap .clear-btn.visible,
.search-wrapper .clear-btn.visible {
  display: flex;
}

.filter-pills-scroll {
  display: flex;
  gap: var(--space-2);
  overflow-x: auto;
  padding-bottom: 4px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.filter-pills-scroll::-webkit-scrollbar {
  display: none;
}

.filter-pill {
  padding: 6px 14px;
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 600;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all var(--transition-fast);
}

.filter-pill:hover {
  background: var(--bg-surface-elevated);
  color: var(--text-primary);
}

.filter-pill.active {
  background: var(--accent-cyan);
  color: #000;
  border-color: var(--accent-cyan);
}

.inventory-summary-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
  font-size: 0.85rem;
  color: var(--text-muted);
}

.legend-badges {
  display: flex;
  gap: var(--space-2);
}

.inventory-tables-wrapper {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

.vendor-block {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  box-shadow: var(--shadow-sm);
}

.vendor-title {
  font-size: 1.15rem;
  margin-bottom: var(--space-4);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.vendor-dot {
  width: 8px;
  height: 8px;
  background: var(--accent-cyan);
  border-radius: 50%;
  flex-shrink: 0;
}

/* --------------------------------------------------------------------------
   12. RUNDOWN TIMELINE
   -------------------------------------------------------------------------- */
.rundown-timeline {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

.timeline-phase {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  transition: transform var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.timeline-phase:hover, .timeline-phase:active {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 2px var(--accent-cyan-subtle), var(--shadow-md);
  transform: translateY(-2px);
}

.phase-active {
  border-color: var(--border-subtle);
  background: var(--bg-surface);
}

.phase-active:hover, .phase-active:active {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 2px var(--accent-cyan-subtle), var(--shadow-glow);
  transform: translateY(-2px);
}

.phase-header {
  margin-bottom: var(--space-4);
}

.phase-badge {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  display: inline-block;
  margin-bottom: 4px;
}

.phase-title {
  font-size: 1.3rem;
}

.timeline-content {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.timeline-item {
  display: flex;
  gap: var(--space-4);
  align-items: flex-start;
}

.timeline-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent-cyan);
  margin-top: 6px;
  flex-shrink: 0;
}

.timeline-box {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  transition: transform var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.timeline-box:hover, .timeline-box:active {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 2px var(--accent-cyan-subtle);
  transform: translateY(-1px);
}

.timeline-box strong {
  font-size: 0.95rem;
  color: var(--text-primary);
}

.timeline-target {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.timeline-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--space-3);
}

.timeline-grid .timeline-box span {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   13. FOOTER (High-Contrast Minimalist Universal Footer)
   -------------------------------------------------------------------------- */
.site-footer {
  background: #090a0f;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 4.5rem 0 calc(var(--dock-height, 68px) + 2.5rem);
  width: 100%;
  position: relative;
  z-index: 10;
}

@media (min-width: 769px) {
  .site-footer {
    padding-bottom: 4rem;
  }
}

.site-footer .container,
.site-footer .footer-container {
  width: 100%;
  max-width: var(--max-width);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--space-6);
  padding-right: var(--space-6);
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 2.5rem;
  margin-bottom: 3rem;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}

.footer-desc {
  font-size: 0.88rem;
  color: #94a3b8;
  line-height: 1.6;
  margin-bottom: var(--space-3);
}

.footer-meta-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: #94a3b8;
}

.footer-heading,
.footer-col-title {
  font-family: var(--font-display);
  font-size: 0.96rem;
  font-weight: 700;
  color: #f8fafc;
  letter-spacing: -0.01em;
  margin-bottom: 1.1rem;
}

.footer-links ul,
ul.footer-links {
  display: flex;
  flex-direction: column;
  gap: 10px;
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-links a,
.footer-links-col a {
  font-size: 0.88rem;
  color: #cbd5e1;
  text-decoration: none;
  transition: color 150ms ease, transform 150ms ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.footer-links a:hover,
.footer-links-col a:hover {
  color: var(--accent-cyan);
  transform: translateX(2px);
}

.footer-policy-text {
  font-size: 0.82rem;
  color: #94a3b8;
  line-height: 1.55;
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-4);
  padding-top: var(--space-6);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.82rem;
  color: #94a3b8;
}

.footer-bottom .copyright {
  color: #94a3b8;
  margin: 0;
}

.footer-bottom .confidential-badge {
  color: #64748b;
  margin: 0;
  font-size: 0.76rem;
}

/* --------------------------------------------------------------------------
   14. MOBILE NAVIGATION DRAWER & BOTTOM DOCK
   -------------------------------------------------------------------------- */
.mobile-menu-toggle-btn {
  display: inline-flex;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 4px;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
  transition: all var(--transition-fast);
}

.mobile-menu-toggle-btn:hover,
.mobile-menu-toggle-btn:active {
  border-color: var(--accent-cyan);
  background: var(--bg-surface-hover);
  box-shadow: 0 0 12px rgba(0, 210, 255, 0.25);
  transform: translateY(-1px);
}

.hamburger-bar {
  width: 18px;
  height: 2px;
  background-color: var(--text-primary);
  border-radius: 2px;
  transition: transform var(--transition-fast), opacity var(--transition-fast);
}

/* Mobile Drawer Backdrop */
.mobile-drawer-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 2500;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.28s ease, visibility 0.28s ease;
}

.mobile-drawer-backdrop.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* Mobile Navigation Drawer */
.mobile-nav-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(340px, 86vw);
  background: var(--bg-surface);
  border-left: 1px solid var(--border-subtle);
  box-shadow: -8px 0 32px rgba(0, 0, 0, 0.45);
  z-index: 2600;
  transform: translateX(100%);
  transition: transform 0.32s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.mobile-nav-drawer.active {
  transform: translateX(0);
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) var(--space-5);
  background: var(--bg-surface-elevated);
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

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

.drawer-brand-text {
  display: flex;
  flex-direction: column;
}

.drawer-title {
  font-family: var(--font-display);
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: 0.04em;
  line-height: 1.2;
}

.drawer-sub {
  font-size: 0.68rem;
  color: var(--text-muted);
  font-weight: 600;
}

.drawer-close-btn {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-size: 1.3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
  line-height: 1;
}

.drawer-close-btn:hover,
.drawer-close-btn:active {
  color: var(--text-primary);
  border-color: var(--accent-cyan);
}

.drawer-content {
  flex-grow: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: var(--space-4) var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.drawer-section-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--accent-cyan);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-top: var(--space-2);
  margin-bottom: var(--space-1);
}

.drawer-nav-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.drawer-nav-link {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 10px 12px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  text-decoration: none;
  transition: all var(--transition-fast);
}

.drawer-nav-link:hover,
.drawer-nav-link:active {
  border-color: var(--accent-cyan);
  background: var(--bg-surface-hover);
  transform: translateX(3px);
}

.drawer-nav-link.highlight {
  border-color: var(--accent-cyan);
  background: rgba(0, 210, 255, 0.06);
}

.drawer-nav-link.active {
  background: rgba(0, 210, 255, 0.14);
  border-color: var(--accent-cyan);
  box-shadow: 0 0 12px rgba(0, 210, 255, 0.25);
}

.drawer-nav-link.active strong {
  color: var(--accent-cyan);
}

.drawer-link-icon {
  font-size: 1.25rem;
  line-height: 1;
  flex-shrink: 0;
}

.drawer-link-text {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  min-width: 0;
}

.drawer-link-text strong {
  font-size: 0.86rem;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.drawer-link-text small {
  font-size: 0.72rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.drawer-link-badge {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  flex-shrink: 0;
}

.drawer-link-badge.pulse {
  background: var(--accent-cyan);
  color: #000;
  border-color: var(--accent-cyan);
  font-weight: 800;
}

.drawer-quick-actions {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-top: var(--space-1);
}

.drawer-action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-weight: 600;
  font-size: 0.84rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.drawer-action-btn:hover,
.drawer-action-btn:active {
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
  background: var(--bg-surface-hover);
}

.drawer-footer-note {
  margin-top: auto;
  padding-top: var(--space-4);
  text-align: center;
  font-size: 0.7rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border-subtle);
}

/* Mobile Bottom Dock */
.mobile-bottom-dock {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 2000;
  background: rgba(24, 26, 31, 0.94);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border-subtle);
  padding-bottom: max(env(safe-area-inset-bottom, 0px), 6px);
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.35);
}

.dock-container {
  display: flex;
  justify-content: space-around;
  align-items: center;
  height: var(--dock-height, 60px);
  padding: 0 var(--space-2);
  max-width: 540px;
  margin: 0 auto;
}

.dock-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 600;
  text-decoration: none;
  padding: 6px 6px;
  border-radius: var(--radius-md);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all var(--transition-fast);
  flex: 1;
  min-height: 48px;
  -webkit-tap-highlight-color: transparent;
}

.dock-icon {
  font-size: 1.25rem;
  line-height: 1;
}

.dock-item:hover, .dock-item.active {
  color: var(--accent-cyan);
}

.dock-item.active .dock-icon {
  transform: translateY(-2px) scale(1.1);
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* --------------------------------------------------------------------------
   14.5. CLOUD SYNC & REALTIME CHECKLIST
   -------------------------------------------------------------------------- */
.cloud-sync-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  margin-bottom: var(--space-6);
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}

.cloud-sync-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent-cyan), var(--accent-blue), var(--accent-emerald));
}

.cloud-sync-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-bottom: var(--space-5);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--border-subtle);
}

.sync-status-indicator {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 600;
}

.sync-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.status-pulse-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #f59e0b;
  display: inline-block;
  box-shadow: 0 0 8px #f59e0b;
}

.status-pulse-dot.connected {
  background: #10b981;
  box-shadow: 0 0 10px #10b981;
  animation: pulse-ring-green 2s infinite;
}

.status-pulse-dot.syncing {
  background: #00d2ff;
  box-shadow: 0 0 10px #00d2ff;
  animation: pulse-ring 1s infinite;
}

@keyframes pulse-ring-green {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.2); opacity: 1; box-shadow: 0 0 14px #10b981; }
  100% { transform: scale(0.95); opacity: 0.8; }
}

.crew-identity-bar {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  flex-wrap: wrap;
  margin-bottom: var(--space-5);
  background: var(--bg-surface-elevated);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

.crew-label {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-primary);
  white-space: nowrap;
}

.crew-input-group {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-grow: 1;
  min-width: 240px;
}

.crew-name-input {
  width: 100%;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: var(--text-primary);
  outline: none;
  transition: border-color var(--transition-fast);
}

.crew-name-input:focus {
  border-color: var(--accent-cyan);
}

.crew-saved-badge {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--accent-emerald);
  white-space: nowrap;
}

.sync-progress-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-4);
}

.progress-box {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
}

.progress-title {
  font-weight: 600;
  color: var(--text-primary);
}

.progress-counter {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--accent-cyan);
}

.progress-bar-track {
  width: 100%;
  height: 8px;
  background: var(--bg-surface);
  border-radius: var(--radius-full);
  overflow: hidden;
  border: 1px solid var(--border-subtle);
}

.progress-bar-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 400ms cubic-bezier(0.16, 1, 0.3, 1);
}

.fill-loading {
  background: linear-gradient(90deg, #3b82f6, #00d2ff);
}

.fill-packing {
  background: linear-gradient(90deg, #f59e0b, #10b981);
}

/* Tactile Inventory Checkboxes & Strict Fixed Column Alignment (Master Portal) */
body:not(.inventory-page) .data-table.inv-table {
  table-layout: fixed;
  width: 100%;
  min-width: 820px;
}

/* Col 1: Nama Barang */
body:not(.inventory-page) .data-table.inv-table th:nth-child(1),
body:not(.inventory-page) .data-table.inv-table td:nth-child(1) {
  width: 26%;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Col 2: Jumlah */
body:not(.inventory-page) .data-table.inv-table th:nth-child(2),
body:not(.inventory-page) .data-table.inv-table td:nth-child(2) {
  width: 11%;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  white-space: nowrap;
}

/* Col 3: Status */
body:not(.inventory-page) .data-table.inv-table th:nth-child(3),
body:not(.inventory-page) .data-table.inv-table td:nth-child(3) {
  width: 8%;
  text-align: center;
  white-space: nowrap;
}

/* Col 4 & 5: Pasang & Kemas Checkboxes (Hydrated by JS) */
body:not(.inventory-page) .data-table.inv-table th.th-sync,
body:not(.inventory-page) .data-table.inv-table td.sync-td {
  width: 80px;
  min-width: 80px;
  max-width: 80px;
  text-align: center;
  white-space: nowrap;
}

/* Col 6: Keterangan Penggunaan (Strictly 1 Single Line) */
body:not(.inventory-page) .data-table.inv-table th:nth-child(6),
body:not(.inventory-page) .data-table.inv-table td:nth-child(6) {
  width: 39%;
  color: var(--text-secondary);
  font-size: 0.84rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Col 4 Fallback before sync columns inserted */
body:not(.inventory-page) .data-table.inv-table th:nth-child(4):last-child,
body:not(.inventory-page) .data-table.inv-table td:nth-child(4):last-child {
  width: 55%;
  color: var(--text-secondary);
  font-size: 0.84rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sync-td {
  text-align: center;
  vertical-align: middle;
  padding: 8px 4px !important;
}

.inv-checkbox-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: var(--bg-surface-elevated);
  border: 1.5px solid var(--border-subtle);
  color: transparent;
  cursor: pointer;
  transition: all 180ms cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
  position: relative;
}

.inv-checkbox-btn:hover {
  border-color: var(--border-strong);
  background: var(--bg-surface-hover);
  transform: scale(1.08);
}

.inv-checkbox-btn:active {
  transform: scale(0.92);
}

.inv-checkbox-btn .check-svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 3;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  transform: scale(0);
  transition: transform 160ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Loading-In (Pasang) Checked State - Cyan */
.inv-checkbox-btn.check-loading.checked {
  background: var(--accent-cyan);
  border-color: var(--accent-cyan);
  color: #000;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.inv-checkbox-btn.check-loading.checked .check-svg {
  transform: scale(1);
}

/* Packing-Out (Kemas) Checked State - Emerald */
.inv-checkbox-btn.check-packing.checked {
  background: var(--accent-emerald);
  border-color: var(--accent-emerald);
  color: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.inv-checkbox-btn.check-packing.checked .check-svg {
  transform: scale(1);
}

/* Remote Sync Flash Animation */
tr.remote-updated {
  animation: remote-update-flash 1.2s ease;
}

@keyframes remote-update-flash {
  0% { background-color: rgba(0, 210, 255, 0.35); }
  50% { background-color: rgba(16, 185, 129, 0.25); }
  100% { background-color: transparent; }
}

/* --------------------------------------------------------------------------
   14. MODAL DIALOGS & POPUPS (BOTTOM-RIGHT DESKTOP & BOTTOM-SHEET MOBILE)
   -------------------------------------------------------------------------- */
.modal-overlay,
.modal-backdrop {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 2700;
  align-items: flex-end;
  justify-content: flex-end;
  padding: 24px;
  opacity: 1;
  transition: opacity 0.25s ease;
}

.modal-overlay.active,
.modal-backdrop.active,
.modal-overlay[style*="display: flex"],
.modal-backdrop[style*="display: flex"] {
  display: flex !important;
}

.modal-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  max-width: 440px;
  width: 100%;
  padding: var(--space-5) var(--space-6);
  box-shadow: 0 24px 56px -12px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(0, 210, 255, 0.15);
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  animation: modal-corner-slide 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modal-corner-slide {
  from {
    opacity: 0;
    transform: translateY(24px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 768px) {
  .modal-overlay,
  .modal-backdrop {
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(0, 0, 0, 0.78);
  }

  .modal-card {
    max-width: 100%;
    width: min(94vw, 540px);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-subtle);
    padding: 20px 18px;
    max-height: 85vh;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.75);
    margin: auto;
    animation: modal-corner-slide 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--border-subtle);
}

.modal-title {
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.modal-close-btn {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 1.1rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  line-height: 1;
  transition: all var(--transition-fast);
}

.modal-close-btn:hover,
.modal-close-btn:active {
  color: var(--text-primary);
  border-color: var(--accent-cyan);
  background: var(--bg-surface-hover);
}

.modal-desc {
  font-size: 0.88rem;
  color: var(--text-secondary);
  margin-bottom: var(--space-4);
}

.form-group {
  margin-bottom: var(--space-4);
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.form-input {
  width: 100%;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-primary);
  outline: none;
}

.form-input:focus {
  border-color: var(--accent-cyan);
}

.modal-notice {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  margin-bottom: var(--space-4);
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.modal-notice ol {
  margin-left: var(--space-4);
  margin-top: 4px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-3);
  padding-top: var(--space-4);
  border-top: 1px solid var(--border-subtle);
}

/* Secondary Status Filter Pills */
.status-filter-pills {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-2);
}

.filter-group-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
  flex-shrink: 0;
}

.status-pill {
  padding: 5px 12px;
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 600;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all var(--transition-fast);
}

.status-pill:hover {
  border-color: var(--border-strong);
  color: var(--text-primary);
}

.status-pill.active {
  background: var(--bg-surface-hover);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
  font-weight: 700;
}

/* Presence Badge */
.presence-badge {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  background: rgba(16, 185, 129, 0.12);
  color: var(--accent-emerald);
  border: 1px solid var(--border-subtle);
  padding: 3px 8px;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}

.btn-outline:hover {
  background: var(--bg-surface-elevated);
  border-color: var(--border-strong);
  color: var(--text-primary);
}

/* Toast Notifications Container */
.toast-container {
  position: fixed;
  z-index: 3000;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  pointer-events: none;
  bottom: calc(72px + env(safe-area-inset-bottom, 8px));
  left: 16px;
  right: 16px;
  max-width: none;
}

@media (min-width: 769px) {
  .toast-container {
    bottom: 24px;
    right: 24px;
    left: auto;
    max-width: 380px;
    width: 380px;
  }
}

.toast-item {
  pointer-events: auto;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-left: 4px solid var(--accent-cyan);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  animation: slide-in-toast 0.3s cubic-bezier(0.16, 1, 0.3, 1), fade-out-toast 0.4s ease 3.6s forwards;
}

.toast-item.toast-success {
  border-left-color: var(--accent-emerald);
}

.toast-item.toast-warning {
  border-left-color: var(--accent-amber);
}

.toast-icon {
  font-size: 1.2rem;
  line-height: 1;
}

.toast-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.toast-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
}

.toast-msg {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.3;
}

@keyframes slide-in-toast {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes fade-out-toast {
  to {
    opacity: 0;
    transform: translateY(-8px);
  }
}

/* --------------------------------------------------------------------------
   15. RESPONSIVE BREAKPOINTS
   -------------------------------------------------------------------------- */
@media (min-width: 769px) and (max-width: 1120px) {
  .nav-container {
    padding: 0 var(--space-4);
    gap: var(--space-2);
  }

  .brand-sub {
    display: none;
  }

  .nav-links {
    gap: 2px;
    padding: 3px 4px;
  }

  .nav-link {
    padding: 5px 8px;
    font-size: 0.78rem;
  }

  .nav-link span {
    display: none;
  }

  .theme-toggle-btn .theme-label {
    display: none;
  }

  .theme-toggle-btn {
    padding: 7px 9px;
  }

  .nav-cta-btn {
    padding: 7px 11px;
    font-size: 0.78rem;
  }
}

@media (max-width: 768px) {
  html, body {
    max-width: 100vw;
    overflow-x: hidden;
  }

  .container {
    padding-left: 14px;
    padding-right: 14px;
  }

  .desktop-header {
    height: 56px;
  }

  .nav-container {
    padding: 0 var(--space-3);
    gap: var(--space-2);
  }

  .brand-logo {
    gap: var(--space-2);
    min-width: 0;
  }

  .brand-badge {
    font-size: 0.8rem;
    padding: 3px 7px;
  }

  .brand-title {
    font-size: 0.82rem;
    letter-spacing: 0.02em;
    white-space: nowrap;
  }

  .brand-sub {
    font-size: 0.62rem;
    letter-spacing: 0.03em;
  }

  .desktop-header .desktop-nav,
  .desktop-header .nav-actions .nav-cta-btn {
    display: none !important;
  }

  .mobile-menu-toggle-btn {
    display: inline-flex !important;
  }

  .theme-toggle-btn {
    padding: 6px 8px;
  }

  .theme-toggle-btn .theme-label {
    display: none;
  }

  .mobile-bottom-dock {
    display: block;
  }

  body {
    padding-bottom: calc(var(--dock-height, 60px) + max(env(safe-area-inset-bottom, 0px), 8px));
  }

  .section {
    padding: var(--space-8) 0;
  }

  .section-header {
    margin-bottom: var(--space-5);
  }

  .section-title {
    font-size: 1.45rem;
    line-height: 1.25;
  }

  .section-subtitle {
    font-size: 0.88rem;
  }

  .hero-section {
    padding-top: var(--space-6);
    padding-bottom: var(--space-8);
  }

  .hero-badges {
    justify-content: flex-start;
    gap: var(--space-2);
  }

  .badge {
    font-size: 0.7rem;
    padding: 3px 8px;
  }

  .telemetry-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  .telemetry-card {
    padding: 10px 12px;
    gap: 8px;
    min-width: 0;
  }

  .telemetry-icon {
    width: 34px;
    height: 34px;
    font-size: 1.15rem;
    flex-shrink: 0;
  }

  .telemetry-data,
  .telemetry-info {
    min-width: 0;
    flex: 1;
    overflow: hidden;
  }

  .telemetry-label {
    font-size: 0.72rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
  }

  .telemetry-value {
    font-size: 1.05rem;
    font-weight: 800;
  }

  .team-grid {
    grid-template-columns: 1fr;
    gap: var(--space-4);
  }

  .team-card,
  .cam-card,
  .timeline-phase,
  .subsystem-card {
    padding: 16px 14px;
    border-radius: var(--radius-md);
  }

  .vendor-block {
    padding: 14px 10px;
    border-radius: var(--radius-md);
    margin-bottom: 14px;
  }

  .vendor-title {
    font-size: 1.05rem;
  }

  .cloud-sync-card {
    padding: 14px 12px;
    border-radius: var(--radius-md);
  }

  .cloud-sync-header {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding-bottom: 12px;
    margin-bottom: 14px;
  }

  .sync-status-indicator {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
  }

  .sync-status-text {
    font-size: 0.8rem;
    line-height: 1.3;
    flex: 1 1 auto;
    min-width: 150px;
  }

  .sync-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    width: 100%;
  }

  .sync-actions #btn-copy-summary,
  .sync-actions .btn-full-width {
    grid-column: span 2;
  }

  .sync-actions .btn {
    width: 100%;
    justify-content: center;
    text-align: center;
    padding: 8px 10px;
    font-size: 0.78rem;
    white-space: normal;
    line-height: 1.25;
  }

  .crew-identity-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 12px 10px;
    margin-bottom: 12px;
  }

  .crew-input-group {
    min-width: 0;
    width: 100%;
  }

  .crew-name-input {
    font-size: 0.85rem;
    padding: 8px 10px;
  }

  .crew-saved-badge {
    align-self: flex-start;
    font-size: 0.72rem;
  }

  .crew-sync-status {
    width: 100%;
    justify-content: space-between;
  }

  .sync-progress-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .progress-box {
    padding: 12px 10px;
  }

  .cloud-metrics-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-3);
  }

  .cloud-actions-row {
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-2);
  }

  .cloud-actions-row .btn {
    width: 100%;
  }

  .flowchart-board {
    padding: 12px 10px;
    gap: 10px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }

  .flowchart-board::-webkit-scrollbar {
    display: none;
  }

  .flow-stage {
    min-width: 200px;
    flex-shrink: 0;
  }

  .mermaid {
    justify-content: flex-start !important;
  }

  .table-responsive {
    border-radius: var(--radius-md);
    margin-left: 0;
    margin-right: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  body:not(.inventory-page) .table-responsive .data-table {
    min-width: 660px; /* Device matrix and generic tables get smooth horizontal scroll */
  }

  body:not(.inventory-page) .table-responsive .inv-table {
    min-width: 820px; /* Master inventory 6-column fixed table */
  }

  body:not(.inventory-page) .inv-table th,
  body:not(.inventory-page) .inv-table td {
    padding: 10px 8px;
    font-size: 0.8rem;
  }

  .timeline-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: var(--space-6);
  }
}

@media (max-width: 480px) {
  .container {
    padding-left: 12px;
    padding-right: 12px;
  }

  .nav-container {
    padding: 0 var(--space-2);
  }

  .brand-sub {
    display: none;
  }

  .brand-title {
    font-size: 0.78rem;
    max-width: 170px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .hero-title {
    font-size: 1.65rem;
    line-height: 1.2;
  }

  .hero-lead {
    font-size: 0.88rem;
  }

  .hero-cta-group {
    flex-direction: column;
    gap: var(--space-2);
  }

  .hero-cta-group .btn {
    width: 100%;
  }

  .telemetry-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
  }

  .telemetry-card {
    padding: 8px 10px;
  }

  .cloud-metrics-grid {
    grid-template-columns: 1fr;
  }

  .search-input {
    font-size: 0.86rem;
    padding: 11px 34px 11px 40px;
  }

  .search-icon {
    left: 12px;
    font-size: 0.95rem;
  }

  .filter-pills-scroll {
    gap: 5px;
    padding-bottom: 5px;
  }

  .filter-pill {
    padding: 5px 10px;
    font-size: 0.76rem;
  }

  .status-pill {
    padding: 4px 8px;
    font-size: 0.72rem;
  }

  .inventory-summary-bar {
    font-size: 0.78rem;
    gap: 6px;
  }

  .legend-badges {
    flex-wrap: wrap;
    gap: 4px;
  }

  .legend-badges .badge {
    font-size: 0.68rem;
    padding: 2px 6px;
  }
}

@media (max-width: 360px) {
  .container {
    padding-left: 8px;
    padding-right: 8px;
  }

  .nav-container {
    padding: 0 6px;
  }

  .nav-actions .btn {
    padding: 4px 7px;
    font-size: 0.72rem;
    white-space: nowrap;
  }

  .brand-badge {
    font-size: 0.72rem;
    padding: 2px 5px;
  }

  .brand-title {
    font-size: 0.72rem;
    max-width: 130px;
  }

  .hero-badges {
    gap: 4px;
  }

  .hero-badges .badge {
    font-size: 0.66rem;
    padding: 2px 6px;
  }

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

  .sync-actions {
    grid-template-columns: 1fr;
  }

  .sync-actions #btn-copy-summary,
  .sync-actions .btn-full-width {
    grid-column: span 1;
  }

  .cam-spec-row {
    font-size: 0.8rem;
    gap: 4px;
  }

  body.inventory-page .inventory-title {
    font-size: 1.05rem !important;
  }

  body.inventory-page .data-table.inv-table-field th.col-qty,
  body.inventory-page .data-table.inv-table-field td.col-qty {
    width: 60px !important;
    min-width: 60px !important;
    max-width: 60px !important;
    font-size: 0.74rem !important;
  }

  body.inventory-page .data-table.inv-table-field th.col-ceklist,
  body.inventory-page .data-table.inv-table-field td.col-ceklist {
    width: 46px !important;
    min-width: 46px !important;
    max-width: 46px !important;
  }

  body.inventory-page .data-table.inv-table-field .inv-checkbox-btn {
    width: 32px !important;
    height: 32px !important;
    min-width: 32px !important;
    max-width: 32px !important;
  }
}


/* --------------------------------------------------------------------------
   14. SATSET MOBILE PORTAL STYLES (3 Columns: Nama, Jumlah, Centang)
   Desain visual konsisten dengan Master Portal, lega, tidak disunat / padet.
   -------------------------------------------------------------------------- */
body.inventory-page {
  overflow-x: hidden !important;
  max-width: 100vw !important;
  background-color: var(--bg-primary);
  padding-bottom: calc(32px + env(safe-area-inset-bottom, 12px)) !important;
}

body.inventory-page .container {
  width: 100% !important;
  max-width: 100% !important;
  padding-left: 10px !important;
  padding-right: 10px !important;
  overflow-x: hidden !important;
}

body.inventory-page .inventory-page-header {
  padding: 8px 0 4px 0 !important;
}

body.inventory-page .inventory-hero-card,
body.inventory-page .cloud-sync-card,
body.inventory-page .vendor-block {
  padding: 12px 10px !important;
  margin-bottom: 12px !important;
  border-radius: 12px !important;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-sm);
}

body.inventory-page .inventory-hero-card {
  gap: 6px;
}

body.inventory-page .inventory-title {
  font-size: 1.15rem !important;
}

body.inventory-page .inventory-subtitle {
  font-size: 0.8rem !important;
  line-height: 1.35 !important;
}

body.inventory-page .vendor-title {
  font-size: 0.98rem !important;
  font-weight: 700 !important;
  color: var(--text-primary);
  margin-bottom: 8px !important;
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.inventory-responsive {
  width: 100% !important;
  max-width: 100% !important;
  overflow-x: hidden !important; /* Zero horizontal scrolling on mobile */
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-sm);
  background: var(--bg-surface);
  margin-bottom: 2px;
}

.data-table.inv-table-field {
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  table-layout: fixed !important;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.data-table.inv-table-field th {
  background: var(--bg-surface-elevated);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 8px 6px !important;
  border-bottom: 1px solid var(--border-subtle);
  box-sizing: border-box;
}

.data-table.inv-table-field td {
  padding: 9px 6px !important;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
  box-sizing: border-box;
}

.data-table.inv-table-field th.col-nama,
.data-table.inv-table-field td.col-nama {
  width: auto !important;
  text-align: left;
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--text-primary);
  word-wrap: break-word;
  overflow-wrap: break-word;
  white-space: normal !important;
  padding: 9px 8px !important;
}

.data-table.inv-table-field th.col-qty,
.data-table.inv-table-field td.col-qty {
  width: 68px !important;
  min-width: 68px !important;
  max-width: 68px !important;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  line-height: 1.25;
  color: var(--text-secondary);
  word-wrap: break-word;
  overflow-wrap: break-word;
  white-space: normal !important;
  padding: 9px 4px !important;
}

.data-table.inv-table-field th.col-ceklist,
.data-table.inv-table-field td.col-ceklist {
  width: 52px !important;
  min-width: 52px !important;
  max-width: 52px !important;
  text-align: center;
  padding: 5px 2px !important;
  white-space: nowrap;
}

.data-table.inv-table-field tbody tr {
  transition: background 160ms cubic-bezier(0.16, 1, 0.3, 1);
}

.data-table.inv-table-field tbody tr:hover {
  background: var(--bg-surface-hover);
}

.data-table.inv-table-field tbody tr:last-child td {
  border-bottom: none;
}

/* Row Highlight when checked (matching Pasang cyan glow) */
.data-table.inv-table-field tr.is-loaded {
  background: rgba(0, 210, 255, 0.08) !important;
}

.data-table.inv-table-field tr.is-loaded td.col-nama {
  color: var(--accent-cyan) !important;
}

/* Touch-optimized tactile checkbox button matching page utama */
.data-table.inv-table-field .inv-checkbox-btn {
  width: 36px !important;
  height: 36px !important;
  min-width: 36px !important;
  max-width: 36px !important;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  border: 1.5px solid var(--border-subtle);
  background: var(--bg-surface-elevated);
  cursor: pointer;
  padding: 0;
  margin: 0 auto;
  position: relative;
  transition: all 180ms cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.data-table.inv-table-field .inv-checkbox-btn:hover {
  border-color: var(--border-strong);
  background: var(--bg-surface-hover);
  transform: scale(1.06);
}

.data-table.inv-table-field .inv-checkbox-btn:active {
  transform: scale(0.92);
}

.data-table.inv-table-field .inv-checkbox-btn .check-svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  stroke-width: 3;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  transform: scale(0);
  transition: transform 160ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Checked state: match Pasang (Loading) button cyan style from main page */
.data-table.inv-table-field .inv-checkbox-btn.checked {
  background: var(--accent-cyan) !important;
  border-color: var(--accent-cyan) !important;
  color: #000 !important;
  box-shadow: 0 0 12px rgba(0, 210, 255, 0.4) !important;
}

.data-table.inv-table-field .inv-checkbox-btn.checked .check-svg {
  transform: scale(1);
}

/* ==========================================================================
   UNIFIED WORKSTATION / MOBILE LOCKOUT SCREEN (Home Harmonized)
   ========================================================================== */
.desktop-lock-screen {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999999;
  background: rgba(18, 18, 18, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  align-items: center;
  justify-content: center;
  padding: var(--space-6);
  text-align: center;
}

.lockout-card {
  max-width: 480px;
  width: 100%;
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-xl);
  padding: var(--space-8) var(--space-6);
  box-shadow: var(--shadow-lg), 0 0 35px rgba(0, 210, 255, 0.08);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
  position: relative;
  z-index: 10;
}

.lockout-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--accent-cyan-subtle);
  color: var(--accent-cyan);
  border: 1px solid rgba(0, 210, 255, 0.3);
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.lockout-badge.lockout-badge-amber {
  background: var(--accent-amber-subtle);
  color: var(--accent-amber);
  border-color: rgba(245, 158, 11, 0.3);
}

.lockout-pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-cyan);
  box-shadow: 0 0 8px var(--accent-cyan);
  animation: pulse-ring-green 2s infinite;
}

.lockout-pulse-dot.pulse-amber {
  background: var(--accent-amber);
  box-shadow: 0 0 8px var(--accent-amber);
}

.lockout-icon {
  font-size: 2.8rem;
  line-height: 1;
  margin: 4px 0;
}

.lockout-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.lockout-desc {
  font-family: var(--font-body);
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.55;
  margin-bottom: var(--space-2);
}

.lockout-telemetry {
  width: 100%;
  background: var(--bg-primary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: var(--space-2);
  text-align: left;
}

.telemetry-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 0.78rem;
}

.telemetry-lbl {
  color: var(--text-muted);
}

.telemetry-val {
  color: var(--text-primary);
  font-weight: 600;
}

.telemetry-warn {
  color: var(--accent-amber);
  font-weight: 700;
}

.lockout-actions {
  display: flex;
  gap: var(--space-3);
  width: 100%;
  flex-direction: column;
}

.lockout-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.lockout-btn-primary {
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-blue));
  color: #000;
  font-weight: 700;
  border: none;
  box-shadow: 0 4px 14px rgba(0, 210, 255, 0.3);
}

.lockout-btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(0, 210, 255, 0.4);
  color: #000;
}

.lockout-btn-secondary {
  background: var(--bg-surface-elevated);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
}

.lockout-btn-secondary:hover {
  background: var(--bg-surface-hover);
  border-color: var(--border-strong);
  color: var(--text-primary);
}




/* ==========================================================================
   ARCHIVE STATUS BANNER (for archive.html & archive/index.html)
   ========================================================================== */
.archive-banner {
  background: linear-gradient(90deg, rgba(245, 158, 11, 0.15) 0%, rgba(0, 210, 255, 0.1) 100%);
  border-bottom: 1px solid var(--accent-amber);
  padding: 12px 16px;
  position: relative;
  z-index: 99;
}

.archive-banner-container {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.archive-banner-content {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.archive-banner-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--accent-amber);
  color: #000;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.archive-banner-text {
  font-family: var(--font-body);
  font-size: 0.88rem;
  color: var(--text-primary);
  margin: 0;
  line-height: 1.4;
}

.archive-banner-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--accent-cyan);
  color: #000;
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: var(--radius-md);
  text-decoration: none;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.archive-banner-btn:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}
