/* =======================================================
💎 MAGMA UI SYSTEM V12 (TITAN ENTERPRISE)
=======================================================
   Autor: Engenharia Magma
   Core: CSS3 Variables & Flexbox/Grid Layout
=======================================================
*/

:root {
    /* PALETA DE CORES (MAGMA BRAND) */
    --bg-dark: #050505;
    --bg-card: #0f0f12;
    --bg-input: #151518;
    --border: #1f1f1f;
    
    --primary: #ff4500;
    --primary-hover: #d63000;
    --primary-dim: rgba(255, 69, 0, 0.1);
    
    --text-main: #e0e0e0;
    --text-muted: #888;
    
    --success: #2ecc71;
    --danger: #e74c3c;
    --warning: #f1c40f;
    
    /* VARIÁVEIS VISUAIS (GLASS & NEON) */
    --glass-bg: rgba(20, 20, 23, 0.7);
    --glass-border: rgba(255, 255, 255, 0.05);
    --neon-glow: 0 0 20px rgba(255, 69, 0, 0.15);

    /* ESPAÇAMENTO & LAYOUT */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --nav-height: 70px;
}

/* --- RESET & BASE --- */
* { box-sizing: border-box; outline: none; }
body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: 'Inter', sans-serif;
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

/* Background Premium (Client Panel Style) */
body.magma-premium-bg {
    background-color: #050505;
    background-image: radial-gradient(circle at 50% 0%, #1a0b05 0%, #050505 60%);
    background-attachment: fixed;
}

a { text-decoration: none; color: inherit; transition: 0.3s; }
button { border: none; background: none; cursor: pointer; font-family: inherit; }
ul, li { list-style: none; padding: 0; margin: 0; }

/* --- TYPOGRAPHY --- */
h1, h2, h3 { margin: 0; color: #fff; font-weight: 800; text-transform: uppercase; letter-spacing: -0.5px; }
.text-muted { color: var(--text-muted); font-size: 12px; }

/* --- COMPONENTS: NAVBAR --- */
.navbar {
    background: var(--bg-card);
    padding: 0 30px;
    height: var(--nav-height);
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
}
/* Navbar Transparente para o Painel do Cliente */
.navbar.glass {
    background: rgba(10, 10, 12, 0.8);
    backdrop-filter: blur(15px);
    border-bottom: 1px solid var(--glass-border);
}

.brand { font-size: 20px; font-weight: 800; color: #fff; text-transform: uppercase; letter-spacing: 1px; }
.brand span { color: var(--primary); }

/* --- COMPONENTS: CARDS --- */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 25px;
    position: relative;
    overflow: hidden;
    transition: transform 0.3s ease, border-color 0.3s ease;
}
.card:hover { border-color: #333; }

/* Card Glassmorphism (Cliente) */
.card.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}
.card.glass .card-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    background: rgba(255, 255, 255, 0.01);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #1a1a1d;
}
.card-title { font-size: 13px; font-weight: 800; color: #fff; text-transform: uppercase; letter-spacing: 0.5px; display: flex; align-items: center; gap: 10px; }
.card-title i { color: var(--primary); }

/* --- COMPONENTS: INPUTS & FORMS --- */
.input-group { margin-bottom: 20px; position: relative; }
.form-label, label { display: block; font-size: 11px; color: var(--text-muted); margin-bottom: 6px; font-weight: 600; text-transform: uppercase; }

input[type="text"], input[type="password"], input[type="email"], select {
    width: 100%;
    padding: 12px 15px;
    background: var(--bg-input);
    border: 1px solid #252529;
    color: white;
    border-radius: var(--radius-sm);
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    transition: 0.3s;
}
input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-dim); }

