html {
    font-size: 14px;
}

@media (min-width: 768px) {
    html {
        font-size: 16px;
    }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
    position: relative;
    min-height: 100%;
}

body {
    margin-bottom: 60px;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}

/* Dark base */
body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* Sidebar */
.sidebar {
    width: 250px;
}

.sidebar-link {
    border-radius: .65rem;
    padding: 0.6rem 0.9rem;
    font-size: 0.93rem;
    font-weight: 500;
    letter-spacing: .01em;
    margin: 0.12rem 0.55rem;
    border: 1px solid transparent;
    transition: background-color .2s ease, border-color .2s ease, transform .2s ease;
}

    .sidebar-link:hover {
        background-color: rgba(255, 255, 255, 0.07);
        border-color: rgba(255, 255, 255, 0.12);
        transform: translateX(2px);
    }

.sidebar .nav-link.active,
.offcanvas .nav-link.active {
    background: linear-gradient(90deg, rgba(13, 110, 253, 0.9), rgba(58, 134, 255, 0.82));
    border-color: rgba(147, 197, 253, 0.55);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}
.card {
    background: #020024;
    background: linear-gradient(90deg, rgba(2, 0, 36, 0) 0%, rgba(0, 3, 48, 1) 50%, rgba(0, 0, 0, 1) 100%);
    border: 1px solid rgba(0, 197, 253, 0.28);
    box-shadow: inset 0 1px 0 rgba(191, 219, 254, 0.12);
}


/* Prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
    .card.card-hover {
        transition: none;
    }

        .card.card-hover:hover {
            transform: none;
            filter: none;
        }
}

.navbar .app-navbar-brand {
    display: inline-flex;
    align-items: center;
    padding-top: 0;
    padding-bottom: 0;
    line-height: 1;
}

.navbar .app-navbar-logo {
    width: auto;
    height: auto;
    max-height: 2rem;
    max-width: min(170px, 36vw);
    object-fit: contain;
}

.offcanvas-title .app-navbar-logo {
    width: auto;
    height: auto;
    max-height: 1.75rem;
    max-width: 160px;
    object-fit: contain;
}

/* Main area: subtle visual differentiation */
.main-area-shell .navbar {
    background: linear-gradient(90deg, #051d31, #0b2f4a 55%, #15466a) !important;
}

.main-area-shell .sidebar {
    background: linear-gradient(180deg, rgba(122, 162, 247, 0.1), rgba(122, 162, 247, 0.03)) !important;
}

.main-area-shell footer {
    border-top-color: rgba(122, 162, 247, 0.35) !important;
}

/* Admin area: blue-toned visual differentiation */
.admin-area-shell .navbar {
    background: linear-gradient(90deg, #0a2142, #12386c 55%, #1f4f8a) !important;
}

.admin-area-shell .admin-sidebar {
    background: linear-gradient(180deg, rgba(83, 156, 255, 0.1), rgba(83, 156, 255, 0.03)) !important;
}

.admin-area-shell footer {
    border-top-color: rgba(83, 156, 255, 0.35) !important;
}

/* Billing area: subtle visual differentiation */
.billing-area-shell .navbar {
    background: linear-gradient(90deg, #012a3a, #013a63 55%, #01497c) !important;
}

.billing-area-shell .billing-sidebar {
    background: linear-gradient(180deg, rgba(13, 202, 240, 0.08), rgba(13, 202, 240, 0.02)) !important;
}

.billing-area-shell footer {
    border-top-color: rgba(13, 202, 240, 0.35) !important;
}


.main-area-shell #main-container,
.admin-area-shell #main-container,
.billing-area-shell #main-container {
    padding: 1.25rem;
    min-height: calc(100vh - 120px);
    background: #020024;
    background: linear-gradient(90deg, rgba(2, 0, 36, 0) 0%, rgba(0, 3, 48, 1) 50%, rgba(0, 0, 0, 1) 100%);
}

.main-area-shell #main-container > .container-fluid,
.admin-area-shell #main-container > .container-fluid,
.billing-area-shell #main-container > .container-fluid {
    padding: 0.10rem;
}

@media (min-width: 992px) {
    .main-area-shell #main-container > .container-fluid,
    .admin-area-shell #main-container > .container-fluid,
    .billing-area-shell #main-container > .container-fluid {
        padding: 0.10rem;
    }
}

