/* CKM+ APP — ERP Theme (Odoo / SAP Fiori inspired) */
:root {
    --font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
    --font-size-base: 0.875rem;

    --body-bg: #f0f2f5;
    --surface: #ffffff;
    --border-color: #d9d9d9;
    --border-light: #e8e8e8;

    --text-primary: #3d3d3d;
    --text-secondary: #6a6d70;
    --text-muted: #89919a;

    --primary: #0a6ed1;
    --primary-hover: #085cad;
    --primary-light: #e8f3fc;
    --accent: #017e84;

    --sidebar-bg: #ffffff;
    --sidebar-border: #e0e0e0;
    --sidebar-text: #495057;
    --sidebar-text-muted: #6c757d;
    --sidebar-hover: #f5f7fa;
    --sidebar-active-bg: #e8f4fd;
    --sidebar-active-text: #0a6ed1;
    --sidebar-submenu-bg: #fafbfc;

    --success: #107e3e;
    --success-hover: #0d6532;
    --warning: #e9730c;
    --warning-hover: #c45f0a;
    --danger: #bb0000;
    --danger-hover: #9a0000;

    --table-header-bg: #5b9bd5;
    --table-filter-bg: #eef5fc;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.08);
    --radius: 4px;
    --radius-lg: 8px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    color: var(--text-primary);
    background-color: var(--body-bg);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* Bootstrap overrides for uniform ERP look */
.form-control,
.form-select,
.btn,
.table,
.alert,
.card,
.modal-content,
.dropdown-menu {
    font-family: var(--font-family);
    font-size: var(--font-size-base);
}

.form-control,
.form-select {
    color: var(--text-primary);
    border-color: var(--border-color);
    border-radius: var(--radius);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 0.2rem rgba(10, 110, 209, 0.15);
}

.btn-primary {
    background-color: var(--primary);
    border-color: var(--primary);
}

.btn-primary:hover,
.btn-primary:focus {
    background-color: var(--primary-hover);
    border-color: var(--primary-hover);
}

/* Wrapper */
.wrapper {
    display: flex;
    width: 100%;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 250px;
    min-height: 100vh;
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    border-right: 1px solid var(--sidebar-border);
    transition: all 0.3s;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    overflow-y: auto;
    box-shadow: var(--shadow-sm);
}

.sidebar-header {
    padding: 18px 20px;
    border-bottom: 1px solid var(--sidebar-border);
    background: var(--surface);
}

.brand-text {
    color: var(--text-primary);
    font-size: 1.25rem;
    font-weight: 500;
    margin: 0;
    letter-spacing: -0.02em;
}

.brand-bold {
    font-weight: 700;
    color: var(--primary);
}

.sidebar-nav {
    list-style: none;
    padding: 8px 0;
}

.sidebar-nav > li {
    border-bottom: none;
}

.sidebar-nav > li > a {
    display: block;
    padding: 11px 20px;
    color: var(--sidebar-text);
    text-decoration: none;
    font-size: var(--font-size-base);
    font-weight: 400;
    transition: background 0.15s, color 0.15s;
}

.sidebar-nav > li > a:hover,
.sidebar-nav > li.active > a {
    color: var(--sidebar-active-text);
    background: var(--sidebar-active-bg);
    border-left: 3px solid var(--primary);
    padding-left: 17px;
}

.sidebar-nav > li > a i {
    width: 20px;
    margin-right: 10px;
    color: var(--text-muted);
}

.sidebar-nav > li.active > a i,
.sidebar-nav > li > a:hover i {
    color: var(--primary);
}

/* Submenu */
.submenu {
    list-style: none;
    padding: 4px 0;
    display: none;
    background: var(--sidebar-submenu-bg);
    border-top: 1px solid var(--border-light);
}

.has-submenu.open .submenu {
    display: block;
}

.submenu li a {
    display: block;
    padding: 9px 20px 9px 48px;
    color: var(--sidebar-text-muted);
    text-decoration: none;
    font-size: 0.8125rem;
    transition: all 0.15s;
}

.submenu li a::before {
    content: "–";
    margin-right: 8px;
    color: var(--text-muted);
}

.submenu li a:hover,
.submenu li.active a {
    color: var(--sidebar-active-text);
    background: var(--sidebar-active-bg);
}

/* Content */
#content {
    width: calc(100% - 250px);
    margin-left: 250px;
    transition: all 0.3s;
}

/* Topbar */
.topbar {
    background: var(--surface);
    border-bottom: 1px solid var(--border-light);
    padding: 10px 20px;
    box-shadow: var(--shadow-sm);
}

#sidebarToggle {
    font-size: 1.1rem;
    color: var(--text-secondary);
}

#sidebarToggle:hover {
    color: var(--primary);
}

.user-info {
    display: flex;
    align-items: center;
    color: var(--text-secondary);
    font-weight: 400;
    font-size: var(--font-size-base);
}

.user-info i {
    color: var(--text-muted);
}

/* Main Content */
.main-content {
    padding: 24px 28px;
}

/* Page Title */
.page-title {
    font-size: 1.375rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 20px;
    letter-spacing: -0.01em;
}

/* Filter Card */
.filter-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 20px 24px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
}

