﻿/* =========================================================
   BASE & GLOBAL STYLES
   ========================================================= */
html,
body {
    font-family: Roboto, 'Helvetica Neue', Helvetica, Arial, sans-serif;
    margin: 0;
}

code {
    color: #c02d76;
}

/* Form-floating placeholder behavior */
.form-floating > .form-control-plaintext::placeholder,
.form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder,
.form-floating > .form-control:focus::placeholder {
    text-align: start;
}


/* =========================================================
   VALIDATION STATE
   ========================================================= */
.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid red;
}

.validation-message {
    color: red;
}


/* =========================================================
   BLAZOR ERROR UI
   ========================================================= */
#blazor-error-ui {
    color-scheme: light only;
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
    }

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred.";
    }


/* =========================================================
   LOADING PROGRESS (BOOTSTRAPPER)
   ========================================================= */
.loading-progress {
    position: absolute;
    display: block;
    width: 8rem;
    height: 8rem;
    inset: 20vh 0 auto 0;
    margin: 0 auto 0;
}

    .loading-progress circle {
        fill: none;
        stroke: #e0e0e0;
        stroke-width: 0.6rem;
        transform-origin: 50% 50%;
        transform: rotate(-90deg);
    }

        .loading-progress circle:last-child {
            stroke: #1b6ec2;
            stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
            transition: stroke-dasharray 0.05s ease-in-out;
        }

.loading-progress-text {
    position: absolute;
    text-align: center;
    font-weight: bold;
    inset: calc(20vh + 3.25rem) 0 auto 0.2rem;
}

    .loading-progress-text:after {
        content: var(--blazor-load-percentage-text, "Loading");
    }


/* =========================================================
   PAGE LAYOUT (PageCard, Header, Tabs)
   ========================================================= */
.page-card-full {
    min-height: calc(100vh - 0px); /* tweak based on navbar/spacing */
}

.page-card {
    background-color: #ffffff;
    border-radius: 12px;
    border-start-end-radius: 0;
    border-end-end-radius: 0;
    box-shadow: 0 0 0 1px #e3e6ef, 0 10px 30px rgba(15, 23, 42, 0.06);
    padding: 20px 24px;
    margin: 16px 0 16px 12px;
}

/* header style */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 16px;
    margin-top: 12px;
    padding: 12px 12px 0 12px;
}

.page-title {
    font-size: 1.4rem;
    font-weight: 600;
    margin: 0 0 6px 0;
}

/* Tab header (kalau dipakai) */
.page-tabs {
    display: flex;
    gap: 16px;
    border-bottom: 1px solid #e5e7eb;
}

.page-tab {
    border: none;
    background: transparent;
    padding: 8px 0;
    font-size: 0.9rem;
    color: #6b7280;
    border-bottom: 2px solid transparent;
    cursor: pointer;
}

    .page-tab.active {
        color: #4f46e5;
        border-bottom-color: #4f46e5;
    }


/* =========================================================
   POS / INVOICE FORM (POS.razor)
   ========================================================= */
.invoice-form label {
    font-size: 0.8rem;
    font-weight: 500;
    color: #6b7280;
}

.invoice-items-table th,
.invoice-items-table td {
    vertical-align: middle;
}

.invoice-items-table input.form-control-sm {
    padding-top: .15rem;
    padding-bottom: .15rem;
}

.uppercase-input {
    text-transform: uppercase;
}

    .uppercase-input::placeholder {
        text-transform: none;
    }


