/* =========================================
   KREVIA - Page-Specific Styles
   ========================================= */

/* DASHBOARD */
.greeting { margin-bottom: 1.5rem; }
.greeting h1 { font-size: 1.75rem; font-weight: 800; }
.greeting .date { color: var(--text-secondary); font-size: .9rem; margin-top: .25rem; }
.current-task-card { background: linear-gradient(135deg, var(--accent-light), var(--bg-card)); border: 1px solid var(--accent); border-radius: var(--radius-lg); padding: 1.25rem; margin-bottom: 1.5rem; }
.current-task-label { font-size: .75rem; font-weight: 700; color: var(--accent); text-transform: uppercase; letter-spacing: 1px; margin-bottom: .5rem; }
.current-task-name { font-size: 1.2rem; font-weight: 700; }
.current-task-time { font-size: .85rem; color: var(--text-secondary); margin-top: .25rem; }

/* DASHBOARD TABS */
.dash-tabs { display: flex; gap: 2px; background: var(--bg-tertiary); border-radius: var(--radius-md); padding: 3px; margin-bottom: 1.25rem; }
.dash-tab { flex: 1; padding: .6rem; border: none; background: transparent; color: var(--text-secondary); font-size: .85rem; font-weight: 600; cursor: pointer; border-radius: var(--radius-sm); transition: var(--transition); font-family: inherit; text-align: center; }
.dash-tab.active { background: var(--accent); color: var(--accent-text); }

/* TIMELINE ITEM */
.timeline-item { display: flex; align-items: flex-start; gap: .75rem; padding: .75rem; background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--radius-md); margin-bottom: .5rem; transition: var(--transition); }
.timeline-item:hover { border-color: var(--border-light); }
.timeline-item.overdue { border-color: var(--red); background: var(--red-light); }
.timeline-icon { width: 32px; height: 32px; border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; font-size: .8rem; flex-shrink: 0; }
.timeline-icon.rotina { background: var(--blue-light); color: var(--blue); }
.timeline-icon.tarefa { background: var(--orange-light); color: var(--orange); }
.timeline-icon.calendario { background: var(--purple-light); color: var(--purple); }
.timeline-content { flex: 1; min-width: 0; }
.timeline-title { font-size: .85rem; font-weight: 600; }
.timeline-meta { font-size: .75rem; color: var(--text-muted); margin-top: .15rem; }
.timeline-check { width: 20px; height: 20px; border-radius: 4px; border: 2px solid var(--border-light); cursor: pointer; appearance: none; background: transparent; transition: var(--transition); flex-shrink: 0; margin-top: 4px; }
.timeline-check:checked { background: var(--green); border-color: var(--green); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='white' viewBox='0 0 16 16'%3E%3Cpath d='M13.485 1.929a.75.75 0 0 1 .086 1.057l-7.25 8.5a.75.75 0 0 1-1.1.043l-3.25-3.25a.75.75 0 1 1 1.06-1.06l2.67 2.67L12.428 2.015a.75.75 0 0 1 1.057-.086z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: center; }

/* ROTINA */
.week-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: .75rem; }
.day-column { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--radius-lg); overflow: hidden; }
.day-header { padding: .75rem 1rem; background: var(--bg-secondary); border-bottom: 1px solid var(--border-color); font-weight: 700; font-size: .9rem; text-align: center; }
.day-header.today { background: var(--accent); color: var(--accent-text); }
.day-blocks { padding: .5rem; display: flex; flex-direction: column; gap: .4rem; }
.block-item { padding: .65rem; border-radius: var(--radius-sm); border: 1px solid var(--border-color); font-size: .8rem; cursor: pointer; transition: var(--transition); }
.block-item:hover { border-color: var(--accent); }
.block-item.done { opacity: .6; }
.block-item.done .block-name { text-decoration: line-through; }
.block-time { font-size: .7rem; color: var(--text-muted); font-weight: 600; }
.block-name { font-weight: 600; margin-top: .2rem; font-size: .8rem; }
.block-product { font-size: .7rem; color: var(--text-secondary); margin-top: .15rem; }
.block-status-toggle { margin-top: .3rem; display: flex; align-items: center; gap: .4rem; }
.block-checkbox { width: 18px; height: 18px; border-radius: 4px; border: 2px solid var(--border-light); cursor: pointer; appearance: none; background: transparent; transition: var(--transition); }
.block-checkbox:checked { background: var(--green); border-color: var(--green); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='white' viewBox='0 0 16 16'%3E%3Cpath d='M13.485 1.929a.75.75 0 0 1 .086 1.057l-7.25 8.5a.75.75 0 0 1-1.1.043l-3.25-3.25a.75.75 0 1 1 1.06-1.06l2.67 2.67L12.428 2.015a.75.75 0 0 1 1.057-.086z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: center; }
.block-status-label { font-size: .7rem; color: var(--text-muted); }

/* SCRIPT READER */
.script-reader { background: #000; color: #fff; padding: 2rem; border-radius: var(--radius-lg); font-size: 1.4rem; line-height: 1.8; max-height: 70vh; overflow-y: auto; }
.script-reader .hook { color: var(--accent); font-weight: 700; font-size: 1.6rem; margin-bottom: 1rem; display: block; }
.script-reader .cta { color: var(--green); font-weight: 700; font-size: 1.4rem; margin-top: 1rem; display: block; }

/* GERADOR - PRODUCT CARDS */
.product-card { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--radius-lg); padding: 1.25rem; margin-bottom: 1rem; transition: var(--transition); }
.product-card:hover { border-color: var(--border-light); }
.product-card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; padding-bottom: .75rem; border-bottom: 1px solid var(--border-color); }
.product-card-header h3 { font-size: 1.05rem; font-weight: 700; }
.product-info-row { display: flex; gap: .5rem; flex-wrap: wrap; font-size: .8rem; color: var(--text-secondary); margin-top: .5rem; }

