/* Reset e Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Cores Vivas - Baseadas na imagem */
    --primary-blue: #2563eb;
    --dark-blue: #1e3a8a;
    --light-blue: #3b82f6;
    --red: #ef4444;
    --green: #22c55e;
    --orange: #f97316;
    --purple: #a855f7;
    --yellow: #eab308;
    
    /* Cores de fundo */
    --bg-white: #ffffff;
    --bg-light: #f8fafc;
    --bg-sidebar: #1e293b;
    --bg-card: #ffffff;
    
    /* Texto */
    --text-dark: #1e293b;
    --text-gray: #64748b;
    --text-light: #94a3b8;
    --text-white: #ffffff;
    
    /* Sombras */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    
    /* Transições */
    --transition: all 0.3s ease;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--bg-light);
    color: var(--text-dark);
    line-height: 1.6;
    overflow-x: hidden;
}

html,
body {
    width: 100%;
    height: 100%;
}

/* Layout Principal */
.main-content {
    margin-left: 280px;
    min-height: 100vh;
    transition: var(--transition);
}

/* Sidebar */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 280px;
    height: 100vh;
    background: var(--bg-sidebar);
    color: var(--text-white);
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-xl);
    z-index: 1000;
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
}

.sidebar-nav {
    flex: 1;
    padding: 1rem 0;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 0.875rem 1.5rem;
    color: var(--text-white);
    text-decoration: none;
    transition: var(--transition);
    border-left: 3px solid transparent;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.1);
    border-left-color: var(--light-blue);
}

.nav-item.active {
    background: rgba(59, 130, 246, 0.2);
    border-left-color: var(--light-blue);
    color: var(--light-blue);
}

.nav-icon {
    font-size: 1.25rem;
    margin-right: 0.75rem;
    width: 24px;
    text-align: center;
}

.sidebar-footer {
    padding: 1rem 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Header */
.header {
    background: var(--bg-white);
    padding: 1rem 2rem;
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
}

.header-title {
    display: block;
}

.system-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-blue);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

@media (max-width: 767px) {
    .header-title {
        display: none;
    }
}

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-dark);
}

.user-name {
    font-weight: 500;
    color: var(--text-gray);
}

@media (min-width: 768px) {
    .header-title {
        display: block;
    }
}

/* Content Wrapper */
.content-wrapper {
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

img,
video,
iframe {
    max-width: 100%;
    height: auto;
}

.page-header {
    margin-bottom: 2rem;
}

.page-header h1 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.page-header p {
    color: var(--text-gray);
    font-size: 1rem;
}

/* Cards */
.card {
    background: var(--bg-white);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-lg);
    transition: var(--transition);
    min-width: 0;
}

.card:hover {
    box-shadow: var(--shadow-xl);
}

.card h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-dark);
}

.card h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--text-dark);
}

/* Metric Cards - Cores Vivas com Sombras */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.metric-card {
    background: var(--bg-white);
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    box-shadow: var(--shadow-lg);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.metric-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
}

.metric-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
}

.card-blue {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: var(--text-white);
}

.card-blue::before {
    background: #1e40af;
}

.card-red {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: var(--text-white);
}

.card-red::before {
    background: #b91c1c;
}

.card-green {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    color: var(--text-white);
}

.card-green::before {
    background: #15803d;
}

.card-purple {
    background: linear-gradient(135deg, #a855f7 0%, #9333ea 100%);
    color: var(--text-white);
}

.card-purple::before {
    background: #7e22ce;
}

.metric-icon {
    font-size: 2.5rem;
    margin-right: 1rem;
    opacity: 0.9;
}

.metric-content h3 {
    font-size: 0.875rem;
    font-weight: 500;
    opacity: 0.9;
    margin-bottom: 0.25rem;
    color: var(--text-white);
}

.metric-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-white);
}

/* Charts Grid */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.chart-card {
    background: var(--bg-white);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: var(--shadow-lg);
}

.chart-card h3 {
    margin-bottom: 1rem;
}

.chart-card canvas {
    max-height: 300px;
}

/* Bottom Grid */
.bottom-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 1.5rem;
}

.budget-card,
.transactions-card {
    background: var(--bg-white);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: var(--shadow-lg);
}

.budget-item {
    margin-bottom: 1.5rem;
}

.budget-item:last-child {
    margin-bottom: 0;
}

.budget-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-gray);
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.25rem;
}

