@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
    --bg-page: #f6f3ee;
    --paper-bg: #faf7f2;
    --paper-card: #fdfbf8;
    --text-primary: #374151;
    --text-secondary: #6c584c;
    --text-muted: #9c8a7c;
    --text-dark: #2d3748;

    --border-light: #e5dbcf;
    --border-dashed: #dfd1c3;
    --border-warm: #cdbfae;

    /* Cores de Destaque Harmonizadas com a Seção 3 */
    --accent: #b56576;           /* Rosé terracota refinado */
    --accent-light: #fce7e1;     /* Rosa suave da washi tape */
    --accent-hover: #9c4f60;
    --accent-purple: #6d597a;    /* Lilás / lavanda do sábado */
    --accent-purple-light: #e2d9f3;
    --accent-peach: #fcd5ce;     /* Pêssego suave do domingo */

    --success: #10b981;
    --warning: #d97706;
    --danger: #e56b6f;

    --today-border: #b56576;
    --today-bg: #fdf2f4;

    --shadow-paper: 0 10px 28px -6px rgba(60, 45, 30, 0.08), 0 4px 12px rgba(60, 45, 30, 0.04);
    --shadow-sm: 0 1px 3px rgba(60, 45, 30, 0.06);
    --shadow-spread: 0 14px 38px -10px rgba(60, 45, 30, 0.12), 0 4px 14px rgba(60, 45, 30, 0.06);

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 18px;

    --font-main: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

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

html {
    overflow-x: hidden;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-page);
    color: var(--text-primary);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    padding-bottom: 60px;
    overflow-x: hidden;
    width: 100%;
    position: relative;
}

.planner-container {
    max-width: 1440px;
    margin: 0 auto;
    padding: 24px 20px;
}

/* =========================================
   Top Bar / Header
   ========================================= */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    background: var(--paper-bg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    margin-bottom: 24px;
    border: 1px solid var(--border-light);
}

.brand-area {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-logo {
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, #b56576, #6d597a);
    color: white;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 18px;
    letter-spacing: -0.5px;
    box-shadow: 0 2px 6px rgba(181, 101, 118, 0.3);
    position: relative;
    overflow: hidden;
}

.brand-logo.has-photo {
    background: transparent !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15) !important;
}

.brand-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: inherit;
}

.brand-logo-text {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    font-weight: 700;
}

.brand-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

.brand-subtitle {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}

.year-nav {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f0ebe4;
    padding: 4px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
}

.btn-icon {
    background: none;
    border: none;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: 600;
    color: var(--text-secondary);
    transition: all 0.15s ease;
}

.btn-icon:hover {
    background: #ffffff;
    color: var(--accent);
    box-shadow: var(--shadow-sm);
}

.current-year-label {
    font-size: 16px;
    font-weight: 700;
    padding: 0 12px;
    color: var(--text-primary);
    font-family: var(--font-mono);
}

.header-right-area {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-profile-badge {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #fdf2f4;
    border: 1px solid #f9d5ca;
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    color: var(--text-dark);
    flex-shrink: 0;
}

.user-greeting {
    white-space: nowrap;
    text-decoration: none;
    color: var(--text-dark);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: color 0.15s ease, transform 0.15s ease;
}

.user-greeting:hover {
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.btn-logout {
    font-size: 12px;
    color: var(--accent);
    text-decoration: none;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 4px;
    background: rgba(181, 101, 118, 0.1);
    transition: all 0.15s ease;
}

.btn-logout:hover {
    background: var(--accent);
    color: #ffffff;
}

/* =========================================
   Section 1: Annual Calendar Grid
   ========================================= */
.calendar-section {
    background: var(--paper-bg);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-paper);
    border: 1px solid var(--border-light);
    margin-bottom: 32px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-light);
}

.section-title {
    font-size: 16px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.calendar-legend {
    display: flex;
    gap: 16px;
    font-size: 12px;
    color: var(--text-secondary);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.legend-bullet {
    width: 10px;
    height: 10px;
    border-radius: 3px;
}

.legend-today {
    background: var(--today-bg);
    border: 1.5px solid var(--today-border);
}

.legend-active {
    background: var(--accent);
}

.months-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

@media (max-width: 1200px) {
    .months-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 900px) {
    .months-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .months-grid {
        grid-template-columns: 1fr;
    }
}

.month-card {
    background: var(--paper-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 12px 14px;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.month-card:hover {
    box-shadow: 0 6px 16px rgba(60, 45, 30, 0.08);
    border-color: var(--border-warm);
}

.month-name {
    text-align: center;
    font-size: 14px;
    font-weight: 700;
    color: #5b4636;
    background: #f3ede6;
    margin-bottom: 8px;
    padding: 6px 8px;
    border-radius: 6px;
    border-bottom: 1px solid var(--border-dashed);
    letter-spacing: 0.5px;
    transition: all 0.15s ease;
}

.month-name:hover {
    background: #ebdcd0;
    color: var(--accent);
}

.month-table {
    width: 100%;
    border-collapse: collapse;
    text-align: center;
    font-size: 12px;
}

.month-table th {
    font-weight: 600;
    color: var(--text-muted);
    padding: 4px 0;
    font-size: 11px;
}

.month-table td {
    padding: 3px 0;
}

.day-cell {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    text-decoration: none;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.12s ease;
    border: none;
    background: transparent;
}

.day-cell:hover:not(.empty) {
    background: var(--accent-light);
    color: var(--accent);
    font-weight: 700;
}

.day-cell.is-today {
    border: 1.5px solid var(--today-border);
    background: var(--today-bg);
    color: var(--accent);
    font-weight: 700;
}

.day-cell.is-active {
    background: var(--accent) !important;
    color: #ffffff !important;
    font-weight: 700 !important;
    box-shadow: 0 2px 8px rgba(181, 101, 118, 0.4);
}

.day-cell.empty {
    cursor: default;
    color: transparent;
}

/* =========================================
   Section 2: Daily Editable Sheet
   ========================================= */
.daily-section {
    background: var(--paper-bg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-spread);
    border: 1px solid var(--border-light);
    padding: 36px 36px 32px 36px;
    position: relative;
    overflow: hidden;
    transition: opacity 0.2s ease;
}

/* Faixa Washi Tape sutil no topo da folha diária */
.daily-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 12px;
    background: repeating-linear-gradient(
        -45deg,
        #fce7e1,
        #fce7e1 14px,
        #f9d5ca 14px,
        #f9d5ca 28px,
        #f3e8db 28px,
        #f3e8db 42px,
        #ecdcf5 42px,
        #ecdcf5 56px
    );
    border-bottom: 1px dashed #e1cfc2;
}

.daily-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--border-dashed);
    margin-bottom: 28px;
    flex-wrap: wrap;
    gap: 16px;
}

.daily-date-info {
    display: flex;
    flex-direction: column;
}

.daily-weekday {
    font-size: 15px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--accent);
}