/* AGENT CARDS */
.agent-card { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--radius-lg); padding: 1rem; margin-bottom: .75rem; transition: var(--transition); }
.agent-card:hover { border-color: var(--border-light); }
.agent-card.selected { border-color: var(--accent); background: var(--accent-light); }
.agent-card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: .5rem; }
.agent-card-header h4 { font-size: .95rem; font-weight: 700; }
.agent-instruction { font-size: .85rem; color: var(--text-secondary); line-height: 1.5; max-height: 60px; overflow: hidden; transition: max-height .3s; }
.agent-instruction.expanded { max-height: none; }

/* GENERATED SCRIPTS */
.generated-scripts { display: flex; flex-direction: column; gap: 1rem; margin-top: 1.5rem; }
.generated-card { background: var(--bg-card); border: 1px solid var(--accent); border-radius: var(--radius-lg); padding: 1.25rem; }
.generated-card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.generated-hook { font-size: 1.1rem; font-weight: 700; color: var(--accent); margin-bottom: .75rem; }
.generated-body { font-size: .95rem; line-height: 1.6; white-space: pre-wrap; margin-bottom: .75rem; }
.generated-cta { font-size: 1rem; font-weight: 700; color: var(--green); }
.generated-actions { display: flex; gap: .5rem; margin-top: 1rem; flex-wrap: wrap; }

