/* Fluxo — preto, amarelo e vidro. Um único arquivo de estilo. */

:root {
  color-scheme: dark;
  --bg: #050505;
  --text: #f5f5f7;
  --muted: rgba(235, 235, 245, .62);
  --faint: rgba(235, 235, 245, .36);
  --stroke: rgba(255, 255, 255, .08);
  --stroke-2: rgba(255, 255, 255, .17);
  --fill: rgba(255, 255, 255, .05);
  --fill-2: rgba(255, 255, 255, .095);
  --accent: #ffd60a;
  --accent-hi: #ffe566;
  --accent-soft: rgba(255, 214, 10, .14);
  --ink: #181300;
  --danger: #ff6961;
  --glass: linear-gradient(180deg, rgba(255, 255, 255, .09), rgba(255, 255, 255, .03));
  --blur: blur(28px) saturate(180%);
  --hi: inset 0 1px 0 rgba(255, 255, 255, .15);
  --shadow: 0 24px 60px rgba(0, 0, 0, .55);
  --ease: cubic-bezier(.2, .8, .2, 1);
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  --nav-h: 64px;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI Variable", "Segoe UI", system-ui, sans-serif;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  background: var(--bg);
  color: var(--text);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100dvh; background: var(--bg); -webkit-tap-highlight-color: transparent; overscroll-behavior-y: none; }
/* luzes de fundo: é o que dá o que refratar por trás do vidro */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(60vmax 44vmax at 8% -10%, rgba(255, 214, 10, .17), transparent 62%),
    radial-gradient(48vmax 40vmax at 104% 106%, rgba(255, 176, 0, .11), transparent 62%),
    radial-gradient(40vmax 30vmax at 72% 18%, rgba(255, 255, 255, .035), transparent 62%);
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; touch-action: manipulation; border: 0; background: none; padding: 0; }
h1, h2, h3, p { margin: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.lucide { width: 18px; height: 18px; stroke-width: 1.9; flex: 0 0 auto; }
::selection { background: rgba(255, 214, 10, .35); }
* { scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .16) transparent; }

/* ---------- estrutura ---------- */
.app-shell { display: flex; gap: 16px; min-height: 100dvh; padding: 16px; }
.main-content { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 16px; }

/* ---------- barra lateral ---------- */
.sidebar {
  width: 272px; flex: 0 0 272px; position: sticky; top: 16px; height: calc(100dvh - 32px);
  display: flex; flex-direction: column; padding: 20px 18px; overflow-y: auto;
  background: var(--glass); border: 1px solid var(--stroke); border-radius: 28px;
  backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); box-shadow: var(--hi), var(--shadow);
}
.brand { display: flex; align-items: center; gap: 12px; font-size: 20px; font-weight: 700; letter-spacing: -.03em; padding: 2px 4px; }
.brand-icon { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; color: var(--ink); background: linear-gradient(150deg, var(--accent-hi), var(--accent) 60%, #f5b400); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .6), 0 8px 22px rgba(255, 214, 10, .28); }
.brand-icon .lucide { width: 20px; height: 20px; stroke-width: 2.2; }
.sidebar-rule { height: 1px; margin: 20px 4px; background: linear-gradient(90deg, transparent, var(--stroke-2), transparent); }
.side-section-header { display: flex; align-items: center; justify-content: space-between; padding: 0 4px; font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); }
.side-section-header > div { display: flex; gap: 2px; }
.small-arrow { width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; color: var(--muted); transition: background .16s, color .16s; }
.small-arrow:hover { background: var(--fill-2); color: var(--text); }
.small-arrow .lucide { width: 16px; height: 16px; }
.mini-calendar { padding: 10px 2px 0; }
.mini-month { font-size: 15px; font-weight: 600; letter-spacing: -.01em; padding: 0 4px; margin-bottom: 12px; }
.mini-month::first-letter, .week-summary strong::first-letter { text-transform: uppercase; }
.mini-weekdays, .mini-days { display: grid; grid-template-columns: repeat(7, 1fr); text-align: center; }
.mini-weekdays { font-size: 11px; font-weight: 600; color: var(--faint); margin-bottom: 4px; }
.mini-days { row-gap: 2px; }
.mini-days button, .mini-days span { height: 32px; width: 32px; margin: 0 auto; display: grid; place-items: center; border-radius: 50%; font-size: 13px; font-weight: 500; color: var(--muted); position: relative; transition: background .16s, color .16s; }
.mini-days button:hover { background: var(--fill-2); color: var(--text); }
.mini-days button.today { background: var(--accent); color: var(--ink); font-weight: 700; box-shadow: 0 4px 16px rgba(255, 214, 10, .35); }
.mini-days button.has-tasks:not(.today)::after { content: ""; position: absolute; bottom: 3px; width: 4px; height: 4px; border-radius: 50%; background: var(--accent); }
.upcoming-list { display: grid; gap: 8px; padding: 12px 0 0; }
.upcoming-item { display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 14px; background: var(--fill); border: 1px solid var(--stroke); }
.upcoming-line { width: 4px; height: 30px; border-radius: 4px; flex: 0 0 4px; background: rgba(255, 255, 255, .4); }
.upcoming-line.doing { background: var(--accent); box-shadow: 0 0 10px rgba(255, 214, 10, .5); }
.upcoming-item > div { min-width: 0; }
.upcoming-item strong { display: block; font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.upcoming-item small { font-size: 12px; color: var(--muted); }
.upcoming-empty { font-size: 13px; line-height: 1.5; color: var(--faint); padding: 4px; }
.sidebar-bottom { margin-top: auto; padding-top: 18px; display: grid; gap: 2px; }
.storage-note { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--faint); padding: 0 8px 8px; }
.storage-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px rgba(255, 214, 10, .7); }
.side-action { display: flex; align-items: center; gap: 11px; width: 100%; padding: 10px 8px; border-radius: 12px; font-size: 13.5px; font-weight: 500; color: var(--muted); transition: background .16s, color .16s; }
.side-action:hover { background: var(--fill-2); color: var(--text); }
.side-action .lucide { width: 17px; height: 17px; }
.sidebar-backdrop { display: none; }

