﻿
:root {
    --primary: #18AACC;
    --primary-dark: #1190ae;
    --primary-light: #e6f7fb;
    --sidebar-w: 264px;
    --topnav-h: 94px;
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Poppins', sans-serif;
    background: #f0f4f8;
    min-height: 100vh;
    overflow-x: hidden;
}

/* ─── TOP NAV ─── */
.top-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--topnav-h);
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    padding: 0 20px;
    z-index: 1050;
    gap: 12px;
    box-shadow: 0 2px 10px rgba(24,170,204,.10);
}

.brand {
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--primary);
    letter-spacing: .4px;
}

.module-tag {
    font-size: .68rem;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: 20px;
    padding: 2px 10px;
    font-weight: 600;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

.btn-topnav {
    font-family: 'Poppins', sans-serif;
    font-size: .78rem;
    font-weight: 600;
    border-radius: 8px;
    padding: 6px 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    border: none;
    transition: all .2s;
}

.btn-export {
    background: #fff;
    color: var(--primary);
    border: 1.5px solid var(--primary) !important;
}

    .btn-export:hover {
        background: var(--primary-light);
    }

.btn-run-top {
    background: var(--primary);
    color: #fff;
}

    .btn-run-top:hover {
        background: var(--primary-dark);
        transform: translateY(-1px);
        box-shadow: 0 4px 12px rgba(24,170,204,.35);
    }

/* ─── LAYOUT WRAPPER ─── */
.layout {
    display: flex;
    padding-top: var(--topnav-h);
    min-height: 100vh;
}

/* ─── LEFT SIDEBAR ─── */
.sidebarReport {
    width: var(--sidebar-w);
    min-width: var(--sidebar-w);
    max-width: var(--sidebar-w);
    background: #fff;
    border-right: 1px solid #e2e8f0;
    position: fixed;
    top: var(--topnav-h);
    left: 60px;
    bottom: 53px;
    overflow-y: auto;
    z-index: 900;
    padding-bottom: 20px;
}

    .sidebarReport::-webkit-scrollbar {
        width: 3px;
    }

    .sidebarReport::-webkit-scrollbar-thumb {
        background: #cbd5e1;
        border-radius: 4px;
    }

.sb-section-title {
    font-size: .63rem;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    padding: 14px 16px 5px;
}

.report-item {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 8px 16px;
    font-size: .78rem;
    font-weight: 500;
    color: #475569;
    cursor: pointer;
    border-left: 3px solid transparent;
    transition: all .18s ease;
    user-select: none;
}

    .report-item:hover {
        background: var(--primary-light);
        color: var(--primary);
        border-left-color: var(--primary);
    }

    .report-item.active {
        background: var(--primary-light);
        color: var(--primary);
        border-left-color: var(--primary);
        font-weight: 600;
    }

.ri-icon {
    width: 26px;
    height: 26px;
    border-radius: 6px;
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .82rem;
    color: #94a3b8;
    flex-shrink: 0;
    transition: all .18s;
}

.report-item:hover .ri-icon, .report-item.active .ri-icon {
    background: var(--primary);
    color: #fff;
}

.sb-badge {
    margin-left: auto;
    font-size: .58rem;
    background: var(--primary);
    color: #fff;
    border-radius: 20px;
    padding: 1px 6px;
    font-weight: 600;
}

/* ─── MAIN CONTENT (offset by sidebar) ─── */
.main-wrap {
    margin-left: var(--sidebar-w);
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    padding: 22px 24px;
    min-height: calc(100vh - var(--topnav-h));
}

/* ─── REPORT HEADER ─── */
.report-header {
    background: #fff;
    border-radius: 12px;
    padding: 14px 18px;
    margin-bottom: 18px;
    box-shadow: 0 1px 6px rgba(0,0,0,.06);
    display: flex;
    align-items: center;
    gap: 14px;
    animation: fadeSlideDown .3s ease;
}

.rh-icon {
    width: 44px;
    height: 44px;
    background: var(--primary-light);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-size: 1.2rem;
    flex-shrink: 0;
}

.rh-info h5 {
    font-size: .9rem;
    font-weight: 700;
    color: #1e293b;
}

.rh-info p {
    font-size: .72rem;
    color: #94a3b8;
    margin-top: 1px;
    margin-bottom: 0px;
}

.rh-right {
    margin-left: auto;
    display: flex;
    gap: 8px;
    align-items: center;
}

.rh-badge {
    font-size: .68rem;
    padding: 3px 10px;
    border-radius: 20px;
    background: var(--primary-light);
    color: var(--primary);
    font-weight: 600;
}

/* ─── FILTER PANEL ─── */
.filter-panel {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 1px 6px rgba(0,0,0,.06);
    margin-bottom: 20px;
    animation: fadeSlideDown .35s ease;
}

.filter-panel-head {
    padding: 12px 18px;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    align-items: center;
    gap: 8px;
}

    .filter-panel-head h6 {
        font-size: .82rem;
        font-weight: 700;
        color: #1e293b;
        margin: 0;
    }

    .filter-panel-head .btn-reset-f {
        margin-left: auto;
        font-size: .72rem;
        color: var(--primary);
        background: none;
        border: none;
        font-family: 'Poppins', sans-serif;
        font-weight: 600;
        cursor: pointer;
        display: flex;
        align-items: center;
        gap: 4px;
    }

        .filter-panel-head .btn-reset-f:hover {
            text-decoration: underline;
        }

.filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    padding: 16px 18px;
}

