﻿:root {
    --flag-red: #E30A17;
    --flag-red-hover: #b80812;
    --anthracite: #36454F;
    --anthracite-dark: #2C3539;
    --bg-light: #f4f6f9;
    --white: #ffffff;
    --border-color: #e0e0e0;
    --sidebar-width: 270px;
    --header-height: 80px;
    --bs-pagination-active-color: ffffff;
    --bs-primary-border-subtle: #dfdfdf !important;
    --bs-primary-bg-subtle: #c9c9c9 !important;
    /*--bs-card-height: calc(100vh - 270px) !important;*/
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-light);
    color: var(--anthracite);
    overflow-x: hidden;
}

/* ----- Layout & Sidebar ----- */
#sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    background-color: var(--anthracite);
    color: var(--white);
    transition: all 0.3s ease;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
}

#main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

div.sidebar-toggled #sidebar {
    left: calc(-1 * var(--sidebar-width));
}

div.sidebar-toggled #main-content {
    margin-left: 0;
}

@media (max-width: 991.98px) {
    #sidebar {
        left: calc(-1 * var(--sidebar-width));
    }

    #main-content {
        margin-left: 0;
    }

    div.sidebar-toggled #sidebar {
        left: 0;
    }
}

/* ----- Sidebar Navigation ----- */
.sidebar-brand {
    height: var(--header-height);
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--white);
    text-decoration: none;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    background-color: var(--anthracite-dark);
}

    .sidebar-brand span {
        color: var(--flag-red);
    }

.sidebar-nav {
    padding: 0.75rem 0;
    list-style: none;
    margin: 0;
    flex: 1;
    overflow-y: auto;
}

    .sidebar-nav::-webkit-scrollbar {
        width: 5px;
    }

    .sidebar-nav::-webkit-scrollbar-thumb {
        background: rgba(255,255,255,0.2);
        border-radius: 4px;
    }

.sidebar-nav.nav-heading {
    padding: 1.25rem 1.5rem 0.35rem;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: rgba(255,255,255,0.45);
    font-weight: 700;
}

    .nav-heading hr {
        border-color: rgba(255,255,255,0.1);
        margin: 0.5rem 0;
    }

.nav-item {
    margin: 0.15rem 0.75rem;
}

aside .nav-link {
    display: flex;
    align-items: center;
    padding: 0.65rem 0.9rem;
    color: rgba(255,255,255,0.8);
    border-radius: 8px;
    transition: all 0.2s ease;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
}

    aside .nav-link i:first-child {
        margin-right: 10px;
        font-size: 1.05rem;
        width: 20px;
        text-align: center;
    }

    aside .nav-link:hover {
        color: var(--white);
        background-color: rgba(255,255,255,0.08);
    }

    aside .nav-link.active {
        color: var(--white);
        background-color: var(--flag-red);
        box-shadow: 0 4px 10px rgba(227, 10, 23, 0.3);
    }

    aside .nav-link[data-bs-toggle="collapse"] .bi-chevron-down {
        transition: transform 0.25s ease;
        font-size: 0.8rem;
    }

    aside .nav-link[data-bs-toggle="collapse"].collapsed .bi-chevron-down {
        transform: rotate(-90deg);
    }

.nav-content {
    list-style: none;
    padding: 0.3rem 0 0.3rem 1.85rem;
    margin: 0;
}

    .nav-content li {
        margin-bottom: 2px;
    }

    .nav-content a {
        display: flex;
        align-items: center;
        gap: 8px;
        padding: 0.45rem 0.75rem;
        font-size: 0.83rem;
        color: rgba(255,255,255,0.65);
        text-decoration: none;
        border-radius: 6px;
        transition: all 0.2s ease;
    }

        .nav-content a i {
            font-size: 0.45rem;
        }

        .nav-content a:hover {
            color: var(--white);
            background-color: rgba(255,255,255,0.06);
            padding-left: 1rem;
        }

        .nav-content a.active {
            color: var(--white);
            font-weight: 600;
            background-color: rgba(227, 10, 23, 0.25);
        }

