/* =========================================================
   Ai-de Orchestrator - 3D Orthographic Live Virtual Office
   Aesthetics: 3D Isometric Projection, Ambient Cyber Glow,
   Real-Time Animated Desks & Flying Document Particles
   ========================================================= */

.office-viewport {
    position: relative;
    width: 100%;
    height: calc(100vh - 128px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: radial-gradient(circle at 50% 10%, rgba(30, 27, 75, 0.45) 0%, rgba(10, 14, 26, 0.95) 75%);
    border-radius: var(--radius-md);
    margin-top: 8px;
    border: 1px solid rgba(139, 92, 246, 0.2);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
}

.office-viewport.hidden {
    display: none !important;
}

/* =========================================================
   Top Office HUD (Heads-Up Display & Command Bar)
   ========================================================= */
.office-hud-bar {
    position: relative;
    z-index: 40;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 20px;
    background: rgba(13, 18, 32, 0.85);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    gap: 16px;
    flex-wrap: wrap;
}

.hud-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.hud-brand-pill {
    display: flex;
    align-items: center;
    gap: 18px;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.15), rgba(6, 182, 212, 0.15));
    border: 1px solid rgba(139, 92, 246, 0.35);
    padding: 8px 26px;
    border-radius: var(--radius-full);
}

.hud-pulse-dot {
    position: relative;
    width: 10px;
    height: 10px;
    background: #10b981;
    border-radius: 50%;
    box-shadow: 0 0 10px #10b981;
}

.hud-pulse-dot::after {
    content: '';
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    border-radius: 50%;
    border: 2px solid #10b981;
    animation: radarPulse 2s infinite ease-out;
}

@keyframes radarPulse {
    0% {
        transform: scale(0.6);
        opacity: 1;
    }

    100% {
        transform: scale(2.2);
        opacity: 0;
    }
}

.hud-title-group h3 {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-high);
    margin: 0;
    display: flex;
    align-items: center;
}

.hud-title-group span {
    font-size: 0.7rem;
    color: var(--text-mid);
}

.hud-center-stats {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.hud-stat-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: rgba(18, 24, 42, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-full);
    font-size: 0.72rem;
    color: var(--text-mid);
    backdrop-filter: blur(8px);
}

.hud-stat-chip strong {
    font-family: var(--font-mono);
    color: var(--text-high);
}

.hud-stat-chip.active-busy {
    border-color: rgba(16, 185, 129, 0.4);
    background: rgba(16, 185, 129, 0.1);
    color: #6ee7b7;
}

.hud-stat-chip.active-busy strong {
    color: #a7f3d0;
}

.hud-stat-chip.stream-docs {
    border-color: rgba(6, 182, 212, 0.4);
    background: rgba(6, 182, 212, 0.1);
    color: #67e8f9;
}

.hud-stat-chip.stream-docs strong {
    color: #a5f3fc;
}

.hud-right-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-hud {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    font-size: 0.75rem;
    font-weight: 600;
    background: rgba(26, 33, 56, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-sm);
    color: var(--text-high);
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-hud:hover {
    background: rgba(38, 48, 80, 0.9);
    border-color: rgba(139, 92, 246, 0.45);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.2);
}

.btn-hud.active {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.3), rgba(6, 182, 212, 0.3));
    border-color: rgba(139, 92, 246, 0.6);
    color: #fff;
    box-shadow: 0 0 12px rgba(139, 92, 246, 0.35);
}

.btn-hud-icon {
    font-size: 0.85rem;
}

/* =========================================================
   3D Orthographic Stage Viewport
   ========================================================= */
.office-stage-viewport {
    position: relative;
    flex: 1;
    width: 100%;
    overflow: hidden;
    cursor: grab;
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
}

.office-stage-viewport.css-2d-mode {
    perspective: 1600px;
    perspective-origin: 50% 45%;
}

.office-stage-viewport:active {
    cursor: grabbing;
}

/* Real WebGL 3D Canvas (Three.js) */
.office-three-canvas {
    position: absolute;
    inset: 0;
    width: 100% !important;
    height: 100% !important;
    display: block;
    z-index: 10;
    outline: none;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

/* 3D Interactive Hover Popover Card */
.office-3d-hover-card {
    position: absolute;
    pointer-events: none;
    z-index: 100;
    transform: translate(-50%, -100%) translateY(-14px);
    transition: opacity 0.15s ease, transform 0.15s ease;
    background: rgba(13, 18, 32, 0.96);
    border: 1.5px solid rgba(139, 92, 246, 0.45);
    border-radius: var(--radius-md);
    padding: 10px 14px;
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.8), 0 0 25px rgba(139, 92, 246, 0.3);
    min-width: 220px;
}

.office-3d-hover-card.hidden {
    opacity: 0;
    visibility: hidden;
    transform: translate(-50%, -100%) translateY(-6px);
}

.hover-card-inner {
    display: flex;
    align-items: center;
    gap: 12px;
}

.hover-card-avatar {
    width: 42px;
    height: 42px;
    border-radius: var(--radius-sm);
    background: rgba(139, 92, 246, 0.15);
    border: 1px solid rgba(139, 92, 246, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.hover-card-info h4 {
    margin: 0 0 2px 0;
    font-size: 0.88rem;
    font-weight: 700;
    color: #ffffff;
}

.hover-card-role {
    display: block;
    font-size: 0.72rem;
    color: #c4b5fd;
    margin-bottom: 4px;
}

.hover-card-status {
    display: inline-block;
    font-size: 0.68rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    background: rgba(16, 185, 129, 0.2);
    color: #6ee7b7;
    border: 1px solid rgba(16, 185, 129, 0.4);
}

/* Background Atmospheric Grid */
.office-ambient-backdrop {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background-image:
        radial-gradient(circle at 50% 50%, rgba(139, 92, 246, 0.08) 0%, transparent 60%),
        linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    background-size: 100% 100%, 40px 40px, 40px 40px;
    background-position: center center;
    z-index: 1;
}

/* The 3D Rotating Floor Plane */
.office-isometric-plane {
    position: relative;
    width: 1350px;
    height: 900px;
    transform-style: preserve-3d;
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    transform-origin: center center;
    z-index: 2;
}

/* Isometric Mode (Default) */
.office-isometric-plane.mode-3d {
    transform: rotateX(58deg) rotateZ(-45deg);
}

/* 2D Top-Down Mode */
.office-isometric-plane.mode-2d {
    transform: rotateX(0deg) rotateZ(0deg);
}

/* Main Floor Base Board with 3D Depth */
.office-floor-base {
    position: absolute;
    inset: 0;
    background: #090e1c;
    border-radius: 28px;
    border: 2px solid rgba(139, 92, 246, 0.35);
    box-shadow:
        0 40px 80px rgba(0, 0, 0, 0.8),
        0 0 45px rgba(139, 92, 246, 0.15),
        inset 0 0 60px rgba(10, 15, 30, 0.8);
    overflow: hidden;
}

/* Floor Grid Tiles */
.office-floor-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(139, 92, 246, 0.08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(139, 92, 246, 0.08) 1px, transparent 1px);
    background-size: 45px 45px;
    opacity: 0.8;
}

/* Illuminated Floor Walkways / Corridors */
.floor-pathway-horizontal,
.floor-pathway-vertical {
    position: absolute;
    background: rgba(139, 92, 246, 0.05);
    border: 1px dashed rgba(139, 92, 246, 0.2);
    pointer-events: none;
}

.floor-pathway-horizontal {
    left: 40px;
    right: 40px;
    top: 50%;
    height: 90px;
    transform: translateY(-50%);
    border-left: none;
    border-right: none;
}

.floor-pathway-vertical {
    top: 40px;
    bottom: 40px;
    left: 50%;
    width: 90px;
    transform: translateX(-50%);
    border-top: none;
    border-bottom: none;
}

/* =========================================================
   Inter-Desk Communication Network Overlay
   Subtle Faint Lines (Göze batmayan hayali çizgiler)
   ========================================================= */
.office-network-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 5;
    overflow: visible;
}

