:root {
    --primary-color: var(--accent-primary);  /* legacy alias — points to design token */
    --sidebar-width: 240px;
    --sidebar-collapsed-width: 68px;
    --sidebar-tree-width: 320px;
    --sidebar-transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* No transitions during initial load */
html.no-transitions,
html.no-transitions *,
html.no-transitions *::before,
html.no-transitions *::after {
    transition: none !important;
}

/* Pre-apply sidebar state before JS runs */
html.pre-tree-mode .sidebar {
    width: var(--sidebar-tree-width) !important;
}
html.pre-tree-mode .main-content {
    margin-left: var(--sidebar-tree-width) !important;
}
html.pre-pinned .sidebar {
    width: var(--sidebar-width) !important;
}
html.pre-pinned .main-content {
    margin-left: var(--sidebar-width) !important;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-page);
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-collapsed-width);
    height: 100vh;
    background: linear-gradient(180deg, var(--sidebar-bg-start) 0%, var(--sidebar-bg-end) 100%);
    padding: 1rem 0;
    overflow-x: hidden;
    overflow-y: auto;
    scrollbar-width: none;
    z-index: 1000;
    transition: width var(--sidebar-transition);
}
.sidebar::-webkit-scrollbar { display: none; }

.sidebar:hover,
.sidebar.pinned {
    width: var(--sidebar-width);
}

.sidebar.tree-mode {
    width: var(--sidebar-tree-width);
}

.sidebar.tree-mode:hover {
    width: var(--sidebar-tree-width);
}

/* Sidebar resize handle */
.sidebar-resize-handle {
    position: absolute;
    top: 0;
    right: 0;
    width: 5px;
    height: 100%;
    cursor: ew-resize;
    background: transparent;
    transition: background 0.2s;
    z-index: 1001;
}

.sidebar-resize-handle:hover,
.sidebar-resize-handle.dragging {
    background: var(--primary-color);
}

.sidebar.resizing {
    transition: none !important;
}

body.sidebar-resizing {
    cursor: ew-resize !important;
    user-select: none !important;
}

.sidebar-brand {
    color: var(--text-inverse);
    font-weight: 700;
    font-size: 1.25rem;
    padding: 0.5rem 1.25rem 1.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    margin-bottom: 1rem;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sidebar-brand .brand-icon {
    font-size: 1.5rem;
    min-width: 24px;
}

.sidebar-brand .brand-text {
    opacity: 0;
    transition: opacity var(--sidebar-transition);
}

.sidebar:hover .brand-text,
.sidebar.pinned .brand-text,
.sidebar.tree-mode .brand-text {
    opacity: 1;
}

.sidebar-brand .brand-name {
    font-size: 1.5rem;
    letter-spacing: 2px;
}

.sidebar-brand .brand-full {
    font-size: 0.65rem;
    opacity: 0.5;
    letter-spacing: 0.5px;
    display: block;
    margin-top: 2px;
}

.sidebar-brand .brand-version {
    font-size: 0.7rem;
    opacity: 0.6;
    margin-top: 4px;
}

.sidebar-pin {
    position: absolute;
    top: 1rem;
    right: 0.75rem;
    background: transparent;
    border: none;
    color: rgba(255,255,255,0.4);
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    opacity: 0;
    transition: all 0.2s;
}

.sidebar:hover .sidebar-pin,
.sidebar.tree-mode .sidebar-pin {
    opacity: 1;
}

.sidebar-pin:hover {
    color: rgba(255,255,255,0.8);
    background: rgba(255,255,255,0.1);
}

.sidebar.pinned .sidebar-pin {
    opacity: 1;
    color: var(--primary-color);
}

.sidebar-nav {
    padding: 0;
    margin: 0;
    list-style: none;
}

.sidebar-nav li a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.25rem;
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    transition: all 0.2s;
    white-space: nowrap;
}

.sidebar-nav li a i {
    font-size: 1.1rem;
    min-width: 20px;
    text-align: center;
}

.sidebar-nav li a .nav-text {
    opacity: 0;
    transition: opacity var(--sidebar-transition);
}

.sidebar:hover .nav-text,
.sidebar.pinned .nav-text,
.sidebar.tree-mode .nav-text {
    opacity: 1;
}

.sidebar-nav li a:hover,
.sidebar-nav li a.active {
    background: rgba(255,255,255,0.1);
    color: var(--text-inverse);
}

.sidebar-nav li a.active {
    border-left: 3px solid var(--primary-color);
}

