/* =========================================================
   aMuleWeb Modern Skin
   Mobile First Base
   ========================================================= */


/* =========================================================
   VARIABLES DE TEMA
   ========================================================= */

:root {

    --bg-main: #0f172a;
    --bg-panel: #1e293b;
    --bg-panel-hover: #334155;

    --border-color: #334155;

    --text-main: #e5e7eb;
    --text-muted: #94a3b8;
    --text-soft: #64748b;

    --accent: #6366f1;
    --accent-hover: #818cf8;

    --danger: #ef4444;
    --success: #22c55e;

    --radius: 10px;
    --radius-small: 6px;

    --sidebar-width: 240px;

    --shadow:
        0 4px 12px rgba(0, 0, 0, .25);

}


/* =========================================================
   RESET GENERAL
   ========================================================= */

* {
    box-sizing: border-box;
}


html,
body {

    height: 100%;
    width: 100%;

    margin: 0;
    padding: 0;

    overflow: hidden;

    background: var(--bg-main);
    color: var(--text-main);

    font-family:
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;

    font-size: 16px;

}


/* =========================================================
   LAYOUT PRINCIPAL
   ========================================================= */

.layout {

    display: flex;

    width: 100%;
    height: 100vh;

}


/*
   MOBILE FIRST

   En móvil no existe sidebar lateral.
   El contenido ocupa toda la pantalla.
*/

.content-area {

    flex: 1;

    display: flex;
    flex-direction: column;

    min-width: 0;

    margin-left: 0;

}


/* =========================================================
   SIDEBAR DESKTOP
   ========================================================= */

/*
   Compatibilidad temporal con el menú actual.

   Más adelante será sustituido por navigation.php
*/

.sidebar {
    display: none;
}


/* =========================================================
   MAIN
   ========================================================= */

.main {

    flex: 1;

    display: flex;
    flex-direction: column;

    min-height: 0;
    padding: 15px;
    overflow: hidden;
}


.bottom-nav {
    display: none;
}


/* =========================================================
   HEADER / TITULOS
   ========================================================= */

h1 {
    margin: 0 0 15px 0;
    font-size: 1.6rem;
    font-weight: 600;
}

@media (max-width:768px) {
    h1 {
        display: none;
    }
}

/* =========================================================
   ENLACES GENERALES
   ========================================================= */

a {
    color: inherit;
}


/* =========================================================
   PANELES GENERALES
   ========================================================= */

.panel {

    background: var(--bg-panel);

    border-radius: var(--radius);

    box-shadow: var(--shadow);

}


/* =========================================================
   SEARCH BOX
   ========================================================= */


.search-box {

    background: var(--bg-panel);

    padding: 15px;

    border-radius: var(--radius);

    flex: 1;

    display: flex;
    flex-direction: column;

    overflow: hidden;

}



/* =========================================================
   FILA DE BUSQUEDA
   ========================================================= */

.search-row {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 10px;
}

.search-wrapper {
    position: relative;
    width: 100%;
}

.search-input {
    width: 100%;
    padding: 12px 72px 12px 12px;
    border: none;
    border-radius: var(--radius-small);
    background: #ffffff;
    color: #111827;
    font-size: 1rem;
}

.search-input:focus {
    outline: 2px solid var(--accent);
}

/* boton limpiar */
.clear-btn {
    position: absolute;
    right: 42px;
    top: 50%;
    transform: translateY(-50%);
    color: #666;
    cursor: pointer;
    display: none;
}

.clear-btn:hover {
    color: #000;
}

.refresh-btn {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #000;
    cursor: pointer;
}

/* select */
.search-row select {
    width: 100%;
    padding: 10px;
    border-radius: var(--radius-small);
    border: none;
}

@media(max-width:768px) {
    .search-row {
        align-items: center;
    }

    .search-row select {
        display: none;
    }

    .search-row .btn {
        display: none;
    }

    .search-wrapper {
        position: relative;
        flex: 1;
    }

    .search-input {
        width: 100%;
        box-sizing: border-box;
    }
}


/* =========================================================
   FILTROS
   ========================================================= */


.filters {

    display: flex;

    flex-wrap: wrap;

    gap: 10px;

    margin-bottom: 10px;

}



.filters input,
.filters select {

    padding: 8px;

    border-radius:

        var(--radius-small);

    border: none;

}



/* =========================================================
   BOTONES
   ========================================================= */