/* Card utama item invoice */
.invoice-card {
    overflow: visible;
    border-radius: 18px;
    border: none;
    background: linear-gradient(180deg, #f8fbff 0%, #ffffff 40%) !important;
    box-shadow: 0 -2px 18px rgba(37, 99, 235, 0.05);
}

@media (max-width: 768px) {
    .invoice-card .table-responsive {
        overflow-x: auto;
        overflow-y: visible;
    }
}

@media (min-width: 769px) {
    .invoice-card .table-responsive {
        overflow: visible;
    }
}


/* Header card produk */
.invoice-header {
    background: linear-gradient(90deg, #eef3ff 0%, #f4f7ff 60%, #ffffff 100%);
    border-bottom: 1px solid #d6e2ff;
    border-right: 0 !important;
}

    .invoice-header h6 {
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: .06em;
        font-size: .8rem;
        margin-bottom: .15rem;
        color: #1f2937;
    }

    .invoice-actions .icon-btn {
        width: 36px;
        height: 32px;
        padding: 0;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .invoice-actions .icon-btn i {
        font-size: 14px;
        line-height: 1;
    }


.invoice-header small {
    font-size: .75rem;
    color: #6c757d;
}

/* Tabel item invoice */
.invoice-items-table thead th {
    font-size: .72rem;
    text-transform: uppercase;
    padding-top: .5rem;
    padding-bottom: .4rem;
    white-space: nowrap;
    background: #f3f6ff;
    border-bottom: 1px solid #dde5ff;
    letter-spacing: .08em;
    color: #6b7280;
}

.invoice-items-table tbody tr:hover {
    background-color: #f8fbff;
}

.invoice-items-table tbody td {
    vertical-align: middle;
}

/* Kolom "Jumlah" jangan kependekan */
.invoice-items-table .total-col {
    min-width: 140px;
}

/* Badge kecil di header card POS */
.pill-badge {
    font-size: .7rem;
    border-radius: 999px;
    padding: .25rem .75rem;
    background-color: #e0ecff;
    color: #1d4ed8;
    font-weight: 500;
}

/* Separator + tombol add item */
.invoice-add-item-row {
    border-top: 1px dashed #d1ddff;
    padding: .75rem 0 0.2rem;
}

/* Tombol "Tambah baris produk" */
.btn-add-product {
    width: 100%;
    border-radius: 999px;
    border: 1px dashed #9fb6ff;
    background: #f3f7ff;
    font-size: 0.85rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    color: #1d4ed8;
    transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, transform 0.08s ease;
}

    .btn-add-product:hover {
        background: #e4ecff;
        border-color: #2563eb;
        box-shadow: 0 4px 10px rgba(37, 99, 235, 0.18);
        text-decoration: none;
    }

    .btn-add-product:active {
        transform: scale(0.98);
        box-shadow: 0 2px 6px rgba(37, 99, 235, 0.18);
    }

/* Icon plus */
.add-product-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.35rem;
    height: 1.35rem;
    border-radius: 999px;
    background-color: #2563eb;
    color: #ffffff;
    font-size: 0.9rem;
    line-height: 1;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.35);
}


/* =========================================================
   INVOICE SUMMARY (POS & DETAIL)
   ========================================================= */
.invoice-summary-card {
    font-size: 1.05rem;
    border-radius: 16px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.04);
    background: #ffffff;
}

    /* Padding card summary */
    .invoice-summary-card .card-body {
        padding: 1.25rem 1.6rem;
    }

    /* Judul "Ringkasan" */
    .invoice-summary-card h6 {
        font-size: 1.1rem;
        font-weight: 600;
        color: #4b5563;
        margin-bottom: 1rem;
    }

/* dt/dd ringkasan */
.invoice-summary-list dt,
.invoice-summary-list dd {
    padding-top: 0.4rem;
    padding-bottom: 0.4rem;
    margin-bottom: 0;
    font-size: 0.95rem;
}

/* Label kiri */
.invoice-summary-list dt {
    color: #6b7280;
    font-weight: 500;
}

/* Value kanan */
.invoice-summary-list dd {
    color: #111827;
}

/* Biar "Rp x.xxx.xxx" gak kepotong */
.invoice-summary-list .summary-value {
    white-space: nowrap;
}

/* Garis putus-putus sebelum Total */
.invoice-summary-divider {
    border-top: 1px solid rgba(0, 0, 0, .05);
    margin: .25rem 0 .5rem;
}

/* Total section */
.summary-total-label,
.summary-total-value {
    border-top: 1px dashed #e5e7eb;
    padding-top: 1rem;
    margin-top: 0.3rem;
}

.summary-total-label {
    font-weight: 600;
    color: #111827;
}

.summary-total-value {
    font-weight: 700;
    font-size: 1.15rem;
    color: #1d4ed8;
}

