:root {
            --navbar-height: 60px;
            --sidebar-width: 340px;
            --primary-color: #2c2c2c;
            --secondary-color: #6c757d;
            --success-color: #28a745;
            --warning-color: #fd7e14;
            --danger-color: #dc3545;
            --accent-orange: #e67e22;
            --dark-gray: #343a40;
            --light-gray: #f8f9fa;
            --medium-gray: #adb5bd;
            --light-bg: #f5f5f5;
            --border-color: #e0e0e0;
            --border-radius: 8px;
            --body-font: 'Inter', sans-serif;
            --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
            --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
            --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
            --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
            --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        }
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }
        body {
            font-family: var(--body-font);
            background: var(--light-bg);
            color: var(--primary-color);
            line-height: 1.6;
            overflow-x: hidden;
            padding-top: var(--navbar-height);
        }
        .navbar.fixed-top {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            width: 100%;
            height: var(--navbar-height);
            z-index: 1030;
            box-shadow: var(--shadow-md);
            background: linear-gradient(135deg, var(--primary-color), var(--dark-gray));
            border: none;
        }
        .navbar .navbar-brand { 
            font-weight: 600; 
            color: #ffffff !important;
            display: flex;
            align-items: center;
            gap: 0.75rem;
        }
        .brand-logo {
            width: 40px;
            height: 40px;
            background: transparent;
            border-radius: 8px;
            display: flex;
            align-items: center;
            justify-content: center;
            color: white;
            font-size: 1.25rem;
            transition: all 0.3s ease;
            overflow: hidden;
        }
        .brand-logo.custom-circles {
            flex-direction: column;
            gap: 2px;
            padding: 4px;
            background: #ffffff;
            border: 1px solid rgba(255, 255, 255, 0.9);
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
        }
        .circle {
            width: 8px;
            height: 8px;
            border-radius: 50%;
            transition: all 0.3s ease;
        }
        .circle-orange {
            background: var(--accent-orange);
            box-shadow: 0 0 4px rgba(230, 126, 34, 0.4);
        }
        .circle-green {
            background: var(--success-color);
            box-shadow: 0 0 4px rgba(40, 167, 69, 0.4);
        }
        .circle-gray {
            background: var(--secondary-color);
            box-shadow: 0 0 4px rgba(108, 117, 125, 0.4);
        }
        .navbar .navbar-nav .nav-link { 
            color: rgba(255,255,255,0.9) !important;
            transition: var(--transition);
            padding: 0.5rem 1rem;
        }
        .navbar .navbar-nav .nav-link:hover {
            color: #ffffff !important;
            background: rgba(255,255,255,0.1);
            border-radius: 6px;
        }
        .toast-container {
            position: fixed;
            top: calc(var(--navbar-height) + 20px);
            right: 20px;
            z-index: 9999;
            display: flex;
            flex-direction: column;
            gap: 10px;
            max-width: 380px;
        }
        .toast-notification {
            background: white;
            border-radius: var(--border-radius);
            padding: 14px 18px;
            box-shadow: var(--shadow-xl);
            display: flex;
            align-items: center;
            gap: 12px;
            border-left: 4px solid;
            animation: slideIn 0.3s ease-out;
            min-width: 300px;
        }
        @keyframes slideIn {
            from { transform: translateX(400px); opacity: 0; }
            to { transform: translateX(0); opacity: 1; }
        }

        @keyframes slideOut {
            from { transform: translateX(0); opacity: 1; }
            to { transform: translateX(400px); opacity: 0; }
        }
        .toast-notification.removing {
            animation: slideOut 0.3s ease-in forwards;
        }
        .toast-notification.toast-success { border-left-color: var(--success-color); }
        .toast-notification.toast-error { border-left-color: var(--danger-color); }
        .toast-notification.toast-warning { border-left-color: var(--warning-color); }
        .toast-notification.toast-info { border-left-color: var(--secondary-color); }
        .toast-icon {
            width: 20px;
            height: 20px;
            flex-shrink: 0;
        }
        .toast-content {
            flex: 1;
            font-size: 14px;
            color: var(--primary-color);
        }
        .toast-close {
            background: none;
            border: none;
            color: var(--secondary-color);
            cursor: pointer;
            padding: 0;
            width: 20px;
            height: 20px;
            display: flex;
            align-items: center;
            justify-content: center;
            border-radius: 4px;
            transition: var(--transition);
        }
        .toast-close:hover {
            background: var(--light-gray);
            color: var(--primary-color);
        }
        .app-container {
            display: flex;
            min-height: calc(100vh - var(--navbar-height));
        }
        .sidebar {
            width: var(--sidebar-width);
            background: white;
            border-right: 1px solid var(--border-color);
            padding: 20px;
            overflow-y: auto;
            position: fixed;
            height: calc(100vh - var(--navbar-height));
            top: var(--navbar-height);
            left: 0;
        }
        .main-content {
            margin-left: var(--sidebar-width);
            flex: 1;
            padding: 20px;
        }
        .sidebar-section {
            background: white;
            border: 1px solid #e0e0e0;
            border-radius: 8px;
            padding: 16px;
            margin-bottom: 16px;
        }
        .sidebar-section:last-child {
            border-bottom: none;
        }
        .sidebar-section h3 {
            background: #f8f9fa;
            margin: -16px -16px 12px -16px;
            padding: 10px 16px;
            border-radius: 8px 8px 0 0;
            font-size: 13px;
        }
        /* ========== DRAG & DROP ZONES ========== */
        .drop-zone {
            border: 2px dashed var(--border-color);
            border-radius: var(--border-radius);
            padding: 20px;
            text-align: center;
            cursor: pointer;
            transition: var(--transition);
            background: var(--light-bg);
            position: relative;
            overflow: hidden;
        }
        .drop-zone:hover {
            border-color: var(--accent-orange);
            background: white;
            transform: translateY(-2px);
            box-shadow: var(--shadow-md);
        }
        .drop-zone.drag-over {
            border-color: var(--accent-orange);
            background: rgba(230, 126, 34, 0.1);
            border-style: solid;
        }
        .drop-zone.has-file {
            border-color: var(--success-color);
            background: rgba(40, 167, 69, 0.05);
            border-style: solid;
        }
        .drop-zone-icon {
            font-size: 32px;
            margin-bottom: 8px;
            opacity: 0.5;
            transition: var(--transition);
        }
        .drop-zone:hover .drop-zone-icon {
            opacity: 0.8;
            transform: scale(1.1);
        }
        .drop-zone-text {
            font-size: 13px;
            color: var(--secondary-color);
            font-weight: 500;
        }
        .drop-zone-filename {
            font-size: 12px;
            color: var(--success-color);
            margin-top: 8px;
            word-break: break-all;
            font-weight: 600;
        }
        /* ========== UPLOADED FILES LIST ========== */
        .uploaded-files {
            margin-top: 12px;
        }
        .file-item {
            padding: 12px;
            margin-bottom: 10px;
            border: 2px solid #e0e0e0;
            border-radius: 6px;
        }
        .file-item:hover {
            border-color: var(--accent-orange);
            background: var(--light-bg);
        }
        .file-item.active {
            border-color: #e67e22;
            background: rgba(230, 126, 34, 0.05);
            box-shadow: 0 0 0 3px rgba(230, 126, 34, 0.1);
        }
        .file-item-info {
            flex: 1;
            display: flex;
            align-items: center;
            gap: 8px;
        }
        .file-icon {
            width: 24px;
            height: 24px;
            background: var(--light-bg);
            border-radius: 4px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 12px;
        }
        .file-name {
            font-size: 12px;
            font-weight: 500;
            color: var(--primary-color);
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }
        .file-actions {
            display: flex;
            gap: 4px;
        }
        .file-action-btn {
            width: 24px;
            height: 24px;
            border: none;
            background: none;
            color: var(--secondary-color);
            cursor: pointer;
            border-radius: 4px;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: var(--transition);
        }
        .file-action-btn:hover {
            background: var(--light-bg);
            color: var(--primary-color);
        }
        .file-action-btn.delete:hover {
            background: var(--danger-color);
            color: white;
        }
        /* ========== PAGE SELECTOR ========== */
        .page-selector-container {
            margin-top: 12px;
        }
        .page-thumbnails {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
            gap: 8px;
            margin-top: 8px;
            max-height: 200px;
            overflow-y: auto;
        }
        .page-thumb {
            aspect-ratio: 0.707;
            border: 2px solid var(--border-color);
            border-radius: 4px;
            cursor: pointer;
            transition: var(--transition);
            background: white;
            position: relative;
            overflow: hidden;
        }
        .page-thumb:hover {
            border-color: var(--accent-orange);
            transform: scale(1.05);
        }
        .page-thumb.active {
            border-color: var(--accent-orange);
            border-width: 3px;
            box-shadow: 0 0 0 2px rgba(230, 126, 34, 0.2);
        }
        .page-thumb img {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }
        .page-number {
            position: absolute;
            bottom: 2px;
            right: 2px;
            background: rgba(0, 0, 0, 0.7);
            color: white;
            font-size: 10px;
            padding: 2px 4px;
            border-radius: 2px;
            font-weight: 600;
        }
        /* ========== ZOOM CONTROLS ========== */
        .zoom-controls {
            position: absolute;
            top: 16px;
            right: 16px;
            display: flex;
            flex-direction: column;
            gap: 8px;
            z-index: 100;
            background: white;
            border-radius: 6px;
            padding: 8px;
            box-shadow: var(--shadow-md);
        }
        .zoom-btn {
            width: 32px;
            height: 32px;
            border: 1px solid var(--border-color);
            background: white;
            border-radius: 4px;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: var(--transition);
            font-size: 16px;
            color: var(--primary-color);
        }
        .zoom-btn:hover {
            background: var(--accent-orange);
            border-color: var(--accent-orange);
            color: white;
        }
        .zoom-level {
            font-size: 11px;
            text-align: center;
            color: var(--secondary-color);
            font-weight: 600;
        }
        /* ========== CANVAS WRAPPER ========== */
        .canvas-wrapper {
            position: relative;
            width: 100%;
            min-height: 500px;
            border: 2px solid var(--border-color);
            border-radius: 4px;
            overflow: hidden;
            background: #fafafa;
            cursor: grab;
        }
        .canvas-wrapper.grabbing {
            cursor: grabbing;
        }
        .canvas-inner {
            transform-origin: 0 0;
            transition: transform 0.1s ease-out;
        }
        #floorplan-display {
            display: block;
            max-width: 100%;
            height: auto;
        }
        #selection-canvas {
            position: absolute;
            top: 0;
            left: 0;
            cursor: crosshair;
            z-index: 10;
            pointer-events: none;
        }
        /* ========== ACCORDION ========== */
        .accordion-header {
            background: var(--light-bg);
            border: 1px solid var(--border-color);
            border-radius: 6px;
            padding: 10px 12px;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: space-between;
            transition: var(--transition);
            margin-bottom: 8px;
        }
        .accordion-header:hover {
            background: white;
            border-color: var(--accent-orange);
        }
        .accordion-header.active {
            border-bottom-left-radius: 0;
            border-bottom-right-radius: 0;
            margin-bottom: 0;
        }
        .accordion-title {
            font-size: 13px;
            font-weight: 600;
            color: var(--primary-color);
        }
        .accordion-icon {
            transition: transform 0.3s ease;
            color: var(--secondary-color);
        }
        .accordion-header.active .accordion-icon {
            transform: rotate(180deg);
        }
        .accordion-content {
            max-height: 0;
            overflow: hidden;
            transition: max-height 0.3s ease;
            border: 1px solid var(--border-color);
            border-top: none;
            border-bottom-left-radius: 6px;
            border-bottom-right-radius: 6px;
        }
        .accordion-content.active {
            max-height: 500px;
            padding: 12px;
        }
        .form-group {
            margin-bottom: 16px;
        }
        .form-label {
            font-size: 13px;
            font-weight: 500;
            color: var(--primary-color);
            margin-bottom: 8px;
            display: block;
        }
        .form-control, .form-select {
            font-size: 14px;
            border-radius: 6px;
            border: 1px solid var(--border-color);
            padding: 8px 12px;
        }
        .form-control:focus, .form-select:focus {
            border-color: var(--accent-orange);
            box-shadow: 0 0 0 0.2rem rgba(230, 126, 34, 0.15);
        }
        .form-range {
            height: 6px;
        }
        .range-value {
            font-weight: 600;
            color: var(--accent-orange);
        }
        .progress-section {
            background: var(--light-bg);
            border-radius: var(--border-radius);
            padding: 12px;
        }
        .progress-label {
            font-size: 12px;
            color: var(--secondary-color);
            margin-bottom: 8px;
            display: flex;
            justify-content: space-between;
        }
        .progress {
            height: 8px;
            border-radius: 4px;
            background: var(--border-color);
        }
        .progress-bar {
            background: linear-gradient(90deg, var(--success-color), var(--accent-orange));
            border-radius: 4px;
        }
        .nav-tabs {
            border-bottom: 2px solid var(--border-color);
            margin-bottom: 24px;
        }
        .nav-tabs .nav-link {
            border: none;
            border-bottom: 3px solid transparent;
            color: var(--secondary-color);
            font-weight: 500;
            padding: 12px 20px;
            transition: var(--transition);
        }
        .nav-tabs .nav-link:hover {
            border-color: var(--medium-gray);
            color: var(--primary-color);
        }
        .nav-tabs .nav-link.active {
            color: var(--accent-orange);
            border-color: var(--accent-orange);
            background: none;
        }
        .card {
            background: white;
            border: 1px solid var(--border-color);
            border-radius: var(--border-radius);
            padding: 20px;
            margin-bottom: 20px;
            box-shadow: var(--shadow-sm);
        }
        .badge {
            padding: 4px 10px;
            border-radius: 4px;
            font-size: 11px;
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 0.3px;
        }
        .badge-success {
            background: var(--success-color);
            color: white;
        }
        .section-card {
            background: white;
            border: 2px solid var(--border-color);
            border-radius: var(--border-radius);
            padding: 16px;
            margin-bottom: 12px;
            cursor: pointer;
            transition: var(--transition);
        }
        .section-card:hover {
            border-color: var(--accent-orange);
            box-shadow: var(--shadow-md);
        }
        .section-card.processed {
            border-color: var(--success-color);
        }
        .section-header {
            font-weight: 600;
            font-size: 14px;
            margin-bottom: 12px;
            display: flex;
            align-items: center;
            justify-content: space-between;
        }
        .section-status {
            width: 20px;
            height: 20px;
            border-radius: 50%;
            border: 2px solid var(--border-color);
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 12px;
        }
        .section-status.processed {
            border-color: var(--success-color);
            background: var(--success-color);
            color: white;
        }
        .localisation-text {
            background: var(--light-bg);
            padding: 12px;
            border-left: 3px solid var(--accent-orange);
            border-radius: 4px;
            font-size: 13px;
            color: var(--secondary-color);
            line-height: 1.6;
        }
        .navigation-controls {
            display: flex;
            align-items: center;
            gap: 16px;
            margin-bottom: 20px;
            padding: 16px;
            background: white;
            border-radius: var(--border-radius);
            box-shadow: var(--shadow-sm);
        }
        .nav-section-info {
            flex: 1;
            text-align: center;
            font-weight: 600;
        }
        .quick-nav-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(45px, 1fr));
            gap: 8px;
            margin: 16px 0;
        }
        .quick-nav-btn {
            aspect-ratio: 1;
            border: 2px solid var(--border-color);
            background: white;
            border-radius: 6px;
            font-weight: 600;
            cursor: pointer;
            transition: var(--transition);
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 13px;
            position: relative;
        }
        .quick-nav-btn:hover {
            border-color: var(--accent-orange);
        }
        .quick-nav-btn.processed {
            border-color: var(--success-color);
            color: var(--success-color);
        }
        .quick-nav-btn.processed::after {
            content: '✓';
            position: absolute;
            top: 2px;
            right: 2px;
            font-size: 10px;
            color: var(--success-color);
        }
        .quick-nav-btn.current {
            border-color: var(--accent-orange);
            background: var(--accent-orange);
            color: white;
        }
        .canvas-container {
            background: white;
            border-radius: var(--border-radius);
            padding: 20px;
            margin: 20px 0;
            box-shadow: var(--shadow-sm);
        }
        .btn {
            padding: 12px 20px;
            border: none;
            border-radius: 6px;
            font-weight: 500;
            font-size: 15px;
            cursor: pointer;
            transition: var(--transition);
            display: inline-flex;
            align-items: center;
            gap: 8px;
        }
        .btn-primary {
            background: var(--primary-color);
            color: white;
        }
        .btn-primary:hover {
            background: var(--dark-gray);
            transform: translateY(-1px);
            box-shadow: var(--shadow-md);
        }
        .btn-secondary {
            background: var(--secondary-color);
            color: white;
        }
        .btn-success {
            background: var(--success-color);
            color: white;
        }
        .btn-success:hover {
            background: #22c55e;
            transform: translateY(-1px);
            box-shadow: var(--shadow-md);
        }
        .btn-outline {
            background: white;
            border: 2px solid var(--border-color);
            color: var(--primary-color);
        }
        .btn-outline:hover {
            border-color: var(--accent-orange);
            background: rgba(230, 126, 34, 0.05);
        }
        .btn:disabled {
            opacity: 0.5;
            cursor: not-allowed;
            transform: none !important;
        }
        .results-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
            gap: 16px;
            margin: 20px 0;
        }
        .result-card {
            background: white;
            border: 1px solid var(--border-color);
            border-radius: var(--border-radius);
            padding: 20px;
            box-shadow: var(--shadow-sm);
        }
        .metric-card {
            background: linear-gradient(135deg, var(--accent-orange), var(--warning-color));
            color: white;
            padding: 24px;
            border-radius: var(--border-radius);
            text-align: center;
        }
        .metric-card.success {
            background: linear-gradient(135deg, var(--success-color), #22c55e);
        }
        .metric-card.gray {
            background: linear-gradient(135deg, var(--secondary-color), var(--medium-gray));
        }
        .metric-value {
            font-size: 36px;
            font-weight: 700;
        }
        .metric-label {
            font-size: 13px;
            opacity: 0.95;
            margin-top: 8px;
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }
        .detection-image {
            width: 100%;
            border-radius: var(--border-radius);
            border: 1px solid var(--border-color);
            margin: 16px 0;
        }
        .object-item {
            background: var(--light-bg);
            border-radius: 6px;
            padding: 12px;
            margin-bottom: 8px;
            font-size: 13px;
        }
        .object-item strong {
            color: var(--primary-color);
        }
        .spinner {
            width: 18px;
            height: 18px;
            border: 2px solid rgba(255, 255, 255, 0.3);
            border-top: 2px solid white;
            border-radius: 50%;
            animation: spin 0.8s linear infinite;
        }

        @keyframes spin {
            0% { transform: rotate(0deg); }
            100% { transform: rotate(360deg); }
        }

        .hidden {
            display: none !important;
        }

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

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

        .page-thumb {
            cursor: pointer;
            transition: all 0.2s ease;
        }

        .page-thumb:hover {
            transform: scale(1.05);
            box-shadow: 0 2px 8px rgba(0,0,0,0.15);
        }

        .page-thumb.active {
            border-color: #e67e22;
            border-width: 3px;
            box-shadow: 0 0 0 3px rgba(230, 126, 34, 0.2);
        }

        .page-thumb.active .page-number {
            background: #e67e22;
            color: white;
        }

        .page-navigation-header {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: white;
            padding: 16px 20px;
            border-radius: 8px;
            margin-bottom: 16px;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .page-nav-info {
            display: flex;
            flex-direction: column;
            gap: 4px;
        }

        .page-nav-info strong {
            font-size: 15px;
        }

        .page-nav-info span {
            font-size: 13px;
            opacity: 0.9;
        }

        .page-nav-controls {
            display: flex;
            gap: 10px;
        }

        .btn-nav-page {
            background: rgba(255, 255, 255, 0.2);
            border: 1px solid rgba(255, 255, 255, 0.3);
            color: white;
            padding: 8px 16px;
            border-radius: 6px;
            cursor: pointer;
            font-weight: 600;
            transition: all 0.3s ease;
        }

        .btn-nav-page:hover:not(:disabled) {
            background: rgba(255, 255, 255, 0.3);
            transform: translateY(-1px);
        }

        .btn-nav-page:disabled {
            opacity: 0.5;
            cursor: not-allowed;
        }
