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

* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Inter', sans-serif; line-height: 1.5; overflow: hidden; height: 100vh; }

/* ---------------------------------------------------
   Global Components
--------------------------------------------------- */

/* NOVO LAYOUT GLOBAL (Top Navigation) */
.page-container { display: flex; flex-direction: column; height: 100vh; width: 100vw; overflow: hidden; }
.page-content { flex: 1; display: flex; overflow: hidden; width: 100%; }

.top-header { width: 100%; background-color: var(--surface-color); border-bottom: 1px solid var(--border-color); padding: 1rem 2rem; display: flex; flex-direction: row; justify-content: space-between; align-items: stretch; flex-shrink: 0; }
.top-header-top { display: flex; justify-content: space-between; align-items: center; width: 100%; }
.top-header-title { color: var(--primary-color); font-size: 1.5rem; font-weight: 700; text-transform: uppercase; margin: 0; }
.top-header-bottom { display: flex; justify-content: center; gap: 1rem; margin-top: 1.5rem; position: relative; }
.nav-tab { padding: 0.8rem 2.5rem; border-radius: 8px; font-weight: 500; text-decoration: none; transition: all 0.2s; }
.nav-tab.inactive { background-color: rgba(255,255,255,0.05); color: var(--text-muted); }
.nav-tab.inactive:hover { background-color: rgba(255,255,255,0.1); }
.nav-tab.active { background-color: var(--primary-color); color: #ffffff; border-radius: 8px; font-weight: 600; }
.nav-tab.logout { background-color: rgba(247, 118, 142, 0.1); color: #f7768e; position: absolute; right: 0; }

.layout-a-main { flex: 1; display: flex; flex-direction: column; padding: 2rem; overflow-y: auto; width: 100%; }

.layout-b-sidebar { width: 368px; background-color: var(--surface-color); display: flex; flex-direction: column; overflow-y: auto; border-right: 1px solid var(--border-color); }
.layout-b-main { flex: 1; display: flex; flex-direction: column; padding: 2rem; overflow-y: auto; }

.logo-container {
    display: flex; justify-content: center; align-items: center;
    padding: 2rem;
}
.logo-img { width: 100%; max-width: 250px; }

.btn {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 0 1rem; height: 36px; border-radius: 6px; font-weight: 500;
    cursor: pointer; border: none; transition: opacity 0.2s ease;
    font-size: 0.9rem;
}
.btn:hover { opacity: 0.8; }
.btn-primary { background-color: var(--primary-color); color: #ffffff; }
.btn-success { background-color: var(--success-color); color: #1a1b26; }
.btn-danger { background-color: var(--error-color); color: #1a1b26; }
.btn-info { background-color: var(--primary-color); color: #1a1b26; }

.form-control {
    width: 100%; height: 36px; padding: 0 1rem; border-radius: 6px;
    font-size: 0.9rem;
}
.form-group { margin-bottom: 1.5rem; }
.form-label { display: block; margin-bottom: 0.5rem; font-size: 0.85rem; font-weight: 600; color: var(--text-primary); }

/* Theme Toggle */
.theme-toggle-container {
    display: flex; align-items: center; gap: 1rem;
    position: absolute; bottom: 2rem; right: 2rem;
}
.theme-icon { font-size: 1.5rem; cursor: pointer; display: none; transition: all 0.3s ease; }
.theme-icon.active { display: block; opacity: 1; transform: scale(1.1); }

/* ---------------------------------------------------
   LOGIN
--------------------------------------------------- */
.login-wrapper {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    height: 100vh;
}
.login-card {
    background-color: var(--surface-color);
    width: 435px; height: 342px; border-radius: 30px;
    display: flex; flex-direction: column; justify-content: center;
    padding: 3rem; margin-top: 2rem;
}
.login-card .form-group { text-align: center; }
.login-card .form-label { color: var(--text-primary); margin-bottom: 0.5rem; font-weight: 500; }
.login-card .form-control { background-color: var(--input-bg); margin-bottom: 1rem; text-align: center;}

/* ---------------------------------------------------
   LAYOUT A (Dashboard Nav Lateral)
--------------------------------------------------- */
.layout-a { display: flex; height: 100vh; width: 100vw; }
.layout-a-sidebar {
    width: 368px; background-color: var(--surface-color);
    display: flex; flex-direction: column; position: relative;
}
.layout-a-main {
    flex: 1; display: flex; flex-direction: column;
    align-items: center; justify-content: center;
}

.layout-a-sidebar .nav-menu { margin-top: 4rem; flex: 1; }
.layout-a-sidebar .nav-item {
    display: block; width: 100%; height: 70px;
    line-height: 70px; padding-left: 3rem;
    font-size: 1.2rem; font-weight: 500;
    color: var(--text-primary); text-decoration: none;
    transition: background 0.2s;
}
.layout-a-sidebar .nav-item:hover { background-color: var(--surface-hover); }
.layout-a-sidebar .nav-item.active { background-color: var(--primary-color); color: #1a1b26; font-weight: 600; }

.layout-a-sidebar .bottom-actions {
    padding: 2rem 3rem; display: flex; align-items: center; justify-content: space-between;
}
.layout-a-sidebar .btn-sair { background-color: var(--error-color); color: #1a1b26; width: 80px; }


/* ---------------------------------------------------
   LAYOUT B (Modules - Formulário Lateral + Abas)
--------------------------------------------------- */
.layout-b { display: flex; height: 100vh; width: 100vw; }
.layout-b-sidebar {
    width: 368px; background-color: var(--surface-color);
    display: flex; flex-direction: column; position: relative;
}
.layout-b-main {
    flex: 1; display: flex; flex-direction: column; padding: 2rem 2rem 0 2rem;
}

/* Formulário Lateral */
.sidebar-form { padding: 1rem 2rem; flex: 1; overflow-y: auto; }
.sidebar-form-title { font-size: 1.2rem; font-weight: 600; margin-bottom: 2rem; display: flex; align-items: center; gap: 0.5rem; }
.sidebar-form .radio-group { display: flex; gap: 2rem; margin-bottom: 2rem; }
.sidebar-form .radio-item { display: flex; align-items: center; gap: 0.5rem; font-size: 0.9rem; }
.sidebar-form .radio-dot { width: 12px; height: 12px; border-radius: 50%; }
.sidebar-form .radio-dot.green { background-color: var(--success-color); }
.sidebar-form .radio-dot.red { background-color: var(--error-color); }

.sidebar-form .btn-group { display: flex; gap: 0.5rem; margin-top: 2rem; flex-wrap: wrap; }

.layout-b-sidebar .bottom-actions {
    padding: 2rem; display: flex; align-items: center; justify-content: space-between;
}
.layout-b-sidebar .btn-sair { background-color: var(--error-color); color: #1a1b26; width: 80px; }

/* Topo do Módulo */
.module-title { text-align: center; font-size: 2rem; color: var(--primary-color); font-weight: 700; margin-bottom: 2rem; letter-spacing: 2px;}

.module-tabs { display: flex; gap: 1rem; margin-bottom: 1rem; }
.module-tab {
    flex: 1; height: 60px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    background-color: var(--input-bg); color: var(--text-primary);
    font-size: 1.2rem; font-weight: 500; text-decoration: none;
    transition: background 0.2s;
}
.module-tab:hover { opacity: 0.9; }
.module-tab.active { background-color: var(--surface-color); }

/* Tabela e Cards */
.module-content {
    flex: 1; display: flex; flex-direction: column; overflow: hidden;
}
.table-wrapper {
    flex: 1; overflow-y: auto; margin-bottom: 1rem;
    border: 1px solid var(--surface-color);
}
table { width: 100%; border-collapse: collapse; text-align: left; }
th { background-color: var(--input-bg); padding: 1rem; font-size: 0.8rem; font-weight: 600; text-transform: uppercase; color: var(--text-primary); position: sticky; top: 0; }
td { padding: 1rem; border-bottom: 1px solid var(--surface-hover); font-size: 0.9rem; }
tr:nth-child(odd) { background-color: var(--bg-color); }
tr:nth-child(even) { background-color: var(--surface-color); }

.text-success { color: var(--success-color); }
.text-danger { color: var(--error-color); }
.text-warning { color: var(--warning-color); }

.summary-cards {
    display: flex; gap: 1rem; height: 100px; margin-bottom: 1rem;
}
.summary-card {
    flex: 1; background-color: var(--summary-bg); color: var(--summary-text);
    border-radius: 10px; padding: 1rem 1.5rem;
    display: flex; flex-direction: column; justify-content: center;
}
.summary-card span { font-size: 0.8rem; font-weight: 500; }
.summary-card h2 { font-size: 1.5rem; font-weight: 700; margin: 0; color: var(--success-color); white-space: nowrap; }
.summary-card.despesa h2 { color: var(--error-color); }

/* ---------------------------------------------------
   RESPONSIVE DESIGN (Mobile)
--------------------------------------------------- */
@media (max-width: 768px) {
    body { overflow-y: auto; overflow-x: hidden; height: auto; min-height: 100vh; }
    
    .layout-a, .layout-b { flex-direction: column; height: auto; }
    .layout-a-sidebar, .layout-b-sidebar { width: 100%; height: auto; min-height: auto; flex: none; }
    
    .layout-b-main { padding: 1rem; display: flex; flex-direction: column; flex: none; height: auto; }
    
    .module-tabs { flex-wrap: wrap; gap: 0.5rem; }
    .module-tab { font-size: 0.9rem; height: 50px; flex: 1 1 45%; }
    
    .summary-cards { flex-direction: column; height: auto; }
    
    .table-wrapper { overflow-x: auto; width: 100%; }
    table { min-width: 700px; }
    
    .sidebar-form { padding: 1rem; overflow-y: visible; }
    .sidebar-form .form-group { flex-direction: column; }
    .sidebar-form .form-group > div { flex: none !important; width: 100%; margin-bottom: 0.5rem; }
    
    .login-card { width: 90%; padding: 2rem; }
    
    .theme-toggle-container { position: static; justify-content: center; padding: 1rem 0; margin-top: 1rem; }
    .layout-a-sidebar .bottom-actions, .layout-b-sidebar .bottom-actions {
        flex-direction: column; gap: 1rem; padding: 1rem;
    }
    
    .logo-img { max-width: 150px; }
    .logo-container { padding: 1rem; }
    
    .module-title { font-size: 1.5rem; margin-bottom: 1rem; }
}

.btn-success { background-color: var(--success-color); color: #1a1b26; }

