/* ==========================================================================
   CITY OF VICE — Dark Crime Dashboard Theme
   A 1970s noir meets cyberpunk terminal aesthetic
   ========================================================================== */

/* CSS Variables — Noir Palette */
:root {
    --bg-deep: #0a0a0d;
    --bg-panel: #0f0f14;
    --bg-elevated: #14141a;
    --bg-input: #0c0c10;
    --bg-panel-header: #14141a;
    --bg-hover: rgba(255, 170, 51, 0.05);
    
    --border-subtle: #1a1a22;
    --border-medium: #2a2a35;
    --border-accent: #3a3a48;
    
    --text-primary: #e0e0e8;
    --text-secondary: #8888a0;
    --text-muted: #555568;
    --text-dim: #3a3a48;
    
    --neon-red: #ff3344;
    --neon-red-dim: #ff334466;
    --neon-amber: #ffaa33;
    --neon-amber-dim: #ffaa3366;
    --neon-green: #33ff66;
    --neon-green-dim: #33ff6666;
    --neon-blue: #3388ff;
    --neon-blue-dim: #3388ff66;
    
    --accent-gold: #ffaa33;
    
    --heat-low: #33ff66;
    --heat-mid: #ffaa33;
    --heat-high: #ff3344;
    
    --font-mono: 'Courier New', 'Consolas', monospace;
    --font-sans: 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    --font-prose: 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    
    --radius-sm: 3px;
    --radius-md: 6px;
    --radius-lg: 10px;
    
    --shadow-soft: 0 4px 12px rgba(0, 0, 0, 0.5);
    --shadow-neon-red: 0 0 10px rgba(255, 51, 68, 0.3);
    --shadow-neon-amber: 0 0 10px rgba(255, 170, 51, 0.3);
    
    --transition-fast: 150ms ease-in-out;
    --transition-normal: 250ms ease-in-out;
}

/* Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
}

body, html {
    margin: 0;
    padding: 0;
    height: 100%;
    overflow: hidden;
    background: var(--bg-deep);
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 14px;
    line-height: 1.5;
}

/* Scanline overlay effect */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0, 0, 0, 0.03) 2px,
        rgba(0, 0, 0, 0.03) 4px
    );
}

/* Vignette effect */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9998;
    background: radial-gradient(ellipse at center, transparent 50%, rgba(0, 0, 0, 0.4) 100%);
}

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

::-webkit-scrollbar-track {
    background: var(--bg-deep);
}

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

::-webkit-scrollbar-thumb:hover {
    background: var(--border-accent);
}

/* ==========================================================================
   GOLDEN LAYOUT OVERRIDES
   ========================================================================== */

.lm_root {
    background: var(--bg-deep);
}

.lm_row {
    background: var(--bg-deep);
}

.lm_content {
    background: var(--bg-panel);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.lm_header {
    background: var(--bg-elevated);
    height: 28px !important;
}

.lm_header .lm_tab {
    background: var(--bg-deep);
    color: var(--text-muted);
    border: 1px solid var(--border-subtle);
    border-bottom: none;
    padding: 4px 12px;
    font-family: var(--font-mono);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all var(--transition-fast);
}

.lm_header .lm_tab:hover {
    background: var(--bg-panel);
    color: var(--text-secondary);
}

.lm_header .lm_tab.lm_active {
    background: var(--bg-panel);
    color: var(--neon-amber);
    border-color: var(--border-medium);
    text-shadow: 0 0 8px var(--neon-amber-dim);
}

.lm_header .lm_tab.lm_active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--neon-amber);
    box-shadow: 0 0 6px var(--neon-amber-dim);
}

.lm_splitter {
    background: var(--border-subtle) !important;
}

.lm_splitter:hover,
.lm_splitter.lm_dragging {
    background: var(--neon-amber-dim) !important;
}

.lm_dragProxy .lm_content {
    border-color: var(--neon-amber-dim);
    box-shadow: var(--shadow-neon-amber);
}

/* ==========================================================================
   TOP BAR — HUD
   ========================================================================== */

#vice-topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    height: 40px;
    padding: 0 16px;
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border-medium);
    font-family: var(--font-mono);
    font-size: 13px;
    gap: 24px;
    user-select: none;
}

