:root {
    --sidebar-width: 280px;
    --sidebar-bg: #111827;
    --sidebar-link: #cbd5e1;
    --sidebar-link-hover: #ffffff;
    --primary: #0d6efd;
    --surface: #ffffff;
    --body-bg: #f4f7fb;
    --text-muted: #64748b;
}

* {
    box-sizing: border-box;
}

body {
    background: var(--body-bg);
    color: #0f172a;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    letter-spacing: 0;
}

a {
    text-decoration: none;
}

.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: linear-gradient(135deg, #f8fbff 0%, #e9f2ff 100%);
}

.login-card {
    width: 100%;
    max-width: 430px;
    border: 0;
    border-radius: 8px;
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.14);
}

.app-shell {
    min-height: 100vh;
}

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--sidebar-bg);
    color: #ffffff;
    z-index: 1030;
}

.mobile-sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
}

.sidebar-inner {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: 20px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #ffffff;
    font-size: 1.2rem;
    font-weight: 700;
    min-height: 44px;
}

.brand:hover {
    color: #ffffff;
}

.brand i {
    color: #60a5fa;
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px 0;
    margin: 16px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: #2563eb;
    font-weight: 700;
}

.sidebar-user-name {
    color: #ffffff;
    font-weight: 600;
    line-height: 1.2;
}

.sidebar-user-role {
    color: #94a3b8;
    font-size: 0.84rem;
}

.sidebar-nav {
    display: grid;
    gap: 6px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 44px;
    padding: 10px 12px;
    color: var(--sidebar-link);
    border-radius: 8px;
    font-weight: 500;
}

.sidebar-link:hover,
.sidebar-link.active {
    color: var(--sidebar-link-hover);
    background: rgba(37, 99, 235, 0.22);
}

.sidebar-link i {
    width: 20px;
    text-align: center;
}

.sidebar-logout {
    margin-top: auto;
}

.main-content {
    min-height: 100vh;
}

@media (min-width: 992px) {
    .main-content {
        margin-left: var(--sidebar-width);
    }
}

.top-navbar {
    min-height: 76px;
    display: flex;
    align-items: center;
    gap: 16px;
    justify-content: space-between;
    padding: 16px 24px;
    background: var(--surface);
    border-bottom: 1px solid #e2e8f0;
    position: sticky;
    top: 0;
    z-index: 1020;
}

.top-navbar h1 {
    margin: 0;
    font-size: clamp(1.12rem, 2vw, 1.45rem);
    font-weight: 700;
}

.top-navbar p {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.92rem;
}

.top-user {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #334155;
    font-weight: 600;
}

.content-wrap {
    padding: 24px;
}

.stat-card,
.panel-card {
    background: var(--surface);
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04);
}

.stat-card {
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    background: #e7f1ff;
    color: var(--primary);
    font-size: 1.45rem;
}

.stat-label {
    color: var(--text-muted);
    margin-bottom: 4px;
    font-weight: 600;
}

.stat-value {
    font-size: 1.55rem;
    font-weight: 800;
}

.panel-card {
    padding: 20px;
}

.panel-title {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 16px;
}

.table-toolbar {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.product-table-toolbar {
    align-items: center;
}

.product-toolbar-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

.product-export-actions {
    flex-wrap: wrap;
}

.product-filter-card {
    border: 1px solid #dbe4f0;
    border-radius: 8px;
    background: #f8fafc;
    box-shadow: none;
}

.product-filter-card .card-body {
    padding: 16px;
}

.product-filter-card .form-label {
    color: #334155;
    font-size: 0.88rem;
    font-weight: 700;
    margin-bottom: 6px;
}

.product-search-control {
    position: relative;
}

.product-search-control > i {
    position: absolute;
    top: 50%;
    left: 16px;
    z-index: 2;
    color: #64748b;
    transform: translateY(-50%);
    pointer-events: none;
}

.product-search-input {
    min-height: 52px;
    padding-left: 44px;
    border-radius: 8px;
    border-color: #cbd5e1;
    font-size: 1rem;
}

.product-filter-control,
.product-filter-submit,
.product-filter-reset {
    min-height: 44px;
    border-radius: 8px;
}

.product-filter-card .select2-container--bootstrap-5 .select2-selection {
    min-height: 44px;
    border-radius: 8px;
    border-color: #cbd5e1;
    display: flex;
    align-items: center;
}

.product-filter-card .select2-container--bootstrap-5 .select2-selection--single .select2-selection__rendered {
    line-height: 1.4;
    padding-left: 0.75rem;
}

.product-filter-card .select2-container--bootstrap-5 .select2-selection--single .select2-selection__arrow {
    height: 42px;
}

.product-table-wrap {
    min-height: 260px;
}

.product-data-table thead th {
    background: #f1f5f9;
    color: #1e293b;
    font-size: 0.86rem;
    font-weight: 800;
    letter-spacing: 0;
    padding-top: 12px;
    padding-bottom: 12px;
    white-space: nowrap;
}

.product-data-table tbody td {
    vertical-align: middle;
}

.dataTables_wrapper .dataTables_processing {
    border: 1px solid #dbe4f0;
    border-radius: 8px;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.12);
    color: #334155;
    font-weight: 700;
    padding: 14px 18px;
    background: #ffffff;
}

.form-help {
    font-size: 0.86rem;
}

.ck-editor {
    width: 100%;
}

.ck.ck-toolbar {
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
}

.ck.ck-editor__main > .ck-editor__editable {
    min-height: 220px;
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
}

.ck-content ul,
.ck-content ol,
.product-description-content ul,
.product-description-content ol {
    padding-left: 1.5rem;
    margin-bottom: 1rem;
}

.product-description-content h1,
.product-description-content h2,
.product-description-content h3,
.product-description-content h4,
.product-description-content h5,
.product-description-content h6 {
    margin: 0 0 0.75rem;
    font-weight: 700;
}

.product-description-content p {
    margin-bottom: 0.75rem;
}

.product-description-content :last-child {
    margin-bottom: 0;
}

.dataTables_wrapper .dt-buttons {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter {
    margin-bottom: 12px;
}

.product-datatable-controls .dataTables_length,
.product-datatable-controls .dt-buttons {
    margin-bottom: 0;
}

.dataTables_wrapper .dataTables_paginate .pagination {
    flex-wrap: wrap;
    gap: 4px;
    justify-content: flex-end;
    margin-bottom: 0;
}

.action-buttons {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.chart-box {
    min-height: 320px;
}

@media (max-width: 767.98px) {
    .top-navbar {
        padding: 14px 16px;
        align-items: flex-start;
    }

    .top-user {
        display: none;
    }

    .content-wrap {
        padding: 16px;
    }

    .panel-card {
        padding: 16px;
    }

    .product-filter-card .card-body {
        padding: 14px;
    }

    .product-search-input {
        min-height: 48px;
    }

    .product-filter-submit,
    .product-filter-reset {
        width: 100%;
    }

    .product-toolbar-actions,
    .product-toolbar-actions .btn,
    .product-export-actions {
        width: 100%;
    }

    .product-datatable-controls .dt-buttons {
        justify-content: flex-start;
        margin-top: 8px;
    }

    .dataTables_wrapper .dataTables_paginate .pagination {
        justify-content: flex-start;
        margin-top: 8px;
    }
}