.filter-field label {
    font-size: .67rem;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: .7px;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 5px;
}

    .filter-field label i {
        color: var(--primary);
        font-size: .82rem;
    }

.f-control {
    width: 100%;
    font-family: 'Poppins', sans-serif;
    font-size: .78rem;
    color: #374151;
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    padding: 7px 10px;
    background: #f8fafc;
    outline: none;
    appearance: none;
    transition: border-color .2s, box-shadow .2s;
}

    .f-control:focus {
        border-color: var(--primary);
        box-shadow: 0 0 0 3px rgba(24,170,204,.13);
        background: #fff;
    }

/* Date range inline */
.date-pair {
    display: flex;
    gap: 6px;
}

    .date-pair .f-control {
        flex: 1;
    }

/* Status checkboxes */
.check-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
    margin-top: 2px;
}

.ck-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: .75rem;
    color: #374151;
    cursor: pointer;
}

    .ck-item input[type="checkbox"] {
        accent-color: var(--primary);
        width: 14px;
        height: 14px;
    }

/* Asset type radios */
.radio-group {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    margin-top: 2px;
}

.rd-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: .75rem;
    color: #374151;
    cursor: pointer;
}

    .rd-item input[type="radio"] {
        accent-color: var(--primary);
        width: 14px;
        height: 14px;
    }

/* ─── FILTER FOOTER ─── */
.filter-footer {
    padding: 12px 18px;
    border-top: 1px solid #f1f5f9;
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-apply {
    background: var(--primary);
    color: #fff;
    border: none;
    font-family: 'Poppins', sans-serif;
    font-size: .8rem;
    font-weight: 600;
    border-radius: 8px;
    padding: 8px 22px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 7px;
    transition: all .2s;
    position: relative;
    overflow: hidden;
}

    .btn-apply:hover {
        background: var(--primary-dark);
        transform: translateY(-1px);
        box-shadow: 0 4px 14px rgba(24,170,204,.35);
    }

    .btn-apply .ripple {
        position: absolute;
        border-radius: 50%;
        background: rgba(255,255,255,.35);
        transform: scale(0);
        animation: rippleAnim .5s linear;
        pointer-events: none;
    }

.btn-clear {
    background: #f1f5f9;
    color: #64748b;
    border: none;
    font-family: 'Poppins', sans-serif;
    font-size: .8rem;
    font-weight: 600;
    border-radius: 8px;
    padding: 8px 16px;
    cursor: pointer;
    transition: background .2s;
}

    .btn-clear:hover {
        background: #e2e8f0;
    }

.filter-summary {
    margin-left: auto;
    font-size: .72rem;
    color: #94a3b8;
}

    .filter-summary span {
        color: var(--primary);
        font-weight: 600;
    }

/* ─── RESULT SECTION ─── */
#result-section {
    display: none;
}

.result-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 1px 6px rgba(0,0,0,.06);
    overflow: hidden;
}

.result-toolbar {
    padding: 12px 18px;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    align-items: center;
    gap: 10px;
}

    .result-toolbar .rt-title {
        font-size: .82rem;
        font-weight: 700;
        color: #374151;
    }

.rt-count {
    font-size: .68rem;
    padding: 3px 9px;
    border-radius: 20px;
    background: #f1f5f9;
    color: #64748b;
    font-weight: 600;
}