.network-link-line {
    stroke: rgba(148, 163, 184, 0.12);
    stroke-width: 1.5;
    stroke-dasharray: 4, 6;
    transition: stroke 0.4s ease, stroke-width 0.4s ease, filter 0.4s ease;
}

.network-link-line.active-communicating {
    stroke: #06b6d4;
    stroke-width: 2.5;
    stroke-dasharray: 8, 4;
    filter: drop-shadow(0 0 6px #06b6d4);
    animation: lineDashTravel 0.8s linear infinite;
}

@keyframes lineDashTravel {
    to {
        stroke-dashoffset: -24;
    }
}

/* =========================================================
   Office Department Zones
   ========================================================= */
.office-department-zone {
    position: absolute;
    border-radius: 18px;
    padding: 16px;
    transition: all 0.3s ease;
    transform-style: preserve-3d;
}

.zone-header-tag {
    position: absolute;
    top: 10px;
    left: 14px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    pointer-events: none;
    z-index: 5;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    transform: translateZ(5px);
}

/* 1. Patron & Executive Suite (Top-Center / Corner) */
.zone-patron-suite {
    top: 30px;
    left: 30px;
    width: 480px;
    height: 380px;
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.08), rgba(139, 92, 246, 0.08));
    border: 1.5px solid rgba(245, 158, 11, 0.4);
    box-shadow: 0 0 35px rgba(245, 158, 11, 0.15);
}

.zone-patron-suite .zone-header-tag {
    background: rgba(245, 158, 11, 0.2);
    border: 1px solid rgba(245, 158, 11, 0.5);
    color: #fde68a;
}

/* 2. Tech & R&D Hub (Right Wing) */
.zone-tech-hub {
    top: 30px;
    right: 30px;
    width: 680px;
    height: 380px;
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.08), rgba(99, 102, 241, 0.08));
    border: 1.5px solid rgba(6, 182, 212, 0.35);
    box-shadow: 0 0 35px rgba(6, 182, 212, 0.12);
}

.zone-tech-hub .zone-header-tag {
    background: rgba(6, 182, 212, 0.2);
    border: 1px solid rgba(6, 182, 212, 0.45);
    color: #a5f3fc;
}

/* 3. Finance & Wolvox ERP Wing (Bottom-Left) */
.zone-finance-wing {
    bottom: 30px;
    left: 30px;
    width: 480px;
    height: 420px;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.08), rgba(5, 150, 105, 0.08));
    border: 1.5px solid rgba(16, 185, 129, 0.35);
    box-shadow: 0 0 35px rgba(16, 185, 129, 0.12);
}

.zone-finance-wing .zone-header-tag {
    background: rgba(16, 185, 129, 0.2);
    border: 1px solid rgba(16, 185, 129, 0.45);
    color: #a7f3d0;
}

/* 4. HR, Operations & Legal Hub (Bottom-Right) */
.zone-ops-hub {
    bottom: 30px;
    right: 30px;
    width: 680px;
    height: 420px;
    background: linear-gradient(135deg, rgba(236, 72, 153, 0.08), rgba(168, 85, 247, 0.08));
    border: 1.5px solid rgba(236, 72, 153, 0.35);
    box-shadow: 0 0 35px rgba(236, 72, 153, 0.12);
}

.zone-ops-hub .zone-header-tag {
    background: rgba(236, 72, 153, 0.2);
    border: 1px solid rgba(236, 72, 153, 0.45);
    color: #fbcfe8;
}

/* =========================================================
   Inter-Desk Communication Network Overlay (Subtle Links)
   ========================================================= */
.office-network-svg {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 4;
}

.network-link-line {
    stroke: rgba(139, 92, 246, 0.32);
    stroke-width: 1.5;
    stroke-dasharray: 5 6;
    stroke-linecap: round;
    transition: stroke 0.4s ease, stroke-width 0.4s ease, opacity 0.4s ease;
    fill: none;
    opacity: 0.85;
}

.network-link-line.link-to-patron {
    stroke: rgba(167, 139, 250, 0.36);
    stroke-dasharray: 6 5;
    opacity: 0.9;
}

.network-link-line.link-peer {
    stroke: rgba(56, 189, 248, 0.24);
    stroke-dasharray: 4 6;
    opacity: 0.75;
}

