/* ============================================================
   Meus Estudos — folha de estilos
   Design system: variáveis, tema claro/escuro, responsivo
   ============================================================ */

:root {
  --accent: #6366f1;
  --accent-soft: #eef2ff;
  --accent-2: #8b5cf6;
  --success: #10b981;
  --success-soft: #ecfdf5;
  --danger: #ef4444;
  --danger-soft: #fef2f2;
  --warning: #f59e0b;
  --warning-soft: #fffbeb;
  --info: #0ea5e9;
  --info-soft: #f0f9ff;

  --bg: #f5f6fb;
  --surface: #ffffff;
  --surface-2: #f1f2f8;
  --border: #e6e7f0;
  --text: #1e2130;
  --text-muted: #6b7280;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 8px 24px -12px rgba(16, 24, 40, .12);
  --shadow-lg: 0 4px 8px rgba(16, 24, 40, .08), 0 24px 48px -16px rgba(16, 24, 40, .22);
  --radius: 14px;
  --radius-sm: 10px;
  --sidebar-w: 252px;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

[data-theme="dark"] {
  --bg: #0f1117;
  --surface: #1a1d27;
  --surface-2: #232733;
  --border: #2c3140;
  --text: #e9ebf5;
  --text-muted: #9aa3b5;
  --accent-soft: #262b47;
  --success-soft: #123025;
  --danger-soft: #3a1f23;
  --warning-soft: #36290f;
  --info-soft: #14283a;
  --shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 10px 28px -14px rgba(0, 0, 0, .5);
  --shadow-lg: 0 4px 8px rgba(0, 0, 0, .4), 0 28px 56px -20px rgba(0, 0, 0, .65);
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  transition: background .25s ease, color .25s ease;
}

h1, h2, h3, h4 { margin: 0; font-weight: 700; line-height: 1.25; }
p { margin: 0; }
a { color: var(--accent); text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- Layout ---------- */
.app { display: flex; min-height: 100vh; }

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 18px 14px;
  z-index: 60;
  transition: transform .25s ease;
}

.main {
  flex: 1;
  margin-left: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 26px;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.page-title { font-size: 21px; letter-spacing: -.01em; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.topbar-right { display: flex; align-items: center; gap: 10px; }

.view { padding: 26px; max-width: 1240px; width: 100%; margin: 0 auto; outline: none; }

/* ---------- Sidebar ---------- */
.brand { display: flex; align-items: center; gap: 12px; padding: 4px 8px 20px; }

.brand-logo {
  width: 42px; height: 42px; flex: 0 0 42px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff; border-radius: 12px;
}

.brand-name { font-weight: 800; font-size: 16px; }
.brand-sub { font-size: 12px; color: var(--text-muted); }

.nav { display: flex; flex-direction: column; gap: 3px; flex: 1; overflow-y: auto; }

.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px;
  border: none; background: none;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 14.5px; font-weight: 600;
  width: 100%; text-align: left;
  transition: background .15s, color .15s;
}

.nav-item svg { flex: 0 0 20px; }

.nav-item:hover { background: var(--surface-2); color: var(--text); }

.nav-item.active {
  background: var(--accent-soft);
  color: var(--accent);
}

.sidebar-foot { padding-top: 14px; border-top: 1px solid var(--border); display: flex; align-items: center; gap: 8px; }

.mini-timer {
  flex: 1; display: flex; align-items: center; gap: 7px;
  background: var(--accent-soft); color: var(--accent);
  padding: 8px 10px; border-radius: var(--radius-sm);
  font-size: 12.5px; min-width: 0;
}
.mini-timer svg { flex: 0 0 auto; }
.mini-timer span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-timer strong { margin-left: auto; font-variant-numeric: tabular-nums; }

.scrim {
  position: fixed; inset: 0; background: rgba(0,0,0,.5);
  z-index: 55; opacity: 0; pointer-events: none; transition: opacity .2s;
}

/* ---------- Botões ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-size: 14px; font-weight: 600;
  background: var(--surface-2); color: var(--text);
  transition: transform .1s, background .15s, opacity .15s, box-shadow .15s;
  white-space: nowrap;
}
.btn:hover { filter: brightness(.97); }
.btn:active { transform: translateY(1px); }

.btn-primary { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; box-shadow: 0 8px 20px -8px var(--accent); }
.btn-primary:hover { box-shadow: 0 10px 24px -8px var(--accent); filter: brightness(1.05); }

.btn-success { background: var(--success); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-ghost { background: transparent; color: var(--text-muted); border-color: var(--border); }
.btn-ghost:hover { color: var(--text); background: var(--surface-2); }

.btn-sm { padding: 6px 11px; font-size: 13px; border-radius: 8px; }

.icon-btn {
  width: 40px; height: 40px; display: inline-grid; place-items: center;
  border-radius: 10px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text-muted);
  transition: background .15s, color .15s, transform .1s;
}
.icon-btn:hover { color: var(--accent); background: var(--accent-soft); border-color: transparent; }
.icon-btn:active { transform: scale(.95); }
.icon-btn.ghost { border-color: transparent; background: transparent; }
.icon-btn.danger:hover { color: var(--danger); background: var(--danger-soft); }
.icon-btn.lg { width: 46px; height: 46px; }

.menu-btn { display: none; }

/* ---------- Cards ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
}

.card + .card { margin-top: 18px; }

.card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.card-head h2 { font-size: 17px; }
.card-head .spacer { flex: 1; }

.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-6 { grid-template-columns: repeat(3, 1fr); }
.grid-stats { grid-template-columns: repeat(4, 1fr); }

.stat-card { padding: 18px; display: flex; flex-direction: column; gap: 6px; }
.stat-card .stat-icon { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; margin-bottom: 4px; }
.stat-card .stat-value { font-size: 26px; font-weight: 800; letter-spacing: -.02em; }
.stat-card .stat-label { font-size: 13px; color: var(--text-muted); font-weight: 600; }

.tone-accent { background: var(--accent-soft); color: var(--accent); }
.tone-success { background: var(--success-soft); color: var(--success); }
.tone-danger { background: var(--danger-soft); color: var(--danger); }
.tone-warning { background: var(--warning-soft); color: var(--warning); }
.tone-info { background: var(--info-soft); color: var(--info); }

/* ---------- Week day cards ---------- */
.day-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  cursor: pointer;
  transition: transform .15s, box-shadow .15s, border-color .15s;
  display: flex; flex-direction: column; gap: 12px;
  position: relative; overflow: hidden;
}
.day-card:hover { transform: translateY(-3px); border-color: var(--accent); box-shadow: var(--shadow-lg); }
.day-card.today { border-color: var(--accent); }

.day-card .day-name { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.day-card .day-name h3 { font-size: 16px; }
.day-card .day-date { font-size: 12.5px; color: var(--text-muted); }

.chip-row { display: flex; flex-wrap: wrap; gap: 6px; min-height: 10px; }

.subject-chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12.5px; font-weight: 600;
  padding: 4px 9px; border-radius: 999px;
  background: var(--surface-2); color: var(--text);
  border: 1px solid transparent;
}
.subject-chip .dot { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 8px; }

.day-meta { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--text-muted); }
.day-meta .row { display: flex; align-items: center; gap: 7px; }

