:root {
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: #1f2937;
    background-color: #f8fafc;
}

html,
body {
    min-height: 100%;
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: #f8fafc;
}

body.modern-app {
    background: #f8fafc;
}

.modern-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: #f8fafc;
}

.modern-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 1.5rem;
    min-height: 72px;
    background: #1e293b;
    color: #ffffff;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.12);
    position: sticky;
    top: 0;
    z-index: 20;
}

.modern-header-brand {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.modern-sidebar-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    border: none;
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
    transition: background 0.2s ease;
}

.modern-sidebar-toggle:hover {
    background: rgba(255, 255, 255, 0.18);
}

.modern-brand-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: #ffffff;
    text-decoration: none;
    font-weight: 700;
}

.modern-brand-logo {
    width: 40px;
    height: 40px;
    object-fit: contain;
    border-radius: 12px;
    background: #ffffff;
    padding: 5px;
}

.modern-header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.modern-user-dropdown .modern-user-button {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.modern-user-avatar,
.modern-user-card-avatar {
    width: 34px;
    height: 34px;
    border-radius: 999px;
    object-fit: cover;
}

.modern-user-menu {
    min-width: 220px;
    border-radius: 16px;
    overflow: hidden;
}

.modern-user-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
}

.modern-user-card strong {
    display: block;
    font-weight: 700;
}

.modern-user-card p {
    margin: 0;
    font-size: 0.9rem;
    color: #475569;
}

.modern-sidebar {
    width: 260px;
    min-height: calc(100vh - 72px);
    background: #111827;
    padding: 1.5rem 1rem;
    color: #cbd5e1;
    transition: width 0.25s ease, opacity 0.25s ease;
    overflow-y: auto;
    overflow-x: hidden;
}

.modern-shell.modern-sidebar-collapsed .modern-sidebar {
    width: 0;
    opacity: 0;
    overflow: hidden;
}

.modern-main-layout {
    display: flex;
    flex: 1;
}

.modern-content-area {
    flex: 1;
    padding: 1.5rem;
    min-height: calc(100vh - 72px);
}

.modern-page-header {
    margin-bottom: 1.5rem;
}

.modern-page-header h1 {
    margin: 0;
    font-size: 2.2rem;
    color: #0f172a;
    letter-spacing: -0.02em;
}

.modern-breadcrumb {
    padding: 0;
    margin: 0.75rem 0 0;
    background: transparent;
    border: none;
}

.modern-breadcrumb li a,
.modern-breadcrumb li {
    color: #64748b;
    font-size: 0.9rem;
}

.modern-breadcrumb li + li:before {
    color: #cbd5e1;
}

.modern-main-content {
    min-height: calc(100vh - 72px - 5rem);
}

.modern-footer {
    padding: 1rem 1.25rem;
    background: #ffffff;
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 1rem;
    margin-top: 2rem;
}

.modern-footer-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    color: #475569;
}

.modern-footer a {
    color: #2563eb;
}

.modern-footer-version {
    color: #64748b;
}

.modern-sidebar-user {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 1rem;
    border-radius: 1.25rem;
    background: rgba(255, 255, 255, 0.04);
    margin-bottom: 1.25rem;
}

.modern-sidebar-avatar {
    width: 44px;
    height: 44px;
    border-radius: 999px;
    object-fit: cover;
    border: 1px solid rgba(148, 163, 184, 0.2);
}

.modern-sidebar-user-info strong {
    display: block;
    color: #ffffff;
    font-size: 0.95rem;
}

.modern-sidebar-user-info span {
    font-size: 0.85rem;
    color: #94a3b8;
}

.modern-sidebar-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.modern-sidebar-nav li {
    margin-bottom: 0.45rem;
}

.modern-sidebar-nav li a {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.95rem 1rem;
    border-radius: 1rem;
    color: #cbd5e1;
    text-decoration: none;
    transition: background 0.18s ease, color 0.18s ease;
}

.modern-sidebar-nav li a:hover,
.modern-sidebar-nav li a:focus {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
}

.modern-sidebar-nav li a i {
    width: 20px;
    text-align: center;
}

.modern-sidebar-section {
    display: block;
    margin: 1.35rem 0 0.75rem;
    padding: 0 1rem;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    color: #94a3b8;
    text-transform: uppercase;
}

.modern-login-page {
    background: #eef2ff;
}

.modern-login-screen {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2.5rem 1rem;
}

.login-box {
    border-radius: 1.5rem !important;
    border: 1px solid rgba(148, 163, 184, 0.2) !important;
    box-shadow: 0 30px 60px rgba(15, 23, 42, 0.08) !important;
    background: #ffffff !important;
}

.login-box-body {
    padding: 2rem !important;
    box-shadow: none !important;
}

.login-logo {
    margin-bottom: 1.5rem !important;
    text-align: center !important;
}

.login-logo img {
    width: 110px !important;
}

.login-box-body .form-group {
    margin-bottom: 1.25rem !important;
}

