body {
    min-height: 100vh;
    background: #f5f7fb;
    color: #243447;
    font-family: Inter, "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

.admin-shell {
    display: flex;
    min-height: 100vh;
}

.admin-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 1040;
    width: 270px;
    overflow-y: auto;
    color: #dbe7ff;
    background: #172033;
}

.admin-sidebar-toggle,
.admin-sidebar-close,
.admin-sidebar-backdrop {
    display: none;
}

.admin-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 22px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.admin-brand-icon {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    color: #fff;
    background: #2fb06f;
    border-radius: 10px;
}

.admin-brand-image-wrap {
    overflow: hidden;
    background: #fff;
}

.admin-brand-logo {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 4px;
}

.admin-logo-preview {
    display: block;
    width: auto;
    max-width: 180px;
    height: 70px;
    object-fit: contain;
    border: 1px solid #dbe3ef;
    border-radius: 8px;
    padding: 8px;
    background: #fff;
}

.brand-thumb {
    width: 54px;
    height: 42px;
    display: inline-grid;
    place-items: center;
    object-fit: contain;
    border: 1px solid #dbe3ef;
    border-radius: 8px;
    padding: 5px;
    color: #7a8ca5;
    background: #fff;
}

.brand-thumb-empty {
    background: #f7f9fc;
}

.brand-logo-preview {
    width: auto;
    max-width: 180px;
    height: 86px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    object-fit: contain;
    border: 1px solid #dbe3ef;
    border-radius: 8px;
    padding: 8px;
    color: #7a8ca5;
    background: #fff;
}

.brand-logo-preview-empty {
    width: 180px;
    font-size: 14px;
    background: #f7f9fc;
}

.admin-slider-preview {
    display: block;
    width: min(360px, 100%);
    height: 130px;
    object-fit: cover;
    border: 1px solid #dbe3ef;
    border-radius: 8px;
    background: #fff;
}

.admin-brand strong,
.admin-brand small {
    display: block;
}

.admin-brand small {
    color: #98a8c3;
}

.sidebar-label {
    margin: 22px 24px 8px;
    color: #7f90ad;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    width: calc(100% - 28px);
    margin: 3px 14px;
    padding: 11px 14px;
    color: #dbe7ff;
    border: 0;
    border-radius: 8px;
    background: transparent;
    font: inherit;
    text-decoration: none;
    text-align: left;
}

.sidebar-link:hover,
.sidebar-link.active {
    color: #fff;
    background: rgba(47, 176, 111, 0.18);
}

.sidebar-link i {
    width: 22px;
    color: #69d69d;
    font-size: 18px;
}

.sidebar-toggle {
    cursor: pointer;
}

.sidebar-toggle-icon {
    margin-left: auto;
    color: #7f90ad !important;
    font-size: 14px !important;
    transition: transform 0.2s ease;
}

.sidebar-dropdown.open .sidebar-toggle,
.sidebar-dropdown.has-active .sidebar-toggle {
    color: #fff;
    background: rgba(47, 176, 111, 0.18);
}

.sidebar-dropdown.open .sidebar-toggle-icon,
.sidebar-dropdown.has-active .sidebar-toggle-icon {
    transform: rotate(180deg);
}

.sidebar-submenu {
    display: none;
    margin: 4px 0 8px;
    padding-left: 18px;
}

.sidebar-dropdown.open .sidebar-submenu,
.sidebar-dropdown.has-active .sidebar-submenu {
    display: block;
}

.sidebar-sublink {
    padding: 9px 14px;
    font-size: 14px;
}

.sidebar-sublink i {
    font-size: 10px;
}

.admin-main {
    width: calc(100% - 270px);
    margin-left: 270px;
}

.admin-header {
    position: sticky;
    top: 0;
    z-index: 1030;
    background: #fff;
    border-bottom: 1px solid #e5eaf1;
}

.admin-search {
    max-width: 460px;
}

.admin-avatar {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    color: #fff;
    background: #2fb06f;
    border-radius: 50%;
    font-weight: 800;
    object-fit: cover;
}

.admin-profile-trigger {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    padding: 4px 8px 4px 14px;
    border: 1px solid transparent;
    border-radius: 999px;
    background: #fff;
    transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.admin-profile-trigger:hover,
.admin-profile-trigger.show {
    border-color: #e5eaf1;
    background: #f8fafc;
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.08);
}

.admin-order-bell {
    color: #243447;
}

.admin-order-bell.has-new {
    color: #fff;
    background: #2fb06f;
    animation: adminBellPulse 1s ease-in-out 2;
}