.progress-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s ease;
}

.progress-red {
    background: linear-gradient(90deg, #ef4444, #dc2626);
}

.progress-orange {
    background: linear-gradient(90deg, #f97316, #ea580c);
}

.progress-green {
    background: linear-gradient(90deg, #22c55e, #16a34a);
}

.progress-blue {
    background: linear-gradient(90deg, #3b82f6, #2563eb);
}

/* Transactions */
.transactions-list {
    max-height: 400px;
    overflow-y: auto;
}

.transaction-item {
    display: flex;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid #e5e7eb;
    transition: var(--transition);
}

.transaction-item:hover {
    background: var(--bg-light);
}

.transaction-item:last-child {
    border-bottom: none;
}

.transaction-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: 700;
    margin-right: 1rem;
}

.transaction-green {
    background: rgba(34, 197, 94, 0.1);
    color: var(--green);
}

.transaction-red {
    background: rgba(239, 68, 68, 0.1);
    color: var(--red);
}

.transaction-details {
    flex: 1;
}

.transaction-details strong {
    display: block;
    margin-bottom: 0.25rem;
    color: var(--text-dark);
}

.transaction-details span {
    font-size: 0.875rem;
    color: var(--text-gray);
}

.transaction-value {
    font-weight: 700;
    font-size: 1.125rem;
}

/* Forms */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    min-width: 0;
}

.form-group {
    margin-bottom: 1rem;
    min-width: 0;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-dark);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 1rem;
    transition: var(--transition);
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.checkbox-label input {
    width: auto;
    margin-right: 0.5rem;
}

.form-actions {
    grid-column: 1 / -1;
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.875rem 1.75rem;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    letter-spacing: 0.3px;
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.btn:active {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-blue), var(--dark-blue));
    color: var(--text-white);
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn-primary:hover::before {
    left: 100%;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--light-blue), var(--primary-blue));
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.4);
}

.btn-secondary {
    background: var(--bg-white);
    color: var(--text-dark);
    border: 2px solid #e5e7eb;
    position: relative;
}

