/* Design System Profissional - Estilo Web3/Fintech Dashboard */
:root {
    /* Cores de Fundo (Super Dark) */
    --bg-base: #0a0a0c;
    --bg-surface: #111216;
    --bg-surface-hover: #15161b;
    --bg-surface-highlight: #1a1b23;
    
    /* Bordas e Linhas */
    --border-subtle: #202229;
    --border-strong: #2a2d36;
    
    /* Tipografia */
    --text-pure: #ffffff;
    --text-primary: #e4e4e7;
    --text-secondary: #8a8d9b;
    --text-muted: #5f616e;
    
    /* Cores de Destaque Dashboard Automator (TEMA AZUL) */
    --accent-purple: #2563eb; 
    --accent-purple-glow: rgba(37, 99, 235, 0.2);
    --accent-purple-dark: rgba(37, 99, 235, 0.1);
    
    --accent-green: #0ea5e9; 
    --accent-green-glow: rgba(14, 165, 233, 0.2);
    --accent-green-dark: rgba(14, 165, 233, 0.1);

    /* Dimensões */
    --sidebar-width: 260px;
    --header-height: 72px;
    
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    
    --font-family: 'Inter', system-ui, -apple-system, sans-serif;
    --transition-fast: 0.15s ease;
    --transition-smooth: 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-base);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

a { text-decoration: none; }
ul { list-style: none; }
button { font-family: inherit; cursor: pointer; outline: none; }

.hidden { display: none !important; }

/* =========================================================
   LAYOUT PRINCIPAL
========================================================= */
.app-layout {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* --- SIDEBAR --- */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--bg-surface);
    border-right: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    z-index: 10;
}

.sidebar-header {
    height: var(--header-height);
    display: flex;
    align-items: center;
    padding: 0 24px;
    border-bottom: 1px solid var(--border-subtle);
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-mark {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--accent-purple), #5136db);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    color: white;
    box-shadow: 0 4px 12px var(--accent-purple-glow);
}

.logo-text {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-pure);
    letter-spacing: -0.5px;
}

.sidebar-nav {
    padding: 24px 16px;
    flex: 1;
    overflow-y: auto;
}

.nav-section {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    font-weight: 600;
    margin: 24px 0 8px 12px;
}
.nav-section:first-child { margin-top: 0; }

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition-fast);
}

.nav-link:hover {
    background-color: var(--bg-surface-highlight);
    color: var(--text-primary);
}

.nav-link.active {
    background-color: var(--accent-purple-dark);
    color: var(--accent-purple);
    font-weight: 600;
}
.nav-link.active svg { color: var(--accent-purple); }

.sidebar-card {
    margin: 24px 16px;
    padding: 20px;
    background-color: var(--bg-surface-highlight);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    position: relative;
    overflow: hidden;
}
.sidebar-card h4 { font-size: 13px; color: var(--text-pure); margin-bottom: 6px; }
.sidebar-card p { font-size: 12px; color: var(--text-secondary); margin-bottom: 16px; line-height: 1.4; }

.btn-sm {
    width: 100%;
    background: var(--bg-surface);
    border: 1px solid var(--border-strong);
    color: var(--text-primary);
    padding: 8px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 500;
}

/* --- CONTEUDO PRINCIPAL --- */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* Topbar */
.topbar {
    height: var(--header-height);
    padding: 0 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-subtle);
    background-color: var(--bg-base);
}

.topbar-search {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-muted);
    width: 300px;
}
.topbar-search input {
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 14px;
    width: 100%;
    outline: none;
    font-family: inherit;
}
.topbar-search input::placeholder { color: var(--text-muted); }

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.icon-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    transition: var(--transition-fast);
}
.icon-btn:hover {
    background: var(--bg-surface);
    color: var(--text-primary);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-left: 20px;
    border-left: 1px solid var(--border-subtle);
}
.avatar {
    width: 32px;
    height: 32px;
    background-color: var(--accent-purple);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    color: white;
}
.user-info { display: flex; flex-direction: column; }
.user-name { font-size: 13px; font-weight: 500; color: var(--text-pure); }
.user-status { font-size: 11px; color: var(--accent-green); }