.network-link-line.active-communicating {
    stroke: url(#netPulseGradient) !important;
    stroke-width: 2.8 !important;
    stroke-dasharray: 8 4 !important;
    filter: url(#netGlow) !important;
    opacity: 1 !important;
    animation: lineDashTravel 0.8s linear infinite;
}

@keyframes lineDashTravel {
    to {
        stroke-dashoffset: -24px;
    }
}

/* =========================================================
   Workstations & Desks (3D Isometric Volumetric Elements)
   ========================================================= */
.office-workstation {
    position: absolute;
    width: 150px;
    height: 110px;
    transform-style: preserve-3d;
    cursor: pointer;
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.office-workstation:hover {
    transform: translateZ(12px) scale(1.03);
}

/* 3D Floor Shadow beneath desk */
.desk-3d-floor-shadow {
    position: absolute;
    left: 10px;
    top: 15px;
    width: 130px;
    height: 75px;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 12px;
    filter: blur(8px);
    transform: translateZ(1px);
    pointer-events: none;
}

/* 3D Table Legs */
.desk-3d-leg {
    position: absolute;
    width: 5px;
    height: 24px;
    background: linear-gradient(180deg, #475569, #0f172a);
    border-radius: 2px;
    transform: rotateX(-90deg) translateZ(-12px);
    transform-origin: top center;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.9);
    pointer-events: none;
}

.desk-3d-leg.leg-fl {
    left: 16px;
    top: 82px;
}

.desk-3d-leg.leg-fr {
    left: 124px;
    top: 82px;
}

.desk-3d-leg.leg-bl {
    left: 16px;
    top: 20px;
}

.desk-3d-leg.leg-br {
    left: 124px;
    top: 20px;
}

/* 3D Volumetric Desk Surface (Elevated at Z=24px) */
.desk-3d-surface {
    position: absolute;
    left: 10px;
    top: 15px;
    width: 130px;
    height: 75px;
    transform: translateZ(24px);
    transform-style: preserve-3d;
    background: linear-gradient(135deg, #1e293b, #0f172a);
    border-radius: 8px;
    border: 1.5px solid rgba(255, 255, 255, 0.16);
    box-shadow:
        0 16px 36px rgba(0, 0, 0, 0.75),
        inset 0 1px 2px rgba(255, 255, 255, 0.2);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 6px;
}

/* Solid Thickness Lips */
.desk-surface-front-lip {
    position: absolute;
    left: 0;
    bottom: -6px;
    width: 100%;
    height: 6px;
    background: linear-gradient(180deg, #0f172a, #020617);
    border-radius: 0 0 4px 4px;
    transform: rotateX(-90deg) translateZ(-3px);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.desk-surface-side-lip {
    position: absolute;
    right: -6px;
    top: 0;
    width: 6px;
    height: 100%;
    background: linear-gradient(90deg, #0f172a, #020617);
    border-radius: 0 4px 4px 0;
    transform: rotateY(90deg) translateZ(3px);
}

/* Department Accent Borders for 3D Desk */
.desk-3d-surface.patron-desk {
    background: linear-gradient(135deg, #312e81, #1e1b4b);
    border-color: rgba(245, 158, 11, 0.65);
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.8), 0 0 25px rgba(245, 158, 11, 0.35);
}

.desk-3d-surface.tech-desk {
    border-color: rgba(6, 182, 212, 0.55);
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.8), 0 0 22px rgba(6, 182, 212, 0.25);
}

.desk-3d-surface.finance-desk {
    border-color: rgba(16, 185, 129, 0.55);
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.8), 0 0 22px rgba(16, 185, 129, 0.25);
}

.desk-3d-surface.hr-desk {
    border-color: rgba(236, 72, 153, 0.55);
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.8), 0 0 22px rgba(236, 72, 153, 0.25);
}

/* 3D Monitors Standing Upright on the Desk Surface */
.desk-3d-monitors {
    position: absolute;
    top: 6px;
    left: 50%;
    transform: translateX(-50%) translateZ(4px) rotateZ(45deg) rotateX(-58deg);
    display: flex;
    align-items: flex-end;
    gap: 6px;
    transform-style: preserve-3d;
    z-index: 15;
}

.desk-screen {
    width: 32px;
    height: 22px;
    background: #020617;
    border: 1.5px solid rgba(255, 255, 255, 0.25);
    border-radius: 3px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 0 12px rgba(6, 182, 212, 0.35), 0 6px 12px rgba(0, 0, 0, 0.8);
}

.desk-screen.wide-screen {
    width: 56px;
    height: 26px;
    border-color: rgba(245, 158, 11, 0.55);
    box-shadow: 0 0 16px rgba(245, 158, 11, 0.4), 0 6px 14px rgba(0, 0, 0, 0.8);
}

.screen-stand {
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    width: 6px;
    height: 6px;
    background: #334155;
    border-radius: 1px;
}

.screen-code-lines {
    position: absolute;
    inset: 1px;
    background: repeating-linear-gradient(0deg,
            rgba(6, 182, 212, 0.85) 0px,
            rgba(6, 182, 212, 0.85) 2px,
            transparent 2px,
            transparent 5px);
    opacity: 0.75;
    animation: screenScan 3s linear infinite;
}

.desk-screen.patron-screen .screen-code-lines {
    background: repeating-linear-gradient(0deg,
            rgba(245, 158, 11, 0.85) 0px,
            rgba(245, 158, 11, 0.85) 2px,
            transparent 2px,
            transparent 5px);
}

.desk-screen.finance-screen .screen-code-lines {
    background: repeating-linear-gradient(0deg,
            rgba(16, 185, 129, 0.85) 0px,
            rgba(16, 185, 129, 0.85) 2px,
            transparent 2px,
            transparent 5px);
}

@keyframes screenScan {
    0% {
        transform: translateY(0);
    }

    100% {
        transform: translateY(-10px);
    }
}

/* Desk Props Row (Keyboard & Coffee Cup) */
.desk-3d-props {
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%) translateZ(2px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 85px;
}

.desk-keyboard {
    width: 44px;
    height: 10px;
    background: #090d16;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 2px;
}

.desk-coffee-cup {
    position: relative;
    font-size: 0.85rem;
    cursor: default;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.6));
}

.cup-steam {
    position: absolute;
    top: -6px;
    left: 3px;
    width: 4px;
    height: 8px;
    background: rgba(255, 255, 255, 0.45);
    border-radius: 50%;
    filter: blur(1.5px);
    animation: cupSteamFloat 2s infinite ease-out;
}

@keyframes cupSteamFloat {
    0% {
        transform: translateY(0) scaleX(1);
        opacity: 0.8;
    }

    100% {
        transform: translateY(-10px) scaleX(2);
        opacity: 0;
    }
}

/* 3D Ergonomic Office Chair */
.chair-3d {
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    transform-style: preserve-3d;
    z-index: 8;
}

.chair-base-wheel {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #050811;
    border: 1.5px solid rgba(255, 255, 255, 0.15);
    transform: translateZ(1px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.7);
}

.chair-seat-cushion {
    position: absolute;
    top: 4px;
    left: 4px;
    width: 28px;
    height: 28px;
    border-radius: 7px;
    background: linear-gradient(135deg, #1e293b, #0f172a);
    border: 1px solid rgba(255, 255, 255, 0.15);
    transform: translateZ(14px);
}

.chair-backrest {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%) translateZ(24px) rotateZ(45deg) rotateX(-58deg);
    width: 26px;
    height: 24px;
    border-radius: 7px;
    background: linear-gradient(180deg, #334155, #0f172a);
    border: 1.5px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.7);
}

/* 3D Seated Character (Standing Upright facing camera in 3D Space) */
.employee-3d-character {
    position: absolute;
    bottom: -2px;
    left: 50%;
    transform: translateX(-50%) translateZ(18px) rotateZ(45deg) rotateX(-58deg);
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 12;
    transform-style: preserve-3d;
    pointer-events: none;
}

.char-head-wrapper {
    position: relative;
    z-index: 15;
    transition: transform 0.2s ease;
}

.char-svg-head {
    display: flex;
    align-items: center;
    justify-content: center;
    filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.7));
}

.char-torso {
    width: 34px;
    height: 22px;
    border-radius: 8px 8px 4px 4px;
    margin-top: -6px;
    background: linear-gradient(180deg, #334155, #1e293b);
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.6);
    z-index: 10;
}

