/**
 * Estilos do Painel N-GATEWAY
 * NTECH NETWORK E COMUNICAÇÃO LTDA
 */

/* Reset e Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #3b82f6;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --info-color: #3b82f6;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --sidebar-width: 260px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: var(--gray-800);
    background-color: var(--gray-100);
}

a {
    color: var(--primary-color);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* ==================== LOGIN PAGE ==================== */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1e3a5f 0%, #0f172a 100%);
    padding: 20px;
}

.login-container {
    width: 100%;
    max-width: 420px;
}

.login-box {
    background: white;
    border-radius: 16px;
    padding: 40px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.4);
}

.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.company-logo {
    margin-bottom: 20px;
}

.company-logo img {
    max-width: 180px;
    max-height: 80px;
    object-fit: contain;
}

.logo-fallback {
    width: 80px;
    height: 80px;
    margin: 0 auto;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    border-radius: 16px;
    display: none;
    align-items: center;
    justify-content: center;
}

.logo-icon {
    font-size: 40px;
}

.logo-text {
    font-size: 24px;
    font-weight: 800;
    color: white;
    letter-spacing: 2px;
}

.login-header h1 {
    font-size: 24px;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 4px;
}

.login-header p {
    color: var(--gray-500);
    font-size: 14px;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-weight: 500;
    color: var(--gray-700);
    font-size: 14px;
}

.form-group input {
    padding: 12px 16px;
    border: 1px solid var(--gray-300);
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Selects: aparência consistente com os inputs em todo o painel — herdam a fonte
   e ganham borda arredondada + seta própria, eliminando o visual nativo "quadrado"
   e a fonte do sistema. Regras locais que ajustem padding/cor devem usar
   "background-color" (NÃO o shorthand "background"), para não apagar a seta. */
select {
    font-family: inherit;
    font-size: 14px;
    color: var(--gray-800);
    padding: 12px 40px 12px 16px;
    border: 1px solid var(--gray-300);
    border-radius: 8px;
    background-color: #fff;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 12px;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
}

select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.login-footer {
    text-align: center;
    margin-top: 24px;
    color: var(--gray-500);
}

.copyright {
    text-align: center;
    margin-top: 24px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 12px;
}

.copyright p {
    margin: 4px 0;
}

/* ==================== BUTTONS ==================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.btn:hover {
    text-decoration: none;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

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

.btn-danger:hover {
    background: #dc2626;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--gray-300);
    color: var(--gray-700);
}

.btn-outline:hover {
    background: var(--gray-100);
}

.btn-block {
    width: 100%;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.data-table .action-cell {
    white-space: nowrap;
}

.data-table .action-cell .action-buttons {
    gap: 6px;
    align-items: center;
}

.data-table .action-cell .btn-sm {
    padding: 4px 8px;
    font-size: 13px;
    min-width: 34px;
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

/* ==================== ALERTS ==================== */
.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
}

.alert a {
    color: inherit;
    text-decoration: underline;
}

.alert-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #b91c1c;
}

.alert-success {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #15803d;
}

/* ==================== DASHBOARD LAYOUT ==================== */
.dashboard {
    display: flex;
    min-height: 100vh;
}

/* ==================== SIDEBAR ==================== */
.sidebar {
    width: var(--sidebar-width);
    background: var(--gray-900);
    color: white;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid var(--gray-700);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    text-align: center;
}

.sidebar-logo {
    width: 100%;
    display: flex;
    justify-content: center;
}

.sidebar-logo img {
    max-width: 160px;
    max-height: 60px;
    object-fit: contain;
}

.logo-fallback-small {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 14px;
}

.sidebar-title h2 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 2px;
}

.router-name {
    font-size: 11px;
    color: var(--gray-400);
}

.sidebar-nav {
    padding: 16px 12px;
    flex: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--gray-300);
    text-decoration: none;
    border-radius: 8px;
    margin-bottom: 4px;
    transition: all 0.2s;
}

.nav-item:hover {
    background: var(--gray-800);
    color: white;
    text-decoration: none;
}

.nav-item.active {
    background: var(--primary-color);
    color: white;
}

.nav-icon {
    font-size: 18px;
    width: 24px;
    text-align: center;
}

.nav-text {
    font-size: 14px;
}

