/* ==========================================================================
   OCG OS — Enterprise Operating System Design Language
   Authoritative Design System: Spatial, Institutional, AI-Native
   Zero legacy tokens. Pure OCG OS Architecture.
   ========================================================================== */

:root {
  /* Spatial Cosmic Canvas */
  --bg-cosmic: #050A14;
  --bg-canvas: #070F1E;
  --bg-elevated: #0B1322;

  /* Tiered Surfaces */
  --surface-base: #0B1322;
  --surface-card: #101A2E;
  --surface-elevated: #16233B;
  --surface-hover: #1D2D49;
  --surface-active: #243758;
  
  /* Hairline Precision Borders */
  --border-subtle: rgba(255, 255, 255, 0.07);
  --border-medium: rgba(255, 255, 255, 0.14);
  --border-highlight: rgba(37, 99, 235, 0.4);
  --border-focus: rgba(59, 130, 246, 0.65);

  /* Primary Brand & Executive Energy (Royal Blue) */
  --blue-primary: #2563EB;
  --blue-secondary: #3B82F6;
  --blue-dark: #1D4ED8;
  --blue-electric: #60A5FA;
  --blue-sky: #93C5FD;
  --blue-glow: rgba(37, 99, 235, 0.25);
  --blue-luminescent: rgba(59, 130, 246, 0.15);

  /* Operational & Governance Colors */
  --emerald-verified: #10B981;
  --emerald-glow: rgba(16, 185, 129, 0.25);
  --amber-attention: #F59E0B;
  --amber-glow: rgba(245, 158, 11, 0.25);
  --coral-alert: #EF4444;
  --coral-glow: rgba(239, 68, 68, 0.25);

  /* Typography */
  --text-primary: #FFFFFF;
  --text-secondary: #94A3B8;
  --text-muted: #64748B;
  --text-inverse: #050A14;

  --font-main: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: "SF Mono", Monaco, "Consolas", "Liberation Mono", monospace;

  /* Motion Tokens */
  --motion-micro: 120ms cubic-bezier(0.16, 1, 0.3, 1);
  --motion-panel: 200ms cubic-bezier(0.16, 1, 0.3, 1);
  --motion-workspace: 320ms cubic-bezier(0.16, 1, 0.3, 1);
  --motion-spring: 400ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

html, body {
  width: 100%;
  height: 100%;
  background-color: var(--bg-cosmic);
  color: var(--text-primary);
  font-family: var(--font-main);
  font-size: 14px;
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Tabular Numerals for Financial Accuracy */
.tabular-nums, .metric-value, .ocg-kpi-value, td.num {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: var(--bg-cosmic);
}
::-webkit-scrollbar-thumb {
  background: var(--surface-elevated);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--blue-primary);
}

/* ==========================================================================
   Base Layout & App Shell
   ========================================================================== */

#app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: radial-gradient(1200px circle at 50% -10%, rgba(37, 99, 235, 0.07), transparent 70%), var(--bg-cosmic);
}

.ocg-shell-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  width: 100%;
}

/* Top Intelligence Header */
.ocg-top-header {
  height: 64px;
  background: rgba(7, 15, 30, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 1000;
  gap: 16px;
}

.ocg-main-layout {
  display: flex;
  flex: 1;
  min-height: 0;
  position: relative;
  overflow: hidden;
}

/* Sidebar Navigation */
.ocg-sidebar {
  width: 260px;
  background: var(--surface-base);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  padding: 16px 12px;
  flex-shrink: 0;
  overflow-y: auto;
  user-select: none;
}

.ocg-sidebar-section-label {
  font-size: 10px;
  font-weight: 800;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1.2px;
  padding: 12px 14px 6px;
}

.ocg-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 14px;
  border-radius: 8px;
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  font-size: 13px;
  transition: background var(--motion-micro), color var(--motion-micro), border-color var(--motion-micro);
  cursor: pointer;
  margin-bottom: 2px;
  border: 1px solid transparent;
}

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

.ocg-nav-item.active {
  background: var(--blue-primary);
  color: #FFFFFF;
  font-weight: 700;
  box-shadow: 0 2px 12px rgba(37, 99, 235, 0.35);
}

.ocg-nav-item.active .ocg-nav-icon {
  color: #FFFFFF;
}

.ocg-nav-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  font-size: 14px;
}

/* Workspace Canvas Container */
.ocg-workspace-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
  background: var(--bg-canvas);
  position: relative;
  overflow-y: auto;
}

.content-scroll {
  padding: 24px 32px;
  flex: 1;
  min-height: 0;
  animation: ocg-fade-in var(--motion-workspace) ease;
}

/* ==========================================================================
   Persistent Aiden Executive Command Rail & Ambient Intelligence Dock
   ========================================================================== */