/* Responsive: summary di layar kecil */
@media (max-width: 480px) {
    .invoice-summary-divider {
        margin-top: 0.5rem;
        margin-bottom: 0.5rem;
    }

    .invoice-summary-list dt,
    .invoice-summary-list dd {
        flex: 0 0 100%;
        max-width: 100%;
    }

    .invoice-summary-list dt {
        padding-bottom: 0.15rem;
    }

    .invoice-summary-list dd {
        text-align: left;
        padding-top: 0;
        padding-bottom: 0.45rem;
    }

    /* total di mobile: garis satu saja, rapi */
    .invoice-summary-list .summary-total-label,
    .invoice-summary-list .summary-total-value {
        border-top: none;
    }

    .invoice-summary-list .summary-total-value {
        margin-top: 0.4rem;
        padding-top: 0.4rem;
        border-top: 1px dashed #e5e7eb;
    }

    .invoice-summary-card .card-body {
        padding: 1rem 1.1rem;
    }
}


.row-done {
    background: rgba(40, 167, 69, .12); /* hijau halus */
}

/* =========================================================
   INVOICE LIST / TABLE HIGHLIGHT
   ========================================================= */
.invoice-table tbody tr.invoice-row-queued {
    background-color: #fffbe8; /* kuning sangat lembut */
}

.invoice-table tbody tr.invoice-row-overdue {
    background-color: #ffe9ec; /* merah muda lembut */
}


/* =========================================================
   DATEPICKER COMPONENT
   ========================================================= */
.date-picker {
    position: relative;
    display: inline-block;
    width: 100%;
}

.date-picker-input .form-control {
    background-color: #fff;
    cursor: pointer;
}

.date-picker-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 4px;
    background-color: #fff;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
    z-index: 1050;
    padding: 8px;
    min-width: 260px;
}

.date-picker-table th,
.date-picker-table td {
    padding: 2px;
}

.date-picker-day button {
    width: 100%;
}

.date-picker-btn {
    padding: 0.25rem 0.4rem;
    font-size: 0.75rem;
}


/* =========================================================
   ATTACHMENT / FILE UPLOAD
   ========================================================= */
.attachment-dropzone {
    position: relative;
    overflow: hidden;
    background-color: #fafafa;
}

