:root {
    --bg: #f5f7fb;
    --surface: #fff;
    --text: #273244;
    --muted: #7b8798;

    --primary: #7089a8;
    --primary-dark: #5d7696;

    --border: #e5eaf1;
    --success: #6fa889;
    --danger: #c97878;
    --warning: #c79b5f;

    --sidebar: #eef3f8;
    --shadow: 0 10px 30px rgba(55, 75, 95, .08);
    --radius: 14px;
}


/* ==================================================
   GLOBAL
   ================================================== */

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    font-family: Inter, Segoe UI, Arial, sans-serif;
    color: var(--text);
    background: var(--bg);
}

button,
input,
select,
textarea {
    font: inherit;
}
.btn {
    border: 0;
    border-radius: 10px;
    padding: 10px 16px;
    cursor: pointer;
    font-weight: 600;
    transition: .2s;
}

a.btn {
    text-decoration: none;
}

/* ==================================================
   LOGIN
   ================================================== */

.login-body {
    min-height: 100vh;
    background: linear-gradient(135deg, #eef3f8, #f8fafc);
    display: flex;
}

.login-wrapper {
    width: 100%;
    display: grid;
    place-items: center;
    padding: 24px;
}

.login-card {
    width: min(420px, 100%);
    background: #fff;
    padding: 36px;
    border: 1px solid var(--border);
    border-radius: 20px;
    box-shadow: var(--shadow);
}


/* ==================================================
   BRAND
   ================================================== */

.brand,
.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand {
    margin-bottom: 28px;
}

.brand h1 {
    margin: 0;
    font-size: 24px;
}

.brand p {
    margin: 3px 0;
    color: var(--muted);
    font-size: 13px;
}

.brand-mark {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: var(--primary);
    color: #fff;
    display: grid;
    place-items: center;
    font-weight: 700;
    font-size: 20px;
}


/* ==================================================
   FORM
   ================================================== */

label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin: 0 0 7px;
}

input,
select,
textarea {
    width: 100%;
    padding: 11px 13px;
    border: 1px solid var(--border);
    border-radius: 10px;
    outline: 0;
    background: #fff;
    color: var(--text);
    transition: .2s;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(112, 137, 168, .12);
}

.login-card label {
    margin-top: 15px;
}

.login-card input {
    margin-bottom: 2px;
}


/* ==================================================
   BUTTON
   ================================================== */

