:root {
    --primary: #8B5CF6;
    --primary-dark: #7C3AED;
    --secondary: #EC4899;
    --success: #10B981;
    --warning: #F59E0B;
    --error: #EF4444;
    --info: #3B82F6;
    
    --bg-primary: #0F172A;
    --bg-secondary: #1E293B;
    --bg-tertiary: #334155;
    --bg-card: #1E293B;
    
    --text-primary: #F1F5F9;
    --text-secondary: #CBD5E1;
    --text-tertiary: #94A3B8;
    --text-muted: #64748B;
    
    --border: #334155;
    --border-light: #475569;
    
    --radius: 12px;
    --radius-lg: 16px;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 20px 50px rgba(0, 0, 0, 0.4);
    
    --sidebar-width: 260px;
    --header-height: 60px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    width: 100%;
    height: 100%;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 16px;
    overflow: hidden;
}

/* ===== LAYOUT PRINCIPAL ===== */
.container {
    display: flex;
    width: 100%;
    height: 100vh;
    overflow: hidden;
    position: relative;
}

/* ===== SIDEBAR ===== */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-secondary);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease;
    z-index: 1000;
    flex-shrink: 0;
}

.logo {
    padding: 20px 16px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.logo-icon {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    color: white;
    flex-shrink: 0;
}

.logo-text h1 {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 3px;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: var(--text-tertiary);
}

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

.status-dot.online {
    background: var(--success);
    box-shadow: 0 0 8px var(--success);
}

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

/* Navigation Menu */
.nav-menu {
    flex: 1;
    padding: 12px 0;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
}

.nav-divider {
    padding: 12px 16px 6px;
    font-size: 10px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 16px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
    position: relative;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
}

.nav-item:hover {
    background: rgba(139, 92, 246, 0.1);
    color: var(--text-primary);
}

.nav-item.active {
    background: rgba(139, 92, 246, 0.15);
    color: var(--primary);
    border-left-color: var(--primary);
}

.nav-item i {
    width: 18px;
    text-align: center;
    font-size: 14px;
    flex-shrink: 0;
}

.nav-item span:not(.badge) {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nav-item .badge {
    margin-left: auto;
    background: var(--error);
    color: white;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 10px;
    font-weight: 700;
    flex-shrink: 0;
    min-width: 20px;
    text-align: center;
}

.sidebar-footer {
    padding: 12px 16px;
    border-top: 1px solid var(--border);
    flex-shrink: 0;
}

.btn-logout {
    width: 100%;
    padding: 10px 16px;
    background: linear-gradient(135deg, var(--error), #DC2626);
    color: white;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.btn-logout:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

/* ===== MAIN CONTENT ===== */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 0;
}

.header {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    padding: 0 16px;
    height: var(--header-height);
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    gap: 12px;
    flex-shrink: 0;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.header-left h2 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.connection-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--success);
    font-weight: 500;
    white-space: nowrap;
}

.time-display {
    font-size: 12px;
    color: var(--text-tertiary);
    font-family: 'Courier New', monospace;
    white-space: nowrap;
}

/* ===== HAMBURGER BUTTON ===== */
.hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 36px;
    height: 36px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    gap: 5px;
    padding: 8px;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.hamburger span {
    display: block;
    width: 18px;
    height: 2px;
    background: var(--text-secondary);
    border-radius: 2px;
    transition: all 0.3s ease;
    transform-origin: center;
}

.hamburger.active span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

.hamburger.active span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* ===== OVERLAY MOBILE ===== */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 999;
    backdrop-filter: blur(2px);
}

.sidebar-overlay.active {
    display: block;
}

/* ===== PAGES CONTAINER ===== */
.pages-container {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 16px;
    background: var(--bg-primary);
    -webkit-overflow-scrolling: touch;
}

.page {
    display: none;
    animation: fadeIn 0.25s ease;
}

.page.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

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

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 14px;
    display: flex;
    gap: 12px;
    align-items: center;
    transition: all 0.2s ease;
}

.stat-card:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 16px rgba(139, 92, 246, 0.15);
    transform: translateY(-2px);
}

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

