@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    /* Color Palette - Cattleya Frozen Food Theme */
    --bg-body: #f1f5f9;
    --surface: #ffffff;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    
    --primary: #1e3a8a; /* Deep Navy */
    --primary-light: #3b82f6;
    --primary-gradient: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
    
    --accent: #f59e0b; /* Classic Amber */
    --accent-glow: rgba(245, 158, 11, 0.15);
    
    --success: #10b981; /* Fresh Mint */
    --success-bg: #ecfdf5;
    
    --warning: #f59e0b;
    --warning-bg: #fffbeb;
    
    --danger: #f43f5e; /* Fresh Coral */
    --danger-bg: #fff1f2;
    
    --sidebar-width: 260px;
    --header-height: 70px;
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, 0.08), 0 4px 6px -4px rgba(15, 23, 42, 0.08);
    --shadow-premium: 0 20px 25px -5px rgba(15, 46, 92, 0.05), 0 8px 10px -6px rgba(15, 46, 92, 0.05);
    
    --border-radius-sm: 6px;
    --border-radius-md: 12px;
    --border-radius-lg: 16px;
    --border-radius-xl: 24px;
    
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Global Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Outfit', sans-serif;
    color: var(--primary);
    font-weight: 700;
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Login Page Frosted Glass Layout */
.login-body {
    background: radial-gradient(circle at 10% 20%, rgba(14, 165, 233, 0.1) 0%, rgba(15, 46, 92, 0.2) 90.1%), 
                linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

.login-card {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: var(--border-radius-xl);
    width: 100%;
    max-width: 440px;
    padding: 40px;
    box-shadow: var(--shadow-premium), 0 30px 60px -15px rgba(15, 46, 92, 0.15);
    transform: translateY(0);
    transition: var(--transition-smooth);
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-gradient);
    color: white;
    width: 64px;
    height: 64px;
    border-radius: var(--border-radius-md);
    margin-bottom: 15px;
    box-shadow: 0 8px 16px rgba(15, 46, 92, 0.2);
}

.login-logo span {
    font-size: 32px;
}

.login-title {
    font-size: 26px;
    color: var(--primary);
    margin-bottom: 6px;
}

.login-subtitle {
    font-size: 14px;
    color: var(--text-muted);
}

/* Layout Wrapper for App Dashboard */
.app-wrapper {
    display: flex;
    min-height: 100vh;
}

/* Sidebar Styling */
.sidebar {
    width: var(--sidebar-width);
    background: var(--primary);
    background-image: linear-gradient(180deg, #1e3a8a 0%, #172554 100%);
    color: #f8fafc;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 100;
    box-shadow: var(--shadow-lg);
    transition: var(--transition-smooth);
}

.sidebar-header {
    height: var(--header-height);
    display: flex;
    align-items: center;
    padding: 0 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 18px;
    color: #ffffff;
    text-decoration: none;
    letter-spacing: 0.5px;
}

.sidebar-brand span.icon {
    background: var(--accent);
    color: var(--primary);
    padding: 6px;
    border-radius: var(--border-radius-sm);
    font-size: 20px;
}

.sidebar-menu {
    flex: 1;
    list-style: none;
    padding: 24px 16px;
    overflow-y: auto;
}

.sidebar-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: rgba(255, 255, 255, 0.3);
    margin-bottom: 12px;
    padding-left: 12px;
    font-weight: 600;
}

.sidebar-item {
    margin-bottom: 6px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    border-radius: var(--border-radius-md);
    transition: var(--transition-smooth);
}

.sidebar-link span.material-icons {
    font-size: 20px;
}

.sidebar-link:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.05);
}

.sidebar-link.active {
    color: #ffffff;
    background: var(--accent);
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.3);
}

.sidebar-footer {
    padding: 20px 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    background: rgba(0, 0, 0, 0.1);
}

.user-profile-menu {
    display: flex;
    align-items: center;
    gap: 12px;
    color: white;
}

.user-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: var(--accent);
    border: 2px solid rgba(14, 165, 233, 0.4);
}

.user-info {
    flex: 1;
    overflow: hidden;
}

.user-name {
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role {
    font-size: 11px;
    color: var(--accent);
}

.logout-btn {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    padding: 6px;
    border-radius: var(--border-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-smooth);
}

.logout-btn:hover {
    color: var(--danger);
    background: rgba(244, 63, 94, 0.1);
}

/* Content Area */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: var(--transition-smooth);
}

