*{
    margin:0;
    padding:0;
    box-sizing:border-box;
    font-family:"Poppins",sans-serif;
}

:root{
    --primary:#159447;
    --primary-dark:#0e6e34;
    --primary-light:#e4f5ea;
    --background:#f4f8f5;
    --card:#ffffff;
    --border:#e1e9e3;
    --text:#22301f;
    --muted:#7a8a7e;
    --shadow:0 10px 30px rgba(21,148,71,.08);
    --radius:16px;
}

body{
    background:var(--background);
    color:var(--text);
}

.topbar{
    display:flex;
    justify-content:space-between;
    align-items:center;
    background:linear-gradient(135deg,#0e6e34,#1eb85c);
    color:#fff;
    padding:18px 28px;
    box-shadow:var(--shadow);
    position:sticky;
    top:0;
    z-index:10;
}

.topbar-left{
    display:flex;
    align-items:center;
    gap:14px;
}

.topbar-left img{
    width:44px;
    height:44px;
    border-radius:12px;
    background:rgba(255,255,255,.2);
    object-fit:contain;
    padding:4px;
}

.topbar-left h1{
    font-size:19px;
    font-weight:700;
}

.topbar-left p{
    font-size:12px;
    opacity:.85;
}

.topbar-right{
    display:flex;
    align-items:center;
    gap:10px;
}

.topbar-right label{
    font-size:13px;
    font-weight:600;
    opacity:.9;
}

.topbar-right select{
    height:38px;
    border-radius:10px;
    border:none;
    padding:0 12px;
    outline:none;
    background:#fff;
    color:var(--text);
    font-weight:600;
}

.layout{
    max-width:1300px;
    margin:26px auto;
    padding:0 20px 30px;
    display:grid;
    grid-template-columns:250px 1fr;
    gap:22px;
    align-items:start;
}

.sidebar{
    background:var(--card);
    border-radius:var(--radius);
    box-shadow:var(--shadow);
    padding:20px;
    position:sticky;
    top:88px;
}

.sidebar-title{
    font-size:12px;
    text-transform:uppercase;
    letter-spacing:.06em;
    color:var(--muted);
    font-weight:700;
    margin:18px 0 10px;
}

.sidebar-title:first-child{
    margin-top:0;
}

.komoditas-list,
.jenis-list{
    display:flex;
    flex-direction:column;
    gap:8px;
}

.tab{
    padding:11px 14px;
    border-radius:10px;
    background:transparent;
    border:1px solid transparent;
    cursor:pointer;
    transition:.2s;
    font-weight:600;
    font-size:14px;
    color:var(--text);
}

.tab:hover{
    background:var(--primary-light);
}

.tab.active{
    background:var(--primary);
    color:#fff;
}

.chip{
    padding:10px 14px;
    border-radius:10px;
    background:#f7faf8;
    border:1px solid var(--border);
    cursor:pointer;
    transition:.2s;
    font-size:13px;
    font-weight:600;
    color:var(--text);
}

.chip:hover{
    background:var(--primary-light);
}

.chip.active{
    background:var(--primary-dark);
    color:#fff;
    border-color:var(--primary-dark);
}

.content{
    display:flex;
    flex-direction:column;
    gap:22px;
    min-width:0;
}

.card{
    background:var(--card);
    border-radius:var(--radius);
    box-shadow:var(--shadow);
    padding:22px 24px;
}

.section-title{
    display:flex;
    align-items:center;
    gap:10px;
    margin-bottom:16px;
}

.section-title h2{
    font-size:17px;
    color:var(--primary-dark);
}

.badge{
    background:var(--primary-light);
    color:var(--primary-dark);
    font-size:12px;
    font-weight:700;
    padding:3px 10px;
    border-radius:999px;
}

.upload-card{
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:25px;
}

.upload-left h3{
    margin-bottom:6px;
    color:var(--primary-dark);
    font-size:16px;
}

.upload-left p{
    color:var(--muted);
    font-size:13px;
}

.upload-right{
    display:flex;
    align-items:center;
    gap:12px;
    flex-wrap:wrap;
}

input[type=file]{
    border:1px solid var(--border);
    border-radius:10px;
    padding:9px;
    background:#fbfdfb;
    font-size:13px;
}

button{
    height:42px;
    padding:0 20px;
    border:none;
    border-radius:10px;
    background:var(--primary);
    color:#fff;
    font-weight:600;
    font-size:13px;
    cursor:pointer;
    transition:.2s;
}

button:hover:not(:disabled){
    background:var(--primary-dark);
}

button:disabled{
    opacity:.4;
    cursor:not-allowed;
}

.list{
    display:flex;
    flex-direction:column;
    gap:12px;
    max-height:560px;
    overflow-y:auto;
}

.row{
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:20px;
    padding:16px 18px;
    background:#fafcfa;
    border:1px solid var(--border);
    border-radius:12px;
    transition:.2s;
}

.row:hover{
    border-color:var(--primary);
}

.row .file-name{
    font-weight:600;
    color:var(--text);
    word-break:break-word;
}

.row .file-date{
    color:var(--muted);
    font-size:12px;
    margin-top:2px;
}

.row .file-info{
    flex:1;
    display:flex;
    align-items:center;
    gap:12px;
}

.file-icon{
    width:38px;
    height:38px;
    flex-shrink:0;
    border-radius:9px;
    background:var(--primary-light);
    display:flex;
    align-items:center;
    justify-content:center;
    font-size:17px;
}

.row-actions{
    display:flex;
    gap:8px;
    flex-wrap:wrap;
}

.row-actions button{
    height:36px;
    padding:0 14px;
    font-size:12px;
}

.btn-ghost{
    background:#eef3ef;
    color:var(--text);
}

.btn-ghost:hover:not(:disabled){
    background:#dfe9e2;
}

.btn-danger{
    background:#e3524c;
}

.btn-danger:hover:not(:disabled){
    background:#c73f3a;
}

.empty{
    text-align:center;
    padding:44px 20px;
    color:var(--muted);
    font-size:14px;
}

.modal{
    position:fixed;
    inset:0;
    display:none;
    justify-content:center;
    align-items:center;
    background:rgba(0,0,0,.45);
    backdrop-filter:blur(4px);
    z-index:999;
}

.modal-box{
    width:90%;
    max-width:380px;
    background:#fff;
    border-radius:18px;
    padding:28px;
}

.modal-box h3{
    margin-bottom:14px;
    color:var(--primary-dark);
}

.modal-box p{
    line-height:1.7;
    color:var(--muted);
}

.modal-actions{
    display:flex;
    justify-content:flex-end;
    gap:10px;
    margin-top:24px;
}

.btn-secondary{
    background:#95a5a6;
}

.btn-secondary:hover{
    background:#7f8c8d;
}

.loading-overlay{
    position:fixed;
    inset:0;
    display:none;
    justify-content:center;
    align-items:center;
    background:rgba(255,255,255,.5);
    backdrop-filter:blur(5px);
    z-index:1000;
}

.loading-box{
    background:#fff;
    padding:28px 40px;
    border-radius:18px;
    box-shadow:var(--shadow);
    display:flex;
    flex-direction:column;
    align-items:center;
    gap:18px;
}

.spinner{
    width:44px;
    height:44px;
    border:4px solid #d9e9de;
    border-top:4px solid var(--primary);
    border-radius:50%;
    animation:spin .8s linear infinite;
}

@keyframes spin{
    to{ transform:rotate(360deg); }
}

::-webkit-scrollbar{
    width:8px;
}

::-webkit-scrollbar-thumb{
    background:var(--primary);
    border-radius:20px;
}

::-webkit-scrollbar-track{
    background:#e7efe9;
}

@media(max-width:900px){

    .layout{
        grid-template-columns:1fr;
    }

    .sidebar{
        position:static;
        display:flex;
        gap:24px;
        overflow-x:auto;
    }

    .sidebar > div{
        flex:1;
        min-width:200px;
    }
}

@media(max-width:640px){

    .topbar{
        flex-direction:column;
        align-items:flex-start;
        gap:12px;
    }

    .topbar-right{
        width:100%;
    }

    .topbar-right select{
        flex:1;
    }

    .sidebar{
        flex-direction:column;
    }

    .upload-card{
        flex-direction:column;
        align-items:flex-start;
    }

    .upload-right{
        width:100%;
        flex-direction:column;
        align-items:stretch;
    }

    input[type=file]{
        width:100%;
    }

    .upload-right button{
        width:100%;
    }

    .row{
        flex-direction:column;
        align-items:flex-start;
    }

    .row-actions{
        width:100%;
    }

    .row-actions button{
        flex:1;
    }
}