.char-torso.torso-patron {
    background: linear-gradient(180deg, #4f46e5, #312e81);
    border-color: rgba(245, 158, 11, 0.5);
}

.char-torso.torso-tech {
    background: linear-gradient(180deg, #0891b2, #0e7490);
    border-color: rgba(6, 182, 212, 0.5);
}

.char-torso.torso-finance {
    background: linear-gradient(180deg, #059669, #047857);
    border-color: rgba(16, 185, 129, 0.5);
}

.char-torso.torso-ops {
    background: linear-gradient(180deg, #be185d, #9d174d);
    border-color: rgba(236, 72, 153, 0.5);
}

.char-hands-typing {
    position: absolute;
    bottom: 22px;
    width: 38px;
    display: flex;
    justify-content: space-between;
    z-index: 18;
}

.char-hand {
    width: 7px;
    height: 7px;
    background: #fed7aa;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

/* 3D Floating Nameplate (Standing Upright facing camera) */
.desk-3d-nameplate {
    position: absolute;
    top: -14px;
    left: 50%;
    transform: translateX(-50%) translateZ(78px) rotateZ(45deg) rotateX(-58deg);
    background: rgba(9, 13, 24, 0.94);
    border: 1.5px solid rgba(255, 255, 255, 0.2);
    padding: 3px 10px;
    border-radius: var(--radius-full);
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.75), 0 0 16px rgba(139, 92, 246, 0.25);
    z-index: 25;
    pointer-events: none;
}

.desk-3d-person-name {
    font-size: 0.74rem;
    font-weight: 700;
    color: #f8fafc;
}

.desk-3d-person-role {
    font-size: 0.65rem;
    color: #c4b5fd;
}

/* 3D Floating Status Pill (Standing Upright facing camera) */
.desk-3d-status-bubble {
    position: absolute;
    top: -38px;
    left: 50%;
    transform: translateX(-50%) translateZ(98px) rotateZ(45deg) rotateX(-58deg);
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-size: 0.65rem;
    font-weight: 700;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 5px;
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.75);
    z-index: 26;
    pointer-events: none;
}

.desk-3d-status-bubble.status-idle {
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid rgba(148, 163, 184, 0.35);
    color: #cbd5e1;
}

.desk-3d-status-bubble.status-busy {
    background: rgba(16, 185, 129, 0.25);
    border: 1.5px solid rgba(16, 185, 129, 0.8);
    color: #6ee7b7;
    box-shadow: 0 0 16px rgba(16, 185, 129, 0.4);
    animation: pulseWorking 2s infinite ease-in-out;
}

.desk-3d-status-bubble.status-director {
    background: rgba(245, 158, 11, 0.25);
    border: 1.5px solid rgba(245, 158, 11, 0.8);
    color: #fde68a;
    box-shadow: 0 0 16px rgba(245, 158, 11, 0.4);
}

@keyframes pulseWorking {

    0%,
    100% {
        box-shadow: 0 0 12px rgba(16, 185, 129, 0.35);
        border-color: rgba(16, 185, 129, 0.8);
    }

    50% {
        box-shadow: 0 0 24px rgba(16, 185, 129, 0.85);
        border-color: rgba(52, 211, 153, 1);
        transform: translateX(-50%) translateZ(102px) rotateZ(45deg) rotateX(-58deg) scale(1.04);
    }
}

/* Active Working Desk Animation (2D & 3D CSS) */
.office-workstation.desk-working .desk-3d-surface {
    border-color: rgba(16, 185, 129, 0.85) !important;
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.8), 0 0 28px rgba(16, 185, 129, 0.5) !important;
}

.office-workstation.desk-working .screen-code-lines {
    animation: screenScan 0.7s linear infinite !important;
    opacity: 1 !important;
}

.char-active-busy .char-hands-typing .char-hand.hand-left {
    animation: handTypingFast 0.16s infinite alternate ease-in-out;
}

.char-active-busy .char-hands-typing .char-hand.hand-right {
    animation: handTypingFast 0.16s infinite alternate-reverse ease-in-out;
}

.char-active-busy .char-head-wrapper {
    animation: headWorkNod 1.2s infinite ease-in-out;
}

@keyframes handTypingFast {
    0% {
        transform: translateY(0) scale(1);
    }

    100% {
        transform: translateY(-5px) scale(1.15);
        background: #fde68a;
    }
}

@keyframes headWorkNod {

    0%,
    100% {
        transform: translateY(0) rotate(0deg);
    }

    30% {
        transform: translateY(2px) rotate(2deg);
    }

    70% {
        transform: translateY(1px) rotate(-1.5deg);
    }
}

/* 2D Kuşbakışı Active Card State */
.workstation-card-2d.card-busy-active {
    border-color: rgba(16, 185, 129, 0.85) !important;
    box-shadow: 0 8px 24px rgba(16, 185, 129, 0.3), 0 0 14px rgba(16, 185, 129, 0.4) !important;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.16), rgba(15, 23, 42, 0.95)) !important;
}

.compact-status-dot.status-dot-busy {
    background: #10b981 !important;
    box-shadow: 0 0 10px #10b981 !important;
    animation: dotPulse 0.9s infinite alternate ease-in-out;
}

@keyframes dotPulse {
    0% {
        transform: scale(1);
        opacity: 0.8;
        box-shadow: 0 0 6px #10b981;
    }

    100% {
        transform: scale(1.4);
        opacity: 1;
        box-shadow: 0 0 14px #10b981;
    }
}

/* Server Rack Cabinet (Decor in Tech zone) */
.decor-server-rack {
    position: absolute;
    width: 60px;
    height: 120px;
    background: #020617;
    border-radius: 6px;
    border: 1.5px solid rgba(6, 182, 212, 0.4);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.8), 0 0 15px rgba(6, 182, 212, 0.2);
    display: flex;
    flex-direction: column;
    padding: 6px;
    gap: 6px;
}

.server-rack-slot {
    flex: 1;
    background: #0f172a;
    border-radius: 2px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 4px;
}

.server-led-row {
    display: flex;
    gap: 3px;
}

.server-led {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 4px #10b981;
    animation: ledFlicker 1.5s infinite steps(2, start);
}

.server-led.cyan-led {
    background: #06b6d4;
    box-shadow: 0 0 4px #06b6d4;
    animation-delay: 0.3s;
}

.server-led.amber-led {
    background: #f59e0b;
    box-shadow: 0 0 4px #f59e0b;
    animation-delay: 0.7s;
}

@keyframes ledFlicker {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.2;
    }
}

/* Potted Plants & Props */
.office-plant-pot {
    position: absolute;
    font-size: 1.6rem;
    filter: drop-shadow(0 6px 8px rgba(0, 0, 0, 0.6));
    pointer-events: none;
}

/* =========================================================
   Live Flying Documents & Data Packets
   ========================================================= */
.flying-doc-container {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 30;
    transform-style: preserve-3d;
}

.flying-document {
    position: absolute;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    background: rgba(13, 18, 36, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.7), 0 0 15px rgba(139, 92, 246, 0.4);
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--text-high);
    white-space: nowrap;
    pointer-events: auto;
    cursor: pointer;
    transition: transform 0.2s ease;
    backdrop-filter: blur(8px);
}

.flying-document:hover {
    transform: scale(1.18);
    z-index: 50;
    border-color: #a78bfa;
}

.flying-document.doc-invoice {
    border-color: rgba(16, 185, 129, 0.6);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.7), 0 0 15px rgba(16, 185, 129, 0.45);
    color: #6ee7b7;
}

.flying-document.doc-code {
    border-color: rgba(6, 182, 212, 0.6);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.7), 0 0 15px rgba(6, 182, 212, 0.45);
    color: #67e8f9;
}

.flying-document.doc-decision {
    border-color: rgba(245, 158, 11, 0.6);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.7), 0 0 15px rgba(245, 158, 11, 0.45);
    color: #fde68a;
}

/* Floor Shadow of the Flying Doc */
.flying-doc-shadow {
    position: absolute;
    width: 30px;
    height: 12px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 50%;
    filter: blur(4px);
    pointer-events: none;
    transform: scale(1);
    transition: opacity 0.2s ease;
}

/* =========================================================
   Desk Action Modal & Backdrop (Centered Popover Modal)
   ========================================================= */
.desk-inspection-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(2, 6, 23, 0.72);
    backdrop-filter: blur(8px);
    z-index: 998;
    transition: opacity 0.25s ease;
}

.desk-inspection-backdrop.hidden {
    display: none !important;
}

.desk-inspection-drawer {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 440px;
    max-width: 92vw;
    background: rgba(13, 18, 36, 0.96);
    backdrop-filter: blur(25px);
    border: 1.5px solid rgba(139, 92, 246, 0.45);
    border-radius: 20px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.85), 0 0 45px rgba(139, 92, 246, 0.25);
    padding: 24px;
    z-index: 999;
    animation: modalCenterPop 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.desk-inspection-drawer.hidden {
    display: none !important;
}

@keyframes modalCenterPop {
    from {
        opacity: 0;
        transform: translate(-50%, -46%) scale(0.94);
    }

    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

.drawer-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding-bottom: 14px;
}

.drawer-employee-card {
    display: flex;
    align-items: center;
    gap: 14px;
}

.drawer-avatar {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.06);
    border: 1.5px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}

.drawer-header-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.drawer-name {
    font-size: 1.1rem;
    font-weight: 800;
    color: #f8fafc;
    margin: 0;
}

.drawer-role {
    font-size: 0.8rem;
    color: #a78bfa;
    margin: 0;
}