.rt-actions {
    margin-left: auto;
    display: flex;
    gap: 8px;
}

.btn-sm-act {
    font-family: 'Poppins', sans-serif;
    font-size: .7rem;
    font-weight: 600;
    border-radius: 7px;
    padding: 5px 12px;
    border: 1.5px solid #e2e8f0;
    background: #fff;
    color: #64748b;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: all .18s;
}

    .btn-sm-act:hover {
        border-color: var(--primary);
        color: var(--primary);
        background: var(--primary-light);
    }

/* ─── TABLE ─── */
.table-wrap {
    overflow-x: auto;
}

.fa-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .76rem;
}

    .fa-table thead tr {
        background: var(--primary);
    }

    .fa-table thead th {
        padding: 10px 14px;
        color: #fff;
        font-weight: 600;
        white-space: nowrap;
        border: none;
        text-align: left;
    }

        .fa-table thead th:first-child {
            border-radius: 0;
        }

    .fa-table tbody tr {
        border-bottom: 1px solid #f1f5f9;
        transition: background .15s, transform .15s;
        opacity: 0;
        transform: translateY(8px);
    }

        .fa-table tbody tr.row-visible {
            opacity: 1;
            transform: translateY(0);
        }

        .fa-table tbody tr:hover {
            background: #f8fafc;
        }

    .fa-table tbody td {
        padding: 9px 14px;
        color: #374151;
        white-space: nowrap;
    }

    .fa-table .subtotal-row td {
        background: #f0f9ff;
        font-weight: 600;
        color: var(--primary-dark);
    }

    .fa-table .total-row td {
        background: var(--primary-light);
        font-weight: 700;
        color: #0e7490;
    }

    .fa-table tbody td:nth-child(7),
    .fa-table tbody td:nth-child(8),
    .fa-table tbody td:nth-child(9) {
        text-align: right;
        font-variant-numeric: tabular-nums;
    }

.st-badge {
    font-size: .64rem;
    padding: 2px 8px;
    border-radius: 20px;
    font-weight: 600;
}

.st-active {
    background: #dcfce7;
    color: #16a34a;
}

.st-disposed {
    background: #fee2e2;
    color: #dc2626;
}

.st-scrapped {
    background: #fef3c7;
    color: #d97706;
}

/* ─── LOADING SHIMMER ─── */
.shimmer-wrap {
    padding: 16px 18px;
}

.shimmer-row {
    height: 38px;
    border-radius: 6px;
    margin-bottom: 8px;
    background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
    background-size: 200% 100%;
    animation: shimmerAnim 1.2s infinite;
}

/* ─── EMPTY STATE ─── */
.empty-state {
    padding: 60px 20px;
    text-align: center;
}

    .empty-state .es-icon {
        font-size: 3rem;
        color: #cbd5e1;
        margin-bottom: 14px;
        animation: floatIcon 3s ease-in-out infinite;
    }

    .empty-state p {
        font-size: .8rem;
        color: #94a3b8;
    }

    .empty-state strong {
        color: #64748b;
    }

/* ─── ANIMATIONS ─── */
@keyframes fadeSlideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeSlideUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes shimmerAnim {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

@keyframes rippleAnim {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

@keyframes floatIcon {
    0%, 100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-8px);
    }
}

@keyframes rowIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.result-slide-in {
    animation: fadeSlideUp .4s ease forwards;
}

.btn-run-top.loading {
    pointer-events: none;
    opacity: .75;
}

/* ─── SIDEBAR ACTIVE ANIMATION ─── */
@keyframes sidebarPing {
    0% {
        box-shadow: inset 3px 0 0 var(--primary), 0 0 0 0 rgba(24,170,204,.4);
    }

    70% {
        box-shadow: inset 3px 0 0 var(--primary), 4px 0 0 0 rgba(24,170,204,0);
    }

    100% {
        box-shadow: inset 3px 0 0 var(--primary);
    }
}

.report-item.active {
    animation: sidebarPing .4s ease;
}

/* ─── SCROLLBAR ─── */
::-webkit-scrollbar {
    width: 5px;
    height: 5px;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.select2-container--default .select2-selection--single, .select2-selection .select2-selection--single {
    border-radius: 4px;
    background: #fff;
    border: 1px solid #e5e5e5;
}

.form-control {
    border-radius: 4px;
    background: #fff;
    border: 1px solid #e5e5e5;
}
