.sidebar-search {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--sidebar-border, #e2e8f0);
}

.sidebar-search-wrapper {
    position: relative;
}

.sidebar-search-input {
    width: 100%;
    padding: 0.5rem 0.75rem 0.5rem 2.25rem;
    border: 1px solid var(--sidebar-border, #e2e8f0);
    border-radius: 6px;
    font-size: 0.8rem;
    background: var(--sidebar-hover, #f1f5f9);
    color: var(--sidebar-text-primary, #1e293b);
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.sidebar-search-input::placeholder {
    color: var(--sidebar-text-light, #94a3b8);
}

.sidebar-search-input:focus {
    border-color: var(--sidebar-primary, #3b82f6);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
    background: #fff;
}

.sidebar-search-icon {
    position: absolute;
    left: 0.65rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--sidebar-text-light, #94a3b8);
    font-size: 0.8rem;
    pointer-events: none;
}

.sidebar-search-clear {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--sidebar-text-light, #94a3b8);
    cursor: pointer;
    font-size: 0.75rem;
    padding: 2px;
    display: none;
}

.sidebar-search-clear.visible {
    display: block;
}

.global-search-results {
    position: fixed;
    z-index: 10000;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    max-height: 420px;
    overflow-y: auto;
    display: none;
    min-width: 320px;
}

.global-search-results.visible {
    display: block;
}

.search-results-header {
    padding: 0.6rem 1rem;
    font-size: 0.7rem;
    font-weight: 600;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: 1px solid #f1f5f9;
}

.search-group {
    border-bottom: 1px solid #f1f5f9;
}

.search-group:last-child {
    border-bottom: none;
}

.search-group-title {
    padding: 0.5rem 1rem 0.25rem;
    font-size: 0.7rem;
    font-weight: 600;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.search-group-title i {
    font-size: 0.7rem;
}

.search-result-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.55rem 1rem;
    cursor: pointer;
    transition: background 0.12s;
    text-decoration: none;
    color: inherit;
}

.search-result-item:hover {
    background: #f8fafc;
    text-decoration: none;
    color: inherit;
}

.search-result-icon {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    flex-shrink: 0;
}

.search-result-icon.improvement { background: rgba(16, 185, 129, 0.1); color: #10b981; }
.search-result-icon.task { background: rgba(59, 130, 246, 0.1); color: #3b82f6; }
.search-result-icon.plan { background: rgba(139, 92, 246, 0.1); color: #8b5cf6; }
.search-result-icon.problem { background: rgba(239, 68, 68, 0.1); color: #ef4444; }
.search-result-icon.standard_work { background: rgba(245, 158, 11, 0.1); color: #f59e0b; }
.search-result-icon.fives { background: rgba(16, 185, 129, 0.1); color: #059669; }
.search-result-icon.safety { background: rgba(239, 68, 68, 0.1); color: #dc2626; }

.search-result-info {
    flex: 1;
    min-width: 0;
}

.search-result-title {
    font-size: 0.82rem;
    font-weight: 500;
    color: #1e293b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-result-meta {
    font-size: 0.7rem;
    color: #94a3b8;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.search-result-badge {
    display: inline-block;
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 500;
    text-transform: uppercase;
}

.search-result-badge.active, .search-result-badge.in_progress { background: rgba(59, 130, 246, 0.1); color: #3b82f6; }
.search-result-badge.completed, .search-result-badge.done { background: rgba(16, 185, 129, 0.1); color: #10b981; }
.search-result-badge.pending, .search-result-badge.draft { background: rgba(245, 158, 11, 0.1); color: #f59e0b; }

.search-no-results {
    padding: 1.5rem 1rem;
    text-align: center;
    color: #94a3b8;
    font-size: 0.82rem;
}

.search-no-results i {
    display: block;
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    opacity: 0.5;
}

.search-loading {
    padding: 1.25rem 1rem;
    text-align: center;
    color: #94a3b8;
    font-size: 0.8rem;
}

.search-loading i {
    margin-right: 0.4rem;
}