.stat-icon.uptime { background: rgba(59, 130, 246, 0.15); color: var(--info); }
.stat-icon.servers { background: rgba(139, 92, 246, 0.15); color: var(--primary); }
.stat-icon.users { background: rgba(236, 72, 153, 0.15); color: var(--secondary); }
.stat-icon.ping { background: rgba(16, 185, 129, 0.15); color: var(--success); }
.stat-icon.commands { background: rgba(245, 158, 11, 0.15); color: var(--warning); }
.stat-icon.messages { background: rgba(139, 92, 246, 0.15); color: var(--primary); }
.stat-icon.memory { background: rgba(236, 72, 153, 0.15); color: var(--secondary); }
.stat-icon.errors { background: rgba(239, 68, 68, 0.15); color: var(--error); }

.stat-content {
    flex: 1;
    min-width: 0;
}

.stat-label {
    font-size: 11px;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 3px;
}

.stat-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    word-break: break-word;
    line-height: 1.2;
}

/* ===== CHARTS ===== */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 14px;
    margin-bottom: 20px;
}

.chart-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 14px;
    transition: all 0.2s ease;
}

.chart-card:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 16px rgba(139, 92, 246, 0.15);
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
    gap: 6px;
}

.chart-header h3 {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.chart-header i { color: var(--primary); }

.live-indicator {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    color: var(--error);
    font-weight: 600;
}

.pulse {
    width: 6px;
    height: 6px;
    background: var(--error);
    border-radius: 50%;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.8); }
}

/* ===== LOGS SECTION ===== */
.logs-section {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 14px;
    margin-bottom: 20px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
    gap: 8px;
}