.filter-card label,
.filter-card .form-label {
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
    font-size: 0.8125rem;
}

.filter-card select,
.filter-card input,
.filter-card .form-select,
.filter-card .form-control {
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    padding: 7px 12px;
    background-color: var(--surface);
    color: var(--text-primary);
}

.filter-card select option {
    background-color: var(--surface);
    color: var(--text-primary);
}

/* Buttons */
.btn-tampilkan {
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 7px 18px;
    border-radius: var(--radius);
    font-weight: 500;
    font-size: var(--font-size-base);
}

.btn-tampilkan:hover {
    background: var(--primary-hover);
    color: #fff;
}

.btn-grafik {
    background: var(--surface);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    padding: 7px 18px;
    border-radius: var(--radius);
    font-weight: 500;
}

.btn-grafik:hover {
    background: var(--sidebar-hover);
    border-color: var(--border-color);
}

.btn-tambah {
    background: var(--success);
    color: #fff;
    border: none;
    padding: 7px 18px;
    border-radius: var(--radius);
    font-weight: 500;
}

.btn-tambah:hover {
    background: var(--success-hover);
    color: #fff;
}

.btn-edit {
    background: var(--warning);
    color: #fff;
    border: none;
    padding: 7px 18px;
    border-radius: var(--radius);
    font-weight: 500;
}

.btn-edit:hover {
    background: var(--warning-hover);
    color: #fff;
}

.btn-hapus {
    background: var(--danger);
    color: #fff;
    border: none;
    padding: 7px 18px;
    border-radius: var(--radius);
    font-weight: 500;
}

.btn-hapus:hover {
    background: var(--danger-hover);
    color: #fff;
}

/* Table Styles */
.table-container {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 16px 20px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table thead th {
    background: var(--table-header-bg);
    color: #fff;
    padding: 10px 10px;
    font-size: 0.8125rem;
    font-weight: 500;
    text-align: center;
    white-space: nowrap;
}

.data-table tbody td {
    padding: 9px 10px;
    border-bottom: 1px solid var(--border-light);
    font-size: 0.8125rem;
    vertical-align: top;
    color: var(--text-primary);
}

.data-table tbody tr:hover {
    background: var(--primary-light);
}

.data-table tbody tr.table-success-soft {
    background-color: #e8f5e9;
}

.data-table tbody tr.table-success-soft:hover {
    background-color: #d4edda;
}

.data-table tbody tr.table-total-row {
    background: #fff3cd;
    border-top: 2px solid #856404;
}

.data-table tbody tr.table-total-row:hover {
    background: #fff3cd;
}

/* Pagination */
.pagination-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 16px 0;
    flex-wrap: wrap;
}

.pagination-wrapper .page-link {
    padding: 5px 10px;
    border: 1px solid var(--border-color);
    text-decoration: none;
    color: var(--text-primary);
    border-radius: var(--radius);
    font-size: 0.8125rem;
}

.pagination-wrapper .page-link.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.pagination-wrapper .page-link:hover:not(.active) {
    background: var(--sidebar-hover);
}

.records-per-page input {
    width: 60px;
    padding: 4px 8px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    text-align: center;
}

/* Print Button */
.btn-cetak {
    background: var(--danger);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
}

.btn-cetak:hover {
    background: var(--danger-hover);
    color: #fff;
}

/* Dashboard / stat cards (legacy) */
.stat-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
    text-align: center;
    transition: box-shadow 0.2s;
}

.stat-card:hover {
    box-shadow: var(--shadow-md);
}

.stat-card .stat-number {
    font-size: 1.75rem;
    font-weight: 500;
    color: var(--primary);
    letter-spacing: -0.02em;
}

.stat-card .stat-number.stat-number-compact {
    font-size: 1.2rem;
}

.stat-card .stat-label {
    color: var(--text-muted);
    font-size: 0.8125rem;
    margin-top: 4px;
    font-weight: 400;
}

/* Dashboard — rapi & compact (selaras order-list) */
.dashboard-page .page-title {
    margin-bottom: 0;
    font-size: 1.15rem;
}

.dashboard-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.dashboard-date {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.dashboard-period-form {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    margin-left: auto;
}

.dashboard-period-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    margin: 0;
    white-space: nowrap;
}

.dashboard-period-sep {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.dashboard-period-form .form-control-sm {
    width: auto;
    min-width: 130px;
}

.dashboard-period-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin: -4px 0 10px;
}

.dashboard-kpis-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.dashboard-kpis {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 6px;
    margin-bottom: 10px;
}