/* Input file overlay seluruh area */
.attachment-input-file {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

/* Konten visual di atas input transparan */
.attachment-dropzone-content {
    pointer-events: none;
}

    .attachment-dropzone-content button {
        pointer-events: auto;
    }

.attachment-item {
    background-color: #fff;
    border-radius: 6px;
    border: 1px solid #eee;
    padding: 0.5rem 0.75rem;
}

.attachment-icon i {
    font-size: 1.25rem;
}

.attachment-name {
    font-size: 0.9rem;
    font-weight: 500;
    word-break: break-all;
}

.attachment-size {
    font-size: 0.75rem;
}


/* =========================================================
   GLOBAL FORM ACTIONS (BATALKAN / SIMPAN)
   ========================================================= */
.form-actions-bar {
    border-top: 1px solid #e5e7eb;
    margin-top: 1.5rem;
    padding-top: 1rem;
}

/* Tombol Batalkan */
.form-btn-cancel {
    color: #6b7280;
    font-weight: 500;
    padding-left: 0;
}

    .form-btn-cancel:hover {
        color: #111827;
        text-decoration: none;
    }

/* Tombol utama (Simpan) */
.form-btn-primary {
    border-radius: 999px;
    padding: 0.55rem 1.8rem;
    font-weight: 500;
    background: #2563eb;
    border: 1px solid #1d4ed8;
    color: #ffffff;
    box-shadow: 0 8px 18px rgba(37, 99, 235, 0.28);
}

    .form-btn-primary:hover {
        background: #1d4ed8;
        color: #ffffff;
        box-shadow: 0 10px 22px rgba(37, 99, 235, 0.36);
    }


/* =========================================================
   INVOICE DETAIL PAGE
   ========================================================= */
.invoice-items-scroll {
    max-height: 360px;
    overflow-y: auto;
}

/* Sudah ada invoice-summary-card di atas, ini hanya tweak kecil dt dan divider */
.invoice-summary-card dl dt {
    font-weight: 500;
}

.invoice-summary-divider {
    border-top: 1px solid rgba(0, 0, 0, .05);
    margin: .25rem 0 .5rem;
}


/* Modal pembayaran invoice */
.payment-modal-body {
    font-size: .875rem;
}

    .payment-modal-body .form-row + .form-row {
        margin-top: .25rem;
    }

    .payment-modal-body .col-form-label-sm {
        padding-top: .25rem;
        padding-bottom: .25rem;
        font-weight: 500;
        color: #555;
    }

    .payment-modal-body input[type="file"] {
        font-size: .8rem;
    }

    .payment-modal-body hr {
        margin: .75rem 0;
    }

/* =========================================================
   INVOICE PAYMENTS TABLE & SHIPMENT TABLES
   ========================================================= */

/* Semua tabel: bukti pembayaran + semua tabel SJ pakai style yang sama */
.invoice-payments-table,
.shipment-items-table,
.shipment-sj-table,
.shipment-modal-table {
    font-size: 0.88rem;
    border-color: #e5e7eb;
}

    /* Header */
    .invoice-payments-table thead th,
    .shipment-items-table thead th,
    .shipment-sj-table thead th,
    .shipment-modal-table thead th {
        background-color: #f9fafb;
        border-color: #e5e7eb;
        font-size: 0.72rem;
        text-transform: uppercase;
        letter-spacing: 0.06em;
        color: #6b7280;
        font-weight: 600;
        padding-top: 0.45rem;
        padding-bottom: 0.35rem;
        white-space: nowrap;
    }

    /* Cell body */
    .invoice-payments-table tbody td,
    .shipment-items-table tbody td,
    .shipment-sj-table tbody td,
    .shipment-modal-table tbody td {
        padding-top: 0.45rem;
        padding-bottom: 0.45rem;
        vertical-align: middle;
        border-color: #eef2f7;
    }

    /* Hover row */
    .invoice-payments-table tbody tr:hover,
    .shipment-items-table tbody tr:hover,
    .shipment-sj-table tbody tr:hover,
    .shipment-modal-table tbody tr:hover {
        background-color: #f9fbff;
    }

    /* Kolom angka rapi */
    .invoice-payments-table td.text-right,
    .shipment-items-table td.text-right,
    .shipment-sj-table td.text-right,
    .shipment-modal-table td.text-right {
        font-variant-numeric: tabular-nums;
    }

    /* Kolom aksi di ujung kanan tetap center */
    .invoice-payments-table td:last-child,
    .shipment-sj-table td:last-child {
        text-align: center;
    }

    /* Footer khusus tabel SJ (total) */
    .shipment-items-table tfoot td,
    .shipment-modal-table tfoot td {
        background-color: #f9fafb;
        border-top: 1px dashed #e5e7eb;
    }

/* Info produk di modal SJ */
.shipment-product-name {
    font-weight: 500;
    color: #111827;
}

.shipment-product-sub {
    margin-top: 2px;
}

/* Tombol +/- qty di modal */
.shipment-qty-input .btn {
    padding: 0.15rem 0.5rem;
    min-width: 32px;
}

.shipment-qty-input .form-control {
    max-width: 70px;
    padding-top: 0.15rem;
    padding-bottom: 0.15rem;
}


/* link bukti */
.payment-proof-link {
    font-size: 0.88rem;
    color: #2563eb;
    font-weight: 500;
    text-decoration: none;
}

    .payment-proof-link:hover {
        text-decoration: underline;
        color: #1d4ed8;
    }

/* tombol aksi di kolom terakhir */
.invoice-payments-table .btn-group .btn {
    padding: 0.18rem 0.45rem;
}

.invoice-payments-table .btn-outline-secondary i,
.invoice-payments-table .btn-outline-danger i {
    font-size: 0.85rem;
}

/* =========================================================
   INVOICE ITEMS SUMMARY - VISUAL UPGRADE
   ========================================================= */

.invoice-items-card {
    border: 1px solid rgba(229, 231, 235, 0.9);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 10px 26px rgba(17, 24, 39, 0.06);
}

    /* Header lebih "berniat" */
    .invoice-items-card > .card-header {
        background: linear-gradient(90deg, #f5f8ff 0%, #ffffff 55%, #f8fafc 100%);
        border-bottom: 1px solid rgba(226, 232, 240, 0.9);
    }

        .invoice-items-card > .card-header h6 {
            font-weight: 700;
            letter-spacing: .02em;
        }

/* Scroll area: biar header tabel bisa sticky */
.invoice-items-scroll {
    max-height: 360px;
    overflow-y: auto;
    background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
}

    /* scrollbar tipis (optional, tapi manis) */
    .invoice-items-scroll::-webkit-scrollbar {
        width: 10px;
    }

    .invoice-items-scroll::-webkit-scrollbar-thumb {
        background: rgba(148, 163, 184, 0.45);
        border-radius: 999px;
        border: 3px solid rgba(255,255,255,0.9);
    }

        .invoice-items-scroll::-webkit-scrollbar-thumb:hover {
            background: rgba(148, 163, 184, 0.65);
        }

/* Tabel: lebih clean */
.invoice-items-summary-table {
    font-size: 0.9rem;
    border-color: transparent;
}

    /* Sticky header tabel */
    .invoice-items-summary-table thead th {
        position: sticky;
        top: 0;
        z-index: 2;
        background: linear-gradient(180deg, #f8fafc 0%, #f1f5ff 100%);
        border-bottom: 1px solid rgba(226, 232, 240, 0.95);
        font-size: 0.72rem;
        text-transform: uppercase;
        letter-spacing: 0.08em;
        color: #64748b;
        font-weight: 700;
        padding-top: 0.55rem;
        padding-bottom: 0.45rem;
        white-space: nowrap;
    }

    /* Divider halus & padding enak */
    .invoice-items-summary-table tbody td {
        padding: 0.55rem 0.75rem;
        vertical-align: middle;
        border-top: 1px solid rgba(241, 245, 249, 1);
        border-color: rgba(241, 245, 249, 1);
    }

    /* Angka: tabular + sedikit tracking */
    .invoice-items-summary-table td.text-right {
        font-variant-numeric: tabular-nums;
        letter-spacing: .01em;
        color: #0f172a;
    }

    /* Hover: bukan cuma ganti background, tapi ada highlight di kiri */
    .invoice-items-summary-table tbody tr {
        transition: background-color .12s ease, transform .12s ease;
    }

        .invoice-items-summary-table tbody tr:hover {
            background-color: rgba(59, 130, 246, 0.06);
        }

            .invoice-items-summary-table tbody tr:hover td:first-child {
                box-shadow: inset 3px 0 0 rgba(59, 130, 246, 0.55);
            }

/* Footer: jadi "summary bar" */
.invoice-items-footer {
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%) !important;
    border-top: 1px solid rgba(226, 232, 240, 0.9);
}

    .invoice-items-footer strong {
        font-variant-numeric: tabular-nums;
        font-weight: 800;
    }

    /* Button link di footer biar keliatan actionable */
    .invoice-items-footer .btn-link {
        font-weight: 700;
        text-decoration: none;
    }

        .invoice-items-footer .btn-link:hover {
            text-decoration: underline;
        }

.invoice-items-summary-table th.text-right,
.invoice-items-summary-table td.text-right {
    padding-right: 1rem !important;
}

/* =========================================================
   INVOICE DETAIL TAB PENGIRIMAN / SURAT JALAN
   ========================================================= */

.shipment-card {
    border-radius: 14px;
    border: 1px solid #e5e7eb;
}

/* Modal SJ */

.shipment-modal-body {
    font-size: .875rem;
}

.modal-dialog.modal-dialog-scrollable .modal-content {
    max-height: calc(100vh - 2rem);
}

/* =========================================================
   A4 INVOICE PREVIEW
   ========================================================= */
.invoice-pdf-wrapper {
    height: calc(100vh - 140px); /* kira-kira sisa tinggi setelah header */
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 0 0 1px #e5e7eb, 0 10px 30px rgba(15, 23, 42, 0.08);
    background-color: #f3f4f6;
}

.invoice-pdf-frame {
    width: 100%;
    height: 100%;
    border: none;
}


/* =========================================================
   INVOICE SUCCESS MODAL
   ========================================================= */
.invoice-success-backdrop {
    background-color: rgba(15, 23, 42, 0.38);
    z-index: 1055;
}

.invoice-success-modal {
    border-radius: 16px;
    border: none;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.25);
}

    .invoice-success-modal .modal-header {
        border-bottom: 0;
        padding: 1rem 1.5rem 0.5rem;
    }

    .invoice-success-modal .modal-title {
        font-size: 1rem;
        font-weight: 600;
    }

    .invoice-success-modal .modal-body {
        padding: 0.75rem 1.5rem 1rem;
    }

.invoice-success-icon {
    width: 32px;
    height: 32px;
    border-radius: 999px;
    background-color: #dcfce7;
    color: #16a34a;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
}

.invoice-success-summary dt {
    font-size: 0.8rem;
    font-weight: 500;
    color: #6b7280;
}

.invoice-success-summary dd {
    font-size: 0.9rem;
    font-weight: 600;
    color: #111827;
}

.invoice-success-modal .modal-footer {
    border-top: 0;
    padding: 0.75rem 1.5rem 1.25rem;
    background: #f9fafb;
}

.invoice-success-secondary-actions .btn-link {
    font-size: 0.8rem;
}

    .invoice-success-secondary-actions .btn-link.text-muted {
        color: #9ca3af;
    }



.customer-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 4px;
    background-color: #ffffff;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
    z-index: 1030;
    max-height: 260px;
    overflow-y: auto !important;
}

