/* ============================================================
   Business Central 365 Style – Parfume Gallery
   ============================================================ */

:root {
    --bc-primary: #0078D4;
    --bc-primary-hover: #106EBE;
    --bc-primary-dark: #005A9E;
    --bc-bg-app: #F3F2F1;
    --bc-bg-sidebar: #FAF9F8;
    --bc-bg-card: #FFFFFF;
    --bc-border: #EDEBE9;
    --bc-border-strong: #D2D0CE;
    --bc-text: #201F1E;
    --bc-text-secondary: #605E5C;
    --bc-text-muted: #A19F9D;
    --bc-success: #107C10;
    --bc-warning: #FFB900;
    --bc-danger: #D13438;
    --bc-info: #0078D4;
    --bc-topbar-height: 48px;
    --bc-sidebar-width: 260px;
    --bc-ribbon-height: 44px;
    --bc-shadow: 0 1.6px 3.6px rgba(0, 0, 0, .08), 0 .3px .9px rgba(0, 0, 0, .06);
    --bc-shadow-2: 0 3.2px 7.2px rgba(0, 0, 0, .1), 0 .6px 1.8px rgba(0, 0, 0, .08);
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    height: 100%;
    font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", sans-serif;
    font-size: 13px;
    color: var(--bc-text);
    background-color: var(--bc-bg-app);
}

/* ============ LAYOUT ============ */
.bc-app {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* ============ SIDEBAR ============ */
.bc-sidebar {
    width: var(--bc-sidebar-width);
    background: var(--bc-bg-sidebar);
    border-right: 1px solid var(--bc-border);
    display: flex;
    flex-direction: column;
    transition: width .2s ease;
    overflow-y: auto;
    overflow-x: hidden;
    flex-shrink: 0;
}

.bc-sidebar.collapsed {
    width: 48px;
}

.bc-sidebar.collapsed .bc-sidebar-text,
.bc-sidebar.collapsed .bc-sidebar-group-title,
.bc-sidebar.collapsed .bc-sidebar-chevron {
    display: none;
}

.bc-sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    height: var(--bc-topbar-height);
    border-bottom: 1px solid var(--bc-border);
    font-weight: 600;
    font-size: 14px;
    color: var(--bc-primary-dark);
    flex-shrink: 0;
}

.bc-sidebar-brand-icon {
    width: 24px;
    height: 24px;
    background: linear-gradient(135deg, var(--bc-primary), #50E6FF);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: bold;
    font-size: 12px;
    flex-shrink: 0;
}

.bc-sidebar-group {
    padding: 6px 0;
}

.bc-sidebar-group-title {
    padding: 8px 16px 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--bc-text-muted);
}

.bc-sidebar-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    color: var(--bc-text);
    text-decoration: none;
    font-size: 13px;
    border-left: 3px solid transparent;
    transition: background .15s ease;
    white-space: nowrap;
}

.bc-sidebar-link:hover {
    background: rgba(0, 120, 212, .08);
    color: var(--bc-primary-dark);
    text-decoration: none;
}

.bc-sidebar-link.active {
    background: rgba(0, 120, 212, .12);
    border-left-color: var(--bc-primary);
    color: var(--bc-primary-dark);
    font-weight: 600;
}

.bc-sidebar-link i {
    font-size: 16px;
    width: 18px;
    text-align: center;
    flex-shrink: 0;
}

.bc-sidebar-chevron {
    margin-left: auto;
    font-size: 10px;
    transition: transform .2s ease;
}

.bc-sidebar-link[aria-expanded="true"] .bc-sidebar-chevron {
    transform: rotate(90deg);
}

/* ============ MAIN AREA ============ */
.bc-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 0;
}

/* ============ TOPBAR ============ */
.bc-topbar {
    height: var(--bc-topbar-height);
    background: #FFFFFF;
    border-bottom: 1px solid var(--bc-border);
    display: flex;
    align-items: center;
    padding: 0 12px;
    gap: 8px;
    flex-shrink: 0;
    box-shadow: var(--bc-shadow);
    z-index: 10;
}

