/* style.css - Sistema Financeiro Premium (Teal & Gold) */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;700&family=Outfit:wght@300;400;600;700&display=swap');

:root {
    /* DARK THEME PREMIUM */
    --bg-main: #042127; /* Teal mais profundo */
    --bg-card: rgba(5, 41, 48, 0.85);
    --bg-glass: rgba(5, 41, 48, 0.65);
    --primary: #BCA474; /* Ouro mais suave */
    --primary-hover: #D8BD8A;
    --accent: #8E9899;
    --text-main: #F4F7F7;
    --text-muted: #8E9899;
    --border: rgba(188, 164, 116, 0.25);
    --sidebar-width: 260px;
    --shadow-glass: 0 12px 40px 0 rgba(0, 0, 0, 0.35);
    --topbar-bg: rgba(4, 33, 39, 0.95);
    --card-shadow: 0 8px 24px rgba(0,0,0,0.15);
    
    /* Semantic Colors para Financeiro */
    --success: #10B981;
    --success-bg: rgba(16, 185, 129, 0.15);
    --danger: #EF4444;
    --danger-bg: rgba(239, 68, 68, 0.15);
    --warning: #F59E0B;
    --warning-bg: rgba(245, 158, 11, 0.15);
}

/* LIGHT THEME PREMIUM */
body.light-theme {
    --bg-main: #F4F7F7; /* Fundo cinza super claro/branco */
    --bg-card: #FFFFFF;
    --bg-glass: rgba(255, 255, 255, 0.85);
    --primary: #042127; /* Inverte o Dourado para o Teal Escuro como destaque primário, ou mantém um Ouro mais forte */
    --primary-hover: #05333D;
    --accent: #BCA474; /* Ouro passa a ser o acento/secundário */
    --text-main: #042127;
    --text-muted: #6B7280;
    --border: rgba(4, 33, 39, 0.1);
    --shadow-glass: 0 12px 30px 0 rgba(0, 0, 0, 0.05);
    --topbar-bg: rgba(244, 247, 247, 0.95);
    --card-shadow: 0 8px 24px rgba(0,0,0,0.03);
    
    --success-bg: rgba(16, 185, 129, 0.1);
    --danger-bg: rgba(239, 68, 68, 0.1);
    --warning-bg: rgba(245, 158, 11, 0.1);
}

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

body {
    font-family: 'DM Sans', sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    font-size: 14px;
}

h1, h2, h3, h4, h5, h6, .brand, .kpi-value {
    font-family: 'Outfit', sans-serif;
}

/* Utilitários Glassmorphism */
.glass-panel {
    background: var(--bg-glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: var(--shadow-glass);
    transition: all 0.3s ease;
}

/* ----- TELA DE LOGIN ----- */
.login-wrapper {
    display: flex;
    height: 100vh;
    width: 100vw;
    overflow: hidden;
}

.login-hero {
    flex: 1.2;
    background: url('https://images.unsplash.com/photo-1554224155-6726b3ff858f?ixlib=rb-4.0.3&auto=format&fit=crop&w=2000&q=80') center/cover no-repeat;
    position: relative;
    display: none;
}
@media (min-width: 992px) {
    .login-hero { display: block; }
}

.login-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(4, 33, 39, 0.9), rgba(5, 41, 48, 0.7));
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 80px;
    color: white;
}

.login-hero-title {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 20px;
    line-height: 1.1;
    color: var(--primary);
}

.login-hero-text {
    font-size: 1.25rem;
    opacity: 0.9;
    max-width: 500px;
    line-height: 1.6;
}

.login-form-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--bg-main);
    position: relative;
}

.login-box {
    width: 100%;
    max-width: 440px;
    padding: 48px;
}

.login-header {
    text-align: center;
    margin-bottom: 40px;
}
.login-header i {
    font-size: 3.5rem;
    color: var(--primary);
    margin-bottom: 16px;
    display: inline-block;
}
.login-header h2 {
    font-size: 2rem;
    color: var(--text-main);
    margin-bottom: 8px;
}
.login-header p {
    color: var(--text-muted);
}

/* Campos de Formulário */
.form-group {
    margin-bottom: 24px;
    position: relative;
}
.form-label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 0.5px;
}
.form-input {
    width: 100%;
    padding: 14px 16px 14px 44px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: rgba(0,0,0,0.2);
    color: var(--text-main);
    outline: none;
    transition: all 0.3s;
    font-size: 1rem;
}
.form-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(188, 164, 116, 0.15);
    background: rgba(0,0,0,0.3);
}
.input-icon {
    position: absolute;
    left: 16px;
    top: 38px;
    color: var(--primary);
    font-size: 1.25rem;
}

.btn-primary-custom {
    width: 100%;
    padding: 14px;
    background: var(--primary);
    color: var(--bg-main);
    border: none;
    border-radius: 12px;
    font-weight: 700;
    font-size: 1.1rem;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
    box-shadow: 0 4px 15px rgba(188, 164, 116, 0.2);
}
.btn-primary-custom:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(188, 164, 116, 0.4);
    background: var(--primary-hover);
}

