:root {
    --sidebar-width: 260px;
    --bg-dark: #0b0c0d;
    --sidebar-bg: #111214;
    --card-bg: rgba(24, 25, 27, 0.8);
    --border-color: rgba(38, 40, 43, 0.6);
    --text-main: #ffffff;
    --text-muted: #8b949e;
    --primary-color: #00d1b2;
    --accent-blue: #4572ef;
    --danger-color: #ff4560;
}

body { 
    background-color: var(--bg-dark) !important; 
    background-image: radial-gradient(rgba(255, 255, 255, 0.13) 1.2px, transparent 0) !important;
    background-size: 40px 40px !important; 
    background-attachment: fixed !important;
    color: #ffffff !important;
    font-family: 'Inter', sans-serif;
    margin: 0;
    position: relative;
    z-index: 1;
}

body::after {
    content: "BANNEDNATION";
    position: fixed;
    top: 50%;
    right: -2%;
    transform: translateY(-50%) rotate(180deg);
    writing-mode: vertical-rl;
    font-size: 12rem;
    font-weight: 950;
    text-transform: uppercase;
    letter-spacing: -5px;
    color: rgba(255, 255, 255, 0.03);
    filter: blur(1px);
    user-select: none;
    pointer-events: none;
    z-index: -2;
}

.sidebar {
    width: var(--sidebar-width); 
    height: 100vh; 
    position: fixed; 
    top: 0;
    left: 0;
    background: var(--sidebar-bg); 
    border-right: 1px solid var(--border-color);
    padding: 20px;
    z-index: 1001; 
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-link { 
    color: var(--text-muted) !important; 
    padding: 12px 15px; 
    border-radius: 8px; 
    margin-bottom: 5px; 
    transition: 0.2s all; 
    display: flex;
    align-items: center;
}

.nav-link:hover, .nav-link.active { 
    background: rgba(255, 255, 255, 0.05); 
    color: var(--text-main) !important; 
}

.nav-link.active {
    border-left: 3px solid var(--primary-color);
    background: linear-gradient(90deg, rgba(0, 209, 178, 0.1) 0%, transparent 100%);
}

.main-content { 
    margin-left: var(--sidebar-width); 
    padding: 30px; 
    min-height: 100vh;
    position: relative;
    z-index: 10;
    transition: margin-left 0.3s ease;
}

.card { 
    background: var(--card-bg) !important; 
    border: 1px solid rgba(0, 209, 178, 0.1) !important; 
    border-radius: 4px !important; 
    color: var(--text-main);
    backdrop-filter: blur(10px);
    position: relative;
    overflow: visible !important; 
    transition: all 0.3s ease;
    
    box-shadow: 0 0 20px rgba(0, 209, 178, 0.03); 
}

.card:hover {
    border-color: rgba(0, 209, 178, 0.3) !important;
    transform: translateY(-2px);
}

.card::before {
    content: "";
    position: absolute;
    top: -1px;
    left: -1px;
    width: 12px;
    height: 12px;
    border-top: 2px solid var(--primary-color);
    border-left: 2px solid var(--primary-color);
    z-index: 10;
}

.card::after {
    content: "";
    position: absolute;
    bottom: -1px;
    right: -1px;
    width: 12px;
    height: 12px;
    border-bottom: 2px solid var(--primary-color);
    border-right: 2px solid var(--primary-color);
    z-index: 10;
}

.card .icon-shape {
    flex-shrink: 0; 
    margin-left: 10px;
}

.card h6, .card .h6 {
    white-space: nowrap; 
    overflow: hidden;
    text-overflow: ellipsis; 
    max-width: 100%;
}

.card .d-flex {
    align-items: center;
    overflow: hidden;
}


.h4, .fw-bold, .h6 {
    font-family: 'JetBrains Mono', monospace !important;
}



.icon-shape {
    width: 40px; height: 40px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 8px; background: #0d1117;
    border: 1px solid var(--border-color);
    position: relative; z-index: 2;
}

.text-info { text-shadow: 0 0 10px rgba(0, 209, 178, 0.4); }
.text-warning { text-shadow: 0 0 10px rgba(255, 193, 7, 0.4); }
.text-primary { text-shadow: 0 0 10px rgba(69, 114, 239, 0.4); }
.text-danger { text-shadow: 0 0 10px rgba(255, 69, 96, 0.4); }

.text-secondary, .text-muted, .small { color: #8b949e !important; }

.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(6px);  
    z-index: 900;                 
    
    /* Скрыто по умолчанию */
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease-in-out;
}

.sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
}

@media (max-width: 992px) {
    .sidebar { 
        transform: translateX(-100%); 
    }
    
    .sidebar.active { 
        transform: translateX(0); 
    }
    
    .main-content { 
        margin-left: 0 !important; 
        padding: 15px; 
    }

   
    .card {
        margin-bottom: 15px;
        overflow: visible; 
    }

    body::after {
        font-size: 6rem;
        right: -5%;
        opacity: 0.5; 
    }
}


.row > [class*="col-"] {
    display: flex;
    flex-direction: column;
}

@media (max-width: 576px) {
    .card .h4, .card h4 {
        font-size: 1.1rem !important; 
        white-space: nowrap;         
    }
    .card .text-muted.small {
        font-size: 0.7rem !important; 
    }
}

@media (max-width: 992px) {
    .main-content {
        margin-left: 0 !important;
        width: 100% !important; 
        padding: 15px;
    }
}

@media (max-width: 576px) {
    .mobile-key-card {
        background: var(--card-bg);
        border: 1px solid var(--border-color);
        border-radius: 8px;
        padding: 12px;
        margin-bottom: 10px;
    }
    .mobile-key-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        border-bottom: 1px style dashed rgba(255,255,255,0.1);
        padding-bottom: 8px;
        margin-bottom: 8px;
    }
    .status-dot {
        font-size: 0.7rem;
        padding: 2px 8px;
        border-radius: 20px;
    }
}