.bc-topbar-btn {
    background: transparent;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--bc-text-secondary);
    cursor: pointer;
    transition: background .15s;
}

.bc-topbar-btn:hover {
    background: var(--bc-bg-app);
    color: var(--bc-text);
}

.bc-search {
    flex: 1;
    max-width: 480px;
    position: relative;
}

.bc-search input {
    width: 100%;
    height: 32px;
    border: 1px solid var(--bc-border-strong);
    border-radius: 4px;
    padding: 0 12px 0 34px;
    font-size: 13px;
    background: #FFFFFF;
    transition: border-color .15s;
}

.bc-search input:focus {
    outline: none;
    border-color: var(--bc-primary);
    box-shadow: 0 0 0 1px var(--bc-primary);
}

.bc-search i {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--bc-text-muted);
    font-size: 13px;
}

.bc-topbar-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 4px;
}

.bc-user-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 10px;
    border-radius: 4px;
    cursor: pointer;
    transition: background .15s;
}

.bc-user-badge:hover {
    background: var(--bc-bg-app);
}

.bc-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--bc-primary), #50E6FF);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 12px;
}

.bc-company-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: rgba(0, 120, 212, .08);
    border: 1px solid rgba(0, 120, 212, .2);
    border-radius: 4px;
    font-size: 12px;
    color: var(--bc-primary-dark);
    font-weight: 600;
}

.bc-company-badge i {
    font-size: 12px;
}

/* ============ CONTENT ============ */
.bc-content {
    flex: 1;
    overflow-y: auto;
    padding: 0;
    background: var(--bc-bg-app);
}

.bc-page-header {
    background: #FFFFFF;
    padding: 16px 24px 12px;
    border-bottom: 1px solid var(--bc-border);
}

.bc-breadcrumb {
    font-size: 12px;
    color: var(--bc-text-secondary);
    margin-bottom: 4px;
}

.bc-breadcrumb a {
    color: var(--bc-primary);
    text-decoration: none;
}

.bc-breadcrumb a:hover {
    text-decoration: underline;
}

.bc-page-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--bc-text);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.bc-page-title i {
    color: var(--bc-primary);
}

/* ============ RIBBON (Action Bar) ============ */
.bc-ribbon {
    background: #FFFFFF;
    border-bottom: 1px solid var(--bc-border);
    padding: 6px 24px;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.bc-ribbon-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border: 1px solid transparent;
    background: transparent;
    border-radius: 4px;
    font-size: 13px;
    color: var(--bc-text);
    cursor: pointer;
    text-decoration: none;
    transition: background .15s;
    white-space: nowrap;
}

.bc-ribbon-btn:hover {
    background: var(--bc-bg-app);
    color: var(--bc-text);
    text-decoration: none;
}

.bc-ribbon-btn.bc-primary {
    background: var(--bc-primary);
    color: #fff;
    border-color: var(--bc-primary);
    font-weight: 600;
}

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

.bc-ribbon-btn.bc-danger {
    color: var(--bc-danger);
}

.bc-ribbon-btn.bc-danger:hover {
    background: rgba(209, 52, 56, .08);
}

.bc-ribbon-divider {
    width: 1px;
    height: 20px;
    background: var(--bc-border-strong);
    margin: 0 6px;
}

/* ============ CARD ============ */
.bc-card {
    background: #FFFFFF;
    border: 1px solid var(--bc-border);
    border-radius: 4px;
    margin: 16px 24px;
    box-shadow: var(--bc-shadow);
}