.btn {

    width: 100%;


    background:

        var(--accent);


    border: none;


    padding:

        12px 16px;


    border-radius:

        var(--radius-small);


    color: white;


    cursor: pointer;


    font-size: 1rem;


    transition:

        background .2s ease;

}



.btn:hover {

    background:

        var(--accent-hover);

}



.btn.secondary {

    background:

        #334155;

}



.btn.secondary:hover {

    background:

        #475569;

}



/* =========================================================
   ACCIONES
   ========================================================= */

.actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

#floatingActions {
    display: none;
}

@media(max-width:768px) {

    #desktopActions {
        display: none;
    }

    #floatingActions {
        position: fixed;
        left: 16px;
        right: 16px;
        bottom: 80px;
        display: flex;
        justify-content: center;
        opacity: 0;
        transform: translateY(20px);
        pointer-events: none;
        transition: .25s;
    }

    #floatingActions.visible {
        opacity: 1;
        transform: none;
        pointer-events: auto;
    }

    .floating-btn {
        width: 100%;
        max-width: 320px;
        border-radius: 24px;
        box-shadow: 0 8px 25px rgba(0, 0, 0, .35);
    }
}


/* =========================================================
   RESULTADOS
   ========================================================= */


.results {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #64748b transparent;
}

@media(min-width:768px) {

    .results {
        margin-top: 15px;
    }

}

.results::-webkit-scrollbar {
    width: 8px;
}

.results::-webkit-scrollbar-track {
    background: transparent;
}

.results::-webkit-scrollbar-thumb {
    background: #64748b;
    border-radius: 10px;
}


/* =========================================================
   CABECERA RESULTADOS
   ========================================================= */

.results-header {
    display: none;
}


/* =========================================================
   CARD RESULTADO
   ========================================================= */

.card {
    padding: 12px;
    margin-bottom: 5px;
    border-radius: var(--radius);
    cursor: pointer;
    transition:
        background .2s ease,
        transform .1s ease;
}

.card:hover {
    background: var(--bg-panel-hover);
}

.card:active {
    transform: scale(.98);
}

.card-check {
    display: none;
    top: 15px;
    left: 15px;
}

.card-main {
    width: 100%;
    padding-top: 2px;
}

.card-size,
.card-sources {
    color: var(--text-muted);
    font-size: .9rem;
    padding-top: 2px;
}

.card-sources i {
    margin-right: 5px;
    color: var(--accent);
}

.file-name {
    font-weight: 600;
    line-height: 1.3;
    word-break: break-word;
}

@media (min-width: 768px) {

    .card-check {
        position: static;
        display: block;
    }

    .card-main {
        padding-top: 0;
    }

    .card-size,
    .card-sources {
        padding-top: 0;
    }
}

/* selección */
.card.selected {
    border: 1px solid var(--accent);
    background: rgba(99, 102, 241, .15);
}


/* =========================================================
   NAVEGACION ESCRITORIO
   ========================================================= */


/*
   A partir de 768px volvemos al layout clásico:
   sidebar fijo + contenido desplazado
*/


@media (min-width: 768px) {


    .sidebar {
        display: flex;
        flex-direction: column;
        width:
            var(--sidebar-width);
        height: 100vh;
        background:
            var(--bg-panel);
        color:
            var(--text-main);

        position: fixed;
        left: 0;
        top: 0;

        border-right:
            1px solid var(--border-color);

        z-index: 100;
    }

    .content-area {
        margin-left: var(--sidebar-width);
    }

    .main {
        padding: 20px;
    }

    .bottom-nav {
        display: none;
    }


    /*
       Menu lateral
    */
    .sidebar-header {
        padding: 16px;
        font-size: 1.4rem;
        font-weight: bold;
        border-bottom: 1px solid var(--border-color);
    }

    .sidebar-menu {
        display: flex;
        flex-direction: column;
        padding: 10px 0;
        flex: 1;
    }

    .sidebar-menu a {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 12px 16px;
        color: var(--text-muted);
        text-decoration: none;
        border-left: 3px solid transparent;
        transition: all .2s ease;
    }

    .sidebar-menu a:hover {
        background: var(--bg-panel-hover);
        color: white;
    }

    .sidebar-menu a.active {
        background: rgba(99, 102, 241, .15);
        color: white;
        border-left-color: var(--accent);
    }

    .sidebar-footer {
        padding: 12px 16px;
        color: var(--text-soft);
        font-size: .85rem;
        border-top: 1px solid var(--border-color);
    }


    /*
       Resultados en escritorio
    */

    @media (min-width: 768px) {

        .results-header {
            display: grid;
            grid-template-columns: 40px 1fr 120px 100px;
            align-items: center;
            background: var(--bg-main);
            padding: 12px;
            border-radius: var(--radius);
            border-bottom: 1px solid var(--border-color);
            font-weight: bold;
        }

        .results-header a {
            color: var(--text-muted);
            text-decoration: none;

            transition:
                color .2s ease;
        }

        .results-header a:hover {
            color: var(--text-main);
        }

    }

    .card {
        display: grid;
        grid-template-columns: 40px 1fr 120px 100px;
        align-items: center;
    }

    .card-size,
    .card-sources {
        display: block;
    }

    .search-row {
        flex-direction: row;
        align-items: center;
    }

    .search-wrapper {
        flex: 1;
    }

    .search-row select {
        width: auto;
    }

    .btn {
        width: auto;
    }

    .actions {
        flex-direction: row;
    }
}