/* AI CONFIG */
.ai-config-section { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--radius-lg); margin-bottom: 1.5rem; overflow: hidden; }
.ai-config-header { display: flex; align-items: center; justify-content: space-between; padding: 1rem 1.25rem; cursor: pointer; transition: var(--transition); }
.ai-config-header:hover { background: var(--bg-hover); }
.ai-config-header h3 { font-size: .95rem; font-weight: 700; display: flex; align-items: center; gap: .5rem; }
.ai-config-body { max-height: 0; overflow: hidden; transition: max-height .3s ease; padding: 0 1.25rem; }
.ai-config-body.open { max-height: 2000px; padding: 0 1.25rem 1.25rem; }
.ai-config-header i.fa-chevron-down { transition: transform 0.3s ease; color: var(--text-muted); }
.generated-freeform { font-size: .95rem; line-height: 1.7; white-space: pre-wrap; margin-bottom: .75rem; color: var(--text-primary); }
.history-item { padding: .75rem; background: var(--bg-primary); border: 1px solid var(--border-color); border-radius: var(--radius-md); margin-bottom: .5rem; cursor: pointer; transition: var(--transition); }
.history-item:hover { border-color: var(--accent); }
.templates-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; margin-top: 1rem; }
.template-card { background: var(--bg-primary); border: 1px solid var(--border-color); border-radius: var(--radius-lg); padding: 1.25rem; text-align: center; transition: all 0.3s ease; }
.template-card:hover { border-color: var(--accent); }
.template-card.template-installed { border-color: var(--green); background: color-mix(in srgb, var(--green) 5%, var(--bg-primary)); }
.template-card-icon { font-size: 1.5rem; color: var(--purple); margin-bottom: .5rem; transition: color 0.3s ease; }
.template-card.template-installed .template-card-icon { color: var(--green); }
.btn-outline { background: transparent !important; border: 1px solid currentColor; }
.template-card-name { font-weight: 700; font-size: .95rem; margin-bottom: .25rem; }
.template-card-category { font-size: .75rem; color: var(--text-muted); margin-bottom: .5rem; }
.template-card-preview { font-size: .8rem; color: var(--text-secondary); margin-bottom: .75rem; line-height: 1.4; min-height: 3rem; }

/* CALENDAR */
.cal-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.cal-nav h3 { font-size: 1.1rem; font-weight: 700; }
.cal-nav-btns { display: flex; gap: .25rem; }
.cal-grid-month { display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px; background: var(--border-color); border-radius: var(--radius-lg); overflow: hidden; }
.cal-header-cell { background: var(--bg-secondary); padding: .5rem; text-align: center; font-size: .75rem; font-weight: 700; color: var(--text-secondary); }
.cal-cell { background: var(--bg-card); padding: .4rem; min-height: 90px; font-size: .75rem; cursor: pointer; transition: var(--transition); }
.cal-cell:hover { background: var(--bg-hover); }
.cal-cell.today { background: var(--accent-light); }
.cal-cell.other-month { opacity: .4; }
.cal-cell .day-num { font-weight: 700; margin-bottom: .2rem; }
.cal-event { padding: .15rem .35rem; border-radius: 3px; font-size: .65rem; margin-top: .15rem; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-event.evt-azul { background: var(--blue-light); color: var(--blue); }
.cal-event.evt-verde { background: var(--green-light); color: var(--green); }
.cal-event.evt-vermelho { background: var(--red-light); color: var(--red); }
.cal-event.evt-amarelo { background: var(--yellow-light); color: var(--yellow); }
.cal-event.evt-roxo { background: var(--purple-light); color: var(--purple); }
.cal-event.evt-laranja { background: var(--orange-light); color: var(--orange); }
.cal-event.evt-rotina { background: var(--bg-tertiary); color: var(--text-secondary); border: 1px dashed var(--border-light); font-style: italic; }

/* CALENDAR WEEK/DAY */
.cal-week-grid { display: grid; grid-template-columns: 60px repeat(7, 1fr); gap: 1px; background: var(--border-color); border-radius: var(--radius-lg); overflow: hidden; }
.cal-day-grid { display: grid; grid-template-columns: 60px 1fr; gap: 1px; background: var(--border-color); border-radius: var(--radius-lg); overflow: hidden; }
.cal-time-cell { background: var(--bg-secondary); padding: .25rem .4rem; font-size: .7rem; color: var(--text-muted); text-align: right; min-height: 50px; }
.cal-slot { background: var(--bg-card); padding: .2rem; min-height: 50px; cursor: pointer; position: relative; }
.cal-slot:hover { background: var(--bg-hover); }
.cal-week-header { background: var(--bg-secondary); padding: .5rem; text-align: center; font-size: .75rem; font-weight: 700; color: var(--text-secondary); }
.cal-week-header.today { background: var(--accent); color: var(--accent-text); }

/* CHARTS */
.charts-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(400px, 1fr)); gap: 1.5rem; }
.chart-card { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--radius-lg); padding: 1.25rem; }
.chart-card h3 { font-size: .95rem; font-weight: 700; margin-bottom: 1rem; }
.chart-wrapper { position: relative; height: 280px; }