.btn-primary {
    border-radius: 999px !important;
    padding: 0.85rem 1.25rem !important;
    font-weight: 600 !important;
    background-color: #3b82f6 !important;
    border-color: #3b82f6 !important;
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active {
    background-color: #2563eb !important;
    border-color: #2563eb !important;
}

.form-control {
    border-radius: 0.95rem !important;
    border: 1px solid #cbd5e1 !important;
    box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.05) !important;
}

.has-error .form-control {
    border-color: #ef4444 !important;
}

.help-block {
    color: #64748b !important;
}

.box,
.panel,
.card,
.table-responsive,
.dataTables_wrapper {
    border-radius: 1.25rem !important;
    border: 1px solid rgba(148, 163, 184, 0.18) !important;
    background: #ffffff !important;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.06) !important;
}

.table-responsive,
.dataTables_wrapper {
    overflow-x: auto !important;
}

.box-header.with-border {
    border-bottom: 1px solid rgba(148, 163, 184, 0.16) !important;
}

.box-header .box-title {
    font-size: 1.15rem !important;
    font-weight: 700 !important;
}

.small-box {
    border-radius: 1.25rem !important;
    overflow: hidden;
    box-shadow: 0 18px 35px rgba(15, 23, 42, 0.08) !important;
}

.small-box .inner {
    padding: 1.35rem !important;
}

.small-box h3,
.small-box p {
    color: #ffffff;
}

.small-box .icon {
    top: auto !important;
    right: 1rem !important;
    bottom: 1rem !important;
    font-size: 3rem !important;
    opacity: 0.35;
}

.small-box a {
    color: rgba(255, 255, 255, 0.92) !important;
}

.small-box.bg-aqua {
    background: linear-gradient(135deg, #0ea5e9 0%, #2563eb 100%) !important;
}

.small-box.bg-green {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%) !important;
}

.small-box.bg-yellow {
    background: linear-gradient(135deg, #facc15 0%, #f59e0b 100%) !important;
}

.small-box.bg-red {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%) !important;
}

.table thead th {
    background: #f8fafc !important;
}

/* Detail view modal styling */
.btn-detail {
    padding: 0.375rem 0.75rem !important;
    font-size: 0.85rem !important;
    background-color: #3b82f6 !important;
    border-color: #3b82f6 !important;
    color: #ffffff !important;
}

.btn-detail:hover {
    background-color: #2563eb !important;
    border-color: #2563eb !important;
}

.detail-modal .modal-body {
    padding: 2rem !important;
}

.detail-modal .detail-row {
    display: flex;
    padding: 1rem 0;
    border-bottom: 1px solid #e2e8f0;
    flex-direction: column;
}

.detail-modal .detail-row:last-child {
    border-bottom: none;
}

.detail-modal .detail-label {
    font-weight: 600;
    color: #475569;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.detail-modal .detail-value {
    color: #1f2937;
    font-size: 1.05rem;
}

.detail-modal .detail-value.currency {
    font-weight: 600;
    color: #059669;
}

@media (min-width: 480px) {
    .detail-modal .detail-row {
        flex-direction: row;
        align-items: center;
    }

    .detail-modal .detail-label {
        width: 35%;
        margin-bottom: 0;
        font-weight: 700;
    }

    .detail-modal .detail-value {
        width: 65%;
    }
}

@media (max-width: 992px) {
    .modern-sidebar {
        position: fixed;
        left: 0;
        top: 72px;
        width: 260px;
        height: calc(100vh - 72px);
        z-index: 100;
        transform: translateX(-100%);
        transition: transform 0.25s ease;
        box-shadow: 2px 0 10px rgba(15, 23, 42, 0.15);
        overflow-y: auto;
        overflow-x: hidden;
    }

    .modern-sidebar::before {
        content: '';
        position: fixed;
        left: 0;
        top: 72px;
        right: 0;
        bottom: 0;
        background: rgba(15, 23, 42, 0.5);
        opacity: 0;
        transition: opacity 0.25s ease;
        pointer-events: none;
        z-index: 99;
    }

    .modern-shell.modern-sidebar-collapsed .modern-sidebar {
        transform: translateX(0);
        width: 260px;
        opacity: 1;
    }

    .modern-shell.modern-sidebar-collapsed .modern-sidebar::before {
        opacity: 1;
        pointer-events: none;
    }

    .modern-main-layout {
        flex-direction: column;
    }

    .modern-content-area {
        width: 100%;
    }
}