/* =========================================================
   FOOTER
   ========================================================= */
.footer {
    flex-shrink: 0;
    min-height: 45px;
    padding: 15px;
    margin: 20px 20px 0 20px;
    background: var(--bg-panel);
    border-radius: var(--radius);
    display: flex;
    flex-direction: column;
    gap: 10px;
    color: var(--text-muted);
}



/* =========================================================
   NAVEGACION INFERIOR MOVIL
   ========================================================= */

@media (max-width: 768px) {

    .main h1 {
        display: none;
    }

    .sidebar {
        display: none;
    }

    .bottom-nav {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: 64px;
        background: var(--bg-panel);
        border-top: 1px solid var(--border-color);
        justify-content: space-around;
        align-items: center;
        z-index: 200;
    }

    .bottom-nav a {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 4px;
        color: var(--text-muted);
        text-decoration: none;
        font-size: .75rem;
    }

    .bottom-nav a i {
        font-size: 1.25rem;
    }

    .bottom-nav a.active {
        color: white;
    }


    /*
       Dejamos espacio para el menú inferior
    */

    .main {
        padding-bottom: 75px;
    }

    .footer {
        display: none;
    }
}

/* =========================================================
   FIN CSS MOBILE-FIRST
   ========================================================= */

/* =========================================================
   MOBILE SORT
========================================================= */

.mobile-sort {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 8px;
}

.sort-pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;

    padding: 7px 12px;

    border: 1px solid var(--border-color);
    border-radius: 20px;

    background: var(--bg-panel);
    color: var(--text-muted);

    font-size: .82rem;
    cursor: pointer;

    transition:
        background .2s ease,
        color .2s ease,
        border-color .2s ease;
}

.sort-pill:hover {
    background: var(--bg-panel-hover);
    color: var(--text-main);
}

.sort-pill i {
    color: var(--accent);
}


/* =========================================================
   SORT BOTTOM SHEET
========================================================= */

.sort-sheet-backdrop {
    display: none;

    position: fixed;
    inset: 0;

    background: rgba(0, 0, 0, .45);

    z-index: 400;

    opacity: 0;
    transition: opacity .2s ease;
}

.sort-sheet {
    position: fixed;

    left: 0;
    right: 0;
    bottom: 0;

    background: var(--bg-panel);

    border-radius:
        18px 18px 0 0;

    padding:
        10px 16px 25px;

    z-index: 401;

    transform: translateY(100%);
    transition: transform .25s ease;

    box-shadow:
        0 -8px 30px rgba(0, 0, 0, .35);
}

.sort-sheet-handle {
    width: 40px;
    height: 4px;

    margin:
        0 auto 15px;

    border-radius: 4px;

    background: var(--text-soft);
}

.sort-sheet-header {
    display: flex;

    align-items: center;
    justify-content: space-between;

    margin-bottom: 15px;

    font-size: 1.05rem;
    font-weight: 600;
}

.sort-sheet-header button {
    width: 34px;
    height: 34px;

    border: none;
    border-radius: 50%;

    background: var(--bg-panel-hover);
    color: var(--text-muted);

    cursor: pointer;
}

.sort-options {
    display: flex;
    flex-direction: column;

    gap: 2px;
}

