/* ============================================
   KAT MONEY OS — PREMIUM DARK THEME (MISSION CONTROL)
   ============================================ */

:root {
  /* Core Colors */
  --bg: #0f1115;
  --surface: #1a1d23;
  --surface-low: #14171c;
  --surface-high: #242831;
  --border: #2d323d;
  --border-light: #3a3f4b;
  
  /* Accent Colors */
  --primary: #4f46e5;
  --primary-glow: rgba(79, 70, 229, 0.4);
  --secondary: #ec4899;
  --accent: #8b5cf6;
  
  /* Status Colors */
  --success: #10b981;
  --warning: #f59e0b;
  --error: #ef4444;
  --info: #3b82f6;
  
  /* Text */
  --text: #e2e8f0;
  --text-secondary: #94a3b8;
  --text-tertiary: #64748b;
  
  /* Dimensions & Spacing */
  --gap-xs: 4px;
  --gap-sm: 8px;
  --gap-md: 12px;
  --gap-lg: 20px;
  --gap-xl: 32px;
  --radius: 8px;
  --radius-lg: 12px;
  --shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

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

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.app {
  max-width: 1400px;
  margin: 0 auto;
  padding: var(--gap-xl);
}

/* ============================================
   VIEW SWITCHER (GLASSMORPHISM)
   ============================================ */
.view-switcher {
  display: flex;
  justify-content: center;
  gap: var(--gap-sm);
  background: rgba(26, 29, 35, 0.8);
  backdrop-filter: blur(12px);
  padding: 6px;
  border-radius: 100px;
  border: 1px solid var(--border);
  width: fit-content;
  margin: 0 auto var(--gap-xl);
  position: sticky;
  top: 20px;
  z-index: 100;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.view-switcher__btn {
  background: transparent;
  border: none;
  padding: 8px 18px;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 550;
  border-radius: 100px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.view-switcher__btn--active {
  background: var(--surface-high);
  color: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.view-switcher__btn:hover:not(.view-switcher__btn--active) {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
}

/* ============================================
   HEADER
   ============================================ */
.header {
  text-align: left;
  margin-bottom: var(--gap-xl);
  border-bottom: 1px solid var(--border);
  padding-bottom: var(--gap-lg);
}

.header__title {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.header__subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  margin-top: 4px;
}

.header__meta {
  display: flex;
  align-items: center;
  gap: var(--gap-md);
  margin-top: 16px;
}

.meta-item {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-tertiary);
  background: var(--surface-low);
  padding: 2px 8px;
  border-radius: 4px;
  border: 1px solid var(--border);
}

.meta-dot {
  width: 3px;
  height: 3px;
  background: var(--text-tertiary);
  border-radius: 50%;
  opacity: 0.5;
}

/* ============================================
   VIEWS & CARDS
   ============================================ */
.view {
  display: none;
  animation: fadeIn 0.3s ease-out;
}

.view--active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--gap-lg);
  margin-bottom: var(--gap-lg);
  transition: border-color 0.2s;
}

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

.card--approval {
  border-left: 4px solid var(--warning);
}

/* ============================================
   NOTION-STYLE SECTIONS
   ============================================ */
.control-room {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--gap-lg);
}

.kpi-strip {
  display: flex;
  gap: var(--gap-lg);
  margin-bottom: var(--gap-xl);
  overflow-x: auto;
  padding-bottom: 8px;
}

.kpi-item {
  flex: 1;
  min-width: 120px;
  background: var(--surface-low);
  padding: 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.kpi-value {
  font-size: 20px;
  font-weight: 700;
  color: var(--info);
}

.kpi-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-tertiary);
  margin-top: 4px;
}

.secondary-row {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: var(--gap-lg);
}

/* =============================================
   AGENT OFFICE v6 — IMAGE-BASED PIXEL-ART
   Notion Grayscale Chrome + Real Pixel-Art PNGs
   ============================================= */

.agent-office {
  background: #ffffff;
  border: 1px solid #e0e0e0;
  border-radius: 12px;
  padding: 32px;
  min-height: 700px;
}

.agent-office__eyebrow {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: #999;
  margin-bottom: 20px;
  text-align: center;
}

/* === Main Office Scene Container === */
.office-scene {
  position: relative;
  width: 100%;
  height: 600px;
  border: 2px solid #e0e0e0;
  overflow: hidden;
  background: #f5f5f5;
}

/* Background image (isometric pixel-art room) */
.office-scene__bg {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  z-index: 1;
}