/* Header Navbar */
.top-navbar {
    height: var(--header-height);
    background: var(--surface);
    border-bottom: 1px solid var(--border-color);
    padding: 0 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 90;
    box-shadow: var(--shadow-sm);
}

.page-title-area h2 {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.2px;
}

.top-navbar-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.top-navbar-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-body);
    border: 1px solid var(--border-color);
    padding: 8px 16px;
    border-radius: var(--border-radius-md);
    font-size: 13px;
    font-weight: 500;
    color: var(--text-main);
    text-decoration: none;
    transition: var(--transition-smooth);
}

.top-navbar-btn:hover {
    background: var(--border-color);
}

/* Dashboard & Common Containers */
.container-fluid {
    padding: 30px;
    flex: 1;
}

/* Info Cards / Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--surface);
    border-radius: var(--border-radius-lg);
    padding: 24px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
    transition: var(--transition-smooth);
}

.stat-card::after {
    content: '';
    position: absolute;
    width: 4px;
    height: 100%;
    left: 0;
    top: 0;
    background: var(--primary);
}

.stat-card.stat-accent::after {
    background: var(--accent);
}

.stat-card.stat-warning::after {
    background: var(--warning);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.stat-card-info h4 {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.stat-card-value {
    font-family: 'Outfit', sans-serif;
    font-size: 28px;
    font-weight: 800;
    color: var(--primary);
}

.stat-card-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: var(--border-radius-md);
    background: rgba(15, 46, 92, 0.05);
    color: var(--primary);
}

.stat-card.stat-accent .stat-card-icon {
    background: var(--accent-glow);
    color: var(--accent);
}

.stat-card-icon span {
    font-size: 24px;
}

/* Premium Form Elements */
.form-group {
    margin-bottom: 20px;
}

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

.form-control {
    width: 100%;
    padding: 12px 16px;
    font-family: inherit;
    font-size: 14px;
    color: var(--text-main);
    background-color: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    outline: none;
    transition: var(--transition-smooth);
}

.form-control:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-glow);
}

.form-control:disabled {
    background-color: var(--bg-body);
    color: var(--text-muted);
}

.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%2364748b'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    background-size: 20px;
    padding-right: 40px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    border-radius: var(--border-radius-md);
    border: none;
    cursor: pointer;
    transition: var(--transition-smooth);
    text-decoration: none;
    text-align: center;
}

.btn-primary {
    background: var(--primary-gradient);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(15, 46, 92, 0.15);
}

.btn-primary:hover {
    box-shadow: 0 6px 16px rgba(15, 46, 92, 0.25);
    filter: brightness(1.1);
}

.btn-secondary {
    background: #e2e8f0;
    color: var(--text-main);
}

.btn-secondary:hover {
    background: #cbd5e1;
}

.btn-danger {
    background: var(--danger);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(244, 63, 94, 0.15);
}

.btn-danger:hover {
    box-shadow: 0 6px 16px rgba(244, 63, 94, 0.25);
    filter: brightness(1.1);
}

.btn-block {
    display: flex;
    width: 100%;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
    border-radius: var(--border-radius-sm);
}

/* Cards & Containers */
.card {
    background: var(--surface);
    border-radius: var(--border-radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    margin-bottom: 30px;
    overflow: hidden;
}

.card-header {
    padding: 20px 30px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--primary);
}

.card-body {
    padding: 30px;
}