/* Push the GoldenLayout container below the fixed topbar.
   Use position:fixed so it fills the exact viewport area below the topbar,
   bypassing any height-inheritance issues from Bootstrap's d-none removal. */
#clientwrapper {
    position: fixed !important;
    top: 40px !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    height: auto !important;
    margin-top: 0 !important;
}

/* #main and #main-sub must fill #clientwrapper so GoldenLayout gets correct dimensions */
#main {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    height: auto !important;
    overflow: hidden;
}

/* GoldenLayout mounts into #main-sub; remove default padding so it fills flush */
#main-sub {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    padding: 0 !important;
    height: auto !important;
    overflow: hidden;
}

#vice-topbar .hud-section {
    display: flex;
    align-items: center;
    gap: 8px;
}

#vice-topbar .hud-label {
    color: var(--text-muted);
    text-transform: uppercase;
    font-size: 10px;
    letter-spacing: 1px;
}

#vice-topbar .hud-value {
    color: var(--text-primary);
    font-weight: bold;
}

#vice-topbar .cash-value {
    color: var(--neon-green);
    text-shadow: 0 0 6px var(--neon-green-dim);
}

#vice-topbar .dirty-cash-value {
    color: var(--neon-amber);
    text-shadow: 0 0 6px var(--neon-amber-dim);
}

/* Heat meter */
.heat-meter {
    display: flex;
    align-items: center;
    gap: 8px;
}

.heat-bar-track {
    width: 120px;
    height: 14px;
    background: var(--bg-deep);
    border-radius: 7px;
    border: 1px solid var(--border-medium);
    overflow: hidden;
    position: relative;
}

.heat-bar-fill {
    height: 100%;
    border-radius: 7px;
    transition: width var(--transition-normal), background-color var(--transition-normal);
    position: relative;
}

.heat-bar-fill::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.1) 50%,
        transparent 100%
    );
}

.heat-bar-fill.heat-low {
    background: linear-gradient(90deg, var(--heat-low), #22cc44);
    box-shadow: 0 0 8px var(--neon-green-dim);
}

.heat-bar-fill.heat-mid {
    background: linear-gradient(90deg, var(--heat-mid), #cc8822);
    box-shadow: 0 0 8px var(--neon-amber-dim);
}

.heat-bar-fill.heat-high {
    background: linear-gradient(90deg, var(--heat-high), #cc2233);
    box-shadow: 0 0 8px var(--neon-red-dim);
    animation: heat-pulse 2s ease-in-out infinite;
}

@keyframes heat-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.heat-value {
    min-width: 30px;
    text-align: right;
    font-size: 12px;
}

.heat-trend {
    font-size: 10px;
    margin-left: 4px;
}

.heat-trend.rising {
    color: var(--neon-red);
}

.heat-trend.falling {
    color: var(--neon-green);
}

.heat-trend.stable {
    color: var(--text-muted);
}

/* HP meter */
.hp-meter {
    display: flex;
    align-items: center;
    gap: 8px;
}

.hp-bar-track {
    width: 80px;
    height: 14px;
    background: var(--bg-deep);
    border-radius: 7px;
    border: 1px solid var(--border-medium);
    overflow: hidden;
    position: relative;
}

.hp-bar-fill {
    height: 100%;
    border-radius: 7px;
    transition: width var(--transition-normal), background-color var(--transition-normal);
    position: relative;
}

.hp-bar-fill::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.1) 50%,
        transparent 100%
    );
}