/* ---------- barra superior ---------- */
.app-toolbar {
  position: sticky; top: 16px; z-index: 6; display: flex; align-items: center; gap: 12px; min-height: 68px; padding: 12px 14px 12px 22px;
  background: var(--glass); border: 1px solid var(--stroke); border-radius: 24px;
  backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); box-shadow: var(--hi), var(--shadow);
}
.period-title { font-size: 24px; font-weight: 700; letter-spacing: -.035em; line-height: 1.1; white-space: nowrap; }
.period-nav { display: flex; align-items: center; gap: 2px; margin-right: auto; }
.tool-icon { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; color: var(--muted); transition: background .16s, color .16s, transform .16s; }
.tool-icon:hover { background: var(--fill-2); color: var(--text); }
.today-control { height: 36px; padding: 0 14px; border-radius: 12px; font-size: 13px; font-weight: 600; color: var(--accent); background: var(--accent-soft); transition: background .16s; }
.today-control:hover { background: rgba(255, 214, 10, .24); }
.mode-switch { display: flex; gap: 2px; padding: 4px; border-radius: 15px; background: rgba(0, 0, 0, .35); border: 1px solid var(--stroke); }
.mode-switch button { display: flex; align-items: center; gap: 7px; height: 36px; padding: 0 13px; border-radius: 11px; font-size: 13px; font-weight: 600; color: var(--muted); transition: background .2s, color .2s; }
.mode-switch button:hover { color: var(--text); }
.mode-switch button.active { color: var(--ink); background: linear-gradient(160deg, var(--accent-hi), var(--accent)); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .55), 0 6px 16px rgba(255, 214, 10, .22); }
.mode-switch .lucide { width: 16px; height: 16px; }
.search-field { display: flex; align-items: center; gap: 9px; height: 44px; width: 190px; padding: 0 13px; border-radius: 14px; background: rgba(0, 0, 0, .35); border: 1px solid var(--stroke); color: var(--faint); transition: border-color .16s, box-shadow .16s, width .25s var(--ease); }
.search-field:focus-within { width: 240px; border-color: rgba(255, 214, 10, .6); box-shadow: 0 0 0 4px rgba(255, 214, 10, .13); color: var(--accent); }
.search-field input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; font-size: 14px; color: var(--text); }
.search-field input::placeholder { color: var(--faint); }
.search-field .lucide { width: 17px; height: 17px; }
.add-button { display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 18px 0 14px; border-radius: 14px; font-size: 14px; font-weight: 700; white-space: nowrap; color: var(--ink); background: linear-gradient(160deg, var(--accent-hi), var(--accent) 60%, #f5b400); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .6), 0 10px 26px rgba(255, 214, 10, .26); transition: transform .18s var(--ease), box-shadow .18s, filter .18s; }
.add-button:hover { transform: translateY(-2px); filter: brightness(1.06); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .6), 0 14px 32px rgba(255, 214, 10, .36); }
.add-button:active { transform: scale(.96); }
.add-button .lucide { width: 19px; height: 19px; stroke-width: 2.4; }
.mobile-menu, .search-toggle { display: none; }

/* ---------- quadro ---------- */
.board-view { display: flex; flex-direction: column; gap: 16px; padding: 0 0 24px; animation: view-in .3s var(--ease) both; }
.board-topline { display: flex; align-items: center; gap: 16px; padding: 4px 8px 0; }
.week-summary { display: flex; align-items: baseline; gap: 10px; white-space: nowrap; }
.week-summary strong { display: inline-block; font-size: 17px; font-weight: 700; letter-spacing: -.02em; }
.week-summary span { font-size: 13px; color: var(--muted); }
.progress { flex: 1; max-width: 260px; height: 6px; border-radius: 6px; background: rgba(255, 255, 255, .09); overflow: hidden; }
.progress i { display: block; height: 100%; width: 0; border-radius: 6px; background: linear-gradient(90deg, #f5b400, var(--accent-hi)); box-shadow: 0 0 12px rgba(255, 214, 10, .6); transition: width .5s var(--ease); }
.progress-label { font-size: 13px; color: var(--muted); white-space: nowrap; }
.scope-control { margin-left: auto; height: 36px; padding: 0 14px; border-radius: 11px; font-size: 13px; font-weight: 600; color: var(--text); background: var(--fill); border: 1px solid var(--stroke); transition: background .16s; }
.scope-control:hover { background: var(--fill-2); }

.week-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 10px; }
.week-day { position: relative; height: 84px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; border-radius: 20px; background: var(--fill); border: 1px solid var(--stroke); color: var(--text); transition: background .18s, border-color .18s, transform .18s var(--ease), box-shadow .18s; }
.week-day:hover { background: var(--fill-2); transform: translateY(-2px); }
.week-day span { font-size: 11.5px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--faint); }
.week-day strong { font-size: 23px; font-weight: 700; letter-spacing: -.03em; line-height: 1; }
.week-day small { display: flex; gap: 3px; height: 5px; }
.week-day small i { width: 5px; height: 5px; border-radius: 50%; background: var(--muted); }
.week-day.is-today { border-color: rgba(255, 214, 10, .45); background: var(--accent-soft); }
.week-day.is-today strong, .week-day.is-today span { color: var(--accent); }
.week-day.is-today small i { background: var(--accent); }
.week-day.is-selected { background: linear-gradient(160deg, var(--accent-hi), var(--accent)); border-color: transparent; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .55), 0 12px 28px rgba(255, 214, 10, .25); }
.week-day.is-selected strong, .week-day.is-selected span { color: var(--ink); }
.week-day.is-selected small i { background: var(--ink); }
.week-day.drop-ready { border-color: var(--accent); background: rgba(255, 214, 10, .28); transform: scale(1.05); box-shadow: 0 0 0 4px rgba(255, 214, 10, .18); }