.main-area-shell #main-container h1,
.admin-area-shell #main-container h1,
.billing-area-shell #main-container h1 {
    padding-inline: 0.5rem;
    font-size: var(--bs-h3-font-size);
    line-height: var(--bs-body-line-height);
}

.main-area-shell #main-container h1,
.admin-area-shell #main-container h1,
.billing-area-shell #main-container h1,
.main-area-shell #main-container .h1 {
    font-size: 1.75rem;
    font-weight: 650;
    margin-bottom: 1rem;
}

.main-area-shell #main-container h2,
.admin-area-shell #main-container h2,
.billing-area-shell #main-container h2,
.main-area-shell #main-container .h2 {
    font-size: 1.4rem;
    font-weight: 600;
}

.main-area-shell #main-container h3,
.admin-area-shell #main-container h3,
.billing-area-shell #main-container h3,
.main-area-shell #main-container .h3 {
    font-size: 1.2rem;
    font-weight: 600;
}

@media (min-width: 992px) {
     .main-area-shell #main-container,
    .admin-area-shell #main-container,
    .billing-area-shell #main-container {
        padding: 1.5rem 1.75rem;
    }
}

/* Auth card */
.auth-card {
    max-width: 420px;
    width: 100%;
}

/* Small screen tweaks */
@media (max-width: 991.98px) {
    .sidebar {
        width: 100%;
    }
}

.dashboard-loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.82);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1050;
}

#dashboard-root {
    opacity: 0;
    transition: opacity 0.3s ease;
}

    #dashboard-root.dashboard-visible {
        opacity: 1;
    }

#dashboard-sticky-header {
    transition: opacity 0.3s ease, transform 0.3s ease;
}




@media (max-width: 576px) {
    .card .h2, .card .h3, .card .h5 {
        font-size: 1.4rem !important;
    }

    .card {
        padding: 0.4rem !important;
    }

    .card-body {
        padding: 0.1rem !important;
    }

    .card-title {
        font-size: 0.7rem !important;
    }
}
/* Services cards: make footer buttons wrap nicely on mobile */
/* Prevent charts inside collapses from breaking responsive width */
.js-traffic-chart {
    display: block;
    width: 100% !important;
}

.service-traffic-host {
    overflow-x: hidden;
}


.historical-traffic-section {
    position: relative;
}

    .historical-traffic-section .traffic-period-buttons {
        position: absolute;
        top: 0;
        right: 0;
        z-index: 2;
    }

/* Live traffic ÍßÌÀ period buttons */
.live-traffic-host {
    position: relative;
}
/*.............................................................*/
[data-rt-traffic] .rt-dl {
    color: var(--bs-success);
}
/* download */
[data-rt-traffic] .rt-ul {
    color: var(--bs-info);
}
/* upload */


/* =========================
   Customer Details (Services)
   ========================= */

#customer-details-page .billing-summary-card {
    background: linear-gradient(180deg, rgba(13, 110, 253, 0.12), rgba(33, 37, 41, 1));
}

#customer-details-page .svc-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    flex-wrap: wrap;
}

#customer-details-page .svc-header-left,
#customer-details-page .svc-header-mid,
#customer-details-page .svc-header-right {
    display: flex;
    align-items: center;
    gap: .5rem;
    flex-wrap: wrap;
}

#customer-details-page .svc-header-left {
    min-width: 260px;
}

#customer-details-page .svc-header-right {
    margin-left: auto;
    justify-content: flex-end;
    text-align: right;
}

#customer-details-page .svc-live-readout {
    display: inline-flex;
    align-items: center;
    gap: .6rem;
    white-space: nowrap;
}

#customer-details-page .svc-chip {
    max-width: 240px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#customer-details-page .svc-id {
    font-variant-numeric: tabular-nums;
    opacity: .85;
}

/* Reduce nested card visual noise */
#customer-details-page .svc-card {
    border-radius: .5rem;
}

    #customer-details-page .svc-card .card-header {
        padding-top: .55rem;
        padding-bottom: .55rem;
    }

    #customer-details-page .svc-card .card-body {
        padding-top: .75rem;
        padding-bottom: .75rem;
    }

/* Buttons - keep consistent spacing */
#customer-details-page .svc-actions {
    display: flex;
    gap: .5rem;
    flex-wrap: wrap;
}

    #customer-details-page .svc-actions .btn {
        white-space: nowrap;
    }

