/* =========================================================
   LUXION POS
   SALES & SURAT JALAN
   ========================================================= */

* {
    box-sizing: border-box;
}

:root {
    --bg: #f4f7fb;
    --surface: #ffffff;
    --surface-soft: #f8fafc;

    --text: #172033;
    --text-soft: #5f697a;
    --muted: #8a93a3;

    --line: #e5eaf1;

    --primary: #2864ff;
    --primary-dark: #1749d2;

    --green: #10a36a;
    --amber: #d99100;
    --red: #df5353;
    --purple: #7657d9;

    --shadow-sm:
        0 6px 20px rgba(31, 48, 82, 0.05);

    --shadow:
        0 14px 40px rgba(31, 48, 82, 0.07);

    --radius: 20px;
}


/* =========================================================
   BODY
   ========================================================= */

body {
    margin: 0;

    min-height: 100vh;

    background:
        radial-gradient(
            circle at 85% 0%,
            rgba(40, 100, 255, 0.08),
            transparent 28%
        ),
        radial-gradient(
            circle at 0% 50%,
            rgba(118, 87, 217, 0.04),
            transparent 25%
        ),
        var(--bg);

    color: var(--text);

    font-family:
        "Inter",
        Arial,
        sans-serif;
}


/* =========================================================
   APP CONTAINER
   ========================================================= */

.app-shell {
    width: 100%;
    max-width: 1450px;

    margin: 0 auto;

    padding: 30px 32px 70px;
}


/* =========================================================
   TYPOGRAPHY
   ========================================================= */

h1,
h2,
h3 {
    margin: 0;

    font-family:
        "Space Grotesk",
        "Inter",
        Arial,
        sans-serif;
}

h1 {
    margin-top: 5px;

    font-size: 32px;
    line-height: 1.15;

    letter-spacing: -1px;
}

h2 {
    margin-top: 5px;

    font-size: 22px;
    line-height: 1.2;

    letter-spacing: -0.3px;
}

h3 {
    font-size: 20px;
}

.eyebrow,
.section-kicker {
    font-size: 10px;
    font-weight: 800;

    letter-spacing: 2px;

    color: var(--primary);
}


/* =========================================================
   HEADER
   ========================================================= */

.topbar {
    display: flex;

    justify-content: space-between;
    align-items: flex-end;

    gap: 25px;

    margin-bottom: 28px;
}

.page-title p {
    margin: 8px 0 0;

    color: var(--muted);

    font-size: 13px;

    line-height: 1.6;
}

.top-actions {
    display: flex;

    align-items: center;

    gap: 10px;
}


/* =========================================================
   DATE CHIP
   ========================================================= */

.today-chip {
    display: flex;

    align-items: center;

    gap: 7px;

    min-height: 42px;

    padding: 0 15px;

    background: rgba(255, 255, 255, 0.9);

    border: 1px solid var(--line);

    border-radius: 999px;

    color: var(--text-soft);

    font-size: 11px;
    font-weight: 700;

    box-shadow: var(--shadow-sm);

    white-space: nowrap;
}

.status-dot {
    width: 7px;
    height: 7px;

    border-radius: 50%;

    background: var(--green);

    box-shadow:
        0 0 0 4px rgba(16, 163, 106, 0.1);
}


/* =========================================================
   BUTTON
   ========================================================= */

.btn {
    min-height: 42px;

    padding: 0 16px;

    border: 0;

    border-radius: 11px;

    font-size: 12px;
    font-weight: 700;

    transition:
        transform 0.18s ease,
        box-shadow 0.18s ease,
        background 0.18s ease;

    cursor: pointer;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    color: #ffffff;

    background:
        linear-gradient(
            135deg,
            var(--primary),
            var(--primary-dark)
        );

    box-shadow:
        0 8px 20px rgba(40, 100, 255, 0.22);
}

.btn-primary:hover {
    box-shadow:
        0 12px 25px rgba(40, 100, 255, 0.28);
}