.btn {
    border: 0;
    border-radius: 10px;
    padding: 10px 16px;
    cursor: pointer;
    font-weight: 600;
    transition: .2s;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-primary {
    background: var(--primary);
    color: #fff;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-secondary {
    background: #e9eef4;
    color: #52657a;
}

.btn-success {
    background: var(--success);
    color: #fff;
}

.btn-danger {
    background: var(--danger);
    color: #fff;
}

.btn-outline {
    background: #fff;
    color: #5d718a;
    border: 1px solid var(--border);
}

.btn-block {
    width: 100%;
    margin-top: 20px;
}

.btn-sm {
    padding: 6px 10px;
    font-size: 12px;
}


/* ==================================================
   LOGIN INFO
   ================================================== */

.login-info {
    margin-top: 18px;
    padding: 10px;
    background: #f7f9fb;
    border-radius: 9px;
    color: var(--muted);
    font-size: 12px;
    text-align: center;
}


/* ==================================================
   APP SHELL
   ================================================== */

.app-shell {
    min-height: 100vh;
    display: flex;
}


/* ==================================================
   SIDEBAR
   ================================================== */

.sidebar {
    width: 245px;
    background: var(--sidebar);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 20px 14px;
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 20;
}

.sidebar-brand {
    padding: 4px 10px 25px;
    font-size: 18px;
    font-weight: 700;
}


/* ==================================================
   NAVIGATION
   ================================================== */

.nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-link,
.nav-dropdown {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 12px;
    border: 0;
    background: transparent;
    text-decoration: none;
    color: #5d6d7e;
    border-radius: 10px;
    font-size: 14px;
    cursor: pointer;
    text-align: left;
    width: 100%;
}

.nav-link:hover,
.nav-dropdown:hover,
.nav-link.active {
    background: #fff;
    color: var(--primary-dark);
    box-shadow: 0 3px 12px rgba(50, 70, 90, .05);
}

.nav-dropdown .arrow {
    margin-left: auto;
}


/* ==================================================
   SUBMENU
   ================================================== */

.submenu {
    display: none;
    padding-left: 30px;
}

.submenu.show {
    display: block;
}

.submenu a {
    display: block;
    padding: 8px;
    color: var(--muted);
    text-decoration: none;
    font-size: 13px;
}

.submenu a:hover {
    background: #fff;
    color: var(--primary-dark);
    border-radius: 7px;
}


/* ==================================================
   LOGOUT
   ================================================== */

.logout-btn {
    margin-top: auto;
    border: 0;
    background: #fff;
    color: #6c7b8b;
    padding: 11px;
    border-radius: 10px;
    cursor: pointer;
}


/* ==================================================
   MAIN AREA
   ================================================== */

.main-area {
    margin-left: 245px;
    width: calc(100% - 245px);
    min-height: 100vh;
}


/* ==================================================
   TOPBAR
   ================================================== */

.topbar {
    height: 68px;
    background: rgba(255, 255, 255, .9);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 24px;
    gap: 15px;
    position: sticky;
    top: 0;
    z-index: 10;
}

.topbar-title {
    font-weight: 700;
}

.user-badge {
    margin-left: auto;
    background: #eef3f8;
    padding: 8px 13px;
    border-radius: 20px;
    font-size: 12px;
}

.icon-btn {
    display: none;
    border: 0;
    background: #eef3f8;
    border-radius: 9px;
    padding: 9px;
    cursor: pointer;
}


/* ==================================================
   CONTENT
   ================================================== */

.content-area {
    height: calc(100vh - 68px);
}

iframe {
    width: 100%;
    height: 100%;
    border: 0;
    background: var(--bg);
}


/* ==================================================
   PAGE
   ================================================== */

.page-body {
    padding: 28px;
    min-height: 100vh;
    background: var(--bg);
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-bottom: 24px;
}

.page-header h1 {
    margin: 5px 0;
    font-size: 26px;
}

.page-header p {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
}

.eyebrow {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.5px;
    color: var(--primary);
}


/* ==================================================
   STATISTICS
   ================================================== */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}

.stat-card,
.panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.stat-card {
    padding: 20px;
}

.stat-card span {
    font-size: 13px;
    color: var(--muted);
}

.stat-card strong {
    display: block;
    font-size: 25px;
    margin: 8px 0;
}

.stat-card small {
    color: var(--success);
}


/* ==================================================
   PANEL
   ================================================== */

.panel {
    padding: 22px;
    margin-bottom: 18px;
}

.panel h2 {
    font-size: 17px;
    margin: 0 0 15px;
}

.muted {
    color: var(--muted);
}


/* ==================================================
   COMPONENT
   ================================================== */

.component-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}


/* ==================================================
   FORM GRID
   ================================================== */

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.full {
    grid-column: 1 / -1;
}


/* ==================================================
   CHECKBOX
   ================================================== */

.check-row {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    margin-top: 16px;
}

.check-row label {
    font-weight: 400;
}

.check-row input {
    width: auto;
}


/* ==================================================
   ALERT
   ================================================== */

.alert {
    padding: 12px 14px;
    border-radius: 10px;
    margin: 8px 0;
    font-size: 13px;
}

.alert-info {
    background: #edf3f8;
}

.alert-success {
    background: #edf7f1;
}

.alert-warning {
    background: #fbf5e9;
}
/* ==================================================
   TABLE
   ================================================== */

.table-wrap {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
}


/* TABEL UMUM */

table {
    width: 100%;
    min-width: 600px;
    border-collapse: collapse;
}


/* ==================================================
   TABLE WIDE
   Digunakan untuk tabel dengan banyak kolom
   ================================================== */

