/* ==========================================================================
   SISTEMA DE DESIGN - MEU LEMBRETE (ASSISTENTE PESSOAL INTELIGENTE)
   ========================================================================== */

/* Fontes e Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
    transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}

h1, h2, h3, h4, .brand-name {
    font-family: 'Outfit', sans-serif;
}

/* Variáveis de Tema */
:root[data-theme="dark"] {
    --bg-app: #0b0f19;
    --bg-sidebar: #0f1626;
    --bg-card: rgba(21, 30, 52, 0.7);
    --bg-card-hover: rgba(29, 41, 71, 0.85);
    --border-color: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(255, 255, 255, 0.15);
    
    --text-main: #f3f4f6;
    --text-muted: #9ca3af;
    --text-inverse: #111827;

    --primary: #6366f1; /* Indigo */
    --primary-hover: #4f46e5;
    --primary-glow: rgba(99, 102, 241, 0.3);

    --accent: #a855f7; /* Purple */
    --accent-glow: rgba(168, 85, 247, 0.35);
    
    --income: #10b981; /* Emerald */
    --income-bg: rgba(16, 185, 129, 0.15);
    --expense: #ef4444; /* Rose */
    --expense-bg: rgba(239, 68, 68, 0.15);

    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    --backdrop-filter: blur(12px);

    /* Cores das Notas */
    --note-blue: #1e3a8a;
    --note-purple: #581c87;
    --note-pink: #701a75;
    --note-green: #064e3b;
    --note-yellow: #78350f;
}

:root[data-theme="light"] {
    --bg-app: #f8fafc;
    --bg-sidebar: #ffffff;
    --bg-card: rgba(255, 255, 255, 0.8);
    --bg-card-hover: rgba(255, 255, 255, 0.95);
    --border-color: rgba(0, 0, 0, 0.06);
    --border-hover: rgba(0, 0, 0, 0.12);
    
    --text-main: #0f172a;
    --text-muted: #64748b;
    --text-inverse: #ffffff;

    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --primary-glow: rgba(79, 70, 229, 0.15);

    --accent: #9333ea;
    --accent-glow: rgba(147, 51, 234, 0.15);
    
    --income: #059669;
    --income-bg: rgba(5, 150, 105, 0.1);
    --expense: #dc2626;
    --expense-bg: rgba(220, 38, 38, 0.1);

    --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.05);
    --backdrop-filter: blur(8px);

    /* Cores das Notas */
    --note-blue: #dbeafe;
    --note-purple: #f3e8ff;
    --note-pink: #fce7f3;
    --note-green: #d1fae5;
    --note-yellow: #fef3c7;
}

/* Layout Geral */
body {
    background-color: var(--bg-app);
    color: var(--text-main);
    overflow-x: hidden;
    min-height: 100vh;
}

.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background-color: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 2rem 1.2rem;
    position: fixed;
    height: 100vh;
    z-index: 100;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 2.5rem;
}

.brand-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

