/* ===== BizEmpire — Modern Fintech Design v4 ===== */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
    --bg-void: #050810;
    --bg-deep: #0a0f1e;
    --bg-surface: #0e1428;

    /* Glass */
    --glass: rgba(15, 23, 52, 0.45);
    --glass-border: rgba(100, 160, 255, 0.12);
    --glass-shine: rgba(140, 190, 255, 0.06);
    --glass-hover: rgba(20, 35, 70, 0.6);

    /* Accents */
    --cyan: #00e5ff;
    --cyan-dim: rgba(0, 229, 255, 0.15);
    --cyan-glow: rgba(0, 229, 255, 0.3);
    --blue: #4d8dff;
    --blue-dim: rgba(77, 141, 255, 0.15);
    --purple: #a855f7;
    --emerald: #34d399;
    --emerald-dim: rgba(52, 211, 153, 0.12);
    --gold: #fbbf24;
    --gold-dim: rgba(251, 191, 36, 0.12);
    --coral: #ff6b6b;

    /* Text */
    --text-bright: #ffffff;
    --text-primary: #e0e7f5;
    --text-secondary: #a8b8d8;
    --text-muted: #6b7fa3;
    --text-label: #8a9dc0;

    /* Functional */
    --danger: #ff4d6a;
    --danger-bg: rgba(255, 77, 106, 0.1);
    --success: #34d399;
    --success-bg: rgba(52, 211, 153, 0.1);

    /* Fonts */
    --font-display: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-body: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'Inter', -apple-system, monospace;

    /* Geometry */
    --radius: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;

    /* Sidebar */
    --sidebar-width: 220px;

    /* Motion */
    --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    --transition: 0.3s var(--ease-out-expo);
    --transition-slow: 0.6s var(--ease-out-expo);
}

/* ===== Light Theme ===== */

[data-theme="light"] {
    --bg-void: #f0f2f5;
    --bg-deep: #e8ebf0;
    --bg-surface: #ffffff;

    /* Glass */
    --glass: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(0, 0, 0, 0.08);
    --glass-shine: rgba(255, 255, 255, 0.9);
    --glass-hover: rgba(255, 255, 255, 0.85);

    /* Accents (adjusted for contrast on light bg) */
    --cyan: #0099cc;
    --cyan-dim: rgba(0, 153, 204, 0.1);
    --cyan-glow: rgba(0, 153, 204, 0.2);
    --blue: #3366cc;
    --blue-dim: rgba(51, 102, 204, 0.1);
    --purple: #7c3aed;
    --emerald: #059669;
    --emerald-dim: rgba(5, 150, 105, 0.08);
    --gold: #d97706;
    --gold-dim: rgba(217, 119, 6, 0.08);
    --coral: #dc2626;

    /* Text */
    --text-bright: #111827;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --text-muted: #9ca3af;
    --text-label: #6b7280;

    /* Functional */
    --danger: #dc2626;
    --danger-bg: rgba(220, 38, 38, 0.08);
    --success: #059669;
    --success-bg: rgba(5, 150, 105, 0.08);
}

/* Light theme overrides for bg scene */
[data-theme="light"] .bg-gradient {
    background:
        radial-gradient(ellipse 80% 60% at 10% 90%, rgba(0, 153, 204, 0.06) 0%, transparent 60%),
        radial-gradient(ellipse 60% 50% at 85% 20%, rgba(124, 58, 237, 0.05) 0%, transparent 55%),
        radial-gradient(ellipse 70% 70% at 50% 50%, rgba(51, 102, 204, 0.03) 0%, transparent 60%),
        var(--bg-void);
}

[data-theme="light"] .bg-orb--1 { background: radial-gradient(circle, rgba(0, 153, 204, 0.06), transparent 70%); }
[data-theme="light"] .bg-orb--2 { background: radial-gradient(circle, rgba(124, 58, 237, 0.05), transparent 70%); }
[data-theme="light"] .bg-orb--3 { background: radial-gradient(circle, rgba(5, 150, 105, 0.04), transparent 70%); }

[data-theme="light"] .bg-grid {
    background-image: linear-gradient(rgba(0, 0, 0, 0.03) 1px, transparent 1px), linear-gradient(90deg, rgba(0, 0, 0, 0.03) 1px, transparent 1px);
}

[data-theme="light"] .particle { background: rgba(0, 153, 204, 0.25); }
[data-theme="light"] .particle:nth-child(2) { background: rgba(124, 58, 237, 0.2); }
[data-theme="light"] .particle:nth-child(4) { background: rgba(5, 150, 105, 0.2); }
[data-theme="light"] .particle:nth-child(6) { background: rgba(217, 119, 6, 0.2); }

/* Light theme glass override */
[data-theme="light"] .glass {
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.8);
}
[data-theme="light"] .glass:hover {
    border-color: rgba(0, 0, 0, 0.12);
}

/* Light theme auth */
[data-theme="light"] .auth-logo h1 {
    filter: drop-shadow(0 0 10px rgba(0, 153, 204, 0.15));
}

[data-theme="light"] .form-group input {
    background: rgba(255, 255, 255, 0.8);
    border-color: rgba(0, 0, 0, 0.1);
    color: var(--text-bright);
}
[data-theme="light"] .form-group input:focus {
    background: rgba(255, 255, 255, 0.95);
    border-color: var(--cyan);
    box-shadow: 0 0 0 3px var(--cyan-dim);
}
[data-theme="light"] .form-group input::placeholder { color: var(--text-muted); }

/* Light theme game header */
[data-theme="light"] .game-header {
    background: rgba(255, 255, 255, 0.75);
    border-bottom-color: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .header-stat {
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .header-tick {
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .tick-circle-bg { stroke: rgba(0, 0, 0, 0.08); }
[data-theme="light"] .tick-circle-fill { filter: drop-shadow(0 0 3px rgba(0, 153, 204, 0.3)); }

/* Light theme sidebar */
[data-theme="light"] .sidebar {
    background: rgba(255, 255, 255, 0.5);
    border-right-color: rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .sidebar-link:hover {
    background: rgba(0, 153, 204, 0.06);
    border-color: rgba(0, 153, 204, 0.08);
}
[data-theme="light"] .sidebar-link.active {
    background: rgba(0, 153, 204, 0.1);
    color: var(--cyan);
    border-color: rgba(0, 153, 204, 0.15);
}

[data-theme="light"] .sidebar-info-block {
    background: rgba(0, 0, 0, 0.02);
    border-color: rgba(0, 0, 0, 0.06);
}

/* Light theme financial cards */
[data-theme="light"] .period-tabs {
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.06);
}
[data-theme="light"] .period-tab.active {
    background: rgba(0, 153, 204, 0.1);
    color: var(--cyan);
}

/* Light theme market */
[data-theme="light"] .market-item:hover {
    background: rgba(0, 0, 0, 0.03);
}

/* Light theme country stripe */
[data-theme="light"] .country-stripe-header {
    border-bottom-color: rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .enterprise-mini-card {
    background: rgba(0, 0, 0, 0.02);
    border-color: rgba(0, 0, 0, 0.06);
}
[data-theme="light"] .enterprise-mini-card:hover {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.1);
}

/* Light theme modal */
[data-theme="light"] .modal-overlay {
    background: rgba(0, 0, 0, 0.3);
}

[data-theme="light"] .btn-glass {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.1);
    color: var(--text-secondary);
}
[data-theme="light"] .btn-glass:hover {
    background: rgba(0, 0, 0, 0.08);
    color: var(--text-bright);
}

[data-theme="light"] .btn-create-enterprise {
    background: linear-gradient(135deg, rgba(0, 153, 204, 0.1), rgba(51, 102, 204, 0.1));
    border-color: rgba(0, 153, 204, 0.2);
    color: var(--cyan);
}
[data-theme="light"] .btn-create-enterprise:hover {
    background: linear-gradient(135deg, rgba(0, 153, 204, 0.18), rgba(51, 102, 204, 0.18));
    border-color: var(--cyan);
}

[data-theme="light"] .btn-logout {
    background: rgba(220, 38, 38, 0.05);
    border-color: rgba(220, 38, 38, 0.12);
}
[data-theme="light"] .btn-logout:hover {
    background: rgba(220, 38, 38, 0.1);
}

[data-theme="light"] .player-avatar {
    box-shadow: 0 0 10px rgba(0, 153, 204, 0.15);
}

/* ===== Theme Toggle Button ===== */

.theme-toggle {
    display: flex; align-items: center; justify-content: center;
    width: 36px; height: 36px; border-radius: 50%;
    background: rgba(100, 160, 255, 0.08);
    border: 1px solid var(--glass-border);
    color: var(--text-secondary);
    cursor: pointer; transition: all var(--transition);
    flex-shrink: 0; position: relative;
}
.theme-toggle:hover {
    background: rgba(100, 160, 255, 0.15);
    color: var(--text-bright);
    border-color: rgba(100, 160, 255, 0.25);
    transform: rotate(15deg);
}

.theme-toggle svg { width: 18px; height: 18px; transition: all 0.4s var(--ease-spring); }

.theme-icon-sun,
.theme-icon-moon { position: absolute; }

/* Dark theme: show moon, hide sun */
.theme-icon-sun { opacity: 0; transform: scale(0.5) rotate(-90deg); }
.theme-icon-moon { opacity: 1; transform: scale(1) rotate(0deg); }

[data-theme="light"] .theme-icon-sun { opacity: 1; transform: scale(1) rotate(0deg); }
[data-theme="light"] .theme-icon-moon { opacity: 0; transform: scale(0.5) rotate(90deg); }

[data-theme="light"] .theme-toggle {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.08);
}
[data-theme="light"] .theme-toggle:hover {
    background: rgba(0, 0, 0, 0.08);
    border-color: rgba(0, 0, 0, 0.15);
}

/* ===== Transition for theme switch ===== */

html.theme-transition,
html.theme-transition *,
html.theme-transition *::before,
html.theme-transition *::after {
    transition: background 0.3s ease, background-color 0.3s ease, color 0.2s ease,
                border-color 0.3s ease, box-shadow 0.3s ease, fill 0.2s ease, stroke 0.2s ease !important;
}

/* ===== Reset ===== */

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
    font-family: var(--font-body);
    background: var(--bg-void);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    font-size: 15px;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

a { color: var(--cyan); text-decoration: none; transition: color var(--transition); font-weight: 500; }
a:hover { color: #fff; }

/* ===== Animated Background ===== */

.bg-scene { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }

.bg-gradient {
    position: absolute; inset: 0;
    background:
        radial-gradient(ellipse 80% 60% at 10% 90%, rgba(0, 229, 255, 0.07) 0%, transparent 60%),
        radial-gradient(ellipse 60% 50% at 85% 20%, rgba(168, 85, 247, 0.06) 0%, transparent 55%),
        radial-gradient(ellipse 70% 70% at 50% 50%, rgba(77, 141, 255, 0.04) 0%, transparent 60%),
        var(--bg-void);
}

.bg-orb { position: absolute; border-radius: 50%; filter: blur(80px); animation: orbFloat 20s ease-in-out infinite; }
.bg-orb--1 { width: 500px; height: 500px; top: -10%; left: -5%; background: radial-gradient(circle, rgba(0, 229, 255, 0.12), transparent 70%); animation-duration: 25s; }
.bg-orb--2 { width: 400px; height: 400px; bottom: -10%; right: -5%; background: radial-gradient(circle, rgba(168, 85, 247, 0.1), transparent 70%); animation-duration: 30s; animation-delay: -10s; }
.bg-orb--3 { width: 350px; height: 350px; top: 40%; left: 50%; background: radial-gradient(circle, rgba(52, 211, 153, 0.06), transparent 70%); animation-duration: 22s; animation-delay: -5s; }

@keyframes orbFloat {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(40px, -30px) scale(1.1); }
    50% { transform: translate(-20px, 50px) scale(0.95); }
    75% { transform: translate(30px, 20px) scale(1.05); }
}

.bg-grid {
    position: absolute; inset: 0;
    background-image: linear-gradient(rgba(100, 160, 255, 0.03) 1px, transparent 1px), linear-gradient(90deg, rgba(100, 160, 255, 0.03) 1px, transparent 1px);
    background-size: 60px 60px;
    mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, black 20%, transparent 70%);
    -webkit-mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, black 20%, transparent 70%);
}

.bg-particles { position: absolute; inset: 0; }
.particle { position: absolute; width: 2px; height: 2px; border-radius: 50%; background: rgba(0, 229, 255, 0.4); animation: particleDrift linear infinite; }
.particle:nth-child(1) { left: 10%; top: 20%; animation-duration: 15s; }
.particle:nth-child(2) { left: 30%; top: 60%; animation-duration: 18s; animation-delay: -3s; width: 3px; height: 3px; background: rgba(168, 85, 247, 0.3); }
.particle:nth-child(3) { left: 55%; top: 10%; animation-duration: 20s; animation-delay: -7s; }
.particle:nth-child(4) { left: 75%; top: 70%; animation-duration: 16s; animation-delay: -12s; width: 3px; height: 3px; background: rgba(52, 211, 153, 0.3); }
.particle:nth-child(5) { left: 90%; top: 40%; animation-duration: 22s; animation-delay: -4s; }
.particle:nth-child(6) { left: 20%; top: 80%; animation-duration: 19s; animation-delay: -9s; background: rgba(251, 191, 36, 0.3); }
.particle:nth-child(7) { left: 65%; top: 45%; animation-duration: 17s; animation-delay: -15s; }
.particle:nth-child(8) { left: 45%; top: 85%; animation-duration: 21s; animation-delay: -2s; width: 3px; height: 3px; }

@keyframes particleDrift {
    0% { transform: translateY(0) translateX(0) scale(1); opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { transform: translateY(-100vh) translateX(30px) scale(0.5); opacity: 0; }
}

/* ===== Glass ===== */

.glass {
    background: var(--glass);
    backdrop-filter: blur(24px) saturate(1.4);
    -webkit-backdrop-filter: blur(24px) saturate(1.4);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3), inset 0 1px 0 var(--glass-shine);
    transition: all var(--transition);
    position: relative;
    overflow: hidden;
}

.glass:hover { border-color: rgba(100, 160, 255, 0.15); }

/* ===== Auth Pages ===== */

.auth-theme-toggle {
    position: fixed; top: 20px; right: 20px; z-index: 50;
}

.auth-page { position: relative; display: flex; min-height: 100vh; align-items: center; justify-content: center; z-index: 1; }

.auth-container { width: 100%; max-width: 440px; padding: 20px; animation: authAppear 0.8s var(--ease-out-expo) both; }

@keyframes authAppear { from { opacity: 0; transform: translateY(30px) scale(0.96); filter: blur(8px); } to { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); } }

.auth-logo { text-align: center; margin-bottom: 36px; }
.auth-logo h1 {
    font-family: var(--font-display); font-size: 38px; font-weight: 800; letter-spacing: -0.5px;
    background: linear-gradient(135deg, var(--cyan) 0%, var(--blue) 40%, var(--purple) 100%);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
    filter: drop-shadow(0 0 20px rgba(0, 229, 255, 0.2));
    animation: logoGlow 3s ease-in-out infinite alternate;
}
@keyframes logoGlow { from { filter: drop-shadow(0 0 15px rgba(0, 229, 255, 0.15)); } to { filter: drop-shadow(0 0 25px rgba(0, 229, 255, 0.3)); } }