.daily-full-date {
    font-size: 28px;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

.daily-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.status-badge {
    font-size: 13px;
    font-weight: 600;
    padding: 6px 14px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 6px;
    background: #f3ede6;
    color: var(--text-secondary);
    border: 1px solid var(--border-light);
    transition: all 0.2s ease;
}

.status-badge.saved {
    background: #ecfdf5;
    color: var(--success);
    border-color: #a7f3d0;
}

.status-badge.saving {
    background: #fffbeb;
    color: var(--warning);
    border-color: #fde68a;
}

.status-badge.error {
    background: #fef2f2;
    color: var(--danger);
    border-color: #fecaca;
}

.btn-primary {
    background: var(--accent);
    color: white;
    border: none;
    padding: 8px 18px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(181, 101, 118, 0.3);
    transition: all 0.15s ease;
}

.btn-primary:hover {
    background: var(--accent-hover);
    box-shadow: 0 4px 10px rgba(181, 101, 118, 0.4);
}

.btn-secondary {
    background: #ffffff;
    color: var(--text-secondary);
    border: 1px solid var(--border-light);
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: all 0.15s ease;
}

.btn-secondary:hover {
    background: #f5ede4;
    border-color: var(--border-warm);
    color: var(--text-primary);
}

/* =========================================
   Planner Sheet Columns (Grid)
   ========================================= */
.sheet-grid {
    display: grid;
    grid-template-columns: 1fr 280px 340px;
    gap: 28px;
}

@media (max-width: 1024px) {
    .sheet-grid {
        grid-template-columns: 1fr;
        gap: 22px;
    }
    .col-priorities {
        order: 1;
    }
    .col-agenda {
        order: 2;
    }
    .col-notes {
        order: 3;
    }
}

.sheet-col {
    display: flex;
    flex-direction: column;
}

.col-header {
    font-size: 13.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    padding: 8px 12px;
    background: #f3ede6;
    border-bottom: 2px solid var(--border-dashed);
    color: #5b4636;
    border-radius: 4px;
    margin-bottom: 10px;
}

/* Agenda Column */
.agenda-list {
    display: flex;
    flex-direction: column;
}

.agenda-row {
    display: flex;
    align-items: center;
    height: 38px;
    border-bottom: 1px dashed var(--border-dashed);
    padding: 2px 4px;
}

.agenda-time {
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 700;
    color: var(--text-secondary);
    width: 52px;
    flex-shrink: 0;
}

.agenda-input {
    flex: 1;
    border: none;
    background: transparent;
    font-family: var(--font-main);
    font-size: 13.5px;
    font-weight: 500;
    color: var(--text-dark);
    padding: 4px 6px;
    outline: none;
    transition: background 0.1s;
}

.agenda-input:focus {
    background: #ffffff;
    border-radius: 4px;
    box-shadow: inset 0 0 0 1px var(--border-light);
}

/* Priorities & Tasks Column */
.priorities-block {
    margin-bottom: 20px;
}

.priority-row {
    display: flex;
    align-items: center;
    height: 36px;
    border-bottom: 1px dashed var(--border-dashed);
    padding: 2px 4px;
    gap: 8px;
}

.priority-number {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #f0ebe4;
    color: #6c584c;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    flex-shrink: 0;
}

.priority-input {
    flex: 1;
    border: none;
    background: transparent;
    font-family: var(--font-main);
    font-size: 13.5px;
    font-weight: 500;
    color: var(--text-dark);
    padding: 4px;
    outline: none;
}

.priority-input:focus {
    background: #ffffff;
    border-radius: 4px;
    box-shadow: inset 0 0 0 1px var(--border-light);
}

.tasks-list {
    display: flex;
    flex-direction: column;
}

.task-row {
    display: flex;
    align-items: center;
    height: 34px;
    border-bottom: 1px dashed var(--border-dashed);
    padding: 2px 4px;
    gap: 10px;
}

.task-checkbox {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--accent);
    flex-shrink: 0;
}

.task-input {
    flex: 1;
    border: none;
    background: transparent;
    font-family: var(--font-main);
    font-size: 13.5px;
    font-weight: 500;
    color: var(--text-dark);
    padding: 4px;
    outline: none;
    transition: all 0.15s ease;
}

.task-input:focus {
    background: #ffffff;
    border-radius: 4px;
    box-shadow: inset 0 0 0 1px var(--border-light);
}

.task-input.is-done {
    text-decoration: line-through;
    color: var(--text-muted);
}

/* Notes Column */
.notes-container {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.notes-textarea {
    width: 100%;
    flex: 1;
    min-height: 580px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    box-sizing: border-box;
    font-family: var(--font-main);
    font-size: 13.5px;
    line-height: 32px;
    padding: 4px 16px 8px 16px;
    color: var(--text-dark);
    background-color: var(--paper-card);
    background-image: repeating-linear-gradient(transparent, transparent 31px, #e8dfd5 32px);
    outline: none;
    resize: vertical;
    transition: border-color 0.15s ease;
}

.notes-textarea:focus {
    border-color: var(--accent);
}

/* Navigation Month Bar */
.month-days-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 24px;
    padding: 8px 12px;
    background: #f3ede6;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-dashed);
}

@media (max-width: 768px) {
    .month-days-strip {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
        padding: 10px 8px;
        gap: 6px;
    }
}

.strip-day {
    padding: 4px 8px;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-secondary);
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.1s;
    user-select: none;
}