.btn-secondary:hover {
    background: var(--bg-light);
    border-color: var(--primary-blue);
    color: var(--primary-blue);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.btn-danger {
    background: linear-gradient(135deg, var(--red), #dc2626);
    color: var(--text-white);
    position: relative;
    overflow: hidden;
}

.btn-danger::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn-danger:hover::before {
    left: 100%;
}

.btn-danger:hover {
    background: linear-gradient(135deg, #f87171, var(--red));
    box-shadow: 0 8px 20px rgba(239, 68, 68, 0.4);
}

.btn-warning {
    background: linear-gradient(135deg, var(--orange), #ea580c);
    color: var(--text-white);
}

.btn-success {
    background: linear-gradient(135deg, var(--green), #16a34a);
    color: var(--text-white);
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn-block {
    width: 100%;
}

/* Alerts */
.alert {
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    box-shadow: var(--shadow-md);
}

.alert-success {
    background: rgba(34, 197, 94, 0.1);
    color: #16a34a;
    border-left: 4px solid var(--green);
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
    border-left: 4px solid var(--red);
}

/* Tables */
.table-responsive {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table thead {
    background: var(--bg-light);
}

.data-table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: var(--text-dark);
    border-bottom: 2px solid #e5e7eb;
}

.data-table td {
    padding: 1rem;
    border-bottom: 1px solid #e5e7eb;
}

.data-table tbody tr:hover {
    background: var(--bg-light);
}

.actions {
    display: flex;
    gap: 0.5rem;
}

.text-success {
    color: var(--green);
    font-weight: 600;
}

.text-danger {
    color: var(--red);
    font-weight: 600;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-primary {
    background: rgba(37, 99, 235, 0.1);
    color: var(--primary-blue);
}

.badge-secondary {
    background: rgba(100, 116, 139, 0.1);
    color: var(--text-gray);
}

.badge-success {
    background: rgba(34, 197, 94, 0.1);
    color: var(--green);
}

.badge-danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--red);
}

/* Share Buttons */
.share-buttons {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.share-buttons span {
    font-weight: 500;
    color: var(--text-gray);
    margin-right: 0.5rem;
}

.share-btn {
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.875rem;
    text-decoration: none;
    color: var(--text-white);
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

.share-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.share-facebook {
    background: #1877f2;
}

.share-twitter {
    background: #1da1f2;
}

.share-whatsapp {
    background: #25d366;
}

.share-linkedin {
    background: #0077b5;
}

.share-telegram {
    background: #0088cc;
}

/* Login Page */
#particle-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

.login-page {
    position: relative;
    overflow: hidden;
}

.login-container {
    position: relative;
    z-index: 1;
}

body.login-page {
    display: grid;
    place-items: center;
    min-height: 100vh;
    width: 100%;
    margin: 0;
    padding: 0;
    background: linear-gradient(135deg, var(--primary-blue), var(--dark-blue));
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 2rem;
    margin: 0 auto;
}

.login-box {
    background: var(--bg-white);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: var(--shadow-xl);
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-header h1 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.login-header p {
    color: var(--text-gray);
}

.login-form {
    margin-top: 1.5rem;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 2rem;
    color: var(--text-gray);
}

/* Budget List */
.budget-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.budget-item-card {
    background: var(--bg-light);
    border-radius: 8px;
    padding: 1.25rem;
    box-shadow: var(--shadow-sm);
}

.budget-item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.budget-item-header h3 {
    margin-bottom: 0.25rem;
}

/* Assistente Amazon Flex */
.assistant-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.assistant-card {
    border-left: 4px solid var(--primary-blue);
    background: linear-gradient(180deg, #f8fbff 0%, #ffffff 100%);
}

.assistant-card.highlight {
    border-color: var(--orange);
    background: linear-gradient(180deg, #fff7ed 0%, #ffffff 100%);
}

.phase-badge {
    display: inline-block;
    background: rgba(37, 99, 235, 0.1);
    color: var(--primary-blue);
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.phase-badge.success {
    background: rgba(34, 197, 94, 0.15);
    color: var(--green);
}

.phase-badge.warning {
    background: rgba(249, 115, 22, 0.15);
    color: var(--orange);
}

.checklist {
    list-style: none;
    padding-left: 0;
}

.checklist li {
    padding: 0.35rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.checklist li::before {
    content: "✔";
    color: var(--green);
    font-size: 0.9rem;
}

.mini-badges {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.status-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    background: var(--bg-light);
    color: var(--text-dark);
    font-weight: 600;
    font-size: 0.85rem;
}

.status-chip.info {
    background: rgba(37, 99, 235, 0.12);
    color: var(--primary-blue);
}

.card-header-inline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.output-card .output-body {
    white-space: pre-wrap;
    line-height: 1.6;
    overflow-x: hidden;
    color: var(--text-dark);
}

.output-card .muted {
    color: var(--text-gray);
}

.output-card .error {
    color: var(--red);
}

.output-card {
    position: relative;
}

.output-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 0.75rem;
}

.output-editor {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    line-height: 1.6;
}

.output-editor:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.actions-rail {
    position: fixed;
    right: 20px;
    top: 200px;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    z-index: 1100;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 1.25rem;
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.8);
    min-width: 180px;
}

.rail-header {
    margin-bottom: 0.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid rgba(37, 99, 235, 0.1);
}

.rail-header h4 {
    margin: 0;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-dark);
    text-align: center;
    letter-spacing: 0.5px;
}

.rail-btn {
    background: linear-gradient(135deg, var(--primary-blue), var(--dark-blue));
    color: var(--text-white);
    border: none;
    border-radius: 12px;
    padding: 0.875rem 1.25rem;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 600;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 140px;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.rail-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.rail-btn:hover::before {
    left: 100%;
}

.rail-btn:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.4);
    background: linear-gradient(135deg, var(--light-blue), var(--primary-blue));
}

.rail-btn:active {
    transform: translateY(-1px) scale(0.98);
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

.form-group.full {
    grid-column: 1 / -1;
    min-width: 0;
}

.email-amazon-group {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.05), rgba(59, 130, 246, 0.02));
    padding: 1.25rem;
    border-radius: 12px;
    border: 2px solid rgba(37, 99, 235, 0.15);
    margin-bottom: 1.5rem;
}

.email-amazon-group label {
    font-weight: 700;
    color: var(--primary-blue);
    font-size: 1.05rem;
    margin-bottom: 0.5rem;
    display: block;
}

.label-hint {
    font-weight: 400;
    font-size: 0.85rem;
    color: var(--text-gray);
    display: block;
    margin-top: 0.25rem;
}

.email-textarea {
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    line-height: 1.6;
    background: var(--bg-white);
    border: 2px solid rgba(37, 99, 235, 0.2);
}

.email-textarea:focus {
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

.field-hint {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-gray);
    font-style: italic;
}

/* Recursos Amazon Flex */
.recursos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

/* Inbox Amazon */
.inbox-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.inbox-search {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    align-items: center;
    flex: 1;
}

.inbox-search input {
    flex: 1;
    min-width: 220px;
    padding: 0.65rem 0.75rem;
    border-radius: 10px;
    border: 2px solid #e5e7eb;
    font-size: 0.95rem;
}

.inbox-meta {
    display: flex;
    gap: 0.75rem;
    font-size: 0.85rem;
    color: var(--text-gray);
}

.inbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
}

.email-card h3 {
    margin-bottom: 0.35rem;
}

.email-header {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.email-meta {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    font-size: 0.85rem;
    color: var(--text-gray);
}

.email-date {
    font-size: 0.85rem;
    color: var(--text-gray);
    white-space: nowrap;
}

.email-preview {
    margin-top: 0.75rem;
    color: var(--text-dark);
    line-height: 1.6;
}

.email-details summary {
    cursor: pointer;
    color: var(--primary-blue);
    margin-top: 0.75rem;
    font-weight: 600;
}

.email-body {
    margin-top: 0.75rem;
    background: var(--bg-light);
    border-radius: 8px;
    padding: 0.75rem;
    max-height: 260px;
    overflow-y: auto;
    color: var(--text-dark);
    overflow-x: auto;
}

.email-body pre {
    white-space: pre-wrap;
    word-break: break-word;
    overflow-wrap: anywhere;
    font-family: inherit;
    font-size: 0.9rem;
}

.email-body img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0.5rem 0;
    border-radius: 6px;
}

.email-body * {
    max-width: 100%;
    box-sizing: border-box;
}

.email-body a {
    color: var(--primary-blue);
    word-break: break-word;
}

.email-body table {
    width: 100%;
    max-width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
    margin: 0.5rem 0;
    font-size: 0.9rem;
}

.email-body th,
.email-body td {
    border: 1px solid rgba(0, 0, 0, 0.08);
    padding: 0.4rem 0.5rem;
    text-align: left;
    vertical-align: top;
    width: auto;
    word-break: break-word;
    white-space: normal;
}

.email-body ul,
.email-body ol {
    padding-left: 1.2rem;
    margin: 0.5rem 0;
}

.email-body p {
    margin: 0 0 0.75rem 0;
}

.email-html {
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--text-dark);
    width: 100%;
}

.email-html * {
    max-width: 100% !important;
    box-sizing: border-box;
    background: transparent !important;
    box-shadow: none !important;
    outline: none !important;
    color: var(--text-dark) !important;
}

.email-html table,
.email-html th,
.email-html td {
    border: none !important;
}

.email-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.recursos-resumo {
    margin-bottom: 1.5rem;
}

.resumo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.resumo-card {
    border: none;
    padding: 1rem 1.25rem;
    border-radius: 14px;
    text-align: left;
    cursor: pointer;
    display: grid;
    gap: 0.35rem;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    background: var(--bg-white);
}

.resumo-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.resumo-card.active {
    outline: 3px solid rgba(37, 99, 235, 0.2);
    box-shadow: var(--shadow-xl);
}

.resumo-card.aberto {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.12), rgba(37, 99, 235, 0.02));
    border-left: 4px solid var(--primary-blue);
}

.resumo-card.finalizado {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.15), rgba(34, 197, 94, 0.03));
    border-left: 4px solid var(--green);
}

.resumo-card.positivo {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.2), rgba(22, 163, 74, 0.05));
    border-left: 4px solid #16a34a;
}

