:root
{
    --bg: #080b12;
    --sidebar: #0d111a;
    --panel: #111722;
    --panel-hover: #151c29;
    --border: #202938;

    --text: #f5f7fb;
    --muted: #8d98aa;

    --accent: #8b5cf6;
    --accent2: #6366f1;

    --success: #22c55e;

    --mobile-header: 64px;
}


*
{
    box-sizing: border-box;
}


html
{
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}


body
{
    margin: 0;

    background:
        radial-gradient(
            circle at top right,
            rgba(99,102,241,.15),
            transparent 35%
        ),
        var(--bg);

    color: var(--text);

    font-family:
        Inter,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;

    overflow-x: hidden;
}


body.menu-open
{
    overflow: hidden;
}


button,
input,
select,
textarea
{
    font: inherit;
}


button,
a
{
    -webkit-tap-highlight-color: transparent;
}


/* =========================================
   APP
   ========================================= */

.app
{
    display: flex;

    min-height: 100vh;
}


/* =========================================
   SIDEBAR
   ========================================= */

.sidebar
{
    width: 260px;

    position: fixed;

    top: 0;
    bottom: 0;
    left: 0;

    z-index: 1000;

    background:
        rgba(13,17,26,.97);

    border-right:
        1px solid var(--border);

    padding: 24px 16px;

    display: flex;

    flex-direction: column;

    overflow-y: auto;

    scrollbar-width: thin;
}


.sidebar-mobile-top
{
    position: relative;
}


.brand
{
    display: flex;

    align-items: center;

    gap: 12px;

    padding: 8px 10px 30px;
}


.brand-logo,
.login-logo,
.mobile-brand-logo
{
    width: 44px;
    height: 44px;

    flex-shrink: 0;

    display: flex;

    align-items: center;
    justify-content: center;

    border-radius: 13px;

    background:
        linear-gradient(
            135deg,
            var(--accent),
            var(--accent2)
        );

    font-weight: 900;

    font-size: 22px;

    box-shadow:
        0 10px 30px
        rgba(99,102,241,.3);
}


.brand-title
{
    font-size: 20px;

    font-weight: 800;
}


.brand small
{
    color: var(--muted);
}


.menu
{
    display: flex;

    flex-direction: column;

    gap: 5px;
}


.menu-item
{
    display: flex;

    align-items: center;

    gap: 12px;

    min-height: 46px;

    padding: 11px 14px;

    border-radius: 10px;

    color: #aeb7c7;

    text-decoration: none;

    transition:
        background .2s,
        color .2s,
        transform .15s;
}


.menu-icon
{
    width: 24px;

    flex-shrink: 0;

    text-align: center;

    font-size: 18px;
}


.menu-item:hover
{
    color: white;

    background:
        var(--panel-hover);
}


.menu-item:active
{
    transform: scale(.98);
}


.sidebar-bottom
{
    margin-top: auto;

    padding-top: 20px;
}


.logout-button
{
    width: 100%;

    min-height: 46px;

    display: flex;

    align-items: center;

    gap: 12px;

    border: 0;

    background: transparent;

    color: #aeb7c7;

    text-align: left;

    padding: 11px 14px;

    border-radius: 10px;

    cursor: pointer;

    transition: .2s;
}


.logout-button:hover
{
    background: var(--panel-hover);

    color: white;
}


/* =========================================
   CONTENT
   ========================================= */

.content
{
    margin-left: 260px;

    width: calc(100% - 260px);

    min-width: 0;

    padding: 40px;
}


/* =========================================
   PAGE HEADER
   ========================================= */

.page-header
{
    display: flex;

    align-items: center;

    justify-content: space-between;

    gap: 20px;

    margin-bottom: 32px;
}


.page-header h1
{
    font-size: 36px;

    font-weight: 800;

    margin-bottom: 5px;
}


.page-header p
{
    color: var(--muted);

    margin: 0;
}


/* =========================================
   STATUS
   ========================================= */

.server-status
{
    padding: 10px 15px;

    border:
        1px solid
        rgba(34,197,94,.2);

    background:
        rgba(34,197,94,.08);

    border-radius: 10px;

    color: #86efac;

    white-space: nowrap;
}


.status-dot
{
    width: 8px;
    height: 8px;

    display: inline-block;

    background: var(--success);

    border-radius: 50%;

    margin-right: 7px;
}


/* =========================================
   STAT CARDS
   ========================================= */

.stat-card
{
    background: var(--panel);

    border:
        1px solid var(--border);

    border-radius: 16px;

    padding: 22px;

    display: flex;

    gap: 16px;

    align-items: center;

    transition: .2s;

    min-width: 0;
}