/* Tables */
.table-responsive {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.table th {
    background-color: var(--bg-body);
    color: var(--text-muted);
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    padding: 16px 24px;
    border-bottom: 2px solid var(--border-color);
}

.table td {
    padding: 16px 24px;
    font-size: 14px;
    color: var(--text-main);
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

.table tbody tr {
    transition: var(--transition-smooth);
}

.table tbody tr:hover {
    background-color: rgba(14, 165, 233, 0.02);
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 50px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-primary {
    background-color: rgba(15, 46, 92, 0.1);
    color: var(--primary);
}

.badge-success {
    background-color: var(--success-bg);
    color: var(--success);
}

.badge-danger {
    background-color: var(--danger-bg);
    color: var(--danger);
}

/* Alert Banners */
.alert {
    padding: 16px 24px;
    border-radius: var(--border-radius-md);
    margin-bottom: 24px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid transparent;
}

.alert-success {
    background-color: var(--success-bg);
    border-color: rgba(16, 185, 129, 0.2);
    color: #065f46;
}

.alert-danger {
    background-color: var(--danger-bg);
    border-color: rgba(244, 63, 94, 0.2);
    color: #9f1239;
}

/* Checkbox Lists (e.g. for Role Permission Settings) */
.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    padding: 10px 0;
}

.checkbox-card {
    background: var(--bg-body);
    padding: 16px;
    border-radius: var(--border-radius-md);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.checkbox-card:hover {
    border-color: var(--accent);
    background: #ffffff;
    box-shadow: var(--shadow-sm);
}

.checkbox-card input[type="checkbox"] {
    width: 18px;
    height: 18px;
    border-radius: 4px;
    accent-color: var(--accent);
    cursor: pointer;
}

.checkbox-card label {
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    user-select: none;
    color: var(--text-main);
}

/* Responsive Styles */
@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .top-navbar {
        padding: 0 20px;
    }
}

/* Searchable Select Lookup Component */
.searchable-select-wrapper {
    position: relative;
    width: 100%;
}

.searchable-select-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 4px;
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    max-height: 240px;
    overflow-y: auto;
    display: none;
}

.searchable-select-dropdown.show {
    display: block;
}

.searchable-select-item {
    padding: 10px 16px;
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition-smooth);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.searchable-select-item:hover {
    background-color: var(--bg-body);
    color: var(--accent);
}

.searchable-select-item.selected {
    background-color: var(--accent-glow);
    color: var(--primary-light);
    font-weight: 600;
}

.searchable-select-no-results {
    padding: 12px 16px;
    font-size: 13px;
    color: var(--text-muted);
    text-align: center;
}

/* Barang Image Upload Styles */
.image-upload-wrapper {
    display: flex;
    align-items: center;
    gap: 20px;
    background: var(--bg-body);
    padding: 20px;
    border-radius: var(--border-radius-lg);
    border: 1px dashed var(--border-color);
}

.image-preview-box {
    width: 100px;
    height: 100px;
    border-radius: var(--border-radius-md);
    background: var(--surface);
    border: 1px solid var(--border-color);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    box-shadow: var(--shadow-sm);
}

.image-preview-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* POS Cashier Layout Styles */
.pos-container {
    display: flex;
    gap: 24px;
    height: calc(100vh - var(--header-height) - 60px);
    overflow: hidden;
}

.pos-catalog-panel {
    flex: 1.3;
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border-radius: var(--border-radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    padding: 20px;
    height: 100%;
}

.pos-cart-panel {
    flex: 0.8;
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border-radius: var(--border-radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    padding: 20px;
    height: 100%;
}

.pos-search-wrapper {
    margin-bottom: 20px;
}

.pos-grid-container {
    flex: 1;
    overflow-y: auto;
    padding-right: 4px;
}

.pos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 16px;
}

.pos-card {
    background: var(--bg-body);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    padding: 12px;
    cursor: pointer;
    text-align: center;
    transition: var(--transition-smooth);
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    user-select: none;
}

.pos-card:hover {
    transform: translateY(-2px);
    border-color: var(--accent);
    box-shadow: var(--shadow-md);
    background: #ffffff;
}

.pos-card-img {
    width: 70px;
    height: 70px;
    border-radius: var(--border-radius-sm);
    border: 1px solid var(--border-color);
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    margin-bottom: 10px;
}

.pos-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.pos-card-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: 36px;
}

.pos-card-price {
    font-size: 12px;
    font-weight: 800;
    color: var(--accent);
}

.pos-cart-items-wrapper {
    flex: 1;
    overflow-y: auto;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

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

.pos-cart-table th {
    font-size: 11px;
    text-transform: uppercase;
    color: var(--text-muted);
    padding: 8px;
    border-bottom: 2px solid var(--border-color);
    text-align: left;
}

.pos-cart-table td {
    padding: 10px 8px;
    font-size: 13px;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

.pos-qty-input {
    width: 50px;
    text-align: center;
    padding: 4px;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    outline: none;
}

.pos-price-input {
    width: 90px;
    text-align: right;
    padding: 4px 8px;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    outline: none;
    font-family: inherit;
    font-weight: 600;
}

.pos-btn-delete {
    background: transparent;
    border: none;
    color: var(--danger);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pos-summary-box {
    background: var(--bg-body);
    border-radius: var(--border-radius-md);
    padding: 16px;
    margin-bottom: 20px;
}

.pos-summary-row {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    margin-bottom: 8px;
}

.pos-summary-row.grand-total {
    font-family: 'Outfit', sans-serif;
    font-size: 20px;
    font-weight: 800;
    color: var(--primary);
    margin-top: 8px;
    border-top: 1px dashed var(--border-color);
    padding-top: 8px;
    margin-bottom: 0;
}

/* Detail Transaksi Table */
.transaction-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

.transaction-table th {
    background: var(--primary);
    color: #ffffff;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    padding: 12px 16px;
    border: 1px solid rgba(255,255,255,0.1);
    text-align: left;
}

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

.transaction-table select, .transaction-table input {
    padding: 8px 12px;
    font-size: 13px;
}

/* History Badge */
.history-badge {
    font-size: 10px;
    background: rgba(14, 165, 233, 0.1);
    color: var(--accent);
    padding: 2px 6px;
    border-radius: 4px;
    display: block;
    margin-top: 4px;
    font-weight: 600;
}

/* Sidebar Expandable/Collapsible Group Menus */
.sidebar-group-item {
    margin-bottom: 6px;
}

.sidebar-group-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    border-radius: var(--border-radius-md);
    cursor: pointer;
    transition: var(--transition-smooth);
    user-select: none;
}

.sidebar-group-header:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.05);
}

.sidebar-group-header .group-title {
    flex: 1;
}

.sidebar-group-header .arrow-icon {
    font-size: 18px;
    transition: transform 0.2s ease;
}

.sidebar-group-item.expanded .sidebar-group-header .arrow-icon {
    transform: rotate(180deg);
}

.sidebar-submenu {
    list-style: none;
    padding: 4px 0 4px 28px;
    display: none; /* Hidden by default */
}

.sidebar-group-item.expanded .sidebar-submenu {
    display: block; /* Shown when expanded */
}

.submenu-item {
    margin-bottom: 4px;
}

.submenu-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    border-radius: var(--border-radius-sm);
    transition: var(--transition-smooth);
}