.resumo-card.negado {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.15), rgba(185, 28, 28, 0.04));
    border-left: 4px solid #b91c1c;
}

.resumo-card.pendente {
    background: linear-gradient(135deg, rgba(148, 163, 184, 0.2), rgba(148, 163, 184, 0.05));
    border-left: 4px solid var(--text-gray);
}

.resumo-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-gray);
}

.resumo-valor {
    font-size: 1.75rem;
    color: var(--text-dark);
}

.resumo-hint {
    font-size: 0.8rem;
    color: var(--text-gray);
}

.resumo-filtros {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
    align-items: center;
}

.resumo-select {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--bg-white);
    border: 1px solid rgba(37, 99, 235, 0.2);
    border-radius: 999px;
    padding: 0.35rem 0.75rem;
    font-size: 0.8rem;
    color: var(--primary-blue);
    font-weight: 600;
}

.resumo-select select {
    border: none;
    background: transparent;
    font-weight: 600;
    color: var(--text-dark);
    cursor: pointer;
}

.resumo-select select:focus {
    outline: none;
}

.filter-chip {
    border: 1px solid rgba(37, 99, 235, 0.2);
    background: var(--bg-white);
    color: var(--primary-blue);
    padding: 0.4rem 0.75rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.filter-chip:hover {
    border-color: var(--primary-blue);
    background: rgba(37, 99, 235, 0.1);
}

.filter-chip.active {
    background: var(--primary-blue);
    color: var(--text-white);
    border-color: var(--primary-blue);
}

.recurso-card {
    transition: transform 0.2s, box-shadow 0.2s;
}

.recurso-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
}