.modal.show {
        background: rgba(0, 0, 0, 0.75) !important;
        backdrop-filter: blur(4px); 
    }
    

    .modal-backdrop {
        display: none !important;
    }

    .modal-content, .card {
        z-index: 100001 !important;
        pointer-events: all !important; 
    }

.btn-action {
    min-width: 45px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

@media (max-width: 768px) {
    .btn-action {
        width: 100%; 
        padding: 12px;
    }
}

#toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
}
.toast-custom {
    background: #1a1a1a !important;
    border-left: 4px solid #00ff88 !important;
    color: white !important;
    min-width: 250px;
}


.card.d-none.d-lg-block {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}


.table-custom {
    background: transparent !important;
    border-collapse: separate !important;
    border-spacing: 0 10px !important;
    color: #ffffff !important;
    width: 100%;
    border: none !important;
}

.table-custom > :not(caption) > * > * {
    background-color: transparent !important;
    box-shadow: none !important;
}

.table-custom tbody tr.key-row {
    background: rgba(255, 255, 255, 0.05) !important;
    transition: all 0.2s ease;
    cursor: pointer;
}

.table-custom thead th {
   color: rgba(255, 255, 255, 0.8) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 1px;
    opacity: 1; 
}

.table-custom td, .table-custom th {
    border: none !important;
    padding: 15px;
}

.table-custom tr.key-row td:nth-child(2) { 
        color: #ffffff !important;
    }

.table-custom td.fw-bold {
    color: #00d1b2 !important;
    font-family: 'JetBrains Mono', monospace !important;
}


.badge-day { background: rgba(255, 193, 7, 0.1); color: #ffc107; border: 1px solid #ffc107; }
.badge-week { background: rgba(0, 209, 178, 0.1); color: #00d1b2; border: 1px solid #00d1b2; }
.badge-month { background: rgba(69, 114, 239, 0.1); color: #4572ef; border: 1px solid #4572ef; }


@media (max-width: 768px) {
    .table-responsive { overflow: visible !important; }
    .table-custom { display: table !important; }
    .table-custom thead { display: none !important; }

    .table-custom tbody tr.key-row {
        display: flex !important;
        flex-direction: column;
        background: #0d0d0d !important;
        border: 1px solid #222 !important;
        border-radius: 12px;
        margin-bottom: 12px;
        padding: 16px !important;
        position: relative;
        z-index: 10;
    }

    .table-custom tbody tr.key-row.active {
        border-radius: 12px 12px 0 0 !important;
        margin-bottom: 0 !important;
        border-bottom: 1px solid #1a1a1a !important;
    }

    .table-custom tr td {
        display: block !important;
        background: transparent !important; 
        padding: 0 !important;
        border: none !important;
    }

    .table-custom tr.key-row td:nth-child(1) { 
        order: 1; 
        width: max-content !important; 
        display: inline-block !important; 
        margin-bottom: 8px;
    } 
    
    .table-custom tr.key-row td:nth-child(5) { 
        order: 2;
        position: absolute;
        top: 18px;
        right: 16px;
        text-align: right !important;
        font-size: 0.75rem;
        color: #777;
        width: auto !important;
    }

    .table-custom tr.key-row td:nth-child(2) { 
        order: 3;
        font-size: 1.2rem;
        font-weight: 700;
        margin-bottom: 12px;
        width: 100% !important;
        color: #ffffff !important;
    }

    .table-custom tr.key-row td:nth-child(3) { 
        order: 4;
        background: rgba(0, 207, 236, 0.05) !important;
        border: 1px solid rgba(0, 207, 236, 0.2) !important;
        border-radius: 8px;
        padding: 12px !important;
        margin-bottom: 16px !important;
        text-align: center !important;
        color: #00cfec !important;
        font-family: monospace;
        width: 100% !important;
    }

    .table-custom tr.key-row td:nth-child(4) { 
        order: 5; 
        display: inline-block !important; 
        width: auto !important; 
        font-size: 1.3rem; 
        font-weight: 800;
        color: #00ff88 !important;
    }

    .table-custom tr.key-row td:nth-child(6) { 
        order: 6; 
        position: absolute;
        bottom: 18px;
        right: 16px;
        width: auto !important;
        text-align: right !important;
    }

    .details-row td {
        display: block !important;
        width: 100% !important;
        background: #111 !important;
        border: 1px solid #222 !important;
        border-top: none !important;
        border-radius: 0 0 12px 12px !important;
        margin-top: -1px !important;
        margin-bottom: 20px !important;
        padding: 0 !important;
        overflow: hidden !important;
    }

    .details-row .row { display: block !important; margin: 0 !important; }
    .details-row .col-md-3 {
        width: 100% !important;
        padding: 5px 5px !important;
    }

    .details-row .text-muted.small {
        color: #999 !important;
        border-bottom: 1px solid #222;
        padding-bottom: 4px;
        margin-bottom: 8px;
        display: block;
        text-transform: uppercase;
    }

    .details-row .btn {
        width: 100% !important;
        margin-top: 5px;
        padding: 12px !important;
        border-radius: 10px !important;
    }
}

.offcanvas {
    z-index: 1055 !important;
}


.offcanvas-backdrop {
    z-index: 1050 !important;
}

.card, .main-content, header {
    z-index: 1 !important;
}

    .chart-card {
        display: flex;
        flex-direction: column;
        height: 100%;
    }


    .chart-container {
        position: relative;
        flex-grow: 1;
        min-height: 250px; 
        width: 100%;
    }