.section-header h3 {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.section-header i { color: var(--primary); }

.link-view-all {
    color: var(--primary);
    text-decoration: none;
    font-size: 12px;
    font-weight: 600;
    transition: color 0.2s;
    white-space: nowrap;
}

.link-view-all:hover { color: var(--primary-dark); }

.logs-container {
    max-height: 240px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.empty-state {
    text-align: center;
    padding: 24px 12px;
    color: var(--text-tertiary);
    font-size: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.empty-state i {
    font-size: 28px;
    opacity: 0.4;
}

/* ===== LOGS CONTROLS ===== */
.logs-controls {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.control-group {
    flex: 1;
    min-width: 130px;
}

.control-group select,
.control-group input {
    width: 100%;
    padding: 8px 10px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: 13px;
    transition: border-color 0.2s;
    -webkit-appearance: none;
    appearance: none;
}

.control-group select:focus,
.control-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

.control-buttons {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    align-items: center;
}

.btn-control {
    padding: 8px 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

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

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 12px;
    color: var(--text-secondary);
    white-space: nowrap;
    padding: 8px 0;
}

/* ===== LOGS DISPLAY ===== */
.logs-display {
    background: #0a0f1e;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    height: 420px;
    overflow-y: auto;
    padding: 8px;
    -webkit-overflow-scrolling: touch;
}

.log-entry {
    padding: 5px 8px;
    margin-bottom: 2px;
    border-left: 3px solid var(--border);
    border-radius: 4px;
    font-size: 11px;
    font-family: 'Courier New', monospace;
    background: rgba(30, 41, 59, 0.6);
    transition: all 0.15s ease;
    word-break: break-word;
    line-height: 1.5;
}

.log-entry:hover {
    background: rgba(139, 92, 246, 0.08);
    border-left-color: var(--primary);
}

.log-time {
    color: var(--text-muted);
    margin-right: 5px;
    font-size: 10px;
}

.log-type {
    display: inline-block;
    padding: 1px 5px;
    border-radius: 3px;
    font-size: 9px;
    font-weight: 700;
    margin-right: 5px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.log-type.info    { background: rgba(59, 130, 246, 0.2);  color: #60a5fa; }
.log-type.success { background: rgba(16, 185, 129, 0.2);  color: #34d399; }
.log-type.error   { background: rgba(239, 68, 68, 0.2);   color: #f87171; }
.log-type.warning { background: rgba(245, 158, 11, 0.2);  color: #fbbf24; }
.log-type.command { background: rgba(139, 92, 246, 0.2);  color: #a78bfa; }
.log-type.event   { background: rgba(236, 72, 153, 0.2);  color: #f472b6; }

.log-message {
    color: var(--text-secondary);
    word-break: break-word;
}

/* ===== COMMANDS TABLE ===== */
.commands-table {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-top: 12px;
}

.commands-table,
.table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.commands-table table,
.data-table {
    width: 100%;
    min-width: 480px;
    border-collapse: collapse;
    font-size: 12px;
}

.commands-table thead,
.data-table thead {
    background: var(--bg-secondary);
    border-bottom: 2px solid var(--border);
}

.commands-table th,
.data-table th {
    padding: 10px 12px;
    text-align: left;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.commands-table td,
.data-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    color: var(--text-secondary);
    font-size: 12px;
    vertical-align: middle;
}

.commands-table tbody tr:hover,
.data-table tbody tr:hover {
    background: rgba(139, 92, 246, 0.05);
}

/* ===== TABLE CONTAINER ===== */
.table-container {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-top: 12px;
}

/* ===== SERVERS SECTION ===== */
.servers-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.servers-controls input,
.servers-controls select {
    padding: 10px 12px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: 13px;
    -webkit-appearance: none;
    appearance: none;
}

.servers-controls input { flex: 1; min-width: 150px; }

.servers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 12px;
}

.server-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 14px;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
}

.server-card:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 16px rgba(139, 92, 246, 0.15);
    transform: translateY(-2px);
}

.server-card-header {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.server-icon {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
    flex-shrink: 0;
    overflow: hidden;
}

.server-info { flex: 1; min-width: 0; }

.server-card h4 {
    color: var(--text-primary);
    margin-bottom: 3px;
    font-size: 13px;
    font-weight: 600;
    word-break: break-word;
}

.server-id {
    font-size: 10px;
    color: var(--text-tertiary);
    font-family: monospace;
    word-break: break-all;
}

.server-card p {
    font-size: 12px;
    color: var(--text-tertiary);
    margin-bottom: 3px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.server-card p i { font-size: 11px; color: var(--primary); }

.server-card-footer {
    display: flex;
    gap: 6px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--border);
}

.btn-small {
    flex: 1;
    padding: 7px 6px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 11px;
    font-weight: 500;
    transition: all 0.2s ease;
    text-align: center;
}

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

/* ===== CONFIG SECTION ===== */
.config-section {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 16px;
    margin-bottom: 16px;
}

.config-section h3 {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.config-section i { color: var(--primary); }

.section-description {
    font-size: 12px;
    color: var(--text-tertiary);
    margin-bottom: 14px;
}

.config-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    margin-bottom: 14px;
}

.config-field { display: flex; flex-direction: column; }

.config-field.full-width { grid-column: 1 / -1; }

.config-field label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 5px;
}

.config-field input {
    padding: 9px 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: 13px;
    transition: border-color 0.2s;
    -webkit-appearance: none;
}

.config-field input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

.password-field { display: flex; gap: 6px; }
.password-field input { flex: 1; }

/* ===== BUTTONS ===== */
.btn-primary {
    padding: 10px 16px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-primary:hover {
    opacity: 0.9;
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(139, 92, 246, 0.3);
}

.btn-secondary {
    padding: 10px 16px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.btn-secondary:hover {
    background: var(--bg-tertiary);
    border-color: var(--primary);
    color: var(--primary);
}

.btn-icon {
    padding: 9px 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 13px;
}

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

/* ===== ACTION BUTTONS ===== */
.btn-action {
    padding: 5px 10px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 11px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-action.success {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.btn-action.success:hover {
    background: var(--success);
    color: white;
}

.btn-action.danger {
    background: rgba(239, 68, 68, 0.15);
    color: var(--error);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

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

.btn-action.warning {
    background: rgba(245, 158, 11, 0.15);
    color: var(--warning);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.btn-action.warning:hover {
    background: var(--warning);
    color: white;
}

.btn-view {
    background: rgba(59, 130, 246, 0.15);
    color: var(--info);
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.btn-view:hover {
    background: var(--info);
    color: white;
}

/* ===== PLUGINS SECTION ===== */
.plugins-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.plugins-controls input,
.plugins-controls select {
    padding: 10px 12px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: 13px;
    -webkit-appearance: none;
}

.plugins-controls input { flex: 1; min-width: 150px; }

.plugins-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 12px;
}

.plugin-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 12px;
    transition: all 0.2s ease;
}

.plugin-card:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 16px rgba(139, 92, 246, 0.15);
    transform: translateY(-2px);
}

.plugin-card h4 {
    color: var(--text-primary);
    margin-bottom: 5px;
    font-size: 13px;
    font-weight: 600;
    word-break: break-word;
}

.plugin-card p {
    font-size: 11px;
    color: var(--text-tertiary);
    margin-bottom: 8px;
    line-height: 1.4;
}

.plugin-tags { display: flex; gap: 4px; flex-wrap: wrap; }

.plugin-tag {
    font-size: 10px;
    padding: 2px 7px;
    background: rgba(139, 92, 246, 0.12);
    color: var(--primary);
    border-radius: 4px;
    font-weight: 600;
}

/* ===== DATABASE SECTION ===== */
.database-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.db-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 14px;
    display: flex;
    gap: 10px;
    align-items: center;
    transition: all 0.2s ease;
}

.db-card:hover {
    border-color: var(--info);
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.15);
}

.db-icon {
    width: 40px;
    height: 40px;
    background: rgba(59, 130, 246, 0.12);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: var(--info);
    flex-shrink: 0;
}

.db-content { flex: 1; min-width: 0; }

.db-label {
    font-size: 11px;
    color: var(--text-tertiary);
    margin-bottom: 3px;
}

.db-card h3 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
}

/* ===== PERFORMANCE SECTION ===== */
.performance-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 12px;
    margin-bottom: 12px;
}

.perf-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 14px;
    transition: all 0.2s ease;
}

.perf-card:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 16px rgba(139, 92, 246, 0.15);
}

.perf-card.full-width { grid-column: 1 / -1; }

.perf-card h3 {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.perf-card i { color: var(--primary); }

.perf-details {
    background: var(--bg-secondary);
    border-radius: var(--radius);
    padding: 10px;
    font-size: 12px;
}

.perf-details p {
    color: var(--text-secondary);
    margin-bottom: 4px;
    display: flex;
    justify-content: space-between;
    gap: 8px;
}

.perf-details strong { color: var(--text-primary); }

.cpu-loads { display: flex; flex-direction: column; gap: 8px; }

.cpu-load-item { display: flex; align-items: center; gap: 8px; }

.cpu-label {
    font-size: 11px;
    color: var(--text-tertiary);
    min-width: 30px;
    font-weight: 600;
}

.cpu-bar {
    flex: 1;
    height: 14px;
    background: var(--bg-secondary);
    border-radius: 7px;
    overflow: hidden;
}

.cpu-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    border-radius: 7px;
    transition: width 0.3s ease;
}

.cpu-value {
    font-size: 11px;
    color: var(--text-primary);
    font-weight: 600;
    min-width: 40px;
    text-align: right;
}

/* ===== SECURITY SECTION ===== */
.security-section {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 16px;
    margin-bottom: 16px;
}

.security-section h3 {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.security-section i { color: var(--primary); }

.security-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    margin-top: 12px;
}

.form-field { display: flex; flex-direction: column; }

.form-field label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 5px;
}

.form-field input {
    padding: 9px 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: 13px;
    transition: border-color 0.2s;
    -webkit-appearance: none;
}

.form-field input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

/* ===== USER / VIP / WARN / RELATIONSHIP CARDS ===== */
.users-grid,
.vip-grid,
.warnings-grid,
.relationships-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 12px;
    margin-top: 12px;
}

.user-card,
.vip-card,
.warn-card,
.relationship-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 14px;
    transition: all 0.2s ease;
}

.user-card:hover,
.vip-card:hover,
.warn-card:hover,
.relationship-card:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 16px rgba(139, 92, 246, 0.12);
}

.user-id, .vip-id {
    font-size: 11px;
    font-family: monospace;
    color: var(--primary);
    background: rgba(139, 92, 246, 0.1);
    padding: 3px 8px;
    border-radius: 6px;
    margin-bottom: 8px;
    word-break: break-all;
}

.user-stats p,
.vip-info {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 4px;
    line-height: 1.4;
}

.warn-user {
    font-size: 12px;
    font-weight: 600;
    color: var(--warning);
    margin-bottom: 4px;
}

.warn-reason {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 8px;
    line-height: 1.4;
}

.rel-users {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
    word-break: break-all;
}

.rel-status {
    font-size: 12px;
    color: var(--secondary);
}

/* ===== PLANS GRID ===== */
.plans-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
    margin-top: 12px;
}

.plan-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 16px 12px;
    text-align: center;
    transition: all 0.2s ease;
}