.progress { height: 8px; background: var(--surface-2); border-radius: 99px; overflow: hidden; flex: 1; }
.progress > div { height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width .4s ease; }
.progress.warn > div { background: linear-gradient(90deg, var(--warning), #f97316); }
.progress.ok > div { background: linear-gradient(90deg, var(--success), #34d399); }

.day-foot { display: flex; align-items: center; gap: 8px; margin-top: auto; }
.day-foot .progress { flex: 1; }
.day-foot .pct { font-size: 12.5px; font-weight: 700; color: var(--text-muted); }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 13px; font-weight: 600; color: var(--text-muted); }
.input, .select, .textarea {
  width: 100%;
  padding: 10px 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--text);
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--surface);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}
.textarea { resize: vertical; min-height: 80px; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.task-input-row { display: flex; gap: 8px; align-items: center; }
.task-input-row input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--accent); flex: 0 0 18px; }

.color-swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.color-swatch {
  width: 30px; height: 30px; border-radius: 8px; border: 2px solid transparent;
  cursor: pointer; transition: transform .1s;
}
.color-swatch:hover { transform: scale(1.12); }
.color-swatch.selected { border-color: var(--text); box-shadow: 0 0 0 3px color-mix(in srgb, var(--text) 18%, transparent); }

/* ---------- Listas de itens ---------- */
.item-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  transition: border-color .15s, box-shadow .15s;
}
.item-card + .item-card { margin-top: 12px; }
.item-card:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }

.item-head { display: flex; align-items: flex-start; gap: 12px; }
.item-title { font-size: 16px; font-weight: 700; flex: 1; }
.item-actions { display: flex; gap: 4px; opacity: 0; transition: opacity .15s; }
.item-card:hover .item-actions { opacity: 1; }

.item-body { margin-top: 8px; color: var(--text-muted); font-size: 14px; white-space: pre-wrap; }
.item-sub { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-muted); flex-wrap: wrap; }

.task-list { margin-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.task-item { display: flex; align-items: center; gap: 10px; font-size: 14px; padding: 5px 0; }
.task-item input[type="checkbox"] { width: 17px; height: 17px; accent-color: var(--accent); flex: 0 0 17px; cursor: pointer; }
.task-item .task-text { flex: 1; }
.task-item.done .task-text { text-decoration: line-through; color: var(--text-muted); }

.note-box {
  margin-top: 10px;
  background: var(--warning-soft);
  border: 1px solid color-mix(in srgb, var(--warning) 30%, transparent);
  color: var(--text);
  padding: 10px 13px; border-radius: var(--radius-sm);
  font-size: 13.5px; white-space: pre-wrap;
}
.note-box .note-label { display: flex; align-items: center; gap: 6px; font-weight: 700; font-size: 12px; color: var(--warning); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 4px; }

.objective-box {
  margin-top: 10px;
  background: var(--success-soft);
  border: 1px solid color-mix(in srgb, var(--success) 30%, transparent);
  padding: 10px 13px; border-radius: var(--radius-sm);
  font-size: 13.5px;
}
.objective-box .obj-label { display: flex; align-items: center; gap: 6px; font-weight: 700; font-size: 12px; color: var(--success); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 4px; }

/* ---------- Badges / pills ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em;
  padding: 3px 9px; border-radius: 99px;
}
.badge.dif-facil { background: var(--success-soft); color: var(--success); }
.badge.dif-media { background: var(--warning-soft); color: var(--warning); }
.badge.dif-dificil { background: var(--danger-soft); color: var(--danger); }
.badge.type { background: var(--info-soft); color: var(--info); }

/* ---------- Cronômetro ---------- */
.timer-box { display: flex; flex-direction: column; align-items: center; gap: 18px; padding: 26px; }

.timer-ring {
  width: 220px; height: 220px;
  border-radius: 50%;
  display: grid; place-items: center;
  background:
    radial-gradient(circle at center, var(--surface) 58%, transparent 60%),
    conic-gradient(var(--accent) 0%, var(--surface-2) 0%);
  box-shadow: inset 0 0 0 1px var(--border);
  position: relative;
  transition: background .3s;
}
.timer-ring.running { animation: pulse-ring 2s ease-in-out infinite; }
@keyframes pulse-ring { 0%,100% { box-shadow: inset 0 0 0 1px var(--border), 0 0 0 0 rgba(99,102,241,.25); } 50% { box-shadow: inset 0 0 0 1px var(--border), 0 0 0 14px rgba(99,102,241,0); } }

.timer-clock { font-size: 44px; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }

.timer-controls { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }

.session-item {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 14px; border-radius: var(--radius-sm);
  background: var(--surface-2);
}
.session-item + .session-item { margin-top: 8px; }
.session-item .ses-subject { flex: 1; min-width: 0; }
.session-item .ses-subject strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.session-item .ses-subject span { font-size: 12.5px; color: var(--text-muted); }

/* ---------- Materiais ---------- */
.material-card {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 14px; border-radius: var(--radius-sm);
  background: var(--surface-2);
  cursor: pointer;
  transition: background .15s, transform .1s;
}
.material-card:hover { background: color-mix(in srgb, var(--surface-2) 70%, var(--accent) 10%); }
.material-card + .material-card { margin-top: 8px; }
.material-icon { width: 38px; height: 38px; flex: 0 0 38px; border-radius: 9px; display: grid; place-items: center; }
.material-card .mat-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; font-size: 14px; }
.material-card .mat-meta { font-size: 12px; color: var(--text-muted); display: flex; gap: 8px; align-items: center; }

