/* Base reset for consistent rendering */
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; font-family: system-ui, -apple-system, Segoe UI, Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif; line-height: 1.5; color: #1f2937; background: #f8fafc; }

/* Utilities */
.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 1rem; }
.component-group { padding: 0 1rem; }
.table-container { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table-header { display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
.table-header-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.pagination-container { padding-bottom: 1rem; }

/* Responsive typography */
h1 { font-size: clamp(1.5rem, 1.2rem + 2vw, 2.25rem); margin: .25rem 0 .5rem; }
h2 { font-size: clamp(1.25rem, 1rem + 1.5vw, 1.75rem); }
h3 { font-size: clamp(1.125rem, .95rem + 1vw, 1.5rem); }
p { margin: .25rem 0 .75rem; }

/* Cards and papers */
.pa-3 { padding: 1rem !important; }

/* MudBlazor specific tweaks */
.mud-table { width: 100%; }
.mud-table-container { overflow: hidden; }
.mud-button { white-space: nowrap; }
.mud-grid { width: 100%; }

/* Forms spacing */
.form-inline-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.mb-1 { margin-bottom: .25rem !important; }
.mb-2 { margin-bottom: .5rem !important; }
.mb-3 { margin-bottom: .75rem !important; }
.mt-3 { margin-top: .75rem !important; }
.my-2 { margin-top: .5rem !important; margin-bottom: .5rem !important; }

/* Breakpoints */
@media (max-width: 600px) {
    .header-section { padding: .5rem 0; }
    .header-content p { font-size: .9rem; }
    .table-header { flex-direction: column; align-items: stretch; }
    .table-header-actions { width: 100%; }

    /* Stack grid controls */
    .mud-grid-item { padding-top: .5rem !important; padding-bottom: .5rem !important; }

    /* Compact buttons */
    .mud-button, .mud-icon-button { min-width: 36px; }

    /* Dialogs full width on mobile */
    .mud-dialog { margin: 0 !important; max-width: 100% !important; width: 100% !important; }
    .mud-dialog-content { padding: .75rem !important; }

    /* Tables: make cells readable */
    .mud-table-cell { padding: .5rem .5rem !important; }
    .mud-table { font-size: .9rem; }
}

@media (max-width: 900px) {
    .table-header-actions { gap: .5rem; }
    .mud-grid { row-gap: .5rem; }
    .mud-textfield, .mud-select, .mud-numeric-field { width: 100%; }
}

/* Large screens */
@media (min-width: 1200px) {
    .container { max-width: 1280px; }
}

/* Helpful responsive helpers for custom layouts */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
@media (max-width: 900px) {
    .grid-2, .grid-3 { grid-template-columns: 1fr; }
}

/* Ensure overflow-x for wide content in modals */
.mud-dialog-content { overflow-x: hidden; }

/* Accessibility & focus */
:focus-visible { outline: 2px solid #2563eb; outline-offset: 2px; }
html, body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

:root {
    --primary: #325bb3;
    --secondary: #6B7280;
    --success: #10B981;
    --error: #EF4444;
    --warning: #F59E0B;
    --info: #3B82F6;
    --bg-primary: #FFFFFF;
    --bg-secondary: #E5E7EB;
    --text-primary: #111827;
    --text-secondary: #6B7280;
    --border: #E5E7EB;
    --shadow: rgba(0, 0, 0, 0.1);
}

a, .btn-link {
    color: #006bb7;
}

.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

.content {
    padding-top: 1.1rem;
}

/* Header Section */
.header-section {
    background: var(--primary);
    color: white !important;
    padding: 2rem 1.5rem;
    border-radius: 12px;
    margin-bottom: 1rem;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    flex-wrap: wrap; /* permitir quebrar */
}

    /* Título */
    .header-content h1 {
        font-size: 2rem;
        font-weight: 700;
        margin: 0;
        display: flex;
        align-items: center;
        gap: 0.75rem;
        color: white !important;
    }

        .header-content h1 i {
            font-size: 2.4rem;
            color: white !important;
        }

    /* Descrição */
    .header-content p {
        font-size: 1rem;
        margin: 0;
        opacity: 0.95;
        color: white !important;
        line-height: 1.6;
        flex: 1;
        min-width: 260px;
    }

/* 🔥 Ajustes para mobile */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column; /* Empilha tudo */
        align-items: flex-start;
        gap: 1rem;
    }

        .header-content h1 {
            font-size: 1.6rem;
        }

            .header-content h1 i {
                font-size: 2rem;
            }

        .header-content p {
            font-size: 0.95rem;
        }

    .header-section {
        padding: 1.5rem 1rem;
    }
}

/* 🔥 Mobile pequeno (até 480px) */
@media (max-width: 480px) {
    .header-content h1 {
        font-size: 1.4rem;
    }

    .header-content p {
        font-size: 0.85rem;
    }
}

/* ========================================
   LOGIN SPLIT LAYOUT - CSS COMPLETO
   ======================================== */

/* Wrapper para centrar o cartão na página */
.auth-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    min-height: calc(100vh - 59px);
    background-color: #F9FAFB;
    padding: 20px;
    box-sizing: border-box;
    margin: 0;
}

/* Login Logo */
.login-logo {
    text-align: center;
    margin-bottom: 2rem;
}

.nav-logo {
    width: 80px;
    height: 80px;
    border-radius: 12px;
    object-fit: cover;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Login Split Layout - Layout Principal */
.login-split-layout {
    display: flex;
    flex-wrap: wrap;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.07);
    overflow: hidden;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    min-height: 600px;
}

/* Lado Esquerdo - Imagem */
.login-split-image {
    position: relative;
    min-height: 600px;
    flex: 1;
    overflow: hidden;
}

    .login-split-image img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
    }

/* Overlay sobre a imagem */
.login-split-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.9), rgba(59, 130, 246, 0.8));
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    text-align: center;
    color: white;
}

    .login-split-overlay h2 {
        font-size: 2rem;
        font-weight: 700;
        margin-bottom: 1rem;
        color: white;
    }

    .login-split-overlay p {
        font-size: 1.1rem;
        opacity: 0.95;
        max-width: 400px;
        line-height: 1.6;
        color: white;
    }

/* Lado Direito - Formul�rio */
.login-split-form {
    padding: 3rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    flex: 1;
    box-sizing: border-box;
}

    .login-split-form h3 {
        font-size: 1.75rem;
        font-weight: 700;
        margin-bottom: 0.5rem;
        color: #111827;
    }

    .login-split-form .subtitle {
        font-size: 1rem;
        color: #6B7280;
        margin-bottom: 2rem;
    }

/* Formul�rio */
.login-form {
    width: 100%;
}

/* Form Group */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-primary);
}

.form-input,
.form-select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.95rem;
    transition: all 0.2s;
    font-family: inherit;
}

    .form-input:focus,
    .form-select:focus {
        outline: none;
        border-color: var(--primary);
        box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
    }

/* Select customizado */
.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
}

/* Checkbox "Lembrar-me" */
.form-check {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
}

.form-checkbox {
    width: 18px;
    height: 18px;
    margin-right: 0.5rem;
    cursor: pointer;
    accent-color: var(--primary);
}

.form-check-label {
    cursor: pointer;
    user-select: none;
    font-size: 0.95rem;
    color: var(--text-primary);
}

/* Link "Esqueceu a senha?" */
.forgot-password-link {
    display: block;
    text-align: right;
    margin-top: -0.5rem;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    color: var(--primary);
    text-decoration: none;
}

    .forgot-password-link:hover {
        text-decoration: underline;
    }

