* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: #f4f6f8;
    color: #1f2937;
}
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 230px;
    height: 100vh;
    background: #111827;
    padding: 20px 14px;
}
.brand {
    color: #fff;
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 24px;
    padding: 0 10px;
}
.sidebar a {
    display: block;
    color: #cbd5e1;
    text-decoration: none;
    padding: 12px 14px;
    margin-bottom: 8px;
    border-radius: 10px;
    font-weight: 600;
}
.sidebar a:hover, .sidebar a.active {
    background: #2563eb;
    color: #fff;
}
.main {
    margin-left: 230px;
    padding: 26px;
}
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 18px;
}
h1 { margin: 0; font-size: 26px; }
.card {
    background: #fff;
    border-radius: 14px;
    padding: 18px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, .08);
    margin-bottom: 18px;
}
.grid-form {
    display: grid;
    grid-template-columns: repeat(3, minmax(180px, 1fr));
    gap: 14px;
}
label { font-weight: 700; font-size: 13px; color: #374151; }
input, select, textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    margin-top: 6px;
    font-size: 14px;
}
textarea { min-height: 42px; resize: vertical; }
.form-actions { grid-column: 1 / -1; display: flex; gap: 10px; }
.btn {
    border: 0;
    background: #2563eb;
    color: #fff;
    padding: 10px 14px;
    border-radius: 10px;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
}
.btn.secondary { background: #64748b; }
.btn.danger { background: #dc2626; }
.table-wrap { overflow-x: auto; }
table {
    width: 100%;
    border-collapse: collapse;
    min-width: 820px;
}
th, td {
    padding: 12px 10px;
    border-bottom: 1px solid #e5e7eb;
    text-align: left;
    vertical-align: top;
}
th {
    background: #f8fafc;
    color: #334155;
    font-size: 13px;
    text-transform: uppercase;
}
.number { text-align: right; white-space: nowrap; }
.badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 999px;
    background: #e0f2fe;
    color: #075985;
    font-weight: 700;
    font-size: 12px;
}
.badge.danger { background: #fee2e2; color: #991b1b; }
.alert {
    padding: 12px 14px;
    border-radius: 12px;
    margin-bottom: 14px;
    font-weight: 700;
}
.alert.success { background: #dcfce7; color: #166534; }
.alert.error { background: #fee2e2; color: #991b1b; }
.summary-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-bottom: 18px;
}
.summary-card {
    background: #fff;
    border-radius: 14px;
    padding: 16px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, .08);
}
.summary-card span { color: #64748b; font-size: 13px; font-weight: 700; }
.summary-card strong { display: block; margin-top: 6px; font-size: 22px; }
@media (max-width: 900px) {
    .sidebar { position: static; width: 100%; height: auto; }
    .main { margin-left: 0; padding: 16px; }
    .grid-form, .summary-grid { grid-template-columns: 1fr; }
}

.import-form {
    display: grid;
    grid-template-columns: minmax(240px, 1fr);
    gap: 14px;
}
.muted {
    color: #64748b;
    line-height: 1.5;
    margin-top: 0;
}
h3 {
    margin: 0 0 14px;
    font-size: 18px;
}

.user-box {
    color: #e5e7eb;
    background: rgba(255,255,255,.08);
    border-radius: 12px;
    padding: 10px 12px;
    margin: 0 0 14px;
}
.user-box strong { display:block; font-size: 14px; }
.user-box span { display:block; margin-top: 4px; font-size: 12px; color:#cbd5e1; }
.login-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #111827;
    padding: 18px;
}
.login-card {
    width: 100%;
    max-width: 420px;
    background: #fff;
    border-radius: 18px;
    padding: 24px;
    box-shadow: 0 20px 60px rgba(0,0,0,.25);
}
.login-card h1 { margin-bottom: 6px; }
.login-card p { color: #64748b; }
.btn.full { width: 100%; text-align: center; margin-top: 14px; }
.small { font-size: 12px; }
.danger-zone { border: 1px solid #fecaca; }

.filter-form { display: grid; grid-template-columns: repeat(4, minmax(160px, 1fr)); gap: 14px; align-items: end; }
.letters { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.letters a { padding: 6px 9px; border-radius: 8px; background: #f1f5f9; color: #334155; text-decoration: none; font-weight: 700; font-size: 13px; }
.letters a.active, .letters a:hover { background: #2563eb; color: #fff; }
.badge.success { background: #dcfce7; color: #166534; }
.badge.warning { background: #fef3c7; color: #92400e; }
.summary-card.warning { border-left: 5px solid #f59e0b; }
.summary-card.danger { border-left: 5px solid #dc2626; }
@media (max-width: 900px) { .filter-form { grid-template-columns: 1fr; } }

.dashboard-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 18px;
    align-items: start;
}
.link-card {
    text-decoration: none;
    color: inherit;
    transition: transform .15s ease, box-shadow .15s ease;
}
.link-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 32px rgba(15, 23, 42, .12);
}
.summary-card.success { border-left: 5px solid #16a34a; }
.section-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    margin-bottom: 14px;
}
.section-head h3 { margin: 0; }
@media (max-width: 1100px) {
    .dashboard-grid { grid-template-columns: 1fr; }
}

/* v1.7 Mobile Gudang */
.mobile-header {
    display: none;
    position: sticky;
    top: 0;
    z-index: 1000;
    background: #111827;
    color: #fff;
    padding: 12px 14px;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 8px 24px rgba(15, 23, 42, .18);
}
.mobile-brand {
    font-weight: 800;
    font-size: 16px;
}
.menu-toggle {
    border: 0;
    background: #2563eb;
    color: #fff;
    border-radius: 10px;
    padding: 10px 12px;
    font-weight: 800;
    cursor: pointer;
}
.sidebar-overlay {
    display: none;
}
body.menu-open { overflow: hidden; }

@media (max-width: 900px) {
    body { background: #f8fafc; }
    .mobile-header { display: flex; }
    .sidebar {
        position: fixed;
        left: -280px;
        top: 0;
        width: 270px;
        height: 100vh;
        z-index: 1100;
        overflow-y: auto;
        transition: left .2s ease;
        box-shadow: 12px 0 32px rgba(15, 23, 42, .24);
    }
    body.menu-open .sidebar { left: 0; }
    .sidebar-overlay {
        display: none;
        position: fixed;
        inset: 0;
        z-index: 1050;
        background: rgba(15, 23, 42, .55);
    }
    body.menu-open .sidebar-overlay { display: block; }
    .brand { margin-bottom: 14px; }
    .sidebar a {
        padding: 14px 14px;
        font-size: 15px;
    }
    .main {
        margin-left: 0;
        padding: 14px;
    }
    .page-header {
        align-items: flex-start;
        flex-direction: column;
        gap: 10px;
    }
    h1 { font-size: 22px; line-height: 1.25; }
    h3 { font-size: 17px; }
    .card {
        padding: 14px;
        border-radius: 14px;
        margin-bottom: 14px;
    }
    .grid-form,
    .import-form,
    .filter-form {
        grid-template-columns: 1fr !important;
        gap: 12px;
    }
    .form-actions {
        flex-direction: column;
    }
    .btn,
    button.btn,
    a.btn {
        width: 100%;
        text-align: center;
        padding: 13px 14px;
        font-size: 15px;
    }
    input,
    select,
    textarea {
        font-size: 16px;
        padding: 12px 12px;
    }
    .summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 12px;
    }
    .summary-card {
        padding: 14px;
    }
    .summary-card strong {
        font-size: 20px;
    }
    .dashboard-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }
    .section-head {
        flex-direction: column;
        align-items: stretch;
    }
    .table-wrap {
        margin-left: -4px;
        margin-right: -4px;
        padding-bottom: 8px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    table {
        min-width: 760px;
        font-size: 13px;
    }
    th,
    td {
        padding: 10px 8px;
    }
    .number { text-align: left; }
    .alert {
        font-size: 14px;
        line-height: 1.4;
    }
}

@media (max-width: 520px) {
    .summary-grid {
        grid-template-columns: 1fr 1fr !important;
    }
    .summary-card span {
        font-size: 12px;
    }
    .summary-card strong {
        font-size: 18px;
    }
    table {
        min-width: 700px;
    }
}