table.table-wide {
    width: 100%;
    min-width: 1350px;
    border-collapse: collapse;
}


/* ==================================================
   HEADER & CELL
   ================================================== */

th,
td {
    text-align: left;
    padding: 12px;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
    white-space: nowrap;
    vertical-align: middle;
}


/* HEADER */

th {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
    background: #f7f9fb;
}


/* Hover baris */

tbody tr:hover {
    background: #f8fafc;
}


/* ==================================================
   TABLE WIDE - KOLOM
   ================================================== */


/* No Transaksi */

table.table-wide th:nth-child(1),
table.table-wide td:nth-child(1) {
    min-width: 145px;
    white-space: nowrap;
}


/* Tanggal */

table.table-wide th:nth-child(2),
table.table-wide td:nth-child(2) {
    min-width: 125px;
    white-space: nowrap;
}


/* Pelanggan */

table.table-wide th:nth-child(3),
table.table-wide td:nth-child(3) {
    min-width: 150px;
}


/* Subtotal */

table.table-wide th:nth-child(4),
table.table-wide td:nth-child(4) {
    min-width: 125px;
    white-space: nowrap;
}


/* Diskon */

table.table-wide th:nth-child(5),
table.table-wide td:nth-child(5) {
    min-width: 125px;
    white-space: nowrap;
}


/* PPN % */

table.table-wide th:nth-child(6),
table.table-wide td:nth-child(6) {
    min-width: 75px;
    width: 75px;
    text-align: center;
    white-space: nowrap;
}


/* Nilai PPN */

table.table-wide th:nth-child(7),
table.table-wide td:nth-child(7) {
    min-width: 125px;
    white-space: nowrap;
}


/* Total */

table.table-wide th:nth-child(8),
table.table-wide td:nth-child(8) {
    min-width: 125px;
    white-space: nowrap;
}


/* Bayar */

table.table-wide th:nth-child(9),
table.table-wide td:nth-child(9) {
    min-width: 125px;
    white-space: nowrap;
}


/* Kembalian */

table.table-wide th:nth-child(10),
table.table-wide td:nth-child(10) {
    min-width: 125px;
    white-space: nowrap;
}


/* Jenis Pembayaran */

table.table-wide th:nth-child(11),
table.table-wide td:nth-child(11) {
    min-width: 105px;
    width: 105px;
    white-space: nowrap;
}


/* ==================================================
   KOLOM AKSI
   ================================================== */

table.table-wide th:nth-child(12),
table.table-wide td:nth-child(12) {
    min-width: 125px;
    width: 125px;
    white-space: nowrap !important;
    vertical-align: middle;
}


table.table-wide td.action-column {
    white-space: nowrap !important;
}


/* Tombol aksi */

table.table-wide td.action-column .btn {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;

    width: auto !important;
    min-width: 70px !important;

    margin: 0 4px 0 0 !important;

    white-space: nowrap !important;
    vertical-align: middle;

    text-align: center;

    box-sizing: border-box;
}


/* Hilangkan underline */

table.table-wide td.action-column a {
    text-decoration: none;
}


/* ==================================================
   TEXT WRAP
   Untuk kolom yang memang boleh turun baris
   ================================================== */

td.wrap-text {
    white-space: normal;
    word-break: break-word;
}


/* Kolom keterangan panjang */

td.text-column {
    white-space: normal;
    min-width: 150px;
}


/* ==================================================
   BUTTON DI DALAM TABLE
   ================================================== */

.table-wrap .btn {
    white-space: nowrap;
}


/* ==================================================
   RESPONSIVE TABLE
   ================================================== */

@media (max-width: 900px) {

    .table-wrap {
        width: 100%;
        overflow-x: auto;
    }

    table.table-wide {
        min-width: 1350px;
    }

}

/* ==================================================
   BADGE
   ================================================== */

.badge {
    display: inline-block;
    padding: 5px 9px;
    border-radius: 20px;
    font-size: 11px;
}

.badge.success {
    background: #edf7f1;
    color: #4e8768;
}

.muted-badge {
    background: #eef1f4;
    color: #7c8792;
}