.dropzone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 26px;
  text-align: center;
  color: var(--text-muted);
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.dropzone:hover, .dropzone.dragover { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }

.file-viewer-modal iframe, .file-viewer-modal img { width: 100%; height: 100%; border: 0; border-radius: 10px; }

/* ---------- Desafios ---------- */
.challenge-card { position: relative; }

.challenge-front { display: flex; flex-direction: column; gap: 10px; }
.challenge-front .q { font-size: 15.5px; font-weight: 600; white-space: pre-wrap; }
.challenge-front .a { color: var(--text-muted); font-size: 14px; white-space: pre-wrap; }

.pair-list { display: flex; flex-direction: column; gap: 5px; margin-top: 8px; }
.pair-row { display: flex; gap: 8px; align-items: center; font-size: 13.5px; background: var(--surface-2); padding: 7px 11px; border-radius: 8px; }
.pair-row .arrow { color: var(--text-muted); }

/* Flipcard */
.flip-card { perspective: 1200px; cursor: pointer; height: 230px; }
.flip-inner { position: relative; width: 100%; height: 100%; transition: transform .5s; transform-style: preserve-3d; }
.flip-card.flipped .flip-inner { transform: rotateY(180deg); }
.flip-face {
  position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden;
  border-radius: var(--radius);
  display: grid; place-items: center; padding: 26px; text-align: center;
  border: 1px solid var(--border);
}
.flip-face .face-label { position: absolute; top: 12px; left: 16px; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); }
.flip-front { background: var(--surface); }
.flip-back { background: var(--accent-soft); transform: rotateY(180deg); }

/* Prática (overlay) */
.practice-stage { min-height: 300px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; text-align: center; padding: 12px 4px; }
.practice-question { font-size: 20px; font-weight: 700; max-width: 520px; white-space: pre-wrap; }
.practice-answer {
  font-size: 16px; background: var(--accent-soft); color: var(--accent);
  border-radius: var(--radius); padding: 18px 24px; max-width: 520px; white-space: pre-wrap;
}
.practice-actions { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
.practice-progress { font-size: 13px; color: var(--text-muted); font-weight: 600; }

/* ---------- Calendário ---------- */
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; }
.cal-dow { text-align: center; font-size: 12px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em; padding: 4px 0; }
.cal-day {
  aspect-ratio: 1 / 1;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  cursor: pointer; font-size: 14px; font-weight: 600;
  transition: transform .1s, border-color .15s, box-shadow .15s;
  position: relative;
}
.cal-day:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: var(--shadow); }
.cal-day.other { opacity: .35; }
.cal-day.today { border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 25%, transparent); }
.cal-day .dots { display: flex; gap: 3px; min-height: 6px; }
.cal-day .dot { width: 6px; height: 6px; border-radius: 50%; }