.brand-name {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.sidebar-menu {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex-grow: 1;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    border-radius: 10px;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.menu-item i {
    font-size: 1.05rem;
    width: 20px;
    text-align: center;
}

.menu-item:hover, .menu-item.active {
    color: var(--text-main);
    background-color: var(--border-color);
}

.menu-item.active {
    background: linear-gradient(135deg, var(--primary-glow), rgba(168, 85, 247, 0.1));
    border-left: 4px solid var(--primary);
    padding-left: 10px;
}

.sidebar-footer {
    padding-top: 1.2rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* User Profile Badge */
.user-profile-badge {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    background-color: rgba(0, 0, 0, 0.15);
    border: 1px solid var(--border-color);
    border-radius: 10px;
}

.user-avatar-mini {
    font-size: 1.8rem;
    color: var(--primary);
    display: flex;
    align-items: center;
}

.user-info {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.user-name {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-main);
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}

.user-email {
    font-size: 0.75rem;
    color: var(--text-muted);
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}

.footer-actions {
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

.footer-actions .theme-toggle {
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
    background-color: var(--border-color);
    border: 1px solid transparent;
    color: var(--text-main);
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
}

.btn-logout {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 14px;
    background-color: var(--expense-bg);
    color: var(--expense);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.2s ease;
}

.btn-logout:hover {
    background-color: var(--expense);
    color: white;
}

/* Área de Conteúdo Principal */
.main-content {
    margin-left: 260px;
    flex-grow: 1;
    padding: 2.2rem;
    display: flex;
    flex-direction: column;
    gap: 1.8rem;
    min-height: 100vh;
}

/* Header */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 1.2rem;
    border-bottom: 1px solid var(--border-color);
}

.header-welcome h1 {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 4px;
}

.text-gradient {
    background: linear-gradient(135deg, var(--text-main), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

#header-date {
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1.2rem;
}

.user-status-widget {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 8px 12px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: var(--glass-shadow);
}

.status-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
}

.mood-selector-mini {
    display: flex;
    gap: 4px;
}

.mood-btn {
    background: none;
    border: none;
    font-size: 1.15rem;
    cursor: pointer;
    padding: 2px;
    border-radius: 6px;
    transition: transform 0.2s ease, background-color 0.2s ease;
}

.mood-btn:hover {
    transform: scale(1.2);
    background-color: var(--border-color);
}

.mood-btn.selected {
    transform: scale(1.25);
    background-color: var(--primary-glow);
    box-shadow: 0 0 8px var(--primary-glow);
}

/* Seções */
.content-section {
    display: none;
    animation: fadeIn 0.4s ease forwards;
}

.content-section.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Cards Premium */
.card {
    background: var(--bg-card);
    backdrop-filter: var(--backdrop-filter);
    -webkit-backdrop-filter: var(--backdrop-filter);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.2rem;
    box-shadow: var(--glass-shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px 0 rgba(0, 0, 0, 0.22);
    border-color: var(--border-hover);
}

.accent-card {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.12), rgba(168, 85, 247, 0.12)), var(--bg-card);
    border-color: rgba(99, 102, 241, 0.22);
}

/* Filtros Avançados */
.filter-card {
    background-color: rgba(0, 0, 0, 0.1);
    border: 1px solid var(--border-color);
}

.filter-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 1.2rem;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.filter-group label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
}

.filter-group select, .filter-group input {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.85rem;
    outline: none;
}

.filter-group select:focus, .filter-group input:focus {
    border-color: var(--primary);
}

/* Grid do Dashboard */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 1.2rem;
}

.card-welcome-summary {
    grid-column: span 8;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 1.2rem;
}

.card-welcome-summary h2 {
    font-size: 1.5rem;
    font-weight: 700;
}

.summary-stats {
    display: flex;
    gap: 1.2rem;
    margin-top: 0.8rem;
}

.stat-box {
    flex: 1;
    background-color: rgba(0, 0, 0, 0.12);
    border: 1px solid var(--border-color);
    padding: 1rem;
    border-radius: 12px;
    text-align: center;
}

.stat-num {
    display: block;
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--primary);
}

.stat-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
}

.card-mood-insight {
    grid-column: span 4;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    gap: 8px;
}

.card-mood-insight .card-header-icon {
    font-size: 2.2rem;
    color: var(--accent);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.08); }
    100% { transform: scale(1); }
}

.card-next-tasks {
    grid-column: span 6;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.card-mini-finance {
    grid-column: span 6;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.mini-finance-chart {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    margin-top: 0.4rem;
}

.finance-progress-bar {
    height: 10px;
    background-color: var(--border-color);
    border-radius: 5px;
    display: flex;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    transition: width 0.5s ease;
}

.progress-fill.income {
    background-color: var(--income);
}

.progress-fill.expense {
    background-color: var(--expense);
}

.finance-legend {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
}

.income-dot { color: var(--income); margin-right: 4px; }
.expense-dot { color: var(--expense); margin-right: 4px; }

.card-quick-note {
    grid-column: span 12;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.card-quick-note textarea {
    width: 100%;
    height: 110px;
    background: rgba(0, 0, 0, 0.15);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 12px;
    color: var(--text-main);
    resize: none;
    font-size: 0.9rem;
    outline: none;
}

.card-quick-note textarea:focus {
    border-color: var(--primary);
}

/* Componentes de Botões */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 18px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: white;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.25);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(99, 102, 241, 0.35);
}

.btn-secondary {
    background-color: var(--border-color);
    color: var(--text-main);
    border: 1px solid transparent;
}

.btn-secondary:hover {
    background-color: var(--bg-card-hover);
    border-color: var(--border-hover);
}

.btn-icon {
    background: none;
    border: none;
    color: var(--text-main);
    font-size: 1rem;
    cursor: pointer;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-icon:hover {
    background-color: var(--border-color);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.2rem;
}

/* Kanban */
.kanban-board {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.2rem;
    align-items: start;
}

.kanban-col {
    background: rgba(0, 0, 0, 0.1);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    min-height: 480px;
}

.col-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 700;
    font-size: 1.05rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border-color);
}