@media (max-width: 768px) {
    .strip-day {
        flex-shrink: 0;
        min-width: 38px;
        min-height: 38px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        font-size: 13.5px;
    }
}

.strip-day:hover {
    background: #e5dbcf;
    color: var(--text-primary);
}

.strip-day.active {
    background: var(--accent);
    color: white;
    font-weight: 700;
}

/* =========================================
   Navegação Rápida entre Seções (Header)
   ========================================= */
.section-quick-nav {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #f0ebe4;
    padding: 5px 8px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
}

.nav-pill {
    padding: 8px 16px;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--radius-sm);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    border: 1px solid transparent;
}

.nav-pill:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.6);
}

.nav-pill.active {
    color: #ffffff !important;
    background: var(--accent) !important;
    border-color: var(--accent) !important;
    box-shadow: 0 2px 8px rgba(181, 101, 118, 0.35) !important;
}

/* =========================================
   Gerenciamento das Abas Principais (Exibe apenas a aba ativa)
   ========================================= */
.planner-tab-panel {
    display: none !important;
}

.planner-tab-panel.active {
    display: block !important;
    animation: fadeInPlannerTab 0.22s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

/* =========================================
   SEÇÃO 3: Resumo Mensal / Folha Mensal (Spread / Caderno Aberto)
   ========================================= */
.monthly-summary-section {
    margin-top: 0;
    margin-bottom: 40px;
    scroll-margin-top: 24px;
}

.monthly-controls-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--paper-bg);
    padding: 18px 24px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}

.monthly-title-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.monthly-badge-icon {
    font-size: 26px;
    background: #fdf2f8;
    padding: 6px 10px;
    border-radius: 12px;
    border: 1px solid #fbcfe8;
}