.auth-logo .subtitle { color: var(--text-secondary); font-size: 15px; font-weight: 400; margin-top: 8px; letter-spacing: 0.5px; }

.auth-card { padding: 36px; }
.auth-card h2 { font-family: var(--font-display); font-size: 22px; font-weight: 700; margin-bottom: 28px; color: var(--text-bright); }

/* ===== Form ===== */

.form-group { margin-bottom: 22px; position: relative; }
.form-group label { display: block; font-size: 13px; font-weight: 600; color: var(--text-label); margin-bottom: 8px; }
.form-group input {
    width: 100%; padding: 14px 16px; background: rgba(10, 15, 30, 0.6); border: 1px solid rgba(100, 160, 255, 0.1);
    border-radius: var(--radius); color: var(--text-bright); font-size: 15px; font-family: var(--font-body);
    font-weight: 400; transition: all var(--transition); outline: none; backdrop-filter: blur(8px);
}
.form-group input:focus { border-color: var(--cyan); box-shadow: 0 0 0 3px var(--cyan-dim), 0 0 20px rgba(0, 229, 255, 0.08); background: rgba(10, 15, 30, 0.8); }
.form-group input::placeholder { color: var(--text-muted); font-weight: 400; }

.form-error { font-size: 13px; color: var(--danger); margin-top: 6px; display: none; font-weight: 500; }
.form-error.visible { display: block; animation: shakeIn 0.4s var(--ease-spring); }
@keyframes shakeIn { 0% { transform: translateX(-8px); opacity: 0; } 50% { transform: translateX(4px); } 100% { transform: translateX(0); opacity: 1; } }

/* ===== Buttons ===== */

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 10px;
    padding: 14px 28px; font-size: 15px; font-weight: 600; font-family: var(--font-display);
    border: none; border-radius: var(--radius);
    cursor: pointer; transition: all var(--transition); outline: none; position: relative; overflow: hidden;
}
.btn-primary {
    width: 100%; background: linear-gradient(135deg, var(--cyan), var(--blue)); color: #fff;
    box-shadow: 0 4px 20px rgba(0, 229, 255, 0.25);
}
.btn-primary:hover { opacity: 0.9; }
.btn-primary:active { opacity: 0.8; }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none; }

/* ===== Alerts ===== */

.alert { padding: 14px 18px; border-radius: var(--radius); font-size: 14px; font-weight: 500; margin-bottom: 22px; display: none; backdrop-filter: blur(12px); }
.alert.visible { display: block; animation: alertSlide 0.4s var(--ease-spring); }
@keyframes alertSlide { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }
.alert-error { background: var(--danger-bg); border: 1px solid rgba(255, 77, 106, 0.2); color: var(--danger); }
.alert-success { background: var(--success-bg); border: 1px solid rgba(52, 211, 153, 0.2); color: var(--success); }

.auth-footer { text-align: center; margin-top: 24px; font-size: 15px; color: var(--text-secondary); font-weight: 500; }

.spinner { width: 20px; height: 20px; border: 2px solid rgba(255, 255, 255, 0.2); border-top-color: #fff; border-radius: 50%; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ================================================
   GAME PAGE — SIDEBAR + DASHBOARD LAYOUT
   ================================================ */

.game-page { min-height: 100vh; display: flex; flex-direction: column; position: relative; z-index: 1; }

/* ===== Game Header ===== */

.game-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 24px; height: 60px;
    background: var(--glass); backdrop-filter: blur(30px) saturate(1.5); -webkit-backdrop-filter: blur(30px) saturate(1.5);
    border-bottom: 1px solid var(--glass-border);
    position: sticky; top: 0; z-index: 100;
    animation: headerSlide 0.6s var(--ease-out-expo) both;
}
@keyframes headerSlide { from { opacity: 0; transform: translateY(-100%); } to { opacity: 1; transform: translateY(0); } }

.game-header .logo {
    font-family: var(--font-display); font-size: 20px; font-weight: 800; letter-spacing: -0.5px;
    background: linear-gradient(135deg, var(--cyan), var(--blue));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}

.header-center { display: flex; align-items: center; gap: 16px; }

.header-stat { display: flex; align-items: center; gap: 8px; padding: 6px 14px; background: rgba(10, 15, 30, 0.4); border: 1px solid var(--glass-border); border-radius: 30px; font-size: 14px; font-weight: 500; }
.header-stat .stat-icon { font-size: 16px; }
.header-stat .stat-value { color: var(--gold); font-family: var(--font-display); font-size: 13px; font-weight: 700; }

/* Circular Tick Timer */
.header-tick {
    display: flex; align-items: center; gap: 10px;
    padding: 4px 14px 4px 4px;
    background: rgba(10, 15, 30, 0.4); border: 1px solid var(--glass-border); border-radius: 30px;
}

.tick-circle { position: relative; width: 42px; height: 42px; }
.tick-circle svg { width: 42px; height: 42px; transform: rotate(-90deg); }
.tick-circle-bg { fill: none; stroke: rgba(100, 160, 255, 0.1); stroke-width: 3; }
.tick-circle-fill { fill: none; stroke: var(--cyan); stroke-width: 3; stroke-linecap: round; transition: stroke-dashoffset 1s linear; filter: drop-shadow(0 0 4px rgba(0, 229, 255, 0.4)); }

.tick-circle-text {
    position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
    font-family: var(--font-display); font-size: 10px; font-weight: 700; color: var(--text-bright);
}

.tick-circle-label { font-size: 13px; font-weight: 500; color: var(--text-secondary); white-space: nowrap; }

/* Create Enterprise Button */
.btn-create-enterprise {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 18px; font-size: 14px; font-family: var(--font-body); font-weight: 600;
    background: linear-gradient(135deg, rgba(0, 229, 255, 0.15), rgba(77, 141, 255, 0.15));
    color: var(--cyan); border: 1px solid rgba(0, 229, 255, 0.25); border-radius: var(--radius);
    cursor: pointer; transition: all var(--transition); white-space: nowrap;
}
.btn-create-enterprise svg { width: 16px; height: 16px; flex-shrink: 0; }
.btn-create-enterprise:hover {
    background: linear-gradient(135deg, rgba(0, 229, 255, 0.25), rgba(77, 141, 255, 0.25));
    border-color: var(--cyan);
}

.header-right { display: flex; align-items: center; gap: 14px; }
.player-info { display: flex; align-items: center; gap: 10px; }
.player-avatar {
    width: 34px; height: 34px; border-radius: 50%;
    background: linear-gradient(135deg, var(--cyan), var(--purple));
    display: flex; align-items: center; justify-content: center;
    font-family: var(--font-display); font-size: 13px; font-weight: 700; color: #fff;
    box-shadow: 0 0 15px rgba(0, 229, 255, 0.2);
    animation: avatarPulse 3s ease-in-out infinite;
}
@keyframes avatarPulse { 0%, 100% { box-shadow: 0 0 12px rgba(0, 229, 255, 0.15); } 50% { box-shadow: 0 0 20px rgba(0, 229, 255, 0.3); } }

.player-name { font-weight: 600; color: var(--text-bright); font-size: 15px; }

.btn-logout {
    padding: 7px 14px; font-size: 13px; font-family: var(--font-body); font-weight: 600;
    background: rgba(255, 77, 106, 0.08);
    color: var(--text-secondary); border: 1px solid rgba(255, 77, 106, 0.15); border-radius: var(--radius);
    cursor: pointer; transition: all var(--transition);
}
.btn-logout:hover { color: var(--danger); border-color: var(--danger); background: rgba(255, 77, 106, 0.15); }

/* ===== LAYOUT: Sidebar + Main ===== */

.game-body { display: flex; flex: 1; }

/* ===== SIDEBAR ===== */

.sidebar {
    width: var(--sidebar-width); min-height: calc(100vh - 60px);
    background: rgba(8, 12, 28, 0.6); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    border-right: 1px solid var(--glass-border);
    padding: 16px 0; display: flex; flex-direction: column;
    animation: sidebarSlide 0.6s var(--ease-out-expo) 0.1s both;
    position: sticky; top: 60px; height: calc(100vh - 60px); overflow-y: auto;
}
@keyframes sidebarSlide { from { opacity: 0; transform: translateX(-30px); } to { opacity: 1; transform: translateX(0); } }

.sidebar-section { padding: 0 12px; margin-bottom: 24px; }
.sidebar-section-title {
    font-size: 11px; font-weight: 600; color: var(--text-muted); text-transform: uppercase;
    letter-spacing: 1px; padding: 0 12px; margin-bottom: 8px;
}

.sidebar-nav { list-style: none; }

.sidebar-link {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 14px; margin: 2px 4px; border-radius: var(--radius);
    color: var(--text-secondary); font-size: 14px; font-weight: 500;
    cursor: pointer; transition: all var(--transition); text-decoration: none;
    border: 1px solid transparent;
}
.sidebar-link:hover {
    background: rgba(0, 229, 255, 0.06); color: var(--text-bright);
    border-color: rgba(0, 229, 255, 0.08);
}
.sidebar-link.active {
    background: rgba(0, 229, 255, 0.1); color: var(--cyan);
    border-color: rgba(0, 229, 255, 0.15); box-shadow: 0 0 15px rgba(0, 229, 255, 0.05);
}
.sidebar-link .link-icon { font-size: 18px; width: 24px; text-align: center; flex-shrink: 0; }
.sidebar-link .link-text { white-space: nowrap; }

/* Sidebar info block */
.sidebar-info-block {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 14px; margin: 0 4px; border-radius: var(--radius);
    background: rgba(10, 15, 30, 0.4); border: 1px solid var(--glass-border);
}
.sidebar-info-icon { font-size: 22px; line-height: 1; flex-shrink: 0; }
.sidebar-info-text h4 { font-family: var(--font-display); font-size: 13px; font-weight: 700; color: var(--text-bright); }
.sidebar-info-text p { font-size: 12px; color: var(--text-secondary); font-weight: 400; }

/* Sidebar spacer */
.sidebar-spacer { flex: 1; }

/* ===== Main Content ===== */

.game-main {
    flex: 1; padding: 28px 28px;
    animation: fadeIn 0.8s var(--ease-out-expo) 0.3s both;
}

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

/* ===== Dashboard Sections ===== */

.dashboard-section { margin-bottom: 28px; }

.section-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 18px;
}

.section-title {
    font-family: var(--font-display); font-size: 18px; font-weight: 700;
    color: var(--text-bright);
}

/* Period tabs */
.period-tabs { display: flex; gap: 4px; background: rgba(10, 15, 30, 0.5); border-radius: var(--radius); padding: 3px; border: 1px solid var(--glass-border); }
.period-tab {
    padding: 6px 16px; font-size: 13px; font-weight: 600; font-family: var(--font-body);
    color: var(--text-muted); background: transparent; border: none; border-radius: 8px;
    cursor: pointer; transition: all var(--transition);
}
.period-tab:hover { color: var(--text-secondary); }
.period-tab.active {
    background: rgba(0, 229, 255, 0.12); color: var(--cyan);
    box-shadow: 0 0 10px rgba(0, 229, 255, 0.08);
}

/* ===== Financial Cards ===== */

.fin-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }

.fin-card {
    padding: 20px; border-radius: var(--radius-lg);
    animation: cardAppear 0.6s var(--ease-out-expo) both;
}
.fin-card:nth-child(1) { animation-delay: 0.15s; }
.fin-card:nth-child(2) { animation-delay: 0.25s; }
.fin-card:nth-child(3) { animation-delay: 0.35s; }
.fin-card:nth-child(4) { animation-delay: 0.45s; }

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

.fin-card-header { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.fin-card-icon {
    width: 36px; height: 36px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 18px; flex-shrink: 0;
}
.fin-card-label { font-size: 14px; font-weight: 500; color: var(--text-secondary); }

.fin-card-value {
    font-family: var(--font-display); font-size: 24px; font-weight: 700;
    margin-bottom: 8px; letter-spacing: -0.5px;
}

.fin-card-change {
    display: flex; align-items: center; gap: 6px;
    font-size: 13px; font-weight: 500;
}
.fin-card-change svg { width: 16px; height: 16px; }
.fin-card-change.positive { color: var(--emerald); }
.fin-card-change.negative { color: var(--coral); }
.fin-card-change.neutral { color: var(--text-muted); }

/* ===== Dashboard Row (Charts + Market) ===== */

.dashboard-row {
    display: grid; grid-template-columns: 1.4fr 1fr; gap: 20px;
    margin-bottom: 28px;
}

.dash-panel { padding: 22px; border-radius: var(--radius-lg); }

.dash-panel-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 18px;
}

.dash-panel-header h3 {
    font-family: var(--font-display); font-size: 15px; font-weight: 700;
    color: var(--text-bright);
}

/* Chart placeholder */
.chart-placeholder { width: 100%; height: 160px; border-radius: var(--radius); overflow: hidden; }
.chart-placeholder svg { width: 100%; height: 100%; }

/* Market list */
.market-list { display: flex; flex-direction: column; gap: 4px; }

.market-item {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 12px; border-radius: 10px;
    transition: all var(--transition);
}
.market-item:hover { background: rgba(100, 160, 255, 0.05); }

.market-item-left {
    display: flex; align-items: center; gap: 10px;
    min-width: 140px; flex-shrink: 0;
}

.market-icon {
    width: 34px; height: 34px; border-radius: 9px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.market-icon svg { width: 18px; height: 18px; }

.market-item-info { display: flex; flex-direction: column; gap: 1px; }
.market-item-name {
    font-size: 14px; font-weight: 600; color: var(--text-bright);
    line-height: 1.2;
}
.market-item-cat {
    font-size: 11px; font-weight: 500; color: var(--text-muted);
}

/* Sparkline */
.market-sparkline {
    flex: 1; height: 32px; min-width: 70px; max-width: 100px;
    opacity: 0.9;
}
.market-sparkline svg { width: 100%; height: 100%; display: block; }

.market-item-right {
    display: flex; flex-direction: column; align-items: flex-end; gap: 1px;
    min-width: 90px; text-align: right; flex-shrink: 0;
}

.market-item-price {
    font-family: var(--font-display); font-size: 14px; font-weight: 700;
    color: var(--text-bright); line-height: 1.2; white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.market-item-change { font-size: 12px; font-weight: 600; }
.market-item-change.positive { color: var(--emerald); }
.market-item-change.negative { color: var(--coral); }
.market-item-change.neutral { color: var(--text-muted); }

/* ===== Country Stripe ===== */

.country-stripe { padding: 22px; border-radius: var(--radius-lg); }

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

.country-stripe-title { display: flex; align-items: center; gap: 12px; }
.country-stripe-flag { font-size: 26px; line-height: 1; }
.country-stripe-title h3 {
    font-family: var(--font-display); font-size: 16px; font-weight: 700;
    color: var(--text-bright);
}

/* Cities */
.country-cities { display: flex; flex-direction: column; gap: 14px; }

.city-row { display: flex; flex-direction: column; gap: 10px; }
.city-row-header {
    display: flex; align-items: center; gap: 10px;
    font-size: 15px; font-weight: 600; color: var(--text-primary);
}
.city-row-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--cyan); flex-shrink: 0; }

.enterprise-cards { display: flex; gap: 12px; flex-wrap: wrap; padding-left: 18px; }