.kpi-item {
    background: var(--surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    padding: 6px 10px;
    min-width: 0;
    box-shadow: none;
}

.kpi-label {
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    line-height: 1.15;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.kpi-value {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--primary);
    letter-spacing: -0.02em;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.kpi-item.kpi-money .kpi-value {
    font-size: 0.82rem;
    font-weight: 600;
}

.kpi-item.kpi-warn {
    border-left: 3px solid var(--warning);
}

.kpi-item.kpi-warn .kpi-value {
    color: var(--warning-hover);
}

.kpi-item.kpi-success {
    border-left: 3px solid var(--success);
}

.kpi-item.kpi-success .kpi-value {
    color: var(--success);
}

a.kpi-item.kpi-link {
    display: block;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    transition: box-shadow 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}

a.kpi-item.kpi-link:hover {
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
    border-color: var(--primary);
    transform: translateY(-1px);
}

a.kpi-item.kpi-link .kpi-hint {
    font-size: 0.6rem;
    color: var(--text-muted);
    margin-top: 2px;
    opacity: 0.85;
}

a.kpi-item.kpi-link:hover .kpi-hint {
    color: var(--primary);
}

.dashboard-detail-back {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.78rem;
    color: var(--text-muted);
    text-decoration: none;
    margin-bottom: 4px;
}

.dashboard-detail-back:hover {
    color: var(--primary);
}

.dashboard-detail-page .dashboard-header {
    align-items: flex-start;
}

tr.dashboard-detail-total th {
    background: var(--surface-alt, #f8fafc);
    font-weight: 600;
    border-top: 2px solid var(--border-light);
}

.dashboard-table {
    padding: 8px 10px;
}

.dashboard-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 6px;
}

.dashboard-section-head h5 {
    font-size: 0.875rem;
    font-weight: 600;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 6px;
    line-height: 1.2;
}

.dashboard-section-head h5 i {
    font-size: 0.8rem;
}

.dashboard-section-head .badge {
    font-size: 0.65rem;
    font-weight: 600;
    padding: 0.2em 0.45em;
}

.dashboard-table .data-table {
    margin-bottom: 0;
}

.dashboard-table .data-table thead th {
    padding: 5px 6px;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    white-space: nowrap;
}

.dashboard-table .data-table tbody td {
    padding: 4px 6px;
    font-size: 0.78rem;
    vertical-align: middle;
}

.dashboard-table .data-table thead tr.filter-row th {
    background: var(--table-filter-bg);
    color: var(--text-primary);
    padding: 3px 4px;
    vertical-align: middle;
    font-weight: 400;
}

.dashboard-table .filter-row .form-select-sm,
.dashboard-table .filter-row .form-control-sm {
    height: 28px;
    min-height: 28px;
    max-height: 28px;
    padding: 0.15rem 0.4rem;
    font-size: 0.75rem;
    line-height: 1.2;
}

.dashboard-table .filter-row .btn {
    height: 28px;
    padding: 0 10px;
    font-size: 0.75rem;
    display: inline-flex;
    align-items: center;
}

.dashboard-table .col-no {
    width: 36px;
    text-align: center;
}

.dashboard-table .col-act {
    width: 36px;
    text-align: center;
}

.dashboard-table .col-qty {
    width: 52px;
}

.dashboard-table .col-date {
    width: 72px;
}

.dashboard-table .btn-update-prod {
    width: 26px;
    height: 26px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    font-size: 0.7rem;
    gap: 4px;
}

.dashboard-table .btn-update-prod .d-md-none {
    display: none !important;
}

.dashboard-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 6px 8px;
    margin-bottom: 8px;
    padding: 8px;
    background: var(--table-filter-bg);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
}

.dashboard-filters .df-field {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1 1 140px;
    min-width: 0;
    max-width: 200px;
}

.dashboard-filters .df-field .form-label {
    margin: 0;
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.dashboard-filters .form-select-sm,
.dashboard-filters .form-control-sm {
    height: 30px;
    min-height: 30px;
    max-height: 30px;
    padding: 0.15rem 0.45rem;
    font-size: 0.78rem;
}

.dashboard-filters .df-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    height: 30px;
}

.dashboard-filters .df-actions .btn {
    height: 30px;
    padding: 0 12px;
    font-size: 0.75rem;
    display: inline-flex;
    align-items: center;
}

.dashboard-table .td-ellipsis,
.dashboard-table .td-pesanan {
    max-width: 140px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dashboard-table .td-pesanan {
    max-width: 160px;
}

.dashboard-table .pagination-wrapper {
    margin: 0;
    gap: 6px;
    align-items: center;
}

.dashboard-table .pagination-wrapper .page-link {
    padding: 2px 6px;
    font-size: 0.72rem;
    min-width: 24px;
    height: 24px;
    line-height: 20px;
    text-align: center;
}

.dashboard-table .records-per-page {
    font-size: 0.72rem;
    gap: 4px;
    align-items: center;
}

.dashboard-table .records-per-page input {
    width: 48px;
    height: 24px;
    padding: 0 4px;
    font-size: 0.72rem;
}

.dashboard-page .alert {
    font-size: 0.8rem;
}

@media (max-width: 1199.98px) {
    .dashboard-kpis,
    .dashboard-kpis-4 {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

/* Tablet: tetap tabel, scroll horizontal */
@media (max-width: 991.98px) {
    .dashboard-filters .df-field {
        flex: 1 1 calc(50% - 8px);
        max-width: none;
    }

    .dashboard-table-scroll {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .dashboard-table .data-table {
        min-width: 900px;
    }
}

/* HP: KPI 2 kolom + baris jadi kartu */
@media (max-width: 767.98px) {
    .dashboard-kpis,
    .dashboard-kpis-4 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 5px;
    }

    .kpi-item {
        padding: 5px 8px;
    }

    .kpi-value {
        font-size: 0.95rem;
    }

    .kpi-item.kpi-money .kpi-value {
        font-size: 0.75rem;
    }

    .dashboard-section-head {
        flex-direction: column;
        align-items: flex-start;
    }

    .dashboard-filters .df-field {
        flex: 1 1 100%;
        max-width: none;
    }

    .dashboard-filters .df-actions {
        width: 100%;
        height: auto;
    }

    .dashboard-filters .df-actions .btn {
        flex: 1 1 0;
        justify-content: center;
    }

    .dashboard-table .data-table {
        min-width: 0;
        width: 100%;
        border: 0;
    }

    .dashboard-table .data-table thead {
        display: none;
    }

    .dashboard-table .data-table tbody {
        display: block;
    }

    .dashboard-table .data-table tr.dashboard-prod-row {
        display: block;
        background: var(--surface);
        border: 1px solid var(--border-light);
        border-radius: var(--radius);
        margin-bottom: 8px;
        padding: 8px 10px;
        box-shadow: none;
    }

    .dashboard-table .data-table tr.dashboard-prod-row.table-success-soft {
        border-left: 3px solid var(--success);
    }

    .dashboard-table .data-table tr.dashboard-empty-row {
        display: block;
        padding: 12px;
        text-align: center;
    }

    .dashboard-table .data-table tr.dashboard-empty-row td {
        display: block;
        border: 0;
        padding: 0;
    }

    .dashboard-table .data-table tr.dashboard-prod-row td {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        gap: 10px;
        padding: 4px 0;
        border: 0;
        border-bottom: 1px dashed var(--border-light);
        font-size: 0.8rem;
        white-space: normal;
        max-width: none;
        text-align: right !important;
        overflow: visible;
        text-overflow: unset;
    }

    .dashboard-table .data-table tr.dashboard-prod-row td:last-child {
        border-bottom: 0;
    }

    .dashboard-table .data-table tr.dashboard-prod-row td::before {
        content: attr(data-label);
        font-size: 0.68rem;
        font-weight: 600;
        color: var(--text-muted);
        text-transform: uppercase;
        letter-spacing: 0.02em;
        text-align: left;
        flex: 0 0 38%;
        max-width: 38%;
    }

    .dashboard-table .data-table tr.dashboard-prod-row td.col-no {
        display: none;
    }

    .dashboard-table .data-table tr.dashboard-prod-row td.col-act {
        order: -1;
        border-bottom: 1px solid var(--border-light);
        margin-bottom: 4px;
        padding-bottom: 8px;
        justify-content: flex-end;
    }

    .dashboard-table .data-table tr.dashboard-prod-row td.col-act::before {
        content: none;
    }

    .dashboard-table .btn-update-prod {
        width: auto;
        height: 32px;
        padding: 0 12px;
        font-size: 0.78rem;
    }

    .dashboard-table .btn-update-prod .d-md-none {
        display: inline !important;
    }

    .dashboard-table .td-pesanan,
    .dashboard-table .td-ellipsis {
        max-width: none;
    }
}

/* Modal table (kota picker, etc.) */
.modal-table thead th {
    background: var(--table-header-bg);
    color: #fff;
    font-weight: 500;
}

.modal-table tbody tr {
    cursor: pointer;
}

.modal-table tbody tr:hover {
    background: var(--primary-light);
}

.modal-table .text-accent {
    color: var(--primary);
    font-weight: 500;
}

.kota-table-scroll {
    max-height: 400px;
    overflow-y: auto;
}

.kota-table-scroll thead {
    position: sticky;
    top: 0;
    z-index: 1;
}

/* Login page */
.login-page {
    background: linear-gradient(135deg, #e8f0f8 0%, #f0f2f5 50%, #e8f4fd 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-family);
}

.login-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 36px 40px;
    width: 100%;
    max-width: 400px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-light);
}

.login-card h2 {
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 28px;
    font-size: 1.5rem;
}

.login-card .brand {
    color: var(--primary);
    font-weight: 700;
}

.btn-login {
    background: var(--primary);
    border: none;
    padding: 10px;
    font-weight: 500;
}

.btn-login:hover {
    background: var(--primary-hover);
}

/* Responsive */
.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.sidebar-backdrop.active {
    display: block;
    opacity: 1;
}

body.sidebar-open {
    overflow: hidden;
}

.chart-wrap,
.table-container canvas,
.main-content canvas {
    position: relative;
    width: 100%;
    max-width: 100%;
}

.chart-wrap {
    min-height: 260px;
}

/* Tablet */
@media (max-width: 991.98px) {
    .sidebar {
        width: min(280px, 86vw);
        transform: translateX(-100%);
        margin-left: 0;
        transition: transform 0.28s ease, box-shadow 0.28s ease;
        box-shadow: none;
    }

    .sidebar.active {
        transform: translateX(0);
        box-shadow: 4px 0 24px rgba(0, 0, 0, 0.18);
    }

    #content {
        width: 100%;
        margin-left: 0;
    }

    #content.active {
        margin-left: 0;
    }

    .main-content {
        padding: 16px;
    }

    .page-title {
        font-size: 1.2rem;
        margin-bottom: 16px;
    }

    .topbar {
        padding: 8px 12px;
        position: sticky;
        top: 0;
        z-index: 900;
    }

    #sidebarToggle {
        min-width: 44px;
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border-radius: var(--radius);
    }

    #sidebarToggle:hover {
        background: var(--sidebar-hover);
    }

    .sidebar-nav > li > a,
    .submenu li a {
        min-height: 44px;
        display: flex;
        align-items: center;
    }

    .filter-card {
        padding: 16px;
    }

    .filter-card .btn,
    .filter-card .btn-tampilkan,
    .action-buttons .btn {
        width: 100%;
    }

    .action-buttons .btn {
        justify-content: center;
    }

    .stat-card {
        padding: 16px;
    }

    .stat-card .stat-number {
        font-size: 1.45rem;
    }

    .stat-card .stat-number.stat-number-compact {
        font-size: 1.05rem;
    }

    .table-container {
        padding: 12px;
        -webkit-overflow-scrolling: touch;
    }

    .table-container .table-responsive,
    .dashboard-table-scroll {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .table-container.is-scrollable::after,
    .table-responsive.is-scrollable::after {
        content: 'Geser untuk lihat kolom lain →';
        display: block;
        font-size: 0.7rem;
        color: var(--text-muted);
        text-align: center;
        padding-top: 8px;
    }

    /* Di HP dashboard sudah mode kartu — jangan tampilkan hint geser */
    .dashboard-table .table-responsive.is-scrollable::after {
        content: none;
        display: none;
    }

    .data-table {
        min-width: 640px;
    }

    .dashboard-table .data-table {
        min-width: 900px;
    }

    .data-table thead th,
    .data-table tbody td {
        padding: 8px;
        font-size: 0.78rem;
    }

    .pagination-wrapper {
        justify-content: center;
    }

    .user-info .btn {
        min-width: 40px;
        min-height: 40px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        padding: 0.35rem 0.55rem;
    }
}