/* Conteúdo da Pagina */
.content-wrapper {
    flex: 1;
    overflow-y: auto;
    padding: 32px;
    position: relative;
}

.page-title {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 32px;
}
.page-title h1 { font-size: 24px; font-weight: 600; color: var(--text-pure); margin-bottom: 4px; letter-spacing: -0.5px; }
.page-title p { font-size: 14px; color: var(--text-secondary); }

.btn-group {
    display: flex;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 4px;
}
.btn-tab {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 500;
    border-radius: 4px;
}
.btn-tab.active {
    background: var(--bg-surface-highlight);
    color: var(--text-pure);
    box-shadow: 0 1px 3px rgba(0,0,0,0.5);
}

/* =========================================================
   CARDS DE MÉTRICAS
========================================================= */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.stat-card {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    transition: var(--transition-fast);
}
.stat-card:hover { border-color: var(--border-strong); transform: translateY(-2px); }

.stat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.stat-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
}
.stat-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: var(--bg-surface-highlight);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
}

.stat-value {
    font-size: 28px;
    font-weight: 600;
    letter-spacing: -0.5px;
    color: var(--text-pure);
}

/* Destaque Financeiro */
.text-glow-green {
    color: var(--accent-green);
    text-shadow: 0 0 20px var(--accent-green-glow);
}

.stat-footer { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.trend { font-weight: 500; display: flex; align-items: center; gap: 4px; }
.trend.positive { color: var(--accent-green); }
.trend.neutral { color: var(--accent-purple); }
.context { color: var(--text-muted); }

/* =========================================================
   PAINÉIS E GRÁFICOS
========================================================= */
.dashboard-grid-2 {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
}

.panel-card {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 24px;
    display: flex;
    flex-direction: column;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}
.panel-header h3 { font-size: 16px; font-weight: 600; color: var(--text-pure); }

.legend-item { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-secondary); margin-left: 12px; }
.dot { width: 8px; height: 8px; border-radius: 50%; }
.dot.green { background: var(--accent-green); box-shadow: 0 0 8px var(--accent-green); }
.dot.purple { background: var(--accent-purple); }

.chart-wrapper {
    flex: 1;
    position: relative;
    min-height: 300px;
    width: 100%;
}

/* Modulo de Faturas Mini */
.billing-details { display: flex; flex-direction: column; gap: 20px; }
.bill-item { display: flex; align-items: center; gap: 16px; }
.bill-icon { 
    width: 40px; height: 40px; border-radius: 10px; 
    background: var(--bg-base); border: 1px solid var(--border-subtle);
    display: flex; align-items: center; justify-content: center; color: var(--text-secondary);
}
.bill-info { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.bill-title { font-size: 13px; font-weight: 500; color: var(--text-primary); }
.bill-sub { font-size: 12px; color: var(--text-muted); }
.bill-amount { font-size: 14px; font-weight: 600; color: var(--text-pure); }

.text-glow-purple { color: var(--accent-purple); text-shadow: 0 0 15px var(--accent-purple-glow); }

.btn-outline-full {
    width: 100%; margin-top: 24px; padding: 12px;
    background: transparent; border: 1px solid var(--border-strong);
    color: var(--text-primary); border-radius: var(--radius-md);
    font-size: 13px; font-weight: 500; transition: var(--transition-fast);
}
.btn-outline-full:hover { background: var(--bg-surface-highlight); }

/* =========================================================
   TELA DE LOADING
========================================================= */
.loading-overlay {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: var(--bg-base); z-index: 50;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 16px;
}
.spinner {
    width: 40px; height: 40px;
    border: 3px solid var(--border-subtle);
    border-top-color: var(--accent-purple);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Index Generator Overlay */
.page-generator {
    position: relative;
    overflow: hidden;
    display: flex; 
    align-items: center; 
    justify-content: center; 
    height: 100vh;
}
.ambient-glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    z-index: 0;
    opacity: 0.3;
}
.orb-1 {
    width: 400px; height: 400px;
    background: var(--accent-green);
    top: -100px; left: -100px;
}
.orb-2 {
    width: 300px; height: 300px;
    background: var(--accent-purple);
    bottom: -50px; right: -50px;
}
.generator-modal { max-width: 440px; width: 100%; margin: auto; }
.glass-ultra {
    background: rgba(17, 18, 22, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    z-index: 10;
    position: relative;
    border-radius: var(--radius-xl);
    padding: 40px;
}
.generator-header-ui { text-align: center; margin-bottom: 30px; }
.lg-mark {
    margin: 0 auto 20px auto; width: 48px; height: 48px; font-size: 24px;
    box-shadow: 0 0 20px var(--accent-purple-glow);
}
.generator-header-ui h2 { font-size: 24px; color: #fff; margin-bottom: 8px; }
.generator-header-ui p { font-size: 14px; color: var(--text-secondary); line-height: 1.5; }
.generator-form-ui .input-wrap { display: flex; flex-direction: column; gap: 8px; margin-bottom: 20px; text-align: left; }
.generator-form-ui label { font-size: 13px; color: var(--text-secondary); font-weight: 500; }

.input-super, .input-success {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-strong);
    padding: 14px 16px; border-radius: 10px;
    color: white; width: 100%; outline: none;
    font-size: 14px; transition: border-color 0.2s;
}
.input-super:focus { border-color: var(--accent-green); }

.btn-super {
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-green));
    color: white; border: none; padding: 16px; border-radius: 10px;
    font-weight: 600; font-size: 15px; cursor: pointer; width: 100%;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 15px var(--accent-green-glow);
}
.btn-super:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(14, 165, 233, 0.4);
}