.customer-dropdown-item {
    width: 100%;
    padding: 0.45rem 0.75rem;
    display: inline-block;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 0.9rem;
}

    .customer-dropdown-item:hover {
        background-color: #f3f4ff;
    }

.customer-dropdown-footer {
    border-top: 1px solid #f1f5f9;
    padding: 0.35rem 0.75rem;
}
/* backdrop khusus modal customer */
.modal-backdrop.customer-modal-backdrop {
    background: radial-gradient(circle at top, rgba(15, 23, 40, 0.28), transparent 40%), rgba(15, 23, 42, 0.4);
    opacity: 1; /* jangan transparan lagi */
}

/* lebar modal */
.customer-modal-dialog {
    max-width: 640px;
}

/* kontainer modal (extend dari .modal-content bootstrap) */
.customer-modal-saas {
    border-radius: 18px;
    border: 0;
    overflow: hidden;
    box-shadow: 0 22px 60px rgba(15, 23, 42, 0.32), 0 0 0 1px rgba(148, 163, 184, 0.25);
    background: radial-gradient(circle at top left, #f9fbff 0, #ffffff 46%);
}

/* header */
.customer-modal-header {
    border-bottom: 0;
    padding: 1.25rem 1.75rem 0.75rem;
    align-items: flex-start;
}

.customer-modal-title {
    font-size: 1.1rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: #0f172a;
}

.customer-modal-subtitle {
    margin: 0.25rem 0 0;
    font-size: 0.82rem;
    color: #6b7280;
}

.customer-modal-close {
    margin-left: 12px;
    opacity: 0.55;
    font-size: 1.25rem;
}

    .customer-modal-close:hover {
        opacity: 0.9;
    }

/* body – BIARKAN bootstrap yang set overflow-y: auto
   lewat .modal-dialog-scrollable .modal-body */
.customer-modal-body {
    padding: 0.75rem 1.75rem 1.25rem;
    font-size: 0.9rem;
    overflow-y: auto;
}

.customer-modal-section + .customer-modal-section {
    margin-top: 1rem;
}

.customer-field-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 500;
    color: #6b7280;
    margin-bottom: 0.25rem;
}