/* === Agent Workstation (image-based) === */
.ws {
  position: absolute;
  z-index: 10;
  transition: filter 0.3s, opacity 0.3s;
}

.ws__img {
  width: 180px;
  height: auto;
  display: block;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

/* Kat Main larger */
.ws--main .ws__img {
  width: 220px;
}

/* Inactive: dim & grayscale */
.ws--inactive {
  opacity: 0.3;
  filter: grayscale(100%) brightness(0.8);
}

/* Working: subtle glow */
.ws--working {
  filter: drop-shadow(0 0 4px rgba(0,0,0,0.15));
}

/* Blocked: red tint */
.ws--blocked {
  filter: hue-rotate(-20deg) saturate(1.5);
  animation: wsBlockedPulse 1.5s ease-in-out infinite;
}
@keyframes wsBlockedPulse {
  0%, 100% { filter: hue-rotate(-20deg) saturate(1.5) brightness(1); }
  50% { filter: hue-rotate(-20deg) saturate(2) brightness(1.1); }
}

/* Idle: gentle bob */
.ws--idle {
  animation: wsIdleBob 3s ease-in-out infinite;
}
@keyframes wsIdleBob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}

/* Reviewing: subtle scale pulse */
.ws--reviewing {
  animation: wsReview 4s ease-in-out infinite;
}
@keyframes wsReview {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.02); }
}

/* In meeting: bounce */
.ws--in_meeting {
  animation: wsMeetingBounce 2s ease-in-out infinite;
}
@keyframes wsMeetingBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

/* === Label Layer (overlaid, always readable) === */
.label-layer {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  pointer-events: none;
  z-index: 50;
}

.agent-label {
  position: absolute;
  pointer-events: none;
  text-align: center;
  transform: translate(-50%, 0);
}

.agent-label__name {
  font-size: 11px;
  font-weight: 700;
  color: #333;
  background: #fff;
  padding: 2px 10px;
  border: 1px solid #ddd;
  display: inline-block;
  white-space: nowrap;
  box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}

.agent-label__status {
  display: inline-block;
  padding: 2px 8px;
  font-size: 9px;
  font-weight: 600;
  white-space: nowrap;
  margin-top: 3px;
}

/* Notion-style GRAYSCALE status pills */
.agent-label__status--working {
  background: #e8e8e8;
  color: #333;
  border-left: 3px solid #555;
}
.agent-label__status--idle {
  background: #f0f0f0;
  color: #888;
  border-left: 3px solid #bbb;
}
.agent-label__status--blocked {
  background: #e0e0e0;
  color: #333;
  border-left: 3px solid #333;
  font-weight: 700;
}
.agent-label__status--reviewing {
  background: #eee;
  color: #555;
  border-left: 3px solid #777;
}
.agent-label__status--in_meeting {
  background: #e5e5e5;
  color: #444;
  border-left: 3px solid #666;
}
.agent-label__status--inactive {
  background: #f5f5f5;
  color: #bbb;
  border: 1px dashed #ccc;
}

/* === Meeting Room Overlay === */
.meeting-overlay {
  position: absolute;
  z-index: 5;
  border: 2px dashed #ccc;
  background: rgba(240,240,240,0.3);
  transition: all 0.3s;
}
.meeting-overlay--active {
  border-color: #777;
  background: rgba(200,200,200,0.15);
}
.meeting-overlay__label {
  position: absolute;
  top: 6px; left: 8px;
  font-size: 8px;
  font-weight: 700;
  color: #aaa;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* === Legend (Notion grayscale) === */
.office-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid #e0e0e0;
}
.office-legend__item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: #888;
}
.office-legend__dot {
  width: 10px;
  height: 10px;
}
.office-legend__dot--working { background: #555; }
.office-legend__dot--idle { background: #bbb; }
.office-legend__dot--blocked { background: #333; }
.office-legend__dot--reviewing { background: #777; }
.office-legend__dot--in_meeting { background: #666; }
.office-legend__dot--inactive { background: #e0e0e0; border: 1px dashed #ccc; }

/* Footer */
.footer {
  margin-top: var(--gap-xl);
  text-align: center;
  padding: var(--gap-lg);
  color: var(--text-tertiary);
  font-size: 11px;
}

/* Responsiveness */
@media (max-width: 1000px) {
  .secondary-row { grid-template-columns: 1fr; }
  .office-scene { height: 400px; }
  .ws__img { width: 130px; }
  .ws--main .ws__img { width: 160px; }
}
