/* Мебелна Система - Custom Styles */

:root {
    --sidebar-width: 250px;
    --primary-color: #2c3e50;
    --secondary-color: #34495e;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8f9fa;
}

/* Sidebar */
#sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    overflow-y: auto;
    transition: margin-left 0.3s;
    z-index: 1000;
}

#sidebar .nav-link {
    color: rgba(255, 255, 255, 0.8);
    padding: 0.75rem 1rem;
    border-left: 3px solid transparent;
    transition: all 0.2s;
}

#sidebar .nav-link:hover {
    color: #fff;
    background-color: rgba(255, 255, 255, 0.1);
    border-left-color: #3498db;
}

#sidebar .nav-link.active {
    color: #fff;
    background-color: rgba(255, 255, 255, 0.1);
    border-left-color: #3498db;
}

#sidebar .nav-link i {
    width: 20px;
    margin-right: 10px;
}

.sidebar-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-footer {
    position: absolute;
    bottom: 0;
    width: 100%;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Main content */
#content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    transition: margin-left 0.3s;
}

/* Sidebar collapsed state */
body.sidebar-collapsed #sidebar {
    margin-left: calc(-1 * var(--sidebar-width));
}

body.sidebar-collapsed #content {
    margin-left: 0;
}

/* Cards */
.card {
    border: none;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    margin-bottom: 1.5rem;
}

.card-header {
    background-color: #fff;
    border-bottom: 1px solid #eee;
    font-weight: 600;
}

/* Tables */
.table {
    margin-bottom: 0;
}

.table th {
    font-weight: 600;
    background-color: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
}

.table-hover tbody tr:hover {
    background-color: #f1f3f5;
}

/* Status badges */
.badge-status {
    font-weight: 500;
    padding: 0.35em 0.65em;
}

.status-draft { background-color: #6c757d; }
.status-quoted { background-color: #17a2b8; }
.status-confirmed { background-color: #28a745; }
.status-in_production { background-color: #ffc107; color: #000; }
.status-ready { background-color: #007bff; }
.status-delivered { background-color: #6f42c1; }
.status-installed { background-color: #20c997; }
.status-completed { background-color: #198754; }
.status-cancelled { background-color: #dc3545; }

/* Dashboard widgets */
.widget {
    padding: 1.5rem;
    border-radius: 0.5rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: #fff;
}

.widget-icon {
    font-size: 2.5rem;
    opacity: 0.8;
}

.widget-value {
    font-size: 2rem;
    font-weight: 700;
}

.widget-label {
    font-size: 0.875rem;
    opacity: 0.9;
}

/* Stats cards */
.stat-card {
    text-align: center;
    padding: 1rem;
}

.stat-card .stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary-color);
}

.stat-card .stat-label {
    font-size: 0.875rem;
    color: #6c757d;
}

/* Forms */
.form-label {
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.required::after {
    content: " *";
    color: #dc3545;
}

/* Buttons */
.btn-action {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
}

/* Pagination */
.pagination {
    margin-bottom: 0;
}

/* Alerts in low stock, expiring docs */
.alert-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid #eee;
}

.alert-item:last-child {
    border-bottom: none;
}

/* Print styles */
@media print {
    #sidebar, .navbar, .btn, .pagination {
        display: none !important;
    }
    
    #content {
        margin-left: 0 !important;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}

/* Responsive */
@media (max-width: 768px) {
    #sidebar {
        margin-left: calc(-1 * var(--sidebar-width));
    }
    
    #content {
        margin-left: 0;
    }
    
    body.sidebar-open #sidebar {
        margin-left: 0;
    }
    
    body.sidebar-open::after {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
    }
}

/* Loading spinner */
.spinner-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

/* Tooltips */
[data-bs-toggle="tooltip"] {
    cursor: pointer;
}

/* Quick search */
.quick-search {
    position: relative;
}

.quick-search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 0.25rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
}

.quick-search-results.show {
    display: block;
}

.quick-search-item {
    padding: 0.5rem 1rem;
    cursor: pointer;
    border-bottom: 1px solid #eee;
}

.quick-search-item:hover {
    background-color: #f8f9fa;
}

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