:root {
    --sb-red: #e30613;
    --sb-burgundy: #8f0010;
    --sb-burgundy-dark: #69000c;
    --sb-black: #000000;
    --sb-white: #ffffff;
    --sb-light: #f5f5f5;
    --app-header-height-desktop: 70px;
    --app-header-height-mobile: 92px;
    --app-sidebar-width: 230px;
    --app-sidebar-width-mobile: 220px;
}

.app-sidebar__user-avatar {
    width: 48px;
    background: gray;
    padding: 6px;
}

.headerRegister,
.header-primary,
.headerPrimary {
    background: var(--sb-red);
    color: #fff;
}

.headerUpdate {
    background: var(--sb-burgundy);
    color: #fff;
}

.notBlock {
    display: none;
}

.app-title {
    margin: 0 0 20px 0;
    padding: 0 0 12px 0;
    border-bottom: 2px solid var(--sb-red);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.app-title h1 {
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    font-size: 2rem;
    line-height: 1.1;
}

.app-breadcrumb {
    padding-right: 0;
    padding-top: 0;
    margin-bottom: 0;
}

.tile {
    -webkit-box-shadow: none;
    box-shadow: none;
    border-radius: 8px;
}

.treeview-item {
    margin-left: 20px;
}

.botonNew {
    margin-left: 20px;
}

.breadcrumb-item + .breadcrumb-item::before {
    padding-right: 0;
}

.app-content {
    min-height: calc(100vh - var(--app-header-height-desktop));
    margin-top: var(--app-header-height-desktop);
    margin-left: var(--app-sidebar-width);
    padding: 24px;
    background-color: var(--sb-light);
    overflow-x: hidden;
}


/* Unificación visual global UI admin */
.tile:not(.p-0) {
    padding: 16px;
    border: 1px solid #d9e2ec;
    background: #fff;
}

.tile .tile-body {
    padding: 0;
}

.table {
    margin-bottom: 0;
}

.table thead th {
    background: #f8fafc;
    font-weight: 600;
}

.form-control,
select.form-control,
.custom-select {
    min-height: 42px;
    border-radius: 6px;
    border-color: #c5ced8;
    box-shadow: none;
}

.form-control:focus,
select.form-control:focus,
.custom-select:focus {
    border-color: var(--sb-red);
    box-shadow: none;
}

.btn {
    border-radius: 6px;
    font-weight: 600;
    min-height: 42px;
}

.btn-sm {
    min-height: auto;
}

.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter {
    margin-bottom: 14px;
}

.dataTables_wrapper .dataTables_filter input {
    margin-left: 8px;
}

.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_paginate {
    margin-top: 14px;
}

.customer-history-card,
.customer-tax-card,
.customer-ranking-card {
    border: 1px solid #d9e2ec;
    border-radius: 8px;
    background: #fff;
}

.customer-history-total-box,
.customer-tax-total-box {
    border-color: #d9e2ec;
    border-radius: 8px;
}

.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.login-content .login-box label {
    margin-bottom: 0rem;
}

#divLoading {
    position: fixed;
    top: 0;
    width: 100%;
    height: 100%;
    display: none;
    justify-content: center;
    align-items: center;
    background: rgba(254,254,255,.65);
    z-index: 9999;
}

#divLoading img {
    width: 50px;
    height: 50px;
}

.required {
    color: red;
    font-size: 13pt;
    font-weight: bold;
}

.app-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 1030;
    display: flex;
    align-items: center;
    gap: 16px;
    height: var(--app-header-height-desktop);
    padding: 0 16px 0 0;
    background: var(--sb-black);
}

.app-sidebar__toggle {
    display: none;
}

.app-header__logo {
    display: flex;
    align-items: center;
    justify-content: center;
    width: var(--app-sidebar-width);
    min-width: var(--app-sidebar-width);
    height: 100%;
    padding: 0 16px;
    background: var(--sb-black);
}

.app-header__logo:hover,
.app-header__logo:focus {
    text-decoration: none;
}

.app-header__logo-image {
    display: block;
    max-width: 190px;
    width: 100%;
    height: auto;
}