.customer-input-lg {
    padding-top: 0.55rem;
    padding-bottom: 0.55rem;
    font-size: 0.94rem;
}

/* form control look */
.customer-modal-saas .form-control {
    border-radius: 10px;
    border: 1px solid #e5e7eb;
    font-size: 0.9rem;
    padding: 0.45rem 0.7rem;
    box-shadow: none;
    transition: border-color 0.12s ease, box-shadow 0.12s ease, background-color 0.12s ease;
}

    .customer-modal-saas .form-control:focus {
        border-color: #2563eb;
        box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.17);
        background-color: #f9fbff;
    }

    .customer-modal-saas .form-control::placeholder {
        color: #9ca3af;
        font-size: 0.86rem;
    }

/* validation kecil */
.customer-modal-saas .validation-message {
    font-size: 0.78rem;
    margin-top: 0.15rem;
}

/* base */
.customer-modal-alert {
    border-radius: 12px;
    font-size: 0.8rem;
    padding: 0.5rem 0.75rem;
    margin-bottom: 0.5rem;
}

/* ERROR (default) */
.customer-modal-alert-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #b91c1c;
}

/* SUCCESS */
.customer-modal-alert-success {
    background: #ecfdf3;
    border: 1px solid #bbf7d0;
    color: #166534;
}