.sidebar-section {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: rgba(255,255,255,0.4);
    padding: 1.5rem 1.25rem 0.5rem;
    letter-spacing: 0.05em;
    white-space: nowrap;
    overflow: hidden;
}

.sidebar-section .section-text {
    opacity: 0;
    transition: opacity var(--sidebar-transition);
}

.sidebar:hover .section-text,
.sidebar.pinned .section-text,
.sidebar.tree-mode .section-text {
    opacity: 1;
}

.sidebar:not(:hover):not(.pinned):not(.tree-mode) .sidebar-section {
    padding: 1rem 0;
    text-align: center;
}

.sidebar:not(:hover):not(.pinned):not(.tree-mode) .sidebar-section::after {
    content: '';
    display: block;
    width: 24px;
    height: 1px;
    background: rgba(255,255,255,0.2);
    margin: 0 auto;
}

/* Tree Mode */
.sidebar-tree-toggle {
    display: none;
    padding: 0.5rem 1.25rem;
    margin-bottom: 0.5rem;
}

.sidebar-tree-toggle button {
    width: 100%;
    background: rgba(37, 99, 235, 0.2);
    border: 1px solid rgba(37, 99, 235, 0.3);
    color: var(--text-inverse);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.2s;
}

.sidebar-tree-toggle button:hover {
    background: rgba(37, 99, 235, 0.3);
}

.sidebar-tree-toggle button.active {
    background: var(--primary-color);
}

body.estimate-page .sidebar-tree-toggle {
    display: block;
}

body.estimate-page .sidebar:hover .sidebar-tree-toggle,
body.estimate-page .sidebar.pinned .sidebar-tree-toggle,
body.estimate-page .sidebar.tree-mode .sidebar-tree-toggle {
    display: block;
}

body.estimate-page .sidebar:not(:hover):not(.pinned):not(.tree-mode) .sidebar-tree-toggle {
    display: none;
}

.equipment-tree {
    display: none;
    padding: 0 0.5rem;
    overflow-y: auto;
    max-height: calc(100vh - 200px);
}

.sidebar.tree-mode .equipment-tree {
    display: block;
}

.sidebar.tree-mode .sidebar-nav-main {
    display: none;
}

.tree-node {
    user-select: none;
}

.tree-node-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.5rem;
    color: rgba(255,255,255,0.8);
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.15s;
}

.tree-node-header:hover {
    background: rgba(255,255,255,0.1);
    color: var(--text-inverse);
}

.tree-node-header .tree-icon {
    font-size: 0.75rem;
    width: 16px;
    text-align: center;
    color: rgba(255,255,255,0.5);
    transition: transform 0.2s;
}

.tree-node.expanded > .tree-node-header .tree-icon {
    transform: rotate(90deg);
}

.tree-node-header .tree-type-icon {
    font-size: 1rem;
    min-width: 18px;
}

.tree-node-header .tree-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tree-node-header .tree-count {
    font-size: 0.7rem;
    background: rgba(255,255,255,0.15);
    padding: 0.1rem 0.4rem;
    border-radius: 10px;
    color: rgba(255,255,255,0.6);
}

.tree-children {
    display: none;
    padding-left: 1rem;
}

.tree-node.expanded > .tree-children {
    display: block;
}

.tree-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.5rem 0.35rem 1.5rem;
    color: rgba(255,255,255,0.7);
    font-size: 0.8rem;
    border-radius: 4px;
    cursor: grab;
    transition: all 0.15s;
}

.tree-item:hover {
    background: rgba(37, 99, 235, 0.3);
    color: var(--text-inverse);
}

.tree-item:active {
    cursor: grabbing;
}

.tree-item.dragging {
    opacity: 0.5;
}

.tree-item .item-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tree-item .item-price {
    font-size: 0.7rem;
    color: rgba(255,255,255,0.5);
}

.tree-item .item-drag-icon {
    opacity: 0.4;
    font-size: 0.75rem;
}

/* Visual flags for problem items in catalog tree:
   - zero-stock: яркий тонкий border слева (нет на складе — нечего отгружать)
   - zero-price: badge в строке (цена не выставлена)
   Видно мгновенно даже в большом списке. */
.tree-item.zero-stock {
    box-shadow: inset 3px 0 0 #ef4444;
}
.tree-item.zero-stock .item-stock {
    color: #ef4444;
    font-weight: 600;
}
.tree-item.zero-price {
    background: rgba(234, 179, 8, 0.10);
}
.tree-item.zero-price.zero-stock {
    background: rgba(239, 68, 68, 0.12);
}
.tree-item .item-flag {
    font-size: 0.65rem;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 4px;
    line-height: 1.3;
    flex-shrink: 0;
}
.tree-item .item-flag.flag-zero-price {
    background: #eab308;
    color: #000;
}