.enterprise-mini-card {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 16px; border-radius: var(--radius);
    background: rgba(10, 15, 30, 0.5); border: 1px solid var(--glass-border);
    transition: all var(--transition); cursor: pointer;
}
.enterprise-mini-card:hover {
    background: rgba(10, 15, 30, 0.7); border-color: rgba(100, 160, 255, 0.2);
}
.enterprise-mini-icon { font-size: 20px; }
.enterprise-mini-name { font-size: 14px; font-weight: 600; color: var(--text-bright); }
.enterprise-mini-type { font-size: 12px; color: var(--text-muted); }

/* Country empty */
.country-empty { text-align: center; padding: 20px 0; }
.country-empty p { font-size: 15px; color: var(--text-muted); font-weight: 400; }

/* ===== Modal ===== */

.modal-overlay {
    position: fixed; inset: 0; background: rgba(5, 8, 16, 0.7);
    backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
    z-index: 1000; display: flex; align-items: center; justify-content: center;
    opacity: 0; pointer-events: none; transition: opacity 0.3s ease;
}
.modal-overlay.active { opacity: 1; pointer-events: auto; }

.modal-content { width: 90%; max-width: 460px; padding: 32px; transform: scale(0.92) translateY(20px); transition: transform 0.4s var(--ease-spring); }
.modal-overlay.active .modal-content { transform: scale(1) translateY(0); }

.modal-icon { width: 56px; height: 56px; border-radius: 50%; display: flex; align-items: center; justify-content: center; margin: 0 auto 20px; font-size: 24px; }
.modal-icon--info { background: var(--cyan-dim); box-shadow: 0 0 20px rgba(0, 229, 255, 0.15); }

.modal-title { font-family: var(--font-display); font-size: 20px; font-weight: 700; color: var(--text-bright); text-align: center; margin-bottom: 10px; }
.modal-text { text-align: center; color: var(--text-secondary); font-size: 15px; line-height: 1.6; margin-bottom: 28px; }
.modal-actions { display: flex; gap: 12px; }
.modal-actions .btn { flex: 1; font-size: 14px; padding: 12px 20px; }

.btn-glass {
    background: rgba(100, 160, 255, 0.08); border: 1px solid var(--glass-border);
    color: var(--text-secondary); font-family: var(--font-display);
}
.btn-glass:hover { background: rgba(100, 160, 255, 0.15); color: var(--text-bright); border-color: rgba(100, 160, 255, 0.3); }

/* ===== Responsive ===== */

@media (max-width: 1200px) {
    .fin-cards { grid-template-columns: repeat(2, 1fr); }
    .dashboard-row { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
    .sidebar { display: none; }
    .game-main { padding: 20px 14px; }
    .fin-cards { grid-template-columns: 1fr 1fr; }
    .header-center { display: none; }
}

@media (max-width: 600px) {
    .fin-cards { grid-template-columns: 1fr; }
    .game-header .logo { font-size: 16px; }
    .player-name { display: none; }
    .btn-create-enterprise { padding: 8px 12px; font-size: 0; }
    .btn-create-enterprise svg { width: 18px; height: 18px; }
    .auth-logo h1 { font-size: 30px; }
    .auth-card { padding: 28px; }
}

/* ================================================
   CITY BUILDER — MAP PAGE
   ================================================ */

/* Page switching */
.page-content { display: none; }
.page-content.active { display: block; }
.page-content--citymap.active { display: flex; flex-direction: column; flex: 1; min-height: 0; height: 100%; }
.page-content--worldmap.active { display: flex; flex-direction: column; flex: 1; min-height: 0; height: 100%; }

/* Map-active / Worldmap-active main area */
.game-main.worldmap-active {
    padding: 0;
    height: calc(100vh - 60px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: none;
}
.game-main.map-active {
    padding: 0;
    height: calc(100vh - 60px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: none;
}

/* Canvas container */
.map-canvas-container {
    flex: 1;
    position: relative;
    overflow: hidden;
    min-height: 0;
}

#mapCanvas {
    position: absolute;
    top: 0;
    left: 0;
    display: block;
    cursor: grab;
}

/* ===== Stats Panel (top-left) ===== */

.cb-stats-panel {
    position: absolute;
    left: 16px;
    top: 16px;
    z-index: 10;
    padding: 16px;
    min-width: 200px;
    border-radius: var(--radius-lg);
    pointer-events: auto;
}

.cb-stats-panel h3 {
    font-family: var(--font-display);
    font-size: 13px;
    font-weight: 700;
    color: var(--text-bright);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cb-stat-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 5px 0;
    font-size: 13px;
}

.cb-stat-row .cb-stat-label {
    color: var(--text-secondary);
    font-weight: 500;
}

.cb-stat-row .cb-stat-value {
    color: var(--text-bright);
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 14px;
}

.cb-stat-row .cb-stat-value.money { color: var(--gold); }
.cb-stat-row .cb-stat-value.pop { color: var(--cyan); }
.cb-stat-row .cb-stat-value.happy { color: var(--emerald); }
.cb-stat-row .cb-stat-value.jobs { color: var(--blue); }

/* ===== Info Panel (bottom-left) ===== */

.cb-info-panel {
    position: absolute;
    left: 16px;
    bottom: 16px;
    z-index: 10;
    padding: 16px;
    min-width: 240px;
    max-width: 300px;
    border-radius: var(--radius-lg);
    display: none;
    pointer-events: auto;
}

.cb-info-close {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
    font-size: 16px;
    line-height: 1;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, color 0.15s;
}
.cb-info-close:hover {
    background: rgba(255, 255, 255, 0.2);
    color: var(--text-bright);
}

.cb-info-panel h4 {
    font-family: var(--font-display);
    font-size: 15px;
    font-weight: 700;
    color: var(--text-bright);
    margin-bottom: 10px;
}

.info-section { margin-bottom: 10px; padding-bottom: 8px; border-bottom: 1px solid var(--glass-border); }
.info-section:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.info-section-title { font-size: 12px; font-weight: 600; color: var(--text-muted); margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.5px; }
.info-row { display: flex; justify-content: space-between; font-size: 13px; padding: 2px 0; }
.info-row span:first-child { color: var(--text-secondary); }
.info-row span:last-child { color: var(--text-bright); font-weight: 600; }
.info-row .positive { color: var(--emerald); }
.info-row .negative { color: var(--coral); }
.info-row .neutral { color: var(--text-muted); }

/* ===== Special Tools (top-right) ===== */

.cb-special-tools {
    position: absolute;
    right: 16px;
    top: 16px;
    z-index: 10;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: auto;
}

.cb-special-btn {
    width: 44px;
    height: 44px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    cursor: pointer;
    transition: all var(--transition);
    background: var(--glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    color: var(--text-secondary);
}

.cb-special-btn:hover {
    background: var(--glass-hover);
    border-color: rgba(100, 160, 255, 0.25);
    color: var(--text-bright);
    transform: scale(1.05);
}

.cb-special-btn.active {
    background: rgba(0, 229, 255, 0.15);
    border-color: var(--cyan);
    color: var(--cyan);
    box-shadow: 0 0 15px rgba(0, 229, 255, 0.15);
}

.cb-save-btn {
    background: rgba(46, 204, 113, 0.12) !important;
    border-color: rgba(46, 204, 113, 0.3) !important;
}
.cb-save-btn:hover {
    background: rgba(46, 204, 113, 0.22) !important;
    border-color: rgba(46, 204, 113, 0.5) !important;
    box-shadow: 0 0 15px rgba(46, 204, 113, 0.15) !important;
}

/* ===== Toolbar (bottom, flex child) ===== */

.cb-toolbar {
    flex-shrink: 0;
    background: var(--glass);
    backdrop-filter: blur(24px) saturate(1.4);
    -webkit-backdrop-filter: blur(24px) saturate(1.4);
    border-top: 1px solid var(--glass-border);
    z-index: 20;
}

.cb-categories {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--glass-border);
    overflow-x: auto;
    scrollbar-width: none;
}
.cb-categories::-webkit-scrollbar { display: none; }

.cb-category-tab {
    padding: 10px 16px;
    font-size: 13px;
    font-weight: 600;
    font-family: var(--font-body);
    color: var(--text-muted);
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 6px;
}

.cb-category-tab:hover {
    color: var(--text-secondary);
    background: rgba(100, 160, 255, 0.04);
}

.cb-category-tab.active {
    color: var(--cyan);
    border-bottom-color: var(--cyan);
}

.cb-category-tab .cat-icon { font-size: 16px; }

.cb-toolbar-items {
    display: flex;
    gap: 10px;
    padding: 12px 16px;
    overflow-x: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(100, 160, 255, 0.15) transparent;
}
.cb-toolbar-items::-webkit-scrollbar { height: 4px; }
.cb-toolbar-items::-webkit-scrollbar-thumb { background: rgba(100, 160, 255, 0.15); border-radius: 4px; }

.tool-item {
    min-width: 100px;
    max-width: 100px;
    height: 88px;
    padding: 8px;
    border-radius: var(--radius);
    background: rgba(10, 15, 30, 0.4);
    border: 1px solid var(--glass-border);
    cursor: pointer;
    transition: all var(--transition);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    flex-shrink: 0;
    position: relative;
    text-align: center;
}

.tool-item:hover {
    background: rgba(10, 15, 30, 0.6);
    border-color: rgba(100, 160, 255, 0.2);
}

.tool-item.selected {
    background: rgba(0, 229, 255, 0.12);
    border-color: var(--cyan);
    box-shadow: 0 0 15px rgba(0, 229, 255, 0.12);
}

.tool-cost {
    font-size: 10px;
    font-weight: 700;
    color: var(--gold);
    font-family: var(--font-display);
}

.tool-icon {
    font-size: 24px;
    line-height: 1;
}

.tool-name {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    width: 100%;
}

.tool-info {
    font-size: 10px;
    color: var(--text-muted);
    font-weight: 500;
}

/* ===== Toast Notifications ===== */

.cb-notification {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    padding: 12px 24px;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 600;
    font-family: var(--font-body);
    z-index: 9999;
    animation: cbNotifSlide 0.4s var(--ease-spring), cbNotifFade 0.4s ease 2.6s forwards;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    pointer-events: none;
    white-space: nowrap;
}

.cb-notification.success {
    background: rgba(52, 211, 153, 0.2);
    border: 1px solid rgba(52, 211, 153, 0.3);
    color: var(--emerald);
}

.cb-notification.error {
    background: rgba(255, 77, 106, 0.2);
    border: 1px solid rgba(255, 77, 106, 0.3);
    color: var(--danger);
}

.cb-notification.warning {
    background: rgba(251, 191, 36, 0.2);
    border: 1px solid rgba(251, 191, 36, 0.3);
    color: var(--gold);
}

.cb-notification.info {
    background: rgba(0, 229, 255, 0.15);
    border: 1px solid rgba(0, 229, 255, 0.25);
    color: var(--cyan);
}

@keyframes cbNotifSlide { from { opacity: 0; transform: translateX(-50%) translateY(-20px); } to { opacity: 1; transform: translateX(-50%) translateY(0); } }
@keyframes cbNotifFade { to { opacity: 0; transform: translateX(-50%) translateY(-10px); } }

/* ===== Light Theme Overrides for CityBuilder ===== */

[data-theme="light"] .cb-stats-panel,
[data-theme="light"] .cb-info-panel {
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .cb-special-btn {
    background: rgba(255, 255, 255, 0.7);
    border-color: rgba(0, 0, 0, 0.08);
}
[data-theme="light"] .cb-special-btn:hover {
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(0, 0, 0, 0.15);
}
[data-theme="light"] .cb-special-btn.active {
    background: rgba(0, 153, 204, 0.1);
    border-color: var(--cyan);
}

[data-theme="light"] .cb-toolbar {
    background: rgba(255, 255, 255, 0.8);
    border-top-color: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .cb-categories {
    border-bottom-color: rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .cb-category-tab.active {
    color: var(--cyan);
    border-bottom-color: var(--cyan);
}

[data-theme="light"] .tool-item {
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.06);
}
[data-theme="light"] .tool-item:hover {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.1);
}
[data-theme="light"] .tool-item.selected {
    background: rgba(0, 153, 204, 0.08);
    border-color: var(--cyan);
}

[data-theme="light"] .info-section {
    border-bottom-color: rgba(0, 0, 0, 0.06);
}

/* Map page responsive */
@media (max-width: 900px) {
    .cb-stats-panel { display: none; }
    .cb-special-tools { top: 8px; right: 8px; }
    .cb-special-btn { width: 38px; height: 38px; font-size: 16px; }
}

@media (max-width: 600px) {
    .cb-toolbar-items { padding: 8px 10px; gap: 8px; }
    .tool-item { min-width: 80px; max-width: 80px; height: 76px; }
    .tool-icon { font-size: 20px; }
    .cb-category-tab { padding: 8px 12px; font-size: 12px; }
}


/* ================================================
   WORLD MAP
   ================================================ */

.worldmap-container {
    flex: 1;
    position: relative;
    overflow: hidden;
    min-height: 0;
    background: var(--bg-void, #050810);
}

.worldmap-svg {
    display: block;
    cursor: grab;
}
.worldmap-svg:active {
    cursor: grabbing;
}

/* Country paths */
.country {
    cursor: pointer;
    transition: fill-opacity 0.3s ease, stroke-width 0.3s ease;
}
.country--active:hover {
    filter: drop-shadow(0 0 8px currentColor);
}
.country--inactive {
    cursor: default;
}

/* Tooltip */
.worldmap-tooltip {
    position: fixed;
    z-index: 100;
    padding: 10px 14px;
    background: var(--glass);
    backdrop-filter: blur(20px) saturate(1.4);
    -webkit-backdrop-filter: blur(20px) saturate(1.4);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    pointer-events: none;
    opacity: 0;
    transform: translateY(4px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    display: flex;
    align-items: center;
    gap: 10px;
}
.worldmap-tooltip.visible {
    opacity: 1;
    transform: translateY(0);
}
.worldmap-tooltip-flag {
    font-size: 22px;
    line-height: 1;
}
.worldmap-tooltip-name {
    font-family: var(--font-display);
    font-size: 14px;
    font-weight: 600;
    color: var(--text-bright);
}
.worldmap-tooltip-status {
    font-size: 11px;
    font-weight: 500;
    margin-top: 2px;
}
.worldmap-tooltip-status.status-active {
    color: var(--emerald);
}
.worldmap-tooltip-status.status-inactive {
    color: var(--text-muted);
}

/* Zoom controls */
.worldmap-controls {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 10;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 6px;
    border-radius: var(--radius);
}
.worldmap-ctrl-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 8px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition);
}
.worldmap-ctrl-btn:hover {
    background: var(--cyan-dim);
    color: var(--cyan);
    border-color: rgba(0, 229, 255, 0.15);
}
.worldmap-ctrl-btn svg {
    width: 18px;
    height: 18px;
}

/* Country detail panel */
.worldmap-country-panel {
    position: absolute;
    top: 16px;
    right: 70px;
    z-index: 10;
    width: 280px;
    padding: 20px;
    border-radius: var(--radius-lg);
    animation: wmPanelSlideIn 0.4s var(--ease-out-expo, cubic-bezier(0.16, 1, 0.3, 1));
}
@keyframes wmPanelSlideIn {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}
.worldmap-panel-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 28px;
    height: 28px;
    border: none;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
}
.worldmap-panel-close:hover {
    background: var(--danger-bg);
    color: var(--coral);
}
.worldmap-panel-flag {
    font-size: 40px;
    margin-bottom: 8px;
}
.worldmap-panel-name {
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 700;
    color: var(--text-bright);
    margin-bottom: 16px;
}

/* Panel stats */
.panel-stat {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--glass-border);
}
.panel-stat-label {
    font-size: 13px;
    color: var(--text-secondary);
}
.panel-stat-value {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-bright);
}
.panel-stat-value.status-active {
    color: var(--emerald);
}