.hp-bar-fill.hp-good {
    background: linear-gradient(90deg, #33ff66, #22cc44);
    box-shadow: 0 0 8px rgba(51, 255, 102, 0.3);
}

.hp-bar-fill.hp-mid {
    background: linear-gradient(90deg, #ffaa33, #cc8822);
    box-shadow: 0 0 8px rgba(255, 170, 51, 0.3);
}

.hp-bar-fill.hp-low {
    background: linear-gradient(90deg, #ff6633, #cc4422);
    box-shadow: 0 0 8px rgba(255, 102, 51, 0.3);
}

.hp-bar-fill.hp-crit {
    background: linear-gradient(90deg, #ff3344, #cc2233);
    box-shadow: 0 0 8px rgba(255, 51, 68, 0.3);
    animation: hp-crit-pulse 1.5s ease-in-out infinite;
}

@keyframes hp-crit-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.hp-value {
    font-size: 11px;
    min-width: 50px;
    font-family: var(--font-mono);
}

/* Weapon section */
.weapon-section {
    display: flex;
    align-items: center;
    gap: 6px;
}

.weapon-value {
    color: var(--neon-red);
    font-size: 11px;
}

.weapon-ammo {
    font-size: 10px;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

/* District & jail status */
.district-value {
    color: var(--neon-blue);
}

.jail-status {
    color: var(--neon-red);
    animation: jail-flash 1s ease-in-out infinite;
}

@keyframes jail-flash {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* ==========================================================================
   TERMINAL
   ========================================================================== */

#terminal-container {
    height: 100%;
    display: flex;
    flex-direction: column;
    background: var(--bg-deep);
}

#terminal-output {
    flex: 1;
    overflow-y: auto;
    padding: 12px 16px;
    font-family: var(--font-mono);
    font-size: 13px;
    line-height: 1.6;
    color: var(--text-primary);
}

#terminal-output .ansi-bold { font-weight: bold; }
#terminal-output .ansi-dim { opacity: 0.6; }
#terminal-output .ansi-red { color: var(--neon-red); }
#terminal-output .ansi-green { color: var(--neon-green); }
#terminal-output .ansi-yellow { color: var(--neon-amber); }
#terminal-output .ansi-blue { color: var(--neon-blue); }
#terminal-output .ansi-magenta { color: #cc66ff; }
#terminal-output .ansi-cyan { color: #66ccff; }
#terminal-output .ansi-white { color: var(--text-primary); }

#terminal-input-row {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    background: var(--bg-panel);
    border-top: 1px solid var(--border-subtle);
}

#terminal-prompt {
    color: var(--neon-green);
    font-family: var(--font-mono);
    font-size: 13px;
    margin-right: 8px;
    user-select: none;
}

#terminal-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 13px;
}

#terminal-input::placeholder {
    color: var(--text-dim);
}

/* ==========================================================================
   MARKET PANEL
   ========================================================================== */

.market-header {
    padding: 8px 12px;
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border-subtle);
    font-family: var(--font-mono);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--neon-amber);
}

.market-list {
    flex: 1;
    overflow-y: auto;
    padding: 4px;
}

.market-item {
    display: flex;
    align-items: center;
    padding: 8px 10px;
    border-bottom: 1px solid var(--border-subtle);
    transition: background var(--transition-fast);
}

.market-item:hover {
    background: rgba(255, 170, 51, 0.05);
}

.market-item:last-child {
    border-bottom: none;
}

.market-drug-name {
    flex: 1;
    font-family: var(--font-mono);
    font-size: 12px;
    text-transform: capitalize;
    color: var(--text-primary);
}

.market-trend {
    font-size: 14px;
    margin: 0 8px;
    min-width: 16px;
    text-align: center;
}

.market-trend.up { color: var(--neon-red); }
.market-trend.down { color: var(--neon-green); }
.market-trend.stable { color: var(--text-muted); }

.market-price {
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: bold;
    color: var(--neon-amber);
    min-width: 60px;
    text-align: right;
}

.market-owned {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-muted);
    min-width: 40px;
    text-align: right;
    margin-left: 8px;
}

.market-actions {
    display: flex;
    gap: 4px;
    margin-left: 8px;
}

.market-btn {
    padding: 3px 8px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-family: var(--font-mono);
    font-size: 10px;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-transform: uppercase;
}

.market-btn:hover {
    background: var(--neon-amber-dim);
    color: var(--neon-amber);
    border-color: var(--neon-amber);
}

.market-btn:active {
    transform: scale(0.95);
}

/* ==========================================================================
   MAP PANEL
   ========================================================================== */

.map-header {
    padding: 8px 12px;
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border-subtle);
    font-family: var(--font-mono);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--neon-blue);
}

.map-container {
    flex: 1;
    padding: 12px;
    overflow: hidden;
    position: relative;
}

