:root {
    --primary: #4361ee;
    --primary-dark: #3a0ca3;
    --secondary: #7209b7;
    --success: #4cc9f0;
    --warning: #f72585;
    --danger: #e63946;
    --dark: #2b2d42;
    --dark-light: #40456a;
    --light: #f8f9fa;
    --gray: #adb5bd;
    --gray-dark: #6c757d;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background: linear-gradient(135deg, var(--dark) 0%, var(--dark-light) 100%);
    color: var(--light);
    line-height: 1.6;
    min-height: 100vh;
    padding: 0;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Header Styles */
header {
    background: rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
    padding: 15px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--light);
}

.logo-icon {
    background: var(--primary);
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

nav ul {
    display: flex;
    list-style: none;
    gap: 20px;
}

nav a {
    color: var(--light);
    text-decoration: none;
    font-weight: 500;
    padding: 8px 15px;
    border-radius: 6px;
    transition: all 0.3s ease;
}

nav a:hover, nav a.active {
    background: rgba(67, 97, 238, 0.2);
    color: var(--success);
}

.user-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* Menu de usuário responsivo */
.user-menu-container {
    position: relative;
    display: flex;
    gap: 10px;
}

.user-menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--light);
    font-size: 1.5rem;
    cursor: pointer;
}

.user-menu {
    display: flex;
    gap: 10px;
}

/* Main Content Styles */
.dashboard {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 20px;
    margin-top: 20px;
}

.sidebar {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    padding: 20px;
    height: fit-content;
}

.sidebar-menu {
    list-style: none;
}

.sidebar-menu li {
    margin-bottom: 10px;
}

.sidebar-menu a {
    display: block;
    color: var(--light);
    text-decoration: none;
    padding: 10px 15px;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.sidebar-menu a:hover, .sidebar-menu a.active {
    background: rgba(67, 97, 238, 0.2);
    color: var(--success);
}

.main-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.card {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.card-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--light);
}

.card-icon {
    background: var(--primary);
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.stat-card {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    padding: 15px;
    text-align: center;
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 5px;
    color: var(--success);
}

.stat-label {
    font-size: 0.9rem;
    color: var(--gray);
}

/* Progress Bars */
.progress-bar {
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
    margin-top: 10px;
}

.progress {
    height: 100%;
    border-radius: 4px;
}

.progress-ram {
    width: 65%;
    background: var(--success);
}

.progress-storage {
    width: 30%;
    background: var(--success);
}

.progress-cpu {
    width: 45%;
    background: var(--success);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 10px 20px;
    background: var(--primary);
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.btn:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
}

.btn-success {
    background: var(--success);
}

.btn-danger {
    background: var(--danger);
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

th, td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

th {
    color: var(--gray);
    font-weight: 600;
    font-size: 0.9rem;
}

tr:hover {
    background: rgba(255, 255, 255, 0.05);
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

input, select, textarea {
    width: 100%;
    padding: 12px 15px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    color: var(--light);
    font-size: 1rem;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary);
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: var(--dark);
    border-radius: 10px;
    width: 500px;
    max-width: 90%;
    padding: 25px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.close {
    color: var(--gray);
    font-size: 1.5rem;
    cursor: pointer;
}

/* Tabs */
.tabs {
    display: flex;
    margin-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.tab {
    padding: 10px 20px;
    cursor: pointer;
    color: var(--gray);
    border-bottom: 2px solid transparent;
}

.tab.active {
    color: var(--success);
    border-bottom: 2px solid var(--success);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Footer */
footer {
    text-align: center;
    margin-top: 40px;
    padding: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--gray);
}

/* Estilos para os botões de desconectar */
.btn-disconnect {
    background: rgba(230, 57, 70, 0.2) !important;
    color: var(--danger) !important;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
}

.btn-disconnect:hover {
    background: var(--danger) !important;
    color: white !important;
    transform: scale(1.1);
}

/* Ajustes específicos para a tabela de clientes */
.card.clients-vpn td:nth-child(4) {
    text-align: center;
    width: 60px;
}

.card.clients-vpn td .btn-disconnect {
    margin: 0 auto;
}

.mobile-menu-toggle {
    display: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--light);
}

/* Responsive */
@media (max-width: 1200px) {
    .dashboard {
        grid-template-columns: 200px 1fr;
    }
}

@media (max-width: 992px) {
    .dashboard {
        grid-template-columns: 1fr;
    }
    
    .sidebar {
        display: none;
    }
    
    nav ul {
        display: none;
        flex-direction: column;
        background: var(--dark-light);
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        padding: 15px 20px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    nav ul.show {
        display: flex;
    }

    .mobile-menu-toggle {
        display: block;
    }

    /* Menu de usuário responsivo CORRIGIDO */
    .user-menu-container {
        order: 3;
        width: 100%;
        justify-content: center;
        margin-top: 10px;
    }
    
    .user-menu {
        display: none;
        position: absolute;
        top: 100%;
        right: 0;
        background: var(--dark-light);
        border-radius: 6px;
        padding: 10px;
        flex-direction: column;
        min-width: 150px;
        z-index: 101;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    }

    .user-menu.show {
        display: flex;
        flex-direction: column;
    }

    .user-menu-toggle {
        display: block;
    }

    /* Ajustes para a tabela de clientes */
    .card.clients-vpn table {
        min-width: unset;
        table-layout: auto;
    }

    .card.clients-vpn th:nth-child(1),
    .card.clients-vpn td:nth-child(1) {
        width: auto;
    }

    .card.clients-vpn th:nth-child(2),
    .card.clients-vpn td:nth-child(2) {
        width: auto;
    }

    .card.clients-vpn th:nth-child(3),
    .card.clients-vpn td:nth-child(3) {
        width: auto;
    }

    .card.clients-vpn th:nth-child(4),
    .card.clients-vpn td:nth-child(4) {
        width: 60px;
    }

    /* Garantir que o botão de desconectar mantenha formato circular */
    .btn-disconnect {
        width: 32px;
        height: 32px;
        min-width: 32px;
        font-size: 1.2rem;
    }

    /* Ajustes para tabelas em mobile */
    .card {
        overflow-x: auto;
    }

    .card table {
        min-width: 500px;
    }

    /* Ajustes de layout para mobile */
    .header-content {
        flex-wrap: wrap;
    }

    .logo {
        flex: 1;
    }
}

@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .main-content {
        grid-template-columns: 1fr;
    }

    .header-content {
        padding: 0 10px;
    }

    .container {
        padding: 10px;
    }

    /* Ajustes para a tabela de clientes em mobile */
    .card.clients-vpn table {
        font-size: 0.9rem;
    }

    .card.clients-vpn th, 
    .card.clients-vpn td {
        padding: 8px 10px;
    }

    /* Garantir que o botão de desconectar seja sempre circular */
    .btn-disconnect {
        width: 28px;
        height: 28px;
        min-width: 28px;
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .logo span {
        font-size: 1.2rem;
    }

    .logo-icon {
        width: 32px;
        height: 32px;
    }

    h1 {
        font-size: 1.5rem;
    }

    /* Ajustes finos para botões de desconectar em telas muito pequenas */
    .btn-disconnect {
        width: 26px;
        height: 26px;
        min-width: 26px;
        font-size: 0.9rem;
    }

    .card.clients-vpn th:nth-child(4),
    .card.clients-vpn td:nth-child(4) {
        width: 50px;
    }
}