/* Panel city list */
.worldmap-panel-cities {
    margin-top: 12px;
}
.panel-city-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    margin: 4px 0;
    border-radius: var(--radius);
    border: 1px solid transparent;
    color: var(--text-primary);
    font-size: 14px;
    cursor: pointer;
    transition: all var(--transition);
}
.panel-city-item:hover {
    background: var(--cyan-dim);
    border-color: rgba(0, 229, 255, 0.15);
    color: var(--cyan);
}
.panel-city-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--cyan);
    box-shadow: 0 0 8px rgba(0, 229, 255, 0.4);
    flex-shrink: 0;
}
.panel-city-name { flex: 1; min-width: 0; }
.panel-city-resources { display: flex; gap: 3px; flex-shrink: 0; }
.panel-city-res { cursor: default; position: relative; display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; }

/* ===== Tooltip on hover (data-tooltip) ===== */
[data-tooltip] { position: relative; }
[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 4px 8px;
    background: rgba(10, 15, 30, 0.92);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 500;
    white-space: nowrap;
    border-radius: 4px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s;
    z-index: 100;
    margin-bottom: 4px;
}
[data-tooltip]:hover::after { opacity: 1; }
[data-theme="light"] [data-tooltip]::after {
    background: rgba(30, 40, 60, 0.9);
}

/* Enter button */
.worldmap-panel-enter {
    width: 100%;
    margin-top: 16px;
}

/* Legend */
.worldmap-legend {
    position: absolute;
    bottom: 16px;
    left: 16px;
    z-index: 10;
    padding: 12px 16px;
    border-radius: var(--radius);
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.worldmap-legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-secondary);
}
.worldmap-legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}
.worldmap-legend-dot.active {
    background: var(--cyan);
    box-shadow: 0 0 8px rgba(0, 229, 255, 0.5);
}
.worldmap-legend-dot.inactive {
    background: rgba(100, 120, 160, 0.3);
}

/* City markers on map */
.city-glow {
    animation: cityPulse 2.5s ease-in-out infinite;
}
@keyframes cityPulse {
    0%, 100% { r: 6; fill-opacity: 0.15; }
    50% { r: 9; fill-opacity: 0.08; }
}
.city-marker:hover .city-dot {
    filter: drop-shadow(0 0 4px currentColor);
}

/* Light theme overrides */
[data-theme="light"] .worldmap-container {
    background: #e8edf4;
}
[data-theme="light"] .country--inactive {
    fill: rgba(180, 195, 215, 0.6) !important;
    stroke: rgba(0, 0, 0, 0.08) !important;
}
[data-theme="light"] .country--active {
    fill-opacity: 0.45 !important;
    stroke-width: 2px;
}
[data-theme="light"] .country-label {
    fill: #1a1a2e !important;
    stroke: rgba(255,255,255,0.9) !important;
    font-weight: 800 !important;
}
[data-theme="light"] .city-label {
    fill: #1a1a2e !important;
    stroke: rgba(255,255,255,0.9) !important;
}
[data-theme="light"] .worldmap-graticule {
    stroke: rgba(0, 0, 0, 0.04) !important;
}
[data-theme="light"] .worldmap-borders {
    stroke: rgba(0, 0, 0, 0.08) !important;
}

/* ============================================================
   ROLE BADGE (header, next to player name)
   ============================================================ */

.role-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    font-family: var(--font-display);
    line-height: 1;
    white-space: nowrap;
}
.role-badge--admin {
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.2), rgba(255, 140, 0, 0.2));
    color: var(--gold);
    border: 1px solid rgba(251, 191, 36, 0.3);
    box-shadow: 0 0 12px rgba(251, 191, 36, 0.15);
}
.role-badge--mayor {
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.2), rgba(139, 92, 246, 0.2));
    color: var(--purple);
    border: 1px solid rgba(168, 85, 247, 0.3);
    box-shadow: 0 0 12px rgba(168, 85, 247, 0.15);
}
.role-badge--player {
    background: linear-gradient(135deg, rgba(0, 229, 255, 0.15), rgba(77, 141, 255, 0.15));
    color: var(--cyan);
    border: 1px solid rgba(0, 229, 255, 0.2);
}

/* ============================================================
   DEBUG BUTTON (header)
   ============================================================ */

.debug-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border: 1px solid rgba(251, 191, 36, 0.25);
    border-radius: var(--radius);
    background: rgba(251, 191, 36, 0.08);
    color: var(--gold);
    font-size: 18px;
    cursor: pointer;
    transition: all var(--transition);
    position: relative;
}
.debug-btn:hover {
    background: rgba(251, 191, 36, 0.18);
    border-color: rgba(251, 191, 36, 0.4);
    box-shadow: 0 0 16px rgba(251, 191, 36, 0.2);
    transform: scale(1.05);
}
.debug-btn::after {
    content: '';
    position: absolute;
    top: -2px;
    right: -2px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--gold);
    box-shadow: 0 0 6px rgba(251, 191, 36, 0.6);
}

/* ============================================================
   DEBUG OVERLAY + PANEL (slide-in from right)
   ============================================================ */

.debug-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    z-index: 9998;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}
.debug-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.debug-panel {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 400px;
    max-width: 90vw;
    z-index: 9999;
    padding: 0;
    border-radius: var(--radius-xl) 0 0 var(--radius-xl);
    border: 1px solid var(--glass-border);
    border-right: none;
    background: rgba(10, 15, 30, 0.92);
    backdrop-filter: blur(24px);
    box-shadow: -8px 0 40px rgba(0, 0, 0, 0.5);
    overflow-y: auto;
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.debug-panel.open {
    transform: translateX(0);
}

.debug-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--glass-border);
    position: sticky;
    top: 0;
    background: rgba(10, 15, 30, 0.95);
    backdrop-filter: blur(16px);
    z-index: 2;
}
.debug-panel-title {
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 700;
    color: var(--gold);
    margin: 0;
}
.debug-panel-close {
    width: 32px;
    height: 32px;
    border: 1px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
}
.debug-panel-close:hover {
    background: var(--danger-bg);
    color: var(--coral);
    border-color: rgba(255, 77, 106, 0.3);
}

/* Debug sections */
.debug-section {
    padding: 20px 24px;
    border-bottom: 1px solid var(--glass-border);
}
.debug-section:last-child {
    border-bottom: none;
}
.debug-section-title {
    font-family: var(--font-display);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Info grid */
.debug-info-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.debug-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 12px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.03);
}
.debug-info-label {
    font-size: 13px;
    color: var(--text-secondary);
}
.debug-info-value {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-bright);
    font-family: var(--font-mono);
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.debug-role-current {
    padding: 2px 8px;
    border-radius: 6px;
}
.debug-role--admin {
    background: rgba(251, 191, 36, 0.15);
    color: var(--gold);
}
.debug-role--mayor {
    background: rgba(168, 85, 247, 0.15);
    color: var(--purple);
}
.debug-role--player {
    background: rgba(0, 229, 255, 0.15);
    color: var(--cyan);
}

/* Role buttons */
.debug-role-buttons {
    display: flex;
    gap: 8px;
}
.debug-role-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 14px 8px;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 600;
    font-family: var(--font-display);
    cursor: pointer;
    transition: all var(--transition);
}
.debug-role-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
    color: var(--text-bright);
}
.debug-role-btn.active {
    border-color: var(--cyan);
    background: var(--cyan-dim);
    color: var(--cyan);
    box-shadow: 0 0 16px rgba(0, 229, 255, 0.15);
}
.debug-role-btn[data-role="admin"].active {
    border-color: var(--gold);
    background: rgba(251, 191, 36, 0.12);
    color: var(--gold);
    box-shadow: 0 0 16px rgba(251, 191, 36, 0.15);
}
.debug-role-btn[data-role="mayor"].active {
    border-color: var(--purple);
    background: rgba(168, 85, 247, 0.12);
    color: var(--purple);
    box-shadow: 0 0 16px rgba(168, 85, 247, 0.15);
}
.debug-role-icon {
    font-size: 24px;
}

/* Status message */
.debug-status {
    font-size: 12px;
    margin-top: 10px;
    padding: 6px 10px;
    border-radius: 6px;
    min-height: 18px;
    transition: all var(--transition);
}
.debug-status:empty {
    display: none;
}
.debug-status--loading {
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.03);
}
.debug-status--success {
    color: var(--emerald);
    background: rgba(52, 211, 153, 0.1);
}
.debug-status--error {
    color: var(--coral);
    background: var(--danger-bg);
}

/* Refresh button */
.debug-refresh-btn {
    width: 28px;
    height: 28px;
    border: 1px solid var(--glass-border);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-muted);
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
}
.debug-refresh-btn:hover {
    background: var(--cyan-dim);
    color: var(--cyan);
    border-color: rgba(0, 229, 255, 0.2);
}

/* Users list */
.debug-users-list {
    max-height: 350px;
    overflow-y: auto;
}
.debug-users-loading,
.debug-users-empty,
.debug-users-error {
    padding: 20px;
    text-align: center;
    font-size: 13px;
    color: var(--text-muted);
}
.debug-users-error {
    color: var(--coral);
}

/* Users table */
.debug-users-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.debug-users-table thead th {
    text-align: left;
    padding: 8px 10px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    border-bottom: 1px solid var(--glass-border);
}
.debug-users-table tbody tr {
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    transition: background var(--transition);
}
.debug-users-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.04);
}
.debug-users-table td {
    padding: 10px;
    vertical-align: middle;
}
.debug-user-cell {
    display: flex;
    align-items: center;
    gap: 10px;
}
.debug-user-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--cyan-dim), var(--blue-dim));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    color: var(--cyan);
    flex-shrink: 0;
}
.debug-user-name {
    font-weight: 600;
    color: var(--text-bright);
    font-size: 13px;
}
.debug-user-email {
    font-size: 11px;
    color: var(--text-muted);
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
}
.debug-user-role {
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}
.debug-user-actions {
    text-align: right;
}
.debug-role-select {
    padding: 4px 8px;
    border: 1px solid var(--glass-border);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    font-size: 12px;
    font-family: var(--font-body);
    cursor: pointer;
    outline: none;
    transition: all var(--transition);
}
.debug-role-select:hover,
.debug-role-select:focus {
    border-color: var(--cyan);
    background: rgba(0, 229, 255, 0.08);
}
.debug-role-select option {
    background: #1a1f35;
    color: var(--text-primary);
}

/* Light theme overrides for debug panel */
[data-theme="light"] .debug-panel {
    background: rgba(255, 255, 255, 0.95);
    box-shadow: -8px 0 40px rgba(0, 0, 0, 0.15);
}
[data-theme="light"] .debug-panel-header {
    background: rgba(255, 255, 255, 0.98);
}
[data-theme="light"] .debug-info-row {
    background: rgba(0, 0, 0, 0.03);
}
[data-theme="light"] .debug-role-btn {
    background: rgba(0, 0, 0, 0.03);
}
[data-theme="light"] .debug-role-select option {
    background: #fff;
    color: #1a1a2e;
}
[data-theme="light"] .debug-overlay {
    background: rgba(0, 0, 0, 0.2);
}

/* World map responsive */
@media (max-width: 900px) {
    .worldmap-country-panel {
        width: 240px;
        right: 56px;
    }
}
@media (max-width: 600px) {
    .worldmap-country-panel {
        position: absolute;
        bottom: 0;
        left: 0;
        right: 0;
        top: auto;
        width: 100%;
        border-radius: var(--radius-lg) var(--radius-lg) 0 0;
        max-height: 60vh;
        overflow-y: auto;
    }
    .worldmap-legend { display: none; }
}


/* ===== ENTERPRISES PAGE ===== */

.page-content--enterprises,
.page-content--elections {
    padding: 2rem;
    overflow-y: auto;
}

/* ===== Enterprise page — compact redesign ===== */

.ent-page { max-width: 960px; margin: 0 auto; }

.ent-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}
.ent-page-title { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.ent-page-title h2 { font-size: 1.3rem; font-weight: 700; color: var(--text); margin: 0; }
.ent-page-stats { display: flex; gap: 0.5rem; }
.ent-stat-chip {
    font-size: 0.75rem; padding: 0.2rem 0.6rem;
    background: var(--glass-bg); border-radius: 999px;
    color: var(--text-muted); font-weight: 500;
}
.ent-create-btn { white-space: nowrap; }

/* Empty state */
.ent-empty { text-align: center; padding: 2.5rem; border-radius: var(--radius-lg); }
.ent-empty-icon { font-size: 2.5rem; margin-bottom: 0.75rem; }

/* Country group */
.ent-country-group { margin-bottom: 1.5rem; }
.ent-country-header {
    font-size: 0.85rem; font-weight: 600; color: var(--text-muted);
    text-transform: uppercase; letter-spacing: 0.5px;
    margin-bottom: 0.5rem; padding-bottom: 0.35rem;
    border-bottom: 1px solid var(--border);
}

/* City group */
.ent-city-group { margin-bottom: 1rem; }
.ent-city-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 0.5rem;
}
.ent-city-name { font-size: 0.9rem; font-weight: 600; color: var(--text); }
.ent-city-workers { font-size: 0.75rem; color: var(--cyan); }

/* Card grid */
.ent-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 0.75rem;
}

/* Card */
.ent-card {
    padding: 0.85rem;
    border-radius: var(--radius-md);
    transition: transform 0.15s, box-shadow 0.15s;
}
.ent-card:hover {
    border-color: rgba(100, 160, 255, 0.15);
}

.ent-card-top { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 0.5rem; }
.ent-card-icon {
    width: 36px; height: 36px;
    display: flex; align-items: center; justify-content: center;
    border-radius: var(--radius-sm); background: var(--glass-bg);
}
.res-icon { display: inline-block; vertical-align: middle; flex-shrink: 0; }
.ent-card-info { flex: 1; min-width: 0; }
.ent-card-name {
    font-weight: 600; font-size: 0.85rem; color: var(--text);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ent-card-sub { font-size: 0.7rem; color: var(--text-muted); }

.ent-card-res { font-size: 0.75rem; color: var(--text-muted); margin-bottom: 0.4rem; }
.ent-card-res strong { color: var(--cyan); }

/* Workers bar compact */
.ent-card-workers { margin-bottom: 0.5rem; }
.ent-card-wlabel {
    display: flex; justify-content: space-between;
    font-size: 0.7rem; color: var(--text-muted); margin-bottom: 3px;
}
.ent-card-wbar { height: 4px; background: var(--glass-bg); border-radius: 2px; overflow: hidden; }
.ent-card-wfill { height: 100%; background: linear-gradient(90deg, var(--cyan), var(--emerald)); border-radius: 2px; transition: width 0.3s; }

.ent-card-actions { display: flex; gap: 0.4rem; }
.ent-delete-btn { color: var(--coral) !important; border-color: rgba(255,77,106,0.2) !important; }
.ent-delete-btn:hover { background: rgba(255,77,106,0.1) !important; border-color: var(--coral) !important; }

/* Clickable card (simplified) */
.ent-card--clickable {
    cursor: pointer;
    transition: transform 0.18s var(--ease-out-expo), box-shadow 0.18s var(--ease-out-expo), border-color 0.18s;
}
.ent-card--clickable:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(0, 229, 255, 0.08), 0 2px 8px rgba(0,0,0,0.12);
    border-color: rgba(0, 229, 255, 0.25);
}
.ent-card--clickable:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* Worker chip on simplified card */
.ent-card-worker-chip {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    padding: 0.2rem 0.55rem;
    font-size: 0.68rem;
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: 999px;
    white-space: nowrap;
}