/* Smartphone */
@media (max-width: 767.98px) {
    .main-content {
        padding: 12px;
    }

    .page-title {
        font-size: 1.1rem;
        line-height: 1.35;
    }

    .filter-card .row > [class*="col-"] {
        margin-bottom: 0.25rem;
    }

    .user-info-name {
        display: none;
    }

    .user-info {
        gap: 4px;
    }

    .login-card {
        margin: 16px;
        padding: 28px 22px;
        max-width: none;
    }

    .modal-dialog {
        margin: 0.75rem;
    }

    .modal-dialog.modal-lg,
    .modal-dialog.modal-xl {
        max-width: calc(100vw - 1.5rem);
    }

    .kota-table-scroll {
        max-height: 55vh;
    }

    .customer-code-group {
        flex-direction: column !important;
    }

    .customer-code-group .form-control {
        max-width: 100% !important;
        width: 100%;
    }

    .section-title {
        font-size: 0.95rem;
    }

    .navbar .container-fluid {
        padding-left: 0;
        padding-right: 0;
    }

    /* Override tablet min-width: dashboard HP = kartu, bukan scroll */
    .dashboard-table .data-table {
        min-width: 0 !important;
        width: 100%;
    }

    .dashboard-table .table-responsive.is-scrollable::after,
    .dashboard-table-scroll.is-scrollable::after {
        content: none !important;
        display: none !important;
    }
}

