.user-profile { position: relative; }
#userProfileBtn {
    border: 2px solid var(--color-accent);
    box-shadow: 0 0 0 2px var(--color-surface);
    color: var(--color-accent);
}
.profile-popover {
    position: absolute; top: calc(100% + 12px); right: 0;
    width: 180px; background-color: var(--color-surface);
    border-radius: var(--border-radius-md); z-index: 1020;
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-md);
    padding: 8px;
    display: flex; flex-direction: column;
    opacity: 0; transform: translateY(10px);
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
}
.profile-popover.visible {
    opacity: 1; transform: translateY(0); pointer-events: auto;
}
.popover-item {
    font-weight: 500; font-size: 15px; color: var(--color-text-primary);
    padding: 10px 12px; border-radius: var(--border-radius-sm);
    text-decoration: none; display: block;
    transition: all 0.2s ease;
}
.popover-item:hover {
    background-color: var(--color-bg-light); color: var(--color-accent);
}
.popover-item:not(:last-child) { margin-bottom: 4px; }
.date-popover {
    position: fixed; margin-top: 8px; z-index: 1010;
    width: 280px; background: var(--color-surface); border-radius: var(--border-radius-lg);
    box-shadow: 0 10px 25px rgba(0,0,0,0.1); border: 1px solid var(--color-border);
    display: none; flex-direction: column;
}
.date-popover.visible { display: flex; animation: fadeInUp 0.2s ease-out; }
.popover-header { display: flex; justify-content: space-between; align-items: center; padding: 12px 12px 8px; background-color: var(--color-bg-light); border-bottom: 1px solid var(--color-border); border-radius: var(--border-radius-lg) var(--border-radius-lg) 0 0;}
.popover-header span { font-size: 16px; font-weight: 600; }
.popover-header button { background: none; border: none; cursor: pointer; padding: 4px; border-radius: 50%; }
.popover-header button:hover { background-color: var(--color-border); }
.popover-body { padding: 12px; }
.popover-months { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.month-item { padding: 10px; text-align: center; font-size: 14px; font-weight: 500; border-radius: var(--border-radius-sm); cursor: pointer; transition: background-color 0.2s, color 0.2s; }
.month-item:hover { background-color: var(--color-accent-light); }
.month-item.selected { background-color: var(--color-accent); color: #fff; font-weight: 600; }
.popover-footer { padding: 8px 12px 12px; border-top: 1px solid var(--color-border); }
.btn-mes-atual { width: 100%; height: 36px; padding: 0; font-size: 14px; }
.offcanvas-backdrop {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(30, 32, 34, 0.5); z-index: 1040;
    opacity: 0; transition: opacity 0.3s ease; pointer-events: none;
}
.offcanvas-backdrop.open { opacity: 1; pointer-events: auto; }
.offcanvas {
    position: fixed; top: 0; right: -450px; width: 100%; max-width: 420px;
    height: 100%; background-color: var(--color-bg); z-index: 1050;
    display: flex; flex-direction: column;
    box-shadow: -10px 0 30px rgba(0,0,0,0.1);
    transition: right 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.offcanvas.open { right: 0; }
.offcanvas-header {
    padding: 24px; border-bottom: 1px solid var(--color-border);
    display: flex; justify-content: space-between; align-items: center;
    background-color: var(--color-surface); flex-shrink: 0;
}
.offcanvas-header h2 { font-size: 20px; font-weight: 600; color: var(--color-text-primary); margin: 0; }
.offcanvas-header button {
    background: none; border: none; font-size: 28px; line-height: 1;
    color: var(--color-text-tertiary); cursor: pointer; padding: 4px; border-radius: 50%;
    width: 36px; height: 36px;
}
.offcanvas-header button:hover {
    color: var(--color-accent); background-color: var(--color-accent-light);
}
.offcanvas-body { padding: 24px; overflow-y: auto; flex-grow: 1; }
.offcanvas-footer {
    padding: 20px 24px; border-top: 1px solid var(--color-border);
    background-color: var(--color-surface); flex-shrink: 0;
    display: flex; justify-content: flex-end; gap: 12px;
}
.modal-backdrop {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(30, 32, 34, 0.6);
    z-index: 2000;
    opacity: 0;
    transition: opacity 0.25s ease;
    pointer-events: none;
}
.modal-backdrop.visible {
    opacity: 1;
    pointer-events: auto;
}
.modal {
    position: fixed; top: 50%; left: 50%;
    transform: translate(-50%, -50%) scale(0.95);
    background-color: var(--color-surface);
    width: 100%; max-width: 440px;
    border-radius: var(--border-radius-lg);
    box-shadow: 0 15px 40px rgba(0,0,0,0.15);
    z-index: 2010;
    display: flex; flex-direction: column;
    opacity: 0;
    transition: opacity 0.25s ease, transform 0.25s ease;
    pointer-events: none;
}
.modal.visible {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
    pointer-events: auto;
}
.modal-header {
    padding: 24px 24px 0;
    text-align: center;
    position: relative;
}
.modal-icon-container {
    width: 60px; height: 60px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 16px;
    transition: all 0.3s ease;
}
.modal-icon-container.success { background-color: #dcfce7; color: var(--color-green); }
.modal-icon-container.error { background-color: #fee2e2; color: var(--color-red); }
.modal-icon-container.confirm { background-color: #ffedd5; color: var(--color-orange); }
.modal-icon-container.info { background-color: var(--color-accent-light); color: var(--color-accent); }
.modal-icon-container .lucide {
    width: 32px; height: 32px;
}
.modal-header h3 {
    font-size: 22px;
    font-weight: 700;
    color: var(--color-text-primary);
}
.modal-close-btn {
    position: absolute;
    top: 12px; right: 12px;
    background: none; border: none;
    color: var(--color-text-tertiary);
    font-size: 28px; line-height: 1;
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
    width: 36px; height: 36px;
}
.modal-close-btn:hover {
    background-color: var(--color-bg-light);
}
.modal-body {
    padding: 16px 24px;
    text-align: center;
    font-size: 16px;
    color: var(--color-text-secondary);
    line-height: 1.6;
}
#modalContentTextarea {
    width: 100%;
    min-height: 150px;
    padding: 12px;
    font-family: var(--font-family);
    font-size: 15px;
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius-md);
    resize: vertical;
    margin-top: 12px;
    text-align: left;
}
#modalContentTextarea:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px var(--color-accent-glow);
}
.modal-footer {
    padding: 24px;
    display: flex;
    justify-content: center;
    gap: 12px;
    background-color: var(--color-bg);
    border-bottom-left-radius: var(--border-radius-lg);
    border-bottom-right-radius: var(--border-radius-lg);
}
.modal-footer .btn {
    height: 48px;
    flex-grow: 1;
}
.download-popover {
    position: fixed;
    width: 200px;
    background-color: var(--color-surface);
    border-radius: var(--border-radius-md);
    z-index: 1020;
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-md);
    padding: 8px;
    display: flex;
    flex-direction: column;
    opacity: 0;
    transform: translateY(10px);
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
}
.download-popover.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}
.popover-item-action {
    font-weight: 500; font-size: 15px; color: var(--color-text-primary);
    padding: 10px 12px; border-radius: var(--border-radius-sm);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.2s ease;
    background: none;
    border: none;
    cursor: pointer;
    text-align: left;
}
.popover-item-action:hover {
    background-color: var(--color-bg-light);
    color: var(--color-accent);
}
.popover-item-action .lucide {
    width: 18px;
    height: 18px;
}
.batch-progress-wrapper {
    padding: 10px 0 20px;
}
.batch-progress-text {
    font-size: 15px;
    font-weight: 600;
    color: var(--color-text-primary);
    margin-bottom: 12px;
    text-align: center;
}
.batch-progress-bar {
    height: 10px;
    background-color: var(--color-bg-light);
    border-radius: 10px;
    overflow: hidden;
}
.batch-progress-fill {
    height: 100%;
    background: var(--color-accent-gradient);
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 10px;
}
.batch-result-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 8px;
    text-align: left;
}
.batch-summary {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    border-radius: 10px;
    font-weight: 500;
    font-size: 15px;
}
.batch-summary .lucide {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}
.batch-summary.success {
    background-color: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
}
.batch-summary.warning {
    background-color: #fef9c3;
    color: #854d0e;
    border: 1px solid #fde047;
}
.batch-summary.error {
    background-color: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}
.batch-error-section-title {
    font-weight: 600;
    font-size: 14px;
    color: var(--color-text-secondary);
    margin-bottom: 8px;
    display: block;
}
.batch-error-list {
    max-height: 180px;
    overflow-y: auto;
    background-color: #fffaf5;
    border: 1px solid #fed7aa;
    border-radius: 8px;
    padding: 12px;
}
.batch-error-list::-webkit-scrollbar { width: 6px; }
.batch-error-list::-webkit-scrollbar-track { background: transparent; }
.batch-error-list::-webkit-scrollbar-thumb { background-color: #fdba74; border-radius: 10px; }
.batch-error-list ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.batch-error-list li {
    font-size: 13.5px;
    color: #9a3412;
    padding-bottom: 10px;
    border-bottom: 1px solid #ffedd5;
    line-height: 1.4;
}
.batch-error-list li:last-child {
    border-bottom: none;
    padding-bottom: 0;
}
.batch-error-name {
    font-weight: 700;
    display: block;
    margin-bottom: 2px;
    color: #7c2d12;
}