/* ===== Enterprise Detail Page ===== */

.ent-detail-page {
    max-width: 820px;
    margin: 0 auto;
    padding: 1.5rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

/* Header */
.ent-detail-header {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.ent-detail-back {
    flex-shrink: 0;
    padding: 0.4rem 0.85rem;
    font-size: 0.78rem;
    border-radius: var(--radius);
}

.ent-detail-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
    min-width: 0;
}

.ent-detail-icon {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
    background: var(--glass);
    border: 1px solid var(--glass-border);
    flex-shrink: 0;
}

.ent-detail-title h2 {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-bright);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ent-detail-subtitle {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 0.1rem;
}

/* Stats row */
.ent-detail-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
}

.ent-detail-stat-box {
    text-align: center;
    padding: 0.85rem 0.5rem;
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    transition: border-color 0.2s;
}
.ent-detail-stat-box:hover {
    border-color: rgba(100, 160, 255, 0.2);
}

.ent-detail-stat-icon {
    font-size: 1.3rem;
    margin-bottom: 0.3rem;
}

.ent-detail-stat-label {
    font-size: 0.65rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
}

.ent-detail-stat-value {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-bright);
}

/* Section (glass card) */
.ent-detail-section {
    padding: 1.25rem;
    border-radius: var(--radius-lg);
}

.ent-detail-section h3 {
    margin: 0 0 1rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-bright);
}

/* Workers progress bar */
.ent-detail-workers {
    margin-bottom: 1.25rem;
}

.ent-detail-wbar-container {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.4rem;
}

.ent-detail-wbar {
    flex: 1;
    height: 10px;
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: 6px;
    overflow: hidden;
}

.ent-detail-wfill {
    height: 100%;
    background: linear-gradient(90deg, var(--cyan), var(--emerald));
    border-radius: 6px;
    transition: width 0.4s var(--ease-out-expo);
}

.ent-detail-wpct {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--cyan);
    min-width: 2.5rem;
    text-align: right;
}

.ent-detail-wcount {
    font-size: 0.78rem;
    color: var(--text-muted);
}

/* Fire button (reused in staff tab) */
.ent-detail-fire-btn {
    color: var(--coral) !important;
    border-color: rgba(255, 107, 107, 0.25) !important;
}
.ent-detail-fire-btn:hover:not(:disabled) {
    background: rgba(255, 107, 107, 0.1) !important;
    border-color: var(--coral) !important;
}

/* Danger zone section */
.ent-detail-danger {
    border-color: rgba(255, 107, 107, 0.2) !important;
}
.ent-detail-danger h3 { color: var(--coral); }

.ent-detail-demolish-btn {
    background: transparent;
    color: var(--coral);
    border: 1px solid rgba(255, 107, 107, 0.3);
    padding: 0.5rem 1.2rem;
    font-size: 0.82rem;
    font-weight: 600;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s;
}
.ent-detail-demolish-btn:hover {
    background: rgba(255, 107, 107, 0.12);
    border-color: var(--coral);
    box-shadow: 0 4px 16px rgba(255, 107, 107, 0.15);
}

/* ── Tabs ── */
.ent-detail-tabs { align-self: flex-start; }
.ent-detail-tab-content { min-height: 200px; }

/* ── Overview: Metrics row ── */
.ent-detail-metrics {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}
.ent-metric { display: flex; flex-direction: column; gap: 0.2rem; }
.ent-metric-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.ent-metric-value {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-bright);
}
.ent-metric--revenue { color: var(--cyan); }
.ent-metric--expense { color: var(--coral); }

/* ── Overview: Chart ── */
.ent-detail-chart {
    width: 100%;
    height: 220px;
    position: relative;
}
.ent-detail-chart svg { width: 100%; font-family: var(--font-body); }

/* Chart hover tooltip */
.ent-chart-tooltip {
    position: absolute;
    pointer-events: none;
    background: var(--glass);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 0.6rem 0.8rem;
    font-size: 0.75rem;
    color: var(--text-primary);
    z-index: 10;
    opacity: 0;
    transition: opacity 0.12s;
    white-space: nowrap;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}
.ent-chart-tooltip.visible { opacity: 1; }
.ent-chart-tooltip-date {
    font-weight: 600;
    color: var(--text-bright);
    margin-bottom: 0.35rem;
    font-size: 0.78rem;
}
.ent-chart-tooltip-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1.2rem;
    padding: 0.1rem 0;
}
.ent-chart-tooltip-row strong { font-weight: 600; color: var(--text-bright); }
.ent-chart-tooltip-dot {
    display: inline-block;
    width: 8px; height: 8px;
    border-radius: 50%;
    margin-right: 0.35rem;
    vertical-align: middle;
}

/* ── Overview: KPI cards row ── */
.ent-ov-kpis {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.6rem;
    margin-bottom: 1rem;
}
.ent-ov-kpi {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.75rem 0.85rem;
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    transition: border-color 0.2s, box-shadow 0.2s;
}
.ent-ov-kpi:hover {
    border-color: rgba(100, 160, 255, 0.2);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}
.ent-ov-kpi-icon {
    font-size: 1.4rem;
    flex-shrink: 0;
    width: 2rem;
    text-align: center;
}
.ent-ov-kpi-body { flex: 1; min-width: 0; }
.ent-ov-kpi-label {
    font-size: 0.6rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ent-ov-kpi-value {
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--text-bright);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ent-ov-kpi--cyan { border-left: 3px solid var(--cyan); }
.ent-ov-kpi--cyan .ent-ov-kpi-value { color: var(--cyan); }
.ent-ov-kpi--emerald { border-left: 3px solid var(--emerald); }
.ent-ov-kpi--emerald .ent-ov-kpi-value { color: var(--emerald); }
.ent-ov-kpi--gold { border-left: 3px solid var(--gold); }
.ent-ov-kpi--gold .ent-ov-kpi-value { color: var(--gold); }
.ent-ov-kpi--coral { border-left: 3px solid var(--coral); }
.ent-ov-kpi--coral .ent-ov-kpi-value { color: var(--coral); }

/* ── Overview: Glass card sections ── */
.ent-ov-card {
    padding: 1rem 1.25rem;
    border-radius: var(--radius-lg);
    margin-bottom: 0.85rem;
}
.ent-ov-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}
.ent-ov-card-header h3 {
    margin: 0;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-bright);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.ent-ov-badge {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-secondary);
    background: rgba(100, 160, 255, 0.08);
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    border: 1px solid var(--glass-border);
}

/* ── Overview: Progress bar (reserves) ── */
.ent-ov-bar-wrap {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.75rem;
}
.ent-ov-bar {
    flex: 1;
    height: 14px;
    background: rgba(255,255,255,0.06);
    border-radius: 7px;
    overflow: hidden;
    border: 1px solid var(--glass-border);
}
.ent-ov-bar-fill {
    height: 100%;
    border-radius: 7px;
    transition: width 0.6s var(--ease-out-expo);
    position: relative;
}
.ent-ov-bar-fill::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(255,255,255,0.2) 0%, transparent 100%);
    border-radius: 7px;
}
.ent-ov-bar-pct {
    font-size: 0.85rem;
    font-weight: 700;
    min-width: 2.8rem;
    text-align: right;
}

/* ── Overview: Row stats (under reserves) ── */
.ent-ov-row-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
}
.ent-ov-rs {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}
.ent-ov-rs-label {
    font-size: 0.6rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.ent-ov-rs-value {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-bright);
}

/* ── Overview: Sell button ── */
.ent-ov-sell-btn {
    margin-top: 0.75rem;
    width: 100%;
    padding: 0.55rem 1rem;
    font-size: 0.82rem;
}

/* ── Overview: Equipment health ── */
.ent-ov-equip-list {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}
.ent-ov-equip-row {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.5rem 0.6rem;
    background: rgba(255,255,255,0.02);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    transition: background 0.2s;
}
.ent-ov-equip-row:hover {
    background: rgba(255,255,255,0.04);
}
.ent-ov-equip-ico {
    font-size: 1.3rem;
    width: 2rem;
    text-align: center;
    flex-shrink: 0;
}
.ent-ov-equip-mid {
    flex: 1;
    min-width: 0;
}
.ent-ov-equip-name {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-bright);
    margin-bottom: 0.3rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ent-ov-equip-bar-wrap { width: 100%; }
.ent-ov-equip-bar {
    height: 5px;
    background: rgba(255,255,255,0.06);
    border-radius: 3px;
    overflow: hidden;
}
.ent-ov-equip-bar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.4s var(--ease-out-expo);
}
.ent-ov-equip-pct {
    font-size: 0.82rem;
    font-weight: 700;
    min-width: 2.5rem;
    text-align: right;
    flex-shrink: 0;
}

/* ── Overview: Compact chart ── */
.ent-detail-chart--compact {
    height: 150px;
}

/* ── Overview: Sales table ── */
.ent-ov-sales-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.78rem;
}
.ent-ov-sales-table th {
    text-align: left;
    font-size: 0.6rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.4rem 0.5rem;
    border-bottom: 1px solid var(--glass-border);
    white-space: nowrap;
}
.ent-ov-sales-table td {
    padding: 0.45rem 0.5rem;
    border-bottom: 1px solid rgba(100, 160, 255, 0.04);
    color: var(--text-primary);
    white-space: nowrap;
}
.ent-ov-sales-table tbody tr:hover {
    background: rgba(0, 229, 255, 0.03);
}
.ent-ov-sales-total {
    font-weight: 600;
    color: var(--cyan) !important;
}
.ent-ov-sales-summary {
    margin-top: 0.75rem;
    padding-top: 0.6rem;
    border-top: 1px solid var(--glass-border);
    font-size: 0.82rem;
    color: var(--text-secondary);
    text-align: right;
}
.ent-ov-sales-summary strong {
    color: var(--cyan);
    font-weight: 700;
}

/* ── Light theme overrides for overview ── */
[data-theme="light"] .ent-ov-kpi {
    background: rgba(255,255,255,0.8);
    border-color: rgba(0,0,0,0.06);
}
[data-theme="light"] .ent-ov-kpi:hover {
    border-color: rgba(0,0,0,0.12);
    box-shadow: 0 4px 16px rgba(0,0,0,0.06);
}
[data-theme="light"] .ent-ov-bar {
    background: rgba(0,0,0,0.05);
    border-color: rgba(0,0,0,0.08);
}
[data-theme="light"] .ent-ov-equip-row {
    background: rgba(0,0,0,0.02);
    border-color: rgba(0,0,0,0.06);
}
[data-theme="light"] .ent-ov-equip-row:hover {
    background: rgba(0,0,0,0.04);
}
[data-theme="light"] .ent-ov-equip-bar {
    background: rgba(0,0,0,0.06);
}
[data-theme="light"] .ent-ov-badge {
    background: rgba(0,0,0,0.04);
    border-color: rgba(0,0,0,0.08);
}

/* ── Responsive: Overview KPIs ── */
@media (max-width: 640px) {
    .ent-ov-kpis { grid-template-columns: repeat(2, 1fr); }
    .ent-ov-row-stats { grid-template-columns: repeat(2, 1fr); }
    .ent-ov-kpi { padding: 0.55rem 0.65rem; }
    .ent-ov-kpi-icon { font-size: 1.1rem; }
    .ent-ov-kpi-value { font-size: 0.82rem; }
    .ent-ov-sales-table { font-size: 0.7rem; }
    .ent-ov-sales-table th { font-size: 0.55rem; padding: 0.3rem 0.3rem; }
    .ent-ov-sales-table td { padding: 0.35rem 0.3rem; }
}

/* ── Staff: City info bar ── */
.ent-staff-city-info {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
    padding: 0.75rem;
    background: rgba(0, 229, 255, 0.04);
    border: 1px solid rgba(0, 229, 255, 0.08);
    border-radius: var(--radius);
    margin-bottom: 1.25rem;
}
.ent-staff-city-stat { display: flex; flex-direction: column; gap: 0.15rem; }
.ent-staff-city-label {
    font-size: 0.65rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.ent-staff-city-value { font-size: 0.88rem; font-weight: 600; color: var(--text-bright); }
.ent-staff-city-value--unemployed { color: var(--gold); }

/* ── Staff: Slider sections ── */
.ent-staff-slider-section {
    margin-bottom: 1.25rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--glass-border);
}
.ent-staff-slider-section:last-of-type { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }

.ent-staff-slider-label {
    display: block;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.6rem;
}

.ent-staff-slider-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

/* Premium range slider */
.ent-staff-slider {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 8px;
    border-radius: 4px;
    background: var(--glass);
    border: 1px solid var(--glass-border);
    outline: none;
    transition: border-color 0.2s;
}
.ent-staff-slider:hover { border-color: rgba(0, 229, 255, 0.3); }

.ent-staff-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 24px; height: 24px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--cyan), var(--blue));
    cursor: pointer;
    box-shadow: 0 2px 12px rgba(0, 229, 255, 0.35), 0 0 0 3px rgba(0, 229, 255, 0.1);
    transition: all 0.2s var(--ease-spring);
}
.ent-staff-slider::-webkit-slider-thumb:hover {
    transform: scale(1.15);
    box-shadow: 0 2px 16px rgba(0, 229, 255, 0.5), 0 0 0 5px rgba(0, 229, 255, 0.15);
}
.ent-staff-slider::-webkit-slider-thumb:active { transform: scale(1.05); }

.ent-staff-slider::-moz-range-thumb {
    width: 24px; height: 24px;
    border-radius: 50%; border: none;
    background: linear-gradient(135deg, var(--cyan), var(--blue));
    cursor: pointer;
    box-shadow: 0 2px 12px rgba(0, 229, 255, 0.35);
}