.sort-option {
    display: flex;

    align-items: center;
    justify-content: space-between;

    padding: 14px 10px;

    border-bottom:
        1px solid var(--border-color);

    color: var(--text-main);

    text-decoration: none;

    font-size: .95rem;
}

.sort-option>span {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sort-option>span i {
    width: 20px;

    color: var(--text-muted);
    text-align: center;
}

.sort-check {
    visibility: hidden;
    color: var(--accent);
}

.sort-option.active .sort-check {
    visibility: visible;
}

.sort-direction {
    margin-top: 18px;
}

.sort-direction-title {
    margin-bottom: 8px;

    color: var(--text-muted);

    font-size: .8rem;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.sort-direction-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;

    gap: 8px;
}

.sort-direction-btn {
    display: flex;

    align-items: center;
    justify-content: center;

    gap: 8px;

    padding: 11px;

    border:
        1px solid var(--border-color);

    border-radius:
        var(--radius-small);

    background:
        var(--bg-main);

    color:
        var(--text-muted);

    cursor: pointer;
}

.sort-direction-btn.active {
    background:
        rgba(99, 102, 241, .15);

    border-color:
        var(--accent);

    color:
        white;
}

@media (min-width: 768px) {

    .mobile-sort,
    .sort-sheet,
    .sort-sheet-backdrop {
        display: none;
    }

}


/* =========================================================
   MOBILE DOWNLOADS
   ========================================================= */

.downloads-mobile {
    display: block;
}

.downloads-desktop,
#desktopDownloadActions,
.uploads-desktop {
    display: none;
}

.downloads-mobile-header {
    margin-bottom: 10px;
    color: var(--text-muted);
    font-size: .85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.download-card {
    background: var(--bg-panel);
    border-radius: var(--radius);
    padding: 13px;
    margin-bottom: 8px;

    border: 1px solid transparent;

    transition:
        background .2s ease,
        border-color .2s ease,
        transform .1s ease;
}

.download-card.selected {
    border-color: var(--accent);
    background: rgba(99, 102, 241, .15);
}

.download-card:active {
    transform: scale(.99);
}

.download-card-top {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.download-card-check {
    flex-shrink: 0;
    padding-top: 2px;
    display: none;
}

.download-card-name {
    min-width: 0;

    font-weight: 600;
    line-height: 1.3;

    word-break: break-word;
}

.download-card-progress {
    height: 6px;
    margin-top: 12px;

    background: var(--bg-main);
    border-radius: 10px;

    overflow: hidden;
}

.download-progress-bar {
    height: 100%;

    background: var(--accent);
    border-radius: inherit;
}

.download-card-meta {
    display: flex;
    justify-content: space-between;
    gap: 10px;

    margin-top: 7px;

    color: var(--text-muted);
    font-size: .78rem;
}

.download-card-info {
    display: flex;
    align-items: center;

    gap: 14px;

    margin-top: 9px;

    color: var(--text-muted);
    font-size: .8rem;
}

.download-card-info span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.download-card-info i {
    color: var(--accent);
}

@media (min-width: 768px) {

    .downloads-mobile {
        display: none;
    }

    .downloads-desktop {
        display: block;
    }

    .download-card-check {
        display: block;
    }

}

/* =========================================================
   MOBILE DOWNLOAD ACTIONS
   ========================================================= */

#mobileDownloadActions {
    position: fixed;

    left: 16px;
    right: 16px;
    bottom: 80px;

    z-index: 300;

    background: var(--bg-panel);

    border: 1px solid var(--border-color);
    border-radius: 16px;

    padding: 10px;

    box-shadow:
        0 8px 30px rgba(0, 0, 0, .4);

    opacity: 0;
    transform: translateY(20px);

    pointer-events: none;

    transition:
        opacity .25s ease,
        transform .25s ease;
}

#mobileDownloadActions.visible {
    opacity: 1;
    transform: translateY(0);

    pointer-events: auto;
}

.mobile-download-selection {
    display: flex;
    align-items: center;
    justify-content: center;

    gap: 6px;

    margin-bottom: 8px;

    color: var(--text-muted);

    font-size: .8rem;
}

.mobile-download-selection i {
    color: var(--accent);
}

.mobile-download-action-buttons {
    display: grid;

    grid-template-columns:
        1fr 1fr 1fr;

    gap: 7px;
}

.mobile-download-action {
    display: flex;

    flex-direction: column;
    align-items: center;
    justify-content: center;

    gap: 4px;

    min-height: 52px;

    border: 1px solid var(--border-color);
    border-radius: var(--radius-small);

    background: var(--bg-main);
    color: var(--text-muted);

    cursor: pointer;

    font-size: .75rem;
}

.mobile-download-action i {
    font-size: 1rem;
    color: var(--accent);
}

.mobile-download-action:active {
    transform: scale(.97);
}

.mobile-download-action-danger i {
    color: var(--danger);
}

@media (min-width: 768px) {

    #mobileDownloadActions {
        display: none;
    }

    .downloads-desktop,
    .uploads-desktop {
        flex: 1;
        min-height: 0;
        display: flex;
        flex-direction: column;
        overflow: hidden;
        background: var(--bg-panel);
        padding: 15px;
        border-radius: var(--radius);
    }

    .downloads-title,
    .uploads-title {
        display: flex;
        align-items: center;
        gap: 8px;
        margin-bottom: 15px;
        color: var(--text-main);
        font-size: 1rem;
        font-weight: 600;
    }

    .downloads-title i,
    .uploads-title i {
        color: var(--accent);
    }

    .downloads-header,
    .download-row {
        display: grid;

        grid-template-columns:
            40px minmax(250px, 1fr) 100px 110px 110px 100px 90px 120px;

        align-items: center;
    }

    .uploads-header,
    .upload-row {
        display: grid;

        grid-template-columns:
            minmax(450px, 1fr) minmax(150px, 0.4fr) 110px 110px 100px;

        align-items: center;
    }


    /* =========================
       CABECERA
       ========================= */

    .downloads-header,
    .uploads-header {
        padding: 12px;

        background: var(--bg-main);

        border-radius: var(--radius);
        border-bottom: 1px solid var(--border-color);

        font-weight: bold;
    }

    .downloads-header a {
        color: var(--text-muted);
        text-decoration: none;

        transition:
            color .2s ease;
    }

    .downloads-header a:hover {
        color: var(--text-main);
    }


    /* =========================
       FILAS
       ========================= */

    .download-row,
    .upload-row {
        min-height: 48px;
        padding: 0 12px;
        font-size: .9rem;
        border-radius: var(--radius);

        transition:
            background .2s ease,
            border-color .2s ease;
    }

    .download-row:hover {
        background: var(--bg-panel-hover);
    }

    .download-row.selected {
        background: rgba(99, 102, 241, .15);

        box-shadow:
            inset 2px 0 0 var(--accent);
    }


    /* =========================
       CHECKBOX
       ========================= */

    .download-row-check,
    .download-header-check {
        display: flex;

        justify-content: center;
        align-items: center;
    }


    /* =========================
       NOMBRE
       ========================= */

    .download-row-name,
    .upload-row-name {
        min-width: 0;

        padding: 8px 12px 8px 0;

        font-weight: 600;
        line-height: 1.3;

        overflow-wrap: anywhere;
        word-break: break-word;
    }


    /* =========================
       COLUMNAS DE DATOS
       ========================= */

    .download-row-size,
    .download-row-completed,
    .download-row-speed,
    .download-row-progress,
    .download-row-sources,
    .download-row-status,
    .upload-row-downloaded,
    .upload-row-uploaded,
    .upload-row-speed {
        padding: 8px;
        text-align: center;
        color: var(--text-muted);
    }

    .upload-row-user {
        padding: 8px;
        color: var(--text-muted);
    }

    .download-row-sources i {
        margin-right: 4px;
        color: var(--accent);
    }

    .download-row-progress {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
    }

    .desktop-progress {
        width: 70px;
        height: 6px;

        background: var(--bg-main);
        border-radius: 10px;
        overflow: hidden;
    }

    .desktop-progress-bar {
        height: 100%;
        background: var(--accent);
        border-radius: inherit;
    }

    .download-row-status {
        font-weight: 500;
    }

    .download-row-status::before {
        content: "";
        display: inline-block;
        width: 7px;
        height: 7px;
        margin-right: 6px;
        border-radius: 50%;
        background: var(--text-soft);
    }

    .download-row[data-status="Downloading"] .download-row-status::before {
        background: var(--success);
    }

    .download-row[data-status="Paused"] .download-row-status::before {
        background: var(--accent);
    }


    /* =========================================================
    DESKTOP DOWNLOAD ACTIONS
    ========================================================= */

    #desktopDownloadActions {
        display: flex;
        align-items: center;
        justify-content: space-between;

        min-height: 52px;

        margin-top: 10px;
        margin-bottom: 30px;
        padding: 8px 12px;

        background: var(--bg-main);

        border: 1px solid var(--border-color);
        border-radius: var(--radius-small);

        opacity: 0;
        transform: translateY(-5px);

        pointer-events: none;

        transition:
            opacity .2s ease,
            transform .2s ease;
    }

    #desktopDownloadActions.visible {
        opacity: 1;
        transform: translateY(0);
        pointer-events: auto;
    }

    .desktop-download-selection {
        display: flex;
        align-items: center;

        gap: 7px;

        color: var(--text-muted);
        font-size: .85rem;
    }

    .desktop-download-selection i {
        color: var(--accent);
    }

    .desktop-download-action-buttons {
        display: flex;
        align-items: center;

        gap: 7px;
    }

    .desktop-download-action {
        display: inline-flex;
        align-items: center;
        justify-content: center;

        gap: 7px;

        min-width: 100px;
        padding: 8px 12px;

        border: 1px solid var(--border-color);
        border-radius: var(--radius-small);

        background: var(--bg-panel);
        color: var(--text-muted);
        cursor: pointer;
        font-size: .8rem;

        transition:
            background .2s ease,
            color .2s ease,
            border-color .2s ease;
    }

    .desktop-download-action:hover {
        background: var(--bg-panel-hover);
        color: var(--text-main);
    }

    .desktop-download-action i {
        color: var(--accent);
    }

    .desktop-download-action-danger i {
        color: var(--danger);
    }

    .desktop-download-action-danger:hover {
        border-color: var(--danger);
    }



    /* ------------------------------------------------------------
    Servers actions
    ------------------------------------------------------------ */

    .servers-actions {
        display: flex;
        justify-content: flex-end;
        margin-bottom: 16px;
    }

    .servers-disconnect-form {
        margin: 0;
    }

    .servers-disconnect-btn {
        display: inline-flex;
        align-items: center;
        gap: 8px;
    }

    /* ------------------------------------------------------------
    Desktop servers container
    ------------------------------------------------------------ */

    .servers-desktop {
        flex: 1;
        min-height: 0;
        display: flex;
        flex-direction: column;
        overflow: hidden;
        background: var(--bg-panel);
        padding: 15px;
        border-radius: var(--radius);
    }


    /* ------------------------------------------------------------
    Servers title
    ------------------------------------------------------------ */

    .servers-title {
        display: flex;
        align-items: center;
        gap: 10px;

        margin-bottom: 12px;

        font-size: 1.05rem;
        font-weight: 600;
    }


    /* ------------------------------------------------------------
    Desktop header
    ------------------------------------------------------------ */

    .servers-header,
    .server-row {
        display: grid;

        grid-template-columns:
            80px minmax(160px, 1.2fr) minmax(200px, 2fr) minmax(130px, 1fr) 120px 120px;

        align-items: center;
    }

    .servers-header {
        padding: 12px;

        background: var(--bg-main);

        border-radius: var(--radius);
        border-bottom: 1px solid var(--border-color);

        font-weight: bold;
    }

    .servers-header a {
        color: var(--text-muted);
        text-decoration: none;

        transition:
            color .2s ease;
    }

    .servers-header a:hover {
        color: var(--text-main);
    }

    .server-row {
        min-height: 48px;
        padding: 0 12px;
        font-size: .9rem;
        border-radius: var(--radius);

        transition:
            background .2s ease,
            border-color .2s ease;
    }

    .server-row:hover {
        background: var(--bg-panel-hover);
    }

    .server-row.selected {
        background: rgba(99, 102, 241, .15);

        box-shadow:
            inset 2px 0 0 var(--accent);
    }


    /* ------------------------------------------------------------
    Header cells
    ------------------------------------------------------------ */

    .server-header-actions,
    .server-header-name,
    .server-header-description,
    .server-header-address,
    .server-header-users,
    .server-header-files {
        min-width: 0;
    }


    .server-header-actions {
        text-align: center;
    }


    .server-header-users,
    .server-header-files {
        text-align: left;
    }


    .servers-header a {
        color: inherit;
        text-decoration: none;
    }


    .servers-header a:hover {
        text-decoration: underline;
    }


    /* ------------------------------------------------------------
    Row cells
    ------------------------------------------------------------ */

    .server-row-name,
    .server-row-description,
    .server-row-address {
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .server-row-name {
        font-weight: 500;
    }

    .server-row-description {
        opacity: 0.85;
    }

    .server-row-address {
        font-family: monospace;
        font-size: 0.9rem;
    }

    .server-row-users,
    .server-row-files {
        text-align: left;
    }

    .server-row-users i,
    .server-row-files i {
        color: var(--accent);
    }

    /* ------------------------------------------------------------
    Server actions
    ------------------------------------------------------------ */

    .server-row-actions {
        display: flex;

        align-items: center;
        justify-content: center;

        gap: 8px;
    }


    .server-action {
        display: inline-flex;

        align-items: center;
        justify-content: center;

        width: 32px;
        height: 32px;

        border-radius: 6px;

        text-decoration: none;

        transition:
            background-color 0.15s ease,
            transform 0.15s ease;
    }


    .server-action:hover {
        color: var(--success);
        transform: translateY(-1px);
    }

    .server-action-danger:hover {
        color: var(--danger);
    }


    /* ------------------------------------------------------------
    Mobile placeholder
    ------------------------------------------------------------ */

    .servers-mobile,
    #mobileServerActions {
        display: none;
    }

    .servers-mobile-placeholder {
        display: flex;

        align-items: center;
        justify-content: center;

        gap: 8px;
        padding: 30px 20px;
        opacity: 0.6;
    }

}