.bc-card-header {
    padding: 12px 16px;
    border-bottom: 1px solid var(--bc-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 600;
    font-size: 13px;
}

.bc-card-body {
    padding: 16px;
}

/* ============ TABLE ============ */
.bc-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.bc-table thead th {
    background: var(--bc-bg-sidebar);
    color: var(--bc-text-secondary);
    font-weight: 600;
    font-size: 12px;
    text-align: left;
    padding: 10px 12px;
    border-bottom: 1px solid var(--bc-border-strong);
    text-transform: uppercase;
    letter-spacing: .3px;
    white-space: nowrap;
}

.bc-table tbody td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--bc-border);
    color: var(--bc-text);
    vertical-align: middle;
}

.bc-table tbody tr:hover {
    background: #F8F8F8;
}

.bc-table tbody tr:last-child td {
    border-bottom: none;
}

.bc-table-actions {
    display: flex;
    gap: 4px;
}

/* ============ FORM ============ */
.bc-form-group {
    margin-bottom: 16px;
}

.bc-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--bc-text);
}

.bc-label.required::after {
    content: " *";
    color: var(--bc-danger);
}

.bc-input,
.bc-select,
.bc-textarea {
    width: 100%;
    height: 32px;
    padding: 0 10px;
    font-size: 13px;
    color: var(--bc-text);
    background: #FFFFFF;
    border: 1px solid var(--bc-border-strong);
    border-radius: 4px;
    transition: border-color .15s, box-shadow .15s;
}

.bc-textarea {
    height: auto;
    padding: 8px 10px;
    resize: vertical;
    min-height: 80px;
}

.bc-input:focus,
.bc-select:focus,
.bc-textarea:focus {
    outline: none;
    border-color: var(--bc-primary);
    box-shadow: 0 0 0 1px var(--bc-primary);
}

.bc-input:disabled,
.bc-select:disabled {
    background: var(--bc-bg-app);
    color: var(--bc-text-muted);
    cursor: not-allowed;
}

.bc-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    cursor: pointer;
    height: 32px;
}

.bc-checkbox input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--bc-primary);
    cursor: pointer;
}

.bc-form-actions {
    display: flex;
    gap: 8px;
    padding: 12px 0;
    border-top: 1px solid var(--bc-border);
    margin-top: 20px;
}

/* ============ BUTTONS ============ */
.bc-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 600;
    border-radius: 4px;
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    transition: all .15s;
    white-space: nowrap;
}

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

.bc-btn-primary:hover {
    background: var(--bc-primary-hover);
    border-color: var(--bc-primary-hover);
    color: #fff;
    text-decoration: none;
}

.bc-btn-default {
    background: #FFFFFF;
    color: var(--bc-text);
    border-color: var(--bc-border-strong);
}

.bc-btn-default:hover {
    background: var(--bc-bg-app);
    color: var(--bc-text);
    text-decoration: none;
}

.bc-btn-danger {
    background: transparent;
    color: var(--bc-danger);
    border-color: transparent;
}

.bc-btn-danger:hover {
    background: rgba(209, 52, 56, .08);
    color: var(--bc-danger);
}

.bc-btn-icon {
    width: 32px;
    height: 32px;
    padding: 0;
    justify-content: center;
}

.bc-btn-sm {
    padding: 4px 10px;
    font-size: 12px;
}

/* ============ BADGE ============ */
.bc-badge {
    display: inline-block;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 10px;
    text-transform: uppercase;
    letter-spacing: .3px;
}

.bc-badge-success {
    background: rgba(16, 124, 16, .12);
    color: var(--bc-success);
}

.bc-badge-danger {
    background: rgba(209, 52, 56, .12);
    color: var(--bc-danger);
}

.bc-badge-warning {
    background: rgba(255, 185, 0, .18);
    color: #8A6D00;
}

.bc-badge-info {
    background: rgba(0, 120, 212, .12);
    color: var(--bc-info);
}

.bc-badge-secondary {
    background: var(--bc-bg-app);
    color: var(--bc-text-secondary);
}