.drawer-dept-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    background: rgba(139, 92, 246, 0.15);
    border: 1px solid rgba(139, 92, 246, 0.35);
    color: #c4b5fd;
    font-size: 0.68rem;
    font-weight: 600;
    margin-top: 4px;
    align-self: flex-start;
}

.drawer-close-btn {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    width: 32px;
    height: 32px;
    color: var(--text-mid);
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.drawer-close-btn:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.5);
    color: #fca5a5;
    transform: scale(1.08);
}

.drawer-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.drawer-stat-cards-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.drawer-stat-item {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.drawer-stat-label {
    font-size: 0.68rem;
    color: var(--text-low);
    font-weight: 600;
}

.drawer-stat-val {
    font-size: 0.78rem;
    font-weight: 700;
    color: #f8fafc;
}

.drawer-actions {
    display: flex;
    gap: 10px;
    margin-top: 18px;
}

.drawer-btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 14px;
    font-size: 0.8rem;
    font-weight: 700;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.drawer-btn-primary {
    background: linear-gradient(135deg, var(--primary), #6366f1);
    border: none;
    color: #fff;
    box-shadow: 0 4px 14px rgba(139, 92, 246, 0.4);
}

.drawer-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(139, 92, 246, 0.55);
}

.drawer-btn-secondary {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.14);
    color: var(--text-high);
}

.drawer-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.25);
}

/* =========================================================
   3D vs 2D Mode Switching
   ========================================================= */
.office-isometric-plane.mode-3d .workstation-3d-scene {
    display: block !important;
}

.office-isometric-plane.mode-3d .workstation-card-2d {
    display: none !important;
}

.office-isometric-plane.mode-2d .workstation-3d-scene {
    display: none !important;
}

.office-isometric-plane.mode-2d .workstation-card-2d {
    display: flex !important;
}

.office-isometric-plane.mode-2d .office-workstation {
    width: 145px !important;
    height: 50px !important;
    transform: none !important;
}

/* Desk Keyboard & Coffee Cup Row */
.desk-props-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    margin-top: 4px;
}

.desk-coffee-cup {
    position: relative;
    font-size: 0.95rem;
    cursor: default;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}

.cup-steam {
    position: absolute;
    top: -6px;
    left: 4px;
    width: 4px;
    height: 8px;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 50%;
    filter: blur(1.5px);
    animation: cupSteamFloat 2s infinite ease-out;
}

@keyframes cupSteamFloat {
    0% {
        transform: translateY(0) scaleX(1);
        opacity: 0.8;
    }

    100% {
        transform: translateY(-10px) scaleX(2);
        opacity: 0;
    }
}

/* 3D Seated Character */
.employee-3d-character {
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 12;
    pointer-events: none;
}

.char-head-wrapper {
    position: relative;
    z-index: 15;
    transition: transform 0.2s ease;
}

.char-svg-head {
    display: flex;
    align-items: center;
    justify-content: center;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.6));
}