.app-header__store {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-width: 0;
}

.app-header__store-label {
    color: #ffffff;
    font-size: 15px;
    line-height: 1.1;
}

.app-header__store-value {
    color: var(--sb-red);
    font-size: 26px;
    line-height: 1.05;
    font-weight: 700;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.app-nav {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    margin-bottom: 0;
    margin-left: auto;
    padding-left: 0;
}

.app-nav__item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    color: #fff;
    border-radius: 6px;
}

.app-nav__item:hover,
.app-nav__item:focus {
    background: rgba(255,255,255,.08);
    color: #fff;
}

.app-sidebar {
    top: var(--app-header-height-desktop);
    left: 0;
    width: var(--app-sidebar-width);
    height: calc(100vh - var(--app-header-height-desktop));
    padding-top: 0;
    z-index: 1020;
    background: var(--sb-black);
}

.app-sidebar__user {
    padding: 12px 10px;
    margin-bottom: 12px;
    border-bottom: 1px solid rgba(255,255,255,.12);
}

.app-menu {
    padding-bottom: 24px;
}

.app-menu__item,
.treeview-item {
    min-height: 42px;
}

.table td,
.table th {
    vertical-align: middle;
    white-space: nowrap;
}

.form-row {
    display: flex;
    flex-wrap: wrap;
    margin-right: -5px;
    margin-left: -5px;
}

.form-row > .col,
.form-row > [class*="col-"] {
    padding-right: 5px;
    padding-left: 5px;
}

.modal-dialog {
    margin: 1.75rem auto;
}

.modal-body {
    word-break: break-word;
}

div.dataTables_wrapper div.dataTables_paginate ul.pagination {
    justify-content: center;
}

.page-item.active .page-link {
    z-index: 1;
    color: #FFF;
    background-color: var(--sb-red);
    border-color: var(--sb-red);
}

.material-half-bg .cover {
    background-color: var(--sb-black);
}

.login-content .logo img {
    width: auto;
    max-width: 320px;
    height: auto;
}

.login-content .login-box {
    border-top: 4px solid var(--sb-red);
}

.login-content .login-box .login-head {
    color: var(--sb-black);
}

.btn-primary,
.btn-danger {
    background-color: var(--sb-red);
    border-color: var(--sb-red);
}

.btn-info,
.btn[style*="#287094"],
.btn[style*="#048abf"] {
    background-color: var(--sb-burgundy) !important;
    border-color: var(--sb-burgundy) !important;
    color: var(--sb-white) !important;
}

.btn-primary:hover,
.btn-primary:focus,
.btn-danger:hover,
.btn-danger:focus {
    background-color: #b8000c;
    border-color: #b8000c;
}

.btn-info:hover,
.btn-info:focus,
.btn[style*="#287094"]:hover,
.btn[style*="#287094"]:focus,
.btn[style*="#048abf"]:hover,
.btn[style*="#048abf"]:focus {
    background-color: var(--sb-burgundy-dark) !important;
    border-color: var(--sb-burgundy-dark) !important;
    color: var(--sb-white) !important;
}

.app-menu__item.active,
.app-menu__item:hover,
.app-menu__item:focus,
.treeview.is-expanded [data-toggle='treeview'],
.treeview-item.active,
.treeview-item:hover,
.treeview-item:focus {
    background: var(--sb-red);
    color: var(--sb-white);
}

#widget {
    border: 1px solid #ccc;
    padding: 15px;
    background-color: #f9f9f9;
    width: 400px;
    margin: 20px auto;
    text-align: center;
}

#widget ul {
    list-style: none;
    padding: 0;
}

#widget ul li {
    margin: 5px 0;
    font-size: 14px;
}

canvas {
    max-width: 100%;
    height: auto;
}