/* ============ ALERT ============ */
.bc-alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 4px;
    margin: 12px 24px 0;
    font-size: 13px;
    border-left: 3px solid;
}

.bc-alert-success {
    background: rgba(16, 124, 16, .06);
    border-color: var(--bc-success);
    color: #0B5A0B;
}

.bc-alert-danger {
    background: rgba(209, 52, 56, .06);
    border-color: var(--bc-danger);
    color: #8B1F22;
}

.bc-alert-info {
    background: rgba(0, 120, 212, .06);
    border-color: var(--bc-info);
    color: var(--bc-primary-dark);
}

/* ============ FILTER BAR ============ */
.bc-filter-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 24px;
    background: #FFFFFF;
    border-bottom: 1px solid var(--bc-border);
    flex-wrap: wrap;
}

.bc-filter-bar .bc-input,
.bc-filter-bar .bc-select {
    height: 30px;
    font-size: 12px;
}

.bc-filter-bar .bc-input {
    max-width: 280px;
}

.bc-filter-bar .bc-select {
    max-width: 220px;
}

/* ============ PAGINATION ============ */
.bc-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-top: 1px solid var(--bc-border);
    font-size: 12px;
    color: var(--bc-text-secondary);
}

.bc-pagination-pages {
    display: flex;
    gap: 4px;
}

.bc-page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 28px;
    padding: 0 8px;
    border: 1px solid var(--bc-border-strong);
    border-radius: 4px;
    background: #FFFFFF;
    color: var(--bc-text);
    text-decoration: none;
    font-size: 12px;
}

.bc-page-link:hover {
    background: var(--bc-bg-app);
    color: var(--bc-text);
    text-decoration: none;
}

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

.bc-page-link.disabled {
    opacity: .5;
    pointer-events: none;
}

/* ============ EMPTY STATE ============ */
.bc-empty {
    text-align: center;
    padding: 48px 24px;
    color: var(--bc-text-muted);
}

.bc-empty i {
    font-size: 40px;
    display: block;
    margin-bottom: 12px;
    color: var(--bc-border-strong);
}

/* ============ LOGIN ============ */
.bc-login-bg {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0078D4 0%, #005A9E 50%, #003D66 100%);
    padding: 20px;
}

.bc-login-card {
    background: #FFFFFF;
    border-radius: 8px;
    padding: 40px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, .25);
}

.bc-login-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 24px;
}

.bc-login-logo-icon {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, var(--bc-primary), #50E6FF);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: bold;
    font-size: 20px;
}

.bc-login-title {
    font-size: 22px;
    font-weight: 600;
    text-align: center;
    margin: 0 0 4px;
    color: var(--bc-text);
}

.bc-login-subtitle {
    font-size: 13px;
    color: var(--bc-text-secondary);
    text-align: center;
    margin-bottom: 28px;
}

/* ============ DASHBOARD STATS ============ */
.bc-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    padding: 16px 24px;
}

.bc-stat-card {
    background: #FFFFFF;
    border: 1px solid var(--bc-border);
    border-radius: 4px;
    padding: 16px;
    box-shadow: var(--bc-shadow);
    display: flex;
    align-items: center;
    gap: 12px;
}

