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

body {
    font-family: 'Poppins', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f4f6f9;
    color: #333;
    min-height: 100vh;
}

/* ===== NAVBAR ===== */
.navbar {
    background: linear-gradient(90deg, #0f2a4a 0%, #1a3a6b 100%);
    color: #fff;
    padding: 0 24px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.navbar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}
.navbar-logo {
    height: 40px;
    width: auto;
    border-radius: 4px;
    background: #fff;
    padding: 2px;
}
.navbar-brand { font-size: 18px; font-weight: 700; }
.navbar-menu { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.navbar-menu a { color: #fff; text-decoration: none; }
.navbar-menu a:hover { text-decoration: underline; }
.navbar-user { opacity: 0.9; }
.btn-logout {
    background: #e74c3c;
    padding: 6px 14px;
    border-radius: 4px;
    font-size: 14px;
}
.usina-selector select {
    background: rgba(255,255,255,0.15);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 13px;
    font-family: inherit;
}
.usina-selector select option { color: #333; }

/* ===== DROPDOWN (menu de módulos) ===== */
.dropdown { position: relative; }
.dropdown-btn {
    background: rgba(255,255,255,0.15);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 6px;
    padding: 6px 12px;
    cursor: pointer;
    font-family: inherit;
    font-size: 14px;
}
.dropdown-btn:hover { background: rgba(255,255,255,0.25); }
.dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: #fff;
    min-width: 190px;
    border-radius: 8px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.2);
    z-index: 100;
    margin-top: 4px;
    overflow: hidden;
}
.dropdown-content a {
    display: block;
    padding: 11px 16px;
    color: #333;
    text-decoration: none;
    font-size: 14px;
}
.dropdown-content a:hover { background: #f0f2f5; color: #0f2a4a; }
.dropdown.open .dropdown-content { display: block; }

/* ===== CONTAINER ===== */
.container { max-width: 1100px; margin: 0 auto; padding: 24px; }
.page-subtitle { color: #666; margin-bottom: 20px; }

/* ===== CABEÇALHO DE PÁGINA ===== */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}
.page-header h1 { font-size: 24px; color: #0f2a4a; }

/* ===== BARRA DE FILTRO ===== */
.filter-bar {
    background: #fff;
    padding: 16px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    margin-bottom: 20px;
}
.filter-bar form {
    display: flex;
    gap: 16px;
    align-items: flex-end;
    flex-wrap: wrap;
}
.filter-bar .form-group { margin-bottom: 0; }

/* ===== PÁGINA DE BOAS-VINDAS ===== */
.welcome-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 70vh;
    padding: 20px;
}
.welcome-card {
    background: #fff;
    padding: 48px 40px;
    border-radius: 16px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.12);
    max-width: 480px;
    text-align: center;
}
.welcome-logo { margin-bottom: 20px; }
.welcome-logo-img {
    height: 110px;
    width: auto;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.welcome-title {
    font-size: 24px;
    font-weight: 700;
    color: #0f2a4a;
    margin-bottom: 12px;
}
.welcome-usina {
    font-size: 16px;
    color: #555;
    margin-bottom: 12px;
}
.welcome-usina strong { color: #1a3a6b; }
.welcome-msg {
    font-size: 14px;
    color: #888;
    line-height: 1.6;
}

/* ===== AUTH ===== */
.auth-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
    background: linear-gradient(135deg, #0f2a4a 0%, #1a3a6b 40%, #2a5a9e 100%);
}
.auth-card {
    background: #fff;
    padding: 40px 36px;
    border-radius: 16px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.3);
    width: 100%;
    max-width: 420px;
    text-align: center;
}
.auth-logo { margin-bottom: 16px; }
.auth-logo-img {
    height: 90px;
    width: auto;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.auth-title {
    font-size: 26px;
    font-weight: 700;
    color: #0f2a4a;
    margin-bottom: 4px;
}
.auth-subtitle {
    color: #888;
    margin-bottom: 28px;
    font-size: 14px;
}
.auth-footer {
    margin-top: 24px;
    color: rgba(255,255,255,0.7);
    font-size: 13px;
}
.auth-link { margin-top: 16px; font-size: 14px; }
.auth-link a { color: #1a3a6b; text-decoration: none; font-weight: 600; }
.auth-link a:hover { text-decoration: underline; }

/* ===== FORMULÁRIOS ===== */
.form-group { margin-bottom: 18px; text-align: left; }
.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    font-size: 14px;
    color: #333;
}
.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #1a3a6b;
    box-shadow: 0 0 0 3px rgba(26,58,107,0.12);
}
.form-group input:disabled,
.form-group select:disabled {
    background: #f1f3f5;
    color: #adb5bd;
    cursor: not-allowed;
}
.hint {
    display: block;
    margin-top: 5px;
    font-size: 12px;
    color: #999;
    font-style: italic;
}
.hint a { color: #1a3a6b; font-style: normal; font-weight: 600; }

/* ===== CARTÃO DE FORMULÁRIO ===== */
.form-card {
    background: #fff;
    padding: 28px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    max-width: 800px;
}
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

/* ===== CHECKBOX GRID ===== */
.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 8px;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 8px;
}
.checkbox-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500 !important;
    cursor: pointer;
    font-size: 14px;
}
.checkbox-item input { width: auto !important; }
.checkbox-item input:disabled + span,
.checkbox-item input:disabled { opacity: 0.5; cursor: not-allowed; }

/* ===== RADIO E CAMPOS INLINE ===== */
.radio-inline {
    display: inline-block;
    margin-right: 20px;
    font-weight: 500 !important;
    cursor: pointer;
}
.radio-inline input { width: auto !important; margin-right: 6px; }
.form-inline {
    display: flex;
    gap: 8px;
    align-items: center;
}
.form-inline input { flex: 1; }
.form-inline .btn { white-space: nowrap; }

/* ===== BOTÕES ===== */
.btn {
    display: inline-block;
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    font-family: inherit;
    transition: all 0.2s;
}
.btn-primary {
    background: linear-gradient(90deg, #1a3a6b 0%, #2a5a9e 100%);
    color: #fff;
}
.btn-primary:hover {
    background: linear-gradient(90deg, #2a5a9e 0%, #1a3a6b 100%);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(26,58,107,0.3);
}
.btn-secondary {
    background: #e9ecef;
    color: #333;
}
.btn-secondary:hover { background: #dee2e6; }
.btn-danger {
    background: #e74c3c;
    color: #fff;
}
.btn-danger:hover { background: #c0392b; }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-block { width: 100%; margin-top: 8px; }

/* ===== ALERTAS ===== */
.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 14px;
}
.alert-success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.alert-danger { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }
.alert-info { background: #d1ecf1; color: #0c5460; border: 1px solid #bee5eb; }

/* ===== CARDS ===== */
.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 28px;
}
.card {
    background: #fff;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    border-left: 4px solid #ccc;
}
.card h3 { font-size: 14px; color: #666; margin-bottom: 8px; }
.card-value { font-size: 24px; font-weight: 700; }
.card-receita { border-left-color: #27ae60; }
.card-despesa { border-left-color: #e74c3c; }
.card-resultado { border-left-color: #1a3a6b; }

/* ===== TABELA ===== */
.table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
.table th, .table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid #eee;
    font-size: 14px;
}
.table th { background: #f8f9fa; font-weight: 600; }
.table tr:hover { background: #f8f9fa; }
.text-receita { color: #27ae60; font-weight: 600; }
.text-despesa { color: #e74c3c; font-weight: 600; }
.empty-state { color: #888; font-style: italic; padding: 20px 0; }

/* ===== BADGES ===== */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}
.badge-receita { background: #d4edda; color: #155724; }
.badge-despesa { background: #f8d7da; color: #721c24; }
.badge-master { background: #0f2a4a; color: #fff; }