.result-ui { margin-top: 24px; padding-top: 24px; border-top: 1px solid var(--border-subtle); text-align: left;}
.result-title { font-size: 13px; color: var(--accent-green); margin-bottom: 12px; font-weight: 500; }
.copy-wrap { display: flex; gap: 8px; }
.input-success { border-color: var(--accent-green); color: var(--accent-green); }
.btn-copy {
    background: rgba(14, 165, 233, 0.1); border: 1px solid var(--accent-green);
    color: var(--accent-green); width: 50px; border-radius: 10px; cursor: pointer;
    transition: all 0.2s; display: flex; align-items: center; justify-content: center;
}
.btn-copy:hover { background: var(--accent-green); color: #111; }
.generator-footer-ui { margin-top: 30px; text-align: center; }
.generator-footer-ui p { font-size: 11px; color: #555; display: flex; align-items: center; justify-content: center; gap: 6px; }

/* STYLE.CSS ADAPTER: TAG ILIMITADO */
.tag-ilimitado {
    background: linear-gradient(135deg, var(--accent-green), var(--accent-purple));
    color: white; padding: 4px 10px; border-radius: 6px;
    font-size: 11px; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.05em; box-shadow: 0 0 10px var(--accent-green-glow);
}

/* RESPONSIVENESS */
@media (max-width: 900px) {
    .dashboard-grid-2 { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .app-layout { flex-direction: column; }
    .main-content { margin-bottom: 70px; }
    .content-wrapper { padding: 16px; }
    .sidebar {
        position: fixed; bottom: 0; left: 0; width: 100%; height: 75px;
        flex-direction: row; border-right: none; border-top: 1px solid var(--border-subtle);
        padding: 0; z-index: 100;
        background: rgba(17, 18, 22, 0.95); backdrop-filter: blur(10px);
    }
    .sidebar-header, .sidebar-card, .nav-section { display: none; }
    .sidebar-nav { flex-direction: row; justify-content: space-around; align-items: center; width: 100%; padding: 0; gap: 0; }
    .nav-link { flex-direction: column; gap: 4px; padding: 12px 8px; font-size: 10px; justify-content: center; border-radius: 0; }
    .nav-link svg { width: 22px; height: 22px; margin-right: 0 !important; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .topbar { padding: 16px; margin-bottom: 16px; flex-wrap: wrap; gap: 16px; }
    .topbar-actions .user-name { display: none; }
    .topbar-title h1 { font-size: 18px; }
    .topbar-title p { font-size: 12px; }
    .topbar-search { display: none; }
}

@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr; }
    .glass-ultra { padding: 24px; }
    .actions .btn-group { width: 100%; display: flex; }
    .btn-tab { flex: 1; text-align: center; }
}