/* WARNING */
.customer-modal-alert-warning {
    background: #fffbeb;
    border: 1px solid #fed7aa;
    color: #92400e;
}


/* footer */
.customer-modal-footer {
    border-top: 1px solid rgba(226, 232, 240, 0.7);
    padding: 0.75rem 1.75rem 1rem;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 0.5rem;
    background: linear-gradient(180deg, #f9fafb 0, #ffffff 40%);
}

/* tombol */
.customer-btn-secondary {
    font-size: 0.85rem;
    color: #6b7280;
    font-weight: 500;
    text-decoration: none;
}

    .customer-btn-secondary:hover {
        color: #111827;
        text-decoration: underline;
    }

.customer-btn-primary {
    border-radius: 999px;
    padding: 0.45rem 1.45rem;
    font-size: 0.86rem;
    font-weight: 600;
    border: none;
    background: linear-gradient(135deg, #2563eb, #4f46e5);
    color: #ffffff;
    box-shadow: 0 5px 22px rgba(37, 99, 235, 0.33);
}

    .customer-btn-primary:hover:not(:disabled) {
        background: linear-gradient(135deg, #1d4ed8, #4338ca);
        box-shadow: 0 12px 26px rgba(37, 99, 235, 0.42);
    }

    .customer-btn-primary:disabled {
        opacity: 0.7;
        box-shadow: none;
        cursor: default;
    }

    .customer-btn-primary:hover {
        color: #ffffff;
    }

/* mobile tweak */
@media (max-width: 576px) {
    .customer-modal-dialog {
        margin: 0.75rem;
    }

    .customer-modal-saas {
        border-radius: 16px;
    }

    .customer-modal-body {
        padding-inline: 1.25rem;
        overflow-y: auto;
    }

    .customer-modal-footer {
        padding-inline: 1.25rem;
    }
}



/*DASHBOARD------------------------------------------------------*/

.dash-toolbar {
    margin-bottom: 14px;
}

.dash-filter {
    display: grid;
    grid-template-columns: 1.2fr 1.2fr 1fr 1fr auto;
    gap: 12px;
    align-items: end;
}

.dash-field label {
    font-size: 12px;
    color: #6b7280;
    margin-bottom: 6px;
}

.dash-actions {
    display: flex;
    gap: 8px;
    padding-bottom: 2px;
}

.dash-kpis {
    display: grid;
    grid-template-columns: repeat(5, minmax(160px, 1fr));
    gap: 12px;
    margin-bottom: 12px;
}

.dash-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 12px;
}

.dash-panel-wide {
    grid-column: 1 / -1;
}

.dash-panel {
    background: #fff;
    border: 1px solid #eef2f7;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 6px 22px rgba(20, 20, 43, 0.06);
}

.dash-panel-header {
    padding: 14px 14px 10px;
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 12px;
}

.dash-panel-body {
    padding: 14px;
}

.dash-title {
    font-weight: 700;
    color: #0f172a;
}

.dash-subtitle {
    font-size: 12px;
    color: #64748b;
    margin-top: 2px;
}

.dash-chip {
    display: inline-flex;
    gap: 8px;
    align-items: baseline;
    padding: 8px 10px;
    border-radius: 999px;
    border: 1px solid #eef2f7;
    background: #fafbff;
}

    .dash-chip .muted {
        color: #64748b;
        font-size: 12px;
    }

.dash-mini-legend {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #64748b;
    margin-top: 8px;
}

    .dash-mini-legend .dot {
        width: 10px;
        height: 10px;
        border-radius: 99px;
        background: #2563eb;
    }

@media (max-width: 1200px) {
    .dash-filter {
        grid-template-columns: 1fr 1fr;
    }

    .dash-kpis {
        grid-template-columns: repeat(2, minmax(160px, 1fr));
    }

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


.kpi {
    border: 1px solid #eef2f7;
    background: #fff;
    border-radius: 14px;
    padding: 14px;
    box-shadow: 0 6px 22px rgba(20,20,43,.06);
}

.kpi-top {
    display: flex;
    gap: 12px;
    align-items: center;
}

.kpi-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #eef2f7;
    background: #fbfcff;
    color: #0f172a;
}

.kpi-title {
    font-size: 12px;
    color: #64748b;
}

.kpi-value {
    font-size: 20px;
    font-weight: 800;
    color: #0f172a;
    margin-top: 2px;
}

.kpi-sub {
    margin-top: 10px;
    font-size: 12px;
    color: #64748b;
}

.kpi-neutral .kpi-icon {
    background: rgba(100,116,139,.10); /* slate */
    color: #475569;
}

.kpi-success .kpi-icon {
    background: rgba(16,185,129,.08);
    color: #059669;
}

.kpi-warning .kpi-icon {
    background: rgba(245,158,11,.10);
    color: #b45309;
}

.kpi-danger .kpi-icon {
    background: rgba(239,68,68,.10);
    color: #b91c1c;
}

.kpi-info .kpi-icon {
    background: rgba(59,130,246,.10);
    color: #2563eb;
}

.kpi-primary .kpi-icon {
    background: rgba(59,130,246,.10);
    color: #2563eb;
}

/* warna tambahan */
.kpi-purple .kpi-icon {
    background: rgba(168,85,247,.10);
    color: #7c3aed;
}


.spark {
    width: 100%;
    height: 56px;
    display: block;
}

.spark-line {
    fill: none;
    stroke: var(--primary, #2563eb);
    stroke-width: 3;
}

.spark-area {
    fill: var(--primary, #2563eb);
    opacity: .12;
}

.sb {
    margin-bottom: 12px;
}

.sb-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sb-label {
    font-weight: 700;
    color: #0f172a;
}

.sb-num {
    font-weight: 800;
    color: #0f172a;
}

.sb-track {
    height: 10px;
    border-radius: 999px;
    background: #eef2f7;
    overflow: hidden;
    margin-top: 6px;
}

.sb-fill {
    height: 100%;
    border-radius: 999px;
}

.sb-success {
    background: #10b981;
}

.sb-warning {
    background: #f59e0b;
}

.sb-primary {
    background: #2563eb;
}

.sb-neutral {
    background: #94a3b8;
}

.sb-foot {
    font-size: 12px;
    margin-top: 6px;
}

.overdue-table thead th {
    background: #f8fafc;
    border-top: 1px solid #eef2f7;
    border-bottom: 1px solid #eef2f7;
}

.overdue-table tbody td {
    border-top: 1px solid #f1f5f9;
}

/* ===== PPN Segmented Toggle (filled active) ===== */
.ppn-toggle {
    display: flex;
    width: 100%;
    max-width: 260px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
}

.ppn-toggle-input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.ppn-toggle-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 14px;
    margin: 0;
    cursor: pointer;
    user-select: none;
    font-size: 13px;
    color: #495057;
    background: transparent;
    transition: background-color .15s ease, color .15s ease;
}

    .ppn-toggle-btn + .ppn-toggle-input + .ppn-toggle-btn {
        border-left: 1px solid #dee2e6;
    }

.ppn-pill {
    font-weight: 600;
}

.ppn-sub {
    font-size: 12px;
    color: #6c757d;
}

/* active = full background */
.ppn-toggle-input:checked + .ppn-toggle-btn {
    background: #0d6efd;
    color: #fff;
}

    .ppn-toggle-input:checked + .ppn-toggle-btn .ppn-sub {
        color: rgba(255,255,255,.9);
        font-weight: 600;
    }

/* hover */
.ppn-toggle-btn:hover {
    background: #ffffff;
}

/* focus ring (keyboard) */
.ppn-toggle-input:focus-visible + .ppn-toggle-btn {
    outline: 3px solid rgba(13,110,253,.25);
    outline-offset: -3px;
}

.cell-invalid {
    background: rgba(220, 53, 69, 0.06); /* merah lembut */
}

    .cell-invalid .form-control {
        border-color: #dc3545 !important;
    }