.btn-secondary {
    color: #394355;

    background: #ffffff;

    border: 1px solid var(--line);
}

.btn-secondary:hover {
    border-color: #cbd5e5;

    background: #f9fbff;
}


/* =========================================================
   STATISTICS
   ========================================================= */

.stats-grid {
    display: grid;

    grid-template-columns:
        repeat(4, minmax(0, 1fr));

    gap: 15px;

    margin-bottom: 18px;
}

.stat-card {
    display: flex;

    align-items: center;

    gap: 13px;

    min-height: 88px;

    padding: 17px 18px;

    background:
        rgba(255, 255, 255, 0.92);

    border: 1px solid var(--line);

    border-radius: 18px;

    box-shadow: var(--shadow);
}

.stat-card span {
    display: block;

    margin-bottom: 5px;

    color: var(--muted);

    font-size: 10px;
    font-weight: 600;
}

.stat-card strong {
    display: block;

    font-size: 18px;
    font-weight: 800;

    letter-spacing: -0.3px;
}

.stat-icon {
    width: 43px;
    height: 43px;

    flex: 0 0 43px;

    display: grid;

    place-items: center;

    border-radius: 13px;

    font-size: 12px;
    font-weight: 800;
}

.stat-icon.blue {
    color: var(--primary);
    background: #eaf0ff;
}

.stat-icon.amber {
    color: var(--amber);
    background: #fff5dd;
}

.stat-icon.green {
    color: var(--green);
    background: #e5f8f0;
}

.stat-icon.purple {
    color: var(--purple);
    background: #eeeaff;
}


/* =========================================================
   PANEL
   ========================================================= */

.panel {
    margin-bottom: 18px;

    padding: 23px;

    background:
        rgba(255, 255, 255, 0.95);

    border: 1px solid var(--line);

    border-radius: var(--radius);

    box-shadow: var(--shadow);
}

.panel-head {
    display: flex;

    justify-content: space-between;
    align-items: center;

    gap: 20px;

    margin-bottom: 20px;
}

.head-actions {
    display: flex;

    align-items: center;

    gap: 9px;
}

.panel-desc {
    margin: 7px 0 0;

    color: var(--muted);

    font-size: 12px;

    line-height: 1.5;
}


/* =========================================================
   TOOLBAR
   ========================================================= */

.toolbar {
    display: flex;

    align-items: center;

    gap: 10px;

    margin-bottom: 15px;
}

.search-box {
    display: flex;

    align-items: center;

    gap: 8px;

    width: 100%;
    max-width: 500px;

    height: 42px;

    padding: 0 12px;

    background: var(--surface-soft);

    border: 1px solid var(--line);

    border-radius: 11px;

    transition:
        border-color 0.18s ease,
        box-shadow 0.18s ease;
}

.search-box:focus-within {
    border-color: #a9bfff;

    box-shadow:
        0 0 0 3px rgba(40, 100, 255, 0.07);
}

.search-box span {
    color: #9aa3b3;

    font-size: 20px;
}

.search-box input {
    width: 100%;

    padding: 0;

    border: 0;

    outline: 0;

    background: transparent;

    color: var(--text);

    font-size: 12px;
}

.search-box input::placeholder {
    color: #a0a8b6;
}

.toolbar > select {
    height: 42px;

    padding: 0 12px;

    border: 1px solid var(--line);

    border-radius: 10px;

    outline: none;

    background: #ffffff;

    color: var(--text-soft);

    font-size: 12px;

    cursor: pointer;
}


/* =========================================================
   TABLE
   ========================================================= */

.table-wrap {
    width: 100%;

    overflow-x: auto;

    border: 1px solid var(--line);

    border-radius: 14px;
}

table {
    width: 100%;

    min-width: 850px;

    border-collapse: collapse;
}

thead th {
    padding: 13px 15px;

    background: #f8fafc;

    color: #7b8496;

    border-bottom: 1px solid var(--line);

    text-align: left;

    font-size: 9px;
    font-weight: 800;

    letter-spacing: 0.8px;

    text-transform: uppercase;

    white-space: nowrap;
}

