/* ========================================
   Garment Factory Report System - Styles
   ======================================== */

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

/* ---------- Navbar ---------- */
.bg-navbar {
    background: linear-gradient(135deg, #1a237e 0%, #283593 50%, #3949ab 100%);
}

.navbar-brand {
    font-size: 1.25rem;
    font-weight: 600;
    letter-spacing: 0.5px;
}

/* ---------- Section Headers ---------- */
.bg-report-header {
    background: linear-gradient(135deg, #1565c0 0%, #1976d2 100%);
}

/* ---------- Data Status Bar ---------- */
.sheet-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    transition: all 0.3s;
}

.sheet-badge.not-loaded {
    background: #f5f5f5;
    color: #9e9e9e;
}

.sheet-badge.not-loaded i {
    color: #bdbdbd;
    font-size: 0.5rem;
}

.sheet-badge.loaded {
    background: #e8f5e9;
    color: #2e7d32;
}

.sheet-badge.loaded i {
    color: #4caf50;
    font-size: 0.5rem;
}

/* ---------- Upload Hero ---------- */
.upload-hero {
    cursor: pointer;
    padding: 20px;
    border: 2px dashed #bdbdbd;
    border-radius: 16px;
    max-width: 550px;
    margin: 0 auto;
    transition: all 0.3s;
}

.upload-hero:hover {
    border-color: #1976d2;
    background: #e3f2fd;
}

.upload-hero-icon {
    font-size: 4rem;
    color: #4caf50;
}

/* Badge colours for sheet names */
.bg-orange-subtle {
    background-color: #fff3e0 !important;
    border: 1px solid #ffcc80;
}

.bg-teal-subtle {
    background-color: #e0f2f1 !important;
    border: 1px solid #80cbc4;
}

.bg-purple-subtle {
    background-color: #ede7f6 !important;
    border: 1px solid #b39ddb;
}

.bg-red-subtle {
    background-color: #fce4ec !important;
    border: 1px solid #ef9a9a;
}

/* ---------- Summary Cards ---------- */
.summary-card {
    border-radius: 12px;
    padding: 20px;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.15);
    transition: transform 0.2s;
}

.summary-card:hover {
    transform: translateY(-3px);
}

.summary-icon {
    font-size: 2rem;
    opacity: 0.85;
    width: 50px;
    text-align: center;
}

.summary-value {
    font-size: 1.6rem;
    font-weight: 700;
    line-height: 1.2;
}

.summary-label {
    font-size: 0.85rem;
    opacity: 0.9;
    font-weight: 500;
}

.bg-gradient-blue {
    background: linear-gradient(135deg, #1565c0, #42a5f5);
}

.bg-gradient-orange {
    background: linear-gradient(135deg, #e65100, #ff9800);
}

.bg-gradient-green {
    background: linear-gradient(135deg, #2e7d32, #66bb6a);
}

.bg-gradient-red {
    background: linear-gradient(135deg, #c62828, #ef5350);
}

/* ---------- Report Table ---------- */
#reportTable thead th {
    position: sticky;
    top: 0;
    z-index: 10;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

#reportTable tbody td {
    vertical-align: middle;
    font-size: 0.9rem;
}

#reportTable tbody tr.shortage {
    background-color: #ffebee !important;
}

#reportTable tbody tr.excess {
    background-color: #e8f5e9 !important;
}

.badge-shortage {
    background-color: #c62828;
    color: #fff;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
}

.badge-excess {
    background-color: #2e7d32;
    color: #fff;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
}

.badge-balanced {
    background-color: #757575;
    color: #fff;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
}

.table-responsive {
    max-height: 65vh;
    overflow-y: auto;
}

/* ---------- Loading Overlay ---------- */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(3px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.loading-content {
    text-align: center;
    padding: 40px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

.loading-content .progress {
    margin: 15px auto 0;
    height: 8px;
    border-radius: 4px;
}

/* ---------- Toast ---------- */
.toast {
    min-width: 300px;
}

/* ---------- Buttons ---------- */
.btn-primary {
    background: linear-gradient(135deg, #1565c0, #1976d2);
    border: none;
    font-weight: 600;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #0d47a1, #1565c0);
}

.btn-success {
    font-weight: 600;
}

/* ---------- Form ---------- */
.form-control-lg,
.form-select-lg {
    font-size: 1rem;
}

/* ---------- Animations ---------- */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.3s ease-out;
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
    .summary-card {
        padding: 15px;
    }

    .summary-value {
        font-size: 1.3rem;
    }

    .summary-icon {
        font-size: 1.5rem;
    }

    .container-fluid {
        padding-left: 10px !important;
        padding-right: 10px !important;
    }
}

/* Number formatting */

/* ---------- Multi-select Warehouse Dropdown ---------- */
.wh-multiselect {
    position: relative;
}

.wh-multiselect-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    user-select: none;
    min-height: calc(1.5em + 1rem + 2px);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wh-multiselect-toggle:hover {
    border-color: #86b7fe;
}

.wh-multiselect-arrow {
    font-size: 0.7rem;
    color: #6c757d;
    transition: transform 0.2s;
    flex-shrink: 0;
    margin-left: 8px;
}

.wh-multiselect.open .wh-multiselect-arrow {
    transform: rotate(180deg);
}

.wh-multiselect-text {
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    font-size: 0.95rem;
}

.wh-multiselect-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 100;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    max-height: 300px;
    overflow: hidden;
}

.wh-multiselect.open .wh-multiselect-menu {
    display: block;
}

.wh-multiselect-options {
    max-height: 200px;
    overflow-y: auto;
    padding: 4px 0;
}

.wh-multiselect-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.15s;
}

.wh-multiselect-option:hover {
    background: #e3f2fd;
}

.wh-multiselect-option input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #1976d2;
    cursor: pointer;
    flex-shrink: 0;
}

.wh-multiselect-option label {
    cursor: pointer;
    margin: 0;
    flex: 1;
}

.wh-multiselect-actions .btn {
    font-size: 0.75rem;
    padding: 2px 8px;
}

.wh-tag {
    display: inline-block;
    background: #e3f2fd;
    color: #1565c0;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 1px 8px;
    border-radius: 12px;
    margin: 1px 2px;
    white-space: nowrap;
}

/* Dynamic warehouse stock columns */
#reportTable thead th.wh-col {
    background: linear-gradient(135deg, #1b5e20 0%, #388e3c 100%);
    font-size: 0.78rem;
}

#reportTable tbody td.wh-col {
    background-color: rgba(232, 245, 233, 0.3);
}

.num-cell {
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 0.88rem;
}