@media (max-width: 767px) {

    .servers-desktop {
        display: none;
    }

    .servers-mobile {
        display: block;
    }

    .server-card {
        background: var(--bg-panel);
        border-radius: var(--radius);
        padding: 13px;
        margin-bottom: 8px;

        border: 1px solid transparent;

        transition:
            background .2s ease,
            border-color .2s ease,
            transform .1s ease;

        cursor: pointer;
    }

    .server-card.selected {
        border-color: var(--accent);
        background: rgba(99, 102, 241, .15);
    }

    .server-card:active {
        transform: scale(.99);
    }

    .server-card-top {
        display: flex;
        align-items: flex-start;
        gap: 10px;
    }

    .server-card-name {
        min-width: 0;

        font-weight: 600;
        line-height: 1.3;

        word-break: break-word;
    }

    .server-card-description {
        margin-top: 6px;

        color: var(--text-muted);
        font-size: .82rem;

        line-height: 1.3;

        word-break: break-word;
    }

    .server-card-address {
        margin-top: 9px;

        color: var(--text-muted);
        font-size: .8rem;
    }

    .server-card-info {
        display: flex;
        align-items: center;

        gap: 14px;

        margin-top: 9px;

        color: var(--text-muted);
        font-size: .8rem;
    }

    .server-card-info span {
        display: inline-flex;
        align-items: center;
        gap: 5px;
    }

    .server-card-info i {
        color: var(--accent);
    }
    

    /* ------------------------------------------------------------
    Mobile actions
    ------------------------------------------------------------ */
    
    #mobileServerActions {
        position: fixed;

        left: 16px;
        right: 16px;
        bottom: 80px;

        z-index: 300;

        background: var(--bg-panel);

        border: 1px solid var(--border-color);
        border-radius: 16px;

        padding: 10px;

        box-shadow:
            0 8px 30px rgba(0, 0, 0, .4);

        opacity: 0;
        transform: translateY(20px);

        pointer-events: none;

        transition:
            opacity .25s ease,
            transform .25s ease;
    }

    #mobileServerActions.visible {
        opacity: 1;
        transform: translateY(0);

        pointer-events: auto;
    }

    .mobile-server-action-buttons {
        display: grid;

        grid-template-columns:
            1fr 1fr;

        gap: 7px;
    }

    .mobile-server-action {
        display: flex;

        flex-direction: column;
        align-items: center;
        justify-content: center;

        gap: 4px;

        min-height: 52px;

        border: 1px solid var(--border-color);
        border-radius: var(--radius-small);

        background: var(--bg-main);
        color: var(--text-muted);

        cursor: pointer;

        font-size: .75rem;
    }

    .mobile-server-action i {
        font-size: 1rem;
        color: var(--accent);
    }

    .mobile-server-action:active {
        transform: scale(.97);
    }

    .mobile-server-action-danger i {
        color: var(--danger);
    }

}