.join-badge {
    background: #FDE7BD;
    color: #7c8792;
}

/* ==================================================
   SIDEBAR OVERLAY
   ================================================== */

.sidebar-overlay {
    display: none;
}


/* ==================================================
   RESPONSIVE - TABLET
   ================================================== */

@media(max-width:900px) {

    .sidebar {
        transform: translateX(-100%);
        transition: .25s;
        box-shadow: 10px 0 30px rgba(30, 50, 70, .12);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-area {
        margin-left: 0;
        width: 100%;
    }

    .icon-btn {
        display: block;
    }

    .sidebar-overlay.show {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(30, 45, 60, .25);
        z-index: 15;
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }
}


/* ==================================================
   RESPONSIVE - MOBILE
   ================================================== */

@media(max-width:600px) {

    .page-body {
        padding: 18px;
    }

    .page-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .full {
        grid-column: auto;
    }

    .login-card {
        padding: 26px;
    }
}

/* ==================================================
   TOGGLE SIDEBAR - TAMPIL DI SEMUA UKURAN LAYAR
   ================================================== */

.icon-btn {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    flex-shrink: 0;
}

/* ==================================================
   SIDEBAR TOGGLE - DESKTOP
   ================================================== */

@media(min-width:901px) {

    .sidebar {
        transition: transform .25s ease;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar:not(.open) {
        transform: translateX(-100%);
    }

    .main-area {
        transition: margin-left .25s ease, width .25s ease;
    }

    .app-shell:has(.sidebar:not(.open)) .main-area {
        margin-left: 0;
        width: 100%;
    }
}

/* ==============================
   PRODUK PENJUALAN
   ============================== */

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 16px;
}

.product-card {
    position: relative;
    padding: 20px;
    transition: all .2s ease;
}

.product-card:hover {
    transform: translateY(-2px);
}

.product-code {
    font-size: 12px;
    color: #789;
    margin-bottom: 6px;
}

.product-name {
    font-size: 17px;
    font-weight: 700;
    margin-bottom: 12px;
    line-height: 1.35;
}

.product-stock {
    font-size: 13px;
    margin-bottom: 12px;
}

.product-price {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 15px;
}

.product-action {
    display: flex;
    gap: 8px;
    align-items: center;
}

.product-qty {
    width: 75px !important;
    text-align: center;
}

@media (max-width: 700px) {
    .product-grid {
        grid-template-columns: 1fr;
    }
}

/* ==================================================
   HISTORY PENJUALAN - FILTER
   ================================================== */

.history-filter {
    display: grid;
    grid-template-columns: minmax(220px, 1.5fr)
                           minmax(170px, .8fr)
                           minmax(170px, .8fr)
                           auto;
    gap: 12px;
    align-items: end;
}

.history-filter .filter-group {
    min-width: 0;
}

.history-filter label {
    display: block;
    margin-bottom: 6px;
}

.history-filter input,
.history-filter select {
    height: 42px;
}

.history-filter .filter-button {
    display: flex;
    gap: 8px;
    align-items: center;
    white-space: nowrap;
}

.history-filter .btn {
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
}

/* History: tombol Edit + Struk selalu satu baris */
.history-table td.action-column {
    white-space: nowrap !important;
    width: 1%;
}

.history-table td.action-column a.btn {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: auto !important;
    min-width: 70px !important;
    margin: 0 4px 0 0 !important;
    white-space: nowrap !important;
    vertical-align: middle;
}

@media (max-width: 1100px) {
    .history-filter {
        grid-template-columns: 1fr 1fr;
    }

    .history-filter .filter-button {
        grid-column: 1 / -1;
    }
}

@media (max-width: 600px) {
    .history-filter {
        grid-template-columns: 1fr;
    }

    .history-filter .filter-button {
        grid-column: auto;
        width: 100%;
    }

    .history-filter .btn {
        flex: 1;
    }
}

/* ==================================================
   MODUL FAKTUR PAJAK
   ================================================== */

/* -----------------------------------------------
   HEADER MODUL
   ----------------------------------------------- */

.faktur-header-action {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}


/* -----------------------------------------------
   UPLOAD PDF
   ----------------------------------------------- */

.faktur-upload-panel {
    max-width: 850px;
    margin: 0 auto;
}

.faktur-upload-box {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 35px 25px;
    text-align: center;
    background: #fafbfd;
    transition: .2s ease;
}

.faktur-upload-box:hover {
    border-color: var(--primary);
    background: #f7f9fc;
}

.faktur-upload-icon {
    font-size: 42px;
    color: var(--primary);
    margin-bottom: 14px;
}

.faktur-upload-box h3 {
    margin: 0 0 8px;
    font-size: 18px;
}

.faktur-upload-box p {
    margin: 0 0 20px;
    color: var(--muted);
    font-size: 13px;
}

.faktur-file-input {
    max-width: 100%;
    margin-bottom: 15px;
}

.faktur-file-info {
    display: none;
    margin-top: 15px;
    padding: 12px 14px;
    background: #edf3f8;
    border-radius: 10px;
    font-size: 13px;
    color: #52657a;
    text-align: left;
}

.faktur-file-info.show {
    display: block;
}


/* -----------------------------------------------
   INFORMASI FAKTUR
   ----------------------------------------------- */

.faktur-info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.faktur-info-item {
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #fafbfd;
}

.faktur-info-item.full {
    grid-column: 1 / -1;
}

.faktur-info-label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .5px;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 6px;
}