tbody td {
    padding: 14px 15px;

    border-bottom: 1px solid #edf0f5;

    color: var(--text-soft);

    font-size: 12px;

    vertical-align: middle;
}

tbody tr:last-child td {
    border-bottom: 0;
}

tbody tr {
    transition: background 0.15s ease;
}

tbody tr:hover {
    background: #fafcff;
}

tbody td strong {
    color: var(--text);

    font-weight: 700;
}


/* =========================================================
   STATUS BADGE
   ========================================================= */

.badge {
    display: inline-flex;

    align-items: center;

    padding: 5px 9px;

    border-radius: 999px;

    font-size: 9px;
    font-weight: 800;
}

.badge-unpaid {
    color: var(--red);

    background: #fff0f0;
}

.badge-partial {
    color: var(--amber);

    background: #fff5dd;
}


/* =========================================================
   CUSTOMER LIST
   ========================================================= */

.customer-list {
    display: grid;

    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    gap: 10px;
}

.customer-row {
    display: flex;

    align-items: center;

    gap: 13px;

    padding: 14px;

    background: #ffffff;

    border: 1px solid var(--line);

    border-radius: 14px;

    cursor: pointer;

    transition:
        border-color 0.18s ease,
        background 0.18s ease,
        box-shadow 0.18s ease,
        transform 0.18s ease;
}

.customer-row:hover {
    border-color: #cad6f3;

    box-shadow:
        0 7px 20px rgba(25, 45, 90, 0.05);

    transform: translateY(-1px);
}

.customer-row.selected {
    background: #f3f6ff;

    border-color: #9fb6ff;

    box-shadow:
        0 8px 20px rgba(40, 100, 255, 0.06);
}

.customer-row input[type="checkbox"] {
    width: 17px;
    height: 17px;

    flex: 0 0 17px;

    accent-color: var(--primary);

    cursor: pointer;
}

.customer-info {
    flex: 1;

    min-width: 0;
}

.customer-info strong {
    display: block;

    margin-bottom: 4px;

    color: var(--text);

    font-size: 13px;
}

.customer-info span {
    display: block;

    color: var(--muted);

    font-size: 10px;
}

.customer-debt {
    text-align: right;
}

.customer-debt strong {
    display: block;

    margin-bottom: 4px;

    color: var(--text);

    font-size: 13px;
}

.customer-debt span {
    display: block;

    color: var(--muted);

    font-size: 9px;
}


/* =========================================================
   SELECT ALL
   ========================================================= */

.select-all {
    display: flex;

    align-items: center;

    gap: 8px;

    margin-left: auto;

    color: var(--text-soft);

    font-size: 11px;
    font-weight: 600;

    cursor: pointer;
}

.select-all input {
    width: 16px;
    height: 16px;

    accent-color: var(--primary);

    cursor: pointer;
}


/* =========================================================
   SELECTION SUMMARY
   ========================================================= */

.selection-summary {
    min-width: 105px;

    padding: 9px 13px;

    text-align: right;

    background: #f3f6ff;

    border: 1px solid #dbe4ff;

    border-radius: 12px;
}

.selection-summary strong {
    display: block;

    color: var(--primary);

    font-size: 17px;
    font-weight: 800;
}

.selection-summary span {
    display: block;

    margin-top: 2px;

    color: var(--muted);

    font-size: 9px;
}


/* =========================================================
   EMPTY STATE
   ========================================================= */

.empty-state {
    padding: 55px 20px;

    text-align: center;

    border: 1px dashed #d5dce8;

    border-radius: 15px;

    color: var(--muted);
}

.empty-icon {
    width: 48px;
    height: 48px;

    display: grid;

    place-items: center;

    margin: 0 auto 13px;

    border-radius: 14px;

    background: #edf2ff;

    color: var(--primary);

    font-size: 12px;
    font-weight: 800;
}