.map-svg {
    width: 100%;
    height: 100%;
}

.map-node {
    cursor: pointer;
    transition: all var(--transition-normal);
}

.map-node:hover .map-node-circle {
    stroke-width: 3;
    filter: drop-shadow(0 0 8px currentColor);
}

.map-node.here .map-node-circle {
    stroke-width: 3;
    animation: here-pulse 2s ease-in-out infinite;
}

@keyframes here-pulse {
    0%, 100% { stroke-opacity: 1; }
    50% { stroke-opacity: 0.4; }
}

.map-node-circle {
    stroke: var(--border-medium);
    transition: all var(--transition-normal);
}

.map-node-text {
    font-family: var(--font-mono);
    font-size: 10px;
    fill: var(--text-secondary);
    text-anchor: middle;
    pointer-events: none;
}

.map-connection {
    stroke: var(--border-subtle);
    stroke-width: 1;
    fill: none;
}

.map-node.police-high .map-node-circle {
    filter: drop-shadow(0 0 6px var(--neon-red-dim));
}

.map-node.police-low .map-node-circle {
    filter: drop-shadow(0 0 6px var(--neon-green-dim));
}

/* ==========================================================================
   EVENT TOASTS
   ========================================================================== */

#event-toasts {
    position: fixed;
    top: 50px;
    right: 16px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.event-toast {
    padding: 10px 16px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-md);
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-primary);
    box-shadow: var(--shadow-soft);
    animation: toast-in 0.3s ease-out, toast-out 0.3s ease-in 4.7s forwards;
    pointer-events: auto;
    max-width: 350px;
}

.event-toast.severity-minor {
    border-left: 3px solid var(--neon-blue);
}

.event-toast.severity-moderate {
    border-left: 3px solid var(--neon-amber);
    box-shadow: var(--shadow-soft), 0 0 10px var(--neon-amber-dim);
}

.event-toast.severity-bad {
    border-left: 3px solid var(--neon-red);
    box-shadow: var(--shadow-soft), var(--shadow-neon-red);
}

.event-toast.severity-severe {
    border-left: 3px solid var(--neon-red);
    box-shadow: var(--shadow-neon-red);
    animation: toast-in 0.3s ease-out, toast-out 0.3s ease-in 6.7s forwards, toast-pulse 1s ease-in-out infinite;
}

@keyframes toast-in {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes toast-out {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(50px);
    }
}

@keyframes toast-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.event-toast .toast-kind {
    text-transform: uppercase;
    font-size: 10px;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: 2px;
}

.event-toast .toast-summary {
    line-height: 1.4;
}

/* ==========================================================================
   STORY PANEL
   ========================================================================== */

.story-header {
    padding: 8px 12px;
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border-subtle);
    font-family: var(--font-mono);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--neon-blue);
}

.story-content {
    flex: 1;
    overflow-y: auto;
    padding: 12px 16px;
}

.story-chapter {
    margin-bottom: 16px;
}

.story-chapter-title {
    font-family: var(--font-mono);
    font-size: 14px;
    font-weight: bold;
    color: var(--neon-amber);
    margin-bottom: 4px;
}

.story-summary {
    font-size: 12px;
    line-height: 1.6;
    color: var(--text-secondary);
}

.story-flags {
    margin-top: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.story-flag {
    padding: 2px 8px;
    background: var(--bg-deep);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.story-empty {
    padding: 24px;
    text-align: center;
    color: var(--text-dim);
    font-family: var(--font-mono);
    font-size: 11px;
}

/* ==========================================================================
   VICE PANEL CONTENT (GoldenLayout integration)
   ========================================================================== */

.vice-panel-content {
    height: 100%;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background: var(--bg-panel);
}

.vice-panel-content .panel-header {
    padding: 8px 12px;
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border-subtle);
    font-family: var(--font-mono);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    flex-shrink: 0;
}

.vice-panel-content .panel-content {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

/* GoldenLayout content containers need to fill the space */
.lm_content {
    overflow: hidden;
}

.lm_content .vice-panel-content {
    height: 100%;
}

/* ==========================================================================
   MAP PANEL
   ========================================================================== */

#vice-map-panel {
    background: var(--bg-panel);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

#vice-map-panel .panel-header {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border-subtle);
    background: var(--bg-panel-header);
}

#vice-map-panel .panel-title {
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

#vice-map-panel .panel-content {
    padding: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

#city-map-svg {
    width: 100%;
    max-width: 320px;
    height: auto;
}