.bc-stat-icon {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.bc-stat-icon.blue {
    background: rgba(0, 120, 212, .12);
    color: var(--bc-primary);
}

.bc-stat-icon.green {
    background: rgba(16, 124, 16, .12);
    color: var(--bc-success);
}

.bc-stat-icon.orange {
    background: rgba(255, 185, 0, .18);
    color: #8A6D00;
}

.bc-stat-icon.red {
    background: rgba(209, 52, 56, .12);
    color: var(--bc-danger);
}

.bc-stat-value {
    font-size: 20px;
    font-weight: 600;
    color: var(--bc-text);
    line-height: 1.2;
}

.bc-stat-label {
    font-size: 12px;
    color: var(--bc-text-secondary);
    margin-top: 2px;
}

/* ============ SCROLLBAR ============ */
.bc-content::-webkit-scrollbar,
.bc-sidebar::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.bc-content::-webkit-scrollbar-thumb,
.bc-sidebar::-webkit-scrollbar-thumb {
    background: var(--bc-border-strong);
    border-radius: 4px;
}

.bc-content::-webkit-scrollbar-thumb:hover,
.bc-sidebar::-webkit-scrollbar-thumb:hover {
    background: var(--bc-text-muted);
}

/* ============ RESPONSIVE ============ */
@media (max-width: 768px) {
    .bc-sidebar {
        position: fixed;
        z-index: 100;
        height: 100vh;
    }

    .bc-sidebar.collapsed {
        width: 0;
        overflow: hidden;
        border: none;
    }

    .bc-search {
        max-width: 100%;
    }

    .bc-content {
        padding: 0;
    }
}

/* ============ INFO ROW (View Detail) ============ */
.bc-info-row {
    display: flex;
    padding: 8px 0;
    border-bottom: 1px dashed var(--bc-border);
    font-size: 13px;
}

.bc-info-row:last-child {
    border-bottom: none;
}

.bc-info-label {
    width: 160px;
    color: var(--bc-text-secondary);
    flex-shrink: 0;
    font-size: 12px;
}

.bc-info-value {
    color: var(--bc-text);
    flex: 1;
    word-break: break-word;
}

/* ============ TIMELINE (Optional) ============ */
.bc-timeline {
    padding: 12px 0;
}

.bc-timeline-item {
    display: flex;
    gap: 12px;
    padding: 8px 0;
    position: relative;
}

.bc-timeline-item::before {
    content: "";
    position: absolute;
    left: 11px;
    top: 28px;
    bottom: -8px;
    width: 2px;
    background: var(--bc-border);
}

.bc-timeline-item:last-child::before {
    display: none;
}

.bc-timeline-dot {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--bc-bg-app);
    border: 2px solid var(--bc-border-strong);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 11px;
    color: var(--bc-text-secondary);
    z-index: 1;
}

.bc-timeline-dot.active {
    background: var(--bc-primary);
    border-color: var(--bc-primary);
    color: #fff;
}

.bc-timeline-dot.success {
    background: var(--bc-success);
    border-color: var(--bc-success);
    color: #fff;
}

.bc-timeline-content {
    flex: 1;
    padding-top: 2px;
}

.bc-timeline-title {
    font-weight: 600;
    font-size: 13px;
    color: var(--bc-text);
}

.bc-timeline-subtitle {
    font-size: 11px;
    color: var(--bc-text-secondary);
    margin-top: 2px;
}

/* ============ PRINT STYLE ============ */
@media print {

    .bc-sidebar,
    .bc-topbar,
    .bc-ribbon,
    .bc-filter-bar {
        display: none !important;
    }

    .bc-main {
        margin: 0 !important;
    }

    .bc-content {
        padding: 0 !important;
    }

    .bc-card {
        box-shadow: none !important;
        border: 1px solid #ccc !important;
        page-break-inside: avoid;
    }
}

/* ============================================================
   RESPONSIVE & MOBILE-FRIENDLY (BC365 Style)
   ============================================================ */

/* ============ MOBILE OVERLAY ============ */
.bc-sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .45);
    z-index: 99;
    opacity: 0;
    transition: opacity .2s ease;
    backdrop-filter: blur(2px);
}

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

/* ============ MOBILE CLOSE BUTTON (di sidebar) ============ */
.bc-sidebar-close {
    display: none;
    margin-left: auto;
    background: transparent;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 4px;
    color: var(--bc-text-secondary);
    cursor: pointer;
    align-items: center;
    justify-content: center;
}

.bc-sidebar-close:hover {
    background: var(--bc-bg-app);
    color: var(--bc-text);
}