.tree-search-results .tree-item {
    padding-left: 0.5rem;
}

.tree-search-results .search-result-type {
    font-size: 0.65rem;
    padding: 0.1rem 0.3rem;
    border-radius: 3px;
    margin-left: 0.25rem;
}

.tree-search-results .search-result-type.equipment {
    background: rgba(34, 197, 94, 0.3);
    color: #86efac;
}

.tree-search-results .search-result-type.subrent {
    background: rgba(168, 85, 247, 0.3);
    color: #d8b4fe;
}

.tree-items-list {
    max-height: 300px;
    overflow-y: auto;
    margin-top: 0.25rem;
}

.tree-search {
    padding: 0.5rem;
    margin-bottom: 0.5rem;
}

.tree-search input {
    width: 100%;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    color: var(--text-inverse);
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    font-size: 0.85rem;
}

.tree-search input::placeholder {
    color: rgba(255,255,255,0.4);
}

.tree-search input:focus {
    outline: none;
    border-color: var(--primary-color);
    background: rgba(255,255,255,0.15);
}

/* Edit mode styles */
.tree-edit-toggle {
    display: none;
    padding: 0.25rem 0.5rem 0.5rem;
}

.sidebar.tree-mode .tree-edit-toggle {
    display: block;
}

.tree-edit-toggle button {
    width: 100%;
    background: rgba(168, 85, 247, 0.2);
    border: 1px solid rgba(168, 85, 247, 0.3);
    color: var(--text-inverse);
    padding: 0.4rem 0.75rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.2s;
}

.tree-edit-toggle button:hover {
    background: rgba(168, 85, 247, 0.3);
}

.tree-edit-toggle button.active {
    background: #a855f7;
}

.edit-mode .tree-item {
    cursor: pointer;
}

.edit-mode .tree-item .item-checkbox {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.4);
    border-radius: 3px;
    margin-right: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    flex-shrink: 0;
}

.edit-mode .tree-item.selected .item-checkbox {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.edit-mode .tree-item.selected .item-checkbox::after {
    content: "\2713";
    color: var(--text-inverse);
    font-size: 10px;
}

.edit-mode .tree-item.selected {
    background: rgba(37, 99, 235, 0.25);
}

.edit-mode .tree-item:not(.selected):hover .item-checkbox {
    border-color: rgba(255,255,255,0.7);
}

.edit-mode .tree-item .item-drag-icon {
    display: none;
}

.edit-mode .tree-node[data-type="category"].drop-target > .tree-node-header {
    background: rgba(37, 99, 235, 0.4);
    outline: 2px dashed var(--primary-color);
    outline-offset: -2px;
}

.tree-selection-info {
    display: none;
    padding: 0.5rem;
    background: rgba(37, 99, 235, 0.2);
    border-radius: 6px;
    margin: 0.5rem;
    font-size: 0.8rem;
    color: rgba(255,255,255,0.9);
}

.tree-selection-info.visible {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.tree-selection-info .selection-hint {
    font-size: 0.75rem;
    opacity: 0.7;
    margin-left: 0.5rem;
}

.tree-selection-info button {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.3);
    color: var(--text-inverse);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.75rem;
}

.tree-selection-info button:hover {
    background: rgba(255,255,255,0.1);
}

.tree-node.empty-category > .tree-node-header {
    opacity: 0.6;
}

.tree-node.empty-category > .tree-node-header .tree-name {
    font-style: italic;
}

.tree-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    color: rgba(255,255,255,0.5);
}

.tree-back-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    margin: 0.5rem;
    background: rgba(255,255,255,0.1);
    border: none;
    color: rgba(255,255,255,0.8);
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.tree-back-btn:hover {
    background: rgba(255,255,255,0.2);
    color: var(--text-inverse);
}

/* Drop zones */
.drop-zone-active {
    outline: 2px dashed var(--primary-color) !important;
    outline-offset: -2px;
    background: rgba(37, 99, 235, 0.05) !important;
}

.drop-zone-hover {
    outline: 2px solid var(--primary-color) !important;
    background: rgba(37, 99, 235, 0.1) !important;
}

