@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;700;800&display=swap');

/* Variáveis de Cores e Temas */
:root {
    --bg-color: #0b0f19;
    --card-bg: rgba(22, 27, 34, 0.4);
    --card-backdrop: blur(16px);
    --border-color: rgba(255, 255, 255, 0.08);
    --text-primary: #e6edf3;
    --text-secondary: #8b949e;
    --primary-color: #3b82f6; /* Modern Blue */
    --success-color: #10b981; /* Modern Emerald */
    --error-color: #ef4444; /* Modern Red */
    --enterprise-color: #f59e0b; /* Modern Amber */
    --surface-color: #161b22;
    --font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    
    --shadow-glow-blue: 0 0 20px rgba(59, 130, 246, 0.3);
    --shadow-glow-amber: 0 0 20px rgba(245, 158, 11, 0.3);
}

[data-theme="light"] {
    --bg-color: #f3f4f6;
    --card-bg: rgba(255, 255, 255, 0.8);
    --border-color: rgba(0, 0, 0, 0.1);
    --text-primary: #111827;
    --text-secondary: #4b5563;
    --primary-color: #2563eb; 
    --surface-color: #e5e7eb;
}

* {
    box-sizing: border-box;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-family);
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background-image: 
        radial-gradient(circle at 15% 50%, rgba(59, 130, 246, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 85% 30%, rgba(245, 158, 11, 0.1) 0%, transparent 50%);
    background-attachment: fixed;
}

.container {
    width: 100%;
    max-width: 1200px;
    padding: 2rem 1rem;
    animation: fadeIn 0.5s ease-out forwards;
}

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

/* Tipografia */
h1, h2, h3 {
    margin-top: 0;
    font-weight: 700;
}
h1 { font-size: 2.5rem; letter-spacing: -0.05em; }
h2 { font-size: 1.8rem; letter-spacing: -0.03em; }
.subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-bottom: 2rem;
    font-weight: 300;
}

/* Glassmorphism Cards */
.card {
    background: var(--card-bg);
    backdrop-filter: var(--card-backdrop);
    -webkit-backdrop-filter: var(--card-backdrop);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 2rem;
    width: 100%;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}

/* Botões */
.btn {
    display: inline-block;
    padding: 12px 24px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
    background-color: var(--card-bg);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}
.btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
    transform: scale(1.02);
}
.btn-enterprise {
    background: linear-gradient(135deg, var(--primary-color) 0%, #2563eb 100%);
    color: #fff;
    border: none;
    box-shadow: var(--shadow-glow-blue);
}
.btn-enterprise:hover {
    background: linear-gradient(135deg, #60a5fa 0%, var(--primary-color) 100%);
    box-shadow: 0 0 25px rgba(59, 130, 246, 0.5);
    transform: scale(1.05);
}

/* Inputs e Formulários */
input, select {
    width: 100%;
    padding: 14px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background: rgba(0, 0, 0, 0.3);
    color: var(--text-primary);
    font-family: var(--font-family);
    font-size: 1rem;
    transition: all 0.2s ease;
}
input:focus, select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
    background: rgba(0, 0, 0, 0.5);
}

/* Tabelas (Responsivas) */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background: rgba(0,0,0,0.2);
}
table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px; /* Garante que n quebre em telas pequenas */
}
th, td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}
th {
    background-color: rgba(255, 255, 255, 0.05);
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.05em;
}
tr:hover td {
    background-color: rgba(255, 255, 255, 0.02);
}

/* Badges */
.badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    display: inline-block;
}
.badge-enterprise { background-color: rgba(245, 158, 11, 0.2); color: var(--enterprise-color); border: 1px solid var(--enterprise-color); }
.badge-home { background-color: rgba(59, 130, 246, 0.2); color: var(--primary-color); border: 1px solid var(--primary-color); }
.badge-success { background-color: rgba(16, 185, 129, 0.2); color: var(--success-color); border: 1px solid var(--success-color); }
.badge-warning { background-color: rgba(241, 196, 15, 0.2); color: #f1c40f; border: 1px solid #f1c40f; }
.badge-error { background-color: rgba(239, 68, 68, 0.2); color: var(--error-color); border: 1px solid var(--error-color); }

/* Helpers Flexbox & Grid */
.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-10 { gap: 10px; }
.gap-15 { gap: 15px; }
.gap-20 { gap: 20px; }
.w-full { width: 100%; }

/* Grid de Planos e Métricas Admin */
.grid-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}
.metric-card {
    background: rgba(255, 255, 255, 0.03);
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    transition: transform 0.2s ease;
}
.metric-card:hover {
    background: rgba(255, 255, 255, 0.06);
    transform: translateY(-2px);
}
.metric-title {
    margin: 0; color: var(--text-secondary); font-size: 0.9rem; font-weight: 600;
}
.metric-value {
    font-size: 2.2rem; font-weight: 800; margin: 10px 0 0 0;
}

/* =========================================
   MEDIA QUERIES (MOBILE RESPONSIVE)
   ========================================= */
@media (max-width: 768px) {
    body {
        align-items: flex-start;
    }
    .container {
        padding: 1rem;
    }
    .card {
        padding: 1.5rem;
    }
    h1 {
        font-size: 2rem;
    }
    .flex-mobile-col {
        flex-direction: column;
        align-items: stretch !important;
    }
    .flex-mobile-col > * {
        margin-bottom: 10px;
        width: 100%;
    }
    /* Para botões de topo do admin */
    .admin-header-actions {
        display: flex;
        flex-direction: column;
        width: 100%;
        margin-top: 15px;
    }
    .admin-header-actions a {
        margin-right: 0 !important;
        margin-bottom: 10px;
        text-align: center;
    }
}
