/* ===== ROCAcademy Standard Header/Footer ===== */
.roc-vip-header{background:linear-gradient(180deg,#3d2914 0%,#1a1209 100%);border-bottom:3px solid #d4af37;box-shadow:0 4px 20px rgba(0,0,0,0.5);}
.roc-vip-header-wrap{max-width:1100px;margin:0 auto;padding:11px 20px;display:flex;align-items:center;justify-content:space-between;gap:12px;}
.roc-vip-logo h1{font-family:'Cinzel',serif;font-size:clamp(0.9rem,2.5vw,1.25rem);color:#d4af37;margin:0;letter-spacing:0.3px;}
.roc-vip-logo .subtitle{color:#f4e4a6;opacity:0.68;font-size:0.68rem;margin:2px 0 0;}
.roc-vip-nav{display:flex;gap:7px;align-items:center;}
.roc-vip-nav-link{display:flex;align-items:center;gap:6px;padding:7px 14px;background:rgba(212,175,55,0.08);border:1px solid rgba(212,175,55,0.35);border-radius:6px;color:#d4af37;text-decoration:none;font-family:'Cinzel',serif;font-size:0.72rem;font-weight:600;letter-spacing:0.5px;white-space:nowrap;transition:all 0.2s;}
.roc-vip-nav-link:hover{background:rgba(212,175,55,0.22);border-color:#d4af37;box-shadow:0 0 12px rgba(212,175,55,0.28);transform:translateY(-1px);}
.roc-vip-nav-icon{width:20px;height:20px;object-fit:contain;border-radius:3px;}
.roc-vip-footer{background:linear-gradient(180deg,#1a1209 0%,#0d0b08 100%);border-top:2px solid rgba(212,175,55,0.3);padding:18px 20px;display:flex;align-items:center;justify-content:center;gap:16px;margin-top:32px;}
.roc-vip-footer-logo{width:36px;height:36px;object-fit:contain;opacity:0.85;}
.roc-vip-footer-text{text-align:center;}
.roc-vip-footer-text p{color:#a08860;font-size:0.8rem;font-family:'Cinzel',serif;}
.roc-vip-footer-text .copy{font-size:0.65rem;color:#6b5a3e;margin-top:2px;}
.roc-vip-footer-text .copy a{color:#d4af37;text-decoration:none;}
@media(max-width:500px){.roc-vip-nav-link span{display:none;}.roc-vip-nav-link{padding:7px 10px;}}

/* Eden type selector */
.eden-selector-wrap{display:flex;align-items:center;gap:12px;margin-bottom:18px;flex-wrap:wrap;}
.eden-selector-label{font-size:0.82rem;color:var(--text-secondary);white-space:nowrap;font-weight:600;}
.eden-selector{display:flex;background:rgba(0,0,0,0.3);border:1px solid rgba(255,255,255,0.1);border-radius:10px;padding:3px;gap:3px;}
.eden-sel-btn{padding:7px 20px;border:none;border-radius:8px;background:transparent;color:rgba(255,255,255,0.5);font-size:0.83rem;font-weight:600;cursor:pointer;transition:all .2s;white-space:nowrap;}
.eden-sel-btn:hover{color:rgba(255,255,255,0.85);background:rgba(255,255,255,0.06);}
.eden-sel-btn.active{background:linear-gradient(135deg,#1a3a5c,#0f2640);color:#4fc3f7;box-shadow:0 2px 8px rgba(79,195,247,0.25);border:1px solid rgba(79,195,247,0.35);}
.eden-sel-btn.active[id="btnEdenConqueror"]{background:linear-gradient(135deg,#3a1a00,#261000);color:#d4af37;box-shadow:0 2px 8px rgba(212,175,55,0.25);border:1px solid rgba(212,175,55,0.4);}
.eden-sel-status{font-size:0.75rem;color:var(--text-secondary);opacity:0.7;}
.eden-loading .eden-sel-status{animation:eden-blink .8s ease-in-out infinite;}
@keyframes eden-blink{0%,100%{opacity:.4;}50%{opacity:1;}}

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

        :root {
            --primary-blue: #4fc3f7;
            --primary-green: #66bb6a;
            --primary-red: #f44336;
            --warning: #ff9800;
            --bg-dark: #1a1a2e;
            --bg-darker: #16213e;
            --glass-bg: rgba(255, 255, 255, 0.1);
            --glass-border: rgba(79, 195, 247, 0.3);
            --text-primary: #ffffff;
            --text-secondary: #aaa;
            --animation-speed: 0.3s;
            
            /* Mobile-specific variables */
            --mobile-padding: 15px;
            --mobile-font-size: 14px;
            --mobile-button-height: 44px;
            --mobile-input-height: 42px;
        }

        body {
            background: linear-gradient(135deg, var(--bg-dark) 0%, var(--bg-darker) 100%);
            color: var(--text-primary);
            font-family: 'Arial', sans-serif;
            min-height: 100vh;
            overflow-x: hidden;
            position: relative;
            font-size: var(--mobile-font-size);
        }

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

        ::-webkit-scrollbar-track {
            background: rgba(255, 255, 255, 0.05);
        }

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

        ::-webkit-scrollbar-thumb:hover {
            background: var(--primary-green);
        }

        .container {
			max-width: 1600px;
			margin: 0 auto;
			padding: var(--mobile-padding);
			overflow-x: hidden;
			width: 100%;
			box-sizing: border-box;
		}

        /* Header Styles - Mobile First */
        .header {
            text-align: center;
            margin-bottom: 20px;
            background: var(--glass-bg);
            backdrop-filter: blur(10px);
            border-radius: 15px;
            padding: 20px var(--mobile-padding);
            border: 1px solid var(--glass-border);
            position: relative;
            overflow: hidden;
        }

        .header::before {
            content: '';
            position: absolute;
            top: -50%;
            left: -50%;
            width: 200%;
            height: 200%;
            background: radial-gradient(circle, var(--primary-blue) 0%, transparent 70%);
            opacity: 0.1;
            animation: rotate 20s linear infinite;
        }

        @keyframes rotate {
            to { transform: rotate(360deg); }
        }

        .header h1 {
            font-size: 2rem;
            background: linear-gradient(45deg, var(--primary-blue), var(--primary-green));
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            margin-bottom: 10px;
            position: relative;
            z-index: 1;
            line-height: 1.2;
        }

        .header p {
            position: relative;
            z-index: 1;
            color: var(--text-secondary);
        }

        /* Version Badge */
        .version-badge {
            position: absolute;
            top: 10px;
            right: 10px;
            background: var(--primary-green);
            color: white;
            padding: 4px 12px;
            border-radius: 15px;
            font-size: 11px;
            font-weight: bold;
        }

        /* Sync Status */
        .sync-status {
            position: fixed;
            top: 10px;
            right: 10px;
            background: var(--glass-bg);
            backdrop-filter: blur(10px);
            border: 1px solid var(--glass-border);
            border-radius: 20px;
            padding: 8px 15px;
            display: flex;
            align-items: center;
            gap: 8px;
            z-index: 1000;
            transition: all var(--animation-speed) ease;
            font-size: 12px;
        }

        .sync-status.syncing {
            border-color: var(--warning);
            animation: pulse 2s infinite;
        }

        .sync-status.error {
            border-color: var(--primary-red);
            background: rgba(244, 67, 54, 0.1);
        }

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

        /* Card Styles - Mobile Optimized */        
		.card {
			background: var(--glass-bg);
			backdrop-filter: blur(10px);
			border-radius: 15px;
			padding: 20px var(--mobile-padding);
			margin-bottom: 15px;
			border: 1px solid var(--glass-border);
			transition: all var(--animation-speed) ease;
			position: relative;
			overflow: hidden;
			width: 100%;
			box-sizing: border-box;
		}

        .card::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            height: 3px;
            background: linear-gradient(90deg, var(--primary-blue), var(--primary-green));
            transform: scaleX(0);
            transition: transform var(--animation-speed) ease;
        }

        .card:hover::before {
            transform: scaleX(1);
        }

        .card h2, .card h3 {
            margin-bottom: 15px;
            display: flex;
            align-items: center;
            gap: 8px;
            font-size: 1.2rem;
        }

        /* Navigation Tabs - Mobile Scrollable */
        .nav-tabs {
            display: flex;
            gap: 8px;
            margin-bottom: 20px;
            overflow-x: auto;
            padding-bottom: 10px;
            -webkit-overflow-scrolling: touch;
            scrollbar-width: thin;
        }

        .nav-tabs::-webkit-scrollbar {
            height: 4px;
        }

        .nav-tabs::-webkit-scrollbar-track {
            background: rgba(255, 255, 255, 0.1);
            border-radius: 2px;
        }

        .nav-tabs::-webkit-scrollbar-thumb {
            background: var(--primary-blue);
            border-radius: 2px;
        }

        .nav-tab {
            background: var(--glass-bg);
            border: 1px solid var(--glass-border);
            border-radius: 20px;
            padding: 12px 20px;
            cursor: pointer;
            transition: all var(--animation-speed) ease;
            position: relative;
            overflow: hidden;
            white-space: nowrap;
            flex-shrink: 0;
            min-width: 100px;
            text-align: center;
            font-size: 13px;
            touch-action: manipulation;
            -webkit-tap-highlight-color: transparent;
            user-select: none;
            -webkit-user-select: none;
        }

        .nav-tab:hover {
            transform: translateY(-1px);
            border-color: var(--primary-blue);
        }

        .nav-tab.active {
            background: linear-gradient(45deg, var(--primary-blue), var(--primary-green));
            border-color: transparent;
            color: white;
        }

        .nav-tab .badge {
            position: absolute;
            top: -5px;
            right: -5px;
            background: var(--primary-red);
            color: white;
            border-radius: 50%;
            width: 18px;
            height: 18px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 10px;
            font-weight: bold;
        }

        /* Input Styles - Mobile Optimized */
        .input-group {
            display: flex;
            flex-direction: column;
            gap: 6px;
            margin-bottom: 12px;
        }

        .input-group label {
            font-weight: bold;
            color: var(--primary-blue);
            font-size: 13px;
        }

        input, select, textarea {
            background: rgba(26, 26, 46, 0.8);
            border: 1px solid rgba(79, 195, 247, 0.5);
            border-radius: 8px;
            padding: 12px;
            color: var(--text-primary);
            font-size: var(--mobile-font-size);
            transition: all var(--animation-speed) ease;
            min-height: var(--mobile-input-height);
            width: 100%;
        }

        input:focus, select:focus, textarea:focus {
            outline: none;
            border-color: var(--primary-blue);
            box-shadow: 0 0 15px rgba(79, 195, 247, 0.3);
            transform: translateY(-1px);
        }

        /* Button Styles - Mobile Touch Friendly */
        .btn {
            background: linear-gradient(45deg, var(--primary-blue), var(--primary-green));
            border: none;
            border-radius: 8px;
            padding: 12px 20px;
            color: white;
            cursor: pointer;
            font-weight: bold;
            transition: all var(--animation-speed) ease;
            position: relative;
            overflow: hidden;
            text-decoration: none;
            display: inline-block;
            text-align: center;
            min-height: var(--mobile-button-height);
            font-size: var(--mobile-font-size);
            line-height: 1.2;
            touch-action: manipulation;
            -webkit-tap-highlight-color: transparent;
        }

        .btn::before {
            content: '';
            position: absolute;
            top: 50%;
            left: 50%;
            width: 0;
            height: 0;
            background: rgba(255, 255, 255, 0.2);
            border-radius: 50%;
            transform: translate(-50%, -50%);
            transition: width 0.6s, height 0.6s;
        }

        .btn:active::before {
            width: 300px;
            height: 300px;
        }

        .btn:hover {
            transform: translateY(-1px);
            box-shadow: 0 5px 15px rgba(79, 195, 247, 0.4);
        }

        .btn:disabled {
            opacity: 0.6;
            cursor: not-allowed;
            transform: none;
        }

        .btn-danger {
            background: linear-gradient(45deg, var(--primary-red), #e91e63);
        }

        .btn-secondary {
            background: linear-gradient(45deg, #666, #888);
        }

        .btn-small {
            padding: 10px 16px;
            font-size: 12px;
            border-radius: 6px;
            min-height: 36px;
            white-space: nowrap;
        }

        .btn-icon {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            font-weight: 500;
            transition: all var(--animation-speed) ease;
            position: relative;
            overflow: hidden;
        }

        .btn-icon::before {
            content: '';
            position: absolute;
            top: 50%;
            left: 50%;
            width: 0;
            height: 0;
            background: rgba(255, 255, 255, 0.2);
            border-radius: 50%;
            transform: translate(-50%, -50%);
            transition: width 0.6s, height 0.6s;
        }

        .btn-icon:active::before {
            width: 300px;
            height: 300px;
        }

        /* Grid Layouts - Mobile First */
        .grid-2 {
            display: grid;
            grid-template-columns: 1fr;
            gap: 15px;
        }

        .grid-3 {
            display: grid;
            grid-template-columns: 1fr;
            gap: 10px;
        }

        .grid-4 {
            display: grid;
            grid-template-columns: 1fr;
            gap: 10px;
        }

        /* Table Styles - Mobile Responsive */
        .table-container {
            overflow: hidden;
            border-radius: 10px;
            border: 1px solid var(--glass-border);
            position: relative;
        }

        .table-responsive-wrapper {
            overflow-x: auto;
            -webkit-overflow-scrolling: touch;
            max-width: 100vw;
        }

        .table-virtual-scroll {
            height: 400px;
            overflow-y: auto;
            position: relative;
        }

        /* Mobile table with sticky first column */
        table {
            width: 100%;
            border-collapse: collapse;
            background: rgba(255, 255, 255, 0.05);
            min-width: 800px;
        }

        th, td {
            padding: 10px 8px;
            text-align: left;
            border-bottom: 1px solid rgba(79, 195, 247, 0.2);
            white-space: nowrap;
            font-size: 12px;
            min-width: 80px;
        }

        /* Sticky first column for mobile */
        th:first-child,
        td:first-child {
            position: sticky;
            left: 0;
            background: var(--bg-darker);
            z-index: 10;
            border-right: 2px solid var(--glass-border);
            font-weight: bold;
        }

        th {
            background: rgba(79, 195, 247, 0.2);
            font-weight: bold;
            position: sticky;
            top: 0;
            z-index: 20;
            backdrop-filter: blur(10px);
            color: var(--text-primary);
        }

        tr:hover {
            background: rgba(79, 195, 247, 0.1);
        }

        /* Status Colors */
        .status-locked { color: var(--primary-red); }
        .status-available { color: var(--warning); }
        .status-planned { color: var(--primary-green); }
        .status-occupation { color: var(--primary-blue); animation: pulse 2s infinite; }
        .status-conflict { color: var(--primary-red); font-weight: bold; }

        /* Table Actions - Mobile Responsive */
        .table-actions {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 15px;
            flex-wrap: wrap;
            gap: 10px;
        }

        .table-actions h2 {
            margin: 0;
            flex: 1;
            min-width: 200px;
            font-size: 1.2rem;
        }

        .table-actions .btn-group {
            flex-shrink: 0;
            display: flex;
            gap: 6px;
            flex-wrap: wrap;
        }

        .btn-group {
            display: flex;
            gap: 6px;
            align-items: center;
            flex-wrap: wrap;
        }
		.charts-grid {
			display: grid;
			grid-template-columns: 1fr;
			gap: 15px;
		}

		.chart-container {
			background: var(--glass-bg);
			border-radius: 10px;
			padding: 15px;
			border: 1px solid var(--glass-border);
			position: relative;
			/* CORREÇÃO: Altura fixa para gráficos */
			height: 300px;
			max-height: 300px;
			overflow: hidden;
		}

		.chart-container h3 {
			margin: 0 0 10px 0;
			font-size: 14px;
			position: absolute;
			top: 15px;
			left: 15px;
			z-index: 10;
		}

		.chart-container canvas {
			max-width: 100% !important;
			max-height: 250px !important;
			height: 250px !important;
			width: auto !important;
			position: absolute !important;
			top: 40px !important;
			left: 15px !important;
			right: 15px !important;
			bottom: 15px !important;
		}
        /* 2. CORREÇÃO DO MAPA - MAP CONTAINER */
		.map-container {
			/* CORREÇÃO: Altura responsiva mais adequada */
			height: 50vh;
			min-height: 300px;
			max-height: 400px;
			background: #2a2a3a;
			border-radius: 10px;
			position: relative;
			overflow: hidden;
			border: 1px solid var(--glass-border);
			cursor: grab;
			touch-action: none;
			/* CORREÇÃO: Aspect ratio para manter proporção */
			aspect-ratio: 16/10;
		}
        
        .map-container:active {
            cursor: grabbing;
        }
        
        /* CORREÇÃO: Map viewport com dimensões controladas */
		.map-viewport {
			position: absolute;
			width: 100%;
			height: 100%;
			transform-origin: center center;
			transition: transform 0.3s ease;
			max-width: 100%;
			max-height: 100%;
		}        
        
        #mapCanvas {
			position: absolute !important;
			top: 0 !important;
			left: 0 !important;
			width: 100% !important;
			height: 100% !important;
			max-width: 100% !important;
			max-height: 100% !important;
			z-index: 1 !important;
			image-rendering: pixelated;
			image-rendering: -moz-crisp-edges;
			image-rendering: crisp-edges;
			display: block;
			pointer-events: auto;
		}
        
        #mapStructures {
            position: relative !important;
            z-index: 10 !important;
            width: 100%;
            height: 100%;
        }

        .map-structure {
            position: absolute;
            width: 8px;
            height: 8px;
            border-radius: 50%;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 12px;
            border: 2px solid transparent;
            transform: translate(-50%, -50%);
            transition: all 0.2s ease !important;
            z-index: 10;
        }

        .map-structure:hover {
            transform: translate(-50%, -50%) scale(2.5) !important;
            z-index: 100;
            border: 2px solid white !important;
            box-shadow: 0 0 15px rgba(255, 255, 255, 0.8) !important;
            width: 16px;
            height: 16px;
            font-size: 14px;
        }

        .map-structure.north { background: rgba(244, 67, 54, 0.9); }
        .map-structure.south { background: rgba(79, 195, 247, 0.9); }
        .map-structure.neutral { background: rgba(255, 255, 255, 0.7); }
        /* Conqueror empire faction colours */
        .map-structure.empire-bosermoon  { background: rgba(255, 215, 0,   0.9); }
        .map-structure.empire-melydadiz  { background: rgba(244, 67,  54,  0.9); }
        .map-structure.empire-tanbernya  { background: rgba(79,  195, 247, 0.9); }
        .map-structure.empire-tankyar    { background: rgba(102, 187, 106, 0.9); }
        .map-structure.planned { 
            border: 3px solid var(--primary-green); 
            box-shadow: 0 0 10px rgba(102, 187, 106, 0.5);
        }
        
        .map-structure.stronghold { border-radius: 0; }
        .map-structure.capitol { border-radius: 20%; }
        .map-structure.world-center { 
            border-radius: 50%;
            border: 3px solid gold;
        }

        /* Map Controls - Mobile Optimized */
        .map-controls {
            position: absolute;
            bottom: 15px;
            right: 15px;
            display: flex;
            flex-direction: column;
            gap: 8px;
            z-index: 100;
        }

        .map-controls button {
            width: 44px;
            height: 44px;
            border-radius: 8px;
            background: var(--glass-bg);
            backdrop-filter: blur(10px);
            border: 1px solid var(--glass-border);
            color: white;
            cursor: pointer;
            transition: all var(--animation-speed) ease;
            font-size: 16px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-weight: bold;
        }

        .map-controls button:hover {
            background: var(--primary-blue);
            transform: scale(1.05);
        }
        
        .map-legend {
            position: absolute;
            top: 15px;
            left: 15px;
            background: var(--glass-bg);
            backdrop-filter: blur(10px);
            border: 1px solid var(--glass-border);
            border-radius: 8px;
            padding: 12px;
            z-index: 100;
            max-width: calc(100% - 100px);
        }
        
        .map-legend h4 {
            margin: 0 0 8px 0;
            font-size: 12px;
        }
        
        .legend-item {
            display: flex;
            align-items: center;
            gap: 6px;
            margin: 3px 0;
            font-size: 11px;
        }
        
        .legend-color {
            width: 12px;
            height: 12px;
            border-radius: 50%;
            border: 2px solid transparent;
        }

        /* Stats Grid - Mobile First */
        .stats-grid {
            display: grid;
            grid-template-columns: 1fr;
            gap: 15px;
            margin-bottom: 20px;
        }

        .stat-card {
            background: var(--glass-bg);
            border-radius: 10px;
            padding: 15px;
            border-left: 4px solid var(--primary-blue);
            position: relative;
            overflow: hidden;
            transition: all var(--animation-speed) ease;
        }

        .stat-card:hover {
            transform: translateY(-2px);
            box-shadow: 0 10px 30px rgba(79, 195, 247, 0.3);
        }

        .stat-card::before {
            content: '';
            position: absolute;
            top: 0;
            right: 0;
            width: 80px;
            height: 80px;
            background: radial-gradient(circle, var(--primary-blue) 0%, transparent 70%);
            opacity: 0.1;
            transform: translate(25px, -25px);
        }

        .stat-card h4 {
            font-size: 12px;
            color: var(--text-secondary);
            margin-bottom: 8px;
        }

        .stat-value {
            font-size: 1.8rem;
            font-weight: bold;
            color: var(--primary-green);
            margin-bottom: 5px;
            line-height: 1.2;
        }

        .stat-change {
            font-size: 11px;
            color: var(--text-secondary);
        }

        .stat-change.positive {
            color: var(--primary-green);
        }

        .stat-change.negative {
            color: var(--primary-red);
        }

        /* Modal Styles - Mobile Optimized */
        .modal {
            display: none;
            position: fixed !important;
            z-index: 9999;
            left: 0;
            top: 0;
            width: 100%;
            height: 100%;
            background-color: rgba(0, 0, 0, 0.7);
            backdrop-filter: blur(5px);
            animation: fadeIn var(--animation-speed) ease;
            align-items: center;
            justify-content: center;
            padding: 20px;
            box-sizing: border-box;
            overflow-y: auto;
            touch-action: none;
        }

        .modal.show {
            display: flex !important;
        }

        @keyframes fadeIn {
            from { opacity: 0; }
            to { opacity: 1; }
        }

        .modal-content {
            background: linear-gradient(135deg, var(--bg-dark) 0%, var(--bg-darker) 100%);
            margin: auto;
            padding: 20px;
            border-radius: 15px;
            width: 90%;
            max-width: 500px;
            max-height: 90vh;
            border: 1px solid var(--glass-border);
            overflow-y: auto;
            position: relative;
            animation: slideInScale 0.3s ease;
            transform: scale(1);
            touch-action: pan-y;
            -webkit-overflow-scrolling: touch;
        }

        @keyframes slideInScale {
            from { 
                transform: scale(0.9) translateY(-20px); 
                opacity: 0; 
            }
            to { 
                transform: scale(1) translateY(0); 
                opacity: 1; 
            }
        }

        .modal-header {
            display: flex;
            justify-content: space-between;
            align-items: flex-start;
            margin-bottom: 20px;
            padding-bottom: 15px;
            border-bottom: 1px solid var(--glass-border);
        }

        .modal-header h2 {
            font-size: 1.3rem;
            line-height: 1.3;
            flex: 1;
            padding-right: 15px;
        }

        .close {
            font-size: 24px;
            font-weight: bold;
            cursor: pointer;
            transition: all var(--animation-speed) ease;
            color: var(--text-secondary);
            padding: 5px;
            flex-shrink: 0;
            min-width: 44px;
            min-height: 44px;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .close:hover {
            color: var(--primary-red);
            transform: rotate(90deg);
        }

        /* ── Compact Planning Modal ─────────────────────────────────── */
        .modal-compact {
            max-width: 440px;
            padding: 16px 18px 14px;
            max-height: 88vh;
        }

        .modal-compact .modal-header {
            margin-bottom: 12px;
            padding-bottom: 10px;
            align-items: center;
        }

        .modal-title-wrap {
            flex: 1;
            padding-right: 8px;
            min-width: 0;
        }

        .modal-title-wrap h2 {
            font-size: 1rem;
            margin: 0 0 2px;
            line-height: 1.2;
        }

        .modal-structure-info {
            display: block;
            font-size: 0.72rem;
            color: var(--text-secondary);
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .modal-hint {
            font-size: 0.65rem;
            color: var(--warning);
            font-weight: normal;
            margin-left: 4px;
        }

        .modal-fields {
            display: flex;
            flex-direction: column;
            gap: 8px;
        }

        .modal-row {
            display: flex;
            gap: 8px;
            align-items: flex-end;
        }

        .modal-field {
            display: flex;
            flex-direction: column;
            gap: 3px;
        }

        .modal-field label {
            font-size: 0.68rem;
            text-transform: uppercase;
            letter-spacing: 0.04em;
            color: var(--text-secondary);
            font-weight: 600;
        }

        .modal-field input,
        .modal-field select,
        .modal-field textarea {
            padding: 7px 9px;
            font-size: 0.85rem;
            border-radius: 7px;
            background: var(--glass-bg);
            border: 1px solid var(--glass-border);
            color: var(--text-primary);
            width: 100%;
            box-sizing: border-box;
            transition: border-color 0.15s ease;
        }

        .modal-field input:focus,
        .modal-field select:focus,
        .modal-field textarea:focus {
            outline: none;
            border-color: var(--primary-blue);
        }

        .modal-field textarea {
            resize: none;
            min-height: 54px;
        }

        .modal-field-grow { flex: 1; min-width: 0; }
        .modal-field-faction { flex: 0 0 130px; }
        .modal-field-time    { flex: 0 0 110px; }
        .modal-field-priority{ flex: 0 0 120px; }

        .modal-conflict {
            background: rgba(244, 67, 54, 0.08);
            border: 1px solid var(--primary-red);
            border-radius: 7px;
            padding: 8px 10px;
            margin-top: 8px;
            font-size: 0.8rem;
        }

        .modal-conflict p { margin: 3px 0 0; font-size: 0.78rem; }

        .modal-actions {
            display: flex;
            gap: 8px;
            justify-content: flex-end;
            margin-top: 12px;
        }

        /* ── END Compact Planning Modal ─────────────────────────────── */

        /* Notification System - Mobile Optimized */
        .notifications-container {
            position: fixed;
            top: 60px;
            right: 15px;
            left: 15px;
            z-index: 3000;
            display: flex;
            flex-direction: column;
            gap: 8px;
            max-width: none;
        }

        .notification {
            background: var(--glass-bg);
            backdrop-filter: blur(10px);
            border: 1px solid var(--glass-border);
            border-radius: 8px;
            padding: 12px;
            display: flex;
            align-items: flex-start;
            gap: 8px;
            animation: slideInRight var(--animation-speed) ease;
            position: relative;
            overflow: hidden;
            font-size: 13px;
        }

        @keyframes slideInRight {
            from { transform: translateX(100%); }
            to { transform: translateX(0); }
        }

        .notification::before {
            content: '';
            position: absolute;
            bottom: 0;
            left: 0;
            height: 3px;
            background: var(--primary-blue);
            animation: timerBar 5s linear forwards;
        }

        @keyframes timerBar {
            from { width: 100%; }
            to { width: 0%; }
        }

        .notification.success::before { background: var(--primary-green); }
        .notification.error::before { background: var(--primary-red); }
        .notification.warning::before { background: var(--warning); }

        .notification-icon {
            font-size: 18px;
        }

        .notification-content h4 {
            margin: 0 0 4px 0;
            font-size: 13px;
        }

        .notification-content p {
            margin: 0;
            font-size: 11px;
            color: var(--text-secondary);
        }

        .notification-close {
            position: absolute;
            top: 5px;
            right: 5px;
            cursor: pointer;
            font-size: 14px;
            color: var(--text-secondary);
            min-width: 24px;
            min-height: 24px;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .notification-close:hover {
            color: var(--primary-red);
        }

        /* Quick Actions Bar - Mobile Optimized */
        .quick-actions {
            position: fixed;
            bottom: 15px;
            left: 50%;
            transform: translateX(-50%);
            background: var(--glass-bg);
            backdrop-filter: blur(10px);
            border: 1px solid var(--glass-border);
            border-radius: 25px;
            padding: 8px 15px;
            display: flex;
            gap: 10px;
            z-index: 9000;
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
            max-width: calc(100vw - 30px);
            overflow-x: auto;
            touch-action: manipulation;
            -webkit-tap-highlight-color: transparent;
        }

        .quick-action {
            width: 44px;
            height: 44px;
            border-radius: 50%;
            background: rgba(255, 255, 255, 0.1);
            border: 1px solid var(--glass-border);
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            transition: all var(--animation-speed) ease;
            position: relative;
            flex-shrink: 0;
            font-size: 14px;
            min-width: 44px;
            min-height: 44px;
            touch-action: manipulation;
            -webkit-tap-highlight-color: transparent;
            user-select: none;
            -webkit-user-select: none;
        }

        .quick-action:hover {
            background: var(--primary-blue);
            transform: translateY(-2px);
        }

        .quick-action .tooltip {
            position: absolute;
            bottom: 45px;
            background: rgba(0, 0, 0, 0.8);
            color: white;
            padding: 4px 8px;
            border-radius: 4px;
            font-size: 10px;
            white-space: nowrap;
            opacity: 0;
            transition: opacity var(--animation-speed) ease;
            pointer-events: none;
        }

        .quick-action:hover .tooltip {
            opacity: 1;
        }

        /* ── Conqueror Weekly Timeline ──────────────────────────────── */
        .cq-week-tabs {
            display: flex;
            gap: 4px;
            flex-wrap: wrap;
            margin-bottom: 12px;
        }
        .cq-week-tab {
            padding: 6px 13px;
            border: 1px solid rgba(212,175,55,0.25);
            border-radius: 6px;
            background: rgba(0,0,0,0.3);
            color: rgba(255,255,255,0.5);
            font-size: 0.75rem;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.2s;
            white-space: nowrap;
        }
        .cq-week-tab:hover {
            background: rgba(212,175,55,0.1);
            color: rgba(255,255,255,0.85);
            border-color: rgba(212,175,55,0.5);
        }
        .cq-week-tab.active {
            background: linear-gradient(135deg, #3a1a00, #261000);
            color: #d4af37;
            border-color: rgba(212,175,55,0.6);
            box-shadow: 0 2px 8px rgba(212,175,55,0.2);
        }
        .cq-week-tab.current:not(.active)::after {
            content: '●';
            font-size: 0.5rem;
            vertical-align: super;
            margin-left: 3px;
            color: #d4af37;
        }
        .cq-week-panel {
            display: flex;
            flex-direction: column;
            gap: 8px;
        }
        .cq-week-heading {
            display: flex;
            justify-content: space-between;
            align-items: baseline;
            padding: 6px 0 4px;
            border-bottom: 1px solid rgba(212,175,55,0.2);
            margin-bottom: 4px;
        }
        .cq-week-title {
            font-size: 0.82rem;
            font-weight: 700;
            color: #d4af37;
        }
        .cq-week-range {
            font-size: 0.7rem;
            color: var(--text-secondary);
        }
        .cq-event-card {
            background: var(--glass-bg);
            border: 1px solid rgba(212,175,55,0.15);
            border-radius: 7px;
            padding: 10px 12px;
            cursor: pointer;
            transition: all 0.2s;
        }
        .cq-event-card:hover {
            border-color: rgba(212,175,55,0.45);
            background: rgba(212,175,55,0.06);
            transform: translateX(2px);
        }
        .cq-event-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 5px;
        }
        .cq-event-day {
            font-size: 0.82rem;
            font-weight: 700;
            color: #d4af37;
        }
        .cq-real-date {
            font-size: 0.72rem;
            color: var(--text-secondary);
            font-weight: 400;
        }
        .cq-event-count {
            font-size: 0.7rem;
            color: var(--primary-blue);
            background: rgba(79,195,247,0.1);
            padding: 2px 7px;
            border-radius: 10px;
            white-space: nowrap;
        }
        .cq-event-structs {
            display: flex;
            flex-direction: column;
            font-size: 0.75rem;
            color: var(--text-primary);
            margin-bottom: 3px;
            line-height: 1.4;
        }
        .cq-event-sectors {
            font-size: 0.7rem;
            color: var(--text-secondary);
            margin-bottom: 2px;
        }
        .cq-event-points {
            font-size: 0.7rem;
            color: #ffd700;
            font-weight: 600;
        }
        .cq-event-note {
            font-size: 0.7rem;
            color: var(--primary-green);
            font-weight: 600;
            margin-top: 2px;
        }
        /* Lobby / hero structures highlight */
        .cq-event-lobby {
            display: block;
            color: #f0c060;
            font-style: italic;
            font-size: 0.72rem;
            margin-top: 2px;
        }

        /* Timeline Enhanced */
        .timeline {
            position: relative;
            padding: 15px 0;
        }

        .timeline-track {
            display: flex;
            gap: 10px;
            overflow-x: auto;
            padding-bottom: 8px;
            -webkit-overflow-scrolling: touch;
        }

        .timeline-item {
            background: var(--glass-bg);
            border-radius: 8px;
            padding: 15px;
            text-align: center;
            border: 2px solid transparent;
            min-width: 150px;
            transition: all var(--animation-speed) ease;
            cursor: pointer;
            position: relative;
            flex-shrink: 0;
        }

        .timeline-item::before {
            content: '';
            position: absolute;
            bottom: -15px;
            left: 50%;
            transform: translateX(-50%);
            width: 8px;
            height: 8px;
            border-radius: 50%;
            background: var(--glass-border);
        }

        .timeline-item.active {
            border-color: var(--primary-blue);
            box-shadow: 0 0 20px rgba(79, 195, 247, 0.3);
            background: rgba(79, 195, 247, 0.1);
        }

        .timeline-item.active::before {
            background: var(--primary-blue);
            box-shadow: 0 0 8px var(--primary-blue);
        }

        .timeline-item.occupation-day {
            border-color: var(--primary-green);
            background: rgba(102, 187, 106, 0.1);
        }

        .timeline-item:hover {
            transform: translateY(-2px);
            border-color: var(--primary-blue);
        }

        /* Conflict Badge */
        .conflict-badge {
            position: absolute;
            top: -8px;
            right: -8px;
            background: var(--primary-red);
            color: white;
            border-radius: 50%;
            width: 24px;
            height: 24px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-weight: bold;
            font-size: 12px;
            box-shadow: 0 2px 8px rgba(244, 67, 54, 0.5);
            animation: pulse 2s infinite;
        }

        /* Favorites */
        .favorite-btn {
            position: absolute;
            top: 8px;
            right: 8px;
            background: none;
            border: none;
            color: var(--text-secondary);
            cursor: pointer;
            font-size: 16px;
            transition: all var(--animation-speed) ease;
            min-width: 32px;
            min-height: 32px;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .favorite-btn:hover {
            color: var(--warning);
            transform: scale(1.1);
        }

        .favorite-btn.active {
            color: var(--warning);
        }

        /* Loading States */
        .skeleton {
            background: linear-gradient(90deg, rgba(255, 255, 255, 0.1) 25%, rgba(255, 255, 255, 0.2) 50%, rgba(255, 255, 255, 0.1) 75%);
            background-size: 200% 100%;
            animation: loading 1.5s infinite;
        }

        @keyframes loading {
            0% { background-position: 200% 0; }
            100% { background-position: -200% 0; }
        }

        .btn.loading {
            pointer-events: none;
            opacity: 0.7;
        }

        .btn.loading::after {
            content: '';
            width: 16px;
            height: 16px;
            border: 2px solid transparent;
            border-top: 2px solid currentColor;
            border-radius: 50%;
            animation: spin 1s linear infinite;
            margin-left: 8px;
        }

        @keyframes spin {
            to { transform: rotate(360deg); }
        }

        /* Button states */
        .btn-icon.success {
            background: linear-gradient(45deg, var(--primary-green), #81c784) !important;
            animation: success-pulse 0.6s ease;
        }

        @keyframes success-pulse {
            0% { transform: scale(1); }
            50% { transform: scale(1.05); }
            100% { transform: scale(1); }
        }

        /* Filter badge */
        .filter-badge {
            background: var(--primary-blue);
            color: white;
            padding: 2px 6px;
            border-radius: 10px;
            font-size: 10px;
            font-weight: bold;
            margin-left: 6px;
            min-width: 16px;
            text-align: center;
        }

        .filter-badge.hidden {
            display: none;
        }

        /* Table info */
        .table-info {
            color: var(--text-secondary);
            font-size: 12px;
            margin-right: 15px;
        }

        /* Error message */
        .error-message {
            color: #f44336;
            background: rgba(244, 67, 54, 0.1);
            padding: 10px;
            border-radius: 5px;
            margin: 10px 0;
            border-left: 4px solid #f44336;
        }

        /* Success message */
        .success-message {
            color: #66bb6a;
            background: rgba(102, 187, 106, 0.1);
            padding: 10px;
            border-radius: 5px;
            margin: 10px 0;
            border-left: 4px solid #66bb6a;
        }

        /* Utility classes */
        .hidden {
            display: none !important;
        }

        .sr-only {
            position: absolute;
            width: 1px;
            height: 1px;
            padding: 0;
            margin: -1px;
            overflow: hidden;
            clip: rect(0,0,0,0);
            white-space: nowrap;
            border: 0;
        }

        .text-center { text-align: center; }
        .text-left { text-align: left; }
        .text-right { text-align: right; }
        .flex { display: flex; }
        .flex-wrap { flex-wrap: wrap; }
        .justify-center { justify-content: center; }
        .justify-between { justify-content: space-between; }
        .items-center { align-items: center; }
        .gap-2 { gap: 8px; }
        .gap-4 { gap: 16px; }
        .w-full { width: 100%; }
        .h-full { height: 100%; }

        /* Draggable */
        .draggable {
            cursor: move;
        }

        .dragging {
            opacity: 0.5;
        }

        .drag-over {
            background: rgba(79, 195, 247, 0.1);
        }

        /* Connection Indicator */
        .connection-indicator {
            width: 8px;
            height: 8px;
            border-radius: 50%;
            background: var(--primary-green);
            display: inline-block;
        }

        .connection-indicator.offline {
            background: var(--primary-red);
        }

        .connection-indicator.syncing {
            background: var(--warning);
            animation: pulse 1s infinite;
        }

        /* Focus styles for accessibility */
        *:focus-visible {
            outline: 2px solid var(--primary-blue);
            outline-offset: 2px;
        }

        .btn:focus-visible,
        .nav-tab:focus-visible {
            outline: 2px solid white;
            outline-offset: 2px;
        }

        /* TABLET RESPONSIVE (768px and up) */
        @media (min-width: 768px) {
            :root {
                --mobile-padding: 20px;
                --mobile-font-size: 16px;
            }

            .container {
                padding: 20px;
            }

            .header {
                padding: 25px 30px;
                margin-bottom: 30px;
            }

            .header h1 {
                font-size: 2.5rem;
            }

            .version-badge {
                top: 20px;
                right: 20px;
                padding: 5px 15px;
                font-size: 12px;
            }
			.charts-grid {
				grid-template-columns: repeat(2, 1fr);
				gap: 20px;
			}
			.chart-container {
				height: 350px;
				max-height: 350px;
				padding: 20px;
			}
			.chart-container canvas {
				max-height: 290px !important;
				height: 290px !important;
				top: 50px !important;
			}
            .sync-status {
                top: 20px;
                right: 20px;
                padding: 10px 20px;
                font-size: 14px;
            }

            .card {
                padding: 25px;
                margin-bottom: 20px;
            }

            .grid-2 {
                grid-template-columns: repeat(2, 1fr);
                gap: 20px;
            }

            .grid-3 {
                grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
                gap: 15px;
            }

            .grid-4 {
                grid-template-columns: repeat(2, 1fr);
                gap: 15px;
            }

            .stats-grid {
                grid-template-columns: repeat(2, 1fr);
                gap: 20px;
            }

            .nav-tabs {
                justify-content: center;
                overflow: visible;
                flex-wrap: wrap;
            }

            .nav-tab {
                font-size: 14px;
                padding: 12px 25px;
                min-width: auto;
            }

            .table-actions {
                flex-wrap: nowrap;
            }

            .table-actions h2 {
                min-width: auto;
                font-size: 1.5rem;
            }

            .map-container {
				height: 60vh;
				min-height: 400px;
				max-height: 500px;
			}

            .map-controls {
                bottom: 20px;
                right: 20px;
                gap: 10px;
            }

            .map-legend {
                top: 20px;
                left: 20px;
                padding: 15px;
            }

            .map-legend h4 {
                font-size: 14px;
            }

            .legend-item {
                font-size: 12px;
            }

            .notifications-container {
                top: 80px;
                right: 20px;
                left: auto;
                max-width: 350px;
            }

            .notification {
                font-size: 14px;
                padding: 15px;
            }

            .quick-actions {
                bottom: 20px;
                max-width: 400px;
                padding: 10px 20px;
                gap: 15px;
            }

            .quick-action {
                width: 40px;
                height: 40px;
                font-size: 16px;
                min-width: 40px;
                min-height: 40px;
            }

            .quick-action .tooltip {
                bottom: 50px;
                font-size: 12px;
                padding: 5px 10px;
            }

            .modal-content {
                max-width: 600px;
                padding: 30px;
            }

            .modal-compact {
                max-width: 440px;
                padding: 16px 18px 14px;
            }

            .modal-header h2 {
                font-size: 1.5rem;
            }

            .modal-compact .modal-header h2 {
                font-size: 1rem;
            }

            .timeline-item {
                min-width: 200px;
                padding: 20px;
            }

            th, td {
                padding: 12px;
                font-size: 13px;
            }
        }

        /* DESKTOP RESPONSIVE (1024px and up) */
        @media (min-width: 1024px) {
            .grid-3 {
                grid-template-columns: repeat(3, 1fr);
            }

            .grid-4 {
                grid-template-columns: repeat(4, 1fr);
            }

            .stats-grid {
                grid-template-columns: repeat(4, 1fr);
            }

            .header h1 {
                font-size: 3rem;
            }

            .charts-grid {
				grid-template-columns: repeat(2, 1fr);
				gap: 20px;
			}
			
			.chart-container {
				height: 400px;
				max-height: 400px;
			}
			
			.chart-container canvas {
				max-height: 340px !important;
				height: 340px !important;
			}
			
			.map-container {
				height: 70vh;
				min-height: 500px;
				max-height: 600px;
				aspect-ratio: 16/9;
			}

            .modal-content {
                max-width: 700px;
            }

            /* Desktop table - remove sticky column */
            table {
                min-width: auto;
            }

            th:first-child,
            td:first-child {
                position: static;
                border-right: none;
            }

            th, td {
                padding: 14px;
                font-size: 14px;
                min-width: auto;
            }

            .table-virtual-scroll {
				height: 400px;
				max-height: 400px;
				overflow-y: auto;
				overflow-x: hidden;
				position: relative;
			}
        }

        /* LARGE SCREEN RESPONSIVE (1200px and up) */
        @media (min-width: 1200px) {
            .notifications-container {
                top: 80px;
                right: 20px;
            }

            .quick-actions {
                bottom: 20px;
            }
        }

        /* TOUCH DEVICE IMPROVEMENTS */
        @media (hover: none) and (pointer: coarse) {
            .btn, .nav-tab, .map-controls button {
                min-height: 44px;
            }

            .btn-small {
                min-height: 36px;
                padding: 8px 12px;
            }

            /* Compact modal on touch: full-width, fields stack on very narrow screens */
            .modal-compact {
                width: 96%;
                max-width: 96%;
                padding: 14px;
            }

            .modal-field-faction,
            .modal-field-time,
            .modal-field-priority {
                flex: 0 0 115px;
            }

            .modal-field input,
            .modal-field select,
            .modal-field textarea {
                min-height: 40px;
                font-size: 16px; /* prevents iOS zoom on focus */
            }

            .quick-action {
                min-width: 44px;
                min-height: 44px;
                width: 44px;
                height: 44px;
            }

            .close {
                min-width: 44px;
                min-height: 44px;
            }

            /* Remove hover effects on touch devices */
            .btn:hover,
            .nav-tab:hover,
            .card:hover,
            .stat-card:hover,
            .timeline-item:hover,
            .quick-action:hover {
                transform: none;
            }

            .map-structure:hover {
                transform: translate(-50%, -50%) scale(1.5) !important;
                width: 12px;
                height: 12px;
            }
        }

        /* LANDSCAPE MOBILE SPECIFIC */
        @media (orientation: landscape) and (max-height: 500px) {
            .header {
                padding: 15px;
                margin-bottom: 15px;
            }

            .header h1 {
                font-size: 1.8rem;
            }

            .map-container {
				height: 40vh;
				min-height: 250px;
				max-height: 300px;
			}
			
			.chart-container {
				height: 250px;
				max-height: 250px;
			}
			
			.chart-container canvas {
				max-height: 200px !important;
				height: 200px !important;
			}

            .modal-content {
                max-height: 80vh;
            }

            .quick-actions {
                bottom: 10px;
            }
        }

        /* VERY SMALL SCREENS */
        @media (max-width: 320px) {
            :root {
                --mobile-padding: 10px;
                --mobile-font-size: 13px;
            }

            .header h1 {
                font-size: 1.6rem;
            }

            .nav-tab {
                padding: 10px 15px;
                font-size: 12px;
                min-width: 80px;
            }

            .btn-small {
                padding: 6px 10px;
                font-size: 11px;
            }

            .map-controls button {
                width: 40px;
                height: 40px;
                font-size: 14px;
            }

            .quick-action {
                width: 36px;
                height: 36px;
                min-width: 36px;
                min-height: 36px;
                font-size: 12px;
            }
			.map-container {
				height: 45vh;
				min-height: 280px;
				max-height: 320px;
			}
			
			.chart-container {
				height: 250px;
				max-height: 250px;
				padding: 10px;
			}
			
			.chart-container canvas {
				max-height: 210px !important;
				height: 210px !important;
				top: 30px !important;
			}
        }

        /* ACCESSIBILITY IMPROVEMENTS */
        @media (prefers-reduced-motion: reduce) {
            * {
                animation-duration: 0.01ms !important;
                animation-iteration-count: 1 !important;
                transition-duration: 0.01ms !important;
            }

            :root {
                --animation-speed: 0.01ms;
            }
        }

        /* HIGH CONTRAST MODE */
        @media (prefers-contrast: high) {
            :root {
                --glass-bg: rgba(255, 255, 255, 0.2);
                --glass-border: rgba(255, 255, 255, 0.5);
            }

            .btn {
                border: 2px solid white;
            }

            .card {
                border: 2px solid var(--primary-blue);
            }
        }

        /* ── Analytics KPI grid ─────────────────────────────────────── */
        .analytics-kpi-grid {
            display: flex;
            flex-wrap: wrap;
            gap: 12px;
            margin-bottom: 20px;
        }

        .kpi-card {
            flex: 1;
            min-width: 130px;
            background: var(--glass-bg);
            border: 1px solid var(--glass-border);
            border-radius: 10px;
            padding: 16px 12px;
            text-align: center;
        }

        .kpi-value {
            font-size: 1.7rem;
            font-weight: 700;
            line-height: 1.1;
        }

        .kpi-label {
            font-size: 0.72rem;
            color: var(--text-secondary);
            margin-top: 5px;
            text-transform: uppercase;
            letter-spacing: 0.04em;
        }

        /* ── Guild ranking table ─────────────────────────────────────── */
        .guild-ranking-table {
            width: 100%;
            border-collapse: collapse;
            font-size: 13px;
        }

        .guild-ranking-table th {
            color: var(--text-secondary);
            font-weight: 600;
            padding: 8px 10px;
            border-bottom: 1px solid var(--glass-border);
            text-align: left;
            font-size: 0.72rem;
            text-transform: uppercase;
            letter-spacing: 0.04em;
        }

        .guild-ranking-table td {
            padding: 8px 10px;
            border-bottom: 1px solid rgba(255,255,255,0.05);
            vertical-align: middle;
        }

        .guild-ranking-table tr:last-child td { border-bottom: none; }

        .execution-bar {
            height: 5px;
            border-radius: 3px;
            background: rgba(255,255,255,0.1);
            margin-top: 4px;
            min-width: 60px;
        }

        .execution-bar-fill {
            height: 100%;
            border-radius: 3px;
            background: var(--primary-blue);
            transition: width 0.3s ease;
        }

        .rank-gold   { border-left: 3px solid #ffd700; }
        .rank-silver { border-left: 3px solid #c0c0c0; }
        .rank-bronze { border-left: 3px solid #cd7f32; }

        /* ── Day coverage rows ───────────────────────────────────────── */
        .day-coverage-row {
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 5px 0;
            border-bottom: 1px solid rgba(255,255,255,0.04);
        }

        .day-coverage-bar {
            flex: 1;
            height: 6px;
            border-radius: 3px;
            background: rgba(255,255,255,0.1);
        }

        .day-coverage-fill {
            height: 100%;
            border-radius: 3px;
            transition: width 0.3s ease;
        }

        /* ── END Analytics additions ─────────────────────────────────── */

        /* PRINT STYLES */
        @media print {
            .nav-tabs,
            .quick-actions,
            .notifications-container,
            .map-controls,
            .sync-status,
            .no-print {
                display: none !important;
            }

            body {
                background: white;
                color: black;
            }

            .card {
                border: 1px solid #ddd;
                page-break-inside: avoid;
                background: white;
            }

            .header {
                background: white;
                color: black;
            }

            table {
                min-width: auto;
            }

            th:first-child,
            td:first-child {
                position: static;
                border-right: none;
            }
        }
/* ===== MAP IMPROVEMENTS ===== */

/* Increase map height for better visibility */
.map-container {
    height: 60vh !important;
    min-height: 400px !important;
    max-height: 600px !important;
}

/* Conflict badge on markers */
.map-structure.conflict {
    border: 2px solid #ff9800 !important;
    box-shadow: 0 0 8px rgba(255, 152, 0, 0.7) !important;
}
.marker-conflict-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    background: #ff9800;
    color: #000;
    font-size: 8px;
    font-weight: bold;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    z-index: 5;
    line-height: 1;
}

/* Highlighted marker (search result) */
.map-structure.highlighted {
    animation: pulse-highlight 0.6s ease infinite alternate !important;
    z-index: 200 !important;
    transform: translate(-50%, -50%) scale(3.5) !important;
    border: 2px solid yellow !important;
}
@keyframes pulse-highlight {
    from { box-shadow: 0 0 10px rgba(255,255,0,0.8); }
    to   { box-shadow: 0 0 28px rgba(255,255,0,1); }
}

/* Minimap */
#minimapCanvas {
    position: absolute;
    bottom: 15px;
    left: 15px;
    width: 140px;
    height: 90px;
    background: rgba(10, 10, 30, 0.75);
    border: 1px solid rgba(79, 195, 247, 0.4);
    border-radius: 6px;
    z-index: 100;
    cursor: pointer;
    image-rendering: pixelated;
}
#minimapCanvas:hover {
    border-color: var(--primary-blue);
    box-shadow: 0 0 8px rgba(79,195,247,0.4);
}

/* Keyboard shortcuts panel */
.map-shortcuts-panel {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(10, 10, 30, 0.95);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    padding: 20px;
    z-index: 300;
    min-width: 280px;
    backdrop-filter: blur(10px);
    display: none;
}
.map-shortcuts-panel.visible { display: block; }
.map-shortcuts-panel h4 { margin: 0 0 12px; color: var(--primary-blue); font-size: 14px; }
.map-shortcut-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0;
    font-size: 12px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.map-shortcut-row:last-child { border-bottom: none; }
.map-shortcut-key {
    background: rgba(255,255,255,0.12);
    border-radius: 4px;
    padding: 2px 6px;
    font-family: monospace;
    font-size: 11px;
    color: var(--primary-blue);
}
.map-shortcuts-close {
    position: absolute;
    top: 8px;
    right: 10px;
    cursor: pointer;
    font-size: 16px;
    color: var(--text-secondary);
    background: none;
    border: none;
    color: white;
}

/* Colorblind toggle button active state */
.map-controls button.active {
    background: var(--primary-blue);
    border-color: var(--primary-blue);
}

/* Legend additions */
.legend-item.conflict .legend-color {
    background: transparent !important;
    border-color: #ff9800 !important;
    box-shadow: 0 0 4px rgba(255,152,0,0.5);
}
.legend-item.occupied .legend-color {
    background: #66bb6a !important;
}

/* Smooth map viewport transition */
.map-viewport {
    transition: transform 0.08s linear !important;
}

/* Map search box */
.map-search-box {
    position: absolute;
    top: 15px;
    right: 60px;
    z-index: 100;
    display: flex;
    gap: 4px;
}
.map-search-box input {
    background: rgba(10,10,30,0.85);
    border: 1px solid var(--glass-border);
    border-radius: 6px;
    color: white;
    padding: 4px 8px;
    font-size: 12px;
    width: 160px;
    outline: none;
}
.map-search-box input:focus { border-color: var(--primary-blue); }
.map-search-box button {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 6px;
    color: white;
    padding: 4px 8px;
    cursor: pointer;
    font-size: 12px;
}
.map-search-box button:hover { background: var(--primary-blue); }

/* Simulator tab */
.sim-description { font-size: 13px; color: var(--text-secondary); margin-top: 6px; padding: 8px; background: var(--glass-bg); border-radius: 6px; }
.conflict-card { background: var(--glass-bg); border: 1px solid var(--glass-border); border-radius: 8px; padding: 12px; margin-bottom: 10px; }
.conflict-card.high-value { border-left: 3px solid #f44336; }
.whatif-bar { height: 12px; border-radius: 6px; background: rgba(255,255,255,0.1); margin: 4px 0 8px; }
.whatif-bar-fill { height: 100%; border-radius: 6px; transition: width 0.5s; }
.coverage-day-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid rgba(255,255,255,0.05); }
.unplanned-group { margin-bottom: 16px; }
.unplanned-group-header { font-weight: 500; padding: 8px 0; border-bottom: 1px solid var(--glass-border); margin-bottom: 8px; display: flex; justify-content: space-between; }