.plan-card:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 16px rgba(139, 92, 246, 0.15);
    transform: translateY(-2px);
}

.plan-emoji { font-size: 28px; margin-bottom: 8px; }

.plan-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.plan-price {
    font-size: 18px;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 4px;
}

.plan-desc {
    font-size: 11px;
    color: var(--text-tertiary);
}

/* ===== STATUS BADGES ===== */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

.status-badge.active {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.status-badge.warning {
    background: rgba(245, 158, 11, 0.15);
    color: var(--warning);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.status-badge.expired {
    background: rgba(239, 68, 68, 0.15);
    color: var(--error);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

/* ===== TRANSACTION TYPE ===== */
.tx-type {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
}

.tx-type.deposit {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
}

.tx-type.rental {
    background: rgba(139, 92, 246, 0.15);
    color: var(--primary);
}

.tx-type.refund {
    background: rgba(59, 130, 246, 0.15);
    color: var(--info);
}

/* ===== BALANCE COLORS ===== */
.balance-positive { color: var(--success); font-weight: 700; }
.balance-zero { color: var(--text-muted); }

/* ===== TOAST NOTIFICATIONS ===== */
.toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: calc(100vw - 40px);
}

.toast {
    padding: 12px 16px;
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: var(--shadow);
    animation: slideInRight 0.3s ease;
    max-width: 320px;
    word-break: break-word;
}

.toast.success { background: rgba(16, 185, 129, 0.9); color: white; }
.toast.error   { background: rgba(239, 68, 68, 0.9); color: white; }
.toast.warning { background: rgba(245, 158, 11, 0.9); color: white; }
.toast.info    { background: rgba(59, 130, 246, 0.9); color: white; }

@keyframes slideInRight {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-light); }

/* ===== MOBILE (até 768px) ===== */
@media (max-width: 768px) {
    :root {
        --sidebar-width: 260px;
        --header-height: 56px;
    }

    .hamburger {
        display: flex;
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        transform: translateX(-100%);
        z-index: 1000;
        box-shadow: 4px 0 20px rgba(0, 0, 0, 0.4);
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .main-content {
        width: 100%;
    }

    .header-left h2 {
        font-size: 15px;
    }

    .connection-status span {
        display: none;
    }

    .pages-container {
        padding: 10px;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
        margin-bottom: 14px;
    }

    .stat-card {
        padding: 10px;
        gap: 8px;
    }

    .stat-icon {
        width: 36px;
        height: 36px;
        font-size: 16px;
        border-radius: 8px;
    }

    .stat-label { font-size: 10px; }
    .stat-value { font-size: 15px; }

    .charts-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .servers-grid {
        grid-template-columns: 1fr;
    }

    .config-grid {
        grid-template-columns: 1fr;
    }

    .plugins-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .performance-grid {
        grid-template-columns: 1fr;
    }

    .database-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .users-grid,
    .vip-grid,
    .warnings-grid,
    .relationships-grid {
        grid-template-columns: 1fr;
    }

    .plans-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .security-form {
        grid-template-columns: 1fr;
    }

    .logs-display {
        height: 320px;
    }

    .logs-controls {
        flex-direction: column;
    }

    .control-group {
        min-width: 100%;
    }

    .btn-primary,
    .btn-secondary {
        width: 100%;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .toast-container {
        bottom: 12px;
        right: 12px;
        left: 12px;
    }

    .toast {
        max-width: 100%;
    }

    /* Tabelas com scroll horizontal no mobile */
    .commands-table,
    .table-container {
        border-radius: var(--radius-lg);
    }

    .commands-table table,
    .data-table {
        min-width: 500px;
    }
}

/* ===== TABLET (768px - 1024px) ===== */
@media (min-width: 768px) and (max-width: 1024px) {
    :root { --sidebar-width: 220px; }

    .stats-grid { grid-template-columns: repeat(3, 1fr); }
    .charts-grid { grid-template-columns: 1fr; }
    .servers-grid { grid-template-columns: repeat(2, 1fr); }
    .plugins-grid { grid-template-columns: repeat(2, 1fr); }
    .performance-grid { grid-template-columns: repeat(2, 1fr); }
    .plans-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ===== DESKTOP (acima de 1024px) ===== */
@media (min-width: 1024px) {
    .stats-grid { grid-template-columns: repeat(4, 1fr); }
    .charts-grid { grid-template-columns: repeat(2, 1fr); }
    .servers-grid { grid-template-columns: repeat(3, 1fr); }
    .plugins-grid { grid-template-columns: repeat(4, 1fr); }
    .performance-grid { grid-template-columns: repeat(3, 1fr); }
    .plans-grid { grid-template-columns: repeat(5, 1fr); }
}