.submenu-link span.material-icons {
    font-size: 16px;
}

.submenu-link:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.03);
}

.submenu-link.active {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
    font-weight: 600;
}

/* Sidebar Toggle Transitions */
@media (min-width: 992px) {
    .sidebar.collapsed {
        transform: translateX(-100%);
    }
    .sidebar.collapsed ~ .main-content {
        margin-left: 0;
    }
}

/* Global Pagination Styles */
.pos-pagination-btn {
    padding: 6px 12px;
    border: 1px solid var(--border-color);
    background: #ffffff;
    color: var(--text-main);
    font-size: 12px;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    line-height: 1;
}
.pos-pagination-btn:hover {
    background: var(--bg-body);
    border-color: var(--text-muted);
    color: var(--text-main);
}
.pos-pagination-btn.active {
    background: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
}
.pos-pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: var(--bg-body);
}

/* Sembunyikan tombol toggle secara default di desktop */
.table-row-toggle {
    display: none;
}

/* Responsive Collapsible Tables for Mobile */
@media (max-width: 768px) {
    /* Sembunyikan thead bawaan desktop */
    .table-responsive-stack thead {
        display: none !important;
    }

    /* Ubah tbody menjadi blok penuh */
    .table-responsive-stack tbody {
        display: block !important;
        width: 100% !important;
    }

    /* Ubah tr menjadi bentuk kartu (card) */
    .table-responsive-stack tbody tr {
        display: block !important;
        background: #ffffff;
        border: 1px solid var(--border-color);
        border-radius: var(--border-radius-md);
        margin-bottom: 12px;
        padding: 12px 14px;
        position: relative;
        box-shadow: 0 1px 3px rgba(0,0,0,0.02);
        transition: box-shadow 0.2s ease;
    }

    /* Clearfix untuk gambar melayang (float) */
    .table-responsive-stack tbody tr::after {
        content: "";
        display: table;
        clear: both;
    }

    .table-responsive-stack tbody tr:hover {
        background-color: #ffffff !important;
        box-shadow: 0 4px 6px rgba(0,0,0,0.04);
    }

    /* Sembunyikan semua kolom default */
    .table-responsive-stack tbody tr td {
        display: none;
        padding: 8px 0 !important;
        border: none !important;
        font-size: 13px;
        width: auto !important;
    }

    /* Hubungkan style kolom utama */
    .table-responsive-stack tbody tr td.primary-col {
        border: none !important;
    }

    /* 1. Sembunyikan nomor urut ("1", "2", dll) di mobile */
    .table-responsive-stack tbody tr td.primary-col-no {
        display: none !important;
    }

    /* 2. Judul Utama (Nomor Bukti, Kode Barang, dll) */
    .table-responsive-stack tbody tr td.primary-col-main {
        display: block !important;
        font-size: 15px;
        font-weight: 700;
        color: var(--primary);
        line-height: 1.4;
        margin-bottom: 3px;
    }
    
    .table-responsive-stack tbody tr td.primary-col-main strong {
        font-weight: 700;
    }

    /* 3. Sub Detail (Tanggal, Pelanggan, Nama Satuan, dll) */
    .table-responsive-stack tbody tr td.primary-col-sub {
        display: block !important;
        font-size: 12px;
        color: var(--text-muted);
        line-height: 1.4;
        margin-bottom: 2px;
    }

    /* 4. Highlight Penting (Total Nominal, Stok, Harga) */
    .table-responsive-stack tbody tr td.primary-col-highlight {
        display: block !important;
        font-size: 14px;
        font-weight: 700;
        color: var(--accent);
        margin-top: 4px;
    }

    /* Layout Gambar Produk (Melayang di kiri teks) */
    .table-responsive-stack tbody tr td[data-label="Gambar"],
    .table-responsive-stack tbody tr td[data-label="gambar"] {
        display: block !important;
        float: left;
        margin-right: 12px;
        margin-bottom: 4px;
        padding: 0 !important;
        width: auto !important;
    }

    /* Tampilan saat kartu diekspansi (tunjukkan semua kolom detail) */
    .table-responsive-stack tbody tr.is-expanded td {
        display: flex !important;
        justify-content: space-between;
        align-items: center;
        border-bottom: 1px dashed var(--border-color) !important;
        text-align: right;
        float: none !important; /* Reset float saat ekspansi */
        margin-right: 0 !important;
        margin-bottom: 0 !important;
        padding: 10px 0 !important;
    }

    .table-responsive-stack tbody tr.is-expanded td[data-label="Gambar"],
    .table-responsive-stack tbody tr.is-expanded td[data-label="gambar"] {
        padding: 8px 0 !important;
    }

    .table-responsive-stack tbody tr.is-expanded td:last-child {
        border-bottom: none !important;
    }

    .table-responsive-stack tbody tr.is-expanded td::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--text-muted);
        font-size: 11px;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        text-align: left;
        margin-right: 15px;
    }

    /* Perapian tombol aksi & badge di dalam detail */
    .table-responsive-stack tbody tr.is-expanded td .badge {
        margin: 0;
    }
    .table-responsive-stack tbody tr.is-expanded td form {
        display: inline-block;
    }
    .table-responsive-stack tbody tr.is-expanded td div {
        justify-content: flex-end !important;
    }

    /* Tombol Togel Bulat "+" */
    .table-row-toggle {
        position: absolute;
        right: 12px;
        top: 12px;
        width: 28px;
        height: 28px;
        border-radius: 50%;
        background-color: rgba(14, 165, 233, 0.08);
        color: var(--accent);
        display: flex !important;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        font-weight: bold;
        transition: all 0.2s ease;
        z-index: 10;
        box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    }
    
    .table-row-toggle span.material-icons {
        font-size: 18px;
        transition: transform 0.2s ease;
    }

    /* Rotasikan tombol "+" menjadi silang "x" saat diekspansi */
    .table-responsive-stack tbody tr.is-expanded .table-row-toggle {
        background-color: rgba(239, 68, 68, 0.08);
        color: #ef4444;
    }
    
    .table-responsive-stack tbody tr.is-expanded .table-row-toggle span.material-icons {
        transform: rotate(45deg);
    }
}

/* Sidebar Backdrop for Mobile */
.sidebar-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.4);
    z-index: 95; /* Di bawah sidebar (100) tapi di atas navbar (90) */
    backdrop-filter: blur(2px);
    transition: opacity 0.3s ease;
    opacity: 0;
}

@media (max-width: 991.98px) {
    .sidebar-backdrop.show {
        display: block;
        opacity: 1;
    }
    .sidebar-close-btn {
        display: flex !important;
    }
}