/* ============ HORIZONTAL SCROLL WRAPPER for tables ============ */
.bc-table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0 -1px;
}

.bc-table-wrapper::-webkit-scrollbar {
    height: 6px;
}

.bc-table-wrapper::-webkit-scrollbar-thumb {
    background: var(--bc-border-strong);
    border-radius: 3px;
}

/* Tablet: 1024px ke bawah */
@media (max-width: 1024px) {

    .bc-search {
        max-width: 260px;
    }

    .bc-stats {
        grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
        gap: 12px;
        padding: 12px 16px;
    }

    .bc-stat-value {
        font-size: 18px;
    }

    .bc-card {
        margin-left: 16px;
        margin-right: 16px;
    }

    .bc-page-header {
        padding: 12px 16px 10px;
    }

    .bc-page-title {
        font-size: 18px;
    }

    .bc-ribbon {
        padding: 6px 16px;
        overflow-x: auto;
        flex-wrap: nowrap;
        scrollbar-width: none;
    }

    .bc-ribbon::-webkit-scrollbar {
        display: none;
    }

    .bc-ribbon-btn {
        flex-shrink: 0;
    }

    .bc-filter-bar {
        padding: 10px 16px;
    }

    /* POS: cart dipindah bawah */
    .bc-pos-layout {
        grid-template-columns: 1fr !important;
    }
}