.drag-ghost {
    position: fixed;
    padding: 0.5rem 1rem;
    background: var(--primary-color);
    color: var(--text-inverse);
    border-radius: 6px;
    font-size: 0.85rem;
    pointer-events: none;
    z-index: 10000;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    max-width: 250px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Main content */
.main-content {
    margin-left: var(--sidebar-collapsed-width);
    padding: 2rem;
    min-height: 100vh;
    transition: margin-left var(--sidebar-transition);
}

body.sidebar-pinned .main-content {
    margin-left: var(--sidebar-width);
}

body.sidebar-tree-mode .main-content {
    margin-left: var(--sidebar-tree-width);
}

.card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.card-header {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-default);
    padding: 1rem 1.25rem;
    border-radius: 12px 12px 0 0 !important;
}

.btn-primary {
    background: var(--primary-color);
    border: none;
}

.btn-primary:hover {
    background: var(--accent-primary-hover);
}

.table th {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.alert {
    border: none;
    border-radius: 8px;
}

.form-control, .form-select {
    border-radius: 8px;
    border: 1px solid var(--border-strong);
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s, width var(--sidebar-transition);
        width: var(--sidebar-width);
    }

    .sidebar.show {
        transform: translateX(0);
    }

    .sidebar.tree-mode {
        width: 100%;
    }

    .main-content {
        margin-left: 0 !important;
    }

    .mobile-toggle {
        display: block !important;
    }

    .sidebar-pin {
        display: none;
    }
}

.mobile-toggle {
    display: none;
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 1001;
    background: var(--primary-color);
    color: var(--text-inverse);
    border: none;
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
}

@keyframes spin { to { transform: rotate(360deg); } }
.spin { animation: spin 1s linear infinite; }

/* ============================================
   Responsive: Tablets & Small Screens
   ============================================ */
@media (max-width: 767.98px) {
    /* Tables: horizontal scroll on mobile */
    .table-responsive-custom {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Cards: full-width, less padding */
    .card {
        border-radius: 8px;
    }
    .card-body {
        padding: 0.75rem;
    }

    /* Forms: larger touch targets */
    .form-control, .form-select, .btn {
        min-height: 42px;
        font-size: 0.95rem;
    }

    /* Modals: full-screen on mobile */
    .modal-dialog {
        margin: 0;
        max-width: 100%;
        min-height: 100vh;
    }
    .modal-content {
        border-radius: 0;
        min-height: 100vh;
    }

    /* Badge + small elements */
    .badge {
        font-size: 0.75rem;
        padding: 0.35em 0.5em;
    }

    /* Project header: stack vertically */
    .project-header {
        flex-direction: column;
        gap: 0.5rem;
    }

    /* Gantt: horizontal scroll */
    .gantt-card {
        overflow-x: auto;
    }

    /* Selection toolbar: compact on mobile */
    .selection-toolbar {
        flex-wrap: wrap;
        gap: 0.25rem;
    }
    .selection-toolbar select,
    .selection-toolbar input {
        font-size: 0.8rem;
        min-height: 36px;
    }

    /* Date cards: smaller */
    .date-card {
        padding: 0.5rem;
    }

    /* Finance section */
    .finance-row {
        flex-wrap: wrap;
    }

    /* Staff cards */
    .staff-row {
        flex-wrap: wrap;
    }

    /* Toast notifications */
    .toast-container {
        max-width: 90vw;
    }

    /* Bottom safe area for phones */
    .main-content {
        padding-bottom: env(safe-area-inset-bottom, 20px);
    }
}

/* Extra small screens (phones) */
@media (max-width: 575.98px) {
    .main-content {
        padding: 0.5rem;
    }

    h1, .h1 { font-size: 1.4rem; }
    h2, .h2 { font-size: 1.2rem; }
    h3, .h3 { font-size: 1.1rem; }

    /* Estimate item rows: more compact */
    .item-row td {
        padding: 0.35rem 0.25rem;
        font-size: 0.85rem;
    }

    /* Hide less-important columns on phone */
    .d-phone-none {
        display: none !important;
    }
}

/* Touch device optimizations */
@media (hover: none) {
    /* Larger click targets */
    .btn-sm {
        min-height: 36px;
        min-width: 36px;
    }

    /* Remove hover-only effects */
    .editable:hover {
        background: inherit;
    }

    /* Better scrolling */
    .table-responsive-custom {
        -webkit-overflow-scrolling: touch;
    }
}

/* ══════════════════════════════════════════════════════════
   RECENT PROJECTS bar — closed-tab style bookmark widget
   Lives in base.html, rendered on every page. Persists list
   in localStorage. Tabs touch each other like browser bookmarks.
   ══════════════════════════════════════════════════════════ */
.recent-projects-bar {
    display: flex;
    align-items: stretch;
    gap: 2px;
    flex-wrap: wrap;
    font-size: 12px;
    margin-bottom: 4px;
}
.recent-projects-bar__icon {
    display: inline-flex;
    align-items: center;
    color: var(--text-tertiary);
    font-size: 13px;
    padding: 0 6px 0 2px;
}
.recent-tab {
    display: inline-flex;
    align-items: center;
    background: var(--bg-card);
    border: 1px solid var(--border-default);
    border-radius: 6px 6px 2px 2px;
    transition: all var(--transition-fast);
    overflow: hidden;
}
.recent-tab:hover {
    background: var(--bg-subtle);
    border-color: var(--border-strong);
    transform: translateY(-1px);
}
.recent-tab__link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 4px 4px 10px;
    color: var(--text-secondary);
    text-decoration: none;
    white-space: nowrap;
}
.recent-tab__link:hover {
    color: var(--text-primary);
}
.recent-tab__dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
    /* background-color set inline from status (data-driven) */
}
.recent-tab--current .recent-tab__dot {
    background-color: #16a34a !important;
    box-shadow: 0 0 0 2px rgba(22,163,74,.2);
}
.recent-tab--current .recent-tab__link { font-weight: 700; }
.recent-tab__close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0 7px 0 4px;
    color: var(--text-tertiary);
    font-size: 13px;
    line-height: 1;
    opacity: 0;
    transition: opacity var(--transition-fast), color var(--transition-fast);
}
.recent-tab:hover .recent-tab__close {
    opacity: 1;
}
.recent-tab__close:hover {
    color: var(--status-danger);
}