.col-count {
    background-color: var(--border-color);
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 0.75rem;
}

.col-cards {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
    min-height: 380px;
}

/* Kanban Cards */
.kanban-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 0.9rem;
    cursor: grab;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.kanban-card:hover {
    border-color: var(--primary);
}

.task-tag {
    align-self: flex-start;
    padding: 2px 6px;
    border-radius: 6px;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
}

.task-tag.high {
    background-color: var(--expense-bg);
    color: var(--expense);
}

.task-tag.medium {
    background-color: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
}

.task-tag.low {
    background-color: var(--income-bg);
    color: var(--income);
}

.task-title {
    font-weight: 600;
    font-size: 0.9rem;
}

.task-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.task-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.task-actions {
    display: flex;
    gap: 6px;
}

.task-actions button {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.8rem;
}

.task-actions button:hover {
    color: var(--text-main);
}

/* Agenda / Calendário */
.agenda-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.2rem;
}

.calendar-card {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

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

.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    font-weight: 600;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

.calendar-day {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border-radius: 8px;
    font-size: 0.85rem;
    cursor: pointer;
    font-weight: 500;
    position: relative;
}

.calendar-day:hover {
    background-color: var(--border-color);
}

.calendar-day.empty {
    cursor: default;
    background: none !important;
}

.calendar-day.today {
    background-color: var(--primary-glow);
    color: var(--primary);
    border: 1px solid var(--primary);
}

.calendar-day.selected {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: white;
}

.day-dot {
    width: 4px;
    height: 4px;
    background-color: var(--accent);
    border-radius: 50%;
    position: absolute;
    bottom: 4px;
}

.events-list-card {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.events-timeline {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
    overflow-y: auto;
    max-height: 380px;
}

.event-timeline-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-left: 3px solid var(--primary);
    background-color: rgba(0, 0, 0, 0.05);
    border-radius: 0 8px 8px 0;
}

.event-timeline-item.personal { border-left-color: var(--accent); }
.event-timeline-item.finance { border-left-color: var(--income); }
.event-timeline-item.health { border-left-color: #f59e0b; }

.event-time {
    font-weight: 700;
    font-size: 0.75rem;
    color: var(--text-muted);
    min-width: 40px;
}

.event-title {
    font-weight: 600;
    font-size: 0.85rem;
    flex-grow: 1;
}

/* Finanças */
.finances-summary-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.2rem;
    margin-bottom: 1.2rem;
}

.finance-stat {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.finance-stat .stat-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.income-card .stat-icon {
    background-color: var(--income-bg);
    color: var(--income);
}

.expense-card .stat-icon {
    background-color: var(--expense-bg);
    color: var(--expense);
}

.balance-card .stat-icon {
    background-color: rgba(99, 102, 241, 0.12);
    color: var(--primary);
}

.finance-stat .label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
}

.finance-stat h3 {
    font-size: 1.4rem;
    font-weight: 800;
}

.finances-details-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.2rem;
}

.transactions-list-wrapper {
    overflow-x: auto;
    max-height: 380px;
}

.transactions-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.transactions-table th {
    padding: 10px;
    border-bottom: 2px solid var(--border-color);
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 600;
}

.transactions-table td {
    padding: 10px;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.85rem;
}

.transactions-table tr:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.transaction-amount {
    font-weight: 700;
}

.transaction-amount.income { color: var(--income); }
.transaction-amount.expense { color: var(--expense); }

.goals-content {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.goal-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    font-weight: 600;
}

.progress-bar-container {
    height: 8px;
    background-color: var(--border-color);
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    width: 0%;
    transition: width 0.3s ease;
}

/* Chat de IA */
.chat-card {
    height: calc(100vh - 190px);
    display: flex;
    flex-direction: column;
    padding: 0;
    overflow: hidden;
}