.admin-order-toast {
    position: fixed;
    right: 24px;
    top: 92px;
    z-index: 1100;
    width: min(360px, calc(100vw - 32px));
    padding: 16px;
    color: #243447;
    background: #fff;
    border: 1px solid #dbe3ef;
    border-left: 4px solid #2fb06f;
    border-radius: 12px;
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.16);
    opacity: 0;
    pointer-events: none;
    transform: translateY(-12px);
    transition: opacity .22s ease, transform .22s ease;
}

.admin-order-toast.show {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.admin-order-toast strong,
.admin-order-toast span,
.admin-order-toast small {
    display: block;
}

.admin-order-toast span {
    margin-top: 4px;
    color: #607089;
}

.admin-order-toast a {
    display: inline-flex;
    margin-top: 10px;
    color: #198754;
    font-weight: 800;
    text-decoration: none;
}

@keyframes adminBellPulse {
    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.08);
    }
}

.admin-profile-trigger .admin-avatar {
    width: 38px;
    height: 38px;
}

.admin-profile-chevron {
    color: #8a98ad;
    font-size: 12px;
}

.admin-profile-card {
    min-width: 260px;
    padding: 10px;
    border: 1px solid #e5eaf1;
    border-radius: 8px;
    box-shadow: 0 16px 35px rgba(15, 23, 42, 0.12);
}

.admin-profile-card-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px;
}

.admin-profile-card-head strong,
.admin-profile-card-head small {
    display: block;
}

.admin-profile-card-head small {
    color: #718096;
    font-size: 12px;
}

.admin-profile-card .dropdown-item {
    display: flex;
    align-items: center;
    border-radius: 6px;
    padding: 9px 10px;
}

.profile-photo-row {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 16px;
    border: 1px solid #e5eaf1;
    border-radius: 8px;
    background: #f8fafc;
}

.profile-photo-preview,
.profile-photo-fallback {
    width: 82px;
    height: 82px;
    flex: 0 0 auto;
    border-radius: 50%;
}

.profile-photo-preview {
    object-fit: cover;
}

.profile-photo-fallback {
    display: grid;
    place-items: center;
    color: #fff;
    background: #2fb06f;
    font-size: 30px;
    font-weight: 800;
}

.note-editor.note-frame {
    border-color: #d8e0ea;
    border-radius: 8px;
}

.note-editor .note-toolbar {
    background: #f8fafc;
    border-bottom-color: #d8e0ea;
    border-radius: 8px 8px 0 0;
}

.note-editor .note-editing-area .note-editable {
    color: #172033;
    font-family: inherit;
}

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

.brand-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-width: 78px;
    height: 32px;
    padding: 0 10px;
    border: 1px solid transparent;
    border-radius: 6px;
    background: #fff;
    font-size: 13px;
    line-height: 1;
    white-space: nowrap;
}

.brand-action-edit {
    color: #0d6efd;
    border-color: rgba(13, 110, 253, 0.28);
    background: rgba(13, 110, 253, 0.06);
}

.brand-action-warning {
    color: #9a6700;
    border-color: rgba(255, 193, 7, 0.42);
    background: rgba(255, 193, 7, 0.1);
}

.brand-action-success {
    color: #198754;
    border-color: rgba(25, 135, 84, 0.3);
    background: rgba(25, 135, 84, 0.08);
}

.brand-action-danger {
    color: #dc3545;
    border-color: rgba(220, 53, 69, 0.28);
    background: rgba(220, 53, 69, 0.06);
}

.brand-action:hover {
    filter: brightness(0.97);
}

.brand-action:disabled {
    cursor: not-allowed;
    opacity: 0.58;
    filter: grayscale(0.2);
}

.admin-role-select {
    max-width: 150px;
}

.assigned-role-select {
    max-width: 160px;
}

.permission-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.permission-option {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 38px;
    padding: 8px 10px;
    border: 1px solid #d8e0ea;
    border-radius: 6px;
    background: #f8fafc;
}

.permission-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.permission-badges span {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 3px 8px;
    color: #198754;
    background: rgba(25, 135, 84, 0.08);
    border: 1px solid rgba(25, 135, 84, 0.16);
    border-radius: 999px;
    font-size: 12px;
}

.content-wrap {
    padding: 28px;
}

.page-title {
    margin-bottom: 22px;
}

.page-title h1 {
    margin: 0;
    color: #172033;
    font-size: 28px;
    font-weight: 800;
}

.page-title p {
    margin: 6px 0 0;
    color: #718096;
}

.stat-card {
    border: 0;
    border-radius: 10px;
    box-shadow: 0 16px 38px rgba(23, 32, 51, 0.08);
}

.stat-icon {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    font-size: 22px;
}

.table-card,
.form-card {
    border: 0;
    border-radius: 10px;
    box-shadow: 0 16px 38px rgba(23, 32, 51, 0.08);
}

.dashboard-chart {
    position: relative;
    width: 100%;
}

.dashboard-sales-chart {
    height: 330px;
}