/* Mobile: 768px ke bawah */
@media (max-width: 768px) {

    :root {
        --bc-topbar-height: 52px;
    }

    body {
        font-size: 13px;
    }

    /* ============ SIDEBAR → DRAWER ============ */
    .bc-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: 280px;
        z-index: 100;
        transform: translateX(-100%);
        transition: transform .25s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: 4px 0 12px rgba(0, 0, 0, .15);
    }

    .bc-sidebar.mobile-open {
        transform: translateX(0);
    }

    /* Sembunyikan collapse desktop di mobile */
    .bc-sidebar.collapsed {
        width: 280px;
        transform: translateX(-100%);
    }

    .bc-sidebar-close {
        display: flex;
    }

    .bc-sidebar-brand {
        height: 52px;
        padding: 12px 16px;
    }

    /* ============ TOPBAR ============ */
    .bc-topbar {
        padding: 0 8px;
        gap: 4px;
    }

    .bc-topbar-btn {
        width: 40px;
        height: 40px;
    }

    .bc-search {
        max-width: none;
        flex: 1;
    }

    .bc-search input {
        height: 36px;
        font-size: 13px;
    }

    /* Sembunyikan store badge di mobile */
    .bc-company-badge {
        display: none !important;
    }

    /* Sembunyikan teks user, hanya avatar */
    .bc-user-badge>div:not(.bc-avatar) {
        display: none !important;
    }

    .bc-user-badge {
        padding: 4px;
    }

    /* ============ CONTENT ============ */
    .bc-content {
        padding: 0;
    }

    .bc-page-header {
        padding: 12px 14px;
    }

    .bc-page-title {
        font-size: 17px;
        gap: 8px;
    }

    .bc-breadcrumb {
        font-size: 11px;
    }

    /* ============ RIBBON ============ */
    .bc-ribbon {
        padding: 6px 12px;
        gap: 4px;
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
    }

    .bc-ribbon-btn {
        padding: 6px 10px;
        font-size: 12px;
        flex-shrink: 0;
    }

    .bc-ribbon-btn .btn-label {
        display: none;
        /* Sembunyikan label, tampilkan icon saja */
    }

    .bc-ribbon-divider {
        margin: 0 2px;
        height: 16px;
    }

    /* ============ FILTER BAR ============ */
    .bc-filter-bar {
        flex-direction: column;
        align-items: stretch;
        padding: 10px 12px;
        gap: 8px;
    }

    .bc-filter-bar form {
        flex-direction: column !important;
        align-items: stretch !important;
        width: 100%;
    }

    .bc-filter-bar .bc-input,
    .bc-filter-bar .bc-select {
        max-width: 100%;
        height: 36px;
        font-size: 13px;
    }

    .bc-filter-bar>div:last-child {
        margin-left: 0 !important;
        text-align: left;
    }

    /* ============ CARD ============ */
    .bc-card {
        margin-left: 12px;
        margin-right: 12px;
        margin-top: 12px;
        border-radius: 4px;
    }

    .bc-card-header {
        padding: 12px 14px;
        font-size: 13px;
        flex-wrap: wrap;
        gap: 8px;
    }

    .bc-card-body {
        padding: 14px;
    }

    /* ============ TABLES ============ */
    .bc-table {
        font-size: 12px;
        min-width: 640px;
        /* agar horizontal scroll di mobile */
    }

    .bc-table thead th {
        padding: 8px 10px;
        font-size: 11px;
    }

    .bc-table tbody td {
        padding: 10px;
    }

    /* Bungkus tabel dengan wrapper untuk scroll */
    .bc-table-wrapper {
        border-radius: 0;
    }

    /* ============ PAGINATION ============ */
    .bc-pagination {
        flex-direction: column;
        gap: 8px;
        padding: 12px;
        font-size: 11px;
    }

    .bc-pagination-pages {
        justify-content: center;
        width: 100%;
    }

    /* ============ STATS ============ */
    .bc-stats {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
        padding: 12px;
    }

    .bc-stat-card {
        padding: 12px;
        gap: 10px;
    }

    .bc-stat-icon {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }

    .bc-stat-value {
        font-size: 16px;
    }

    .bc-stat-label {
        font-size: 10px;
    }

    /* ============ FORMS ============ */
    .bc-form-group {
        margin-bottom: 14px;
    }

    /* Force grid jadi single column */
    .bc-card-body>div[style*="grid-template-columns"],
    .bc-card>form>div[style*="grid-template-columns"],
    .bc-content>div[style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }

    /* Grid 1fr 1fr dan 1fr 1fr 1fr juga jadi single */
    .bc-card-body>div[style*="1fr 1fr"],
    .bc-card-body>div[style*="1fr 1fr 1fr"],
    .bc-card-body>div[style*="2fr 1fr"],
    .bc-card-body>div[style*="1fr 2fr"] {
        grid-template-columns: 1fr !important;
    }

    /* Input tinggi lebih besar untuk touch */
    .bc-input,
    .bc-select,
    .bc-textarea {
        height: 40px;
        font-size: 14px;
    }

    .bc-textarea {
        min-height: 90px;
    }

    .bc-checkbox {
        height: 40px;
    }

    /* Form actions jadi full-width */
    .bc-form-actions {
        flex-direction: column-reverse;
        align-items: stretch;
        gap: 8px;
        padding: 12px 0 0;
    }

    .bc-form-actions .bc-btn {
        width: 100%;
        justify-content: center;
        padding: 10px 14px;
    }

    /* Footer actions */
    .bc-card-body[style*="border-top"] .bc-form-actions>div:first-child {
        display: flex;
        flex-direction: column;
        gap: 8px;
        width: 100%;
    }

    .bc-card-body[style*="border-top"] .bc-form-actions>div:first-child .bc-btn {
        width: 100%;
        justify-content: center;
    }

    /* Info row (detail view) */
    .bc-info-row {
        flex-direction: column;
        gap: 4px;
        padding: 10px 0;
    }

    .bc-info-label {
        width: auto;
        font-size: 11px;
        color: var(--bc-text-muted);
    }

    .bc-info-value {
        font-size: 13px;
    }

    /* ============ HERO HEADER (view pages) ============ */
    .bc-card-header[style*="padding:20px 24px"] {
        padding: 16px !important;
        flex-direction: column;
        align-items: flex-start !important;
        gap: 12px;
    }

    .bc-card-header[style*="padding:20px 24px"]>div:first-child {
        gap: 12px;
    }

    .bc-card-header[style*="padding:20px 24px"] h1 {
        font-size: 18px !important;
    }

    .bc-card-header[style*="padding:20px 24px"]>div:last-child {
        flex-wrap: wrap;
        gap: 6px !important;
    }

    /* ============ LOGIN ============ */
    .bc-login-card {
        padding: 28px 22px;
        border-radius: 6px;
    }

    .bc-login-title {
        font-size: 20px;
    }

    /* ============ EMPTY STATE ============ */
    .bc-empty {
        padding: 32px 16px;
    }

    .bc-empty i {
        font-size: 32px;
    }

    /* ============ MODAL / DROPDOWN ============ */
    #piDropdown {
        max-height: 260px;
    }

    .pi-option {
        padding: 12px 14px !important;
    }

    /* ============ POS PAGE ============ */
    .pos-product-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)) !important;
        gap: 8px !important;
        max-height: none !important;
    }

    .pos-cart-total {
        position: sticky;
        bottom: 0;
        background: #fff;
        z-index: 5;
    }
}