.faktur-info-value {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    white-space: normal;
    word-break: break-word;
}


/* -----------------------------------------------
   SUMMARY NILAI FAKTUR
   ----------------------------------------------- */

.faktur-summary {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-top: 18px;
}

.faktur-summary-item {
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fafbfd;
}

.faktur-summary-item span {
    display: block;
    font-size: 12px;
    color: var(--muted);
    margin-bottom: 7px;
}

.faktur-summary-item strong {
    display: block;
    font-size: 17px;
    color: var(--text);
}

.faktur-summary-item.total {
    background: #eef3f8;
    border-color: #dce5ef;
}


/* -----------------------------------------------
   TABEL DETAIL FAKTUR
   ----------------------------------------------- */

.faktur-detail-table {
    min-width: 1150px;
}

.faktur-detail-table th,
.faktur-detail-table td {
    vertical-align: middle;
}

.faktur-detail-table td {
    white-space: normal;
}

.faktur-detail-table .col-no {
    width: 60px;
    min-width: 60px;
    text-align: center;
    white-space: nowrap;
}

.faktur-detail-table .col-produk {
    min-width: 280px;
}

.faktur-detail-table .col-qty {
    min-width: 100px;
    text-align: right;
    white-space: nowrap;
}

.faktur-detail-table .col-harga {
    min-width: 140px;
    text-align: right;
    white-space: nowrap;
}

.faktur-detail-table .col-potongan {
    min-width: 130px;
    text-align: right;
    white-space: nowrap;
}

.faktur-detail-table .col-subtotal {
    min-width: 150px;
    text-align: right;
    white-space: nowrap;
}


/* -----------------------------------------------
   INPUT DI DALAM TABEL DETAIL
   ----------------------------------------------- */

.faktur-detail-table input {
    min-width: 110px;
    padding: 8px 10px;
    border-radius: 8px;
}

.faktur-detail-table input[type="number"] {
    text-align: right;
}

.faktur-detail-table .input-produk {
    min-width: 240px;
}

.faktur-detail-table .input-harga {
    min-width: 130px;
}


/* -----------------------------------------------
   HARGA JUAL
   ----------------------------------------------- */

.faktur-harga-jual {
    font-weight: 700;
}

.faktur-harga-jual input {
    font-weight: 600;
}


/* -----------------------------------------------
   STATUS PDF
   ----------------------------------------------- */

.faktur-pdf-status {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 13px 15px;
    border-radius: 10px;
    font-size: 13px;
    margin-bottom: 16px;
}

.faktur-pdf-status i {
    font-size: 18px;
}