/* NOTAS MODULE */
.notas-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1rem; }
.nota-card { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--radius-lg); padding: 1.25rem; cursor: pointer; transition: var(--transition); display: flex; flex-direction: column; min-height: 180px; }
.nota-card:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.nota-card-header { display: flex; align-items: flex-start; justify-content: space-between; gap: .5rem; margin-bottom: .75rem; }
.nota-card-title { font-size: 1rem; font-weight: 700; line-height: 1.3; }
.nota-pasta-badge { display: inline-flex; align-items: center; gap: .3rem; padding: .15rem .5rem; background: var(--blue-light); color: var(--blue); border-radius: 12px; font-size: .7rem; font-weight: 600; white-space: nowrap; flex-shrink: 0; }
.nota-card-preview { font-size: .85rem; color: var(--text-secondary); line-height: 1.5; flex: 1; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
.nota-card-footer { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-top: .75rem; padding-top: .75rem; border-top: 1px solid var(--border-color); }
.nota-tags { display: flex; flex-wrap: wrap; gap: .25rem; }
.nota-tag { display: inline-block; padding: .1rem .4rem; background: var(--accent-light); color: var(--accent); border-radius: 8px; font-size: .65rem; font-weight: 600; }
.nota-date { font-size: .7rem; color: var(--text-muted); white-space: nowrap; }
.nota-list-item { display: flex; align-items: flex-start; gap: 1rem; padding: 1rem; background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--radius-md); margin-bottom: .5rem; cursor: pointer; transition: var(--transition); }
.nota-list-item:hover { border-color: var(--accent); }
.nota-list-main { flex: 1; min-width: 0; }
.nota-list-title { font-size: .95rem; font-weight: 700; margin-bottom: .25rem; }
.nota-list-preview { font-size: .83rem; color: var(--text-secondary); line-height: 1.4; margin-bottom: .5rem; }
.nota-list-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; }
.nota-list-actions { display: flex; gap: .25rem; flex-shrink: 0; }
.nota-view-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; padding-bottom: .75rem; border-bottom: 1px solid var(--border-color); }
.nota-view-content { font-size: .95rem; line-height: 1.7; white-space: pre-wrap; margin-top: .5rem; }
.autosave-indicator { font-size: .75rem; color: var(--green); margin-top: .35rem; display: flex; align-items: center; gap: .3rem; transition: opacity .3s; }