/* ---------- Gráfico de barras ---------- */
.bar-chart { display: flex; align-items: flex-end; gap: 12px; height: 200px; padding-top: 10px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; height: 100%; justify-content: flex-end; min-width: 0; }
.bar-track { width: 100%; max-width: 54px; flex: 1; display: flex; align-items: flex-end; border-radius: 8px; background: var(--surface-2); position: relative; }
.bar-fill { width: 100%; border-radius: 8px; background: linear-gradient(180deg, var(--accent-2), var(--accent)); min-height: 3px; transition: height .5s ease; position: relative; }
.bar-fill.empty { background: var(--surface-2); }
.bar-label { font-size: 12px; color: var(--text-muted); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.bar-value { font-size: 11.5px; font-weight: 700; color: var(--text-muted); }

/* ---------- Metas ---------- */
.goal-row { display: flex; align-items: center; gap: 14px; }
.goal-row .goal-info { flex: 1; }
.goal-row .goal-value { font-weight: 800; font-size: 18px; }

/* ---------- Filtros / tabs ---------- */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tab {
  padding: 8px 14px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text-muted); font-size: 13.5px; font-weight: 600;
  transition: all .15s;
}
.tab:hover { color: var(--text); border-color: var(--accent); }
.tab.active { background: var(--accent); border-color: var(--accent); color: #fff; }

.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 18px; }
.toolbar .spacer { flex: 1; }

/* ---------- Empty states ---------- */
.empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; padding: 42px 20px; text-align: center; color: var(--text-muted);
}
.empty svg { opacity: .4; }
.empty .empty-title { font-weight: 700; color: var(--text); font-size: 15.5px; }
.empty .empty-sub { font-size: 13.5px; max-width: 360px; }

/* ---------- Modal ---------- */
.modal-overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(10, 12, 20, .55);
  display: grid; place-items: center; padding: 18px;
  animation: fadeIn .15s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  width: 100%; max-width: 560px;
  max-height: 92vh;
  display: flex; flex-direction: column;
  animation: slideUp .18s ease;
}
.modal.wide { max-width: 880px; }
@keyframes slideUp { from { transform: translateY(16px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

.modal-head { display: flex; align-items: center; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--border); }
.modal-head h3 { font-size: 17px; flex: 1; }
.modal-body { padding: 22px; overflow-y: auto; }
.modal-foot { padding: 14px 22px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }

/* ---------- Toast ---------- */
.toast-root { position: fixed; bottom: 20px; right: 20px; z-index: 200; display: flex; flex-direction: column; gap: 10px; }
.toast {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  padding: 12px 16px;
  font-size: 14px; font-weight: 600;
  display: flex; align-items: center; gap: 10px;
  animation: slideIn .2s ease;
  max-width: 340px;
}
.toast.success { border-left-color: var(--success); }
.toast.danger { border-left-color: var(--danger); }
.toast.warning { border-left-color: var(--warning); }
@keyframes slideIn { from { transform: translateX(30px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
.toast.out { opacity: 0; transform: translateX(30px); transition: all .25s; }

/* ---------- Tema ---------- */
.theme-icon { pointer-events: none; }

/* ---------- Cabeçalho do dia ---------- */
.day-hero {
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  margin-bottom: 20px;
}
.day-hero h2 { font-size: 26px; letter-spacing: -.02em; }
.day-hero .today-badge { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; background: var(--accent-soft); color: var(--accent); padding: 4px 10px; border-radius: 99px; }

.section-title { display: flex; align-items: center; gap: 9px; margin: 24px 0 14px; }
.section-title h2 { font-size: 18px; }
.section-title svg { color: var(--accent); }

/* ---------- Responsividade ---------- */
@media (max-width: 1100px) {
  .grid-6 { grid-template-columns: repeat(2, 1fr); }
  .grid-stats { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); box-shadow: var(--shadow-lg); }
  .sidebar.open { transform: translateX(0); }
  .scrim.show { opacity: 1; pointer-events: auto; }
  .menu-btn { display: inline-grid; }
  .main { margin-left: 0; }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-2, .form-row { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  .view { padding: 16px; }
  .topbar { padding: 12px 16px; }
  .page-title { font-size: 18px; }
  .grid-6 { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr; }
  .grid-stats { grid-template-columns: repeat(2, 1fr); }
  .timer-clock { font-size: 36px; }
  .timer-ring { width: 180px; height: 180px; }
  .item-actions { opacity: 1; }
  .modal-overlay { padding: 10px; }
  .modal { max-height: 96vh; }
  .cal-grid { gap: 5px; }
  .toast-root { left: 16px; right: 16px; bottom: 16px; }
  .toast { max-width: none; }
}