.mobile-columns { display: none; }
.kanban-board { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: start; }
.kanban-column { min-width: 0; padding: 8px; border-radius: 26px; background: rgba(255, 255, 255, .028); border: 1px solid var(--stroke); box-shadow: var(--hi); }
.kanban-column[data-status="doing"] { background: linear-gradient(180deg, rgba(255, 214, 10, .075), rgba(255, 255, 255, .028) 180px); border-color: rgba(255, 214, 10, .2); }
.column-header { display: flex; align-items: center; justify-content: space-between; height: 48px; padding: 0 6px 0 12px; }
.column-title { display: flex; align-items: center; gap: 10px; }
.column-title h2 { font-size: 15px; font-weight: 700; letter-spacing: -.015em; }
.status-dot { width: 9px; height: 9px; border-radius: 50%; flex: 0 0 9px; }
.status-dot.todo { border: 2px solid rgba(255, 255, 255, .6); }
.status-dot.doing { background: var(--accent); box-shadow: 0 0 12px rgba(255, 214, 10, .8); }
.status-dot.done { background: rgba(255, 255, 255, .45); }
.column-count { min-width: 24px; height: 22px; padding: 0 7px; display: grid; place-items: center; border-radius: 11px; font-size: 12px; font-weight: 700; color: var(--muted); background: var(--fill-2); }
.column-add { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; color: var(--muted); transition: background .16s, color .16s, transform .25s var(--ease); }
.column-add:hover { background: var(--accent-soft); color: var(--accent); transform: rotate(90deg); }
.card-list { display: grid; align-content: start; gap: 8px; min-height: 150px; padding: 4px 0 2px; }