/* Bot�o de Login */
.btn-login {
    width: 100%;
    padding: 0.875rem;
    background-color: var(--primary);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

    .btn-login:hover {
        background-color: #274a94;
    }

    .btn-login:active {
        transform: scale(0.98);
    }

    .btn-login:disabled {
        background-color: #9CA3AF;
        cursor: not-allowed;
        opacity: 0.6;
    }

/* Spinner de Loading */
.spinner {
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Mensagem de Erro */
.alert-error {
    background-color: #FEE2E2;
    border: 1px solid #FCA5A5;
    color: #991B1B;
    padding: 0.875rem 1rem;
    border-radius: 6px;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Link "Criar conta" */
.signup-link {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.95rem;
    color: #6B7280;
}

    .signup-link a {
        color: #325bb3;
        text-decoration: none;
        font-weight: 600;
    }

        .signup-link a:hover {
            text-decoration: underline;
        }

/* ===== BREADCRUMBS ===== */
.breadcrumbs-container {
    background: transparent;
    padding: 0;
    margin-bottom: 1rem;
    display: flex;
    justify-content: flex-start;
    width: 100%;
}

.breadcrumbs {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0.5rem 0;
    font-size: 0.8rem;
}

.breadcrumb-item {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.8rem;
    transition: all 0.3s ease;
}

.breadcrumb-item:hover {
    color: var(--primary);
    transform: translateX(2px);
}

.breadcrumb-item.active {
    color: var(--primary);
    font-weight: 500;
    cursor: default;
}

.breadcrumb-item.active:hover {
    transform: none;
}

.breadcrumb-item i {
    font-size: 0.9rem;
}

.breadcrumb-separator {
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    opacity: 0.5;
}

/* Responsive */
@media (max-width: 768px) {
    .breadcrumbs {
        padding: 0.5rem 0;
        gap: 0.25rem;
    }

    .breadcrumb-item {
        font-size: 0.75rem;
    }

    .breadcrumb-item span {
        display: none;
    }

    .breadcrumb-item.active span {
        display: inline;
    }

    .breadcrumb-separator i {
        font-size: 0.7rem;
    }

    .breadcrumb-item i {
        font-size: 0.85rem;
    }
}

@media (max-width: 480px) {
    .breadcrumbs {
        padding: 0.5rem 0;
        gap: 0.2rem;
    }

    .breadcrumb-item {
        font-size: 0.7rem;
    }

    .breadcrumb-item i {
        font-size: 0.8rem;
    }
}

/* ===== STEPPER PROGRESS ===== */
.stepper-progress {
    margin-bottom: 2.5rem;
}

.stepper-progress-bar {
    height: 4px;
    background-color: var(--border);
    border-radius: 4px;
    margin-bottom: 1.5rem;
    overflow: hidden;
}

.stepper-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
    border-radius: 4px;
    transition: width 0.4s ease;
    width: 0%;
}

.stepper-steps {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
}

.stepper-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.stepper-step-circle {
    position: relative;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background-color: var(--surface-light);
    border: 2px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.5rem;
    transition: all 0.3s ease;
}

    .stepper-step-circle i {
        font-size: 1.25rem;
        color: var(--text-secondary);
        transition: all 0.3s ease;
    }

.stepper-step-number {
    display: none;
    font-weight: 600;
    color: var(--text-secondary);
}

.stepper-step-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    text-align: center;
    font-weight: 500;
    transition: all 0.3s ease;
}

/* Active Step */
.stepper-step.active .stepper-step-circle {
    background-color: var(--primary);
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(50, 91, 179, 0.15);
}

    .stepper-step.active .stepper-step-circle i {
        color: white !important;
    }

.stepper-step.active .stepper-step-label {
    color: var(--primary);
    font-weight: 600;
}

/* Completed Step */
.stepper-step.completed .stepper-step-circle {
    background-color: var(--success);
    border-color: var(--success);
}

    .stepper-step.completed .stepper-step-circle i {
        display: none;
    }

    .stepper-step.completed .stepper-step-circle::after {
        content: "✓";
        color: var(--white);
        font-size: 1.5rem;
        font-weight: bold;
    }

.stepper-step.completed .stepper-step-label {
    color: var(--success);
}

/* Inactive Step */
.stepper-step:not(.active):not(.completed) .stepper-step-circle i {
    color: #000;
}

/* ===== STEPS CONTAINER ===== */
.steps-container {
    position: relative;
    min-height: 400px;
    margin-bottom: 2rem;
}

.step-content {
    display: none;
    animation: fadeIn 0.4s ease;
}

    .step-content.active {
        display: block;
    }

/* Finance Toggle */
.finance-toggle {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background-color: var(--surface-light);
    border-radius: 8px;
}

/* ===== FINANCE SUMMARY ===== */
.finance-summary {
    background-color: var(--surface-light);
    padding: 1rem;
    border-radius: 8px;
    margin-top: 1rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.finance-summary-item {
    display: flex;
    flex-direction: column;
}

.finance-summary-label {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
}

.finance-summary-value {
    margin: 0.25rem 0 0;
    color: var(--text-primary);
    font-size: 1.1rem;
    font-weight: 600;
}

    .finance-summary-value.highlight {
        color: var(--primary);
    }

/* Finance Placeholder */
.finance-placeholder {
    padding: 2rem;
    text-align: center;
    background-color: var(--surface-light);
    border-radius: 8px;
}

    .finance-placeholder i {
        font-size: 3rem;
        color: var(--primary);
        margin-bottom: 1rem;
        display: block;
    }

    .finance-placeholder h4 {
        margin: 0 0 0.5rem;
        color: var(--text-primary);
        font-size: 1.25rem;
    }

    .finance-placeholder p {
        margin: 0;
        color: var(--text-secondary);
        line-height: 1.6;
    }

/* ===== CONFIRMATION SUMMARY ===== */
.confirmation-summary {
    background-color: var(--surface-light);
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.summary-title {
    margin: 0 0 1rem;
    color: var(--primary);
    font-size: 1.25rem;
}

.summary-section {
    margin-bottom: 1rem;
}

    .summary-section:last-child {
        margin-bottom: 0;
    }

.summary-label {
    color: var(--text-primary);
    font-weight: 600;
    display: block;
    margin-bottom: 0.25rem;
}

.summary-text {
    margin: 0.25rem 0 0;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Tablets (768px - 1024px) */
@media (max-width: 1024px) {
    .login-split-form {
        padding: 2rem;
    }
}

/* Mobile Landscape (481px - 768px) */
@media (max-width: 768px) {
    .login-split-form {
        padding: 2rem 1.5rem;
    }

    .stepper-steps {
        gap: 0.25rem;
    }

    .stepper-step-label {
        font-size: 0.75rem;
    }

    .stepper-step-circle {
        width: 42px;
        height: 42px;
    }

        .stepper-step-circle i {
            font-size: 1.1rem;
        }

    .form-row {
        grid-template-columns: 1fr;
    }
}

/* Mobile Portrait (até 480px) */
@media (max-width: 480px) {
    .auth-wrapper {
        padding: 10px;
        align-items: flex-start;
        padding-top: 20px;
    }

    .login-split-form {
        padding: 1.5rem 1rem;
    }

    .login-logo {
        margin-bottom: 1.5rem;
    }

    .nav-logo {
        width: 60px;
        height: 60px;
    }

    .login-logo h2 {
        font-size: 1.25rem;
    }

    .login-logo p {
        font-size: 0.9rem;
    }

    /* Stepper simplificado em mobile */
    .stepper-progress {
        margin-bottom: 2rem;
    }

    .stepper-step-label {
        font-size: 0.7rem;
        max-width: 60px;
        word-wrap: break-word;
    }

    .stepper-step-circle {
        width: 36px;
        height: 36px;
    }

        .stepper-step-circle i {
            font-size: 1rem;
        }

    /* Form adjustments */
    .steps-container {
        min-height: 350px;
    }

    .form-input,
    .form-select,
    textarea.form-input {
        font-size: 16px; /* Previne zoom no iOS */
        padding: 0.7rem 0.875rem;
    }

    .input-group .form-input,
    .input-group textarea {
        padding-left: 2.5rem;
    }

    .input-icon {
        left: 0.875rem;
        font-size: 0.95rem;
    }

    .form-label {
        font-size: 0.9rem;
    }

    .form-group {
        margin-bottom: 1.25rem;
    }

    /* Finance summary em coluna única */
    .finance-summary {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    /* Buttons */
    .btn {
        padding: 0.8rem 1rem;
        font-size: 0.95rem;
    }

    .stepper-navigation {
        gap: 0.5rem;
    }

    /* Confirmation summary */
    .confirmation-summary {
        padding: 1rem;
    }

    .summary-title {
        font-size: 1.1rem;
    }

    .form-check-label {
        font-size: 0.875rem;
    }

    .form-checkbox {
        width: 16px;
        height: 16px;
    }
}

/* Mobile muito pequeno (até 360px) */
@media (max-width: 360px) {
    .login-split-form {
        padding: 1rem 0.75rem;
    }

    .nav-logo {
        width: 50px;
        height: 50px;
    }

    .stepper-step-circle {
        width: 32px;
        height: 32px;
    }

        .stepper-step-circle i {
            font-size: 0.9rem;
            color: white;
        }

    .stepper-step-label {
        font-size: 0.65rem;
        max-width: 50px;
    }

    .form-input,
    .form-select,
    textarea.form-input {
        padding: 0.65rem 0.75rem;
    }

    .input-group .form-input,
    .input-group textarea {
        padding-left: 2.25rem;
    }

    .input-icon {
        left: 0.75rem;
        font-size: 0.9rem;
    }
}

/* Touch-friendly enhancements */
@media (hover: none) and (pointer: coarse) {
    .form-checkbox,
    .btn,
    .stepper-step {
        min-height: 44px;
    }

    .form-check {
        padding: 0.5rem 0;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Footer */
.login-footer {
    text-align: center;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #E5E7EB;
    font-size: 0.85rem;
    color: #9CA3AF;
}

/* Responsividade para Tablets e Mobile */
@media (max-width: 968px) {
    .login-split-layout {
        flex-direction: column;
        max-width: 600px;
        min-height: auto;
    }

    .login-split-image {
        min-height: 200px;
        max-height: 250px;
        order: -1;
        flex: none;
        width: 100%;
    }

    .login-split-form {
        padding: 2rem;
        flex: none;
        width: 100%;
    }

    .login-split-overlay h2 {
        font-size: 1.5rem;
    }

    .login-split-overlay p {
        font-size: 0.95rem;
    }

    .login-split-overlay i {
        font-size: 3rem !important;
    }
}

@media (max-width: 640px) {
    .auth-wrapper {
        padding: 10px;
    }

    .login-split-layout {
        max-width: 100%;
    }

    .login-split-form {
        padding: 1.5rem;
    }

        .login-split-form h3 {
            font-size: 1.5rem;
        }

    .login-split-image {
        min-height: 180px;
        max-height: 200px;
    }

    .login-split-overlay {
        padding: 1.5rem;
    }

    .login-split-overlay h2 {
        font-size: 1.25rem;
    }

    .login-split-overlay p {
        font-size: 0.85rem;
    }

    .login-split-overlay i {
        font-size: 2.5rem !important;
    }
}

@media (max-width: 480px) {
    .login-split-form {
        padding: 1rem;
    }

    .login-split-image {
        min-height: 150px;
        max-height: 180px;
    }

    .login-split-overlay {
        padding: 1rem;
    }

    .login-split-overlay h2 {
        font-size: 1.1rem;
        margin-bottom: 0.5rem;
    }

    .login-split-overlay p {
        font-size: 0.8rem;
    }

    .login-split-overlay i {
        font-size: 2rem !important;
        margin-bottom: 0.5rem !important;
    }
}

.nav-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    background: #ffffff;
}

/* Header */
.nav-header {
    padding: 24px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    border-bottom: 1px solid #f0f0f0;
}

.nav-logo {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    object-fit: cover;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.nav-brand h3 {
    margin: 0;
    font-size: 14px;
    font-weight: 700;
    color: #325bb3;
    letter-spacing: -0.02em;
}

.nav-brand p {
    margin: 0;
    font-size: 12px;
    color: #325bb3;
    font-weight: 400;
}

.mud-nav-custom {
    flex: 1;
    overflow-y: auto;
    padding: 16px 0;
}

.nav-footer {
    padding: 16px 20px;
    border-top: 1px solid #f0f0f0;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px;
    border-radius: 10px;
    transition: background 0.2s ease;
    cursor: pointer;
}

    .user-info:hover {
        background-color: #f5f5f5;
    }

.user-details {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.user-name {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
}

.user-role {
    font-size: 12px;
    color: #64748b;
}

.mud-nav-custom::-webkit-scrollbar {
    width: 5px;
}

.mud-nav-custom::-webkit-scrollbar-track {
    background: transparent;
}

.mud-nav-custom::-webkit-scrollbar-thumb {
    background: #e0e0e0;
    border-radius: 3px;
}

    .mud-nav-custom::-webkit-scrollbar-thumb:hover {
        background: #d0d0d0;
    }

.section-header-icon {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 2rem;
    margin-bottom: 1rem;
    font-size: 1.35rem;
    font-weight: 700;
    color: #325bb3;
    border-left: 4px solid #325bb3;
    padding-left: 12px;
}

    .section-header-icon i {
        font-size: 1.5rem;
        color: #325bb3;
    }

/* --- Responsividade geral: permite cards lado a lado --- */
.cards-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

/* --- Card Moderno --- */
.modern-card {
    background: white;
    border-radius: 20px;
    padding: 24px;
    width: 100%;
    max-width: 450px;
    box-shadow: 0 20px 20px rgba(0, 0, 0, 0.15);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    position: relative;
    overflow: hidden;
}

    /* Linha superior ao hover */
    .modern-card::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 4px;
        background: linear-gradient(90deg, #4a6cf7 0%, #764ba2 100%);
        transform: scaleX(0);
        transition: transform 0.4s ease;
    }

    .modern-card:hover::before {
        transform: scaleX(1);
    }

    .modern-card:hover {
        box-shadow: 0 30px 80px rgba(0, 0, 0, 0.2);
    }

/* --- Ícone Container --- */
.icon-container {
    width: 64px;
    height: 64px;
    background: #325bb3;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.3s ease;
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
}

.modern-card:hover .icon-container {
    transform: rotate(5deg) scale(1.05);
    box-shadow: 0 12px 30px rgba(102, 126, 234, 0.4);
}

.icon-container i {
    font-size: 32px;
    color: white;
    transition: all 0.3s ease;
}

.modern-card:hover .icon-container i {
    transform: scale(1.1);
}
/* --- Profile Card --- */
.profile-card {
    max-width: 100%;
    margin-bottom: 1.5rem;
    padding: 1.25rem;
}

.profile-card-content {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    flex-wrap: wrap;
}

.profile-image-container {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid var(--primary);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
    flex-shrink: 0;
}

.profile-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-image-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--primary) 0%, #4c7cd8 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.profile-image-edit-btn {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    border: 2px solid white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

    .profile-image-edit-btn:hover {
        background: #264a8f;
        transform: scale(1.08);
    }

    .profile-image-edit-btn i {
        font-size: 0.85rem;
    }

.profile-info {
    flex: 1;
    min-width: 0;
}

.profile-name {
    margin: 0 0 0.5rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    word-wrap: break-word;
}

.profile-details {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.profile-detail-item {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    word-break: break-word;
}

    .profile-detail-item i {
        flex-shrink: 0;
    }

.profile-date {
    font-size: 0.875rem;
}

.modern-expansion-panels {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border-radius: 12px;
    overflow: hidden;
}

.expansion-panel-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

    .expansion-panel-title i {
        font-size: 1.25rem;
        color: var(--primary);
    }

@media (max-width: 640px) {
    .profile-card {
        padding: 1rem;
    }

    .profile-card-content {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 1rem;
    }

    .profile-image-container {
        width: 90px;
        height: 90px;
    }

    .profile-info {
        width: 100%;
    }

    .profile-name {
        font-size: 1.35rem;
    }

    .profile-details {
        align-items: center;
    }

    .profile-detail-item {
        font-size: 0.9rem;
        justify-content: center;
    }
}

/* --- Conteúdo --- */
.card-content {
    flex: 1;
    margin-left: 20px;
}

.card-title {
    color: #1e293b;
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: -0.02em;
    transition: color 0.3s ease;
}

.modern-card:hover .card-title {
    color: #667eea;
}

.card-description {
    color: #64748b;
    font-size: 14px;
    line-height: 1.6;
    margin: 0;
}

/* Badge */
.card-badge {
    display: inline-block;
    background: linear-gradient(135deg, #667eea15 0%, #764ba215 100%);
    color: #667eea;
    padding: 4px 12px;
    border-radius: 5px;
    font-size: 12px;
    font-weight: 600;
    margin-top: 12px;
    transition: all 0.3s ease;
}

.modern-card:hover .card-badge {
    background: #325bb3;
    color: white;
    transform: translateX(4px);
}

/* --- RESPONSIVIDADE AVANÇADA --- */

/* Tablets e ecrãs médios */
@media (max-width: 768px) {
    .modern-card {
        max-width: 100%;
        padding: 20px;
        flex-direction: row;
    }

    .card-title {
        font-size: 18px;
    }

    .card-description {
        font-size: 13px;
    }

    .icon-container {
        width: 54px;
        height: 54px;
        border-radius: 14px;
    }

        .icon-container i {
            font-size: 26px;
        }
}

/* Telemóveis pequenos */
@media (max-width: 576px) {

    .modern-card {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 18px;
    }

    .icon-container {
        margin-bottom: 16px;
        width: 48px;
        height: 48px;
    }

        .icon-container i {
            font-size: 22px;
        }

    .card-content {
        margin-left: 0;
    }

    .card-title {
        font-size: 17px;
    }

    .card-description {
        font-size: 13px;
    }

    .card-badge {
        font-size: 16px;
        margin-top: 5px;
    }
}

/* Telemóveis extra pequenos */
@media (max-width: 400px) {
    .modern-card {
        padding: 14px;
        border-radius: 16px;
    }

    .icon-container {
        width: 40px;
        height: 40px;
        border-radius: 10px;
    }

        .icon-container i {
            font-size: 18px;
        }
}


/* ===========================
   RECIPE CALCULATOR STYLES
   =========================== */

.recipe-calculator {
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    padding: 1.5rem;
    position: relative;
    z-index: 2;
    margin-top: -1rem;
}

.header-actions {
    display: flex;
    justify-content: flex-end; /* posiciona no canto direito */
    align-items: center;
    margin-top: 5px;
    gap: 8px; /* espa�o entre bot�o e spinner */
}

    .header-actions .loading-indicator {
        width: 20px;
        height: 20px;
    }

        .header-actions .loading-indicator .spinner {
            width: 100%;
            height: 100%;
            border: 2px solid #cbd5e1; /* cor da borda clara */
            border-top: 2px solid #4f46e5; /* cor do spinner */
            border-radius: 50%;
            animation: spin 0.8s linear infinite;
        }

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}


/* 1. Page Header */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 2rem;
    border-bottom: 2px solid #f0f0f0;
    margin-bottom: 2rem;
    position: relative;
}

.page-header-content {
    flex: 1;
}

.page-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
    margin: 0 0 0.5rem 0;
}

.page-subtitle {
    font-size: 1rem;
    color: #6b7280;
    margin: 0;
}

.btn-refresh {
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 12px;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.2);
}

    .btn-refresh:hover {
        background: #3730a3;
        transform: rotate(180deg);
        box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
    }

.loading-indicator {
    position: absolute;
    top: 50%;
    right: 70px;
    transform: translateY(-50%);
}

.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #f0f0f0;
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* 2. Recipe Selector */
.recipe-selector-section {
    margin-bottom: 2rem;
}

.section-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 1rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

    .section-title i {
        color: var(--primary);
    }

.recipe-selector-mobile {
    display: none;
}

.recipe-selector {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    padding: 0.5rem 0;
    scroll-behavior: smooth;
}

    .recipe-selector::-webkit-scrollbar {
        height: 6px;
    }

    .recipe-selector::-webkit-scrollbar-track {
        background: #f0f0f0;
        border-radius: 3px;
    }

    .recipe-selector::-webkit-scrollbar-thumb {
        background: var(--primary);
        border-radius: 3px;
    }

.recipe-item {
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 1rem;
    min-width: 280px;
    display: flex;
    align-items: center;
    gap: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

    .recipe-item:hover {
        border-color: var(--primary);
        box-shadow: 0 4px 12px rgba(79, 70, 229, 0.15);
        transform: translateY(-2px);
    }

    .recipe-item.active {
        border-color: var(--primary);
        background: linear-gradient(135deg, #f3f4ff 0%, #ffffff 100%);
        box-shadow: 0 4px 12px rgba(79, 70, 229, 0.2);
    }

.recipe-item-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary) 0%, #6366f1 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    color: white;
    flex-shrink: 0;
}

.recipe-item-info {
    flex: 1;
}

    .recipe-item-info h4 {
        margin: 0 0 0.25rem 0;
        font-size: 1rem;
        font-weight: 600;
        color: var(--text-primary);
    }

.recipe-total {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary);
}

.recipe-check {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: #e5e7eb;
    transition: all 0.3s ease;
}

.recipe-item.active .recipe-check {
    color: var(--primary);
}

/* 3. Recipe Ingredients Panel */
.recipe-ingredients-panel {
    background: #f9fafb;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.ingredients-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.ingredient-item {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    transition: all 0.3s ease;
}

    .ingredient-item:hover {
        border-color: var(--primary);
        box-shadow: 0 2px 8px rgba(79, 70, 229, 0.1);
    }

.ingredient-name {
    flex: 2;
    font-weight: 500;
    color: var(--text-primary);
}

.ingredient-quantity {
    flex: 1;
    text-align: center;
    color: #6b7280;
    font-size: 0.95rem;
}

.ingredient-value {
    flex: 1;
    text-align: right;
    font-weight: 600;
    color: var(--primary);
    font-size: 1rem;
}

/* 4. Expense Selector */
.expense-selector-section {
    margin-bottom: 2rem;
}

.expense-selector {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    max-height: 320px;
    overflow-y: auto;
    padding-right: 0.5rem;
}

    .expense-selector::-webkit-scrollbar {
        width: 6px;
    }

    .expense-selector::-webkit-scrollbar-track {
        background: #f0f0f0;
        border-radius: 3px;
    }

    .expense-selector::-webkit-scrollbar-thumb {
        background: var(--primary);
        border-radius: 3px;
    }

        .expense-selector::-webkit-scrollbar-thumb:hover {
            background: var(--primary-dark);
        }

.expense-item {
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 1rem;
    transition: all 0.3s ease;
}

    .expense-item:hover {
        border-color: var(--primary);
        box-shadow: 0 2px 8px rgba(79, 70, 229, 0.1);
    }

.expense-checkbox {
    display: none;
}

.expense-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    width:100%;
    user-select: none;
}

.expense-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
}

.expense-name {
    font-weight: 500;
    color: var(--text-primary);
}

.expense-value {
    font-weight: 700;
    color: var(--primary);
    font-size: 1rem;
}

/* 5. Calculation Form */
.calculation-form {
    background: #f9fafb;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.form-row-calc {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.form-group-calc {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-label-calc {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.form-input-calc {
    padding: 0.75rem 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

    .form-input-calc:focus {
        outline: none;
        border-color: var(--primary);
        box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
    }

.btn-calculate {
    width: 100%;
    background: linear-gradient(135deg, var(--primary) 0%, #6366f1 100%);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 1rem 2rem;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

    .btn-calculate:hover {
        transform: translateY(-2px);
        box-shadow: 0 6px 16px rgba(79, 70, 229, 0.4);
    }

    .btn-calculate:active {
        transform: translateY(0);
    }

/* 6. Results Panel */
.results-panel {
    margin-bottom: 2rem;
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(240px, 1fr));
    gap: 1.5rem;
}

.result-card {
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    gap: 1rem;
    transition: all 0.3s ease;
}

    .result-card:hover {
        transform: translateY(-4px);
        box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
    }

.card-expenses {
    border-left: 4px solid #ef4444;
}

    .card-expenses:hover {
        border-left-color: #dc2626;
        box-shadow: 0 8px 20px rgba(239, 68, 68, 0.2);
    }

.card-ingredients {
    border-left: 4px solid #f59e0b;
}

    .card-ingredients:hover {
        border-left-color: #d97706;
        box-shadow: 0 8px 20px rgba(245, 158, 11, 0.2);
    }

.card-yield {
    border-left: 4px solid #8b5cf6;
}

    .card-yield:hover {
        border-left-color: #7c3aed;
        box-shadow: 0 8px 20px rgba(139, 92, 246, 0.2);
    }

.card-profit {
    border-left: 4px solid #10b981;
}

    .card-profit:hover {
        border-left-color: #059669;
        box-shadow: 0 8px 20px rgba(16, 185, 129, 0.2);
    }

.card-price {
    border-left: 4px solid #3b82f6;
}

    .card-price:hover {
        border-left-color: #2563eb;
        box-shadow: 0 8px 20px rgba(59, 130, 246, 0.2);
    }

.result-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    flex-shrink: 0;
}

.card-expenses .result-icon {
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    color: #ef4444;
}

.card-ingredients .result-icon {
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    color: #f59e0b;
}

.card-yield .result-icon {
    background: linear-gradient(135deg, #faf5ff 0%, #f3e8ff 100%);
    color: #8b5cf6;
}

.card-profit .result-icon {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    color: #10b981;
}

.card-price .result-icon {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    color: #3b82f6;
}

.result-content {
    flex: 1;
}

.result-label {
    margin: 0 0 0.5rem 0;
    font-size: 0.9rem;
    font-weight: 500;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.result-value {
    margin: 0;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
}

.result-sublabel {
    margin: 0.5rem 0 0 0;
    font-size: 0.9rem;
    color: #6b7280;
}

    .result-sublabel span {
        font-weight: 600;
        color: var(--text-primary);
    }

/* 7. Create Product Button */
.btn-create-product {
    width: 100%;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: none;
    border-radius: 16px;
    padding: 1.25rem 2rem;
    font-size: 1.25rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

    .btn-create-product:hover {
        transform: translateY(-3px);
        box-shadow: 0 8px 20px rgba(16, 185, 129, 0.4);
    }

    .btn-create-product:active {
        transform: translateY(-1px);
    }

/* Responsive Design */
@media (max-width: 1024px) {
    .results-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .recipe-calculator {
        padding: 1.5rem;
        margin-top: 1rem;
    }

    .page-title {
        font-size: 1.5rem;
    }

    .page-header {
        padding-bottom: 1.5rem;
        margin-bottom: 1.5rem;
    }

    .form-row-calc {
        grid-template-columns: 1fr;
    }

    .expense-selector {
        grid-template-columns: 1fr;
        max-height: 280px;
    }

    .results-grid {
        grid-template-columns: 1fr;
    }

    .results-panel {
        background: transparent;
        border-radius: 0;
        padding: 0;
    }

    .result-card {
        padding: 0.75rem 0.85rem;
        align-items: center;
        gap: 0.65rem;
    }

    .result-icon {
        width: 48px;
        height: 48px;
        font-size: 1.35rem;
    }

    .result-value {
        font-size: 1.25rem;
    }

    .result-label,
    .result-sublabel {
        font-size: 0.8rem;
    }

    .recipe-item {
        min-width: 240px;
    }

    .ingredient-item {
        flex-direction: column;
        align-items: flex-start;
        padding: 0.85rem;
        gap: 0.4rem;
    }

    .ingredient-quantity,
    .ingredient-value {
        text-align: left;
        font-size: 0.9rem;
    }

    .ingredients-list {
        max-height: 240px;
        overflow-y: auto;
        padding-right: 0.5rem;
        gap: 0.5rem;
    }

    .recipe-ingredients-panel {
        background: transparent;
        padding: 0;
        margin-bottom: 1.5rem;
    }

        .ingredients-list::-webkit-scrollbar {
            width: 6px;
        }

        .ingredients-list::-webkit-scrollbar-track {
            background: #f0f0f0;
            border-radius: 3px;
        }

        .ingredients-list::-webkit-scrollbar-thumb {
            background: var(--primary);
            border-radius: 3px;
        }

    .section-title {
        font-size: 1.1rem;
    }
}

@media (max-width: 480px) {
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .btn-refresh {
        position: absolute;
        top: 0;
        right: 0;
    }

    .loading-indicator {
        right: 60px;
    }

    .recipe-item {
        min-width: 200px;
    }
}


.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-primary);
}

.form-input,
.form-textarea,
.form-select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.95rem;
    transition: all 0.2s;
    font-family: inherit;
}

    .form-input:focus,
    .form-textarea:focus,
    .form-select:focus {
        outline: none;
        border-color: var(--primary);
        box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
    }

    .form-input.success {
        border-color: var(--success);
    }

    .form-input.error {
        border-color: var(--error);
    }

    .form-input:disabled,
    .form-textarea:disabled,
    .form-select:disabled {
        background-color: var(--bg-secondary);
        cursor: not-allowed;
        opacity: 0.6;
    }



.form-textarea {
    resize: vertical;
    min-height: 100px;
}

.form-hint {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

    .form-hint.success {
        color: var(--success);
    }

    .form-hint.error {
        color: var(--error);
    }

    .form-hint i {
        margin-right: 0.25rem;
    }

/* Badge */
.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.875rem;
    font-weight: 600;
    margin: 0.25rem;
    background-color: var(--bg-secondary);
    color: var(--text-primary);
}

.badge-primary {
    background-color: var(--primary);
    color: white;
}

.badge-secondary {
  background-color: #7c4dff;
  color: white;
}

.badge-success {
    background-color: var(--success);
    color: white;
}

.badge-warning {
    background-color: var(--warning);
    color: white;
}

.badge-neutral {
    background-color: var(--secondary); /* cinza neutro */
    color: white;
}

.badge-error {
    background-color: var(--error);
    color: white;
}

.badge-danger {
    background-color: var(--success);
    color: white;
}

.badge-info {
    background-color: var(--info);
    color: white;
}

/* Input Group */
.input-group {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    pointer-events: none;
    z-index: 10;
}

.input-icon-right {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
}

.input-group .form-input {
    padding-left: 2.75rem;
}

.input-group .input-icon-right ~ .form-input {
    padding-right: 2.75rem;
}

.input-group .form-select {
    padding-left: 2.75rem;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.75rem;
}


/* Checkbox & Radio */
.form-check {
    display: flex;
    align-items: center;
    margin-bottom: 0.75rem;
}

.form-checkbox,
.form-radio {
    width: 18px;
    height: 18px;
    margin-right: 0.5rem;
    cursor: pointer;
    accent-color: var(--primary);
}

.form-check-label {
    cursor: pointer;
    user-select: none;
}

.form-checkbox:disabled,
.form-radio:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

/* Switch / Toggle */
.form-switch {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
}

.switch-input {
    display: none;
}

.switch-label {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 24px;
    cursor: pointer;
    margin-right: 0.75rem;
}

.switch-slider {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 24px;
    transition: 0.3s;
}

    .switch-slider::before {
        content: '';
        position: absolute;
        height: 18px;
        width: 18px;
        left: 3px;
        bottom: 3px;
        background-color: white;
        border-radius: 50%;
        transition: 0.3s;
    }

.switch-input:checked + .switch-label .switch-slider {
    background-color: var(--primary);
}

    .switch-input:checked + .switch-label .switch-slider::before {
        transform: translateX(24px);
    }

.switch-input:disabled + .switch-label {
    cursor: not-allowed;
    opacity: 0.5;
}

.switch-text {
    color: var(--text-primary);
}

/* Table Header */
.table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-bottom: none;
    border-radius: 12px 12px 0 0;
}

    .table-header h4 {
        margin: 0;
        font-size: 1.2rem;
        color: var(--text-primary);
        display: flex;
        align-items: center;
        gap: 0.5rem;
    }

.table-header-actions {
    display: flex;
    gap: 0.5rem;
}

/* Expenses Table */
.table-expenses {
    font-size: 0.9rem;
}

.table-expense-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

    .table-expense-info strong {
        color: var(--text-primary);
        font-size: 0.95rem;
    }

    .table-expense-info small {
        color: var(--text-secondary);
        font-size: 0.8rem;
    }

.expense-amount {
    font-size: 1rem;
    font-weight: 600;
}

    .expense-amount strong {
        color: var(--error);
    }

.table-expenses tbody tr:hover {
    background: var(--bg-secondary);
}

.table-expenses tfoot tr {
    background: var(--bg-secondary);
    font-weight: 600;
}

.table-expenses tfoot td {
    padding: 1rem;
    border-top: 2px solid var(--border);
}

.table-expenses .badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

    .table-expenses .badge i {
        font-size: 0.85rem;
    }

/* Responsive Tables */
@media (max-width: 1024px) {
    .table-container {
        overflow-x: auto;
    }

    .table-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }

    .table-header-actions {
        width: 100%;
        justify-content: flex-start;
    }
}

/* Table */

.table-container {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
}

    .table thead {
        background-color: var(--bg-secondary);
    }

    .table th,
    .table td {
        padding: 1rem;
        text-align: left;
    }

    .table th {
        font-weight: 600;
        color: var(--text-primary);
    }

    .table tbody tr {
        border-bottom: 1px solid var(--border);
    }

        .table tbody tr:hover {
            background-color: var(--bg-secondary);
        }

/* Filtered List by Category */
.filtered-list-container {
    background: white;
    border-radius: 12px;
}

.filter-buttons {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.filter-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    border: 2px solid var(--border);
    border-radius: 8px;
    background: white;
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

    .filter-btn:hover {
        border-color: var(--primary);
        color: var(--primary);
        background: rgba(79, 70, 229, 0.05);
    }

    .filter-btn.active {
        border-color: var(--primary);
        background: var(--primary);
        color: white;
    }

.filtered-items {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.filtered-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem;
    background: #ffffff;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    transition: all 0.3s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

    .filtered-item:hover {
        border-color: #325bb3;
        background: #f8fafc;
        box-shadow: 0 4px 12px rgba(50, 91, 179, 0.12);
        transform: translateY(-2px);
    }

    .filtered-item .item-icon {
        width: 48px;
        height: 48px;
        display: flex;
        align-items: center;
        justify-content: center;
        background: linear-gradient(135deg, #325bb3 0%, #4a73c9 100%);
        border-radius: 10px;
        font-size: 1.5rem;
        color: #ffffff;
        flex-shrink: 0;
        box-shadow: 0 2px 8px rgba(50, 91, 179, 0.25);
    }

    .filtered-item .item-content {
        flex: 1;
    }

        .filtered-item .item-content h4 {
            margin: 0 0 0.25rem 0;
            font-size: 1rem;
            font-weight: 600;
            color: #1e293b;
        }

        .filtered-item .item-content p {
            margin: 0 0 0.5rem 0;
            font-size: 0.9rem;
            color: #64748b;
            line-height: 1.5;
        }

    .filtered-item .item-meta {
        display: flex;
        align-items: center;
        gap: 1rem;
        flex-wrap: wrap;
    }

    .filtered-item .item-date {
        display: flex;
        align-items: center;
        gap: 0.25rem;
        font-size: 0.85rem;
        color: #94a3b8;
        font-weight: 500;
    }

.filtered-totals {
    margin-bottom: 1.5rem;
    padding: 1.25rem;
    background: linear-gradient(135deg, #325bb3 0%, #4a73c9 100%);
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(50, 91, 179, 0.2);
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.total-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

    .total-item:hover {
        background: rgba(255, 255, 255, 0.25);
        transform: translateY(-2px);
    }

    .total-item strong {
        font-size: 0.875rem;
        font-weight: 500;
        color: rgba(255, 255, 255, 0.9);
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }

    .total-item span {
        font-size: 1.5rem;
        font-weight: 700;
        color: #ffffff;
        text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    }

    .total-item .text-primary {
        color: #ffffff !important;
    }

    .total-item .text-success {
        color: #ffffff !important;
    }

    .total-item .text-danger {
        color: #ffffff !important;
    }

    .total-item .text-info {
        color: #ffffff !important;
    }


    /* Ações dentro do card */
.item-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: auto;
}

.action-btn {
    width: 36px;
    height: 36px;
    border: none;
    outline: none;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    cursor: pointer;
    transition: .2s;
    color: white;
}

.action-btn i {
    pointer-events: none;
}

/* Cores */
.action-btn.info { background: #0ea5e9; }
.action-btn.primary { background: #6366f1; }
.action-btn.danger { background: #ef4444; }

.action-btn:hover { opacity: 0.85; }

/* Melhor responsividade */
@media (max-width: 480px) {
    .item-actions {
        margin-left: 0;
        width: 100%;
        justify-content: space-between;
    }
}


/* Range Slider */
.form-range {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: var(--border);
    outline: none;
    cursor: pointer;
    accent-color: var(--primary);
}

/* File Input */
.form-file {
    display: block;
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.95rem;
}

    .form-file::file-selector-button {
        padding: 0.5rem 1rem;
        margin-right: 1rem;
        border: none;
        border-radius: 4px;
        background-color: var(--primary);
        color: white;
        cursor: pointer;
        font-size: 0.9rem;
        transition: background-color 0.2s;
    }

        .form-file::file-selector-button:hover {
            background-color: #4338CA;
        }

/* Form Row */
.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

/* Form Actions */
.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

/* ===========================
   FORECAST (PREVIS�O) STYLES
   =========================== */

.forecast-container {
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    margin-top: 1rem;
    position: relative;
    z-index: 2;
}

/* Header Section */
.forecast-header {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    align-items: center;
    padding: 1rem 1.5rem;
    margin-bottom: 1rem;
}


.forecast-header-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 2rem;
}

.header-titles {
    flex: 1;
}

.forecast-title {
    font-size: 2rem;
    font-weight: 700;
    margin: 0 0 0.5rem 0;
    color: white;
}

.forecast-subtitle {
    font-size: 1rem;
    margin: 0 0 0.75rem 0;
    opacity: 0.9;
}

.forecast-summary {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    margin: 1rem 0 0 0;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    backdrop-filter: blur(10px);
}

    .forecast-summary i {
        font-size: 1.25rem;
    }

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.loading-indicator-forecast {
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-clear {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    backdrop-filter: blur(10px);
}

    .btn-clear:hover {
        background: rgba(255, 255, 255, 0.3);
        border-color: rgba(255, 255, 255, 0.5);
        transform: translateY(-2px);
    }

/* Section Styling */
.forecast-section {
    background: #f9fafb;
    border-radius: 12px;
    padding: 0 1.5rem;
    margin-bottom: 2rem;
}

.forecast-section-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 1.5rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

    .forecast-section-title i {
        color: var(--primary);
        font-size: 1.5rem;
    }

/* Recipe Collection */
.recipe-collection {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.recipe-forecast-card {
    cursor: pointer;
    transition: all 0.3s ease;
}

    .recipe-forecast-card:hover {
        transform: translateY(-4px);
    }

.recipe-forecast-border {
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 1.5rem;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.recipe-forecast-card.active .recipe-forecast-border {
    border-color: var(--primary);
    background: linear-gradient(135deg, #f3f4ff 0%, #ffffff 100%);
    box-shadow: 0 4px 16px rgba(79, 70, 229, 0.2);
}

.recipe-forecast-content {
    text-align: center;
}

.recipe-icon-wrapper {
    position: relative;
    display: inline-block;
    margin-bottom: 1rem;
}

.recipe-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--primary) 0%, #6366f1 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    color: white;
    margin: 0 auto;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.selection-indicator {
    position: absolute;
    bottom: -5px;
    right: -5px;
    width: 32px;
    height: 32px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: #d1d5db;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.recipe-forecast-card.active .selection-indicator {
    color: var(--primary);
}

.recipe-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 1rem 0;
}

.recipe-info-grid {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.recipe-info-item {
    font-size: 0.9rem;
    color: #6b7280;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

    .recipe-info-item i {
        color: var(--primary);
    }

.recipe-value-badge {
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.value-label {
    font-size: 0.85rem;
    color: #6b7280;
    font-weight: 500;
}

.value-amount {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary);
}

/* Empty State */
.recipe-empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3rem 1rem;
}

.empty-state-icon {
    width: 80px;
    height: 80px;
    background: #f3f4f6;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    color: #9ca3af;
    margin: 0 auto 1rem;
}

.recipe-empty-state h4 {
    font-size: 1.25rem;
    color: var(--text-primary);
    margin: 0 0 0.5rem 0;
}

.recipe-empty-state p {
    color: #6b7280;
    margin: 0;
}

/* Quantity Input */
.quantity-input-container {
    background: white;
    border-radius: 12px;
}

.quantity-input-grid {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 1rem;
    align-items: end;
}

.input-field-wrapper {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.input-label {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.quantity-input {
    padding: 0.875rem 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: white;
}

    .quantity-input:focus {
        outline: none;
        border-color: var(--primary);
        box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
    }

.btn-forecast {
    background: linear-gradient(135deg, var(--primary) 0%, #6366f1 100%);
    color: white;
    border: none;
    border-radius: 10px;
    padding: 0.875rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
}

    .btn-forecast:hover {
        transform: translateY(-2px);
        box-shadow: 0 6px 16px rgba(79, 70, 229, 0.4);
    }

/* Forecast Results */
.forecast-results {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.forecast-summary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: #f8fafc;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
}

.summary-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.6rem;
    border-radius: 999px;
    background: #ecfdf3;
    color: #15803d;
    font-weight: 700;
    font-size: 0.95rem;
}

.summary-caption {
    font-size: 0.9rem;
    color: #4b5563;
    font-weight: 500;
}

.results-grid-forecast {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.forecast-result-card {
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 1.5rem;
    transition: all 0.3s ease;
}

    .forecast-result-card:hover {
        transform: translateY(-4px);
        box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    }

.card-status {
    border-left: 4px solid #10b981;
}

.card-quantity {
    border-left: 4px solid #3b82f6;
}

.card-cost {
    border-left: 4px solid #f59e0b;
}

.card-summary {
    border-left: 4px solid #8b5cf6;
}

.forecast-card-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #f3f4f6;
}

.card-icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    background: #eef2ff;
    color: #4f46e5;
}

.card-icon.status { background: #ecfdf3; color: #10b981; }
.card-icon.quantity { background: #eff6ff; color: #2563eb; }
.card-icon.cost { background: #fffbeb; color: #d97706; }
.card-icon.summary { background: #f5f3ff; color: #7c3aed; }

.forecast-card-header h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.forecast-card-content {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.status-text {
    font-size: 1.25rem;
    font-weight: 700;
    color: #10b981;
    margin: 0;
}

.status-text.text-success {
    color: #10b981;
}

.status-text.text-warning {
    color: #f59e0b;
}

.status-text.text-danger {
    color: #ef4444;
}


.percentage-text {
    font-size: 0.9rem;
    color: #6b7280;
    margin: 0;
}

.quantity-max {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.quantity-requested {
    font-size: 0.9rem;
    color: #6b7280;
    margin: 0;
}

    .quantity-requested span {
        font-weight: 600;
        color: var(--text-primary);
    }

.cost-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

/* Summary Items */
.summary-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    border-radius: 6px;
    font-size: 0.95rem;
}

.summary-ok {
    background: #f0fdf4;
    color: #10b981;
}

    .summary-ok i {
        color: #10b981;
    }

.summary-partial {
    background: #fffbeb;
    color: #f59e0b;
}

    .summary-partial i {
        color: #f59e0b;
    }

.summary-missing {
    background: #fef2f2;
    color: #ef4444;
}

    .summary-missing i {
        color: #ef4444;
    }

/* Ingredients Panel */
.ingredients-panel {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.ingredient-forecast-card {
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 1.5rem;
    transition: all 0.3s ease;
}

    .ingredient-forecast-card:hover {
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
        border-color: var(--primary);
    }

.ingredient-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #f3f4f6;
}

.ingredient-code {
    background: #f3f4f6;
    color: #6b7280;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.ingredient-status {
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.status-ok {
    background: #f0fdf4;
    color: #10b981;
}

.status-partial {
    background: #fffbeb;
    color: #f59e0b;
}

.status-missing {
    background: #fef2f2;
    color: #ef4444;
}

.ingredient-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 1rem 0;
}

/* Info Grid */
.ingredient-info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 1rem;
}

.info-card {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 1rem;
    transition: all 0.3s ease;
}

    .info-card:hover {
        background: #f3f4f6;
        border-color: var(--primary);
    }

.info-card-full {
    grid-column: 1 / -1;
}

.info-card-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    color: #6b7280;
    font-size: 0.85rem;
    font-weight: 600;
}

    .info-card-header i {
        font-size: 1rem;
        color: var(--primary);
    }

.info-card-content {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.info-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.info-label {
    font-size: 0.85rem;
    color: #6b7280;
    margin: 0;
}

    .info-label strong {
        color: var(--text-primary);
    }

/* Ingredient Alert */
.ingredient-alert {
    background: #fffbeb;
    border: 1px solid #fbbf24;
    border-radius: 10px;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-top: 1rem;
}

.alert-danger {
    background: #fef2f2;
    border-color: #f87171;
}

.alert-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
}

    .alert-content i {
        font-size: 1.25rem;
        color: #f59e0b;
    }

.alert-danger .alert-content i {
    color: #ef4444;
}

.alert-content span {
    font-size: 0.95rem;
    font-weight: 500;
    color: #92400e;
}

.alert-danger .alert-content span {
    color: #991b1b;
}

.btn-buy {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 0.625rem 1.25rem;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
}

    .btn-buy:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4);
    }

.btn-buy-urgent {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

    .btn-buy-urgent:hover {
        box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
    }

/* Forecast Footer Buttons */
.forecast-footer {
    display: flex;
    gap: 1rem;
    justify-content: center;
    align-items: center;
    padding: 1.5rem;
    margin-top: 1rem;
    border-top: 1px solid #e5e7eb;
}

.btn-forecast-header {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

    .btn-forecast-header.primary {
        background: linear-gradient(135deg, var(--primary) 0%, #6366f1 100%);
        color: white;
    }

        .btn-forecast-header.primary:hover {
            transform: translateY(-2px);
            box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
        }

    .btn-forecast-header.secondary {
        background: #f3f4f6;
        color: #374151;
        border: 1px solid #e5e7eb;
    }

        .btn-forecast-header.secondary:hover {
            background: #e5e7eb;
            transform: translateY(-2px);
        }

    .btn-forecast-header.info {
        background: #dbeafe;
        color: #1e40af;
    }

        .btn-forecast-header.info:hover {
            background: #bfdbfe;
            transform: translateY(-2px);
        }

.ingredients-empty-state {
    text-align: center;
    padding: 3rem 2rem;
}

.empty-state-content {
    max-width: 400px;
    margin: 0 auto;
}

.empty-icon-wrapper {
    width: 100px;
    height: 100px;
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: #9ca3af;
    margin: 0 auto 1.5rem;
}

.ingredients-empty-state h4 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 0.75rem 0;
}

.ingredients-empty-state p {
    font-size: 1rem;
    color: #6b7280;
    margin: 0 0 1.5rem 0;
}

.btn-start-analysis {
    background: linear-gradient(135deg, var(--primary) 0%, #6366f1 100%);
    color: white;
    border: none;
    border-radius: 10px;
    padding: 0.875rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

    .btn-start-analysis:hover {
        transform: translateY(-2px);
        box-shadow: 0 6px 16px rgba(79, 70, 229, 0.4);
    }

/* Responsive Design */
@media (max-width: 1024px) {
    .results-grid-forecast {
        grid-template-columns: repeat(2, 1fr);
    }

    .recipe-collection {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .forecast-container {
        padding: 1.25rem;
    }

    .forecast-header {
        padding: 1.25rem;
    }

    .forecast-header-content {
        flex-direction: column;
        gap: 0.75rem;
    }

    .forecast-title {
        font-size: 1.4rem;
    }

    .header-actions {
        width: 100%;
        justify-content: space-between;
        gap: 0.5rem;
    }

    .forecast-results {
        padding: 1rem;
        border-radius: 10px;
    }

    .results-grid-forecast {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .forecast-result-card {
        padding: 1rem;
        border-radius: 10px;
    }

    .forecast-card-header {
        gap: 0.6rem;
        padding-bottom: 0.75rem;
        margin-bottom: 0.75rem;
    }

    .card-icon {
        width: 38px;
        height: 38px;
        font-size: 1.05rem;
    }

    .status-text {
        font-size: 1.1rem;
    }

    .quantity-max,
    .cost-value {
        font-size: 1.3rem;
    }

    .forecast-summary {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.35rem;
        padding: 0.6rem 0.8rem;
    }

    .summary-chip {
        font-size: 0.9rem;
    }

    .summary-caption {
        font-size: 0.85rem;
    }

    .recipe-selector-mobile {
        display: block;
    }

    .recipe-collection,
    .recipe-selector {
        display: none;
    }

    .quantity-input-grid {
        grid-template-columns: 1fr;
    }

    .btn-forecast {
        width: 100%;
        justify-content: center;
    }

    .ingredient-info-grid {
        grid-template-columns: 1fr;
    }

    .ingredient-forecast-card {
        padding: 1rem;
        border-radius: 10px;
        gap: 0.5rem;
    }

    .ingredient-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.6rem;
        padding-bottom: 0.75rem;
        margin-bottom: 0.75rem;
    }

    .ingredient-title {
        margin-bottom: 0.75rem;
    }

    .ingredients-panel {
        max-height: 500px;
        overflow-y: auto;
        padding-right: 0.5rem;
    }

    .ingredients-panel::-webkit-scrollbar {
        width: 6px;
    }

    .ingredients-panel::-webkit-scrollbar-track {
        background: #f0f0f0;
        border-radius: 3px;
    }

    .ingredients-panel::-webkit-scrollbar-thumb {
        background: var(--primary);
        border-radius: 3px;
    }

    .ingredient-alert {
        flex-direction: column;
        align-items: stretch;
    }

    .btn-buy {
        width: 100%;
        justify-content: center;
    }

    .forecast-footer {
        flex-direction: column;
        gap: 0.75rem;
        padding: 1rem;
    }

    .btn-forecast-footer {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .forecast-section {
        padding: 0.75rem;
    }

    .forecast-section-title {
        font-size: 1.05rem;
    }

    .forecast-result-card {
        padding: 0.85rem;
    }

    .card-icon {
        width: 34px;
        height: 34px;
        font-size: 0.95rem;
    }

    .status-text,
    .quantity-max,
    .cost-value {
        font-size: 1.15rem;
    }

    .percentage-text,
    .quantity-requested {
        font-size: 0.85rem;
    }

    .summary-item {
        padding: 0.4rem;
        font-size: 0.85rem;
    }

    .summary-chip {
        padding: 0.3rem 0.55rem;
    }

    .ingredient-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
}

h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}

/* ===========================
   RECONNECT MODAL STYLES
   ======================================== */

.components-reconnect-first-attempt-visible,
.components-reconnect-repeated-attempt-visible,
.components-reconnect-failed-visible,
.components-pause-visible,
.components-resume-failed-visible,
.components-rejoining-animation {
    display: none;
}

#components-reconnect-modal.components-reconnect-show .components-reconnect-first-attempt-visible,
#components-reconnect-modal.components-reconnect-show .components-rejoining-animation,
#components-reconnect-modal.components-reconnect-paused .components-pause-visible,
#components-reconnect-modal.components-reconnect-resume-failed .components-resume-failed-visible,
#components-reconnect-modal.components-reconnect-retrying,
#components-reconnect-modal.components-reconnect-retrying .components-reconnect-repeated-attempt-visible,
#components-reconnect-modal.components-reconnect-retrying .components-rejoining-animation,
#components-reconnect-modal.components-reconnect-failed,
#components-reconnect-modal.components-reconnect-failed .components-reconnect-failed-visible {
    display: block;
}


#components-reconnect-modal {
    background-color: var(--surface, #ffffff);
    width: min(90vw, 420px);
    margin: 12vh auto;
    padding: 1.5rem;
    border: 1px solid var(--border-color, #e1e5eb);
    border-radius: 12px;
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.18);
    opacity: 0;
    transition: display 0.5s allow-discrete, overlay 0.5s allow-discrete;
    animation: components-reconnect-modal-fadeOutOpacity 0.5s both;
    backdrop-filter: blur(4px);
}

#components-reconnect-modal[open] {
    animation: components-reconnect-modal-slideUp 1.1s cubic-bezier(.05, .89, .25, 1.02) 0.2s, components-reconnect-modal-fadeInOpacity 0.4s ease-in-out 0.2s;
    animation-fill-mode: both;
}

#components-reconnect-modal::backdrop {
    background-color: rgba(0, 0, 0, 0.4);
    animation: components-reconnect-modal-fadeInOpacity 0.5s ease-in-out;
    opacity: 1;
}

@keyframes components-reconnect-modal-slideUp {
    0% {
        transform: translateY(30px) scale(0.95);
    }

    100% {
        transform: translateY(0);
    }
}

@keyframes components-reconnect-modal-fadeInOpacity {
    0% {
        opacity: 0;
    }

    100% {
        opacity: 1;
    }
}

@keyframes components-reconnect-modal-fadeOutOpacity {
    0% {
        opacity: 1;
    }

    100% {
        opacity: 0;
    }
}

.components-reconnect-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    color: var(--text-primary, #1f2933);
}

.components-reconnect-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(0, 112, 243, 0.08), rgba(0, 148, 255, 0.12));
    border: 1px solid var(--border-color, #e1e5eb);
}

.components-reconnect-icon {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary, #0d6efd), var(--primary-dark, #0a58ca));
    color: #fff;
    font-size: 1.35rem;
}

.components-reconnect-title {
    margin: 0;
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--text-primary, #1f2933);
}

.components-reconnect-subtitle {
    color: var(--text-secondary, #6b7280);
}

#components-reconnect-modal p {
    margin: 0;
    text-align: center;
}

.components-reconnect-text {
    color: var(--text-secondary, #4b5563);
    line-height: 1.5;
    padding: 0 0.25rem;
}

#components-reconnect-modal button.components-reconnect-button {
    border: 0;
    width: 100%;
    background: linear-gradient(135deg, var(--primary, #0d6efd), var(--primary-dark, #0a58ca));
    color: #fff;
    padding: 10px 16px;
    border-radius: 10px;
    font-weight: 600;
    letter-spacing: 0.01em;
    box-shadow: 0 10px 28px rgba(0, 118, 255, 0.25);
    transition: transform 0.12s ease, box-shadow 0.12s ease, filter 0.12s ease;
}

#components-reconnect-modal button.components-reconnect-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 32px rgba(0, 118, 255, 0.3);
}

#components-reconnect-modal button.components-reconnect-button:active {
    transform: translateY(0);
    filter: brightness(0.96);
}

.components-rejoining-animation {
    position: relative;
    width: 80px;
    height: 80px;
    margin: 0 auto;
}

.components-rejoining-animation div {
    position: absolute;
    border: 3px solid var(--primary, #0d6efd);
    opacity: 1;
    border-radius: 50%;
    animation: components-rejoining-animation 1.5s cubic-bezier(0, 0.2, 0.8, 1) infinite;
}

.components-rejoining-animation div:nth-child(2) {
    animation-delay: -0.5s;
}

@keyframes components-rejoining-animation {
    0% {
        top: 40px;
        left: 40px;
        width: 0;
        height: 0;
        opacity: 0;
    }

    4.9% {
        top: 40px;
        left: 40px;
        width: 0;
        height: 0;
        opacity: 0;
    }

    5% {
        top: 40px;
        left: 40px;
        width: 0;
        height: 0;
        opacity: 1;
    }

    100% {
        top: 0px;
        left: 0px;
        width: 80px;
        height: 80px;
        opacity: 0;
    }
}

@media (max-width: 480px) {
    #components-reconnect-modal {
        margin: 8vh auto;
        padding: 1.25rem;
        width: min(94vw, 420px);
    }

    .components-reconnect-header {
        align-items: flex-start;
    }

    .components-reconnect-title {
        font-size: 1rem;
    }

    #components-reconnect-modal button.components-reconnect-button {
        padding: 12px 14px;
    }
}

/* Container da pesquisa */
.search-container {
    margin-bottom: 1.5rem;
    display: flex;
    justify-content: flex-start;
}

/* Wrapper do input e ícones */
.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

/* Ícone de pesquisa à esquerda */
.search-input-wrapper i.bi-search {
    position: absolute;
    left: 12px;
    color: #94a3b8;
    font-size: 1.1rem;
    pointer-events: none;
    z-index: 1;
}

/* Input de pesquisa */
.search-input {
    width: 100%;
    padding: 0.75rem 3rem 0.75rem 2.5rem; /* ↑ espaço maior à direita para o botão clear */
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #ffffff;
    font-size: 0.95rem;
    color: #1e293b;
    transition: all 0.3s ease;
    outline: none;
}

.search-input:focus {
    border-color: #325bb3;
    box-shadow: 0 0 0 3px rgba(50, 91, 179, 0.1);
    background: #f8fafc;
}

.search-input::placeholder {
    color: #cbd5e1;
}

/* Botão de limpar (X) */
.search-clear {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 2;
    width: 24px;
    height: 24px;
    padding: 0;
}

.search-clear:hover {
    color: #325bb3;
    transform: translateY(-50%) scale(1.15);
}

.search-clear:active {
    transform: translateY(-50%) scale(0.95);
}