.monthly-section-heading {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.monthly-section-subheading {
    font-size: 13px;
    color: var(--text-secondary);
}

.monthly-nav-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.month-select-container {
    position: relative;
}

.month-dropdown {
    padding: 7px 16px;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    color: var(--text-primary);
    background: #ffffff;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    outline: none;
    transition: border-color 0.15s ease;
}

.month-dropdown:focus {
    border-color: var(--accent);
}

.monthly-action-buttons {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Moldura Geral do Caderno Aberto (Spread) */
.spread-book-wrapper {
    background: #faf7f2;
    border-radius: 20px;
    border: 1px solid #e5dbcf;
    box-shadow: 0 14px 38px -10px rgba(60, 45, 30, 0.12), 0 4px 14px rgba(60, 45, 30, 0.06);
    overflow: hidden;
    position: relative;
}

/* Faixa Superior Estilo Washi Tape com Listras Suaves */
.spread-washi-tape {
    height: 24px;
    background: repeating-linear-gradient(
        -45deg,
        #fce7e1,
        #fce7e1 14px,
        #f9d5ca 14px,
        #f9d5ca 28px,
        #f3e8db 28px,
        #f3e8db 42px,
        #ecdcf5 42px,
        #ecdcf5 56px
    );
    border-bottom: 2px dashed #e1cfc2;
}

/* Cabeçalho do Caderno com Título do Mês Centralizado */
.spread-book-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 28px 12px 28px;
    background: #fdfbf8;
    border-bottom: 1px solid #ebdcd0;
}

.spread-flair-left {
    font-size: 18px;
    color: #e5989b;
}

.spread-month-title-wrap {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.spread-main-month-name {
    font-size: 28px;
    font-weight: 800;
    letter-spacing: 3px;
    color: #4a5568;
    margin: 0;
    text-transform: uppercase;
}

.spread-sub-month-name {
    font-size: 18px;
    font-weight: 500;
    color: #a0aec0;
    font-style: italic;
}

.spread-year-pill {
    font-size: 13px;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 14px;
    background: #f0ebe4;
    color: #718096;
    letter-spacing: 0.5px;
}

/* Grade Principal da Folha Dupla */
.spread-grid-container {
    display: flex;
    flex-direction: column;
    background: #fdfbf7;
}

/* Cabeçalhos das 8 Colunas (Notas + 7 Dias) */
.spread-header-row {
    display: grid;
    grid-template-columns: 210px repeat(7, 1fr);
    background: #f3ede6;
    border-bottom: 2px solid #dfd1c3;
}

.spread-col-head {
    padding: 8px 6px;
    text-align: center;
    font-size: 13px;
    font-weight: 700;
    color: #555e6c;
    border-right: 1px solid #e4d7cb;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.spread-col-head.head-notes {
    background: #ebdcd0;
    color: #5b4636;
    font-weight: 800;
}

.spread-col-head.head-sat {
    background: #e2d9f3;
    color: #553c7b;
}

.spread-col-head.head-sun {
    background: #fcd5ce;
    color: #8c3b4d;
}

.head-heart {
    color: #e56b6f;
    font-size: 11px;
    margin: 0 1px;
}

.spread-col-head.head-spine-border {
    border-right: 2px solid #cdbfae;
    box-shadow: inset -4px 0 6px -3px rgba(60, 45, 30, 0.12);
}

/* Layout do Corpo: Lateral de Notas + Semanas */
.spread-body-layout {
    display: grid;
    grid-template-columns: 210px 1fr;
    min-height: 700px;
}

/* Coluna Lateral de Notas */
.spread-notes-sidebar {
    background: #fbf7f0;
    border-right: 1px solid #e4d7cb;
    display: flex;
    flex-direction: column;
}

.notes-sidebar-header {
    padding: 8px 12px;
    background: #f7efe6;
    border-bottom: 1px dashed #e4d7cb;
}

.notes-sidebar-tag {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: #7d6350;
}

.notes-sidebar-editor {
    flex: 1;
    padding: 8px 10px;
    display: flex;
}

.spread-notes-textarea {
    width: 100%;
    min-height: 280px;
    border: none;
    outline: none;
    resize: none;
    font-family: inherit;
    font-size: 13px;
    line-height: 24px;
    color: #2d3748;
    background: repeating-linear-gradient(
        transparent,
        transparent 23px,
        #e8dfd5 24px
    );
    padding: 2px 4px;
    box-sizing: border-box;
}

/* Mini Calendários na Base da Barra de Notas */
.spread-mini-calendars {
    padding: 12px 10px;
    background: #f5ebe0;
    border-top: 1px solid #e4d7cb;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.mini-cal-card {
    background: #ffffff;
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid #e7ded4;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.mini-cal-title {
    font-size: 11px;
    font-weight: 700;
    text-align: center;
    color: #6c584c;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.mini-cal-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 10px;
    text-align: center;
}

.mini-cal-table th {
    color: #9c8a7c;
    font-weight: 600;
    padding: 2px 0;
    border-bottom: 1px solid #f0e6db;
}

.mini-cal-table td {
    padding: 2px 0;
    color: #4a5568;
}

.mini-cal-table td.empty {
    color: transparent;
}

/* Grade de Semanas */
.spread-weeks-grid {
    display: flex;
    flex-direction: column;
}

.spread-week-row {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    border-bottom: 1px solid #e6ded6;
    min-height: 125px;
}

.spread-week-row:last-child {
    border-bottom: none;
}

.spread-day-cell {
    border-right: 1px solid #e6ded6;
    display: flex;
    flex-direction: column;
    background: #ffffff;
    position: relative;
    transition: background-color 0.1s ease;
}

.spread-day-cell:last-child {
    border-right: none;
}

.spread-day-cell.is-weekend {
    background: #fbf9f6;
}

.spread-day-cell.is-today {
    background: #fefcf3;
}

.spread-day-cell.spine-divider {
    border-right: 2px solid #cdbfae !important;
    box-shadow: inset -6px 0 8px -4px rgba(60, 45, 30, 0.1);
}

.day-cell-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 6px 2px 6px;
}

.day-num-badge {
    font-size: 13px;
    font-weight: 700;
    color: #334155;
    line-height: 1;
}

.day-num-badge.today-badge {
    background: var(--accent);
    color: #ffffff;
    padding: 2px 6px;
    border-radius: 10px;
}

.btn-cell-jump {
    background: transparent;
    border: none;
    color: #a0aec0;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 4px;
    transition: all 0.15s ease;
}

.btn-cell-jump:hover {
    color: var(--accent);
    background: #f1f5f9;
}

.day-cell-content {
    flex: 1;
    display: flex;
    padding: 2px 4px 4px 4px;
}

.spread-day-input {
    width: 100%;
    height: 100%;
    min-height: 90px;
    border: none;
    outline: none;
    resize: none;
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    line-height: 20px;
    color: #1e293b;
    background: repeating-linear-gradient(
        transparent,
        transparent 19px,
        #f0eae2 20px
    );
    padding: 2px 4px;
    box-sizing: border-box;
    border-radius: 3px;
}

.spread-day-input:focus {
    background-color: rgba(255, 255, 255, 0.85);
}

.empty-day-texture {
    width: 100%;
    height: 100%;
    min-height: 110px;
    background: repeating-linear-gradient(
        45deg,
        #fcfaf6,
        #fcfaf6 8px,
        #f7f2ea 8px,
        #f7f2ea 16px
    );
}

/* Adaptação Responsiva para Telas Menores */
@media (max-width: 1100px) {
    .spread-header-row {
        grid-template-columns: 160px repeat(7, 1fr);
    }
    .spread-body-layout {
        grid-template-columns: 160px 1fr;
    }
}

@media (max-width: 900px) {
    .spread-book-wrapper {
        overflow-x: auto;
    }
    .spread-grid-container {
        min-width: 820px;
    }
}

/* ========================================================
   SEÇÃO 4: Controle Financeiro (Estilo Caderno Aberto)
   ======================================================== */
.financial-control-section {
    margin-bottom: 50px;
}

.finance-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fdfbf8;
    border-radius: var(--radius-md);
    padding: 16px 24px;
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
    margin-bottom: 18px;
    flex-wrap: wrap;
    gap: 16px;
}

.finance-toolbar-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.finance-toolbar-title .toolbar-icon {
    font-size: 28px;
}

.finance-main-title {
    font-size: 19px;
    font-weight: 800;
    color: var(--text-dark);
    line-height: 1.2;
}

.finance-subtitle {
    font-size: 13px;
    color: var(--text-muted);
}

.finance-toolbar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.finance-semester-tabs {
    display: flex;
    background: #f2ece4;
    padding: 4px;
    border-radius: 20px;
    gap: 4px;
    border: 1px solid #e2d5c7;
}

.finance-semester-tabs .tab-btn {
    border: none;
    background: transparent;
    font-family: var(--font-main);
    font-size: 12.5px;
    font-weight: 600;
    color: #6c584c;
    padding: 6px 14px;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.finance-semester-tabs .tab-btn:hover {
    color: #2d3748;
    background: rgba(255, 255, 255, 0.5);
}

.finance-semester-tabs .tab-btn.active {
    background: #ffffff;
    color: var(--accent);
    box-shadow: 0 2px 6px rgba(60, 45, 30, 0.1);
}

.finance-grand-total-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #fdf2f4;
    border: 1px solid #f9d5ca;
    border-radius: 12px;
    padding: 6px 14px;
    font-size: 13px;
}

.finance-grand-total-badge .badge-label {
    font-weight: 600;
    color: #6c584c;
}

.finance-grand-total-badge .badge-value {
    font-family: var(--font-mono);
    font-weight: 800;
    color: var(--accent);
    font-size: 14.5px;
}

/* Moldura do Caderno Aberto (Book Spread) */
.finance-book-spread {
    background: #faf7f2;
    border-radius: 20px;
    border: 1px solid #e5dbcf;
    box-shadow: 0 14px 38px -10px rgba(60, 45, 30, 0.12), 0 4px 14px rgba(60, 45, 30, 0.06);
    overflow: hidden;
    position: relative;
}