/* Selo "Beta" ao lado de itens do menu ainda em maturação */
.nav-beta {
    margin-left: auto;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 2px 7px;
    border-radius: 999px;
    background: #f59e0b;
    color: #1f2937;
}

.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--gray-700);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.user-icon {
    font-size: 16px;
}

.user-name {
    font-size: 13px;
    color: var(--gray-300);
}

.sidebar-footer .btn-outline {
    border-color: var(--gray-600);
    color: var(--gray-300);
}

.sidebar-footer .btn-outline:hover {
    background: var(--gray-800);
    border-color: var(--gray-500);
}

/* ==================== MAIN CONTENT ==================== */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 24px 32px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.content-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.content-header h1 {
    font-size: 24px;
    font-weight: 700;
    color: var(--gray-900);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.last-update {
    font-size: 12px;
    color: var(--gray-500);
}

.connection-count {
    font-size: 12px;
    color: var(--gray-600);
    background: var(--gray-200);
    padding: 4px 10px;
    border-radius: 12px;
}

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

.stat-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: all 0.2s;
}

.stat-card-link {
    text-decoration: none;
    color: inherit;
}

.stat-card-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}

.stat-icon.connected { background: #dbeafe; }
.stat-icon.users { background: #fef3c7; }
.stat-icon.uptime { background: #d1fae5; }
.stat-icon.cpu { background: #fce7f3; }

.stat-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.stat-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--gray-900);
}

.stat-value-small {
    font-size: 16px;
}

.stat-label {
    font-size: 12px;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ==================== CONTENT SECTION ==================== */
.content-section {
    background: white;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.content-section h2 {
    font-size: 18px;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--gray-200);
}

.section-description {
    color: var(--gray-600);
    margin-bottom: 24px;
    margin-top: -12px;
}

/* ==================== VPN SERVERS GRID ==================== */
.vpn-servers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
}

.server-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    border-radius: 12px;
    border: 1px solid var(--gray-200);
    transition: all 0.2s;
}

.server-card.active {
    border-color: var(--success-color);
    background: #f0fdf4;
}

.server-card.inactive {
    border-color: var(--gray-300);
    background: var(--gray-50);
}

.server-status {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-bottom: 12px;
}

.server-status.online {
    background: var(--success-color);
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.5);
}

.server-status.offline {
    background: var(--gray-400);
}

.server-name {
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 4px;
}

.server-state {
    font-size: 12px;
    color: var(--gray-500);
}

/* ==================== TABLES ==================== */
.table-responsive {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--gray-200);
}

.data-table th {
    font-weight: 600;
    color: var(--gray-600);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: var(--gray-50);
}

.data-table tbody tr:hover {
    background: var(--gray-50);
}

.data-table tbody tr.row-online {
    background: #f0fdf4;
}