.chat-header {
    padding: 0.9rem 1.2rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 10px;
    background-color: rgba(0, 0, 0, 0.05);
}

.chat-avatar {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.chat-meta h3 {
    font-size: 0.95rem;
    font-weight: 700;
}

.status-online {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.7rem;
    color: var(--income);
}

.status-online i { font-size: 0.45rem; }

.chat-messages {
    flex-grow: 1;
    padding: 1.2rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    background: rgba(0, 0, 0, 0.02);
}

.message {
    display: flex;
    max-width: 80%;
}

.message.incoming {
    align-self: flex-start;
}

.message.outgoing {
    align-self: flex-end;
}

.message-bubble {
    padding: 10px 14px;
    border-radius: 16px;
    font-size: 0.9rem;
    line-height: 1.45;
}

.message.incoming .message-bubble {
    background-color: var(--bg-sidebar);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    border-bottom-left-radius: 4px;
}

.message.outgoing .message-bubble {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: white;
    border-bottom-right-radius: 4px;
}

.chat-input-area {
    padding: 0.8rem 1.2rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 10px;
}

.chat-input-area input {
    flex-grow: 1;
    background-color: var(--border-color);
    border: 1px solid transparent;
    border-radius: 12px;
    padding: 10px 14px;
    color: var(--text-main);
    font-size: 0.9rem;
    outline: none;
}

.chat-input-area input:focus {
    border-color: var(--primary);
}

.btn-send {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    transition: transform 0.2s ease;
}

.btn-send:hover {
    transform: scale(1.05);
}

/* Modais */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--bg-sidebar);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    width: 90%;
    max-width: 480px;
    box-shadow: var(--glass-shadow);
    overflow: hidden;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    padding: 1rem 1.2rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-size: 1.15rem;
    font-weight: 700;
}

.modal-close-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.3rem;
    cursor: pointer;
}

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

.modal-body {
    padding: 1.2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.form-group label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
}

.form-group input, .form-group textarea, .form-group select {
    background-color: var(--bg-app);
    border: 1px solid var(--border-color);
    padding: 9px 11px;
    border-radius: 8px;
    color: var(--text-main);
    font-size: 0.85rem;
    outline: none;
}

.form-group input:focus, .form-group textarea:focus, .form-group select:focus {
    border-color: var(--primary);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.8rem;
}

.modal-footer {
    padding: 1rem 1.2rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    background-color: rgba(0, 0, 0, 0.04);
}

/* Empty e helper states */
.empty-state {
    color: var(--text-muted);
    font-size: 0.85rem;
    text-align: center;
    padding: 1.5rem 1rem;
    font-style: italic;
}

.task-mini-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 10px;
    border-bottom: 1px solid var(--border-color);
}

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

.task-mini-item span {
    font-size: 0.85rem;
    font-weight: 500;
}

/* Sliders / Ranges no Modal de Voz */
input[type="range"] {
    -webkit-appearance: none;
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: var(--border-color);
    outline: none;
    margin: 10px 0;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    box-shadow: 0 0 6px var(--primary-glow);
}

/* ============================================================
   RESPONSIVIDADE
   ============================================================ */

/* Previne overflow horizontal em qualquer tamanho de tela */
html, body {
    max-width: 100%;
    overflow-x: hidden;
}

.app-container {
    max-width: 100%;
    overflow-x: hidden;
}

.main-content {
    min-width: 0;
    overflow-x: hidden;
}

/* Tablet — até 1024px */
@media (max-width: 1024px) {
    .sidebar {
        width: 70px;
        padding: 1.5rem 0.4rem;
    }
    .sidebar-brand .brand-name,
    .menu-item span,
    .user-info,
    .theme-toggle span {
        display: none;
    }
    .sidebar-brand {
        justify-content: center;
    }
    .menu-item {
        justify-content: center;
        padding: 11px;
    }
    .user-profile-badge {
        justify-content: center;
        background: none;
        border: none;
        padding: 0;
    }
    .footer-actions {
        flex-direction: column;
        align-items: center;
        gap: 6px;
    }
    .main-content {
        margin-left: 70px;
        padding: 1.2rem;
    }
    .dashboard-grid {
        grid-template-columns: 1fr;
        gap: 0.9rem;
    }
    .card-welcome-summary,
    .card-mood-insight,
    .card-next-tasks,
    .card-mini-finance,
    .card-quick-note {
        grid-column: span 12;
    }
    .agenda-layout,
    .finances-details-layout,
    .filter-row {
        grid-template-columns: 1fr;
    }
    .kanban-board {
        grid-template-columns: 1fr;
    }
    .kanban-col {
        min-height: 220px;
    }
    .col-cards {
        min-height: 120px;
    }
    .finances-summary-grid {
        grid-template-columns: 1fr;
    }
}