/* Extra small: 480px ke bawah */
@media (max-width: 480px) {

    .bc-sidebar {
        width: 260px;
    }

    .bc-page-title {
        font-size: 16px;
    }

    .bc-ribbon-btn {
        padding: 6px 8px;
    }

    .bc-stats {
        grid-template-columns: 1fr;
    }

    .bc-stat-card {
        padding: 10px;
    }

    /* Table: hide column yang tidak kritis */
    .bc-table .hide-xs {
        display: none;
    }

    /* POS: produk 2 kolom */
    .pos-product-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    /* Tombol aksi lebih besar */
    .bc-table-actions .bc-btn-sm {
        min-width: 36px;
        min-height: 36px;
    }
}

/* ============ LANDSCAPE MOBILE ============ */
@media (max-width: 900px) and (orientation: landscape) {
    .bc-sidebar {
        width: 240px;
    }

    .bc-content {
        max-height: 100vh;
    }
}

/* ============ TOUCH DEVICE ============ */
@media (hover: none) and (pointer: coarse) {

    /* Hover effect diganti dengan touch state */
    .bc-sidebar-link {
        padding: 12px 16px;
        /* lebih tinggi untuk touch */
    }

    .bc-table tbody tr:hover {
        background: transparent;
        /* jangan highlight di touch */
    }

    .bc-btn,
    .bc-ribbon-btn {
        min-height: 40px;
        /* touch target */
    }

    /* Hilangkan efek hover di mobile */
    .pi-option:hover {
        background: transparent;
    }
}

/* ============ SAFE AREA (iPhone X+) ============ */
@supports (padding: env(safe-area-inset-bottom)) {
    .bc-sidebar {
        padding-bottom: env(safe-area-inset-bottom);
    }

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

/* ============================================================
   LANGUAGE SWITCHER
   ============================================================ */
.fi-flag {
    font-size: 15px;
    line-height: 1;
}

.dropdown-menu .dropdown-item.active {
    background: rgba(0, 120, 212, .08);
    color: var(--bc-primary-dark);
    font-weight: 600;
}

.dropdown-menu .dropdown-item .bi-check2 {
    color: var(--bc-primary);
    font-size: 14px;
}

.dropdown-menu .dropdown-header {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--bc-text-muted);
    font-weight: 600;
}

/* Public header language button */
.btn-lang-public {
    background: transparent;
    border: 1px solid var(--bc-border);
    border-radius: 4px;
    padding: 4px 8px;
    height: 32px;
    color: var(--bc-text);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.btn-lang-public:hover {
    background: var(--bc-bg-app);
}

/* Public header – pastikan nav & switcher sejajar */
.site-header .nav {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.site-header .nav nav {
    flex: 1;
    display: flex;
    gap: 1rem;
}