.faktur-pdf-status.temp {
    background: #fbf5e9;
    color: #8a6a37;
}

.faktur-pdf-status.saved {
    background: #edf7f1;
    color: #4e8768;
}


/* -----------------------------------------------
   ACTION BAR
   ----------------------------------------------- */

.faktur-action-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 20px;
    padding-top: 18px;
    border-top: 1px solid var(--border);
}

.faktur-action-left,
.faktur-action-right {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}


/* -----------------------------------------------
   HALAMAN DETAIL
   ----------------------------------------------- */

.faktur-detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 18px;
}

.faktur-detail-meta .badge {
    font-size: 12px;
}


/* -----------------------------------------------
   LIST / RIWAYAT FAKTUR
   ----------------------------------------------- */

.faktur-filter {
    display: grid;
    grid-template-columns:
        minmax(220px, 1.5fr)
        minmax(160px, .7fr)
        minmax(160px, .7fr)
        auto;
    gap: 12px;
    align-items: end;
}

.faktur-filter .filter-group {
    min-width: 0;
}

.faktur-filter label {
    margin-bottom: 6px;
}

.faktur-filter input,
.faktur-filter select {
    height: 42px;
}

.faktur-filter-action {
    display: flex;
    gap: 8px;
    white-space: nowrap;
}

.faktur-filter-action .btn {
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}


/* -----------------------------------------------
   TABEL LIST FAKTUR
   ----------------------------------------------- */

.faktur-list-table {
    min-width: 1150px;
}

.faktur-list-table .col-nomor {
    min-width: 170px;
    white-space: nowrap;
}

.faktur-list-table .col-tanggal {
    min-width: 120px;
    white-space: nowrap;
}

.faktur-list-table .col-pkp {
    min-width: 200px;
}

.faktur-list-table .col-pembeli {
    min-width: 200px;
}

.faktur-list-table .col-dpp,
.faktur-list-table .col-ppn,
.faktur-list-table .col-total {
    min-width: 135px;
    text-align: right;
    white-space: nowrap;
}

.faktur-list-table .action-column {
    min-width: 160px;
    white-space: nowrap !important;
}

.faktur-list-table .action-column .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-right: 4px;
}


/* -----------------------------------------------
   EMPTY STATE
   ----------------------------------------------- */

.faktur-empty {
    padding: 40px 20px;
    text-align: center;
    color: var(--muted);
}

.faktur-empty i {
    display: block;
    font-size: 42px;
    color: #b5c0cc;
    margin-bottom: 14px;
}

.faktur-empty h3 {
    margin: 0 0 7px;
    color: var(--text);
    font-size: 17px;
}

.faktur-empty p {
    margin: 0;
    font-size: 13px;
}


/* -----------------------------------------------
   LOADING
   ----------------------------------------------- */

.faktur-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 25px;
    color: var(--muted);
    font-size: 13px;
}

.faktur-loading i {
    font-size: 20px;
    color: var(--primary);
}


/* -----------------------------------------------
   RESPONSIVE
   ----------------------------------------------- */

@media (max-width: 1100px) {

    .faktur-summary {
        grid-template-columns: repeat(2, 1fr);
    }

    .faktur-filter {
        grid-template-columns: 1fr 1fr;
    }

    .faktur-filter-action {
        grid-column: 1 / -1;
    }
}


@media (max-width: 700px) {

    .faktur-info-grid {
        grid-template-columns: 1fr;
    }

    .faktur-info-item.full {
        grid-column: auto;
    }

    .faktur-summary {
        grid-template-columns: 1fr;
    }

    .faktur-upload-box {
        padding: 28px 18px;
    }

    .faktur-action-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .faktur-action-left,
    .faktur-action-right {
        width: 100%;
    }

    .faktur-action-left .btn,
    .faktur-action-right .btn {
        flex: 1;
        text-align: center;
        justify-content: center;
    }

    .faktur-filter {
        grid-template-columns: 1fr;
    }

    .faktur-filter-action {
        grid-column: auto;
        width: 100%;
    }

    .faktur-filter-action .btn {
        flex: 1;
    }
}