/* Washi Tape com Listras Suaves e Efeito Recortado Pastel */
.finance-washi-tape {
    height: 26px;
    background: repeating-linear-gradient(
        -45deg,
        #fce7e1,
        #fce7e1 14px,
        #edd9e4 14px,
        #edd9e4 28px,
        #f3e8db 28px,
        #f3e8db 42px,
        #f9d5ca 42px,
        #f9d5ca 56px
    );
    position: relative;
}

.finance-washi-tape.top-tape {
    border-bottom: 2px dashed #dfcfc2;
}

.finance-washi-tape.bottom-tape {
    border-top: 2px dashed #dfcfc2;
}

/* Banner de Título Central do Caderno */
.finance-spread-title-banner {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    padding: 16px 20px 8px 20px;
    background: #fdfbf8;
    border-bottom: 1px solid #ebdcd0;
}

.finance-spread-title-banner .spread-heading {
    font-size: 24px;
    font-weight: 800;
    letter-spacing: 4px;
    color: #4a5568;
    margin: 0;
    text-transform: uppercase;
}

.finance-spread-title-banner .tape-flair {
    font-size: 16px;
    color: #e5989b;
}

/* Páginas do Caderno (Spread Duplo: Esquerda e Direita) */
.finance-spread-pages {
    display: grid;
    grid-template-columns: 1fr 14px 1fr;
    gap: 0;
    padding: 18px 24px 26px 24px;
    background: #faf7f2;
}

.finance-spine-divider {
    background: linear-gradient(
        to right,
        rgba(0, 0, 0, 0.02),
        rgba(0, 0, 0, 0.08) 45%,
        rgba(0, 0, 0, 0.08) 55%,
        rgba(0, 0, 0, 0.02)
    );
    border-left: 1px dashed #d8c9bb;
    border-right: 1px dashed #d8c9bb;
    height: 100%;
}

.finance-page {
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.finance-page.left-page {
    padding-right: 18px;
}

.finance-page.right-page {
    padding-left: 18px;
}

/* Bloco Mensal de Finanças */
.finance-month-block {
    background: #fdfbf8;
    border-radius: 12px;
    border: 1px solid #e8ded4;
    padding: 12px 14px 10px 14px;
    box-shadow: 0 2px 6px rgba(60, 45, 30, 0.03);
    transition: box-shadow 0.2s ease;
}

.finance-month-block:hover {
    box-shadow: 0 4px 12px rgba(60, 45, 30, 0.06);
}

.finance-month-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 6px;
    border-bottom: 1.5px solid #ebdcd0;
    margin-bottom: 4px;
}

.finance-month-title {
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 1.5px;
    color: #4a5568;
    text-transform: capitalize;
}

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

.btn-add-finance-row {
    background: #f4ede4;
    border: 1px solid #e0d1c3;
    font-size: 11.5px;
    font-weight: 600;
    color: #6c584c;
    padding: 2px 8px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-add-finance-row:hover {
    background: #b56576;
    color: #ffffff;
    border-color: #b56576;
}

/* Tabela de Lançamentos */
.finance-month-table {
    width: 100%;
    border-collapse: collapse;
}

.finance-month-table th {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: #8c7d70;
    letter-spacing: 0.8px;
    padding: 5px 6px;
    border-bottom: 1px solid #e5dbcf;
    text-align: left;
}

.finance-month-table th.th-date {
    width: 76px;
    text-align: center;
}

.finance-month-table th.th-flair {
    width: 18px;
    text-align: center;
    color: #e5989b;
}

.finance-month-table th.th-desc {
    text-align: left;
}

.finance-month-table th.th-val {
    width: 110px;
    text-align: right;
}

.finance-month-table th.th-obs {
    width: 95px;
    text-align: left;
}

.finance-month-table th.th-action {
    width: 22px;
    text-align: center;
}

/* Linhas de Dados com Linhas Pautadas */
.finance-row {
    border-bottom: 1px dotted #dfd1c3;
    transition: background 0.15s ease;
}

.finance-row:hover {
    background: #fffcf8;
}

.finance-row td {
    padding: 3px 4px;
    vertical-align: middle;
}

.finance-cell-date {
    text-align: center;
}

.finance-cell-flair {
    text-align: center;
    color: #e5989b;
    font-size: 10px;
    user-select: none;
}

.finance-date-input {
    width: 100%;
    text-align: center;
    font-family: var(--font-mono);
    font-size: 12px;
    color: #374151;
    border: 1px solid transparent;
    border-radius: 4px;
    background: transparent;
    padding: 3px 2px;
    outline: none;
}

.finance-date-input:focus {
    border-color: #b56576;
    background: #ffffff;
}

.finance-desc-input {
    width: 100%;
    font-family: var(--font-main);
    font-size: 12.5px;
    font-weight: 500;
    color: #2d3748;
    border: 1px solid transparent;
    border-radius: 4px;
    background: transparent;
    padding: 3px 4px;
    outline: none;
}

.finance-desc-input:focus {
    border-color: #b56576;
    background: #ffffff;
}

.finance-val-input {
    width: 100%;
    text-align: right;
    font-family: var(--font-mono);
    font-size: 12.5px;
    font-weight: 600;
    color: #2d3748;
    border: 1px solid transparent;
    border-radius: 4px;
    background: transparent;
    padding: 3px 4px;
    outline: none;
}

.finance-val-input:focus {
    border-color: #b56576;
    background: #ffffff;
}

.finance-obs-input {
    width: 100%;
    font-family: var(--font-main);
    font-size: 12px;
    color: #6b7280;
    border: 1px solid transparent;
    border-radius: 4px;
    background: transparent;
    padding: 3px 4px;
    outline: none;
}

.finance-obs-input:focus {
    border-color: #b56576;
    background: #ffffff;
}

.btn-del-finance-row {
    background: transparent;
    border: none;
    color: #c9b8ab;
    font-size: 14px;
    cursor: pointer;
    padding: 2px;
    border-radius: 4px;
    line-height: 1;
    opacity: 0.3;
    transition: all 0.15s ease;
}

.finance-row:hover .btn-del-finance-row {
    opacity: 1;
}

.btn-del-finance-row:hover {
    color: #e56b6f;
    background: rgba(229, 107, 111, 0.1);
}

/* Linha do Totalizador ao final da coluna Valor */
.finance-total-row {
    background: rgba(181, 101, 118, 0.08);
    border-top: 2px solid #dfcfc2;
    border-bottom: 1.5px solid #d8c9bb;
}

.finance-total-row td {
    padding: 6px 6px;
    vertical-align: middle;
}

.finance-total-label {
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #6c584c;
    text-align: left;
}

.finance-total-value {
    font-family: var(--font-mono);
    font-size: 13.5px;
    font-weight: 800;
    color: #b56576;
    text-align: right;
    letter-spacing: 0.3px;
}

/* ========================================================
   SEÇÃO 5: Suporte Mobile & Usabilidade Touch Avançada
   ======================================================== */

/* Dica visual de toque / swipe */
.mobile-touch-hint {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 12.5px;
    color: var(--accent);
    background: var(--accent-light);
    border: 1px dashed var(--accent);
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    margin-bottom: 14px;
    font-weight: 600;
    text-align: center;
}

.mobile-touch-hint svg {
    animation: pulse-swipe 1.8s infinite ease-in-out;
}

@keyframes pulse-swipe {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(5px); }
}