.user-cell {
    display: flex;
    align-items: center;
    gap: 10px;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.status-dot.online {
    background: var(--success-color);
    box-shadow: 0 0 6px rgba(16, 185, 129, 0.5);
}

.status-dot.offline {
    background: var(--gray-400);
}

code {
    background: var(--gray-100);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 12px;
}

.uptime-badge {
    font-size: 13px;
    color: var(--gray-700);
}

.text-muted {
    color: var(--gray-400);
}

/* ==================== BADGES ==================== */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-success {
    background: #d1fae5;
    color: #065f46;
}

.badge-secondary {
    background: var(--gray-200);
    color: var(--gray-600);
}

.badge-info {
    background: #dbeafe;
    color: #1e40af;
}

/* ==================== EMPTY STATE ==================== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--gray-500);
}

/* ==================== SEARCH / TOOLBAR ==================== */
.section-toolbar {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.search-box {
    flex: 1;
    min-width: 250px;
}

.search-box input {
    width: 100%;
    padding: 10px 16px;
    border: 1px solid var(--gray-300);
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.search-box input::placeholder {
    color: var(--gray-400);
}

.search-filters select {
    padding: 10px 40px 10px 16px;
    border: 1px solid var(--gray-300);
    border-radius: 8px;
    font-size: 14px;
    background-color: white;
    cursor: pointer;
    min-width: 150px;
}

.search-filters select:focus {
    outline: none;
    border-color: var(--primary-color);
}

.search-info {
    font-size: 13px;
    color: var(--gray-500);
    white-space: nowrap;
}

.search-info span {
    font-weight: 600;
    color: var(--gray-700);
}

.empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.empty-state h3 {
    font-size: 18px;
    color: var(--gray-700);
    margin-bottom: 8px;
}

/* ==================== SYSTEM INFO GRID ==================== */
.system-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 12px;
    background: var(--gray-50);
    border-radius: 8px;
}

.info-label {
    font-size: 12px;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.info-value {
    font-weight: 600;
    color: var(--gray-900);
}

/* ==================== CONFIG FORM ==================== */
.config-form {
    max-width: 700px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.form-group .required {
    color: var(--danger-color);
}

.form-help {
    font-size: 12px;
    color: var(--gray-500);
    margin-top: 4px;
}

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--gray-200);
}

/* ==================== INSTRUCTIONS ==================== */
.instructions {
    color: var(--gray-700);
}

.instructions h3 {
    font-size: 14px;
    font-weight: 600;
    margin-top: 20px;
    margin-bottom: 8px;
}

.instructions h3:first-child {
    margin-top: 0;
}

.instructions p {
    margin-bottom: 8px;
}

.code-block {
    background: var(--gray-900);
    color: #e5e7eb;
    padding: 12px 16px;
    border-radius: 8px;
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 13px;
    overflow-x: auto;
    margin-bottom: 16px;
}

.config-info {
    background: var(--gray-50);
    padding: 16px;
    border-radius: 8px;
}

.config-info p {
    margin: 4px 0;
}

/* ==================== FOOTER ==================== */
.main-footer {
    margin-top: auto;
    padding-top: 24px;
    border-top: 1px solid var(--gray-200);
    text-align: center;
}

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

.modal-content {
    background: white;
    border-radius: 12px;
    width: 100%;
    max-width: 400px;
    margin: 20px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    /* Limita a altura à viewport e deixa o corpo rolar, para o rodapé
       (botão Salvar) nunca ser cortado em modais altos. */
    max-height: calc(100vh - 40px);
    display: flex;
    flex-direction: column;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--gray-200);
    flex-shrink: 0;
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--gray-500);
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.modal-close:hover {
    color: var(--gray-700);
}

/* Quando o conteúdo do modal está dentro de um <form>, o form precisa
   participar do flex-column para o corpo poder rolar e o rodapé ficar fixo. */
.modal-content > form {
    display: flex;
    flex-direction: column;
    min-height: 0;
    flex: 1 1 auto;
}

.modal-body {
    padding: 24px;
    /* Rola apenas o conteúdo; header e footer permanecem fixos. */
    overflow-y: auto;
    flex: 1 1 auto;
    min-height: 0;
}

.modal-body p {
    margin-bottom: 16px;
    color: var(--gray-600);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid var(--gray-200);
    background: var(--gray-50);
    border-radius: 0 0 12px 12px;
    flex-shrink: 0;
}

/* ==================== INPUT WITH UNIT ==================== */
.input-with-unit {
    display: flex;
    align-items: center;
    gap: 8px;
}

.input-with-unit input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid var(--gray-300);
    border-radius: 8px;
    font-size: 14px;
}

.input-with-unit input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.input-unit {
    color: var(--gray-500);
    font-size: 14px;
    white-space: nowrap;
}

.info-display {
    padding: 12px 16px;
    background: var(--gray-100);
    border-radius: 8px;
    color: var(--gray-700);
    font-weight: 500;
}

/* ==================== ADD USER SECTION ==================== */
.add-user-section {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--gray-200);
}

.add-user-section h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--gray-800);
}