.table-total-label {
    text-align: right;
}


/* ==================================================
   CHECKOUT PENJUALAN
   ================================================== */

.checkout-page {
    padding: 18px 22px 28px;
}

.checkout-page .page-header {
    margin-bottom: 18px;
}

.checkout-page .page-header h1 {
    display: flex;
    align-items: center;
    gap: 9px;
}

.checkout-page .page-header h1 i {
    color: var(--primary-dark);
}

.checkout-layout {
    display: grid;
    grid-template-columns: minmax(360px, 1fr) minmax(480px, 1fr);
    gap: 18px;
    align-items: start;
}

.checkout-card {
    padding: 20px;
    margin-bottom: 0;
}

.checkout-card-title {
    display: flex;
    align-items: center;
    gap: 9px;
    margin: 0 0 16px;
    font-size: 15px;
    font-weight: 700;
}

.checkout-card-title i {
    color: var(--primary-dark);
    width: 18px;
    text-align: center;
}

.checkout-section {
    padding-bottom: 18px;
    margin-bottom: 18px;
    border-bottom: 1px solid var(--border);
}

.checkout-section:last-child {
    padding-bottom: 0;
    margin-bottom: 0;
    border-bottom: 0;
}

.checkout-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 700;
    margin: 0 0 12px;
}

.checkout-section-title i {
    color: var(--primary);
}

.checkout-field {
    margin-bottom: 12px;
}

.checkout-field:last-child {
    margin-bottom: 0;
}

.checkout-field label {
    font-size: 12px;
    color: #536276;
    margin-bottom: 6px;
}

.checkout-input-icon {
    position: relative;
}

.checkout-input-icon input,
.checkout-input-icon select {
    padding-right: 38px;
}

.checkout-input-icon i {
    position: absolute;
    right: 13px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--muted);
    pointer-events: none;
}

.checkout-customer-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.checkout-customer-grid .checkout-field.full-field {
    grid-column: 1 / -1;
}

.checkout-card textarea {
    min-height: 84px;
    resize: vertical;
}

/* PEMBAYARAN */
.checkout-subtotal-line,
.checkout-summary-row,
.checkout-summary-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
}

.checkout-subtotal-line {
    margin-bottom: 12px;
    font-size: 13px;
}

.checkout-subtotal-line strong {
    font-size: 14px;
}

.ppn-control {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.ppn-toggle {
    min-width: 86px;
}

.ppn-percent-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ppn-percent-wrap input {
    width: 100px;
}

.ppn-percent-wrap span {
    color: var(--muted);
    font-size: 13px;
}

.checkout-summary {
    margin: 16px 0;
    padding: 13px 15px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fafbfd;
}

.checkout-summary-row {
    font-size: 13px;
    padding: 4px 0;
}

.checkout-summary-row span:last-child {
    font-weight: 600;
}

.checkout-summary-total {
    margin-top: 8px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
    font-size: 17px;
    font-weight: 800;
}

.checkout-summary-total strong {
    font-size: 18px;
}

.checkout-payment-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.checkout-payment-grid .checkout-field.full-field {
    grid-column: 1 / -1;
}

.checkout-actions {
    display: flex;
    gap: 10px;
    margin-top: 18px;
}

.checkout-actions .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.checkout-actions .btn-success {
    flex: 1;
}

.checkout-empty-cart {
    padding: 13px 14px;
    margin-bottom: 16px;
}

/* RESPONSIVE CHECKOUT */
@media (max-width: 1100px) {
    .checkout-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 650px) {
    .checkout-page {
        padding: 18px;
    }

    .checkout-customer-grid,
    .checkout-payment-grid {
        grid-template-columns: 1fr;
    }

    .checkout-customer-grid .checkout-field.full-field,
    .checkout-payment-grid .checkout-field.full-field {
        grid-column: auto;
    }

    .checkout-actions {
        flex-direction: column;
    }

    .checkout-actions .btn {
        width: 100%;
    }
}
