/* Meshy 3D Studio - Modular Stylesheet */
        :root {
            --bg-base: #07090e;
            --bg-panel: #0d111a;
            --bg-card: #131926;
            --bg-card-hover: #1b2336;
            --accent: #3b82f6;
            --accent-hover: #2563eb;
            --accent-glow: rgba(59, 130, 246, 0.45);
            --emerald: #10b981;
            --emerald-glow: rgba(16, 185, 129, 0.35);
            --amber: #f59e0b;
            --rose: #ef4444;
            --purple: #8b5cf6;
            --text-main: #f8fafc;
            --text-muted: #94a3b8;
            --text-dim: #64748b;
            --border: #1e293b;
            --border-highlight: #334155;
            --radius-sm: 6px;
            --radius-md: 10px;
        }
        * { box-sizing: border-box; margin: 0; padding: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif; }
        body { background: var(--bg-base); color: var(--text-main); height: 100vh; display: flex; flex-direction: column; overflow: hidden; -webkit-font-smoothing: antialiased; }
        
        /* HEADER */
        header { background: var(--bg-panel); border-bottom: 1px solid var(--border); padding: 7px 16px; display: flex; justify-content: space-between; align-items: center; z-index: 30; }
        .logo-wrap { display: flex; align-items: center; gap: 10px; }
        .brand-badge { width: 30px; height: 30px; border-radius: 8px; background: linear-gradient(135deg, #3b82f6, #8b5cf6); display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 1rem; color: #fff; box-shadow: 0 0 14px var(--accent-glow); }
        .brand-text { font-size: 1.05rem; font-weight: 700; display: flex; align-items: center; gap: 6px; }
        .brand-sub { font-size: 0.72rem; color: var(--text-muted); font-weight: 600; background: rgba(255,255,255,0.06); padding: 2px 7px; border-radius: 4px; border: 1px solid rgba(255,255,255,0.08); }
        
        .header-stats { display: flex; gap: 8px; align-items: center; }
        .pill { display: flex; align-items: center; gap: 6px; background: rgba(14, 19, 29, 0.9); border: 1px solid var(--border); border-radius: 20px; padding: 4px 12px; font-size: 0.76rem; font-weight: 500; }
        .pill-success { border-color: rgba(16, 185, 129, 0.35); background: rgba(16, 185, 129, 0.1); color: #34d399; }
        .pill-accent { border-color: rgba(59, 130, 246, 0.35); background: rgba(59, 130, 246, 0.1); color: #60a5fa; }
        .pill-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

        /* MAIN LAYOUT (MESHY WORKSPACE 3-COLUMN ARCHITECTURE) */
        .main-layout { display: flex; flex: 1; height: calc(100vh - 49px); position: relative; overflow: hidden; background: #06080d; }

        /* 1. SOL İNCE DİKEY NAV RAIL (APP RAIL) */
        .app-rail { width: 68px; background: #07090e; border-right: 1px solid var(--border); display: flex; flex-direction: column; align-items: center; padding: 8px 0; gap: 6px; z-index: 30; flex-shrink: 0; }
        .rail-btn { width: 56px; height: 56px; background: transparent; border: 1px solid transparent; border-radius: var(--radius-md); color: var(--text-muted); cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; transition: all 0.15s; position: relative; }
        .rail-btn:hover { background: rgba(255,255,255,0.05); color: #fff; border-color: rgba(255,255,255,0.08); }
        .rail-btn.active { background: #111726; color: #60a5fa; border-color: rgba(59,130,246,0.45); box-shadow: 0 4px 14px rgba(59,130,246,0.25); }
        .rail-btn.active::before { content: ""; position: absolute; left: -6px; top: 12px; bottom: 12px; width: 3px; background: var(--accent); border-radius: 0 4px 4px 0; box-shadow: 0 0 8px var(--accent); }
        .rail-icon { font-size: 1.25rem; line-height: 1; }
        .rail-label { font-size: 0.62rem; font-weight: 600; letter-spacing: -0.2px; text-align: center; }
        .rail-badge { position: absolute; top: 4px; right: 4px; background: var(--accent); color: #fff; font-size: 0.58rem; font-weight: 800; padding: 1px 4px; border-radius: 999px; line-height: 1; border: 1px solid #07090e; }
        .rail-divider { width: 36px; height: 1px; background: var(--border); margin: 4px 0; }

        /* 2. SOL AÇILIR/KAPANIR PARAMETRE ÇEKMECESİ (TOOL DRAWER) */
        .drawer-panel { width: 400px; background: var(--bg-panel); border-right: 1px solid var(--border); display: flex; flex-direction: column; z-index: 25; flex-shrink: 0; transition: width 0.22s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.18s ease; position: relative; }
        .drawer-panel.collapsed { width: 0 !important; border-right: none; opacity: 0; pointer-events: none; }
        .drawer-header { height: 44px; padding: 0 14px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--border); background: rgba(7, 9, 14, 0.6); flex-shrink: 0; }
        .drawer-title { font-size: 0.82rem; font-weight: 700; color: #f1f5f9; display: flex; align-items: center; gap: 7px; }
        .drawer-toggle-btn { width: 26px; height: 26px; background: rgba(255,255,255,0.04); border: 1px solid var(--border); border-radius: 6px; color: var(--text-muted); cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 0.72rem; transition: all 0.15s; }
        .drawer-toggle-btn:hover { background: rgba(255,255,255,0.1); color: #fff; border-color: var(--border-highlight); }
        .drawer-content-body { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 12px; }

        /* YÜZEN ÇEKMECE AÇMA BUTONU (ÇEKMECE KAPALIYKEN ÇIKAR) */
        .drawer-open-btn { position: absolute; left: 74px; top: 12px; z-index: 28; background: #0d111a; border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text-muted); padding: 6px 10px; font-size: 0.74rem; font-weight: 600; cursor: pointer; display: none; align-items: center; gap: 6px; box-shadow: 0 6px 18px rgba(0,0,0,0.5); }
        .drawer-open-btn:hover { color: #fff; border-color: var(--accent); background: #182236; }

        /* ESKİ SEKMELER İLE UYUMLULUK */
        .tab-content { display: none; flex-direction: column; gap: 12px; width: 100%; }
        .tab-content.active { display: flex; }

        /* KARTLAR */
        .box-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 11px; display: flex; flex-direction: column; gap: 9px; transition: border-color 0.2s; }
        .box-card:hover { border-color: var(--border-highlight); }
        .box-title { font-size: 0.8rem; font-weight: 700; color: #e2e8f0; display: flex; justify-content: space-between; align-items: center; }
        .box-title span { display: flex; align-items: center; gap: 5px; }

        /* FORMLAR */
        label { font-size: 0.73rem; font-weight: 600; color: var(--text-muted); display: block; margin-bottom: 3px; }
        input, select, textarea { width: 100%; background: #090c13; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 7px 9px; color: #fff; font-size: 0.8rem; outline: none; transition: border-color 0.2s, box-shadow 0.2s; }
        input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2); }
        textarea { resize: vertical; min-height: 60px; line-height: 1.4; }

        /* BUTONLAR */
        .btn { background: var(--accent); color: #fff; border: none; border-radius: var(--radius-sm); padding: 7px 12px; font-size: 0.8rem; font-weight: 600; cursor: pointer; transition: all 0.15s; display: inline-flex; align-items: center; justify-content: center; gap: 5px; user-select: none; }
        .btn:hover { background: var(--accent-hover); box-shadow: 0 0 12px var(--accent-glow); }
        .btn:active { transform: scale(0.98); }
        .btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none; }
        .btn-secondary { background: #182030; color: #cbd5e1; border: 1px solid var(--border); }
        .btn-secondary:hover { background: #222d42; border-color: #475569; }
        .btn-emerald { background: var(--emerald); color: #fff; }
        .btn-emerald:hover { background: #059669; box-shadow: 0 0 12px var(--emerald-glow); }
        .btn-purple { background: var(--purple); color: #fff; }
        .btn-purple:hover { background: #7c3aed; }
        .btn-danger { background: rgba(239, 68, 68, 0.15); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.3); }
        .btn-danger:hover { background: rgba(239, 68, 68, 0.3); border-color: #ef4444; color: #fff; }
        .btn-sm { padding: 4px 8px; font-size: 0.72rem; border-radius: 4px; }
        .btn-icon { width: 26px; height: 26px; padding: 0; display: inline-flex; align-items: center; justify-content: center; border-radius: 4px; }

        /* HIZLI ÇİPLER */
        .chips-wrap { display: flex; flex-wrap: wrap; gap: 4px; }
        .chip { background: rgba(255,255,255,0.04); border: 1px solid var(--border); border-radius: 12px; padding: 2px 7px; font-size: 0.7rem; color: var(--text-muted); cursor: pointer; transition: all 0.15s; }
        .chip:hover { color: #fff; border-color: var(--accent); background: rgba(59, 130, 246, 0.15); }

        /* PROGRESS BAR */
        .progress-box { display: none; flex-direction: column; gap: 5px; background: rgba(9, 12, 19, 0.85); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 9px; }
        .progress-header { display: flex; justify-content: space-between; font-size: 0.73rem; }
        .progress-stage { color: var(--accent); font-weight: 600; }
        .progress-pct { color: #fff; font-weight: 700; }
        .progress-track { width: 100%; height: 6px; background: #1e293b; border-radius: 999px; overflow: hidden; }
        .progress-fill { width: 0%; height: 100%; background: linear-gradient(90deg, #3b82f6, #10b981); transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1); }

        /* MODEL LİSTESİ */
        .model-list-wrap { max-height: 250px; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; }
        .model-card { background: #090c13; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 7px 9px; display: flex; justify-content: space-between; align-items: center; cursor: pointer; transition: all 0.15s; }
        .model-card:hover { border-color: var(--accent); background: var(--bg-card-hover); }
        .model-card.active { border-color: var(--accent); background: rgba(59, 130, 246, 0.12); }
        .model-card-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
        .model-card-title { font-size: 0.78rem; font-weight: 600; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
        .model-card-meta { font-size: 0.68rem; color: var(--text-dim); display: flex; gap: 6px; }

        /* 3D VIEWPORT */
        .viewport-area { flex: 1; min-width: 0; position: relative; background: radial-gradient(circle at 50% 42%, #2b2e35 0%, #16181d 62%, #090b10 100%); display: flex; align-items: center; justify-content: center; overflow: hidden; }
        #canvas3d { width: 100%; height: 100%; display: block; outline: none; }
        .empty-placeholder { position: absolute; pointer-events: none; text-align: center; color: var(--text-dim); display: flex; flex-direction: column; align-items: center; gap: 8px; max-width: 340px; background: #0d111a; padding: 18px 22px; border-radius: 14px; border: 1px solid rgba(255,255,255,0.06); }
        .empty-icon { font-size: 2.2rem; opacity: 0.85; }
        
        /* VIEWPORT TOOLBAR (MESHY STUDIO FLOATING HUD) */
        .viewport-toolbar { position: absolute; top: 10px; left: 10px; right: 52px; width: fit-content; max-width: calc(100% - 64px); display: flex; flex-wrap: wrap; align-items: center; gap: 4px; z-index: 10; background: #0d111a; padding: 5px 7px; border-radius: var(--radius-md); border: 1px solid var(--border); box-shadow: 0 8px 24px rgba(0,0,0,0.55); }
        .viewport-toolbar select { width: auto !important; background: rgba(255,255,255,0.04) !important; border: 1px solid rgba(255,255,255,0.08) !important; border-radius: 6px; padding: 3px 7px !important; color: #e2e8f0; font-size: 0.72rem; font-weight: 600; cursor: pointer; }
        .tool-btn { background: transparent; border: 1px solid transparent; color: var(--text-muted); padding: 4px 8px; font-size: 0.72rem; font-weight: 600; border-radius: var(--radius-sm); cursor: pointer; display: inline-flex; align-items: center; gap: 4px; transition: all 0.15s; white-space: nowrap; }
        .tool-btn:hover { color: #fff; background: rgba(255,255,255,0.07); }
        .tool-btn.active { background: var(--accent); color: #fff; box-shadow: 0 0 10px var(--accent-glow); }
        .cad-subnav { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; background: #090c13; padding: 4px; border-radius: 8px; border: 1px solid var(--border); }
        .cad-sub-btn { background: transparent; border: 1px solid transparent; color: var(--text-muted); font-size: 0.7rem; font-weight: 600; padding: 6px 4px; border-radius: 6px; cursor: pointer; text-align: center; transition: all 0.15s; }
        .cad-sub-btn:hover { color: #fff; background: rgba(255,255,255,0.05); }
        .cad-sub-btn.active { background: var(--accent); color: #fff; }
        .hdri-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
        .hdri-card { background: #090c13; border: 1px solid var(--border); border-radius: 8px; padding: 4px; cursor: pointer; text-align: center; transition: all 0.15s; }
        .hdri-card:hover, .hdri-card.active { border-color: var(--accent); background: rgba(59,130,246,0.14); }
        .hdri-card img { width: 100%; height: 38px; object-fit: cover; border-radius: 5px; display: block; margin-bottom: 3px; }
        .hdri-card span { font-size: 0.65rem; font-weight: 600; color: #cbd5e1; display: block; }

        /* KAMERA GIZMO */
        .camera-gizmo { position: absolute; top: 10px; right: 10px; display: flex; flex-direction: column; gap: 4px; z-index: 10; background: #0d111a; padding: 4px; border-radius: var(--radius-md); border: 1px solid var(--border); box-shadow: 0 8px 24px rgba(0,0,0,0.5); }
        .gizmo-btn { background: transparent; border: 1px solid transparent; color: var(--text-muted); width: 26px; height: 26px; border-radius: 4px; cursor: pointer; font-size: 0.7rem; font-weight: 700; display: flex; align-items: center; justify-content: center; transition: all 0.15s; }
        .gizmo-btn:hover { background: rgba(255,255,255,0.1); color: #fff; }

        /* 4. SAĞ MODEL DENETÇİSİ (INSPECTOR SIDEBAR) */
        .inspector-sidebar { width: 300px; background: var(--bg-panel); border-left: 1px solid var(--border); display: flex; flex-direction: column; z-index: 20; flex-shrink: 0; transition: width 0.22s ease, opacity 0.18s ease; }
        .inspector-sidebar.collapsed { width: 0 !important; border-left: none; opacity: 0; pointer-events: none; }
        .inspector-header { height: 44px; padding: 0 14px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--border); background: rgba(7, 9, 14, 0.6); flex-shrink: 0; }
        .inspector-body { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 10px; }

        /* VIEWPORT ÜST SAĞ HIZLI EYLEMLER (EXPORT DROPDOWN vb.) */
        .viewport-top-right { position: absolute; top: 10px; right: 10px; display: flex; align-items: center; gap: 6px; z-index: 10; }
        .export-dropdown { position: relative; }
        .export-menu { position: absolute; top: calc(100% + 4px); right: 0; width: 170px; background: #0c1017; border: 1px solid var(--border-highlight); border-radius: var(--radius-sm); padding: 4px; display: none; flex-direction: column; gap: 2px; box-shadow: 0 10px 25px rgba(0,0,0,0.6); z-index: 50; }
        .export-menu.show { display: flex; }
        .export-item { background: transparent; border: none; color: #cbd5e1; padding: 7px 10px; font-size: 0.74rem; font-weight: 600; text-align: left; border-radius: 4px; cursor: pointer; display: flex; align-items: center; justify-content: space-between; transition: all 0.15s; }
        .export-item:hover { background: var(--accent); color: #fff; }

        /* Z-KESIT SLICER BAR (CROSS-SECTION) */
        .slicer-flyout { position: absolute; left: 10px; bottom: 65px; width: 260px; background: #0d111a; border: 1px solid var(--border); border-radius: var(--radius-md); padding: 10px; display: none; flex-direction: column; gap: 6px; z-index: 10; font-size: 0.76rem; box-shadow: 0 8px 24px rgba(0,0,0,0.5); }
        .slicer-flyout input[type=range] { width: 100%; cursor: pointer; }

        /* MODEL DOKTORU KARTI */
        .inspector-flyout { position: absolute; bottom: 65px; right: 10px; width: 270px; background: #0d111a; border: 1px solid var(--border); border-radius: var(--radius-md); padding: 11px; display: none; flex-direction: column; gap: 8px; z-index: 10; font-size: 0.76rem; box-shadow: 0 10px 30px rgba(0,0,0,0.6); }
        .stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; }
        .stat-card { background: rgba(7, 9, 14, 0.75); border: 1px solid var(--border); border-radius: 5px; padding: 5px 7px; }
        .stat-label { font-size: 0.66rem; color: var(--text-dim); font-weight: 500; }
        .stat-val { font-size: 0.84rem; font-weight: 700; color: #fff; margin-top: 1px; }

        /* ALT AKSİYON ÇUBUĞU */
        .floating-action-bar { position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%); display: none; gap: 7px; z-index: 15; background: #0d111a; padding: 5px 12px; border-radius: 30px; border: 1px solid var(--border); box-shadow: 0 12px 36px rgba(0,0,0,0.6); }

        /* TOAST BİLDİRİM */
        .toast-container { position: fixed; bottom: 16px; right: 16px; display: flex; flex-direction: column; gap: 6px; z-index: 9999; pointer-events: none; }
        .toast { background: var(--bg-card); color: #fff; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px 14px; font-size: 0.78rem; box-shadow: 0 10px 25px rgba(0,0,0,0.5); pointer-events: auto; display: flex; align-items: center; gap: 7px; animation: slideIn 0.2s ease-out; }
        .toast-success { border-color: rgba(16, 185, 129, 0.4); background: #0c1815; }
        .toast-error { border-color: rgba(239, 68, 68, 0.4); background: #1a0d0d; }
        @keyframes slideIn { from { transform: translateX(40px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

        /* KOMUT PALETİ (CTRL+K) MODAL */
        .modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.7); z-index: 1000; display: none; align-items: flex-start; justify-content: center; padding-top: 15vh; }
        .palette-box { width: 480px; background: var(--bg-panel); border: 1px solid var(--border-highlight); border-radius: var(--radius-md); box-shadow: 0 20px 50px rgba(0,0,0,0.8); overflow: hidden; display: flex; flex-direction: column; }
        .palette-input { width: 100%; background: transparent; border: none; border-bottom: 1px solid var(--border); padding: 14px; font-size: 0.95rem; color: #fff; outline: none; }
        .palette-list { max-height: 280px; overflow-y: auto; padding: 6px; display: flex; flex-direction: column; gap: 3px; }
        .palette-item { padding: 8px 12px; border-radius: 6px; cursor: pointer; display: flex; justify-content: space-between; align-items: center; font-size: 0.82rem; color: #cbd5e1; }
        .palette-item:hover, .palette-item.selected { background: var(--accent); color: #fff; }
        .palette-kbd { font-size: 0.68rem; background: rgba(0,0,0,0.3); padding: 2px 6px; border-radius: 4px; border: 1px solid rgba(255,255,255,0.15); }