/* PROMPTS MODULE */
.prompts-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.prompt-card { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--radius-lg); padding: 1.25rem; cursor: pointer; transition: var(--transition); display: flex; flex-direction: column; min-height: 200px; }
.prompt-card:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.prompt-card-header { display: flex; align-items: flex-start; justify-content: space-between; gap: .5rem; margin-bottom: .5rem; }
.prompt-card-title { font-size: 1rem; font-weight: 700; line-height: 1.3; flex: 1; }
.prompt-copy-btn { width: 34px; height: 34px; border-radius: var(--radius-sm); background: var(--bg-tertiary); border: 1px solid var(--border-color); color: var(--text-secondary); cursor: pointer; display: flex; align-items: center; justify-content: center; transition: var(--transition); font-size: .85rem; flex-shrink: 0; white-space: nowrap; overflow: hidden; }
.prompt-copy-btn:hover { color: var(--accent); border-color: var(--accent); }
.prompt-copy-btn.copied { background: var(--green-light); color: var(--green); border-color: var(--green); width: auto; padding: 0 .6rem; font-size: .75rem; font-weight: 600; gap: .3rem; }
.prompt-cat-badge { display: inline-flex; padding: .15rem .5rem; background: var(--purple-light); color: var(--purple); border-radius: 12px; font-size: .7rem; font-weight: 600; margin-bottom: .5rem; }
.prompt-card-preview { flex: 1; overflow: hidden; margin-bottom: .75rem; }
.prompt-card-preview code { font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace; font-size: .8rem; color: var(--text-secondary); line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; white-space: pre-wrap; word-break: break-word; }
.prompt-card-footer { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding-top: .75rem; border-top: 1px solid var(--border-color); }
.prompt-tags { display: flex; flex-wrap: wrap; gap: .25rem; }
.prompt-tag { display: inline-block; padding: .1rem .4rem; background: var(--accent-light); color: var(--accent); border-radius: 8px; font-size: .65rem; font-weight: 600; }
.prompt-date { font-size: .7rem; color: var(--text-muted); white-space: nowrap; }
.prompt-view-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; padding-bottom: .75rem; border-bottom: 1px solid var(--border-color); }
.prompt-view-content { margin-top: .75rem; }
.prompt-code-block { font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace; font-size: .9rem; line-height: 1.6; white-space: pre-wrap; word-break: break-word; background: var(--bg-primary); border: 1px solid var(--border-color); border-radius: var(--radius-md); padding: 1.25rem; color: var(--text-primary); overflow-x: auto; max-height: 60vh; }
.prompt-textarea { font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace; font-size: .88rem; line-height: 1.5; }
.prompt-list-item { display: flex; align-items: flex-start; gap: 1rem; padding: 1rem; background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--radius-md); margin-bottom: .5rem; cursor: pointer; transition: var(--transition); }
.prompt-list-item:hover { border-color: var(--accent); }
.prompt-list-main { flex: 1; min-width: 0; }
.prompt-list-title { font-size: .95rem; font-weight: 700; margin-bottom: .25rem; }
.prompt-list-preview { font-size: .83rem; color: var(--text-secondary); line-height: 1.4; margin-bottom: .5rem; }
.prompt-list-preview code { font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace; font-size: .8rem; white-space: pre-wrap; word-break: break-word; }
.prompt-list-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; }
.prompt-list-actions { display: flex; gap: .25rem; flex-shrink: 0; align-items: flex-start; }

/* RESPONSIVE - Pages */
@media (max-width: 1024px) {
    .week-grid { grid-template-columns: repeat(3, 1fr); }
    .charts-grid { grid-template-columns: 1fr; }
    .prompts-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .greeting h1 { font-size: 1.35rem; }
    .week-grid { grid-template-columns: 1fr; }
    .script-reader { font-size: 1.6rem; line-height: 2; padding: 1.5rem; }
    .script-reader .hook { font-size: 1.8rem; }
    .charts-grid { grid-template-columns: 1fr; }
    .chart-wrapper { height: 240px; }
    .notas-grid { grid-template-columns: 1fr; }
    .prompts-grid { grid-template-columns: 1fr; }
    .cal-cell { min-height: 60px; padding: .25rem; }
    .cal-week-grid { grid-template-columns: 40px repeat(7, 1fr); }
}

/* UTILITY */
.hidden { display: none !important; }
.text-accent { color: var(--accent); }
.text-muted { color: var(--text-muted); }
.text-green { color: var(--green); }
.text-red { color: var(--red); }
.mt-1 { margin-top: .5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: .5rem; }
.mb-2 { margin-bottom: 1rem; }
.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