.char-torso {
    width: 32px;
    height: 20px;
    border-radius: 6px 6px 3px 3px;
    margin-top: -6px;
    background: linear-gradient(180deg, #334155, #1e293b);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
    z-index: 10;
}

.char-torso.torso-patron {
    background: linear-gradient(180deg, #4f46e5, #312e81);
    border-color: rgba(245, 158, 11, 0.4);
}

.char-torso.torso-tech {
    background: linear-gradient(180deg, #0891b2, #0e7490);
    border-color: rgba(6, 182, 212, 0.4);
}

.char-torso.torso-finance {
    background: linear-gradient(180deg, #059669, #047857);
    border-color: rgba(16, 185, 129, 0.4);
}

.char-torso.torso-ops {
    background: linear-gradient(180deg, #be185d, #9d174d);
    border-color: rgba(236, 72, 153, 0.4);
}

.char-hands-typing {
    position: absolute;
    bottom: 22px;
    width: 36px;
    display: flex;
    justify-content: space-between;
    z-index: 18;
}

.char-hand {
    width: 6px;
    height: 6px;
    background: #fed7aa;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
}

/* Passive Work Animation (Idle State) */
.char-passive-work .char-head-wrapper {
    animation: passiveHeadBreathe 4s infinite ease-in-out;
}

.char-passive-work .char-hands-typing .hand-left {
    animation: passiveKeyTap 3s infinite ease-in-out;
}

.char-passive-work .char-hands-typing .hand-right {
    animation: passiveKeyTap 3s infinite ease-in-out 1.5s;
}

@keyframes passiveHeadBreathe {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-3px) rotate(1deg);
    }
}

@keyframes passiveKeyTap {

    0%,
    80%,
    100% {
        transform: translateY(0);
    }

    85% {
        transform: translateY(-3px);
    }

    90% {
        transform: translateY(0);
    }
}

/* Active Work Animation (Busy State) */
.char-active-busy .char-head-wrapper {
    animation: activeHeadFocus 1.2s infinite ease-in-out;
}

.char-active-busy .char-hands-typing .hand-left {
    animation: rapidTypingLeft 0.25s infinite alternate ease-in-out;
}

.char-active-busy .char-hands-typing .hand-right {
    animation: rapidTypingRight 0.28s infinite alternate ease-in-out 0.1s;
}

@keyframes activeHeadFocus {

    0%,
    100% {
        transform: translateY(0) scale(1.02);
    }

    50% {
        transform: translateY(-2px) scale(1.02);
    }
}

@keyframes rapidTypingLeft {
    0% {
        transform: translateY(0) translateX(-1px);
    }

    100% {
        transform: translateY(-4px) translateX(1px);
    }
}

@keyframes rapidTypingRight {
    0% {
        transform: translateY(-4px) translateX(1px);
    }

    100% {
        transform: translateY(0) translateX(-1px);
    }
}

/* Active Desk Glow */
.desk-active-busy {
    box-shadow:
        0 14px 35px rgba(0, 0, 0, 0.8),
        0 0 25px rgba(16, 185, 129, 0.4),
        inset 0 0 15px rgba(16, 185, 129, 0.2) !important;
    border-color: rgba(16, 185, 129, 0.8) !important;
}

.desk-active-busy .screen-code-lines {
    animation-duration: 0.8s !important;
}

/* =========================================================
   2D Compact Kuşbakışı Tile (Space-Saving, Zero Overlap)
   ========================================================= */
.workstation-card-2d {
    position: relative;
    width: 145px;
    height: 50px;
    background: rgba(15, 23, 42, 0.92);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    padding: 6px 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    box-sizing: border-box;
}

.workstation-card-2d:hover {
    background: rgba(24, 34, 58, 0.98);
    border-color: rgba(139, 92, 246, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.65), 0 0 15px rgba(139, 92, 246, 0.25);
}

.compact-card-avatar {
    position: relative;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: rgba(30, 41, 59, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: visible;
}

.compact-status-dot {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    border: 1.5px solid #0f172a;
    z-index: 5;
}

.compact-status-dot.status-dot-idle {
    background: #64748b;
}

.compact-status-dot.status-dot-busy {
    background: #10b981;
    box-shadow: 0 0 8px #10b981;
    animation: dotPulse 1.5s infinite;
}

@keyframes dotPulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.3);
    }
}

.compact-card-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.compact-card-name {
    font-size: 0.76rem;
    font-weight: 700;
    color: #f8fafc;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.compact-card-role {
    font-size: 0.63rem;
    color: #94a3b8;
    margin-top: 1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* =========================================================
   Hover Detail Popover (Shown on Mouse Hover in 2D & 3D)
   ========================================================= */
.desk-hover-popover {
    position: absolute;
    bottom: calc(100% + 10px);
    left: 50%;
    width: 235px;
    background: rgba(11, 16, 32, 0.96);
    backdrop-filter: blur(20px);
    border: 1.5px solid rgba(139, 92, 246, 0.45);
    border-radius: 14px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.85), 0 0 25px rgba(139, 92, 246, 0.25);
    padding: 12px;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 120;
    box-sizing: border-box;
}

/* 2D Hover Popover Positioning */
.office-isometric-plane.mode-2d .desk-hover-popover {
    transform: translateX(-50%) translateY(8px) scale(0.95);
}

.office-isometric-plane.mode-2d .office-workstation:hover .desk-hover-popover {
    transform: translateX(-50%) translateY(0) scale(1);
    opacity: 1;
    visibility: visible;
}

/* 3D Hover Popover Positioning (Upright in 3D Space) */
.office-isometric-plane.mode-3d .desk-hover-popover {
    transform: translateX(-50%) translateZ(110px) rotateZ(45deg) rotateX(-58deg) scale(0.94);
    transform-origin: bottom center;
}

.office-isometric-plane.mode-3d .office-workstation:hover .desk-hover-popover {
    transform: translateX(-50%) translateZ(110px) rotateZ(45deg) rotateX(-58deg) scale(1);
    opacity: 1;
    visibility: visible;
}

.popover-top {
    display: flex;
    align-items: center;
    gap: 10px;
}

.popover-avatar {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
}

.popover-title-box {
    flex: 1;
    min-width: 0;
}

.popover-name {
    font-size: 0.84rem;
    font-weight: 700;
    color: #f8fafc;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.popover-role {
    font-size: 0.68rem;
    color: #a78bfa;
    margin: 1px 0 0 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.popover-badges {
    display: flex;
    align-items: center;
    gap: 5px;
    margin: 8px 0;
    flex-wrap: wrap;
}

.popover-dept-badge {
    padding: 2px 7px;
    border-radius: var(--radius-full);
    font-size: 0.62rem;
    font-weight: 600;
    background: rgba(139, 92, 246, 0.15);
    color: #c4b5fd;
    border: 1px solid rgba(139, 92, 246, 0.3);
}

.popover-model-badge {
    padding: 2px 7px;
    border-radius: var(--radius-full);
    font-size: 0.6rem;
    font-family: var(--font-mono);
    background: rgba(255, 255, 255, 0.06);
    color: #cbd5e1;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.popover-status-row {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.66rem;
    color: #94a3b8;
    position: relative;
    padding-left: 2px;
}

.popover-status-row .compact-status-dot {
    position: static;
    transform: none;
    flex-shrink: 0;
}

.popover-status-text {
    color: #cbd5e1;
}

.popover-click-hint {
    margin-top: 8px;
    padding: 4px 6px;
    background: rgba(139, 92, 246, 0.12);
    border: 1px dashed rgba(139, 92, 246, 0.35);
    border-radius: 6px;
    text-align: center;
    font-size: 0.62rem;
    color: #c4b5fd;
    font-weight: 600;
}

/* =========================================================
   In-Office Patron Walkie-Talkie / Comms Dock
   ========================================================= */
/* In-Office Patron Comms Container (Facebook-style horizontal stack at bottom-right) */
.office-comms-container {
    position: absolute;
    bottom: 20px;
    right: 25px;
    display: flex;
    flex-direction: row;
    align-items: flex-end;
    gap: 14px;
    z-index: 100;
    pointer-events: none;
    max-width: calc(100vw - 40px);
}

.office-comms-container > * {
    pointer-events: auto;
}

.office-popups-container {
    display: flex;
    flex-direction: row-reverse;
    align-items: flex-end;
    gap: 12px;
    pointer-events: none;
}

.office-popups-container > * {
    pointer-events: auto;
}

/* Facebook-Style Dedicated Employee Chat Popup Box */
.employee-chat-box {
    position: relative;
    width: 340px;
    height: 500px;
    max-height: calc(100vh - 120px);
    background: rgba(13, 18, 36, 0.96);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(59, 130, 246, 0.4);
    border-radius: 16px;
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.7), 0 0 25px rgba(59, 130, 246, 0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 55;
    animation: popupSlideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes popupSlideUp {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.employee-chat-box.active {
    border-color: rgba(96, 165, 250, 0.85);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.85), 0 0 35px rgba(59, 130, 246, 0.35);
    z-index: 60;
}

.employee-chat-box.minimized {
    width: 250px;
    height: 48px;
    max-height: 48px;
    border-radius: 24px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.6), 0 0 18px rgba(59, 130, 246, 0.25);
    border: 1px solid rgba(59, 130, 246, 0.5);
}

.employee-chat-box.minimized .chat-box-header {
    height: 100%;
    padding: 8px 14px;
    border-bottom: none;
    background: transparent;
}

.employee-chat-box.minimized .chat-box-role {
    display: none !important;
}

.employee-chat-box.minimized .chat-box-body {
    display: none !important;
}

.chat-box-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 11px 14px;
    background: rgba(20, 27, 52, 0.95);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    cursor: pointer;
    user-select: none;
    gap: 8px;
}

.chat-box-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex: 1;
}

.chat-box-avatar-wrap {
    position: relative;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1.15rem;
    overflow: visible;
}

.chat-box-avatar-wrap svg {
    width: 100%;
    height: 100%;
    border-radius: 7px;
}

.chat-box-online-dot {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #10b981;
    border: 2px solid #0d1224;
    box-shadow: 0 0 6px #10b981;
}

.chat-box-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.chat-box-name {
    font-size: 0.86rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-box-role {
    font-size: 0.68rem;
    color: #94a3b8;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 2px;
}

.chat-box-header-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.btn-box-icon {
    width: 26px;
    height: 26px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #cbd5e1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s;
    font-size: 0.75rem;
    padding: 0;
}

.btn-box-icon:hover {
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
}

.btn-box-icon.btn-box-close:hover {
    background: rgba(239, 68, 68, 0.35);
    border-color: rgba(239, 68, 68, 0.7);
    color: #fca5a5;
}

.chat-box-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

.chat-box-drawer {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(10, 14, 28, 0.98);
    backdrop-filter: blur(16px);
    z-index: 20;
    display: flex;
    flex-direction: column;
    padding: 12px;
}

.chat-box-drawer.hidden {
    display: none !important;
}

.chat-box-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 8px;
}

.chat-box-drawer-title {
    font-size: 0.82rem;
    font-weight: 700;
    color: #fff;
}

.chat-box-drawer-actions {
    display: flex;
    gap: 6px;
}

.btn-drawer-action {
    font-size: 0.70rem;
    padding: 3px 8px;
    border-radius: 6px;
    background: rgba(59, 130, 246, 0.2);
    border: 1px solid rgba(59, 130, 246, 0.4);
    color: #93c5fd;
    cursor: pointer;
}

.btn-drawer-action:hover {
    background: rgba(59, 130, 246, 0.4);
    color: #fff;
}

.btn-drawer-close {
    font-size: 0.72rem;
    width: 22px;
    height: 22px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #cbd5e1;
    cursor: pointer;
}