/* ══════════════════════════════════════════════════════════
   THEME PICKER — radio cards in profile/settings
   ══════════════════════════════════════════════════════════ */
.theme-picker__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
}
.theme-card {
    display: block;
    cursor: pointer;
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    padding: 12px;
    background: var(--bg-card);
    transition: all var(--transition-fast);
    margin: 0;
    user-select: none;
}
.theme-card:hover {
    border-color: var(--border-strong);
}
.theme-card:has(input:checked) {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px var(--accent-primary-soft);
}
.theme-card input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}
.theme-card__preview {
    display: flex;
    gap: 4px;
    height: 44px;
    border-radius: var(--radius-md);
    padding: 6px;
    margin-bottom: 8px;
    border: 1px solid var(--border-subtle);
}
.theme-card__preview--classic { background: #f8fafc; }
.theme-card__preview--linear { background: #fafafa; }
.theme-card__swatch {
    flex: 1;
    border-radius: 3px;
}
.theme-card__name {
    font-weight: 600;
    font-size: 13px;
    color: var(--text-primary);
}
.theme-card__hint {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 2px;
}

/* === Quick Nav === */
.quick-nav {
    position: relative;
    margin: 0 12px 12px;
}
.quick-nav-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.5);
    font-size: 14px;
    pointer-events: none;
}
.quick-nav-input {
    width: 100%;
    padding: 8px 36px 8px 32px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 6px;
    color: #fff;
    font-size: 13px;
    outline: none;
    transition: background 120ms, border-color 120ms;
}
.quick-nav-input:focus {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.25);
}
.quick-nav-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}
.quick-nav-shortcut {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    padding: 1px 6px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 3px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 10px;
    font-family: -apple-system, system-ui, sans-serif;
    pointer-events: none;
}
.quick-nav-results {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    max-height: 400px;
    overflow-y: auto;
    background: #1f2937;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    z-index: 1100;
    padding: 4px 0;
}
.quick-nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    font-size: 13px;
    cursor: pointer;
}
.quick-nav-item:hover,
.quick-nav-item.is-active {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}
.quick-nav-item i {
    flex-shrink: 0;
    width: 16px;
    text-align: center;
    color: rgba(255, 255, 255, 0.6);
}
.quick-nav-item .quick-nav-text {
    flex: 1;
    min-width: 0;
}
.quick-nav-item .quick-nav-title {
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.quick-nav-item .quick-nav-title mark {
    background: rgba(250, 204, 21, 0.3);
    color: #fde68a;
    padding: 0 1px;
    border-radius: 2px;
}
.quick-nav-item .quick-nav-category {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.45);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.quick-nav-empty {
    padding: 16px;
    text-align: center;
    color: rgba(255, 255, 255, 0.4);
    font-size: 12px;
}
.quick-nav-empty i {
    margin-right: 6px;
}
.sidebar:not(.pinned):not(:hover) .quick-nav,
.sidebar.tree-mode .quick-nav {
    display: none;
}