.ocg-aiden-rail {
  width: 360px;
  background: var(--surface-base);
  border-left: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  transition: transform var(--motion-panel), width var(--motion-panel);
  position: relative;
  z-index: 900;
  overflow-y: auto;
}

.ocg-aiden-rail.collapsed {
  width: 52px;
}

.ocg-aiden-rail-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface-card);
}

.ocg-aiden-pulse-node {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--emerald-verified);
  box-shadow: 0 0 10px var(--emerald-verified);
  position: relative;
}

.ocg-aiden-pulse-node.thinking {
  background: var(--blue-secondary);
  box-shadow: 0 0 12px var(--blue-secondary);
  animation: ocg-pulse-blue 1.5s infinite ease-in-out;
}

.ocg-aiden-pulse-node.delegating {
  background: var(--amber-attention);
  box-shadow: 0 0 12px var(--amber-attention);
  animation: ocg-pulse-amber 1.2s infinite ease-in-out;
}

.ocg-aiden-pulse-node.action-ready {
  background: var(--blue-electric);
  box-shadow: 0 0 14px var(--blue-electric);
}

/* Aiden Executive Composer */
.ocg-aiden-composer {
  padding: 16px;
  border-top: 1px solid var(--border-subtle);
  background: var(--surface-card);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ocg-aiden-input-box {
  display: flex;
  gap: 8px;
  position: relative;
}

.ocg-aiden-input {
  flex: 1;
  background: var(--surface-base);
  border: 1px solid var(--border-medium);
  border-radius: 8px;
  padding: 10px 14px;
  color: #FFFFFF;
  font-size: 13px;
  font-family: var(--font-main);
  outline: none;
  transition: border-color var(--motion-micro), box-shadow var(--motion-micro);
}

.ocg-aiden-input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

.ocg-aiden-prompt-chip {
  background: var(--surface-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--blue-sky);
  padding: 6px 11px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--motion-micro);
  text-decoration: none;
}

.ocg-aiden-prompt-chip:hover {
  background: var(--surface-hover);
  border-color: var(--blue-secondary);
  color: #FFFFFF;
}

/* ==========================================================================
   Spatial Cards, Panels & Metrics
   ========================================================================== */

.ocg-card {
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 22px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
  transition: border-color var(--motion-micro), transform var(--motion-micro);
}

.ocg-card:hover {
  border-color: var(--border-medium);
}

.ocg-hero-banner {
  background: linear-gradient(135deg, #0F1D32 0%, #081220 100%);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 26px 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
}

/* Buttons */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all var(--motion-micro);
  text-decoration: none;
  white-space: nowrap;
}

.button.primary {
  background: var(--blue-primary);
  color: #FFFFFF;
  border: none;
  box-shadow: 0 2px 10px rgba(37, 99, 235, 0.35);
}

.button.primary:hover {
  background: var(--blue-dark);
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.5);
  transform: translateY(-1px);
}

.button.secondary {
  background: var(--surface-elevated);
  color: #F4F7F8;
  border: 1px solid var(--border-medium);
}

.button.secondary:hover {
  background: var(--surface-hover);
  border-color: rgba(255, 255, 255, 0.3);
  color: #FFFFFF;
}

.button.danger {
  background: var(--coral-alert);
  color: #FFFFFF;
}

.button.danger:hover {
  background: #DC2626;
}

/* Key Operational Badges */
.ocg-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}