/* ----- Sidebar Footer ----- */
.sidebar-footer {
    padding: 0.85rem;
    background-color: var(--anthracite-dark);
    border-top: 1px solid rgba(255,255,255,0.08);
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    flex-shrink: 0;
}

    .sidebar-footer .user-profile {
        display: flex;
        align-items: center;
        gap: 10px;
        cursor: pointer;
        padding: 0.4rem 0.5rem;
        border-radius: 8px;
        transition: background-color 0.2s ease;
    }

        .sidebar-footer .user-profile:hover {
            background-color: rgba(255,255,255,0.08);
        }

        .sidebar-footer .user-profile img {
            width: 36px;
            height: 36px;
            border-radius: 50%;
            object-fit: cover;
            border: 2px solid rgba(255,255,255,0.4);
        }

    .sidebar-footer .user-info {
        display: flex;
        flex-direction: column;
        min-width: 0;
    }

        .sidebar-footer .user-info .name {
            font-size: 0.85rem;
            font-weight: 600;
            color: var(--white);
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .sidebar-footer .user-info .role {
            font-size: 0.72rem;
            color: rgba(255,255,255,0.7);
        }

/* ----- Top Header ----- */
.top-header {
    height: var(--header-height);
    background-color: var(--flag-red);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 1.5rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 999;
}

.top-bar-logo {
    width: 300px;
    max-width: 100%;
    height: auto;
    max-height: 68px;
    object-fit: contain;
    display: block;
}

.toggle-btn {
    position: absolute;
    left: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 1.65rem;
    color: var(--white);
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

@media (max-width: 767.98px) {
    .top-bar-logo {
        width: 70%;
        max-width: 70%;
        max-height: 75px;
    }
}

@media (max-width: 575.98px) {
    .top-header {
        padding: 0 1rem;
    }

    .toggle-btn {
        left: 1rem;
        font-size: 1.5rem;
    }

    .top-bar-logo {
        width: 50%;
        max-width: 50%;
        max-height: 48px;
    }
}

/* ----- Main Content Area ----- */
.content-area {
    padding: 1rem;
    flex: 1;
}

.page-title {
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--anthracite-dark);
}

.custom-card {
    background: var(--white);
    border-radius: 12px;
    border: none;
    box-shadow: 0 5px 20px rgba(0,0,0,0.05);
    /*margin-bottom: 1.5rem;*/
}

    .custom-card .card-header {
        background: transparent;
        border-bottom: 1px solid var(--border-color);
        padding: 1.25rem 1.5rem;
        font-weight: 600;
        font-size: 1.1rem;
        color: var(--anthracite);
    }

    .custom-card .card-body {
        padding: 1.5rem;
    }

/* Custom Inputs & Controls */
.form-control, .form-select, .input-group-text {
    border-radius: 8px;
    border-color: var(--border-color);
    font-size: 0.95rem;
}

/*.form-control {
    padding: 0.6rem 1rem;
}
*/
.input-group-text {
    background-color: #f8f9fa;
    color: #6c757d;
    border-right: none;
}

.input-group .form-control {
    border-left: none;
/*    padding-left: 0;*/
}

.form-control:focus, .form-select:focus {
    border-color: var(--flag-red);
    box-shadow: none;
}

.input-group:focus-within .input-group-text,
.input-group:focus-within .form-control {
    border-color: var(--flag-red);
    box-shadow: 0 0 0 0.25rem rgba(227, 10, 23, 0.1);
}

/* Custom Buttons */
.btn-custom-primary {
    background-color: var(--flag-red);
    color: var(--white);
    border: none;
    /*border-radius: 8px;*/
    /*padding: 0.55rem 1.1rem;*/
    font-weight: 500;
    transition: all 0.2s;
}

    .btn-custom-primary:hover {
        background-color: var(--flag-red-hover);
        color: var(--white);
    }

.btn-custom-secondary {
    background-color: var(--anthracite);
    color: var(--white);
    border: none;
    /*border-radius: 8px;*/
    /*padding: 0.55rem 1.1rem;*/
    font-weight: 500;
    transition: all 0.2s;
}

    .btn-custom-secondary:hover {
        background-color: var(--anthracite-dark);
        color: var(--white);
    }

.btn-custom-outline-danger {
    background-color: transparent;
    color: var(--flag-red);
    border: 1px solid var(--flag-red);
    /*border-radius: 8px;*/
    /*padding: 0.6rem 1.2rem;*/
    font-weight: 500;
    transition: all 0.2s;
}

    .btn-custom-outline-danger:hover {
        background-color: var(--flag-red);
        color: var(--white);
    }
.btn-custom-outline-success {
    background-color: transparent;
    color: #198754;
    border: 1px solid #198754;
    /*border-radius: 8px;
    padding: 0.55rem 1.1rem;*/
    font-weight: 500;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
}

    .btn-custom-outline-success:hover {
        background-color: #198754;
        color: var(--white);
    }
.form-switch .form-check-input:checked {
    background-color: var(--flag-red);
    border-color: var(--flag-red);
}

.form-switch .form-check-input:focus {
    box-shadow: 0 0 0 0.25rem rgba(227, 10, 23, 0.2);
}

/* Filter Panel */
.filter-panel {
    background-color: #fafbfc;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
    display: none;
}

    .filter-panel.show {
        display: block;
    }

/* Table Styling */
.custom-table {
    border-collapse: separate;
    border-spacing: 0;
    width: 100%;
}

    .custom-table thead th {
        background-color: var(--anthracite-dark);
        color: var(--white);
        font-weight: 600;
        font-size: 0.82rem;
        padding: 0.85rem 0.75rem;
        border: none;
        user-select: none;
        white-space: nowrap;
    }

        /*        .custom-table thead th:first-child {
            border-top-left-radius: 8px;
        }

        .custom-table thead th:last-child {
            border-top-right-radius: 8px;
        }
*/
        .custom-table thead th.sortable:hover {
            background-color: #232a2d;
            cursor: pointer;
        }

    .custom-table tbody td {
        padding: 0.4rem 0.75rem;
        vertical-align: middle;
        border-bottom: 1px solid var(--border-color);
        color: var(--anthracite);
        font-size: 0.86rem;
        white-space: nowrap;
    }

    .custom-table tbody tr {
        cursor: pointer;
        transition: background-color 0.15s ease;
    }

        .custom-table tbody tr:hover {
            background-color: rgba(227, 10, 23, 0.02);
        }

    .empty-state {
        padding: 4rem 1rem;
        text-align: center;
        color: #6c757d;
    }

    .empty-state i {
        font-size: 3rem;
        color: #adb5bd;
        display: inline-block;
        margin-bottom: 0.75rem;
    }

/* Modal Styles */
.custom-modal .modal-content {
    border: none;
    border-radius: 16px;
    /*overflow: hidden;*/
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
}

.custom-modal .modal-header {
    background-color: var(--flag-red);
    color: var(--white);
    border-bottom: none;
    padding: 1.25rem 1.5rem;
}

.custom-modal .modal-title {
    font-weight: 600;
}

.custom-modal .btn-close {
    filter: brightness(0) invert(1);
    opacity: 0.8;
}

.custom-modal .modal-body {
    padding: 1.75rem 1.5rem;
}

.custom-modal .modal-footer {
    border-top: 1px solid var(--border-color);
    padding: 1rem 1.5rem;
    background-color: #f8f9fa;
}

/* Footer */
.footer {
    background-color: var(--white);
    padding: 0.5rem 2rem;
    text-align: center;
    border-top: 1px solid var(--border-color);
    color: var(--anthracite);
    font-size: 0.9rem;
    margin-top: auto;
}

    .footer a {
        color: var(--flag-red);
        text-decoration: none;
        font-weight: 500;
    }



/**********/
.page-link {
    color: var(--anthracite-dark) !important;
}

    .active > .page-link, .page-link.active {
        z-index: 3;
        color: var(--bs-pagination-active-color) !important;
        background-color: var(--anthracite-dark);
        border-color: var(--anthracite-dark);
    }

.modal-table-scroll {
    min-height: 200px;
    max-height: 300px;
    height: 100%;
    flex-basis: 0 !important;
    flex-shrink: 1 !important;
    flex-grow: 1 !important;
    overflow: auto !important;
}

    .modal-table-scroll thead tr:nth-child(1) th, .modal-table-scroll thead, .modal-table-scroll thead tr {
        position: sticky;
        top: -1px;
    }

    .modal-table-scroll > div {
        height: 100%;
        overflow: initial !important;
    }

.page-table {
    height: calc(100vh - 150px) !important;
    flex-basis: 0 !important;
    flex-shrink: 1 !important;
    flex-grow: 1 !important;
    overflow: hidden !important;
}

    .page-table thead tr:nth-child(1) th, .page-table thead, .page-table thead tr {
        position: sticky;
        top: -1px;
    }

.table-responsive {
    height: calc(100% - 55px);
}

th, td {
    white-space: nowrap
}

.tab-content {
    border: 1px solid #ced4da;
}

.bb-table > tbody tr:has(input[type="checkbox"].bb-grid-form-check-input:checked) {
    color: var(--bb-table-selected-row-color);
    background-color: var(--bb-table-selected-row-background-color);
}

td .form-check-input:checked {
    background-color: #2c3539;
    border-color: #2c3539;
}
.badge-offline {
    background-color: #fde8e9;
    color: var(--flag-red);
    font-weight: 600;
    padding: 0.3rem 0.65rem;
    border-radius: 6px;
    font-size: 0.75rem;
}

.badge-online {
    background-color: #e6f7ec;
    color: #198754;
    font-weight: 600;
    padding: 0.3rem 0.65rem;
    border-radius: 6px;
    font-size: 0.75rem;
}

.badge-error {
    background-color: #fff3cd;
    color: #b07d04;
    font-weight: 600;
    padding: 0.3rem 0.65rem;
    border-radius: 6px;
    font-size: 0.75rem;
}

.device-card {
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.03);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

    .device-card:hover {
        transform: translateY(-3px);
        box-shadow: 0 8px 24px rgba(0,0,0,0.08);
    }

.device-card-header {
    background-color: var(--anthracite-dark);
    color: #ffffff;
    padding: 0.75rem 1rem;
    font-size: 0.85rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.device-card-body {
    padding: 1.15rem 1.25rem;
    flex: 1;
}

/* Status Card Accent Variations */
.device-card.status-offline {
    border-top: 4px solid var(--flag-red);
}

.device-card.status-online {
    border-top: 4px solid #198754;
}

.device-card.status-error {
    border-top: 4px solid #fd7e14;
}
.metric-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.45rem 0;
    font-size: 0.875rem;
    border-bottom: 1px dashed #f0f0f0;
}

    .metric-row:last-child {
        border-bottom: none;
        padding-bottom: 0;
    }

.metric-label {
    color: #6c757d;
    font-weight: 500;
}

.metric-val {
    font-weight: 600;
    color: var(--anthracite-dark);
}

.nav-tabs .nav-link {
    color: var(--flag-red);
}
    .nav-tabs .nav-link:hover {
        color: var(--flag-red-hover);
    }

.sale-item-btn {
    width: 100%;
    background-color: var(--white);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
    margin-bottom:0.75rem;
}

    .sale-item-btn:hover {
        border-color: var(--flag-red);
        background-color: rgba(227, 10, 23, 0.02);
        transform: translateY(-2px);
        box-shadow: 0 8px 15px rgba(227, 10, 23, 0.08);
    }

    .sale-item-btn .item-icon {
        width: 80px;
        height: 60px;
        background-color: var(--anthracite);
        border-radius: 8px;
        display: flex;
        align-items: center;
        justify-content: center;
        color: var(--white);
        font-size: 1.5rem;
    }

.sale-item-info h4 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--anthracite);
}

.sale-item-info p {
    margin: 5px 0 0;
    font-size: 1.1rem;
    color: #6c757d;
    font-weight: 500;
}

.sale-item-info strong {
    color: var(--flag-red);
    font-size: 1.3rem;
}

.info-row {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #f0f0f0;
}

    .info-row:last-child {
        margin-bottom: 0;
        padding-bottom: 0;
        border-bottom: none;
    }

.info-label {
    font-weight: 600;
    color: var(--anthracite-dark);
    font-size: 0.95rem;
}

.price-display {
    font-size: 3.5rem;
    font-weight: 700;
    color: var(--anthracite);
    text-align: right;
    padding: 1rem 0;
    line-height: 1;
}

.price-currency {
    font-size: 2rem;
    color: var(--flag-red);
}

.massive-btn {
    height: 80px;
    font-size: 1.5rem;
    font-weight: 600;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}
.qr-scroll-container {
    max-height: 670px;
    overflow-y: auto;
    padding-right: 6px;
}

    .qr-scroll-container::-webkit-scrollbar {
        width: 6px;
    }

    .qr-scroll-container::-webkit-scrollbar-thumb {
        background: #d0d5dd;
        border-radius: 4px;
    }