/* Small phones */
@media (max-width: 575.98px) {
    .brand-text {
        font-size: 1.1rem;
    }

    .stat-card .stat-number {
        font-size: 1.25rem;
    }

    .stat-card .stat-number.stat-number-compact {
        font-size: 0.95rem;
        word-break: break-word;
    }

    .data-table {
        min-width: 560px;
    }

    .btn-tampilkan,
    .btn-grafik,
    .btn-tambah,
    .btn-edit,
    .btn-hapus {
        width: 100%;
    }

    .action-buttons {
        flex-direction: column;
    }

    .alert {
        font-size: 0.8125rem;
    }
}

/* Touch devices — jangan paksa tinggi 44px di kontrol compact di dalam tabel */
@media (hover: none) and (pointer: coarse) {
    .sidebar-nav > li > a,
    .submenu li a,
    .topbar .btn,
    .action-buttons .btn,
    .filter-card .btn,
    .order-list-filter .btn,
    .dashboard-filters .btn {
        min-height: 40px;
    }

    .submenu li a {
        padding-top: 12px;
        padding-bottom: 12px;
    }

    .data-table tbody tr:hover {
        background: transparent;
    }

    .form-control-sm,
    .form-select-sm,
    .btn-sm,
    .page-link,
    .dashboard-table .btn-update-prod,
    .order-list-table .btn-cetak {
        min-height: 0;
    }
}

/* Safe area for notched phones */
@supports (padding: max(0px)) {
    .topbar {
        padding-left: max(12px, env(safe-area-inset-left));
        padding-right: max(12px, env(safe-area-inset-right));
    }

    .main-content {
        padding-left: max(12px, env(safe-area-inset-left));
        padding-right: max(12px, env(safe-area-inset-right));
        padding-bottom: max(12px, env(safe-area-inset-bottom));
    }

    .sidebar {
        padding-bottom: env(safe-area-inset-bottom);
    }
}

/* Action buttons group */
.action-buttons {
    display: flex;
    gap: 8px;
    margin: 16px 0;
    flex-wrap: wrap;
}