/* ============================================================
   MENU HAMBÚRGUER — CELULAR
   ============================================================ */

/* Botão hambúrguer — só aparece no mobile */
.hamburger-btn {
    display: none;
    background: none;
    border: none;
    color: var(--text-main);
    font-size: 1.4rem;
    cursor: pointer;
    padding: 6px 8px;
    border-radius: 8px;
    transition: background-color 0.2s ease;
    flex-shrink: 0;
}
.hamburger-btn:hover {
    background-color: var(--border-color);
}

/* Overlay escuro que aparece atrás do menu aberto */
.menu-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(2px);
    z-index: 150;
}
.menu-overlay.active {
    display: block;
}

@media (max-width: 768px) {


    /* Esconde sidebar fixa lateral */
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
        width: 250px;
        z-index: 200;
        padding: 1.5rem 1rem;
        box-shadow: 4px 0 24px rgba(0,0,0,0.4);
        overflow-y: auto !important;
        max-height: 100vh !important;
    }

    /* Sidebar aberta via JS */
    .sidebar.mobile-open {
        transform: translateX(0);
    }

    /* Restaura exibição de textos e elementos na barra lateral mobile */
    .sidebar-brand .brand-name,
    .menu-item span,
    .user-info {
        display: block !important;
    }

    .sidebar-brand {
        justify-content: flex-start !important;
        gap: 12px !important;
        margin-bottom: 2rem !important;
    }

    /* Aumenta o tamanho dos ícones em 100% no mobile */
    .menu-item i {
        font-size: 1.8rem !important;
        width: 32px !important;
    }

    .brand-icon {
        width: 46px !important;
        height: 46px !important;
        font-size: 1.5rem !important;
    }

    .user-avatar-mini {
        font-size: 2.4rem !important;
    }

    .theme-toggle i,
    .btn-logout i {
        font-size: 1.4rem !important;
    }

    /* Puxa o menu e rodapé para cima */
    .sidebar-menu {
        flex-grow: 0 !important;
        margin-bottom: 1.5rem !important;
    }

    /* Restaura o badge do perfil do usuário */
    .user-profile-badge {
        display: flex !important;
        background-color: rgba(0, 0, 0, 0.15) !important;
        border: 1px solid var(--border-color) !important;
        border-radius: 10px !important;
        padding: 8px !important;
        justify-content: flex-start !important;
        margin-bottom: 12px !important;
    }

    .user-info {
        display: flex !important;
        flex-direction: column !important;
    }

    /* Rodapé com botões de ação organizados lado a lado */
    .footer-actions {
        flex-direction: row !important;
        align-items: center !important;
        justify-content: space-between !important;
        gap: 10px !important;
        width: 100% !important;
    }

    .footer-actions .theme-toggle,
    .btn-logout {
        padding: 12px !important;
        height: 46px !important;
        flex: 1 !important;
    }

    /* Conteúdo ocupa largura total */
    .main-content {
        margin-left: 0;
        padding: 0.75rem 0.65rem;
        gap: 0.75rem;
    }

    /* Botão hambúrguer visível */
    .hamburger-btn {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* Header com hambúrguer à esquerda */
    .app-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
        padding-bottom: 0.75rem;
    }

    .header-top-row {
        display: flex;
        align-items: center;
        gap: 0.6rem;
        width: 100%;
    }

    .header-welcome {
        flex: 1;
    }

    .header-welcome h1 {
        font-size: 1.25rem;
    }

    #header-date {
        font-size: 0.78rem;
    }

    .header-actions {
        width: 100%;
        flex-wrap: wrap;
        gap: 0.5rem;
        justify-content: space-between;
    }

    .header-actions .btn {
        font-size: 0.78rem;
        padding: 7px 11px;
    }

    .status-label {
        display: none;
    }

    .user-status-widget {
        padding: 5px 8px;
    }

    /* Cards compactos */
    .card {
        padding: 0.75rem;
        border-radius: 12px;
    }
    .card:hover {
        transform: none;
    }

    /* Dashboard */
    .dashboard-grid { gap: 0.6rem; }
    .card-welcome-summary h2 { font-size: 1rem; }
    .summary-stats { gap: 0.5rem; margin-top: 0.4rem; }
    .stat-box { padding: 0.5rem 0.35rem; border-radius: 8px; }
    .stat-num { font-size: 1.1rem; }
    .stat-label { font-size: 0.66rem; }

    /* Kanban compacto */
    .kanban-col { min-height: 150px; padding: 0.6rem; }
    .col-cards { min-height: 80px; }

    /* Tabelas com scroll horizontal */
    .transactions-list-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        max-height: 280px;
    }
    .transactions-table { min-width: 480px; }
    .transactions-table th,
    .transactions-table td { padding: 7px 6px; font-size: 0.78rem; }

    /* Finanças */
    .finances-summary-grid { gap: 0.6rem; }
    .finance-stat h3 { font-size: 1rem; }
    .finance-stat .stat-icon { width: 36px; height: 36px; font-size: 1rem; }

    /* Agenda */
    .calendar-day { font-size: 0.75rem; }
    .events-timeline { max-height: 250px; }

    /* Nota rápida */
    .card-quick-note textarea { height: 75px; font-size: 0.85rem; }

    /* Chat */
    .chat-card { height: calc(100vh - 160px); }

    /* Section header */
    .section-header { flex-direction: column; align-items: flex-start; gap: 0.5rem; margin-bottom: 0.75rem; }
    .section-header h2 { font-size: 1.1rem; }
    .section-header .btn { font-size: 0.78rem; padding: 7px 11px; }

    /* Filtros */
    .filter-row { gap: 0.5rem; }

    /* Modal */
    .modal-content { width: 96%; border-radius: 14px; max-height: 90vh; overflow-y: auto; }
    .modal-body { padding: 0.85rem; gap: 0.75rem; }
    .form-row { grid-template-columns: 1fr; gap: 0.6rem; }
    .modal-footer { padding: 0.75rem 0.85rem; }
}