@media (min-width: 768px) {
    .app-header {
        position: fixed;
        justify-content: space-between;
        padding-right: 16px;
    }

    .app-header__store {
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: auto;
        max-width: 420px;
        pointer-events: none;
    }

    .app-content {
        padding: 28px 30px;
    }

    .app-title {
        margin-bottom: 22px;
        padding: 10px 18px;
        align-items: center;
    }

    .app-title h1 {
        font-size: 1.5rem;
        gap: 10px;
        align-items: center;
        line-height: 1;
    }

    .app-title h1 i {
        font-size: 0.86em;
    }
}

@media (max-width: 1199.98px) {
    .app-content {
        padding: 20px;
    }
}

@media (max-width: 991.98px) {
    .app-title h1 {
        font-size: 1.75rem;
    }

    .botonNew {
        margin-left: 0;
    }
}

@media (max-width: 767.98px) {
    .app-header {
        height: var(--app-header-height-mobile);
        padding: 8px 10px;
        display: grid;
        grid-template-columns: 42px 1fr 42px;
        grid-template-rows: 42px auto;
        grid-template-areas:
            "toggle logo nav"
            "store store store";
        gap: 6px 12px;
        align-items: center;
    }

    .app-sidebar__toggle {
        grid-area: toggle;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 42px;
        height: 42px;
        padding: 0;
        color: #fff;
        border-radius: 6px;
        background: transparent;
    }

    .app-sidebar__toggle:hover,
    .app-sidebar__toggle:focus {
        color: #fff;
        background: rgba(255,255,255,.08);
        text-decoration: none;
    }

    .app-header__logo {
        grid-area: logo;
        width: auto;
        min-width: 0;
        height: 42px;
        padding: 0;
        justify-content: flex-start;
        background: transparent;
    }

    .app-header__logo-image {
        max-width: 155px;
        width: auto;
        max-height: 42px;
    }

    .app-header__store {
        grid-area: store;
        padding-bottom: 2px;
    }

    .app-header__store-label {
        font-size: 12px;
    }

    .app-header__store-value {
        font-size: 20px;
        white-space: normal;
        word-break: break-word;
    }

    .app-nav {
        grid-area: nav;
        flex: 0 0 auto;
        margin-left: 0;
    }

    .app-nav__item {
        width: 42px;
        height: 42px;
    }

    .app-content {
        min-height: calc(100vh - var(--app-header-height-mobile));
        margin-top: var(--app-header-height-mobile);
        margin-left: 0;
        padding: 14px 10px;
    }

    .app-sidebar {
        top: var(--app-header-height-mobile);
        left: calc(var(--app-sidebar-width-mobile) * -1);
        width: var(--app-sidebar-width-mobile);
        height: calc(100vh - var(--app-header-height-mobile));
        z-index: 1040;
    }

    .app-sidebar__overlay {
        position: fixed;
        top: var(--app-header-height-mobile);
        right: 0;
        bottom: 0;
        left: 0;
        z-index: 1035;
        background: rgba(0, 0, 0, .35);
        opacity: 0;
        visibility: hidden;
        transition: opacity .25s ease, visibility .25s ease;
    }

    body.sidenav-toggled .app-sidebar {
        left: 0;
    }

    body.sidenav-toggled .app-sidebar__overlay {
        opacity: 1;
        visibility: visible;
    }

    .app-title {
        margin-bottom: 16px;
        padding-bottom: 10px;
    }

    .app-title h1 {
        width: 100%;
        font-size: 1.4rem;
        gap: 8px;
    }

    .botonNew,
    .app-title .btn {
        width: 100%;
        margin-left: 0;
    }

    .modal-dialog {
        max-width: calc(100% - 16px);
        margin: 8px auto;
    }

    #widget {
        width: 100%;
        margin: 10px 0;
    }
}

@media (max-width: 575.98px) {
    .app-header__logo-image {
        max-width: 140px;
    }

    .app-header__store-label {
        font-size: 11px;
    }

    .app-header__store-value {
        font-size: 18px;
    }

    .app-content {
        padding: 12px 8px;
    }

    .app-title h1 {
        font-size: 1.28rem;
    }

    .app-menu__label,
    .treeview-item .app-menu__label {
        white-space: normal;
    }

    .table-responsive {
        border: 0;
    }

    .modal-content {
        border-radius: 10px;
    }
}