/* Fire slider variant */
.ent-staff-slider--fire:hover { border-color: rgba(255, 107, 107, 0.3); }
.ent-staff-slider--fire::-webkit-slider-thumb {
    background: linear-gradient(135deg, var(--coral), #ff4d6a);
    box-shadow: 0 2px 12px rgba(255, 107, 107, 0.35), 0 0 0 3px rgba(255, 107, 107, 0.1);
}
.ent-staff-slider--fire::-webkit-slider-thumb:hover {
    box-shadow: 0 2px 16px rgba(255, 107, 107, 0.5), 0 0 0 5px rgba(255, 107, 107, 0.15);
}
.ent-staff-slider--fire::-moz-range-thumb {
    background: linear-gradient(135deg, var(--coral), #ff4d6a);
    box-shadow: 0 2px 12px rgba(255, 107, 107, 0.35);
}

/* Slider value badge */
.ent-staff-slider-value {
    min-width: 48px; height: 36px;
    display: flex; align-items: center; justify-content: center;
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    font-size: 0.95rem; font-weight: 700;
    color: var(--cyan);
    font-family: var(--font-display);
}
.ent-staff-slider-value--fire { color: var(--coral); }

/* Slider info row */
.ent-staff-slider-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

/* Action buttons (hire/fire) */
.ent-staff-action-btn {
    width: 100%;
    padding: 0.6rem;
    font-size: 0.85rem;
}
.ent-staff-action-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* No workers message */
.ent-staff-no-workers {
    text-align: center;
    padding: 1rem;
    color: var(--text-muted);
    font-size: 0.82rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px dashed var(--glass-border);
    border-radius: var(--radius);
}

/* ── Production: Hero Card ── */
.ent-prod-hero {
    display: flex; align-items: center; gap: 1.5rem;
    padding: 1.25rem 1.5rem; margin-bottom: 1rem;
    border-radius: var(--radius-lg);
}
.ent-prod-hero-left { display: flex; align-items: center; gap: 0.75rem; flex-shrink: 0; }
.ent-prod-hero-icon {
    width: 56px; height: 56px; display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.05); border: 1px solid var(--glass-border); border-radius: var(--radius);
}
.ent-prod-hero-name { font-size: 1.1rem; font-weight: 700; color: var(--text-bright); }
.ent-prod-hero-type { font-size: 0.75rem; color: var(--text-muted); }
.ent-prod-hero-rates { display: flex; gap: 1.5rem; flex: 1; }
.ent-prod-rate { display: flex; flex-direction: column; align-items: center; }
.ent-prod-rate-value { font-size: 1.2rem; font-weight: 700; color: var(--text-bright); }
.ent-prod-rate-unit { font-size: 0.65rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; }

.ent-prod-hero-eff { display: flex; flex-direction: column; align-items: center; gap: 0.25rem; min-width: 80px; }
.ent-prod-eff-label { font-size: 0.65rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.ent-prod-eff-bar { width: 100%; height: 6px; background: rgba(255,255,255,0.06); border-radius: 3px; overflow: hidden; }
.ent-prod-eff-fill {
    height: 100%; border-radius: 3px;
    background: linear-gradient(90deg, var(--emerald), var(--cyan));
    background-size: 200% 100%;
    animation: effShimmer 3s ease-in-out infinite;
    transition: width 0.6s var(--ease-out-expo);
}
@keyframes effShimmer { 0%,100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }
.ent-prod-eff-pct { font-size: 0.85rem; font-weight: 600; color: var(--emerald); }

/* ── Production: Economics Grid ── */
.ent-prod-economics { padding: 1.25rem; border-radius: var(--radius-lg); margin-bottom: 1rem; }
.ent-prod-economics h3 { margin: 0 0 0.75rem; font-size: 0.95rem; }
.ent-prod-econ-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.6rem; }
.ent-prod-econ-item {
    display: flex; flex-direction: column; gap: 0.2rem; padding: 0.65rem 0.75rem;
    background: rgba(255,255,255,0.03); border: 1px solid var(--glass-border); border-radius: var(--radius);
}
.ent-prod-econ-label { font-size: 0.62rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.ent-prod-econ-value { font-size: 0.92rem; font-weight: 600; color: var(--text-bright); }
.ent-prod-econ--revenue { color: var(--cyan); }
.ent-prod-econ--positive { color: var(--emerald); }
.ent-prod-econ--negative { color: var(--coral); }
.ent-prod-quality-badge {
    display: inline-block; padding: 0.12rem 0.5rem;
    background: var(--gold-dim); color: var(--gold); border-radius: 20px;
    font-size: 0.8rem; font-weight: 700;
}

/* ── Production: Equipment Cards ── */
.ent-prod-equip-section { padding: 1.25rem; border-radius: var(--radius-lg); margin-bottom: 1rem; }
.ent-prod-equip-section h3 { margin: 0 0 0.75rem; font-size: 0.95rem; }
.ent-prod-equip-grid { display: flex; flex-direction: column; gap: 0.75rem; }
.ent-prod-equip-card {
    background: rgba(255,255,255,0.03); border: 1px solid var(--glass-border);
    border-radius: var(--radius); padding: 1rem; display: flex; flex-direction: column; gap: 0.55rem;
}
.ent-prod-equip-card-header { display: flex; align-items: center; gap: 0.75rem; }
.ent-prod-equip-card-icon { font-size: 1.5rem; width: 2.5rem; text-align: center; flex-shrink: 0; }
.ent-prod-equip-card-info { flex: 1; }
.ent-prod-equip-card-name { font-weight: 600; font-size: 0.88rem; color: var(--text-bright); }
.ent-prod-equip-card-desc { font-size: 0.72rem; color: var(--text-muted); }
.ent-prod-equip-level-badge {
    padding: 0.2rem 0.5rem; background: var(--cyan-dim); color: var(--cyan);
    border-radius: 20px; font-size: 0.7rem; font-weight: 700; flex-shrink: 0;
}
.ent-prod-equip-levels { display: flex; gap: 3px; }
.ent-prod-equip-dot { width: 8px; height: 8px; border-radius: 50%; transition: all var(--transition); }
.ent-prod-equip-dot--active { background: var(--cyan); box-shadow: 0 0 4px var(--cyan-glow); }
.ent-prod-equip-dot--dim { background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.06); }
.ent-prod-equip-cond { display: flex; flex-direction: column; gap: 0.25rem; }
.ent-prod-equip-cond-label { font-size: 0.72rem; color: var(--text-muted); }
.ent-prod-equip-cond-bar { width: 100%; height: 4px; background: rgba(255,255,255,0.06); border-radius: 2px; overflow: hidden; }
.ent-prod-equip-cond-fill { height: 100%; border-radius: 2px; transition: width 0.6s var(--ease-out-expo); }
.ent-prod-equip-bonus { font-size: 0.75rem; color: var(--emerald); font-weight: 500; }
/* Equipment upgrade button — default disabled */
.ent-prod-equip-upgrade-btn { font-size: 0.72rem; padding: 0.4rem 0.75rem; width: 100%; }
.ent-prod-equip-upgrade-btn--max {
    opacity: 0.5; cursor: not-allowed;
    background: transparent; border: 1px solid var(--emerald); color: var(--emerald);
    font-weight: 700; font-size: 0.75rem;
}
/* Equipment upgrade button — active */
.ent-prod-equip-upgrade-btn:not([disabled]):not(.ent-prod-equip-upgrade-btn--max) {
    opacity: 1; cursor: pointer;
    transition: all 0.3s ease;
}
.ent-prod-equip-upgrade-btn:not([disabled]):not(.ent-prod-equip-upgrade-btn--max):hover {
    box-shadow: 0 0 12px var(--cyan-glow);
    transform: translateY(-1px);
}
/* Equipment upgrade success flash animation */
.ent-prod-equip-upgraded {
    animation: equipUpgradeFlash 1.5s ease-out;
}
@keyframes equipUpgradeFlash {
    0%  { box-shadow: 0 0 0 0 var(--cyan-glow); }
    20% { box-shadow: 0 0 20px 4px var(--cyan-glow); border-color: var(--cyan); }
    100%{ box-shadow: none; }
}

/* ── Production: Warehouse / Summary Table ── */
.ent-prod-warehouse { padding: 1.25rem; border-radius: var(--radius-lg); margin-bottom: 1rem; }
.ent-prod-warehouse h3 { margin: 0 0 0.75rem; font-size: 0.95rem; }
.ent-prod-summary-table { width: 100%; border-collapse: collapse; font-size: 0.8rem; }
.ent-prod-summary-table th {
    text-align: left; color: var(--text-muted); font-size: 0.65rem;
    text-transform: uppercase; letter-spacing: 0.04em;
    padding: 0.4rem 0.5rem; border-bottom: 1px solid var(--glass-border);
}
.ent-prod-summary-table td {
    padding: 0.6rem 0.5rem; color: var(--text-bright); vertical-align: middle;
}
.ent-prod-summary-table td .res-icon { vertical-align: middle; margin-right: 0.3rem; }
.ent-prod-wh-stock { font-weight: 600; }
.ent-prod-wh-bar {
    display: inline-block; width: 60px; height: 6px;
    background: rgba(255,255,255,0.06); border-radius: 3px;
    overflow: hidden; vertical-align: middle; margin-right: 0.4rem;
}
.ent-prod-wh-fill {
    height: 100%; border-radius: 3px;
    transition: width 0.6s ease;
}

/* ── Production: Technologies ── */
.ent-prod-tech-section { padding: 1.25rem; border-radius: var(--radius-lg); }
.ent-prod-tech-section h3 { margin: 0 0 0.75rem; font-size: 0.95rem; }
.ent-prod-tech-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.5rem; }
.ent-prod-tech-card {
    display: flex; flex-direction: column; align-items: center; gap: 0.3rem;
    padding: 0.75rem 0.5rem; background: rgba(255,255,255,0.02); border: 1px solid var(--glass-border);
    border-radius: var(--radius); text-align: center; position: relative;
    transition: all 0.3s ease;
}
.ent-prod-tech-card:hover { border-color: rgba(168, 85, 247, 0.3); }
.ent-prod-tech-card--maxed { border-color: var(--emerald); opacity: 0.85; }
.ent-prod-tech-icon { font-size: 1.5rem; }
.ent-prod-tech-name { font-size: 0.72rem; font-weight: 600; color: var(--text-bright); }
.ent-prod-tech-desc { font-size: 0.6rem; color: var(--text-muted); }
.ent-prod-tech-level { font-size: 0.65rem; color: var(--text-muted); }
.ent-prod-tech-bar {
    width: 100%; height: 3px;
    background: rgba(255,255,255,0.06); border-radius: 2px;
    overflow: hidden; margin: 0.15rem 0;
}
.ent-prod-tech-bar-fill {
    height: 100%; background: #a855f7;
    border-radius: 2px; transition: width 0.6s ease;
}
.ent-prod-tech-bonus { font-size: 0.6rem; color: var(--emerald); font-weight: 500; }
.ent-prod-tech-research-btn {
    font-size: 0.6rem; padding: 0.3rem 0.5rem; margin-top: 0.25rem;
    border: 1px solid #a855f7; color: #a855f7;
    background: transparent; border-radius: var(--radius-sm);
    cursor: pointer; transition: all 0.3s ease; width: 100%;
}
.ent-prod-tech-research-btn:hover {
    background: rgba(168, 85, 247, 0.15);
    box-shadow: 0 0 8px rgba(168, 85, 247, 0.3);
}
.ent-prod-tech-research-btn:disabled {
    opacity: 0.5; cursor: not-allowed;
}
.ent-prod-tech-maxed-badge {
    font-size: 0.65rem; color: var(--emerald); font-weight: 700; margin-top: 0.25rem;
}
/* Technology research success flash */
.ent-prod-tech-researched {
    animation: techResearchFlash 1.5s ease-out;
}
@keyframes techResearchFlash {
    0%  { box-shadow: 0 0 0 0 rgba(168, 85, 247, 0.4); }
    20% { box-shadow: 0 0 16px 3px rgba(168, 85, 247, 0.4); border-color: #a855f7; }
    100%{ box-shadow: none; }
}

/* ===== Enterprise Detail — Responsive ===== */

@media (max-width: 640px) {
    .ent-detail-stats { grid-template-columns: repeat(2, 1fr); }
    .ent-detail-metrics { grid-template-columns: 1fr; }
    .ent-staff-city-info { grid-template-columns: 1fr; }
    .ent-prod-hero { flex-direction: column; align-items: flex-start; padding: 1rem; }
    .ent-prod-hero-rates { width: 100%; justify-content: space-between; }
    .ent-prod-hero-eff { width: 100%; }
    .ent-prod-econ-grid { grid-template-columns: repeat(2, 1fr); }
    .ent-prod-tech-grid { grid-template-columns: repeat(2, 1fr); }
    .ent-prod-summary-table { font-size: 0.7rem; }
    .ent-prod-summary-table th { font-size: 0.55rem; padding: 0.3rem 0.3rem; }
    .ent-prod-summary-table td { padding: 0.4rem 0.3rem; }
    .ent-detail-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.6rem;
    }
    .ent-detail-page { padding: 1rem 0.5rem; }
}

/* Shared button styles */
.btn-sm { padding: 0.3rem 0.65rem; font-size: 0.72rem; border-radius: var(--radius-sm); }

.btn-glass {
    background: var(--glass-bg); border: 1px solid var(--border);
    color: var(--text); cursor: pointer; transition: all 0.2s;
}
.btn-glass:hover { background: var(--glass-hover); border-color: var(--cyan); }

/* ===== Creation flow modals ===== */

.modal-subtitle { font-size: 0.85rem; color: var(--text-muted); margin: 0 0 1rem; }

/* Step 1: Category grid */
.ent-cat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.6rem; }
.ent-cat-option {
    display: flex; flex-direction: column; align-items: center; gap: 0.3rem;
    padding: 1rem 0.5rem; border: 1px solid var(--border); border-radius: var(--radius-md);
    cursor: pointer; transition: all 0.2s; position: relative;
}
.ent-cat-option:hover:not(.disabled) { border-color: var(--cyan); background: var(--glass-bg); }
.ent-cat-option.disabled { opacity: 0.4; cursor: not-allowed; }
.ent-cat-icon { font-size: 1.8rem; }
.ent-cat-name { font-size: 0.82rem; font-weight: 600; color: var(--text); }
.ent-cat-soon {
    font-size: 0.65rem; color: var(--text-muted); background: var(--glass-bg);
    padding: 0.1rem 0.4rem; border-radius: 999px; position: absolute; top: 6px; right: 6px;
}

/* Step 2: City selection */
.ent-sel-cities { max-height: 400px; overflow-y: auto; }
.ent-sel-country { margin-bottom: 0.75rem; }
.ent-sel-country-name {
    font-size: 0.78rem; font-weight: 600; color: var(--text-muted);
    text-transform: uppercase; letter-spacing: 0.5px;
    margin-bottom: 0.35rem; padding-bottom: 0.25rem;
    border-bottom: 1px solid var(--border);
}
.ent-sel-city {
    display: flex; align-items: center; justify-content: space-between;
    padding: 0.6rem 0.75rem; margin-bottom: 0.3rem;
    border: 1px solid var(--border); border-radius: var(--radius-md);
    cursor: pointer; transition: all 0.15s;
}
.ent-sel-city:hover { border-color: var(--cyan); background: var(--glass-bg); }
.ent-sel-city-info { display: flex; align-items: center; gap: 0.75rem; }
.ent-sel-city-name { font-size: 0.88rem; font-weight: 500; color: var(--text); }
.ent-sel-city-res { display: flex; gap: 0.3rem; }
.ent-res-badge { display: inline-flex; align-items: center; }
.ent-sel-arrow { color: var(--text-muted); font-size: 0.9rem; }