/* Wrapper para rolagem touch segura das tabelas financeiras */
.finance-table-wrapper {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--radius-sm);
    scrollbar-width: thin;
}

/* Barra de Navegação Inferior Fixa para Mobile */
.mobile-bottom-nav {
    display: none;
}

@media (max-width: 768px) {
    .mobile-touch-hint {
        display: flex;
    }

    body {
        padding-bottom: 84px !important;
    }

    .planner-container {
        padding: 16px 12px 24px 12px;
    }

    .mobile-bottom-nav {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: 64px;
        background: rgba(250, 247, 242, 0.95);
        backdrop-filter: blur(14px);
        -webkit-backdrop-filter: blur(14px);
        border-top: 1px solid var(--border-light);
        box-shadow: 0 -4px 20px rgba(60, 45, 30, 0.08);
        z-index: 9999;
        justify-content: space-around;
        align-items: center;
        padding: 4px 6px calc(4px + env(safe-area-inset-bottom, 0px)) 6px;
    }

    .mobile-nav-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 3px;
        flex: 1;
        min-height: 48px;
        color: var(--text-secondary);
        text-decoration: none;
        font-size: 11px;
        font-weight: 600;
        border-radius: var(--radius-sm);
        transition: all 0.2s ease;
        -webkit-tap-highlight-color: transparent;
    }

    .mobile-nav-item:active {
        transform: scale(0.92);
    }

    .mobile-nav-item.active {
        color: var(--accent);
        font-weight: 700;
    }

    .mobile-nav-item.active svg {
        stroke: var(--accent);
        transform: scale(1.12);
    }

    .mobile-nav-item svg {
        transition: transform 0.2s ease;
    }

    /* Prevenção de Auto-zoom indesejado no iOS Safari */
    input:not([type="checkbox"]):not([type="radio"]),
    select,
    textarea {
        font-size: 16px !important;
    }

    /* Áreas mínimas de toque (Apple HIG e Material Design >= 44x44px) */
    .btn-nav-day,
    .btn-today,
    .btn-save,
    .btn-print,
    .btn-year-nav,
    .finance-period-btn,
    .btn-add-finance-row,
    .btn-month-nav {
        min-height: 44px;
        min-width: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .daily-actions {
        width: 100%;
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
    }

    .daily-actions button {
        flex: 1 1 calc(50% - 8px);
        min-height: 44px;
    }

    .daily-section {
        padding: 24px 14px 20px 14px;
    }

    .daily-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .daily-nav-controls {
        width: 100%;
        justify-content: space-between;
    }

    .finance-toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .finance-period-selector {
        width: 100%;
        display: flex;
    }

    .finance-period-btn {
        flex: 1;
    }

    .finance-month-table {
        min-width: 520px;
    }

    .finance-date-input,
    .finance-desc-input,
    .finance-val-input,
    .finance-obs-input {
        min-height: 38px;
    }

    .btn-del-finance-row {
        min-height: 40px;
        min-width: 40px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        opacity: 0.85 !important;
        color: #e56b6f;
    }
}

/* Touch screens sem suporte a hover de mouse */
@media (hover: none) {
    .btn-del-finance-row {
        opacity: 0.85 !important;
    }
}