/* Checkbox in table */
.data-table input[type="checkbox"] {
    width: 16px;
    height: 16px;
}

/* Filter row in table header */
.data-table thead tr:nth-child(2) th {
    background: var(--table-filter-bg);
    padding: 5px;
}

.data-table thead tr:nth-child(2) th input {
    width: 100%;
    padding: 4px 6px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 0.75rem;
    background: var(--surface);
    color: var(--text-primary);
}

/* Search dropdowns */
.customer-search-results,
.item-search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1050;
    overflow-y: auto;
    margin-top: 2px;
    border: 1px solid var(--border-color);
    border-radius: 0 0 var(--radius) var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-md);
}

.customer-search-results {
    max-height: 280px;
}

.item-search-results {
    max-height: 220px;
}

.customer-search-results .list-group-item,
.item-search-results .list-group-item {
    cursor: pointer;
    border-left: none;
    border-right: none;
    font-size: var(--font-size-base);
    color: var(--text-primary);
}

.customer-search-results .list-group-item:first-child,
.item-search-results .list-group-item:first-child {
    border-top: none;
}

.customer-search-results .list-group-item:hover,
.item-search-results .list-group-item:hover {
    background-color: var(--primary-light);
}

.item-search-results .create-item-panel {
    cursor: default;
    background: #f8fafc;
}

.item-search-results .create-item-panel:hover {
    background: #f8fafc;
}

.item-search-results .create-item-trigger {
    font-weight: 500;
}

/* Section headings inside pages */
.section-title {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-primary);
    margin: 20px 0 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-light);
}

/* Order items view — compact */
.order-view-page .page-title {
    font-size: 1.1rem;
    margin-bottom: 0;
}