.recurso-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--bg-light);
}

.recurso-tempo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-gray);
    margin-bottom: 1rem;
    width: 100%;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.12);
}

.recurso-tempo-valor {
    color: var(--text-dark);
    font-weight: 700;
}

.recurso-tempo.status-enviado {
    background: rgba(249, 115, 22, 0.12);
    color: var(--orange);
}

.recurso-tempo.status-enviado .recurso-tempo-valor {
    color: var(--orange);
}

.recurso-tempo.status-resolvido {
    background: rgba(34, 197, 94, 0.15);
    color: var(--green);
}

.recurso-tempo.status-resolvido .recurso-tempo-valor {
    color: var(--green);
}

.recurso-tempo.status-negado {
    background: rgba(239, 68, 68, 0.15);
    color: var(--red);
}

.recurso-tempo.status-negado .recurso-tempo-valor {
    color: var(--red);
}

.recurso-header h3 {
    margin: 0;
    font-size: 1.1rem;
    color: var(--text-dark);
}

.recurso-meta {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-gray);
}

.recurso-body {
    margin-bottom: 1rem;
}

.recurso-descricao {
    color: var(--text-dark);
    line-height: 1.6;
    margin-bottom: 0.75rem;
}

.recurso-pedido {
    color: var(--text-gray);
    font-size: 0.9rem;
}

.recurso-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    padding-top: 1rem;
    border-top: 1px solid var(--bg-light);
}

.recurso-status-form {
    display: inline-flex;
    align-items: center;
}

.recurso-status-form label {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: var(--bg-white);
    border: 1px solid rgba(37, 99, 235, 0.2);
    border-radius: 999px;
    padding: 0.35rem 0.75rem;
    font-size: 0.8rem;
    color: var(--primary-blue);
    font-weight: 600;
}

.recurso-status-form .status-pill.status-rascunho {
    background: rgba(100, 116, 139, 0.1);
    border-color: rgba(100, 116, 139, 0.4);
    color: var(--text-gray);
}

.recurso-status-form .status-pill.status-enviado {
    background: rgba(249, 115, 22, 0.15);
    border-color: rgba(249, 115, 22, 0.5);
    color: var(--orange);
}

.recurso-status-form .status-pill.status-resolvido {
    background: rgba(34, 197, 94, 0.15);
    border-color: rgba(34, 197, 94, 0.5);
    color: var(--green);
}

.recurso-status-form .status-pill.status-negado {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.5);
    color: var(--red);
}

.recurso-status-form select {
    border: none;
    background: transparent;
    font-weight: 600;
    color: var(--text-dark);
    cursor: pointer;
}

.recurso-status-form select:focus {
    outline: none;
}

.recurso-detalhes-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--bg-light);
}

.recurso-detalhes-header h2 {
    margin: 0;
    color: var(--text-dark);
}

.recurso-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
    padding: 1rem;
    background: var(--bg-light);
    border-radius: 8px;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.info-item strong {
    color: var(--text-gray);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.info-item span {
    color: var(--text-dark);
    font-weight: 500;
}

.recurso-section {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--bg-light);
}

.recurso-section:last-child {
    border-bottom: none;
}

.recurso-section h3 {
    color: var(--primary-blue);
    margin-bottom: 0.75rem;
    font-size: 1.1rem;
}