#vice-map-panel .map-node circle {
    transition: all 0.2s ease;
}

#vice-map-panel .map-node:hover circle {
    filter: brightness(1.3);
}

#vice-map-panel .map-node:hover text {
    fill: #fff !important;
}

/* Map Legend */
.map-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    margin-top: 12px;
    padding: 8px;
    background: var(--bg-deep);
    border-radius: var(--radius-sm);
    width: 100%;
    box-sizing: border-box;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--text-muted);
}

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 2px;
    display: inline-block;
}

/* Police glow animation */
.police-glow {
    animation: police-pulse 3s ease-in-out infinite;
}

@keyframes police-pulse {
    0%, 100% { opacity: 0.15; }
    50% { opacity: 0.3; }
}

/* ==========================================================================
   NEWS PANEL
   ========================================================================== */

#vice-news-panel {
    background: var(--bg-panel);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

#vice-news-panel .panel-header {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border-subtle);
    background: var(--bg-panel-header);
}

#vice-news-panel .panel-title {
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

#vice-news-panel .panel-content {
    padding: 0;
    flex: 1;
    overflow-y: auto;
}

.news-item {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border-subtle);
    cursor: pointer;
    transition: background 0.2s;
}

.news-item:hover {
    background: var(--bg-hover);
}

.news-item:last-child {
    border-bottom: none;
}

.news-headline {
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 600;
    color: var(--accent-gold);
    margin-bottom: 4px;
    line-height: 1.4;
}

.news-timestamp {
    font-size: 10px;
    color: var(--text-dim);
    font-family: var(--font-mono);
}

.news-body {
    font-family: var(--font-prose);
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-top: 6px;
    display: none;
}

.news-item.expanded .news-body {
    display: block;
}

.news-empty {
    padding: 24px;
    text-align: center;
    color: var(--text-dim);
    font-family: var(--font-mono);
    font-size: 11px;
}

/* ==========================================================================
   CONTACTS PANEL
   ========================================================================== */

#vice-contacts-panel {
    background: var(--bg-panel);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

#vice-contacts-panel .panel-header {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border-subtle);
    background: var(--bg-panel-header);
}

#vice-contacts-panel .panel-title {
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

#vice-contacts-panel .panel-content {
    padding: 8px;
    flex: 1;
    overflow-y: auto;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background 0.2s;
    margin-bottom: 4px;
}

.contact-item:hover {
    background: var(--bg-hover);
}