.chat-box-drawer-list {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.chat-box-thread-item {
    padding: 8px 10px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    cursor: pointer;
    transition: all 0.15s;
}

.chat-box-thread-item:hover,
.chat-box-thread-item.active {
    background: rgba(59, 130, 246, 0.18);
    border-color: rgba(59, 130, 246, 0.45);
}

.chat-box-thread-title {
    font-size: 0.78rem;
    font-weight: 600;
    color: #f1f5f9;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-box-thread-meta {
    font-size: 0.68rem;
    color: #94a3b8;
    margin-top: 2px;
}

.chat-box-chips {
    display: flex;
    gap: 6px;
    padding: 6px 10px;
    overflow-x: auto;
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    scrollbar-width: none;
}

.chat-box-chips::-webkit-scrollbar {
    display: none;
}

.chat-box-chip {
    font-size: 0.70rem;
    padding: 3px 9px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #cbd5e1;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.15s;
}

.chat-box-chip:hover {
    background: rgba(59, 130, 246, 0.25);
    border-color: rgba(59, 130, 246, 0.5);
    color: #93c5fd;
}

.chat-box-messages {
    flex: 1;
    overflow-y: auto;
    padding: 12px 10px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    scroll-behavior: smooth;
}

.chat-box-bubble {
    display: flex;
    gap: 8px;
    max-width: 90%;
    animation: fadeIn 0.2s ease;
}

.chat-box-bubble.bubble-user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.chat-box-bubble.bubble-agent {
    align-self: flex-start;
}

.chat-box-bubble-avatar {
    width: 26px;
    height: 26px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    flex-shrink: 0;
    overflow: hidden;
}

.chat-box-bubble-body {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.chat-box-bubble-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.68rem;
    color: #94a3b8;
    margin-bottom: 2px;
}

.chat-box-bubble.bubble-user .chat-box-bubble-meta {
    justify-content: flex-end;
}

.chat-box-bubble-text {
    padding: 8px 12px;
    border-radius: 12px;
    font-size: 0.80rem;
    line-height: 1.45;
    word-break: break-word;
}

.chat-box-bubble.bubble-user .chat-box-bubble-text {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: #fff;
    border-bottom-right-radius: 2px;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

.chat-box-bubble.bubble-agent .chat-box-bubble-text {
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #f1f5f9;
    border-bottom-left-radius: 2px;
}

.chat-box-bubble-text p {
    margin: 0 0 6px 0;
}

.chat-box-bubble-text p:last-child {
    margin-bottom: 0;
}

.chat-box-bubble-text pre {
    background: rgba(0, 0, 0, 0.4);
    padding: 8px;
    border-radius: 6px;
    overflow-x: auto;
    font-size: 0.74rem;
}

.chat-box-bubble-text code {
    font-family: monospace;
    background: rgba(0, 0, 0, 0.3);
    padding: 1px 4px;
    border-radius: 4px;
}

.chat-box-bubble-text table,
.comms-bubble-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 8px 0;
    font-size: 0.74rem;
    display: block;
    overflow-x: auto;
}

.chat-box-bubble-text th,
.chat-box-bubble-text td,
.comms-bubble-content th,
.comms-bubble-content td {
    padding: 5px 8px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    text-align: left;
    white-space: nowrap;
}

.chat-box-bubble-text th,
.comms-bubble-content th {
    background: rgba(255, 255, 255, 0.08);
    font-weight: 600;
    color: #93c5fd;
}

.chat-box-bubble-text tr:nth-child(even),
.comms-bubble-content tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.02);
}

.chat-box-bubble.bubble-thinking {
    opacity: 0.85;
}

.chat-box-thinking-pulse {
    display: flex;
    align-items: center;
    gap: 6px;
    font-style: italic;
    color: #93c5fd;
    animation: pulse 1.5s infinite;
}

.chat-box-input-bar {
    padding: 8px 10px;
    background: rgba(18, 24, 46, 0.95);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.chat-box-form {
    display: flex;
    gap: 6px;
    align-items: center;
    margin: 0;
}

.chat-box-input {
    flex: 1;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 20px;
    padding: 7px 12px;
    color: #fff;
    font-size: 0.80rem;
    outline: none;
    transition: all 0.2s;
}

.chat-box-input:focus {
    border-color: #3b82f6;
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.3);
}

.btn-box-send {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    border: none;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    font-size: 0.85rem;
    transition: transform 0.15s, opacity 0.15s;
}

.btn-box-send:hover {
    transform: scale(1.08);
}

.btn-box-send:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* In-Office Patron Walkie-Talkie & Executive Comms Dock (HQ General Channel) */
.office-comms-dock {
    position: relative;
    width: 420px;
    max-height: 560px;
    background: rgba(13, 18, 36, 0.94);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(139, 92, 246, 0.35);
    border-radius: 18px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7), 0 0 30px rgba(139, 92, 246, 0.15);
    display: flex;
    flex-direction: column;
    z-index: 50;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
}

.office-comms-dock.minimized {
    width: 400px;
    height: 60px;
    max-height: 60px;
    border-radius: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), 0 0 20px rgba(139, 92, 246, 0.25);
    border: 1px solid rgba(139, 92, 246, 0.45);
}

.office-comms-dock.minimized .comms-dock-header {
    height: 100%;
    padding: 10px 20px;
    border-bottom: none;
    background: transparent;
}

.office-comms-dock.minimized .comms-target-subtitle {
    display: none !important;
}

.office-comms-dock.minimized .comms-target-avatar-wrap {
    width: 36px;
    height: 36px;
}

.office-comms-dock.minimized .comms-dock-body {
    display: none;
}

.comms-dock-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px 14px 20px;
    background: rgba(18, 24, 46, 0.92);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    cursor: pointer;
    user-select: none;
}

.comms-dock-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.comms-target-avatar-wrap {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.14);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
    font-size: 1.35rem;
}

.comms-header-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.comms-header-title-row {
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.comms-target-title {
    font-size: 0.94rem;
    font-weight: 700;
    color: var(--text-high);
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.comms-badge {
    font-size: 0.62rem;
    padding: 3px 8px;
    border-radius: var(--radius-full);
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    white-space: nowrap;
    flex-shrink: 0;
}

.comms-badge.channel-direct {
    background: rgba(16, 185, 129, 0.2);
    border: 1px solid rgba(16, 185, 129, 0.5);
    color: #6ee7b7;
}

.comms-badge.channel-broadcast {
    background: rgba(139, 92, 246, 0.2);
    border: 1px solid rgba(139, 92, 246, 0.5);
    color: #c4b5fd;
}

.comms-target-subtitle {
    font-size: 0.72rem;
    color: var(--text-mid);
    margin: 3px 0 0 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.comms-dock-header-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-dock-icon {
    background: transparent;
    border: none;
    color: var(--text-mid);
    cursor: pointer;
    font-size: 1rem;
    padding: 6px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.btn-dock-icon:hover {
    color: var(--text-high);
    background: rgba(255, 255, 255, 0.08);
}

.comms-dock-body {
    display: flex;
    flex-direction: column;
    height: 440px;
    position: relative;
}

/* Conversations History Drawer */
.comms-conversations-drawer {
    position: absolute;
    inset: 0;
    background: rgba(10, 14, 28, 0.98);
    backdrop-filter: blur(25px);
    z-index: 25;
    display: flex;
    flex-direction: column;
    padding: 14px 16px;
    transition: opacity 0.2s ease;
}

.comms-conversations-drawer.hidden {
    display: none;
    opacity: 0;
    pointer-events: none;
}

.drawer-conversations-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.drawer-conv-title-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
}

.drawer-conv-title-wrap h5 {
    margin: 0;
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--text-high);
}

.drawer-conv-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-conv-action {
    background: rgba(139, 92, 246, 0.2);
    border: 1px solid rgba(139, 92, 246, 0.4);
    color: #c4b5fd;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
}

.btn-conv-action:hover {
    background: rgba(139, 92, 246, 0.4);
    color: #ffffff;
}

.btn-conv-close {
    background: transparent;
    border: none;
    color: var(--text-mid);
    cursor: pointer;
    font-size: 0.9rem;
    padding: 4px 8px;
    border-radius: 4px;
}

.btn-conv-close:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
}

.comms-conversations-list {
    flex: 1;
    overflow-y: auto;
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-right: 4px;
}

.comms-conv-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.comms-conv-item:hover {
    background: rgba(139, 92, 246, 0.12);
    border-color: rgba(139, 92, 246, 0.35);
}

.comms-conv-item.active {
    background: rgba(139, 92, 246, 0.2);
    border-color: rgba(139, 92, 246, 0.6);
    box-shadow: 0 0 12px rgba(139, 92, 246, 0.2);
}

.comms-conv-item-left {
    min-width: 0;
    flex: 1;
}

.comms-conv-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-high);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.comms-conv-meta {
    font-size: 0.68rem;
    color: var(--text-low);
    margin-top: 2px;
    display: flex;
    gap: 8px;
    align-items: center;
}