/* ==========================================================================
   POST-IT DE COBRANÇAS PENDENTES / URGENTES
   ========================================================================== */
.sticky-billing-alert {
    position: fixed;
    top: calc(50% - 130px);
    left: calc(50% - 160px);
    width: 320px;
    background: rgba(30, 27, 22, 0.95); /* Fundo escuro com tom âmbar */
    border: 1px solid rgba(245, 158, 11, 0.4); /* Borda laranja translúcida */
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 15px rgba(245, 158, 11, 0.1);
    backdrop-filter: blur(12px);
    z-index: 1000;
    overflow: hidden;
    animation: slideInSticky 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes slideInSticky {
    from {
        transform: translateY(100px) scale(0.9);
        opacity: 0;
    }
    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

@keyframes slideOutSticky {
    from {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
    to {
        transform: translateY(100px) scale(0.9);
        opacity: 0;
    }
}

.sticky-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: rgba(245, 158, 11, 0.12);
    border-bottom: 1px solid rgba(245, 158, 11, 0.2);
    color: #f59e0b;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    cursor: grab;
    user-select: none;
}

.sticky-header:active {
    cursor: grabbing;
}

.close-sticky-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.3rem;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s;
}

.close-sticky-btn:hover {
    color: #f59e0b;
}

.sticky-body {
    padding: 16px;
}

.sticky-body h4 {
    font-size: 1.05rem;
    color: var(--text-main);
    margin-bottom: 6px;
    font-weight: 600;
}

.sticky-body h3 {
    font-size: 1.6rem;
    color: var(--expense);
    margin-bottom: 8px;
    font-weight: 700;
    font-family: 'Outfit', sans-serif;
}

.sticky-body p {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 4px;
}

/* Ajuste Responsivo Mobile */
@media (max-width: 768px) {
    .sticky-billing-alert {
        top: calc(50% - 130px) !important;
        left: calc(50% - 150px) !important;
        width: 300px !important;
        bottom: auto !important;
        right: auto !important;
        z-index: 1001; /* Fica acima do menu hambúrguer */
    }
}