.task-card { position: relative; padding: 14px 14px 14px 22px; border-radius: 18px; background: linear-gradient(180deg, rgba(255, 255, 255, .095), rgba(255, 255, 255, .055)); border: 1px solid var(--stroke); box-shadow: var(--hi), 0 8px 20px rgba(0, 0, 0, .28); cursor: grab; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; transition: transform .2s var(--ease), box-shadow .2s, border-color .2s, background .2s; animation: card-in .3s var(--ease) both; }
/* barra de status à esquerda, como os eventos de um calendário */
.task-card::before { content: ""; position: absolute; left: 9px; top: 13px; bottom: 13px; width: 4px; border-radius: 4px; background: rgba(255, 255, 255, .34); }
.task-card[data-status="doing"]::before { background: var(--accent); box-shadow: 0 0 12px rgba(255, 214, 10, .55); }
.task-card[data-status="done"]::before { background: rgba(255, 255, 255, .16); }
.task-card:hover { transform: translateY(-3px); border-color: var(--stroke-2); box-shadow: var(--hi), 0 16px 34px rgba(0, 0, 0, .45); }
.task-card:active { cursor: grabbing; }
.task-card-top { display: flex; align-items: flex-start; gap: 11px; }
.task-card h3 { flex: 1; min-width: 0; font-size: 15px; font-weight: 600; letter-spacing: -.012em; line-height: 1.35; overflow-wrap: anywhere; }
.complete-button { position: relative; width: 22px; height: 22px; flex: 0 0 22px; border-radius: 50%; display: grid; place-items: center; border: 2px solid rgba(255, 255, 255, .32); color: var(--ink); transition: border-color .16s, background .16s, transform .16s var(--ease); }
.complete-button::after { content: ""; position: absolute; inset: -10px; }
.complete-button:hover { border-color: var(--accent); background: var(--accent-soft); transform: scale(1.12); }
.complete-button .lucide { width: 13px; height: 13px; stroke-width: 3.2; }
.task-card.done .complete-button { background: var(--accent); border-color: var(--accent); }
.task-card.done h3 { text-decoration: line-through; text-decoration-color: rgba(255, 255, 255, .35); color: var(--muted); }
.task-card.done { background: rgba(255, 255, 255, .035); box-shadow: none; }
.card-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 5px 12px; margin: 9px 0 0 33px; font-size: 12.5px; font-weight: 500; color: var(--muted); }
.meta-chip { display: inline-flex; align-items: center; gap: 5px; }
.card-meta .lucide { width: 13px; height: 13px; opacity: .8; }
.meta-chip.overdue { color: var(--danger); }
.meta-chip.priority { color: var(--accent); font-weight: 700; padding: 2px 8px 2px 6px; border-radius: 8px; background: var(--accent-soft); }
.meta-chip.overdue .lucide, .meta-chip.priority .lucide { opacity: 1; }
.card-notes { margin: 8px 0 0 33px; font-size: 12.5px; line-height: 1.45; color: var(--faint); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.empty-column { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; min-height: 142px; border-radius: 18px; border: 1.5px dashed rgba(255, 255, 255, .1); font-size: 13px; color: var(--faint); text-align: center; }
.empty-column .lucide { width: 24px; height: 24px; opacity: .55; }

/* arrastar */
.task-card.sortable-ghost { opacity: .25; }
.task-card.sortable-drag { opacity: 1 !important; animation: none; transform: rotate(2deg) scale(1.04); border-color: rgba(255, 214, 10, .6); background: linear-gradient(180deg, #2c2a22, #1d1c18); box-shadow: 0 30px 60px rgba(0, 0, 0, .7), 0 0 0 1px rgba(255, 214, 10, .25); cursor: grabbing; }
body.is-dragging { cursor: grabbing; user-select: none; -webkit-user-select: none; }
body.is-dragging .kanban-board { scroll-snap-type: none; }
body.is-dragging .task-card:hover { transform: none; }
body.is-dragging .week-day:not(.drop-ready) { border-style: dashed; border-color: rgba(255, 214, 10, .4); }

/* ---------- calendário ---------- */
.calendar-view { padding: 0 0 24px; animation: view-in .3s var(--ease) both; }
#full-calendar { border-radius: 24px; overflow: hidden; border: 1px solid var(--stroke); box-shadow: var(--hi), var(--shadow); }
html [data-color-scheme=dark], html[data-color-scheme=dark] {
  --fc-pulse-background: #0b0b0c; --fc-pulse-foreground: #f5f5f7; --fc-pulse-faint-foreground: #77777d; --fc-pulse-muted-foreground: #a8a8ae;
  --fc-pulse-border: #1c1c1f; --fc-pulse-strong-border: #2c2c30;
  --fc-pulse-primary: #ffd60a; --fc-pulse-primary-over: #ffe566; --fc-pulse-primary-down: #f5b400; --fc-pulse-primary-foreground: #181300;
  --fc-pulse-tertiary: #ffd60a; --fc-pulse-tertiary-over: #ffe566; --fc-pulse-tertiary-down: #f5b400; --fc-pulse-tertiary-foreground: #181300;
  --fc-pulse-event: #3a3a3e; --fc-pulse-event-contrast: #f5f5f7; --fc-pulse-background-event: #ffd60a;
  --fc-pulse-highlight: rgba(255, 214, 10, .12); --fc-pulse-now: #ffd60a;
}

/* ---------- edição ---------- */
.task-dialog { width: min(480px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); padding: 0; overflow: auto; color: var(--text); border: 1px solid var(--stroke-2); border-radius: 28px; background: linear-gradient(180deg, rgba(44, 44, 48, .92), rgba(22, 22, 24, .94)); backdrop-filter: blur(40px) saturate(180%); -webkit-backdrop-filter: blur(40px) saturate(180%); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .2), 0 40px 100px rgba(0, 0, 0, .8); }
.task-dialog[open] { animation: dialog-in .32s var(--ease) both; }
.task-dialog::backdrop { background: rgba(0, 0, 0, .6); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); animation: fade-in .25s both; }
.dialog-head { display: flex; align-items: center; justify-content: space-between; padding: 22px 22px 6px 26px; }
.dialog-head h2 { font-size: 21px; font-weight: 700; letter-spacing: -.03em; }
.close-button { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; color: var(--muted); background: var(--fill-2); transition: background .16s, color .16s; }
.close-button:hover { background: rgba(255, 255, 255, .18); color: var(--text); }
.dialog-body { padding: 16px 26px 6px; }
.field { display: grid; gap: 7px; margin-bottom: 16px; }
.field span { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.field b { color: var(--accent); }
.field input, .field select, .field textarea { width: 100%; min-height: 46px; padding: 10px 14px; border-radius: 14px; font-size: 15px; outline: 0; background: rgba(0, 0, 0, .32); border: 1px solid var(--stroke); transition: border-color .16s, box-shadow .16s; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: rgba(255, 214, 10, .7); box-shadow: 0 0 0 4px rgba(255, 214, 10, .14); }
.field input::placeholder, .field textarea::placeholder { color: var(--faint); }
.field select option { background: #1c1c1e; }
.field textarea { resize: vertical; line-height: 1.45; }
#task-title { font-size: 17px; font-weight: 600; min-height: 52px; }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.more-fields { border-top: 1px solid var(--stroke); padding-top: 4px; }
.more-fields summary { padding: 12px 0; font-size: 13.5px; font-weight: 600; color: var(--muted); cursor: pointer; }
.more-fields summary:hover { color: var(--text); }
.form-error { margin: 0 0 12px; padding: 11px 14px; border-radius: 12px; font-size: 13.5px; color: #ffb4ae; background: rgba(255, 69, 58, .16); }
.dialog-footer { display: flex; align-items: center; gap: 10px; padding: 14px 26px 24px; }
.footer-spacer { flex: 1; }
.delete-button, .secondary-button, .save-button { height: 46px; padding: 0 18px; border-radius: 14px; font-size: 14.5px; font-weight: 600; transition: background .16s, transform .16s var(--ease), filter .16s; }
.delete-button { color: var(--danger); padding: 0 12px; }
.delete-button:hover { background: rgba(255, 69, 58, .14); }
.secondary-button { background: var(--fill-2); border: 1px solid var(--stroke); }
.secondary-button:hover { background: rgba(255, 255, 255, .16); }
.save-button { min-width: 120px; font-weight: 700; color: var(--ink); background: linear-gradient(160deg, var(--accent-hi), var(--accent)); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .55), 0 10px 24px rgba(255, 214, 10, .24); }
.save-button:hover { filter: brightness(1.07); }
.save-button:active, .secondary-button:active { transform: scale(.97); }

.toast { position: fixed; right: 24px; bottom: 24px; z-index: 99; padding: 12px 18px; border-radius: 16px; font-size: 13.5px; font-weight: 500; background: rgba(40, 40, 44, .82); border: 1px solid var(--stroke-2); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); box-shadow: var(--hi), 0 16px 40px rgba(0, 0, 0, .6); opacity: 0; transform: translateY(10px) scale(.97); pointer-events: none; transition: opacity .25s, transform .3s var(--ease); }
.toast.show { opacity: 1; transform: none; }

@keyframes view-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes card-in { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes dialog-in { from { opacity: 0; transform: translateY(16px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes sheet-in { from { transform: translateY(100%); } to { transform: none; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

/* toque: sem "hover" preso */
@media (hover: none) {
  .task-card:hover { transform: none; border-color: var(--stroke); box-shadow: var(--hi), 0 8px 20px rgba(0, 0, 0, .28); }
  .week-day:hover, .add-button:hover { transform: none; }
  .column-add:hover { transform: none; }
  .task-card:active { transform: scale(.985); }
  .week-day:active { transform: scale(.96); }
}

/* ---------- telas médias ---------- */
@media (max-width: 1240px) {
  .sidebar { width: 240px; flex-basis: 240px; }
  .mode-switch button span, .add-label { display: none; }
  .mode-switch button { padding: 0 12px; }
  .add-button { padding: 0 13px; }
  .search-field { width: 150px; }
  .search-field:focus-within { width: 190px; }
  .period-title { font-size: 21px; }
}

/* ---------- tablet e celular ---------- */
@media (max-width: 830px) {
  .app-shell { display: block; padding: 0; }
  .main-content { gap: 0; }
  .sidebar-backdrop:not([hidden]) { display: block; position: fixed; inset: 0; z-index: 19; background: rgba(0, 0, 0, .6); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); animation: fade-in .2s both; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; z-index: 20; width: min(320px, 86vw); height: 100dvh; border-radius: 0 28px 28px 0; border-left: 0; padding: calc(20px + var(--safe-t)) 18px calc(20px + var(--safe-b)) calc(18px + var(--safe-l)); background: linear-gradient(180deg, rgba(36, 36, 40, .9), rgba(14, 14, 16, .94)); transform: translateX(-105%); transition: transform .32s var(--ease); }
  .sidebar.open { transform: none; }
  .mini-days button, .mini-days span { width: 38px; height: 38px; font-size: 14px; }
  .small-arrow { width: 38px; height: 38px; }
  .side-action { padding: 13px 8px; font-size: 15px; }

  /* o vidro fica num ::before para os itens fixos (navegação e botão +) escaparem da barra */
  .app-toolbar { top: 0; min-height: 60px; flex-wrap: wrap; gap: 6px; padding: calc(10px + var(--safe-t)) calc(10px + var(--safe-r)) 10px calc(10px + var(--safe-l)); border: 0; border-radius: 0; background: none; box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none; }
  .app-toolbar::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(20, 20, 22, .82), rgba(8, 8, 9, .7)); border-bottom: 1px solid var(--stroke); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); }
  .mobile-menu, .search-toggle { display: grid; }
  .tool-icon { width: 40px; height: 40px; }
  .tool-icon .lucide { width: 21px; height: 21px; }
  .period-title { flex: 1; min-width: 0; font-size: 20px; overflow: hidden; text-overflow: ellipsis; }
  .period-nav { margin-right: 0; gap: 0; }
  .today-control { padding: 0 12px; }
  .search-open .search-toggle { background: var(--accent-soft); color: var(--accent); }
  .search-field { display: none; order: 5; width: 100%; height: 46px; }
  .search-field:focus-within { width: 100%; }
  .search-open .search-field { display: flex; animation: card-in .22s var(--ease) both; }
  .search-field input { font-size: 16px; }

  /* navegação inferior */
  .mode-switch { position: fixed; z-index: 7; left: calc(12px + var(--safe-l)); right: calc(12px + var(--safe-r)); bottom: calc(10px + var(--safe-b)); height: var(--nav-h); padding: 5px; gap: 2px; border-radius: 24px; background: linear-gradient(180deg, rgba(48, 48, 52, .72), rgba(18, 18, 20, .8)); border: 1px solid var(--stroke-2); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .2), 0 18px 44px rgba(0, 0, 0, .75); }
  .mode-switch button { flex: 1; flex-direction: column; justify-content: center; gap: 4px; height: 100%; padding: 0; border-radius: 19px; font-size: 11px; }
  .mode-switch button span { display: inline; }
  .mode-switch .lucide { width: 21px; height: 21px; }

  /* botão flutuante */
  .add-button { position: fixed; z-index: 7; right: calc(16px + var(--safe-r)); bottom: calc(var(--nav-h) + 24px + var(--safe-b)); width: 58px; height: 58px; padding: 0; justify-content: center; border-radius: 21px; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .6), 0 14px 32px rgba(0, 0, 0, .65), 0 6px 22px rgba(255, 214, 10, .35); }
  .add-button .lucide { width: 26px; height: 26px; }
  .add-label { display: none; }

  .board-view { gap: 14px; padding: 14px calc(14px + var(--safe-r)) calc(var(--nav-h) + 36px + var(--safe-b)) calc(14px + var(--safe-l)); }
  .calendar-view { padding: 12px 10px calc(var(--nav-h) + 36px + var(--safe-b)); }
  .board-topline { flex-wrap: wrap; gap: 8px 12px; padding: 2px 4px 0; }
  .progress { order: 3; flex: 1 1 100%; max-width: none; }
  .kanban-board { grid-template-columns: repeat(3, minmax(240px, 1fr)); overflow-x: auto; padding-bottom: 6px; }
  .toast { left: 50%; right: auto; bottom: calc(var(--nav-h) + 26px + var(--safe-b)); max-width: calc(100vw - 116px); text-align: center; transform: translate(-50%, 10px) scale(.97); }
  .toast.show { transform: translate(-50%, 0); }
}

/* ---------- celular ---------- */
@media (max-width: 650px) {
  .week-days { gap: 6px; }
  .week-day { height: 70px; border-radius: 16px; gap: 3px; }
  .week-day span { font-size: 10px; letter-spacing: .04em; }
  .week-day strong { font-size: 19px; }
  .week-day:hover { transform: none; }
  .progress-label { display: none; }

  .mobile-columns { display: flex; gap: 4px; padding: 4px; border-radius: 16px; background: rgba(0, 0, 0, .35); border: 1px solid var(--stroke); }
  .mobile-columns button { flex: 1; min-height: 40px; display: flex; align-items: center; justify-content: center; gap: 6px; border-radius: 12px; padding: 0 4px; font-size: 13px; font-weight: 600; white-space: nowrap; color: var(--muted); transition: background .2s, color .2s; }
  .mobile-columns b { min-width: 20px; padding: 2px 6px; border-radius: 9px; font-size: 11px; font-weight: 700; background: var(--fill-2); }
  .mobile-columns button.active { color: var(--ink); background: linear-gradient(160deg, var(--accent-hi), var(--accent)); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .55), 0 6px 14px rgba(255, 214, 10, .2); }
  .mobile-columns button.active b { background: rgba(0, 0, 0, .16); color: var(--ink); }

  .kanban-board { display: flex; gap: 10px; margin: 0 -14px; padding: 0 14px 10px; overflow-x: auto; align-items: stretch; scroll-snap-type: x mandatory; scroll-padding-inline: 14px; scrollbar-width: none; overscroll-behavior-x: contain; }
  .kanban-board::-webkit-scrollbar { display: none; }
  .kanban-column { flex: 0 0 calc(100% - 36px); scroll-snap-align: start; min-height: calc(100dvh - 400px); border-radius: 24px; }
  .task-card h3 { font-size: 16px; }
  .card-meta, .card-notes { font-size: 13px; }

  /* edição como folha inferior */
  .task-dialog { position: fixed; inset: auto 0 0 0; width: 100%; max-width: none; max-height: 92dvh; margin: 0; border-radius: 30px 30px 0 0; border-bottom: 0; overflow: hidden; }
  .task-dialog[open] { animation: sheet-in .36s var(--ease) both; }
  .task-dialog form { display: flex; flex-direction: column; max-height: 92dvh; }
  .dialog-head { position: relative; flex: 0 0 auto; padding: 26px 18px 6px 22px; }
  .dialog-head::before { content: ""; position: absolute; top: 9px; left: 50%; width: 40px; height: 5px; margin-left: -20px; border-radius: 5px; background: rgba(255, 255, 255, .3); }
  .dialog-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 14px 22px 6px; }
  .field input, .field select, .field textarea { font-size: 16px; min-height: 50px; }
  #task-title { font-size: 17px; min-height: 54px; }
  .dialog-footer { flex: 0 0 auto; padding: 12px 22px calc(16px + var(--safe-b)); }
  .footer-spacer { display: none; }
  .delete-button, .secondary-button, .save-button { height: 52px; font-size: 16px; border-radius: 16px; }
  .secondary-button { flex: 1; }
  .save-button { flex: 1.6; }
}