.comms-conv-count-badge {
    background: rgba(255, 255, 255, 0.08);
    padding: 1px 6px;
    border-radius: 9999px;
    font-size: 0.62rem;
    color: var(--text-mid);
}

.btn-conv-delete {
    background: transparent;
    border: none;
    color: var(--text-low);
    cursor: pointer;
    font-size: 0.85rem;
    padding: 4px;
    opacity: 0.6;
    transition: all 0.2s;
}

.btn-conv-delete:hover {
    color: #f87171;
    opacity: 1;
}

.comms-quick-chips {
    display: flex;
    gap: 6px;
    padding: 8px 12px;
    overflow-x: auto;
    overflow-y: hidden;
    background: rgba(10, 14, 28, 0.75);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    white-space: nowrap;
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-color: rgba(99, 102, 241, 0.4) transparent;
}

.comms-quick-chips::-webkit-scrollbar {
    height: 4px;
    display: block;
}

.comms-quick-chips::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, 0.4);
}

.comms-quick-chips::-webkit-scrollbar-thumb {
    background: rgba(99, 102, 241, 0.5);
    border-radius: 4px;
}

.comms-quick-chips::-webkit-scrollbar-thumb:hover {
    background: rgba(129, 140, 248, 0.8);
}

.comms-quick-chip {
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #cbd5e1;
    font-size: 0.7rem;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    user-select: none;
}

.comms-quick-chip:hover {
    background: rgba(139, 92, 246, 0.3);
    border-color: rgba(139, 92, 246, 0.6);
    color: #ffffff;
    transform: translateY(-1px);
}

.comms-messages-log {
    flex: 1;
    overflow-y: auto;
    padding: 14px 12px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    background: rgba(6, 10, 22, 0.4);
}

.comms-bubble {
    display: flex;
    gap: 10px;
    max-width: 86%;
    animation: fadeIn 0.22s ease-out;
}

/* User (Patron) message on the RIGHT */
.comms-bubble.comms-user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

/* Agent / System message on the LEFT */
.comms-bubble.comms-agent,
.comms-bubble.comms-error {
    align-self: flex-start;
    flex-direction: row;
}

.comms-avatar-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.comms-avatar-circle.user-avatar {
    background: linear-gradient(135deg, #f59e0b, #b45309);
    border-color: rgba(245, 158, 11, 0.4);
    font-size: 15px;
}

.comms-avatar-circle.error-avatar {
    background: rgba(239, 68, 68, 0.25);
    border-color: rgba(239, 68, 68, 0.4);
    font-size: 15px;
}

.comms-avatar-circle.agent-avatar {
    background: rgba(30, 41, 59, 0.8);
    border-color: rgba(56, 189, 248, 0.3);
}

.comms-avatar-circle svg {
    width: 100%;
    height: 100%;
    display: block;
}

.comms-bubble-main {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.comms-bubble-meta {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 4px;
    font-size: 0.7rem;
    line-height: 1;
}

.comms-user .comms-bubble-meta {
    justify-content: flex-end;
}

.comms-meta-sender {
    font-weight: 700;
    color: #e2e8f0;
}

.comms-user .comms-meta-sender {
    color: #fde68a;
}

.comms-meta-role {
    font-size: 0.65rem;
    color: #38bdf8;
    background: rgba(56, 189, 248, 0.12);
    padding: 1px 5px;
    border-radius: 4px;
    border: 1px solid rgba(56, 189, 248, 0.25);
}

.comms-meta-dot {
    color: #475569;
    font-size: 0.65rem;
}

.comms-meta-time {
    font-size: 0.65rem;
    color: #94a3b8;
    font-family: var(--font-mono, monospace);
    font-weight: 400;
}

.comms-bubble-content {
    padding: 10px 14px;
    border-radius: 14px;
    font-size: 0.8rem;
    line-height: 1.5;
    word-break: break-word;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

.comms-user .comms-bubble-content {
    background: linear-gradient(135deg, #4f46e5, #6366f1);
    color: #ffffff;
    border-radius: 14px 2px 14px 14px;
    box-shadow: 0 4px 16px rgba(79, 70, 229, 0.35);
}

.comms-agent .comms-bubble-content {
    background: rgba(20, 29, 47, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #f1f5f9;
    border-radius: 2px 14px 14px 14px;
}

.comms-error .comms-bubble-content {
    background: rgba(69, 10, 10, 0.85);
    border: 1px solid rgba(239, 68, 68, 0.35);
    color: #fca5a5;
    border-radius: 2px 14px 14px 14px;
}

.comms-thinking .comms-bubble-content {
    background: rgba(30, 41, 59, 0.7);
    border: 1px dashed rgba(56, 189, 248, 0.35);
    color: #94a3b8;
    font-style: italic;
}

.comms-bubble-content p {
    margin: 0 0 8px 0;
}

.comms-bubble-content p:last-child {
    margin: 0;
}

.comms-bubble-content pre {
    background: rgba(0, 0, 0, 0.4);
    padding: 8px;
    border-radius: 6px;
    overflow-x: auto;
    font-size: 0.75rem;
    margin: 6px 0;
}

.comms-bubble-content code {
    font-family: var(--font-mono, monospace);
    background: rgba(255, 255, 255, 0.1);
    padding: 1px 4px;
    border-radius: 3px;
    font-size: 0.75rem;
}

.comms-input-bar {
    padding: 10px 12px;
    background: rgba(13, 18, 36, 0.95);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.comms-form {
    display: flex;
    gap: 8px;
}

.comms-input {
    flex: 1;
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    padding: 7px 12px;
    font-size: 0.78rem;
    color: var(--text-high);
    outline: none;
    transition: border-color 0.2s;
}

.comms-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 10px rgba(139, 92, 246, 0.3);
}

.btn-comms-send {
    background: linear-gradient(135deg, var(--primary), #6366f1);
    border: none;
    border-radius: 8px;
    padding: 7px 14px;
    color: #fff;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.4);
}

.btn-comms-send:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(139, 92, 246, 0.6);
}

/* Flying Directive Packet */
.flying-doc-packet.doc-directive {
    background: linear-gradient(135deg, #f59e0b, #ec4899);
    border-color: #fbbf24;
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.6);
}

/* Responsive Adjustments */
@media (max-width: 1024px) {
    .office-isometric-plane {
        transform: rotateX(50deg) rotateZ(-35deg) scale(0.85);
    }

    .office-comms-dock {
        width: 320px;
    }
}