.contact-portrait {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    background: var(--bg-deep);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.contact-info {
    flex: 1;
    min-width: 0;
}

.contact-name {
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.contact-mood {
    font-size: 10px;
    color: var(--text-muted);
    font-family: var(--font-mono);
    text-transform: capitalize;
}

.contact-trust-bar {
    width: 60px;
    height: 4px;
    background: var(--bg-deep);
    border-radius: 2px;
    overflow: hidden;
    flex-shrink: 0;
}

.contact-trust-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 0.3s ease;
}

.contact-empty {
    padding: 24px;
    text-align: center;
    color: var(--text-dim);
    font-family: var(--font-mono);
    font-size: 11px;
}

/* Trust bar colors */
.trust-hostile { background: #ff4444; }
.trust-wary { background: #ff8844; }
.trust-neutral { background: #888888; }
.trust-friendly { background: #44aa44; }
.trust-loyal { background: #4488ff; }

/* ==========================================================================
   ACTIONS PANEL — Action Deck
   ========================================================================== */

.actions-panel {
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--bg-panel);
}

/* Context Strip — per-room affordances */
.actions-context {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border-subtle);
    flex-wrap: wrap;
    min-height: 32px;
    flex-shrink: 0;
}

.actions-context-empty {
    color: var(--text-dim);
    font-family: var(--font-mono);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.context-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    background: var(--bg-deep);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-sm);
    color: var(--neon-blue);
    font-family: var(--font-mono);
    font-size: 11px;
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.context-btn:hover {
    background: var(--neon-blue-dim);
    border-color: var(--neon-blue);
    box-shadow: 0 0 6px var(--neon-blue-dim);
}

.context-btn:active {
    transform: scale(0.95);
}

/* Action Groups */
.actions-groups {
    flex: 1;
    overflow-y: auto;
    padding: 6px 8px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.actions-group {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.actions-group-label {
    font-family: var(--font-mono);
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    min-width: 55px;
    padding-top: 4px;
    text-align: right;
    flex-shrink: 0;
}

.actions-group-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    flex: 1;
}

/* Action Buttons */
.action-btn {
    padding: 4px 12px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-family: var(--font-mono);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.action-btn:hover:not(.disabled) {
    background: var(--neon-amber-dim);
    color: var(--neon-amber);
    border-color: var(--neon-amber);
    box-shadow: 0 0 6px var(--neon-amber-dim);
}

.action-btn:active:not(.disabled) {
    transform: scale(0.95);
}

.action-btn.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    border-style: dashed;
}

.action-btn.disabled:hover {
    background: var(--bg-elevated);
    color: var(--text-muted);
    border-color: var(--border-subtle);
    box-shadow: none;
}

/* ==========================================================================
   CREW PANEL
   ========================================================================== */

.crew-header {
    padding: 8px 12px;
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border-subtle);
    font-family: var(--font-mono);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
}

.crew-list {
    flex: 1;
    overflow-y: auto;
    padding: 4px;
}

.crew-member {
    padding: 8px 10px;
    border-bottom: 1px solid var(--border-subtle);
    background: var(--bg-panel);
    transition: background var(--transition-fast);
}

.crew-member:hover {
    background: rgba(255, 170, 51, 0.03);
}

.crew-member:last-child {
    border-bottom: none;
}

.crew-member-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}

.crew-name {
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: bold;
    color: var(--text-primary);
}

.betrayal-risk {
    font-size: 14px;
    animation: betrayal-pulse 2s ease-in-out infinite;
}

@keyframes betrayal-pulse {
    0%, 100% { opacity: 1; text-shadow: 0 0 4px var(--neon-red-dim); }
    50% { opacity: 0.6; text-shadow: 0 0 12px var(--neon-red-dim); }
}

.crew-stats-row {
    display: flex;
    gap: 12px;
    margin-bottom: 6px;
    flex-wrap: wrap;
}

.crew-stat {
    display: flex;
    align-items: center;
    gap: 4px;
}

.crew-stat .stat-label {
    font-size: 9px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.crew-stat .stat-value {
    font-size: 11px;
    font-family: var(--font-mono);
    color: var(--text-secondary);
}

.loyalty-bar-track {
    width: 50px;
    height: 4px;
    background: var(--bg-deep);
    border-radius: 2px;
    overflow: hidden;
}

.loyalty-bar-fill {
    height: 100%;
    border-radius: 2px;
    transition: width var(--transition-normal), background var(--transition-normal);
}

.crew-job {
    font-size: 10px;
    font-family: var(--font-mono);
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    margin-top: 4px;
}

.crew-job.idle {
    color: var(--text-muted);
    background: var(--bg-deep);
}

.crew-job.working {
    color: var(--neon-amber);
    background: rgba(255, 170, 51, 0.1);
}

.crew-job.guarding {
    color: var(--neon-blue);
    background: rgba(51, 136, 255, 0.1);
}

.job-timer {
    color: var(--neon-amber);
    font-size: 9px;
}

.job-icon {
    font-size: 10px;
}

.crew-actions-row {
    display: flex;
    gap: 4px;
    margin-top: 6px;
}

.crew-action-btn {
    padding: 3px 8px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-family: var(--font-mono);
    font-size: 9px;
    text-transform: uppercase;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.crew-action-btn:hover {
    background: var(--neon-amber-dim);
    color: var(--neon-amber);
    border-color: var(--neon-amber);
}

.crew-action-btn.danger:hover {
    background: var(--neon-red-dim);
    color: var(--neon-red);
    border-color: var(--neon-red);
}

.crew-footer {
    padding: 6px 10px;
    background: var(--bg-elevated);
    border-top: 1px solid var(--border-subtle);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.crew-upkeep {
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--text-muted);
}

.crew-empty {
    padding: 24px;
    text-align: center;
    color: var(--text-dim);
    font-family: var(--font-mono);
    font-size: 11px;
}

/* ==========================================================================
   HIDEOUT PANEL
   ========================================================================== */

.hideout-panel {
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.hideout-header {
    padding: 8px 12px;
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border-subtle);
    font-family: var(--font-mono);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
}

.hideout-content {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

.hideout-empty {
    padding: 24px;
    text-align: center;
    color: var(--text-dim);
    font-family: var(--font-mono);
    font-size: 11px;
}

.hideout-empty code {
    background: var(--bg-deep);
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    color: var(--neon-amber);
    font-size: 10px;
}

.hideout-status {
    margin-bottom: 8px;
}

.hideout-name-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.hideout-tier-badge {
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
    font-size: 9px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--bg-deep);
}

.hideout-name {
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: bold;
    color: var(--text-primary);
}

.hideout-bars {
    margin-bottom: 10px;
}

.hideout-bar-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.hideout-bar-row .bar-label {
    font-family: var(--font-mono);
    font-size: 9px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    min-width: 60px;
}

.durability-bar-track,
.storage-bar-track {
    flex: 1;
    height: 6px;
    background: var(--bg-deep);
    border-radius: 3px;
    overflow: hidden;
}

.durability-bar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width var(--transition-normal), background var(--transition-normal);
}

.storage-bar-fill {
    height: 100%;
    background: var(--neon-blue) !important;
    border-radius: 3px;
    transition: width var(--transition-normal);
}

.hideout-bar-row .bar-value {
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--text-secondary);
    min-width: 40px;
    text-align: right;
}

.hideout-stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    margin-bottom: 10px;
}

.hideout-stat-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 6px;
    background: var(--bg-deep);
    border-radius: var(--radius-sm);
}

.hideout-stat-item .stat-icon {
    font-size: 12px;
}

.hideout-stat-item .stat-text {
    font-size: 10px;
    font-family: var(--font-mono);
    color: var(--text-secondary);
}

.hideout-stat-item .stat-text strong {
    color: var(--text-primary);
}

.hideout-section {
    margin-bottom: 8px;
    padding: 6px 8px;
    background: var(--bg-deep);
    border-radius: var(--radius-sm);
}

.hideout-section .section-label {
    font-family: var(--font-mono);
    font-size: 9px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.hideout-section .none-text {
    font-size: 10px;
    color: var(--text-dim);
    font-family: var(--font-mono);
}

.upgrade-tags {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 4px;
}

.upgrade-tag {
    padding: 2px 8px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
    font-size: 9px;
    color: var(--neon-blue);
    text-transform: capitalize;
}

.stash-list {
    list-style: none;
    padding: 0;
    margin: 4px 0 0 0;
}

.stash-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 3px 0;
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-secondary);
}