.stat-card:hover
{
    transform: translateY(-2px);

    background: var(--panel-hover);
}


.stat-icon
{
    width: 48px;
    height: 48px;

    flex-shrink: 0;

    display: flex;

    align-items: center;
    justify-content: center;

    border-radius: 12px;

    background:
        rgba(139,92,246,.15);

    color:
        #c4b5fd;

    font-weight: 800;
}


.stat-title
{
    color: var(--muted);

    font-size: 14px;
}


.stat-value
{
    font-size: 28px;

    font-weight: 800;

    overflow-wrap: anywhere;
}


/* =========================================
   PANELS
   ========================================= */

.panel
{
    background: var(--panel);

    border:
        1px solid var(--border);

    border-radius: 16px;

    padding: 22px;

    min-width: 0;
}


.panel-header
{
    display: flex;

    align-items: center;

    justify-content: space-between;

    gap: 12px;

    margin-bottom: 18px;
}


.panel-header h3
{
    margin: 0;

    font-size: 18px;
}


.panel-header a
{
    color: #a78bfa;

    text-decoration: none;
}


/* =========================================
   SERVICE
   ========================================= */

.service-row
{
    display: flex;

    justify-content: space-between;

    align-items: center;

    gap: 15px;

    padding: 15px 0;

    border-bottom:
        1px solid var(--border);
}


.service-row:last-child
{
    border-bottom: 0;
}


.badge-online
{
    color: #86efac;

    background:
        rgba(34,197,94,.1);

    padding: 5px 9px;

    border-radius: 7px;

    font-size: 12px;

    font-weight: 700;

    white-space: nowrap;
}


.service-actions
{
    display: flex;

    gap: 10px;

    flex-wrap: wrap;
}


/* =========================================
   QUICK BUTTON
   ========================================= */

.quick-button
{
    display: block;

    padding: 14px;

    margin-bottom: 10px;

    border-radius: 10px;

    background: #161d2a;

    color: #dce2ec;

    text-decoration: none;

    transition: .2s;
}


.quick-button:hover
{
    background: #1c2534;

    color: white;
}


/* =========================================
   LOGIN
   ========================================= */

.login-page
{
    min-height: 100vh;

    display: flex;

    justify-content: center;

    align-items: center;

    padding: 20px;
}


.login-card
{
    width: 100%;

    max-width: 430px;

    padding: 40px;

    background: var(--panel);

    border:
        1px solid var(--border);

    border-radius: 20px;

    box-shadow:
        0 30px 80px
        rgba(0,0,0,.35);
}


.login-logo
{
    margin: 0 auto 20px;
}


.login-card h2
{
    text-align: center;

    font-weight: 800;
}


.login-card > p
{
    text-align: center;

    color: var(--muted);

    margin-bottom: 30px;
}


.login-card label
{
    display: block;

    margin-bottom: 7px;

    color: #b9c2d0;
}


.login-card .form-control
{
    background: #0b0f17;

    border:
        1px solid var(--border);

    color: white;

    padding: 12px;
}


.login-card .form-control:focus
{
    border-color:
        var(--accent);

    box-shadow:
        0 0 0 3px
        rgba(139,92,246,.15);
}


.btn-login
{
    width: 100%;

    border: 0;

    border-radius: 10px;

    padding: 13px;

    color: white;

    font-weight: 700;

    background:
        linear-gradient(
            135deg,
            var(--accent),
            var(--accent2)
        );
}


/* =========================================
   MOBILE HEADER
   ========================================= */

.mobile-header
{
    display: none;
}


.mobile-menu-button
{
    width: 44px;
    height: 44px;

    border: 1px solid var(--border);

    border-radius: 11px;

    background: var(--panel);

    color: white;

    font-size: 22px;

    cursor: pointer;
}


.mobile-brand
{
    display: flex;

    align-items: center;

    gap: 10px;
}


.mobile-brand-logo
{
    width: 38px;
    height: 38px;

    border-radius: 10px;

    font-size: 18px;
}


.mobile-brand-title
{
    font-size: 17px;

    font-weight: 800;

    line-height: 18px;
}


.mobile-brand-subtitle
{
    color: var(--muted);

    font-size: 11px;
}


/* =========================================
   MOBILE OVERLAY
   ========================================= */

.sidebar-overlay
{
    display: none;

    position: fixed;

    inset: 0;

    z-index: 999;

    background: rgba(0,0,0,.65);

    backdrop-filter: blur(3px);

    opacity: 0;

    transition: opacity .25s;
}


.overlay-visible
{
    display: block;

    opacity: 1;
}


.sidebar-close
{
    display: none;
}


/* =========================================
   TABLETS
   ========================================= */