.dashboard-status-chart {
    height: 190px;
}

.dashboard-chart-legend {
    min-height: 32px;
    gap: 10px;
    padding: 4px 0;
}

.dashboard-chart-dot {
    width: 9px;
    height: 9px;
    flex: 0 0 9px;
    border-radius: 50%;
    background: #198754;
}

.dashboard-chart-dot-confirmed {
    background: #1f6feb;
}

.dashboard-chart-dot-shipping {
    background: #f0ad4e;
}

.dashboard-chart-dot-delivered {
    background: #20a779;
}

.dashboard-chart-dot-cancelled {
    background: #dc3545;
}

.table > :not(caption) > * > * {
    padding: 15px 18px;
}

.badge-soft-success {
    color: #198754;
    background: #e7f6ee;
}

.badge-soft-warning {
    color: #b7791f;
    background: #fff4dc;
}

.badge-soft-danger {
    color: #c53030;
    background: #ffe5e5;
}

.badge-soft-info {
    color: #1f6feb;
    background: #e7f0ff;
}

.product-thumb {
    width: 46px;
    height: 46px;
    object-fit: cover;
    border-radius: 8px;
}

.auth-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 28px 16px;
    background: linear-gradient(135deg, #f5f7fb 0%, #eaf7f0 100%);
}

.auth-card {
    width: min(100%, 440px);
    padding: 34px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 22px 60px rgba(23, 32, 51, 0.12);
}

.auth-brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
    color: #172033;
    text-decoration: none;
}

.auth-brand strong,
.auth-brand small {
    display: block;
}

.auth-brand strong {
    font-size: 24px;
    line-height: 1;
}

.auth-brand small {
    color: #718096;
}

.auth-card h1 {
    margin-bottom: 8px;
    font-size: 28px;
    font-weight: 800;
}

@media (max-width: 991px) {
    .admin-sidebar {
        position: fixed;
        inset: 0 auto 0 0;
        z-index: 1060;
        width: min(300px, 86vw);
        min-height: 100vh;
        max-height: none;
        box-shadow: 18px 0 45px rgba(15, 23, 42, 0.22);
        transform: translateX(-105%);
        transition: transform 0.24s ease;
    }

    .admin-sidebar.is-open {
        transform: translateX(0);
    }

    .admin-sidebar-toggle,
    .admin-sidebar-close {
        width: 42px;
        height: 42px;
        display: inline-grid;
        place-items: center;
        padding: 0;
        border: 0;
        border-radius: 8px;
    }

    .admin-sidebar-toggle {
        flex: 0 0 42px;
        color: #198754;
        background: #edf8f2;
        font-size: 24px;
    }

    .admin-sidebar-close {
        position: absolute;
        top: 22px;
        right: 14px;
        color: #dbe7ff;
        background: rgba(255, 255, 255, 0.09);
        font-size: 18px;
    }

    .admin-brand {
        padding-right: 64px;
    }

    .admin-sidebar-backdrop {
        position: fixed;
        inset: 0;
        z-index: 1050;
        width: 100%;
        height: 100%;
        display: block;
        padding: 0;
        border: 0;
        background: rgba(15, 23, 42, 0.48);
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.2s ease, visibility 0.2s ease;
    }

    .admin-sidebar-backdrop.is-visible {
        opacity: 1;
        visibility: visible;
    }

    body.admin-nav-open {
        overflow: hidden;
    }

    .admin-shell {
        display: block;
    }

    .admin-main {
        width: 100%;
        margin-left: 0;
    }

    .content-wrap {
        padding: 20px;
    }

    .admin-header > .d-flex {
        padding: 12px 20px !important;
    }

    .admin-search {
        order: 3;
        flex-basis: 100%;
        max-width: none;
    }

    .dashboard-sales-chart {
        height: 290px;
    }

    .permission-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 575px) {
    .content-wrap {
        padding: 16px;
    }

    .admin-header > .d-flex {
        gap: 10px !important;
        padding: 10px 16px !important;
    }

    .admin-header h5 {
        font-size: 16px;
    }

    .admin-header h5 + small {
        display: none;
    }

    .admin-header .gap-3 {
        gap: 8px !important;
    }

    .admin-profile-trigger {
        min-height: 42px;
        padding: 2px;
    }

    .admin-profile-chevron {
        display: none;
    }

    .page-title h1 {
        font-size: 24px;
    }

    .page-title .btn {
        flex: 1 1 auto;
    }

    .table-card .card-header,
    .form-card .card-header {
        padding: 12px 14px;
    }

    .table > :not(caption) > * > * {
        padding: 12px 14px;
    }

    .admin-order-toast {
        top: 118px;
        right: 12px;
        width: calc(100vw - 24px);
    }

    footer.px-4 {
        padding-inline: 16px !important;
    }
}