/* Step 3: Resource selection */
.ent-res-grid { display: flex; flex-direction: column; gap: 0.5rem; }
.ent-res-option {
    display: flex; align-items: center; gap: 0.75rem;
    padding: 0.7rem 0.85rem; border: 1px solid var(--border);
    border-radius: var(--radius-md); cursor: pointer; transition: all 0.15s;
}
.ent-res-option:hover { border-color: var(--cyan); background: var(--glass-bg); }
.ent-res-option.selected { border-color: var(--cyan); background: rgba(0,229,255,0.08); box-shadow: 0 0 0 2px rgba(0,229,255,0.15); }
.ent-res-icon { width: 36px; display: flex; align-items: center; justify-content: center; }
.ent-res-details { flex: 1; }
.ent-res-name { font-size: 0.88rem; font-weight: 600; color: var(--text); display: block; }
.ent-res-sub { font-size: 0.72rem; color: var(--text-muted); }
.ent-no-res { text-align: center; padding: 1.5rem; color: var(--text-muted); font-size: 0.85rem; }

/* Resource type selection grid (2×4) — new enterprise flow */
.ent-res-type-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.6rem;
    margin-bottom: 1rem;
}
.ent-res-type-option {
    display: flex; align-items: center; gap: 0.7rem;
    padding: 0.65rem 0.8rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s;
    background: transparent;
}
.ent-res-type-option:hover {
    border-color: var(--cyan);
    background: var(--glass-bg);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 229, 255, 0.1);
}
.ent-res-type-option:active {
    transform: translateY(0);
}
.ent-res-type-icon {
    width: 44px; height: 44px;
    display: flex; align-items: center; justify-content: center;
    background: var(--glass-bg);
    border-radius: var(--radius-md);
    flex-shrink: 0;
}
.ent-res-type-info { flex: 1; min-width: 0; }
.ent-res-type-name {
    font-size: 0.85rem; font-weight: 600; color: var(--text);
    display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ent-res-type-sub {
    font-size: 0.7rem; color: var(--text-muted);
    display: block; margin-top: 2px;
}

/* Placement banners (world map + city builder) */
.worldmap-placement-banner,
.cb-placement-banner {
    position: absolute;
    top: 12px; left: 50%;
    transform: translateX(-50%);
    display: flex; align-items: center; gap: 0.75rem;
    padding: 0.55rem 1rem;
    background: rgba(249, 115, 22, 0.15);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(249, 115, 22, 0.3);
    border-radius: var(--radius-lg);
    z-index: 100;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    white-space: nowrap;
}
.placement-banner-content {
    display: flex; align-items: center; gap: 0.5rem;
    font-size: 0.85rem; color: var(--text);
}
.placement-banner-content strong {
    color: #f59e0b;
}
.placement-banner-icon {
    display: flex; align-items: center;
}
.placement-banner-cancel {
    background: rgba(239, 68, 68, 0.2) !important;
    border: 1px solid rgba(239, 68, 68, 0.3) !important;
    color: #ef4444 !important;
    font-size: 0.78rem !important;
    padding: 0.3rem 0.6rem !important;
    cursor: pointer;
    transition: all 0.15s;
}
.placement-banner-cancel:hover {
    background: rgba(239, 68, 68, 0.35) !important;
}

/* Step 4: Create summary */
.ent-create-summary { margin-bottom: 1rem; }
.ent-create-row {
    display: flex; justify-content: space-between; align-items: center;
    padding: 0.35rem 0; font-size: 0.85rem;
    border-bottom: 1px solid var(--border);
}
.ent-create-label { color: var(--text-muted); }

/* Shared form elements */
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; font-size: 0.82rem; color: var(--text-muted); margin-bottom: 0.35rem; }
.form-select, .form-input {
    width: 100%; padding: 0.55rem 0.75rem;
    border: 1px solid var(--border); border-radius: var(--radius-md);
    background: var(--glass-bg); color: var(--text);
    font-size: 0.88rem; font-family: inherit; outline: none;
    transition: border-color 0.2s;
}
.form-select:focus, .form-input:focus { border-color: var(--cyan); }
textarea.form-input { resize: vertical; }

.form-actions { display: flex; gap: 0.75rem; margin-top: 1rem; }
.form-status { font-size: 0.8rem; margin-top: 0.6rem; min-height: 1rem; }
.form-status.success { color: var(--emerald); }
.form-status.error { color: var(--coral); }

/* Hire modal */
.hire-form .hire-info {
    display: flex; justify-content: space-between;
    font-size: 0.85rem; color: var(--text-muted); margin-bottom: 1rem;
}


/* ===== ELECTIONS PAGE ===== */

.elections-container {
    max-width: 800px;
    margin: 0 auto;
}

.elections-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.elections-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
    margin: 0;
}

.elections-city-select {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.elections-city-select .form-select {
    width: auto;
    min-width: 160px;
}

/* Governor card */
.governor-card {
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    margin-bottom: 1.5rem;
}

.gov-card-content.gov-empty {
    text-align: center;
}

.gov-title {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 1rem;
}

.gov-name {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 1rem;
}

.gov-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--cyan), var(--purple));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
    color: #fff;
}

.gov-you-badge {
    font-size: 0.7rem;
    background: var(--cyan);
    color: #000;
    padding: 0.15rem 0.5rem;
    border-radius: 10px;
    font-weight: 600;
}

.gov-details {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.gov-detail {
    text-align: center;
}

.gov-detail-label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.gov-detail-value {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text);
}

.gov-decrees-preview {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.gov-decrees-preview strong {
    font-size: 0.85rem;
    display: block;
    margin-bottom: 0.5rem;
}

.decree-mini {
    display: flex;
    justify-content: space-between;
    font-size: 0.82rem;
    padding: 0.35rem 0;
    color: var(--text-muted);
}

.decree-effect {
    font-weight: 600;
    color: var(--cyan);
}

/* Active election panel */
.election-active {
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    margin-bottom: 1.5rem;
}

.election-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.election-header h3 {
    margin: 0;
    font-size: 1.15rem;
    color: var(--text);
}

.election-status-badge {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    text-transform: uppercase;
}

.status-reg {
    background: rgba(255, 193, 7, 0.15);
    color: var(--gold);
}

.status-vote {
    background: rgba(0, 229, 255, 0.15);
    color: var(--cyan);
}

.status-done {
    background: rgba(5, 150, 105, 0.15);
    color: var(--emerald);
}

.status-cancel {
    background: rgba(255, 86, 120, 0.15);
    color: var(--coral);
}

.election-timer {
    font-size: 0.9rem;
    color: var(--gold);
    margin-bottom: 1rem;
    font-weight: 500;
}

.candidates-list h4 {
    font-size: 0.95rem;
    margin-bottom: 0.75rem;
    color: var(--text);
}

.candidate-card {
    padding: 1rem;
    border-radius: var(--radius-md);
    margin-bottom: 0.75rem;
}

.candidate-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.candidate-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--gold), var(--coral));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    color: #fff;
    flex-shrink: 0;
}

.candidate-name {
    font-weight: 600;
    color: var(--text);
}

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

.candidate-votes {
    margin-bottom: 0.5rem;
}

.candidate-votes-bar {
    height: 8px;
    background: var(--glass-bg);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 4px;
}

.candidate-votes-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--gold), var(--coral));
    border-radius: 4px;
    transition: width 0.3s;
}

.candidate-votes-count {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.candidate-vote-btn {
    float: right;
    margin-top: -2.5rem;
}

.election-register {
    text-align: center;
    margin-top: 1rem;
}

.election-registered {
    text-align: center;
    font-size: 0.85rem;
    color: var(--emerald);
    margin-top: 1rem;
    font-weight: 500;
}

/* Election history */
.elections-history {
    padding: 1.5rem;
    border-radius: var(--radius-lg);
}

.elections-history h3 {
    font-size: 1.1rem;
    margin: 0 0 1rem 0;
    color: var(--text);
}

.history-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.85rem;
    color: var(--text-muted);
}

.history-status {
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.15rem 0.5rem;
    border-radius: 8px;
    text-transform: uppercase;
}

.history-winner {
    font-size: 0.72rem;
    color: var(--gold);
    font-weight: 500;
}


/* ===== GOVERNOR HISTORY ===== */

.governor-history {
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    margin-bottom: 1.5rem;
}

.governor-history h3 {
    font-size: 1.1rem;
    margin: 0 0 1rem 0;
    color: var(--text);
}

.gov-history-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.85rem;
}

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

.gov-history-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
}

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

.gov-history-title {
    color: var(--text);
}

.gov-history-title strong {
    color: var(--primary);
}

.gov-history-details {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.gov-history-date {
    font-size: 0.72rem;
    color: var(--text-muted);
    white-space: nowrap;
    flex-shrink: 0;
}

.event-force .gov-history-title strong { color: #ffc107; }
.event-elected .gov-history-title strong { color: #4caf50; }
.event-resigned .gov-history-title strong { color: #ff9800; }
.event-removed .gov-history-title strong { color: #f44336; }


/* ===== GOVERNOR DASHBOARD ===== */

.governor-dashboard {
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    margin-bottom: 1.5rem;
    border: 1px solid rgba(0, 229, 255, 0.15);
}

.governor-dashboard h3 {
    font-size: 1.15rem;
    margin: 0 0 1.5rem 0;
    color: var(--cyan);
}

.gov-control {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.gov-control-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.gov-control-header label {
    font-size: 0.9rem;
    color: var(--text);
    font-weight: 500;
}

.tax-value {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--gold);
}

.tax-slider {
    width: 100%;
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    border-radius: 3px;
    background: var(--glass-bg);
    outline: none;
    margin: 0.5rem 0;
}

.tax-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--cyan);
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 229, 255, 0.3);
}

.tax-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.gov-decrees-section {
    margin-bottom: 1rem;
}

.gov-decrees-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.gov-decrees-header h4 {
    margin: 0;
    font-size: 1rem;
    color: var(--text);
}

.gov-decrees-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.decree-card {
    padding: 1rem;
    border-radius: var(--radius-md);
}

.decree-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.decree-icon {
    font-size: 1.25rem;
}

.decree-title {
    flex: 1;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text);
}

.decree-remove {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0 0.25rem;
    line-height: 1;
    transition: color 0.2s;
}

.decree-remove:hover {
    color: var(--coral);
}

.decree-desc {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.decree-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.78rem;
}

.decree-effect-tag {
    font-weight: 600;
}

.decree-expires {
    color: var(--text-muted);
}


/* ===== DEBUG ELECTIONS ===== */

.debug-election-start {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}

.debug-election-start .debug-role-select {
    flex: 1;
    min-width: 120px;
}

.debug-elections-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.debug-election-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    background: var(--glass-bg);
    border-radius: var(--radius-md);
    font-size: 0.82rem;
}

.debug-election-item span:first-child {
    flex: 1;
    color: var(--text);
    font-weight: 500;
}

.debug-election-status {
    font-size: 0.72rem;
    color: var(--cyan);
    text-transform: uppercase;
    font-weight: 600;
}

.debug-election-finish,
.debug-election-cancel {
    padding: 0.2rem 0.4rem !important;
    font-size: 0.75rem !important;
}