/* Adaptação Responsiva */
@media (max-width: 1024px) {
    .finance-spread-pages {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    .finance-spine-divider {
        display: none;
    }
    .finance-page.left-page,
    .finance-page.right-page {
        padding: 0;
    }
}

/* ========================================================
   SEÇÃO 6: Regras de Impressão em PDF (A4 Landscape)
   ======================================================== */
@media print {
    /* 1. Configuração de Página e Orientação A4 Paisagem */
    @page {
        size: A4 landscape;
        margin: 8mm;
    }

    * {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    /* 2. Ocultar Elementos de Interface de Tela */
    .no-print,
    .app-header,
    .site-footer,
    .app-footer,
    .mobile-bottom-nav,
    .mobile-touch-hint,
    .touch-hint-icon,
    .section-quick-nav,
    .monthly-controls-bar,
    .daily-actions,
    .month-days-strip,
    .finance-toolbar,
    .btn-primary,
    .btn-secondary,
    .btn-action-icon,
    .btn-add-finance-row,
    .btn-del-finance-row,
    .btn-cell-jump,
    .status-badge,
    .planner-tab-panel:not(.active) {
        display: none !important;
    }

    /* 3. Base do Documento */
    html, body {
        background: #ffffff !important;
        color: #1e293b !important;
        padding: 0 !important;
        margin: 0 !important;
        width: 100% !important;
        height: 100% !important;
        overflow: visible !important;
    }

    .planner-container {
        padding: 0 !important;
        margin: 0 !important;
        max-width: 100% !important;
        width: 100% !important;
        overflow: visible !important;
    }

    /* 4. FOLHA MENSAL (Resumo Mensal A4 Paisagem) */
    .monthly-summary-section {
        padding: 0 !important;
        margin: 0 !important;
        background: transparent !important;
        width: 100% !important;
        height: 194mm !important;
        max-height: 194mm !important;
        page-break-inside: avoid !important;
        break-inside: avoid !important;
        page-break-after: avoid !important;
        break-after: avoid !important;
    }

    .spread-book-wrapper {
        box-shadow: none !important;
        border: 1px solid #d4c7b8 !important;
        border-radius: 8px !important;
        margin: 0 !important;
        padding: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        height: 194mm !important;
        max-height: 194mm !important;
        display: flex !important;
        flex-direction: column !important;
        overflow: hidden !important;
        page-break-inside: avoid !important;
        break-inside: avoid !important;
    }

    .spread-washi-tape {
        height: 7mm !important;
        flex-shrink: 0 !important;
    }

    .spread-book-header {
        padding: 2mm 10mm !important;
        border-bottom: 1.5px solid #dfd1c3 !important;
        background: #faf7f2 !important;
        flex-shrink: 0 !important;
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
    }

    .spread-main-month-name {
        font-size: 18px !important;
        letter-spacing: 2.5px !important;
        color: #4a5568 !important;
        margin: 0 !important;
    }

    .spread-year-pill {
        font-size: 11px !important;
        padding: 2px 8px !important;
        background: #ede6dc !important;
        color: #5b4636 !important;
    }

    .spread-flair-left,
    .spread-flair-right {
        font-size: 13px !important;
        color: #e5989b !important;
    }

    .spread-grid-container {
        width: 100% !important;
        min-width: 0 !important;
        flex: 1 1 auto !important;
        display: flex !important;
        flex-direction: column !important;
        overflow: hidden !important;
        background: #fdfbf7 !important;
    }

    /* Proporção 180px para Notas + 7 colunas iguais para os dias */
    .spread-header-row {
        display: grid !important;
        grid-template-columns: 180px repeat(7, 1fr) !important;
        background: #f3ede6 !important;
        border-bottom: 1.5px solid #dfd1c3 !important;
        flex-shrink: 0 !important;
        height: 7mm !important;
    }

    .spread-col-head {
        padding: 1mm 2mm !important;
        font-size: 11px !important;
        border-right: 1px solid #e4d7cb !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }

    .spread-col-head.head-notes {
        background: #ebdcd0 !important;
        color: #5b4636 !important;
        font-weight: 800 !important;
    }

    .spread-col-head.head-sat {
        background: #e2d9f3 !important;
        color: #553c7b !important;
    }

    .spread-col-head.head-sun {
        background: #fcd5ce !important;
        color: #8c3b4d !important;
    }

    .spread-col-head.head-spine-border {
        border-right: 2px solid #cdbfae !important;
    }

    /* Corpo da Folha Mensal */
    .spread-body-layout {
        display: grid !important;
        grid-template-columns: 180px 1fr !important;
        flex: 1 1 auto !important;
        min-height: 0 !important;
        overflow: hidden !important;
    }

    /* Coluna Lateral de Notas */
    .spread-notes-sidebar {
        background: #fbf7f0 !important;
        border-right: 1px solid #e4d7cb !important;
        display: flex !important;
        flex-direction: column !important;
        height: 100% !important;
        overflow: hidden !important;
    }

    .notes-sidebar-header {
        padding: 1.5mm 3mm !important;
        background: #f7efe6 !important;
        border-bottom: 1px dashed #e4d7cb !important;
        flex-shrink: 0 !important;
    }

    .notes-sidebar-tag {
        font-size: 9.5px !important;
        color: #7d6350 !important;
    }

    .notes-sidebar-editor {
        flex: 1 1 auto !important;
        padding: 2mm 3mm !important;
        display: flex !important;
        min-height: 0 !important;
        overflow: hidden !important;
    }

    .spread-notes-textarea {
        width: 100% !important;
        height: 100% !important;
        min-height: 0 !important;
        border: none !important;
        outline: none !important;
        resize: none !important;
        font-size: 10px !important;
        line-height: 18px !important;
        color: #2d3748 !important;
        background: repeating-linear-gradient(transparent, transparent 17px, #e8dfd5 18px) !important;
        padding: 0 !important;
    }

    /* Mini Calendários */
    .spread-mini-calendars {
        padding: 2mm 3mm !important;
        background: #f5ebe0 !important;
        border-top: 1px solid #e4d7cb !important;
        display: flex !important;
        flex-direction: column !important;
        gap: 2mm !important;
        flex-shrink: 0 !important;
    }

    .mini-cal-card {
        background: #ffffff !important;
        padding: 1.5mm 2mm !important;
        border-radius: 4px !important;
        border: 1px solid #e7ded4 !important;
        box-shadow: none !important;
    }

    .mini-cal-title {
        font-size: 9px !important;
        color: #6c584c !important;
        margin-bottom: 1mm !important;
    }

    .mini-cal-table {
        font-size: 8px !important;
        width: 100% !important;
    }

    .mini-cal-table th,
    .mini-cal-table td {
        padding: 0.5px 0 !important;
    }

    /* Grade de Semanas e Dias */
    .spread-weeks-grid {
        display: flex !important;
        flex-direction: column !important;
        height: 100% !important;
        width: 100% !important;
        overflow: hidden !important;
    }

    .spread-week-row {
        display: grid !important;
        grid-template-columns: repeat(7, 1fr) !important;
        border-bottom: 1px solid #e6ded6 !important;
        flex: 1 1 0 !important;
        min-height: 0 !important;
        page-break-inside: avoid !important;
        break-inside: avoid !important;
    }

    .spread-week-row:last-child {
        border-bottom: none !important;
    }

    .spread-day-cell {
        border-right: 1px solid #e6ded6 !important;
        display: flex !important;
        flex-direction: column !important;
        background: #ffffff !important;
        height: 100% !important;
        min-height: 0 !important;
        overflow: hidden !important;
        page-break-inside: avoid !important;
        break-inside: avoid !important;
    }

    .spread-day-cell:last-child {
        border-right: none !important;
    }

    .spread-day-cell.is-weekend {
        background: #fbf9f6 !important;
    }

    .spread-day-cell.is-today {
        background: #fefcf3 !important;
    }

    .spread-day-cell.spine-divider {
        border-right: 2px solid #cdbfae !important;
        box-shadow: none !important;
    }

    .day-cell-top {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        padding: 1mm 2mm 0.5mm 2mm !important;
        flex-shrink: 0 !important;
    }

    .day-num-badge {
        font-size: 10.5px !important;
        font-weight: 700 !important;
        color: #334155 !important;
    }

    .day-num-badge.today-badge {
        background: #b56576 !important;
        color: #ffffff !important;
        padding: 1px 4px !important;
        border-radius: 8px !important;
        font-size: 9.5px !important;
    }

    .day-cell-content {
        flex: 1 1 0 !important;
        display: flex !important;
        padding: 0.5mm 2mm 1mm 2mm !important;
        min-height: 0 !important;
        overflow: hidden !important;
    }

    .spread-day-input {
        width: 100% !important;
        height: 100% !important;
        min-height: 0 !important;
        border: none !important;
        outline: none !important;
        resize: none !important;
        font-size: 9px !important;
        font-weight: 600 !important;
        line-height: 13px !important;
        color: #1e293b !important;
        background: repeating-linear-gradient(transparent, transparent 12px, #f0eae2 13px) !important;
        padding: 0 !important;
    }

    .empty-day-texture {
        width: 100% !important;
        height: 100% !important;
        min-height: 0 !important;
        background: repeating-linear-gradient(45deg, #fcfaf6, #fcfaf6 6px, #f7f2ea 6px, #f7f2ea 12px) !important;
    }

    /* 5. FOLHA DIÁRIA (Quando Impressa) */
    .daily-section {
        box-shadow: none !important;
        border: 1px solid #d4c7b8 !important;
        border-radius: 8px !important;
        padding: 6mm 8mm !important;
        height: 194mm !important;
        max-height: 194mm !important;
        overflow: hidden !important;
        page-break-inside: avoid !important;
        break-inside: avoid !important;
        page-break-after: avoid !important;
        break-after: avoid !important;
        display: flex !important;
        flex-direction: column !important;
    }

    .daily-header {
        padding-bottom: 2mm !important;
        margin-bottom: 3mm !important;
        border-bottom: 1.5px solid #dfd1c3 !important;
        flex-shrink: 0 !important;
    }

    .daily-weekday {
        font-size: 16px !important;
    }

    .daily-full-date {
        font-size: 12px !important;
    }

    .sheet-grid {
        display: grid !important;
        grid-template-columns: 1fr 260px 300px !important;
        gap: 4mm !important;
        flex: 1 1 auto !important;
        min-height: 0 !important;
        overflow: hidden !important;
    }

    .sheet-col {
        height: 100% !important;
        display: flex !important;
        flex-direction: column !important;
        overflow: hidden !important;
    }

    .notes-container {
        flex: 1 1 auto !important;
        display: flex !important;
        min-height: 0 !important;
    }

    .notes-textarea {
        width: 100% !important;
        height: 100% !important;
        min-height: 0 !important;
        resize: none !important;
        font-size: 11px !important;
        line-height: 22px !important;
    }

    .agenda-list {
        flex: 1 1 auto !important;
        overflow: hidden !important;
    }

    .agenda-row {
        padding: 1.5px 0 !important;
        min-height: 0 !important;
    }

    .time-slot {
        font-size: 10px !important;
        width: 44px !important;
    }

    .agenda-input {
        font-size: 10px !important;
    }

    .priorities-list,
    .tasks-list {
        gap: 2px !important;
    }

    .prio-item,
    .task-item {
        padding: 1.5px 0 !important;
    }

    .prio-input,
    .task-input {
        font-size: 10px !important;
    }

    /* 6. CONTROLE FINANCEIRO (Quando Impresso) */
    .finance-book-spread {
        box-shadow: none !important;
        border: 1px solid #d4c7b8 !important;
        border-radius: 8px !important;
        padding: 4mm 6mm !important;
        height: 194mm !important;
        max-height: 194mm !important;
        overflow: hidden !important;
        page-break-inside: avoid !important;
        break-inside: avoid !important;
        page-break-after: avoid !important;
        break-after: avoid !important;
    }

    .finance-spread-pages {
        grid-template-columns: 1fr 1fr !important;
        gap: 4mm !important;
        height: 100% !important;
    }

    .finance-page {
        height: 100% !important;
        overflow: hidden !important;
    }

    .finance-month-table {
        min-width: 0 !important;
        width: 100% !important;
        font-size: 9.5px !important;
    }

    .finance-month-table th,
    .finance-month-table td {
        padding: 1.5px 3px !important;
    }

    .finance-date-input,
    .finance-desc-input,
    .finance-val-input,
    .finance-obs-input {
        font-size: 9.5px !important;
        min-height: 0 !important;
        height: auto !important;
        padding: 1px 2px !important;
    }

    /* 7. CALENDÁRIO ANUAL (Quando Impresso) */
    .calendar-section {
        box-shadow: none !important;
        border: 1px solid #d4c7b8 !important;
        border-radius: 8px !important;
        padding: 4mm 6mm !important;
        height: 194mm !important;
        max-height: 194mm !important;
        overflow: hidden !important;
        page-break-inside: avoid !important;
        break-inside: avoid !important;
        page-break-after: avoid !important;
        break-after: avoid !important;
    }

    .months-grid {
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 3mm !important;
    }

    .month-card {
        padding: 4px 6px !important;
    }
}