.stash-icon {
    font-size: 12px;
}

.hideout-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding-top: 8px;
    border-top: 1px solid var(--border-subtle);
}

.hideout-action-btn {
    padding: 4px 10px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-family: var(--font-mono);
    font-size: 10px;
    text-transform: uppercase;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.hideout-action-btn:hover {
    background: var(--neon-amber-dim);
    color: var(--neon-amber);
    border-color: var(--neon-amber);
    box-shadow: 0 0 6px var(--neon-amber-dim);
}

/* ==========================================================================
   WEAPONS PANEL
   ========================================================================== */

.weapons-panel {
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    gap: 0;
}

.weapons-section {
    border-bottom: 1px solid var(--border-subtle);
    padding-bottom: 8px;
    margin-bottom: 4px;
    flex-shrink: 0;
}

.weapons-section:last-child {
    border-bottom: none;
}

/* Dealer section needs a max-height with its own scroll so it can't crowd out player weapons/ammo */
.weapons-section.dealer-section {
    max-height: 40%;
    overflow-y: auto;
}

.weapons-header {
    padding: 6px 12px;
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 600;
    color: var(--neon-amber);
    text-transform: uppercase;
    letter-spacing: 1px;
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border-subtle);
}

.weapons-subheader {
    padding: 4px 12px;
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.weapons-dealer-info {
    padding: 4px 0;
}

.weapons-dealer-refusal {
    padding: 6px 12px;
    color: var(--neon-red);
    font-size: 12px;
    background: rgba(255, 51, 68, 0.05);
    border-left: 3px solid var(--neon-red);
    margin: 4px 12px;
    border-radius: var(--radius-sm);
}

.weapons-dealer-refusal-reason {
    padding: 4px 12px 8px;
    color: var(--text-muted);
    font-size: 11px;
    font-style: italic;
}

.weapons-dealer-section-title {
    padding: 4px 12px 2px;
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.weapons-dealer-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 12px;
    border-bottom: 1px solid var(--border-subtle);
    transition: background var(--transition-fast);
}

.weapons-dealer-item:hover {
    background: rgba(255, 170, 51, 0.05);
}

.weapons-dealer-item.out-of-stock {
    opacity: 0.5;
}

.weapons-dealer-item:last-child {
    border-bottom: none;
}

.weapons-dealer-name {
    flex: 1;
    font-size: 12px;
    color: var(--text-primary);
}

.weapons-dealer-price {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--neon-green);
    min-width: 70px;
    text-align: right;
}