/* ==================== ACTION BUTTONS ==================== */
.action-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* ==================== USER DETAILS IN SIDEBAR ==================== */
.user-details {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.user-role {
    font-size: 11px;
    color: var(--gray-500);
}

/* ==================== SIDEBAR CLIENT INFO ==================== */
.sidebar-client-info {
    padding: 12px 20px;
    background: var(--gray-800);
    border-bottom: 1px solid var(--gray-700);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.client-label {
    font-size: 11px;
    color: var(--gray-400);
}

.client-name {
    font-size: 13px;
    color: white;
}

.change-client {
    font-size: 11px;
    color: var(--primary-light);
    text-decoration: none;
    margin-left: auto;
}

.change-client:hover {
    text-decoration: underline;
}

/* ==================== CURRENT CLIENT BADGE ==================== */
.current-client-badge {
    background: var(--primary-color);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

/* ==================== ACTIVE CLIENT SECTION ==================== */
.active-client-section {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 16px 24px !important;
}

.active-client-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.active-client-label {
    font-size: 12px;
    opacity: 0.8;
}

.active-client-name {
    font-size: 18px;
}

.active-client-host {
    font-size: 12px;
    opacity: 0.7;
}

/* ==================== CLIENTS GRID ==================== */
.clients-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.client-card {
    background: white;
    border: 2px solid var(--gray-200);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.2s;
}

.client-card:hover {
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.client-card.selected {
    border-color: var(--success-color);
    background: #f0fdf4;
}

.client-card.inactive {
    opacity: 0.6;
}

.client-card-header {
    padding: 16px 20px;
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    gap: 12px;
}

.client-card-header h3 {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
    flex: 1;
}

.client-card-body {
    padding: 16px 20px;
}

.client-card-body p {
    margin: 4px 0;
    font-size: 13px;
    color: var(--gray-600);
}

.client-card-actions {
    padding: 12px 20px;
    background: var(--gray-50);
    border-top: 1px solid var(--gray-200);
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* ==================== ALERT WARNING ==================== */
.alert-warning {
    background: #fffbeb;
    border: 1px solid #fde68a;
    color: #92400e;
}

.alert-info {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1e40af;
}

/* ==================== MODAL LARGE ==================== */
.modal-large {
    max-width: 600px;
}

/* ==================== CHECKBOX LABEL ==================== */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
}

/* ==================== VALIDAÇÃO DE IP / REDE ==================== */
/* Marca campos de endereço IP inválidos (assets/ip-validation.js). */
.input-invalid {
    border-color: var(--danger-color) !important;
    background-color: #fef2f2 !important;
}

.ip-validation-msg {
    display: none;
    color: var(--danger-color);
    font-size: 12px;
    margin-top: 4px;
    line-height: 1.3;
}

/* ==================== EMPTY STATE SMALL ==================== */
.empty-state.small {
    padding: 30px 20px;
}

.empty-state.small p {
    margin: 0;
}

.footer-content {
    color: var(--gray-500);
    font-size: 12px;
}

.footer-content p {
    margin: 2px 0;
}

.footer-version,
.footer-version:visited {
    color: var(--gray-500) !important;
    text-decoration: none;
    font-weight: 600;
}

.footer-version:hover {
    text-decoration: underline;
}

.footer-sub {
    color: var(--gray-400);
}

body.changelog-page {
    background: var(--gray-50);
}

.changelog-shell {
    max-width: 920px;
    margin: 0 auto;
    padding: 36px 24px;
}

.changelog-header {
    display: grid;
    gap: 14px;
    margin-bottom: 30px;
}

.changelog-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 14px;
    border-radius: 999px;
    background: rgba(37, 99, 235, 0.1);
    color: var(--primary-color);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.changelog-header h1 {
    margin: 0;
    font-size: clamp(2rem, 3vw, 2.5rem);
    line-height: 1.05;
}

.changelog-header p {
    margin: 0;
    color: var(--gray-600);
    font-size: 1rem;
    max-width: 720px;
    line-height: 1.75;
}

.changelog-list {
    display: grid;
    gap: 18px;
}

.release-block {
    position: relative;
    border: 1px solid var(--gray-200);
    border-radius: 22px;
    padding: 28px;
    background: white;
    box-shadow: 0 16px 35px rgba(15, 23, 42, 0.06);
}

.release-block::before {
    content: '';
    position: absolute;
    left: 0;
    top: 28px;
    bottom: 28px;
    width: 4px;
    background: linear-gradient(180deg, rgba(37, 99, 235, 1), rgba(37, 99, 235, 0.18));
    border-radius: 999px;
}

.release-block-top {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: flex-start;
    margin-bottom: 20px;
}

.release-title-group {
    min-width: 0;
}

.release-label {
    margin: 0 0 8px;
    color: var(--primary-color);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 700;
}

.release-title {
    margin: 0;
    font-size: 1.5rem;
    color: var(--gray-900);
    line-height: 1.15;
}

.release-meta {
    display: grid;
    gap: 8px;
    text-align: right;
    min-width: 160px;
}

.release-date {
    color: var(--gray-500);
    font-size: 0.95rem;
}

.release-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--gray-700);
    background: var(--gray-100);
}

.release-description {
    margin: 0 0 22px;
    color: var(--gray-600);
    line-height: 1.75;
}

.release-changes {
    display: grid;
    gap: 20px;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.release-section h3 {
    margin: 0 0 10px;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--gray-900);
}

.release-section ul {
    margin: 0;
    padding-left: 18px;
    color: var(--gray-700);
}

.release-section li {
    margin-bottom: 10px;
    line-height: 1.7;
}

.release-empty {
    margin: 0;
    color: var(--gray-500);
    font-size: 0.95rem;
}

@media (max-width: 720px) {
    .changelog-shell {
        padding: 28px 18px;
    }

    .release-block {
        padding: 22px;
    }

    .release-block::before {
        top: 22px;
        bottom: 22px;
    }

    .release-block-top {
        flex-direction: column;
        align-items: stretch;
    }

    .release-meta {
        text-align: left;
        min-width: 0;
    }
}

@media (max-width: 720px) {
    .release-card {
        padding: 20px;
    }

    .release-card::before {
        top: 20px;
        bottom: 20px;
    }

    .release-card-top {
        flex-direction: column;
        align-items: stretch;
    }

    .release-meta {
        text-align: left;
    }
}

@media (max-width: 640px) {
    .changelog-shell {
        padding: 24px 16px;
    }
    .release-header {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        z-index: 1000;
    }
    
    .main-content {
        margin-left: 0;
        padding: 16px;
    }
    
    .content-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .form-actions .btn {
        width: 100%;
    }
}

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

/* ==================== VPN USERS PAGE ==================== */
.section-header-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.section-header-actions h2 {
    margin: 0;
}

/* Cabeçalhos de seção com ações ao lado do título (layout flex): o divisor
   precisa ficar no CONTAINER, ocupando a largura toda do card. Quando o
   border-bottom fica no <h2> (regra geral .content-section h2), ele só aparece
   sob o texto do título e parece uma linha "cortada no meio" do card. */
.section-header-with-filter,
.section-header-actions,
.section-head {
    border-bottom: 1px solid var(--gray-200);
    padding-bottom: 16px;
    margin-bottom: 20px;
}
.section-header-with-filter h2,
.section-header-actions h2,
.section-head h2 {
    border-bottom: none;
    padding-bottom: 0;
    margin: 0;
}

/* Status Badges */
.status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.status-online {
    background: #d1fae5;
    color: #065f46;
}

.status-offline {
    background: #e5e7eb;
    color: #374151;
}

.status-disabled {
    background: #fef3c7;
    color: #92400e;
}

/* Table row status colors */
.row-online {
    background-color: #f0fdf4;
}

.row-offline {
    background-color: #fff;
}

.row-disabled {
    background-color: #fffbeb;
    opacity: 0.8;
}

.row-disabled td {
    color: var(--gray-500);
}

/* IP online highlight */
.ip-online {
    color: var(--success-color);
    font-weight: 500;
}

/* Text muted */
.text-muted {
    color: var(--gray-500);
    font-size: 12px;
}

/* Badge warning */
.badge-warning {
    background: #fef3c7;
    color: #92400e;
}

/* Button warning */
.btn-warning {
    background: #f59e0b;
    color: white;
    border: none;
}

.btn-warning:hover {
    background: #d97706;
}

/* Button success */
.btn-success {
    background: #10b981;
    color: white;
    border: none;
}

.btn-success:hover {
    background: #059669;
}

/* White Label - Logos */
.sidebar-logo img {
    max-width: 100%;
    max-height: 48px;
    object-fit: contain;
}

.client-logo-thumb {
    width: 32px;
    height: 32px;
    object-fit: contain;
    border-radius: 4px;
    margin-right: 8px;
}

.client-card-header {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.client-card-header h3 {
    flex: 1;
}

/* API Type Badge */
.badge-info {
    background: #dbeafe;
    color: #1e40af;
}