.ocg-badge.pursue {
  background: rgba(16, 185, 129, 0.15);
  color: var(--emerald-verified);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.ocg-badge.condition {
  background: rgba(245, 158, 11, 0.15);
  color: var(--amber-attention);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.ocg-badge.hold {
  background: rgba(59, 130, 246, 0.15);
  color: var(--blue-secondary);
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.ocg-badge.kill {
  background: rgba(239, 68, 68, 0.15);
  color: var(--coral-alert);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

/* Keyframe Animations */
@keyframes ocg-fade-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes ocg-pulse-blue {
  0%, 100% { box-shadow: 0 0 6px rgba(59, 130, 246, 0.4); }
  50% { box-shadow: 0 0 16px rgba(59, 130, 246, 0.8); }
}

@keyframes ocg-pulse-amber {
  0%, 100% { box-shadow: 0 0 6px rgba(245, 158, 11, 0.4); }
  50% { box-shadow: 0 0 16px rgba(245, 158, 11, 0.8); }
}

/* ==========================================================================
   Responsive Viewport Overrides
   ========================================================================== */

/* Tablet (768px - 1024px) */
@media (max-width: 1024px) {
  .ocg-sidebar {
    width: 220px;
  }
  .ocg-aiden-rail {
    width: 320px;
  }
  .content-scroll {
    padding: 20px;
  }
}

/* Mobile & Small Tablet (<= 768px) */
@media (max-width: 768px) {
  .ocg-main-layout {
    flex-direction: column !important;
  }
  
  .ocg-sidebar {
    width: 100% !important;
    height: 48px !important;
    flex-direction: row !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    padding: 6px 12px !important;
    border-right: none !important;
    border-bottom: 1px solid var(--border-subtle) !important;
    -webkit-overflow-scrolling: touch;
  }

  .ocg-sidebar-section-label {
    display: none !important;
  }

  .ocg-nav-item {
    white-space: nowrap !important;
    padding: 6px 12px !important;
    font-size: 12px !important;
  }

  .ocg-top-header {
    height: 54px !important;
    padding: 0 14px !important;
  }

  .ocg-aiden-rail {
    display: none; /* Accessible via header button drawer */
  }

  .content-scroll {
    padding: 16px 12px !important;
  }
}

/* ==========================================================================
   Aiden Executive Experience Responsive Rules (Zero Waste, Full-Width)
   ========================================================================== */
.aiden-executive-viewport {
  width: 100%;
  animation: ocg-fade-in 200ms ease;
}

.aiden-grid-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) minmax(360px, 1.1fr);
  gap: 16px;
  width: 100%;
  align-items: start;
}

@media (max-width: 1100px) {
  .aiden-grid-layout {
    grid-template-columns: 1fr !important;
  }
}

@keyframes aiden-pulse-ring {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.6); opacity: 0; }
  100% { transform: scale(1.6); opacity: 0; }
}

.aiden-mode-tab:hover,
.aiden-surface-tab:hover {
  background: rgba(37, 99, 235, 0.2) !important;
  color: #FFFFFF !important;
}

.aiden-quick-link:hover {
  color: #60A5FA !important;
}

@media (max-width: 768px) {
  .aiden-hud-strip {
    padding: 12px 14px !important;
    gap: 10px !important;
  }
  .aiden-hud-strip > div {
    width: 100%;
    justify-content: space-between;
  }
  .aiden-primary-focus {
    padding: 18px !important;
  }
  .aiden-command-dock {
    padding: 12px 14px !important;
    border-radius: 12px 12px 0 0 !important;
  }
  .aiden-command-dock form input {
    font-size: 12px !important;
    padding: 12px 14px 12px 38px !important;
  }
}

/* ==========================================================================
   Aiden Living Presence & Executive Voice HUD
   ========================================================================== */
@keyframes aiden-orb-breathe {
  0%, 100% { transform: scale(1); box-shadow: 0 0 35px rgba(59, 130, 246, 0.35); }
  50% { transform: scale(1.05); box-shadow: 0 0 55px rgba(59, 130, 246, 0.55); }
}

@keyframes aiden-orb-listening {
  0%, 100% { transform: scale(1); box-shadow: 0 0 45px rgba(56, 189, 248, 0.5); }
  50% { transform: scale(1.1); box-shadow: 0 0 75px rgba(56, 189, 248, 0.85); }
}

@keyframes aiden-orb-speaking {
  0%, 100% { transform: scale(1); box-shadow: 0 0 45px rgba(16, 185, 129, 0.5); }
  50% { transform: scale(1.12); box-shadow: 0 0 85px rgba(16, 185, 129, 0.9); }
}

@keyframes aiden-orb-thinking {
  0%, 100% { transform: scale(1); box-shadow: 0 0 40px rgba(245, 158, 11, 0.5); }
  50% { transform: scale(1.08); box-shadow: 0 0 70px rgba(245, 158, 11, 0.8); }
}

@keyframes aiden-fade-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.aiden-orb-sleeping {
  animation: aiden-orb-breathe 4s ease-in-out infinite;
}

.aiden-orb-listening {
  animation: aiden-orb-listening 1.8s ease-in-out infinite;
  background: radial-gradient(circle at 35% 35%, #38BDF8, #0284C7 70%, #0369A1) !important;
}

.aiden-orb-speaking {
  animation: aiden-orb-speaking 1.4s ease-in-out infinite;
  background: radial-gradient(circle at 35% 35%, #34D399, #059669 70%, #047857) !important;
}

.aiden-orb-thinking,
.aiden-orb-delegating {
  animation: aiden-orb-thinking 1.6s ease-in-out infinite;
  background: radial-gradient(circle at 35% 35%, #FBBF24, #D97706 70%, #B45309) !important;
}

.aiden-orb-interrupted {
  transform: scale(0.96);
  box-shadow: 0 0 25px rgba(245, 158, 11, 0.6) !important;
}

.aiden-orb-muted {
  filter: grayscale(1);
  opacity: 0.6;
}

.aiden-review-btn:hover {
  background: #1D4ED8 !important;
  transform: translateY(-1px);
}

.aiden-secondary-toggle:hover {
  color: #94A3B8 !important;
}