.order-view-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.order-view-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.order-meta-card {
    background: var(--surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    margin-bottom: 10px;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.order-view-tabs {
    border-bottom: 1px solid var(--border-light);
    padding: 0 8px;
    gap: 0;
    background: #fafbfc;
}

.order-view-tabs .nav-link {
    color: var(--text-secondary);
    border: none !important;
    border-radius: 0;
    padding: 0.4rem 0.75rem;
    font-size: 0.8125rem;
    margin-bottom: 0;
}

.order-view-tabs .nav-link.active {
    color: var(--primary);
    font-weight: 600;
    background: transparent;
    border-bottom: 2px solid var(--primary) !important;
}

.order-view-tab-panel {
    padding: 8px 10px;
    border: none !important;
}

.order-info-compact {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 4px 12px;
}

.order-info-compact .oi {
    min-width: 0;
    padding: 2px 0;
}

.order-info-compact .oi.oi-wide {
    grid-column: 1 / -1;
}

.order-info-compact .oi span {
    display: block;
    font-size: 0.65rem;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.02em;
    line-height: 1.2;
}

.order-info-compact .oi b {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.3;
    word-break: break-word;
}

.order-info-grid strong {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.15rem;
}

.order-import-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px dashed var(--border-light);
}

.order-detail-card {
    background: var(--surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.order-detail-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 6px 10px;
    background: #f5f7fa;
    border-bottom: 1px solid var(--border-light);
    font-size: 0.8125rem;
    font-weight: 600;
}

.order-items-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding: 0 !important;
    border: none !important;
    box-shadow: none !important;
    border-radius: 0 !important;
}

.order-items-table {
    min-width: 980px;
}

.order-items-table thead th {
    white-space: nowrap;
    font-size: 0.7rem;
    vertical-align: middle;
    padding: 5px 6px !important;
}

.order-items-table tbody td {
    vertical-align: middle;
    padding: 4px 6px !important;
    font-size: 0.75rem;
}

.order-items-table .form-control-sm,
.order-items-table .form-select-sm {
    min-width: 90px;
}

.order-items-table td.position-relative .item-search-results {
    position: absolute;
    z-index: 20;
    left: 0;
    right: 0;
    max-height: 220px;
    overflow-y: auto;
}

.order-items-table td:nth-child(3) .form-control-sm {
    min-width: 160px;
}

.order-detail-footer {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px;
    border-top: 1px solid var(--border-light);
    background: #fafbfc;
}

.order-detail-footer .btn-warning {
    background-color: #ffc107;
    border-color: #ffc107;
}

.order-totals {
    display: flex;
    gap: 14px;
    font-size: 0.78rem;
    color: var(--text-secondary);
}

.order-totals strong {
    color: var(--text-primary);
}

.item-form-modal-dialog {
    max-width: 420px;
}

.item-form-modal-dialog .modal-body {
    overflow-x: hidden;
    overflow-y: auto;
}

.item-form-vertical .position-relative {
    z-index: 2;
}

.item-form-vertical .position-relative:focus-within {
    z-index: 20;
}

.item-form-vertical .item-search-results {
    z-index: 1060;
    max-height: 320px;
}

.item-form-vertical .form-label {
    margin-bottom: 0.2rem;
    font-size: 0.75rem;
}

.item-form-vertical .mb-3 {
    margin-bottom: 0.55rem !important;
}

.item-form-vertical .form-control,
.item-form-vertical .form-select {
    background-color: #f5f5f5;
    padding: 0.3rem 0.55rem;
    font-size: 0.8125rem;
}

.order-items-table tbody tr.item-row {
    cursor: pointer;
}

.order-items-table tbody tr.item-row:hover {
    background-color: var(--primary-light);
}

.order-items-table .item-edit-link {
    color: var(--primary);
    text-decoration: underline;
    cursor: pointer;
}

.order-items-table .item-edit-link:hover {
    color: var(--primary-dark, #0a58ca);
}

#modalProductResults {
    position: absolute;
    z-index: 30;
    left: 0;
    right: 0;
    max-height: 200px;
    overflow-y: auto;
}

.order-accurate-panel {
    background: #f8fbff;
    border: 1px solid #d6e9f8;
    border-radius: var(--radius);
    padding: 0.5rem 0.65rem;
}

.order-items-table .cell-keterangan {
    max-width: 160px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 0.7rem;
}

@media (max-width: 991.98px) {
    .order-info-compact {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 575.98px) {
    .order-info-compact {
        grid-template-columns: 1fr;
    }

    .order-view-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .order-detail-footer {
        flex-direction: column;
        align-items: stretch;
    }

    .order-totals {
        justify-content: space-between;
    }
}

/* Order list pages (harian / bulanan) — compact */
.order-list-page .page-title {
    margin-bottom: 0;
    font-size: 1.15rem;
}

.order-list-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.order-list-meta {
    font-size: 0.75rem;
}

.order-list-filter {
    padding: 8px 12px;
    margin-bottom: 8px;
}

.order-list-filter-form {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 8px 10px;
}

.order-list-filter .olf-field {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 3px;
    min-width: 0;
    flex: 0 0 auto;
}

.order-list-filter .olf-field .form-label {
    margin-bottom: 0;
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    line-height: 1.2;
}

.order-list-filter .olf-marketing {
    flex: 1 1 180px;
    max-width: 240px;
}

.order-list-filter .olf-date {
    flex: 0 0 150px;
    width: 150px;
}

.order-list-filter .olf-bulan {
    flex: 0 0 120px;
    width: 120px;
}

.order-list-filter .olf-tahun {
    flex: 0 0 90px;
    width: 90px;
}

/* Periode: dua select sejajar, tinggi tetap (jangan di-stretch flex) */
.order-list-filter .olf-period {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 6px;
    width: 100%;
    flex: 0 0 auto;
}

.order-list-filter .olf-period .form-select {
    flex: 1 1 0;
    width: auto;
    min-width: 0;
    max-height: 32px;
    height: 32px;
}

.order-list-filter .olf-actions {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 6px;
    height: 32px;
    padding-bottom: 0;
    margin-left: 2px;
}

.order-list-filter .olf-actions .btn {
    height: 32px;
    padding: 0 12px;
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
}

.order-list-filter .form-select-sm,
.order-list-filter .form-control-sm {
    height: 32px;
    min-height: 32px;
    max-height: 32px;
    padding: 0.25rem 0.6rem;
    font-size: 0.8125rem;
    line-height: 1.2;
}

.order-list-page .accurate-sync-bar {
    padding: 6px 10px !important;
    margin-bottom: 8px !important;
}

.order-list-page .accurate-sync-bar .btn {
    padding: 0.2rem 0.55rem;
    font-size: 0.75rem;
}

.order-list-actions {
    margin: 6px 0 8px;
    gap: 6px;
}

.order-list-actions .btn {
    padding: 4px 10px;
    font-size: 0.78rem;
}

.order-list-page .pagination-wrapper {
    margin: 0 0 8px;
    gap: 8px;
}

.order-list-table {
    padding: 8px 10px;
}

.order-list-table .data-table thead th {
    padding: 5px 6px;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.01em;
}

.order-list-table .data-table tbody td {
    padding: 4px 6px;
    font-size: 0.78rem;
    vertical-align: middle;
}

.order-list-table .data-table thead tr:nth-child(2) th {
    padding: 3px 4px;
}

.order-list-table .col-check {
    width: 52px;
    white-space: nowrap;
}

.order-list-table .col-po,
.order-list-table .col-act {
    width: 36px;
}

.order-list-table .btn-cetak {
    width: 24px;
    height: 24px;
    font-size: 0.65rem;
}

.order-list-table .badge {
    font-size: 0.65rem;
    font-weight: 600;
    padding: 0.2em 0.45em;
}

.order-list-table .cell-ellipsis {
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.order-list-table .cell-alamat {
    max-width: 160px;
}

.order-list-table .data-table input[type="checkbox"] {
    width: 14px;
    height: 14px;
    margin: 0 4px 0 0;
    vertical-align: middle;
}

@media (max-width: 768px) {
    .order-list-filter .olf-marketing,
    .order-list-filter .olf-date,
    .order-list-filter .olf-bulan,
    .order-list-filter .olf-tahun {
        flex: 1 1 calc(50% - 6px);
        max-width: none;
        width: auto;
    }

    .order-list-filter .olf-actions {
        width: 100%;
        height: auto;
        margin-left: 0;
    }

    .order-list-filter .olf-actions .btn {
        flex: 1 1 0;
        justify-content: center;
    }

    .order-list-table .data-table {
        min-width: 720px;
    }

    .order-list-table .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .order-list-table .cell-ellipsis,
    .order-list-table .cell-alamat {
        max-width: 110px;
    }

    .order-list-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .order-list-actions {
        width: 100%;
    }

    .order-list-actions .btn {
        flex: 1 1 auto;
    }
}

@media (max-width: 575.98px) {
    .order-list-filter .olf-marketing,
    .order-list-filter .olf-date,
    .order-list-filter .olf-bulan,
    .order-list-filter .olf-tahun {
        flex: 1 1 100%;
    }
}

/* Input angka Indonesia */
.js-angka,
input[data-angka] {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

/* Master Data — compact, seragam order-list / dashboard */
.master-page .page-title {
    margin-bottom: 0;
    font-size: 1.15rem;
}

.master-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.master-meta {
    font-size: 0.75rem;
}

.master-page .alert {
    font-size: 0.8rem;
    padding: 0.4rem 0.65rem;
    margin-bottom: 8px;
}

.master-form-card,
.master-filter {
    padding: 8px 12px;
    margin-bottom: 8px;
}

.master-form-title {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin: 0 0 6px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.master-form-card .form-label,
.master-filter .form-label {
    margin-bottom: 2px;
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.master-form-card .form-control,
.master-form-card .form-select,
.master-filter .form-control,
.master-filter .form-select {
    height: 32px;
    min-height: 32px;
    padding: 0.25rem 0.55rem;
    font-size: 0.8125rem;
}

.master-form-card .row {
    --bs-gutter-x: 0.5rem;
    --bs-gutter-y: 0.45rem;
}

.master-form-card .btn,
.master-filter .btn {
    height: 32px;
    padding: 0 12px;
    font-size: 0.78rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.master-filter-form {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 8px 10px;
}

.master-filter-form .mf-field {
    flex: 1 1 200px;
    min-width: 0;
    max-width: 320px;
}

.master-filter-form .mf-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    height: 32px;
    margin-left: auto;
}

.master-table {
    padding: 8px 10px;
}

.master-table .data-table thead th {
    padding: 5px 6px;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    white-space: nowrap;
}

.master-table .data-table tbody td {
    padding: 4px 6px;
    font-size: 0.78rem;
    vertical-align: middle;
}

.master-table .data-table input[type="checkbox"] {
    width: 14px;
    height: 14px;
    margin: 0;
    vertical-align: middle;
}

.master-table .badge {
    font-size: 0.65rem;
    font-weight: 600;
    padding: 0.2em 0.45em;
}

.master-table .btn-sm {
    width: 26px;
    height: 26px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
}

.master-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.master-actions .btn {
    padding: 4px 10px;
    font-size: 0.78rem;
    height: 30px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.master-actions .page-link {
    padding: 2px 7px;
    font-size: 0.72rem;
    min-width: 24px;
    height: 24px;
    line-height: 20px;
    text-align: center;
}

.master-table .table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Accurate master */
.master-accurate .master-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
    margin-bottom: 8px;
}

.master-accurate .master-kpi {
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    padding: 6px 10px;
    background: var(--surface);
    min-width: 0;
}

.master-accurate .master-kpi .kpi-label {
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 2px;
}

.master-accurate .master-kpi .kpi-value {
    font-size: 1rem;
    font-weight: 600;
    color: var(--primary);
    line-height: 1.2;
}

.master-accurate .master-panel {
    background: var(--surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    margin-bottom: 8px;
    overflow: hidden;
}

.master-accurate .master-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
    padding: 7px 10px;
    background: var(--table-filter-bg);
    border-bottom: 1px solid var(--border-light);
    font-size: 0.8125rem;
    font-weight: 600;
}

.master-accurate .master-panel-head.primary {
    background: var(--primary);
    color: #fff;
    border-bottom-color: var(--primary-hover);
}

.master-accurate .master-panel-body {
    padding: 8px 10px;
}

.master-accurate .master-panel-body .table {
    font-size: 0.78rem;
    margin-bottom: 0;
}

.master-accurate .master-panel-body .table th {
    width: 130px;
    font-weight: 600;
    color: var(--text-muted);
    padding: 4px 6px;
    font-size: 0.72rem;
}

.master-accurate .master-panel-body .table td {
    padding: 4px 6px;
}

.master-accurate .master-panel-head .btn,
.master-accurate .master-panel-body .btn {
    height: 28px;
    padding: 0 10px;
    font-size: 0.72rem;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.master-accurate .master-hint {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin: 0 0 6px;
}

@media (max-width: 991.98px) {
    .master-accurate .master-kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .master-filter-form .mf-field {
        max-width: none;
        flex: 1 1 calc(50% - 8px);
    }

    .master-filter-form .mf-actions {
        margin-left: 0;
        width: 100%;
    }
}

@media (max-width: 767.98px) {
    .master-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 2px;
    }

    .master-form-card .btn,
    .master-filter .btn,
    .master-actions .btn {
        width: 100%;
    }

    .master-filter-form .mf-field {
        flex: 1 1 100%;
    }

    .master-filter-form .mf-actions {
        width: 100%;
        height: auto;
    }

    .master-accurate .master-kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .master-table .data-table {
        min-width: 560px;
    }
}