.recurso-content {
    background: var(--bg-light);
    padding: 1rem;
    border-radius: 8px;
    line-height: 1.8;
    color: var(--text-dark);
    white-space: pre-wrap;
}

.recurso-content.email-content {
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
}

.recurso-content.recurso-japones {
    font-family: 'MS Gothic', 'Yu Gothic', 'Meiryo', sans-serif;
    font-size: 1rem;
}

.badge-warning {
    background: rgba(249, 115, 22, 0.1);
    color: var(--orange);
}

.status-chip.badge-success {
    background: rgba(34, 197, 94, 0.15);
    color: var(--green);
}

.perguntas-guia-card {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.05), rgba(59, 130, 246, 0.02));
    border: 2px solid rgba(37, 99, 235, 0.2);
    margin: 0;
    width: 100%;
    position: relative;
    z-index: 1;
}

.perguntas-content {
    padding: 1rem;
    background: var(--bg-white);
    border-radius: 8px;
    line-height: 1.8;
    max-height: 600px;
    overflow-y: auto;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.perguntas-texto {
    color: var(--text-dark);
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    word-break: break-word;
}

/* Garantir que o card de perguntas fique no fluxo do formulário */
.form-group.full #perguntasCard {
    grid-column: 1 / -1;
    width: 100%;
    margin-bottom: 1.5rem;
}

.muted {
    color: var(--text-gray);
}

@media (max-width: 1024px) {
    .actions-rail {
        position: static;
        flex-direction: row;
        flex-wrap: wrap;
        margin: 1rem 0;
    }
}

.budget-item-header p {
    font-size: 0.875rem;
    color: var(--text-gray);
}

.budget-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

.budget-percent {
    font-weight: 600;
    color: var(--text-dark);
}

.budget-actions {
    display: flex;
    gap: 0.5rem;
}

/* Category List */
.category-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.category-item {
    padding: 1rem;
    background: var(--bg-light);
    border-radius: 8px;
}

.category-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.category-name {
    font-weight: 600;
    color: var(--text-dark);
}

.category-value {
    font-weight: 600;
    color: var(--text-dark);
}

.category-percent {
    font-size: 0.75rem;
    color: var(--text-gray);
    margin-top: 0.25rem;
}

/* IA Form */
.ia-form {
    margin-top: 1rem;
}

.ia-response {
    margin-top: 1.5rem;
    padding: 1.5rem;
    background: var(--bg-light);
    border-radius: 8px;
    border-left: 4px solid var(--primary-blue);
}

.ia-response h3 {
    margin-bottom: 1rem;
    color: var(--text-dark);
}

.ia-content {
    line-height: 1.8;
    color: var(--text-dark);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.modal-content {
    background: var(--bg-white);
    margin: 5% auto;
    padding: 2rem;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    box-shadow: var(--shadow-xl);
    position: relative;
}

.modal-close {
    position: absolute;
    right: 1rem;
    top: 1rem;
    font-size: 2rem;
    font-weight: 300;
    color: var(--text-gray);
    cursor: pointer;
    line-height: 1;
}

.modal-close:hover {
    color: var(--text-dark);
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: var(--transition);
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
        width: 100%;
        overflow-x: hidden;
    }
    
    .mobile-menu-toggle {
        display: block;
    }
    
    .content-wrapper {
        padding: 1rem;
        max-width: 100%;
        width: 100%;
    }

    .card,
    .metric-card {
        width: 100%;
        max-width: 100%;
    }
    
    .metrics-grid {
        grid-template-columns: 1fr;
    }
    
    .charts-grid,
    .bottom-grid {
        grid-template-columns: 1fr;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
    min-width: 0;
    }

    .inbox-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .inbox-grid {
        grid-template-columns: 1fr;
    }

    .inbox-search {
        width: 100%;
    }

    .assistant-grid {
        grid-template-columns: 1fr;
    }

    .card-header-inline {
        flex-direction: column;
        align-items: flex-start;
    }

    .form-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .output-actions {
        flex-direction: column;
        align-items: stretch;
    }
    
    .share-buttons {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .share-btn {
        width: 100%;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .page-header h1 {
        font-size: 1.5rem;
    }
    
    .metric-value {
        font-size: 1.5rem;
    }
    
    .actions {
        flex-direction: column;
    }
    
    .btn-sm {
        width: 100%;
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card,
.metric-card {
    animation: fadeIn 0.3s ease-out;
}