/* ----- DASHBOARD ----- */
.layout-wrapper {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-card); /* Ajustado para var(--bg-card) para alternar temas */
    backdrop-filter: blur(20px);
    display: flex;
    flex-direction: column;
    padding: 24px 16px;
    z-index: 20;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1), padding 0.3s ease;
    overflow-x: hidden;
}

body.light-theme .sidebar {
    background: #042127; /* Mantém o menu escuro super premium, mesmo no tema claro */
    border-right: none;
}

/* --- SIDEBAR COLLAPSED --- */
body.sidebar-collapsed .sidebar {
    width: 84px;
    padding-left: 12px;
    padding-right: 12px;
}
body.sidebar-collapsed .brand span {
    display: none;
}
body.sidebar-collapsed .brand {
    justify-content: center;
    padding-bottom: 24px;
}
body.sidebar-collapsed .nav-item-text {
    opacity: 0;
    display: none;
}
body.sidebar-collapsed .nav-item {
    justify-content: center;
    padding: 14px 0;
    gap: 0;
}
body.sidebar-collapsed .nav-item i {
    font-size: 1.5rem;
    margin: 0;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.5rem;
    font-weight: 700;
    color: #FFF; /* Fixo branco por causa do fundo escuro */
    padding: 0 12px 32px 12px;
    white-space: nowrap;
}
.brand i { color: var(--accent); font-size: 1.8rem; }
body.light-theme .brand { color: #FFFFFF; }
body.light-theme .brand i { color: #BCA474; }

.nav-menu {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    border-radius: 12px;
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s;
    white-space: nowrap;
}
.nav-item-text {
    transition: opacity 0.2s ease;
}
.nav-item:hover, .nav-item.active {
    background: rgba(188, 164, 116, 0.15);
    color: #BCA474;
    font-weight: 600;
}
body.light-theme .nav-item {
    color: #8E9899; /* Text muted fixo pro menu escuro */
}
body.light-theme .nav-item:hover, body.light-theme .nav-item.active {
    background: rgba(188, 164, 116, 0.15);
    color: #BCA474; /* Dourado */
}
.nav-item i { font-size: 1.3rem; }

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.topbar {
    height: 70px;
    padding: 0 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border);
    background: var(--topbar-bg);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 10;
}

.search-bar {
    background: var(--bg-glass);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 8px 16px;
    display: flex;
    align-items: center;
    width: 320px;
}
.search-bar input {
    background: none; border: none; color: var(--text-main); outline: none; margin-left: 8px; width: 100%;
}
.search-bar input::placeholder {
    color: var(--text-muted);
}

.page-header {
    padding: 20px 20px 0 20px;
}
.page-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-main);
}

.dashboard-content {
    padding: 20px;
}

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

.kpi-card {
    padding: 12px 16px;
    position: relative;
    overflow: hidden;
}
.kpi-card::before {
    content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 4px; background: var(--primary);
}
.kpi-card.kpi-danger::before { background: var(--danger); }
.kpi-card.kpi-success::before { background: var(--success); }

.kpi-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}
.kpi-title {
    color: var(--text-muted);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.kpi-icon {
    font-size: 1.1rem;
    padding: 4px;
    border-radius: 6px;
    background: rgba(188, 164, 116, 0.1);
    color: var(--primary);
}
.kpi-danger .kpi-icon { background: var(--danger-bg); color: var(--danger); }
.kpi-success .kpi-icon { background: var(--success-bg); color: var(--success); }

.kpi-value {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-main);
    margin-top: 4px;
}

/* Data Tables Premium */
.table-container {
    padding: 16px;
}
.table-title {
    font-size: 1.1rem;
    margin-bottom: 16px;
    color: var(--text-main);
}
.table-custom {
    width: 100%;
    border-collapse: collapse;
}
.table-custom th {
    text-align: left;
    padding: 10px;
    border-bottom: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.table-custom td {
    padding: 10px;
    border-bottom: 1px solid var(--border);
    color: var(--text-main);
    font-size: 0.9rem;
}
.table-custom tr:hover td {
    background: rgba(4, 33, 39, 0.02);
}
body:not(.light-theme) .table-custom tr:hover td {
    background: rgba(255,255,255,0.02);
}

.theme-toggle-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.3s;
    display: flex;
    align-items: center;
}
.theme-toggle-btn:hover {
    color: var(--primary);
}

.status-badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
}
.badge-pending { background: var(--warning-bg); color: var(--warning); border: 1px solid rgba(245, 158, 11, 0.3); }
.badge-paid { background: var(--success-bg); color: var(--success); border: 1px solid rgba(16, 185, 129, 0.3); }

/* Design Delicado (Globais) */
.form-control, .form-select {
    font-size: 0.8rem !important;
    padding: 6px 10px !important;
    border-radius: 6px !important;
}
label {
    font-size: 0.7rem !important;
    margin-bottom: 2px !important;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
h4 {
    font-size: 1.05rem !important;
    font-weight: 600 !important;
}
h6 {
    font-size: 0.85rem !important;
    font-weight: 600 !important;
}
.btn {
    font-size: 0.85rem !important;
    padding: 8px 16px !important;
}
