﻿/* ===== ORDER DASHBOARD - EXTRA STYLES & CLS FIXES ===== */
/* Dodatkowe style i poprawki Layout Shift */
/* UWAGA: Style sidebar i main-content są w order-dashboard-sidebar.css */

/* ===== CRITICAL CLS FIXES ===== */
/* Zapobiega skakaniu elementów podczas ładowania */

/* Rezerwacja miejsca dla KPI kart */
.kpi-grid {
    min-height: 180px;
    contain: layout style;
}

/* Rezerwacja miejsca dla kanban container */
.kanban-container {
    min-height: 500px;
    contain: layout style;
}

/* Zapobiegaj miganiu elementów podczas ładowania CSS */
.dashboard-header,
.kpi-card,
.kanban-column,
.order-card,
.list-item,
.delivered-card {
    contain: layout style paint;
    will-change: auto;
}

/* ===== LOADING STATE ===== */
.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    padding: 2rem;
    contain: layout style paint;
}

.spinner-large {
    width: 48px;
    height: 48px;
    border: 4px solid #e2e8f0;
    border-top-color: #6366f1;
    border-radius: 50%;
    animation: spinnerRotate 0.8s linear infinite;
}

@keyframes spinnerRotate {
    to { transform: rotate(360deg); }
}

.loading-text {
    margin-top: 1rem;
    color: #64748b;
    font-size: 0.95rem;
}

/* ===== BADGE STYLES ===== */

/* Badge oczekuje na kierownika DUR */
.badge-waiting-manager {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.7rem;
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    color: #92400e;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    margin: 0.5rem 0;
    border: 1px solid #f59e0b;
}

.badge-waiting-manager i {
    font-size: 0.85rem;
}

/* Badge zaakceptowane przez kierownika */
.badge-approved-manager {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.7rem;
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    color: #065f46;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    margin: 0.5rem 0;
    border: 1px solid #10b981;
}

.badge-approved-manager i {
    font-size: 0.85rem;
    color: #059669;
}

/* Małe badge'e dla widoku listy */
.badge-waiting-manager-small {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    padding: 0.15rem 0.4rem;
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    color: #92400e;
    border-radius: 4px;
    font-size: 0.6rem;
    font-weight: 600;
    border: 1px solid #f59e0b;
    white-space: nowrap;
}

.badge-approved-manager-small {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    padding: 0.15rem 0.4rem;
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    color: #065f46;
    border-radius: 4px;
    font-size: 0.6rem;
    font-weight: 600;
    border: 1px solid #10b981;
    white-space: nowrap;
}

/* 🆕 BADGE: Zamówienie było odrzucone (czerwony wykrzyknik) */
.badge-rejected {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.6rem;
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    color: #b91c1c;
    border: 1.5px solid #ef4444;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    animation: pulseRejected 2s ease-in-out infinite;
}

.badge-rejected i {
    font-size: 0.8rem;
    color: #dc2626;
}

@keyframes pulseRejected {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.85; }
}

/* 🆕 BADGE: Ma komentarz (zielony) */
.badge-has-comment {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.6rem;
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    color: #065f46;
    border: 1.5px solid #10b981;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.badge-has-comment i {
    font-size: 0.8rem;
    color: #059669;
}

/* ===== CHECK ORDER BUTTON ===== */
.btn-check-order {
    padding: 0.6rem 1.2rem;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.btn-check-order:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

/* ===== SPRAWDZONE BADGE ===== */
.badge-sprawdzone {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.8rem;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    box-shadow: 0 2px 6px rgba(16, 185, 129, 0.3);
    margin-left: 0.8rem;
}

.badge-sprawdzone i {
    font-size: 1rem;
}

/* Badge "DO SPRAWDZENIA" */
.badge-to-check {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.6rem;
    background: linear-gradient(135deg, #f59e0b 0%, #f97316 100%);
    color: white;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-left: 0.5rem;
    box-shadow: 0 1px 3px rgba(245, 158, 11, 0.3);
}

/* ===== NOTIFICATION STYLES ===== */
.notification-item.to-check {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.05) 0%, rgba(249, 115, 22, 0.05) 100%);
    border-left: 3px solid #f59e0b;
}

.notification-action-btn.check {
    padding: 0.5rem;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(16, 185, 129, 0.3);
    margin-right: 0.5rem;
}

.notification-action-btn.check:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(16, 185, 129, 0.4);
}

.notification-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* ===== DELIVERY INFO BAR ===== */
.delivery-info-bar {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: #f8fafc;
    border-radius: 8px;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.info-item {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: #64748b;
    font-size: 0.9rem;
}

.info-item i {
    color: #10b981;
}

/* ===== MODAL STYLES ===== */
.modal-backdrop-dashboard {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal-container-dashboard {
    background: white;
    border-radius: 16px;
    width: 100%;
    max-width: 500px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    animation: modalSlideUp 0.3s ease;
}

@keyframes modalSlideUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

.modal-header-dashboard {
    padding: 1.5rem;
    color: white;
    position: relative;
}

.modal-close-dashboard {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.modal-close-dashboard:hover {
    background: rgba(255,255,255,0.3);
    transform: rotate(90deg);
}

.modal-header-content-dashboard {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.modal-icon-dashboard {
    width: 50px;
    height: 50px;
    background: rgba(255,255,255,0.2);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.modal-title-dashboard {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
}

.modal-subtitle-dashboard {
    margin: 0.25rem 0 0;
    opacity: 0.9;
    font-size: 0.9rem;
}

.modal-body-dashboard {
    padding: 1.5rem;
}

.modal-info-box-dashboard {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem;
    background: linear-gradient(135deg, #E3F2FD 0%, #BBDEFB 100%);
    border-radius: 10px;
    margin-bottom: 1.5rem;
    border-left: 4px solid #2196F3;
}

.modal-info-box-dashboard i {
    color: #1976D2;
    font-size: 1.25rem;
    margin-top: 0.1rem;
}

.form-group-dashboard {
    margin-bottom: 1rem;
}

.form-group-dashboard label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    color: #334155;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.form-input-dashboard {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.95rem;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.form-input-dashboard:focus {
    outline: none;
    border-color: #9C27B0;
}

.form-textarea-dashboard {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.95rem;
    min-height: 80px;
    resize: vertical;
    transition: border-color 0.2s;
    box-sizing: border-box;
    font-family: inherit;
}

.form-textarea-dashboard:focus {
    outline: none;
    border-color: #9C27B0;
}

.modal-footer-dashboard {
    padding: 1rem 1.5rem;
    background: #f8fafc;
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    border-top: 1px solid #e2e8f0;
}

.modal-btn-cancel-dashboard {
    padding: 0.75rem 1.5rem;
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s;
}

.modal-btn-cancel-dashboard:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

.modal-btn-primary-dashboard {
    padding: 0.75rem 1.5rem;
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.modal-btn-primary-dashboard:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

.modal-btn-primary-dashboard:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.spin {
    animation: spinnerRotate 1s linear infinite;
}

/* ===== RESPONSIVE ===== */
/* Style responsive dla sidebar są w order-dashboard-sidebar.css */