@media (max-width: 991.98px)
{
    .mobile-header
    {
        position: fixed;

        top: 0;
        left: 0;
        right: 0;

        height: var(--mobile-header);

        z-index: 900;

        display: flex;

        align-items: center;

        gap: 12px;

        padding:
            8px 14px;

        background:
            rgba(8,11,18,.94);

        border-bottom:
            1px solid var(--border);

        backdrop-filter: blur(16px);
    }


    .sidebar
    {
        width: min(300px, 86vw);

        transform: translateX(-105%);

        transition:
            transform .25s ease;

        box-shadow:
            20px 0 60px rgba(0,0,0,.35);
    }


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


    .sidebar-close
    {
        display: flex;

        position: absolute;

        top: 8px;
        right: 8px;

        width: 40px;
        height: 40px;

        align-items: center;
        justify-content: center;

        border: 0;

        border-radius: 10px;

        background: var(--panel);

        color: #fff;

        font-size: 26px;

        cursor: pointer;
    }


    .content
    {
        margin-left: 0;

        width: 100%;

        padding:
            calc(var(--mobile-header) + 24px)
            24px
            30px;
    }


    .page-header
    {
        margin-bottom: 24px;
    }
}


/* =========================================
   PHONES
   ========================================= */

@media (max-width: 767.98px)
{
    .mobile-header
    {
        padding-left: 12px;
        padding-right: 12px;
    }


    .content
    {
        padding:
            calc(var(--mobile-header) + 18px)
            12px
            24px;
    }


    .page-header
    {
        display: block;

        margin-bottom: 20px;
    }


    .page-header h1
    {
        font-size: 26px;

        line-height: 1.2;
    }


    .page-header p
    {
        font-size: 13px;

        line-height: 1.5;
    }


    .server-status
    {
        display: inline-block;

        margin-top: 12px;

        padding: 8px 11px;

        font-size: 12px;
    }


    .stat-card
    {
        padding: 16px;

        border-radius: 13px;
    }


    .stat-icon
    {
        width: 42px;
        height: 42px;

        border-radius: 10px;
    }


    .stat-value
    {
        font-size: 24px;
    }


    .stat-title
    {
        font-size: 13px;
    }


    .panel
    {
        padding: 15px;

        border-radius: 13px;
    }


    .panel-header
    {
        align-items: flex-start;

        flex-direction: column;

        gap: 8px;
    }


    .panel-header h3
    {
        font-size: 17px;
    }


    .service-row
    {
        align-items: flex-start;

        flex-direction: column;

        gap: 8px;

        padding: 13px 0;
    }


    .service-actions
    {
        display: grid;

        grid-template-columns: 1fr;

        width: 100%;

        gap: 8px;
    }


    .service-actions .btn
    {
        width: 100%;
    }


    .quick-button
    {
        min-height: 48px;

        display: flex;

        align-items: center;
    }


    /* Bootstrap rows */

    .row
    {
        --bs-gutter-x: 0.75rem;
    }


    /* Tables */

    .table-responsive
    {
        width: 100%;

        overflow-x: auto;

        -webkit-overflow-scrolling: touch;

        border-radius: 10px;
    }


    .table
    {
        min-width: 620px;

        font-size: 13px;
    }


    /* Forms */

    .form-control,
    .form-select
    {
        min-height: 44px;

        font-size: 16px;
    }


    textarea.form-control
    {
        min-height: 100px;
    }


    .btn
    {
        min-height: 44px;
    }


    /* Login */

    .login-page
    {
        padding: 14px;
    }


    .login-card
    {
        padding: 26px 18px;

        border-radius: 16px;
    }


    .login-card > p
    {
        margin-bottom: 22px;
    }
}


/* =========================================
   SMALL PHONES
   ========================================= */

@media (max-width: 400px)
{
    .content
    {
        padding-left: 10px;
        padding-right: 10px;
    }


    .mobile-header
    {
        padding-left: 10px;
        padding-right: 10px;
    }


    .mobile-brand-title
    {
        font-size: 16px;
    }


    .page-header h1
    {
        font-size: 23px;
    }


    .stat-card
    {
        padding: 13px;
    }


    .stat-value
    {
        font-size: 22px;
    }


    .panel
    {
        padding: 13px;
    }


    .login-card
    {
        padding: 22px 15px;
    }
}


/* =========================================
   TOUCH DEVICES
   ========================================= */

@media (hover: none) and (pointer: coarse)
{
    .menu-item
    {
        min-height: 48px;
    }


    .logout-button
    {
        min-height: 48px;
    }


    .btn
    {
        min-height: 44px;
    }


    .quick-button
    {
        min-height: 48px;
    }
}