@media (max-width: 370px) {
  .period-title { font-size: 17px; }
  .tool-icon { width: 36px; }
  .mobile-columns button { font-size: 12px; gap: 4px; }
  .week-day strong { font-size: 17px; }
}

/* celular deitado */
@media (max-width: 830px) and (max-height: 480px) {
  :root { --nav-h: 50px; }
  .mode-switch button { flex-direction: row; gap: 7px; font-size: 12.5px; }
  .mode-switch .lucide { width: 17px; height: 17px; }
  .kanban-column { min-height: 200px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* ---------- tarefa fixa e sincronização ---------- */
.meta-chip.repeat { color: var(--accent); }
.meta-chip.repeat .lucide { opacity: 1; }
.day-chips { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin: -4px 0 16px; }
.day-chips button { height: 42px; border-radius: 12px; font-size: 13px; font-weight: 600; color: var(--muted); background: rgba(0, 0, 0, .32); border: 1px solid var(--stroke); transition: background .16s, color .16s, transform .16s var(--ease); }
.day-chips button:active { transform: scale(.94); }
.day-chips button.on { color: var(--ink); border-color: transparent; background: linear-gradient(160deg, var(--accent-hi), var(--accent)); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .55); }
.field-hint { margin: -6px 0 14px; font-size: 12.5px; line-height: 1.45; color: var(--faint); }
.sync-body { padding-bottom: 24px; }
.sync-body > div { display: grid; gap: 12px; }
.dialog-text { font-size: 14.5px; line-height: 1.5; color: var(--muted); }
.dialog-text.small { font-size: 12.5px; color: var(--faint); }
.wide { width: 100%; display: flex; align-items: center; justify-content: center; gap: 9px; text-decoration: none; color: var(--text); }
.save-button.wide { color: var(--ink); }
.delete-button.wide { color: var(--danger); }
.code-box { padding: 16px 10px; border-radius: 16px; text-align: center; font-size: 17px; font-weight: 700; letter-spacing: .06em; font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; color: var(--accent); background: rgba(0, 0, 0, .4); border: 1px dashed rgba(255, 214, 10, .4); user-select: all; -webkit-user-select: all; overflow-wrap: anywhere; }
.inline-form { display: flex; gap: 8px; }
.inline-form input { flex: 1; min-width: 0; height: 46px; padding: 0 14px; border-radius: 14px; font-size: 16px; outline: 0; background: rgba(0, 0, 0, .32); border: 1px solid var(--stroke); text-transform: uppercase; }
.inline-form input:focus { border-color: rgba(255, 214, 10, .7); box-shadow: 0 0 0 4px rgba(255, 214, 10, .14); }
.storage-note[data-state="none"] .storage-dot, .storage-note[data-state="off"] .storage-dot { background: rgba(255, 255, 255, .4); box-shadow: none; }
.storage-note[data-state="busy"] .storage-dot { animation: pulse 1s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .3; } }
@media (max-width: 650px) {
  #sync-dialog { overflow-y: auto; }
  .sync-body { padding-bottom: calc(24px + var(--safe-b)); }
  .day-chips button { height: 46px; }
}