.debug-force-mayor {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.debug-force-mayor .debug-role-select {
    width: 100%;
}


/* ===== LIGHT THEME OVERRIDES for new components ===== */

[data-theme="light"] .ent-card,
[data-theme="light"] .enterprise-card,
[data-theme="light"] .governor-card,
[data-theme="light"] .election-active,
[data-theme="light"] .elections-history,
[data-theme="light"] .governor-dashboard,
[data-theme="light"] .decree-card,
[data-theme="light"] .candidate-card {
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .ent-card-wbar,
[data-theme="light"] .candidate-votes-bar {
    background: rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .ent-cat-option:hover:not(.disabled),
[data-theme="light"] .ent-sel-city:hover,
[data-theme="light"] .ent-res-option:hover {
    background: rgba(0, 0, 0, 0.03);
}

[data-theme="light"] .ent-res-option.selected {
    background: rgba(0, 153, 204, 0.08);
    border-color: var(--cyan);
}

[data-theme="light"] .ent-res-type-option:hover {
    background: rgba(0, 153, 204, 0.06);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}
[data-theme="light"] .ent-res-type-icon {
    background: rgba(0, 0, 0, 0.04);
}
/* Enterprise detail light theme */
[data-theme="light"] .ent-card--clickable:hover {
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.08), 0 2px 8px rgba(0,0,0,0.04);
    border-color: rgba(0, 153, 204, 0.3);
}

[data-theme="light"] .ent-card-worker-chip {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.08);
    color: var(--text-secondary);
}

[data-theme="light"] .ent-detail-stat-box {
    background: rgba(255, 255, 255, 0.8);
    border-color: rgba(0, 0, 0, 0.08);
}
[data-theme="light"] .ent-detail-stat-box:hover {
    border-color: rgba(0, 153, 204, 0.2);
}

[data-theme="light"] .ent-detail-icon {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .ent-detail-wbar {
    background: rgba(0, 0, 0, 0.06);
    border-color: rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .ent-detail-danger {
    border-color: rgba(220, 38, 38, 0.2) !important;
}

[data-theme="light"] .ent-detail-demolish-btn {
    color: var(--coral);
    border-color: rgba(220, 38, 38, 0.25);
}
[data-theme="light"] .ent-detail-demolish-btn:hover {
    background: rgba(220, 38, 38, 0.06);
    border-color: var(--coral);
}

[data-theme="light"] .ent-staff-city-info {
    background: rgba(0, 153, 204, 0.04);
    border-color: rgba(0, 153, 204, 0.1);
}

[data-theme="light"] .ent-staff-slider {
    background: rgba(0, 0, 0, 0.06);
    border-color: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .ent-staff-slider-value {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .ent-staff-no-workers {
    background: rgba(0, 0, 0, 0.02);
    border-color: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .ent-chart-tooltip {
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
}

[data-theme="light"] .ent-prod-hero-icon {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.08);
}
[data-theme="light"] .ent-prod-econ-item {
    background: rgba(0, 0, 0, 0.02);
    border-color: rgba(0, 0, 0, 0.08);
}
[data-theme="light"] .ent-prod-equip-card {
    background: rgba(0, 0, 0, 0.02);
    border-color: rgba(0, 0, 0, 0.08);
}
[data-theme="light"] .ent-prod-equip-dot--dim {
    background: rgba(0, 0, 0, 0.06);
    border-color: rgba(0, 0, 0, 0.08);
}
[data-theme="light"] .ent-prod-equip-cond-bar {
    background: rgba(0, 0, 0, 0.06);
}
[data-theme="light"] .ent-prod-tech-card {
    background: rgba(0, 0, 0, 0.02);
    border-color: rgba(0, 0, 0, 0.12);
}

[data-theme="light"] .worldmap-placement-banner,
[data-theme="light"] .cb-placement-banner {
    background: rgba(249, 115, 22, 0.1);
    border-color: rgba(249, 115, 22, 0.25);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .form-select,
[data-theme="light"] .form-input {
    background: rgba(255, 255, 255, 0.8);
    border-color: rgba(0, 0, 0, 0.12);
    color: var(--text);
}

[data-theme="light"] .tax-slider {
    background: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .debug-election-item {
    background: rgba(0, 0, 0, 0.04);
}

[data-theme="light"] .governor-dashboard {
    border-color: rgba(0, 153, 204, 0.2);
}

/* Modal body for dynamic content */
#modalBody h3 {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text);
    margin: 0 0 1rem 0;
}

.text-muted {
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* ═══════════════════════════════════════════════
 * Market (Биржа) Styles
 * ═══════════════════════════════════════════════ */

.market-page {
    padding: 0;
    max-width: 1100px;
    margin: 0 auto;
}

/* Header */
.market-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.2rem 1.5rem;
    border-radius: var(--radius-lg);
    margin-bottom: 1rem;
}

.market-header h2 {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-bright);
    margin: 0;
}

.market-balance {
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.market-balance strong {
    color: var(--emerald);
    font-weight: 600;
}

/* Tabs — reuse period-tabs */
.market-tabs {
    margin-bottom: 1rem;
}

/* Summary cards grid — fixed 4 columns */
.market-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.6rem;
    margin-bottom: 0;
}

.market-summary-card {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.7rem 0.9rem;
    border-radius: var(--radius);
    transition: var(--transition);
    cursor: pointer;
    position: relative;
    user-select: none;
}

.market-summary-card:hover {
    background: var(--glass-hover);
}

.market-summary-card.active {
    background: rgba(0, 229, 255, 0.08);
    border: 1px solid rgba(0, 229, 255, 0.25);
    box-shadow: 0 0 12px rgba(0, 229, 255, 0.1);
}

.market-summary-card .expand-arrow {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.6rem;
    color: var(--text-muted);
    transition: transform 0.3s ease;
}

.market-summary-card.active .expand-arrow {
    transform: translateY(-50%) rotate(180deg);
    color: var(--cyan);
}

.market-summary-icon {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--cyan-dim);
    border-radius: 8px;
}

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

.market-summary-name {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.market-summary-ref {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.market-summary-stats {
    text-align: right;
    font-size: 0.7rem;
    color: var(--text-secondary);
    white-space: nowrap;
    padding-right: 14px;
}

/* ── Exchange chart panel ── */
.market-chart-panel {
    margin: 0.6rem 0 1rem;
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    transition: max-height 0.4s ease, opacity 0.3s ease, margin 0.3s ease;
}

.market-chart-panel.open {
    max-height: 500px;
    opacity: 1;
}

.market-chart-inner {
    padding: 1rem 1.2rem;
    border-radius: var(--radius);
    background: var(--glass);
    backdrop-filter: blur(14px);
    border: 1px solid var(--glass-border);
}

.market-chart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.8rem;
}

.market-chart-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-bright);
}

.market-chart-stats {
    display: flex;
    gap: 1.2rem;
    font-size: 0.78rem;
}

.market-chart-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.market-chart-stat .label {
    color: var(--text-muted);
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.market-chart-stat .value {
    color: var(--text-bright);
    font-weight: 600;
}

.market-chart-stat .value.up { color: var(--emerald); }
.market-chart-stat .value.down { color: var(--coral); }

.market-chart-area {
    position: relative;
    width: 100%;
    height: 220px;
    overflow: hidden;
}

.market-chart-area svg {
    width: 100%;
    height: 100%;
}

.market-chart-area .chart-grid line {
    stroke: rgba(100, 160, 255, 0.06);
    stroke-dasharray: 2 4;
}

.market-chart-area .chart-axis text {
    fill: var(--text-muted);
    font-size: 10px;
    font-family: var(--font-mono);
}

.market-chart-area .chart-axis line,
.market-chart-area .chart-axis path {
    stroke: rgba(100, 160, 255, 0.1);
}

.market-chart-area .price-line {
    fill: none;
    stroke: var(--cyan);
    stroke-width: 2;
    stroke-linejoin: round;
    stroke-linecap: round;
}

.market-chart-area .price-area {
    fill: url(#priceGradient);
    opacity: 0.3;
}

.market-chart-area .volume-bar {
    fill: rgba(0, 229, 255, 0.15);
    rx: 1;
}

.market-chart-area .volume-bar.sell {
    fill: rgba(255, 107, 107, 0.15);
}

.market-chart-area .trade-dot {
    fill: var(--cyan);
    stroke: rgba(0, 229, 255, 0.3);
    stroke-width: 2;
    cursor: pointer;
    transition: r 0.15s ease;
}

.market-chart-area .trade-dot:hover {
    r: 6;
    stroke-width: 3;
}

.market-chart-tooltip {
    position: absolute;
    pointer-events: none;
    background: rgba(10, 14, 20, 0.92);
    backdrop-filter: blur(8px);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    padding: 0.5rem 0.7rem;
    font-size: 0.75rem;
    color: var(--text-bright);
    white-space: nowrap;
    z-index: 10;
    opacity: 0;
    transition: opacity 0.15s;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

.market-chart-tooltip.show {
    opacity: 1;
}

.market-chart-tooltip .tt-price {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--cyan);
    margin-bottom: 2px;
}

.market-chart-tooltip .tt-vol {
    color: var(--text-secondary);
}

.market-chart-tooltip .tt-date {
    color: var(--text-muted);
    font-size: 0.68rem;
    margin-top: 2px;
}

.market-chart-no-data {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 220px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Light theme */
[data-theme="light"] .market-summary-card.active {
    background: rgba(0, 153, 204, 0.06);
    border-color: rgba(0, 153, 204, 0.2);
}

[data-theme="light"] .market-chart-inner {
    background: rgba(255, 255, 255, 0.7);
}

[data-theme="light"] .market-chart-tooltip {
    background: rgba(255, 255, 255, 0.95);
    border-color: rgba(0, 0, 0, 0.1);
    color: var(--text-primary);
}

[data-theme="light"] .market-chart-area .chart-grid line {
    stroke: rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .market-chart-area .chart-axis text {
    fill: var(--text-secondary);
}

/* Resource filter */
.market-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 1rem;
}

.market-filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 0.35rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
    font-family: var(--font-body);
}

.market-filter-btn:hover {
    color: var(--text-primary);
    border-color: rgba(100, 160, 255, 0.25);
    background: var(--glass-hover);
}

.market-filter-btn.active {
    color: var(--cyan);
    border-color: rgba(0, 229, 255, 0.35);
    background: var(--cyan-dim);
}

.market-filter-btn .res-icon {
    vertical-align: middle;
}

/* Table wrapper */
.market-table-wrap {
    border-radius: var(--radius-lg);
    padding: 0.2rem;
    overflow-x: auto;
}

/* Orders table */
.market-orders-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
}

.market-orders-table th {
    text-align: left;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    padding: 0.65rem 0.7rem;
    border-bottom: 1px solid var(--glass-border);
}

.market-orders-table td {
    padding: 0.6rem 0.7rem;
    color: var(--text-primary);
    border-bottom: 1px solid rgba(100, 160, 255, 0.06);
    vertical-align: middle;
}

.market-orders-table tbody tr:hover {
    background: rgba(100, 160, 255, 0.04);
}

.market-orders-table td .res-icon {
    vertical-align: middle;
    margin-right: 0.3rem;
}

/* Price diff badges */
.market-price-diff--positive {
    color: var(--emerald);
    font-size: 0.75rem;
    font-weight: 600;
}

.market-price-diff--negative {
    color: var(--coral);
    font-size: 0.75rem;
    font-weight: 600;
}

/* Buy button */
.market-buy-btn {
    padding: 0.35rem 0.9rem !important;
    font-size: 0.75rem !important;
    border-radius: 8px !important;
    min-width: auto !important;
}

/* Cancel button */
.market-cancel-btn {
    padding: 0.3rem 0.7rem !important;
    font-size: 0.72rem !important;
    border-radius: 8px !important;
    color: var(--coral) !important;
    border-color: rgba(255, 107, 107, 0.25) !important;
}

.market-cancel-btn:hover {
    background: rgba(255, 107, 107, 0.1) !important;
    border-color: rgba(255, 107, 107, 0.4) !important;
}

/* Own badge */
.market-own-badge {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-style: italic;
}

/* Status badges */
.market-status {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
}

.market-status--active {
    color: var(--emerald);
    background: var(--emerald-dim);
}

.market-status--sold {
    color: var(--cyan);
    background: var(--cyan-dim);
}

.market-status--cancelled {
    color: var(--text-muted);
    background: rgba(100, 120, 160, 0.1);
}

/* Transaction types */
.market-type--buy {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--emerald);
    background: var(--emerald-dim);
}

.market-type--sell {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--gold);
    background: var(--gold-dim);
}

/* Empty state */
.market-empty {
    padding: 2.5rem 1.5rem;
    text-align: center;
    border-radius: var(--radius-lg);
}

.market-empty p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin: 0;
}

/* Buy modal */
.market-buy-modal {
    padding: 0.5rem 0;
}

.market-buy-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    padding: 0.8rem;
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    margin-bottom: 1rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.market-buy-info strong {
    color: var(--text-primary);
}

.market-buy-form label {
    display: block;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.35rem;
}

.market-buy-slider-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.market-buy-slider-row .ent-staff-slider {
    flex: 1;
}

.market-buy-slider-row span {
    min-width: 50px;
    text-align: right;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.market-buy-total {
    font-size: 1rem;
    color: var(--text-secondary);
    text-align: center;
    padding: 0.5rem;
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
}

.market-buy-total strong {
    color: var(--emerald);
    font-size: 1.1rem;
}

/* Sell from warehouse */
.ent-prod-wh-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--glass-border);
}

.ent-prod-sell-btn {
    padding: 0.4rem 1rem !important;
    font-size: 0.78rem !important;
    border-radius: 8px !important;
    gap: 4px;
}

/* Sell modal form */
.market-sell-form {
    padding: 0.5rem 0;
}

.market-sell-form label {
    display: block;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.35rem;
    margin-top: 0.75rem;
}

.market-sell-form label:first-child {
    margin-top: 0;
}

.market-sell-form .market-buy-slider-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0;
}

.market-sell-form .market-buy-slider-row .ent-staff-slider {
    flex: 1;
}

.market-sell-form .market-buy-slider-row span {
    min-width: 50px;
    text-align: right;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.market-sell-form input[type="number"] {
    width: 100%;
    padding: 0.5rem 0.75rem;
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: 0.9rem;
    font-family: var(--font-body);
    outline: none;
    transition: var(--transition);
    -moz-appearance: textfield;
}

.market-sell-form input[type="number"]:focus {
    border-color: rgba(0, 229, 255, 0.4);
    box-shadow: 0 0 0 2px rgba(0, 229, 255, 0.1);
}

.market-sell-form input[type="number"]::-webkit-inner-spin-button,
.market-sell-form input[type="number"]::-webkit-outer-spin-button {
    opacity: 1;
}

.market-sell-total {
    font-size: 1rem;
    color: var(--text-secondary);
    text-align: center;
    padding: 0.6rem;
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    margin-top: 0.75rem;
}

.market-sell-total strong {
    color: var(--emerald);
    font-size: 1.1rem;
}

/* Market content area */
.market-content {
    padding: 0;
}

/* Responsive */
@media (max-width: 768px) {
    .market-header {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }

    .market-summary-grid {
        grid-template-columns: 1fr 1fr;
    }

    .market-orders-table {
        font-size: 0.72rem;
    }

    .market-orders-table th {
        font-size: 0.6rem;
        padding: 0.4rem 0.35rem;
    }

    .market-orders-table td {
        padding: 0.4rem 0.35rem;
    }

    .market-buy-info {
        grid-template-columns: 1fr;
    }

    .market-filter {
        gap: 4px;
    }

    .market-filter-btn {
        padding: 0.25rem 0.5rem;
        font-size: 0.7rem;
    }
}

@media (max-width: 480px) {
    .market-summary-grid {
        grid-template-columns: 1fr;
    }
}

/* Light theme overrides for Market */
[data-theme="light"] .market-filter-btn {
    background: rgba(255, 255, 255, 0.6);
    border-color: rgba(0, 0, 0, 0.08);
    color: var(--text-secondary);
}

[data-theme="light"] .market-filter-btn.active {
    color: var(--cyan);
    border-color: rgba(0, 153, 204, 0.3);
    background: rgba(0, 153, 204, 0.08);
}

[data-theme="light"] .market-orders-table tbody tr:hover {
    background: rgba(0, 0, 0, 0.03);
}

[data-theme="light"] .market-sell-form input[type="number"] {
    background: rgba(255, 255, 255, 0.8);
    border-color: rgba(0, 0, 0, 0.12);
    color: var(--text-primary);
}

/* ===== Shipments / Delivery ===== */

.shipment-progress {
    width: 100%;
    height: 8px;
    background: rgba(100, 160, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.shipment-progress-bar {
    height: 100%;
    border-radius: 4px;
    background: linear-gradient(90deg, var(--cyan), var(--blue));
    transition: width 1s ease-out;
    position: relative;
}

.shipment-progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.3) 50%,
        transparent 100%
    );
    animation: shipment-shimmer 2s infinite;
}

@keyframes shipment-shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.shipment-progress-bar.delivered {
    background: var(--emerald);
}

.shipment-progress-bar.delivered::after {
    display: none;
}

.shipment-status {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 600;
}

.shipment-status--transit {
    background: var(--cyan-dim);
    color: var(--cyan);
}

.shipment-status--delivered {
    background: var(--emerald-dim);
    color: var(--emerald);
}

.shipment-status--cancelled {
    background: var(--danger-bg);
    color: var(--danger);
}

.shipment-route {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.82rem;
    color: var(--text-secondary);
}

.shipment-route-arrow {
    color: var(--text-muted);
    font-size: 0.7rem;
}

/* Buy preview breakdown */
.buy-preview {
    margin: 0.75rem 0;
    padding: 0.75rem;
    background: rgba(100, 160, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
}

.buy-preview-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0;
    font-size: 0.88rem;
    color: var(--text-secondary);
}

.buy-preview-row.total {
    border-top: 1px solid var(--glass-border);
    margin-top: 4px;
    padding-top: 8px;
    color: var(--text-bright);
    font-weight: 600;
    font-size: 1rem;
}

.buy-preview-row .label {
    display: flex;
    align-items: center;
    gap: 4px;
}

.buy-preview-row .value {
    font-weight: 500;
    color: var(--text-primary);
}

.buy-preview-time {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    padding: 6px 10px;
    background: var(--cyan-dim);
    border-radius: 8px;
    font-size: 0.85rem;
    color: var(--cyan);
    font-weight: 500;
}

.buy-preview-loading {
    text-align: center;
    padding: 1rem;
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* City selector in buy modal */
.buy-city-select {
    width: 100%;
    padding: 0.5rem 0.75rem;
    background: var(--glass);
    border: 1px solid var(--glass-border);
    color: var(--text-bright);
    border-radius: 8px;
    font-size: 0.9rem;
    font-family: var(--font-body);
    cursor: pointer;
    margin: 0.25rem 0 0.5rem;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7fa3' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 28px;
}

.buy-city-select:focus {
    outline: none;
    border-color: var(--cyan);
    box-shadow: 0 0 0 2px var(--cyan-dim);
}

.buy-city-select option {
    background: var(--bg-deep);
    color: var(--text-primary);
}

/* Inventory city badge */
.inv-city-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 6px;
    background: rgba(100, 160, 255, 0.08);
    border-radius: 4px;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* Light theme overrides for shipments */
[data-theme="light"] .shipment-progress {
    background: rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .buy-preview {
    background: rgba(0, 0, 0, 0.03);
}

[data-theme="light"] .buy-city-select {
    background: rgba(255, 255, 255, 0.8);
    border-color: rgba(0, 0, 0, 0.12);
    color: var(--text-primary);
}

[data-theme="light"] .buy-city-select option {
    background: #fff;
    color: var(--text-primary);
}

[data-theme="light"] .buy-preview-time {
    background: rgba(0, 153, 204, 0.08);
    color: var(--cyan);
}