/* Customer profile formatting */
#customer-details-page .profile-kv {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: .25rem .75rem;
}

    #customer-details-page .profile-kv .k {
        color: rgba(255,255,255,.55);
        font-size: .85rem;
    }

    #customer-details-page .profile-kv .v {
        font-weight: 600;
    }

#customer-details-page .geo-badge {
    font-variant-numeric: tabular-nums;
}

/* Mobile refinements */
@media (max-width: 576px) {
    #customer-details-page .svc-header-left {
        min-width: auto;
    }

    #customer-details-page .svc-header-right {
        width: 100%;
        justify-content: space-between;
    }
}

#customer-details-page iframe {
    display: block;
    background: #111;
}


/* Edit Customer modal - correct scroll with <form> wrapper */
#editCustomerModal .modal-dialog {
    height: calc(100vh - 2rem);
    margin: 1rem auto;
}

#editCustomerModal .modal-content {
    height: 100%;
    max-height: 100%;
}

    /* FORM is the real flex container */
    #editCustomerModal .modal-content > form {
        display: flex;
        flex-direction: column;
        height: 100%;
    }

/* Body scrolls */
#editCustomerModal .modal-body {
    flex: 1 1 auto;
    min-height: 0; /* critical */
    overflow-y: auto;
}


/* Scroll container */
.table tr.row-online > td {
    background-color: rgba(var(--bs-success-rgb), .40);
}

.table tr.row-active-offline > td {
    background-color: rgba(var(--bs-info-rgb), .02);
}

.table tr.row-all-suspended > td {
    background-color: rgba(var(--bs-warning-rgb), .03);
}

.table tr.row-offline > td {
    background-color: rgba(var(--bs-secondary-rgb), .08);
}

.table tr.row-noservices > td {
    background-color: rgba(var(--bs-secondary-rgb), .05);
}

.table tr.row-terminated > td {
    opacity: .65;
}

/* Works well with .table-dark */

.area-switch-accordion {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.area-switch-toggle {
    width: 100%;
    text-align: left;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    color: #d6dbe3;
    border-radius: 0.65rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
    font-weight: 600;
}

.area-switch-toggle.expanded,
.area-switch-toggle[aria-expanded="true"] {
    background: rgba(13, 110, 253, 0.25);
    border-color: rgba(147, 197, 253, 0.55);
}

.area-switch-toggle.disabled {
    opacity: 0.45;
}

.dashboard-soft-tiles .card,
.dashboard-soft-tiles .card.bg-dark {
    opacity: 0.98;
    background: linear-gradient(145deg, rgba(31, 58, 92, 0.34) 0%, rgba(16, 28, 45, 0.78) 52%, rgba(13, 22, 36, 0.88) 100%) !important;
    border-color: rgba(147, 197, 253, 0.28);
    box-shadow: inset 0 1px 0 rgba(191, 219, 254, 0.12);
    backdrop-filter: blur(2px);
}

.dashboard-soft-tiles .card-header,
.dashboard-soft-tiles .card-body {
    background: linear-gradient(160deg, rgba(64, 104, 156, 0.18), rgba(18, 27, 42, 0.52) 45%, rgba(14, 24, 38, 0.65)) !important;
}

.dashboard-soft-tiles canvas {
    opacity: 0.92;
}


.dashboard-live-badge {
    font-size: 0.68rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    border: 1px solid rgba(25, 135, 84, 0.45);
}

.page-title {
    position: relative;
    margin: 0 0 1rem;
    color: #f8f9fa;
    font-weight: 700;
    letter-spacing: .01em;
}

.title-underline {
    display: block;
    height: 1px;
    width: min(320px, 70vw);
    margin-top: .55rem;
    border-radius: 999px;
    position: relative;
    overflow: hidden;
    /* базова линия */
    background: rgba(255,255,255,.14);
}

    .title-underline::before {
        content: "";
        position: absolute;
        inset: 0;
        background: linear-gradient( 120deg, transparent 0%, rgba(255,255,255,.25) 35%, rgba(255,255,255,.95) 50%, rgba(255,255,255,.25) 65%, transparent 100% );
        background-size: 220% 100%;
        animation: title-sweep 2.6s linear infinite;
        /* ultra финес */
        filter: blur(.2px);
        opacity: .9;
    }

@keyframes title-sweep {
    0% {
        background-position: 100% 0%;
    }

    100% {
        background-position: -50% 0%;
    }
}

/* optional: уважаваме users with reduced motion */
@media (prefers-reduced-motion: reduce) {
    .title-underline::before {
        animation: none;
    }
}