/* Toolbars (Busca) */
.toolbar { display: flex; gap: 10px; margin-bottom: 15px; }
.search-bar { flex: 1; position: relative; }
.search-bar i { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: #666; font-size: 12px; }
.search-bar input { padding-left: 35px; background: #0a0a0c; border-color: #222; }
.search-bar input:focus { border-color: var(--primary); }

/* --- COMPONENTS: BUTTONS --- */
.btn {
    padding: 12px 20px;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 12px;
    text-transform: uppercase;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: 0.3s;
    cursor: pointer;
}
.btn-primary {
    background: linear-gradient(45deg, var(--primary), var(--primary-hover));
    color: #fff;
}
.btn-primary:hover { box-shadow: 0 5px 15px rgba(255, 69, 0, 0.3); transform: translateY(-2px); }

.btn-sec { background: #1a1a1d; color: #ccc; border: 1px solid #333; }
.btn-sec:hover { background: #fff; color: #000; border-color: #fff; }

.btn-glow {
    background: linear-gradient(90deg, #ff4500, #ff6b00);
    color: #fff;
    border: none;
    box-shadow: 0 4px 15px rgba(255, 69, 0, 0.3);
    font-weight: 800;
    letter-spacing: 0.5px;
}
.btn-glow:hover { box-shadow: 0 6px 20px rgba(255, 69, 0, 0.5); transform: translateY(-2px); }

.btn-glass {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    color: #ccc;
}
.btn-glass:hover { background: rgba(255,255,255,0.1); color: #fff; border-color: #fff; }

.btn-icon {
    width: 32px; height: 32px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: var(--radius-sm);
    background: #1a1a1d; border: 1px solid #252529;
    color: #ccc; transition: 0.2s;
}
.btn-icon:hover { background: #333; color: #fff; border-color: #555; }

/* --- COMPONENTS: BADGES & PILLS --- */
.badge, .status-pill {
    padding: 6px 12px;
    border-radius: 50px;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    display: inline-flex; align-items: center; gap: 6px;
    letter-spacing: 0.5px;
}
.badge-active, .status-active { 
    background: rgba(46, 204, 113, 0.1); 
    color: #2ecc71; 
    border: 1px solid rgba(46, 204, 113, 0.3);
    box-shadow: 0 0 15px rgba(46, 204, 113, 0.1);
}
.badge-active::before, .status-active i.fa-circle { color:#2ecc71; }

.badge-sus, .status-sus { background: rgba(231, 76, 60, 0.1); color: var(--danger); border: 1px solid rgba(231, 76, 60, 0.2); }
.badge-sus::before { content:''; width:6px; height:6px; background:var(--danger); border-radius:50%; box-shadow:0 0 5px var(--danger); }

/* --- COMPONENTS: MODAL (Universal) --- */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.85); backdrop-filter: blur(5px);
    z-index: 9000;
    display: none; align-items: center; justify-content: center;
    opacity: 0; transition: opacity 0.3s;
}
.modal-overlay.active { display: flex; opacity: 1; }

.modal-box {
    background: var(--bg-card);
    width: 90%; max-width: 500px;
    padding: 30px; border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: 0 20px 60px rgba(0,0,0,0.8);
    transform: scale(0.95); transition: transform 0.3s;
    position: relative;
    max-height: 90vh; overflow-y: auto;
}
.modal-overlay.active .modal-box { transform: scale(1); }
.modal-close { position: absolute; top: 20px; right: 20px; font-size: 20px; cursor: pointer; color: #666; transition: 0.2s; }
.modal-close:hover { color: #fff; }

/* --- COMPONENTS: TOAST --- */
.toast-container { position: fixed; bottom: 30px; right: 30px; z-index: 9999; display: flex; flex-direction: column; gap: 10px; }
.toast {
    background: var(--bg-card); color: #fff; padding: 15px 20px;
    border-radius: var(--radius-sm); border-left: 4px solid var(--primary);
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    font-size: 13px; font-weight: 500; display: flex; align-items: center; gap: 12px;
    min-width: 300px; animation: slideInRight 0.4s ease;
}
.toast.success { border-color: var(--success); } .toast.success i { color: var(--success); }
.toast.error { border-color: var(--danger); } .toast.error i { color: var(--danger); }

/* --- MODULE: KEY BOX (Credentials) --- */
.key-wrapper { position: relative; cursor: pointer; }
.key-box {
    background: #000; padding: 10px; border-radius: var(--radius-sm);
    border: 1px solid #333;
    font-family: 'JetBrains Mono', monospace; font-size: 14px;
    color: #ff9f43; text-align: center; letter-spacing: 1px;
    transition: 0.3s; word-break: break-all;
    text-shadow: 0 0 10px rgba(255, 159, 67, 0.3);
}
.key-wrapper:hover .key-box {
    border-color: var(--primary);
    color: #fff;
    box-shadow: var(--neon-glow);
    text-shadow: 0 0 15px var(--primary);
}
.copy-hint { text-align: center; font-size: 10px; color: #555; margin-top: 5px; font-weight: 700; text-transform: uppercase; }

/* --- MODULE: CONNECTION MONITOR (Client) --- */
.monitor-screen {
    background: #000;
    border: 1px solid #222;
    border-radius: 8px;
    padding: 25px;
    position: relative;
    overflow: hidden;
}
.monitor-screen::after {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 2px;
    background: linear-gradient(90deg, transparent, var(--primary), transparent);
    animation: scanline 3s linear infinite;
    opacity: 0.5;
}

/* --- MODULE: PLUGIN GRID & CARDS --- */
.plugin-grid, .perm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 15px; }
.perm-grid { max-height: 400px; overflow-y: auto; padding-right: 5px; }

.plugin-card-premium {
    background: linear-gradient(145deg, rgba(255,255,255,0.03) 0%, rgba(255,255,255,0.01) 100%);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 25px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}
.plugin-card-premium:hover {
    transform: translateY(-5px);
    border-color: rgba(255, 69, 0, 0.3);
    box-shadow: 0 10px 40px rgba(0,0,0,0.4), inset 0 0 20px rgba(255,69,0,0.05);
}
.plugin-card-premium::before { content: ''; position: absolute; top: 0; left: 0; width: 4px; height: 100%; background: var(--primary); opacity: 0; transition: 0.3s; }
.plugin-card-premium:hover::before { opacity: 1; }

.plugin-icon-box {
    width: 50px; height: 50px;
    background: rgba(255, 69, 0, 0.1);
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 22px; color: var(--primary);
    margin-bottom: 15px;
    border: 1px solid rgba(255, 69, 0, 0.1);
}

/* --- MODULE: CHECKBOX GRID (Admin) --- */
.perm-item { display: flex; align-items: center; gap: 12px; padding: 15px; background: #1a1a1d; border: 1px solid #252529; border-radius: var(--radius-sm); cursor: pointer; transition: 0.2s; position: relative; }
.perm-item:hover { border-color: #555; background: #222; }
.perm-item.selected { border-color: var(--primary); background: rgba(255, 69, 0, 0.08); }
.perm-item input { position: absolute; opacity: 0; }
.check-box { width: 20px; height: 20px; border-radius: 4px; border: 2px solid #444; display: flex; align-items: center; justify-content: center; transition: 0.2s; flex-shrink: 0; }
.perm-item input:checked ~ .check-box { background: var(--primary); border-color: var(--primary); }
.perm-item input:checked ~ .check-box::after { content: '✔'; font-size: 12px; color: white; }

/* --- MODULE: KPI DASHBOARD --- */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; margin-bottom: 30px; }
.kpi-card { background: var(--bg-card); padding: 25px; border-radius: var(--radius-lg); border: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; position: relative; overflow: hidden; }
.kpi-value { font-size: 32px; font-weight: 800; color: #fff; line-height: 1; margin-bottom: 5px; }
.kpi-label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; font-weight: 700; letter-spacing: 1px; }
.kpi-icon { font-size: 40px; color: #fff; opacity: 0.05; position: absolute; right: 20px; top: 50%; transform: translateY(-50%); }
.kpi-active { border-bottom: 3px solid var(--success); }
.kpi-prod { border-bottom: 3px solid var(--primary); }

/* --- MODULE: TABLE SYSTEMS --- */
.table-container { background: var(--bg-card); border-radius: var(--radius-lg); border: 1px solid var(--border); overflow: hidden; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; padding: 18px 25px; background: #141417; color: #888; font-size: 10px; text-transform: uppercase; font-weight: 700; letter-spacing: 1px; border-bottom: 1px solid var(--border); }
td { padding: 18px 25px; border-bottom: 1px solid #1a1a1d; vertical-align: middle; color: #ccc; font-size: 13px; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: #121215; }

.user-info { display: flex; flex-direction: column; }
.user-name { font-weight: 700; color: #fff; font-size: 14px; }
.user-email { font-size: 11px; color: #666; margin-top: 2px; }

/* --- SPECIFIC: DASHBOARD GRID --- */
.container { max-width: 1200px; margin: 40px auto; padding: 0 20px; width: 100%; }
.grid-layout { display: grid; grid-template-columns: 350px 1fr; gap: 30px; align-items: start; }
.d-none-mobile { display: inline-block; }

/* --- SPECIFIC: LOGIN PAGE --- */
body.login-mode { align-items: center; justify-content: center; overflow: hidden; }
body.login-mode::before {
    content: ""; position: absolute; width: 200%; height: 200%;
    background-image: linear-gradient(rgba(255, 69, 0, 0.03) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 69, 0, 0.03) 1px, transparent 1px);
    background-size: 50px 50px; z-index: -1;
    transform: perspective(500px) rotateX(60deg);
    animation: gridMove 20s linear infinite;
}
.login-box {
    background: rgba(15, 15, 18, 0.95); backdrop-filter: blur(10px);
    padding: 40px; border-radius: var(--radius-lg);
    width: 340px; text-align: center; border: 1px solid var(--border);
    box-shadow: 0 20px 60px rgba(0,0,0,0.8);
}

/* --- MEDIA & ANIMATIONS --- */
@media (max-width: 900px) {
    .grid-layout { grid-template-columns: 1fr; }
    .d-none-mobile { display: none; }
    .navbar { padding: 0 20px; }
}
@keyframes gridMove { from { transform: perspective(500px) rotateX(60deg) translateY(0); } to { transform: perspective(500px) rotateX(60deg) translateY(50px); } }
@keyframes slideInRight { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes scanline { 0% { top: -10%; } 100% { top: 110%; } }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(241, 196, 15, 0.4); } 70% { box-shadow: 0 0 0 10px rgba(241, 196, 15, 0); } 100% { box-shadow: 0 0 0 0 rgba(241, 196, 15, 0); } }