.empty-state h3 {
    margin: 0 0 7px;

    color: var(--text);

    font-size: 16px;
}

.empty-state p {
    margin: 0;

    font-size: 11px;
}


/* =========================================================
   SURAT JALAN PREVIEW
   ========================================================= */

.sj-document {
    padding: 34px;

    background: #ffffff;

    border: 1px solid #dfe4eb;

    border-radius: 12px;
}

.sj-head {
    display: flex;

    justify-content: space-between;
    align-items: flex-start;

    gap: 20px;

    padding-bottom: 18px;

    margin-bottom: 22px;

    border-bottom: 2px solid #182238;
}

.sj-brand {
    color: #182238;

    font-family:
        "Space Grotesk",
        sans-serif;

    font-size: 20px;
    font-weight: 800;
}

.sj-title {
    text-align: right;
}

.sj-title h3 {
    color: #182238;

    font-size: 22px;

    letter-spacing: 1px;
}

.sj-meta {
    margin-top: 5px;

    color: #697386;

    font-size: 10px;
}

.sj-table {
    min-width: 850px;
}

.sj-table th {
    padding: 11px 12px;

    background: #182238;

    color: #ffffff;

    font-size: 9px;
}

.sj-table td {
    padding: 12px;

    vertical-align: top;
}

.payment-cell {
    width: 120px;
    min-width: 120px;

    height: 32px;

    border-bottom: 1px dashed #c9d0dc;
}

.note-cell {
    width: 130px;
    min-width: 130px;

    height: 32px;

    border-bottom: 1px dashed #c9d0dc;
}

.sj-footer {
    display: flex;

    justify-content: space-between;

    gap: 20px;

    margin-top: 30px;

    color: #687286;

    font-size: 10px;
}

.sign-box {
    width: 180px;

    text-align: center;
}

.sign-line {
    margin-top: 45px;

    padding-top: 7px;

    border-top: 1px solid #7b8496;
}


/* =========================================================
   MODAL
   ========================================================= */

.modal-backdrop {
    position: fixed;

    inset: 0;

    z-index: 999;

    display: none;

    align-items: center;
    justify-content: center;

    padding: 20px;

    background:
        rgba(14, 22, 38, 0.55);

    backdrop-filter: blur(6px);
}

.modal-backdrop.show {
    display: flex;
}

.modal {
    width: min(620px, 100%);

    max-height: calc(100vh - 40px);

    overflow-y: auto;

    background: #ffffff;

    border: 1px solid rgba(255, 255, 255, 0.4);

    border-radius: 22px;

    box-shadow:
        0 30px 80px rgba(0, 0, 0, 0.22);

    animation:
        modalIn 0.2s ease;
}

@keyframes modalIn {

    from {
        opacity: 0;
        transform: translateY(10px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }

}

.modal-head {
    display: flex;

    justify-content: space-between;
    align-items: center;

    gap: 15px;

    padding: 22px 24px;

    border-bottom: 1px solid var(--line);
}

.close-btn {
    width: 34px;
    height: 34px;

    display: grid;

    place-items: center;

    padding: 0;

    border: 1px solid var(--line);

    border-radius: 10px;

    background: #ffffff;

    color: #70798a;

    font-size: 22px;

    line-height: 1;

    cursor: pointer;

    transition:
        background 0.15s ease,
        color 0.15s ease;
}

.close-btn:hover {
    background: #f4f6fa;

    color: var(--text);
}


/* =========================================================
   FORM
   ========================================================= */

form {
    padding: 22px 24px;
}

.form-grid {
    display: grid;

    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    gap: 15px;
}

.form-grid label {
    display: flex;

    flex-direction: column;

    gap: 7px;

    color: #697386;

    font-size: 10px;
    font-weight: 700;
}

.form-grid input,
.form-grid select,
.form-grid textarea {
    width: 100%;

    padding: 11px 12px;

    outline: none;

    border: 1px solid var(--line);

    border-radius: 10px;

    background: #ffffff;

    color: var(--text);

    font-size: 12px;

    transition:
        border-color 0.18s ease,
        box-shadow 0.18s ease;
}

.form-grid input:focus,
.form-grid select:focus,
.form-grid textarea:focus {
    border-color: #9eb5ff;

    box-shadow:
        0 0 0 3px rgba(40, 100, 255, 0.07);
}

.form-grid textarea {
    resize: vertical;

    min-height: 80px;
}

.full {
    grid-column: 1 / -1;
}


/* =========================================================
   MODAL FOOTER
   ========================================================= */

.modal-foot {
    display: flex;

    justify-content: flex-end;

    gap: 9px;

    margin-top: 20px;

    padding-top: 18px;

    border-top: 1px solid #edf0f5;
}


/* =========================================================
   HIDDEN
   ========================================================= */

.hidden {
    display: none !important;
}


/* =========================================================
   SCROLLBAR
   ========================================================= */

::-webkit-scrollbar {
    width: 7px;
    height: 7px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #cdd4df;

    border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
    background: #adb7c6;
}


/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 1000px) {

    .stats-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

    .topbar {
        align-items: flex-start;

        flex-direction: column;
    }

    .top-actions {
        width: 100%;
    }

}