@media (max-width: 768px) {
    .modern-header {
        padding: 0 1rem;
    }

    .modern-sidebar {
        width: 100%;
        top: 72px;
        overflow-y: auto;
        overflow-x: hidden;
    }

    .modern-page-header h1 {
        .dataTables_wrapper table {
            min-width: 100% !important;
            width: auto !important;
            table-layout: auto !important;
        }

        .dataTables_wrapper table th,
        .dataTables_wrapper table td {
            white-space: normal !important;
            word-break: break-word !important;
        }

        .dataTables_wrapper .row {
            display: block !important;
            width: 100% !important;
            margin: 0 !important;
        }

        .dataTables_wrapper .row > div {
            width: 100% !important;
            float: none !important;
            display: block !important;
            margin: 0 0 1rem !important;
        }

        .dataTables_wrapper .dataTables_length,
        .dataTables_wrapper .dataTables_filter {
            width: 100% !important;
            margin-bottom: 1rem !important;
        }

        body .dataTables_wrapper .dataTables_length label,
        body .dataTables_wrapper .dataTables_filter label {
            display: flex !important;
            flex-direction: column !important;
            gap: 0.5rem !important;
            align-items: flex-start !important;
        }

        body .dataTables_wrapper .dataTables_length select,
        body .dataTables_wrapper .dataTables_filter input {
            width: 100% !important;
            max-width: 100% !important;
        }

        body .dataTables_wrapper .dataTables_info,
        body .dataTables_wrapper .dataTables_paginate {
            margin-top: 1rem !important;
            width: 100% !important;
            text-align: center !important;
            float: none !important;
        }

        /* Hide non-critical Produk columns on mobile */
        .table-produk th:nth-child(1),
        .table-produk td:nth-child(1),
        .table-produk th:nth-child(3),
        .table-produk td:nth-child(3),
        .table-produk th:nth-child(5),
        .table-produk td:nth-child(5),
        .table-produk th:nth-child(6),
        .table-produk td:nth-child(6),
        .table-produk th:nth-child(7),
        .table-produk td:nth-child(7),
        .table-produk th:nth-child(8),
        .table-produk td:nth-child(8),
        .table-produk th:nth-child(9),
        .table-produk td:nth-child(9),
        .table-produk th:nth-child(11),
        .table-produk td:nth-child(11) {
            display: none !important;
        }

    /* Hide non-critical Produk columns on mobile */
    .table-produk th:nth-child(1),
    .table-produk td:nth-child(1),
    .table-produk th:nth-child(3),
    .table-produk td:nth-child(3),
    .table-produk th:nth-child(5),
    .table-produk td:nth-child(5),
    .table-produk th:nth-child(6),
    .table-produk td:nth-child(6),
    .table-produk th:nth-child(7),
    .table-produk td:nth-child(7),
    .table-produk th:nth-child(8),
    .table-produk td:nth-child(8),
    .table-produk th:nth-child(10),
    .table-produk td:nth-child(10) {
        display: none !important;
    }
}

@media (max-width: 640px) {
    .table-produk th:nth-child(1),
    .table-produk td:nth-child(1),
    .table-produk th:nth-child(3),
    .table-produk td:nth-child(3),
    .table-produk th:nth-child(5),
    .table-produk td:nth-child(5),
    .table-produk th:nth-child(6),
    .table-produk td:nth-child(6),
    .table-produk th:nth-child(7),
    .table-produk td:nth-child(7),
    .table-produk th:nth-child(8),
    .table-produk td:nth-child(8),
    .table-produk th:nth-child(9),
    .table-produk td:nth-child(9),
    .table-produk th:nth-child(10),
    .table-produk td:nth-child(10),
    .table-produk th:nth-child(11),
    .table-produk td:nth-child(11) {
        display: none !important;
    }

    .table-penjualan th:nth-child(3),
    .table-penjualan td:nth-child(3),
    .table-penjualan th:nth-child(4),
    .table-penjualan td:nth-child(4),
    .table-penjualan th:nth-child(5),
    .table-penjualan td:nth-child(5),
    .table-penjualan th:nth-child(6),
    .table-penjualan td:nth-child(6),
    .table-penjualan th:nth-child(8),
    .table-penjualan td:nth-child(8),
    .table-penjualan th:nth-child(9),
    .table-penjualan td:nth-child(9) {
        display: none !important;
    }

    .table-pembelian th:nth-child(4),
    .table-pembelian td:nth-child(4),
    .table-pembelian th:nth-child(5),
    .table-pembelian td:nth-child(5),
    .table-pembelian th:nth-child(6),
    .table-pembelian td:nth-child(6) {
        display: none !important;
    }

    .table-member th:nth-child(1),
    .table-member td:nth-child(1),
    .table-member th:nth-child(3),
    .table-member td:nth-child(3),
    .table-member th:nth-child(5),
    .table-member td:nth-child(5),
    .table-member th:nth-child(6),
    .table-member td:nth-child(6) {
        display: none !important;
    }
}

@media (max-width: 480px) {
    .modern-header {
        min-height: 60px;
        padding: 0 0.75rem;
    }

    .modern-brand-link {
        gap: 0.5rem;
    }

    .modern-brand-logo {
        width: 32px;
        height: 32px;
    }

    .modern-sidebar-toggle {
        width: 38px;
        height: 38px;
    }

    .modern-page-header h1 {
        font-size: 1.25rem;
    }

    .modern-content-area {
        padding: 0.75rem;
    }

    .modern-sidebar {
        padding: 1rem 0.75rem;
    }
}