.weapons-dealer-stock {
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--text-muted);
    min-width: 70px;
    text-align: right;
}

.weapons-buy-btn {
    padding: 3px 10px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-sm);
    color: var(--neon-green);
    font-family: var(--font-mono);
    font-size: 10px;
    text-transform: uppercase;
    cursor: pointer;
    transition: all var(--transition-fast);
    min-width: 48px;
}

.weapons-buy-btn:hover:not(:disabled) {
    background: var(--neon-green-dim);
    color: var(--neon-green);
    border-color: var(--neon-green);
    box-shadow: 0 0 6px var(--neon-green-dim);
}

.weapons-buy-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.weapons-list {
    flex: 1;
    overflow-y: auto;
}

.weapons-player-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 12px;
    border-bottom: 1px solid var(--border-subtle);
    transition: background var(--transition-fast);
}

.weapons-player-item:hover {
    background: rgba(255, 170, 51, 0.05);
}

.weapons-player-item.equipped {
    background: rgba(255, 170, 51, 0.08);
    border-left: 3px solid var(--neon-amber);
    padding-left: 9px;
}

.weapons-player-item:last-child {
    border-bottom: none;
}

.weapons-player-icon {
    font-size: 14px;
    min-width: 20px;
    text-align: center;
}

.weapons-player-name {
    flex: 1;
    font-size: 12px;
    color: var(--text-primary);
}

.weapons-equipped-badge {
    font-family: var(--font-mono);
    font-size: 9px;
    color: var(--neon-amber);
    background: var(--neon-amber-dim);
    padding: 1px 6px;
    border-radius: var(--radius-sm);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.weapons-ammo-info {
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--text-muted);
}

.weapons-jammed {
    font-family: var(--font-mono);
    font-size: 9px;
    color: var(--neon-red);
    background: var(--neon-red-dim);
    padding: 1px 4px;
    border-radius: var(--radius-sm);
    text-transform: uppercase;
}

.weapons-player-actions {
    display: flex;
    gap: 4px;
}

.weapons-action-btn {
    padding: 3px 8px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-family: var(--font-mono);
    font-size: 9px;
    text-transform: uppercase;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.weapons-action-btn:hover {
    background: var(--neon-amber-dim);
    color: var(--neon-amber);
    border-color: var(--neon-amber);
}

.weapons-ammo-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 12px;
    border-bottom: 1px solid var(--border-subtle);
}

.weapons-ammo-item:last-child {
    border-bottom: none;
}

.weapons-ammo-type {
    flex: 1;
    font-size: 12px;
    color: var(--text-primary);
    text-transform: capitalize;
}

.weapons-ammo-quantity {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--neon-green);
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */

@media (max-width: 768px) {
    #vice-topbar {
        height: auto;
        min-height: 40px;
        padding: 8px 12px;
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .heat-bar-track {
        width: 80px;
    }
}