@media (max-width: 800px) {

    .customer-list {
        grid-template-columns: 1fr;
    }

}


@media (max-width: 650px) {

    .app-shell {
        padding:
            20px
            14px
            50px;
    }

    h1 {
        font-size: 27px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .panel {
        padding: 17px;
    }

    .panel-head {
        align-items: flex-start;

        flex-direction: column;
    }

    .head-actions {
        width: 100%;
    }

    .head-actions .btn {
        flex: 1;
    }

    .toolbar {
        align-items: stretch;

        flex-wrap: wrap;
    }

    .search-box {
        max-width: none;
    }

    .select-all {
        margin-left: 0;
    }

    .top-actions {
        align-items: stretch;

        flex-wrap: wrap;
    }

    .today-chip {
        flex: 1;

        justify-content: center;
    }

    .top-actions .btn {
        flex: 1;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .full {
        grid-column: auto;
    }

    .sj-document {
        padding: 20px;
    }

}

/* =========================================================
   PAYMENT SEARCH
   ========================================================= */

.payment-search-box {
    display: flex;

    align-items: center;

    gap: 8px;

    width: 100%;

    height: 44px;

    padding: 0 12px;

    background: #f8fafc;

    border: 1px solid var(--line);

    border-radius: 11px;

    transition:
        border-color .18s ease,
        box-shadow .18s ease;
}

.payment-search-box:focus-within {
    border-color: #9eb5ff;

    box-shadow:
        0 0 0 3px rgba(40, 100, 255, .07);
}

.payment-search-box span {
    color: #9aa3b3;

    font-size: 20px;
}

.payment-search-box input {
    width: 100%;

    border: 0;

    outline: 0;

    background: transparent;

    color: var(--text);

    font-size: 12px;
}

.payment-search-box input::placeholder {
    color: #a0a8b6;
}


/* =========================================================
   PAYMENT DEBT LIST
   ========================================================= */

.payment-debt-list {
    display: flex;

    flex-direction: column;

    gap: 8px;

    max-height: 220px;

    overflow-y: auto;

    margin-top: -5px;
}

.payment-debt-item {
    display: flex;

    align-items: center;

    justify-content: space-between;

    gap: 15px;

    padding: 12px 14px;

    background: #ffffff;

    border: 1px solid var(--line);

    border-radius: 12px;

    cursor: pointer;

    transition:
        background .15s ease,
        border-color .15s ease,
        transform .15s ease;
}

.payment-debt-item:hover {
    background: #f4f7ff;

    border-color: #aec0f7;

    transform: translateY(-1px);
}

.payment-debt-item.active {
    background: #eef3ff;

    border-color: var(--primary);
}

.payment-debt-info {
    min-width: 0;
}

.payment-debt-info strong {
    display: block;

    margin-bottom: 4px;

    color: var(--text);

    font-size: 12px;
}

.payment-debt-info span {
    display: block;

    color: var(--muted);

    font-size: 10px;
}

.payment-debt-amount {
    flex-shrink: 0;

    text-align: right;
}

.payment-debt-amount strong {
    display: block;

    color: var(--text);

    font-size: 12px;
}

.payment-debt-amount span {
    display: block;

    margin-top: 3px;

    color: var(--red);

    font-size: 9px;
    font-weight: 700;
}

.payment-selected {
    padding: 10px 12px;

    background: #eaf0ff;

    border: 1px solid #c9d7ff;

    border-radius: 10px;

    color: var(--primary);

    font-size: 11px;
    font-weight: 700;
}
/* =========================================================
   AKSI HUTANG
========================================================= */

.debt-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-action {
    border: none;
    border-radius: 8px;
    padding: 7px 12px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s ease;
}

.btn-edit-debt {
    background: #eef4ff;
    color: #2563eb;
}

.btn-edit-debt:hover {
    background: #dbe8ff;
}

.btn-delete-debt {
    background: #fff0f0;
    color: #dc2626;
}

.btn-delete-debt:hover {
    background: #ffe0e0;
}
/* =========================================================
   RESPONSIVE MOBILE - SALES & SURAT JALAN
   ========================================================= */

@media (max-width: 768px) {

    /* =========================
       GLOBAL
    ========================== */

    * {
        box-sizing: border-box;
    }

    body {
        overflow-x: hidden;
    }

    .app-shell {
        width: 100%;
        max-width: 100%;
        padding: 14px;
    }


    /* =========================
       HEADER
    ========================== */

    .topbar {
        flex-direction: column;
        align-items: stretch;
        gap: 16px;
    }

    .page-title h1 {
        font-size: 24px;
        line-height: 1.2;
    }

    .page-title p {
        font-size: 13px;
        line-height: 1.5;
    }

    .top-actions {
        width: 100%;
        display: flex;
        flex-direction: column;
        gap: 10px;
    }

    .today-chip {
        width: 100%;
        justify-content: center;
    }

    .top-actions .btn {
        width: 100%;
    }


    /* =========================
       STATISTIK
    ========================== */

    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .stat-card {
        padding: 14px;
        min-width: 0;
    }

    .stat-card span {
        font-size: 11px;
    }

    .stat-card strong {
        font-size: 15px;
    }

    .stat-icon {
        width: 34px;
        height: 34px;
        min-width: 34px;
        font-size: 12px;
    }


    /* =========================
       PANEL
    ========================== */

    .panel {
        width: 100%;
        padding: 16px;
        overflow: hidden;
    }

    .panel-head {
        flex-direction: column;
        align-items: stretch;
        gap: 14px;
    }

    .panel-head h2 {
        font-size: 20px;
    }

    .panel-desc {
        font-size: 12px;
    }


    /* =========================
       BUTTON PANEL
    ========================== */

    .head-actions {
        width: 100%;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .head-actions .btn {
        width: 100%;
        padding: 10px 8px;
        font-size: 12px;
    }


    /* =========================
       TOOLBAR
    ========================== */

    .toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .search-box {
        width: 100%;
    }

    .search-box input {
        width: 100%;
        min-width: 0;
    }

    .toolbar select {
        width: 100%;
    }

    .select-all {
        width: 100%;
        justify-content: flex-start;
    }


    /* =========================
       TABLE HUTANG
    ========================== */

    .table-wrap {
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .table-wrap table {
        min-width: 850px;
    }

    .table-wrap th,
    .table-wrap td {
        white-space: nowrap;
    }


    /* =========================
       TOMBOL EDIT / HAPUS
    ========================== */

    .debt-actions {
        display: flex;
        gap: 6px;
        white-space: nowrap;
    }

    .btn-action {
        padding: 7px 10px;
        font-size: 11px;
        white-space: nowrap;
    }


    /* =========================
       CUSTOMER LIST
    ========================== */

    .customer-list {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .customer-row {
        width: 100%;
        padding: 13px;
    }

    .customer-info {
        min-width: 0;
    }

    .customer-info strong {
        font-size: 13px;
    }

    .customer-info span {
        font-size: 11px;
    }

    .customer-debt {
        text-align: right;
    }

    .customer-debt strong {
        font-size: 12px;
    }

    .customer-debt span {
        font-size: 10px;
    }


    /* =========================
       PREVIEW SURAT JALAN
    ========================== */

    .preview-panel {
        overflow: hidden;
    }

    .preview-panel .panel-head {
        gap: 10px;
    }

    .preview-panel .panel-head .btn {
        width: 100%;
    }

    .sj-document {
        width: 100%;
        overflow-x: auto;
    }

    .sj-head {
        min-width: 700px;
    }

    .sj-document .table-wrap {
        overflow-x: auto;
    }

    .sj-table {
        min-width: 900px;
    }


    /* =========================
       MODAL
    ========================== */

    .modal-backdrop {
        padding: 12px;
        align-items: flex-start;
        overflow-y: auto;
    }

    .modal {
        width: 100%;
        max-width: 100%;
        margin: 20px 0;
        max-height: calc(100vh - 40px);
        overflow-y: auto;
    }

    .modal-head {
        padding: 16px;
    }

    .modal-head h3 {
        font-size: 18px;
    }

    .form-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .form-grid label {
        width: 100%;
    }

    .form-grid .full {
        grid-column: 1;
    }

    .modal-foot {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .modal-foot .btn {
        width: 100%;
    }


    /* =========================
       PAYMENT SEARCH
    ========================== */

    .payment-search-box {
        width: 100%;
    }

    .payment-debt-list {
        width: 100%;
        max-height: 250px;
        overflow-y: auto;
    }

    .payment-debt-item {
        padding: 12px;
        gap: 10px;
    }

    .payment-debt-info {
        min-width: 0;
    }

    .payment-debt-info strong {
        font-size: 13px;
    }

    .payment-debt-info span {
        font-size: 10px;
    }

    .payment-debt-amount {
        white-space: nowrap;
    }

    .payment-debt-amount strong {
        font-size: 12px;
    }


    /* =========================
       EMPTY STATE
    ========================== */

    .empty-state {
        padding: 30px 15px;
    }

    .empty-state h3 {
        font-size: 17px;
    }

    .empty-state p {
        font-size: 12px;
    }

}


/* =========================================================
   HP KECIL
   ========================================================= */

@media (max-width: 480px) {

    .app-shell {
        padding: 10px;
    }

    .page-title h1 {
        font-size: 21px;
    }

    .page-title p {
        font-size: 12px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .stat-card {
        display: flex;
        align-items: center;
        gap: 12px;
    }

    .panel {
        padding: 13px;
        border-radius: 14px;
    }

    .panel-head h2 {
        font-size: 18px;
    }

    .head-actions {
        grid-template-columns: 1fr;
    }

    .head-actions .btn {
        padding: 11px;
    }

    .modal {
        margin: 10px 0;
    }

    .modal-foot {
        grid-template-columns: 1fr;
    }

}

/* =========================================================
   PRINT SURAT JALAN - A4 1 HALAMAN
   ========================================================= */
@media print {

    @page {
        size: A4 portrait;
        margin: 8mm;
    }

    html,
    body {
        width: 100% !important;
        height: auto !important;
        min-height: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        background: #fff !important;
        overflow: visible !important;
    }

    /* SEMBUNYIKAN SEMUA ELEMEN */
    body > * {
        display: none !important;
    }

    /* TAMPILKAN APP SHELL */
    .app-shell {
        display: block !important;
        width: 100% !important;
        max-width: none !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    /* SEMBUNYIKAN SEMUA ISI APP SHELL */
    .app-shell > * {
        display: none !important;
    }

    /* HANYA PREVIEW YANG DITAMPILKAN */
    .app-shell .preview-panel {
        display: block !important;
        position: static !important;
        width: 100% !important;
        max-width: none !important;
        margin: 0 !important;
        padding: 0 !important;
        border: none !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        overflow: visible !important;
    }

    /* HILANGKAN HEADER PANEL */
    .preview-panel .panel-head {
        display: none !important;
    }

    #emptyPreview,
    #btnPrintPreview {
        display: none !important;
    }

    /* DOKUMEN SURAT JALAN */
    #suratJalanPreview {
        display: block !important;
        position: static !important;
        width: 100% !important;
        max-width: none !important;
        min-width: 0 !important;
        height: auto !important;
        min-height: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        border: none !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        overflow: visible !important;
    }

    .sj-document {
        display: block !important;
        width: 100% !important;
        max-width: none !important;
        min-width: 0 !important;
        height: auto !important;
        min-height: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        border: none !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        overflow: visible !important;
    }

    /* HEADER SURAT JALAN */
    .sj-head {
        display: flex !important;
        width: 100% !important;
        min-width: 0 !important;
        padding-bottom: 10px !important;
        margin-bottom: 12px !important;
    }

    .sj-brand {
        font-size: 18px !important;
    }

    .sj-title h3 {
        font-size: 19px !important;
    }

    .sj-meta {
        font-size: 10px !important;
    }

    /* TABLE */
    .sj-document .table-wrap {
        display: block !important;
        width: 100% !important;
        max-width: none !important;
        margin: 0 !important;
        padding: 0 !important;
        overflow: visible !important;
        border: none !important;
        border-radius: 0 !important;
    }

    .sj-table {
        display: table !important;
        width: 100% !important;
        min-width: 0 !important;
        max-width: none !important;
        margin: 0 !important;
        table-layout: fixed !important;
        border-collapse: collapse !important;
        page-break-inside: avoid !important;
        break-inside: avoid !important;
    }

    .sj-table thead {
        display: table-header-group !important;
    }

    .sj-table tbody {
        display: table-row-group !important;
    }

    .sj-table tr {
        page-break-inside: avoid !important;
        break-inside: avoid !important;
    }

    .sj-table th,
    .sj-table td {
        padding: 5px 4px !important;
        font-size: 10px !important;
        line-height: 1.2 !important;
        white-space: normal !important;
        word-break: break-word !important;
        overflow-wrap: anywhere !important;
    }

    /* KOLOM */
    .sj-table th:nth-child(1),
    .sj-table td:nth-child(1) {
        width: 4% !important;
    }

    .sj-table th:nth-child(2),
    .sj-table td:nth-child(2) {
        width: 20% !important;
    }

    .sj-table th:nth-child(3),
    .sj-table td:nth-child(3) {
        width: 11% !important;
    }

    .sj-table th:nth-child(4),
    .sj-table td:nth-child(4) {
        width: 12% !important;
    }

    .sj-table th:nth-child(5),
    .sj-table td:nth-child(5) {
        width: 13% !important;
    }

    .sj-table th:nth-child(6),
    .sj-table td:nth-child(6) {
        width: 13% !important;
    }

    .sj-table th:nth-child(7),
    .sj-table td:nth-child(7) {
        width: 13% !important;
    }

    .sj-table th:nth-child(8),
    .sj-table td:nth-child(8) {
        width: 14% !important;
    }

    .payment-cell,
    .note-cell {
        width: 100% !important;
        min-width: 0 !important;
        min-height: 22px !important;
        height: auto !important;
    }

    /* FOOTER */
    .sj-footer {
        display: flex !important;
        width: 100% !important;
        max-width: none !important;
        margin-top: 15px !important;
        font-size: 10px !important;
        page-break-inside: avoid !important;
        break-inside: avoid !important;
    }

    .sign-box {
        width: 150px !important;
    }

    .sign-line {
        margin-top: 30px !important;
    }
}