/* ============================================================
   MyNote — identidade visual
   Azul MyNote #3B3FD8 · Âmbar Post-it #FFB020 · Tinta #14162E · Papel #F7F6F2
   Tipografia: Plus Jakarta Sans
   ============================================================ */
:root {
  --brand: #3B3FD8;
  --brand-600: #2F33B8;
  --brand-50: #EEEFFE;
  --brand-100: #DCDDFC;
  --accent: #FFB020;
  --accent-50: #FFF5E0;
  --ink: #14162E;
  --text: #1F2240;
  --muted: #6B6E8A;
  --faint: #9A9CB4;
  --bg: #F7F6F2;
  --surface: #FFFFFF;
  --surface-2: #FBFAF7;
  --line: #E8E6DF;
  --line-2: #F0EEE8;
  --danger: #E11D48;
  --danger-50: #FFE4EA;
  --ok: #10B981;
  --ok-50: #DCFCE9;
  --warn: #F59E0B;
  --weekend: #F3F1EA;
  --holiday: #FFF5E0;
  --shadow-sm: 0 1px 2px rgba(20, 22, 46, .06);
  --shadow: 0 4px 16px rgba(20, 22, 46, .08), 0 1px 3px rgba(20, 22, 46, .06);
  --shadow-lg: 0 24px 64px rgba(20, 22, 46, .22);
  --radius: 14px;
  --radius-sm: 9px;
  --sidebar: 236px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --brand: #7276F5; --brand-600: #8A8DF8; --brand-50: #1F2148; --brand-100: #2A2D60;
    --accent: #FFC14D; --accent-50: #3A2E14;
    --ink: #0B0C1A; --text: #E7E8F3; --muted: #A0A2BE; --faint: #6D7090;
    --bg: #0F1020; --surface: #171931; --surface-2: #1B1D38; --line: #2A2C4A; --line-2: #222440;
    --danger: #FB7185; --danger-50: #3B1522; --ok: #34D399; --ok-50: #0F2E25;
    --weekend: #14152B; --holiday: #2A2314;
    --shadow-sm: 0 1px 2px rgba(0,0,0,.4); --shadow: 0 4px 16px rgba(0,0,0,.35); --shadow-lg: 0 24px 64px rgba(0,0,0,.6);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --brand: #7276F5; --brand-600: #8A8DF8; --brand-50: #1F2148; --brand-100: #2A2D60;
  --accent: #FFC14D; --accent-50: #3A2E14;
  --ink: #0B0C1A; --text: #E7E8F3; --muted: #A0A2BE; --faint: #6D7090;
  --bg: #0F1020; --surface: #171931; --surface-2: #1B1D38; --line: #2A2C4A; --line-2: #222440;
  --danger: #FB7185; --danger-50: #3B1522; --ok: #34D399; --ok-50: #0F2E25;
  --weekend: #14152B; --holiday: #2A2314;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.4); --shadow: 0 4px 16px rgba(0,0,0,.35); --shadow-lg: 0 24px 64px rgba(0,0,0,.6);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 14px; line-height: 1.45; color: var(--text); background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--brand); }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

.boot { height: 100vh; display: grid; place-items: center; animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .45; transform: scale(.96); } }

/* ---------- marca ---------- */
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); }
.brand img { width: 34px; height: 34px; }
.wordmark { font-size: 21px; letter-spacing: -.02em; font-weight: 500; }
.wordmark b { font-weight: 800; }
.wordmark i { font-style: normal; color: var(--accent); }

/* ---------- botões e campos ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 36px; padding: 0 14px; border-radius: var(--radius-sm); border: 1px solid var(--line);
  background: var(--surface); font-weight: 600; font-size: 13.5px; white-space: nowrap;
  transition: background .15s, border-color .15s, transform .05s;
}
.btn:hover { background: var(--surface-2); border-color: var(--faint); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-600); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--line-2); }
.btn.danger { color: var(--danger); }
.btn.danger:hover { background: var(--danger-50); border-color: var(--danger); }
.btn.sm { height: 30px; padding: 0 10px; font-size: 12.5px; }
.btn.icon { width: 36px; padding: 0; }
.btn.sm.icon { width: 30px; }
.btn svg { width: 17px; height: 17px; flex: none; }
.btn:disabled { opacity: .5; cursor: default; }

.field { display: flex; flex-direction: column; gap: 5px; }
.field > span { font-size: 12px; font-weight: 600; color: var(--muted); }
.input, select.input, textarea.input {
  height: 38px; padding: 0 12px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface); width: 100%; transition: border-color .15s, box-shadow .15s;
}
textarea.input { height: auto; padding: 10px 12px; resize: vertical; min-height: 120px; line-height: 1.55; }
.input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-100); }
.check { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; font-weight: 500; }
.check input { width: 16px; height: 16px; accent-color: var(--brand); }

/* ---------- login ---------- */
.auth {
  min-height: 100vh; display: grid; place-items: center; padding: 24px 16px;
  background:
    radial-gradient(800px 400px at 15% 0%, var(--brand-50), transparent 70%),
    radial-gradient(600px 300px at 100% 100%, var(--accent-50), transparent 70%), var(--bg);
}
.auth-card {
  width: 100%; max-width: 400px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 20px; padding: 32px; box-shadow: var(--shadow);
}
.auth-card .brand { justify-content: center; margin-bottom: 6px; }
.auth-card .brand img { width: 46px; height: 46px; }
.auth-card .wordmark { font-size: 28px; }
.auth-card .tagline { text-align: center; color: var(--muted); margin: 0 0 24px; }
.auth-card form { display: grid; gap: 14px; }
.auth-card .btn { height: 42px; margin-top: 4px; }
.form-error { color: var(--danger); font-size: 13px; min-height: 18px; margin: 0; }
.hint { color: var(--muted); font-size: 12.5px; margin: 0; }

/* ---------- layout ---------- */
.shell { display: grid; grid-template-columns: var(--sidebar) 1fr; height: 100vh; }
.sidebar {
  background: var(--surface); border-right: 1px solid var(--line); padding: 18px 14px;
  display: flex; flex-direction: column; gap: 18px; overflow-y: auto;
}
.sidebar .brand { padding: 2px 8px 8px; }
.nav { display: grid; gap: 2px; }
.nav button {
  display: flex; align-items: center; gap: 11px; height: 38px; padding: 0 11px; border: 0;
  background: transparent; border-radius: var(--radius-sm); font-weight: 600; color: var(--muted); text-align: left;
}
.nav button svg { width: 18px; height: 18px; flex: none; }
.nav button:hover { background: var(--line-2); color: var(--text); }
.nav button.on { background: var(--brand-50); color: var(--brand); }
.nav .count {
  margin-left: auto; font-size: 11px; font-weight: 700; background: var(--danger); color: #fff;
  border-radius: 99px; padding: 1px 7px;
}
.side-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); padding: 0 11px; margin-bottom: 6px; }
.mini-cal { padding: 0 4px; }
.side-cats { display: grid; gap: 1px; }
.side-cats button {
  display: flex; align-items: center; gap: 9px; border: 0; background: none; padding: 5px 11px;
  border-radius: 7px; font-size: 13px; color: var(--muted); text-align: left;
}
.side-cats button:hover { background: var(--line-2); color: var(--text); }
.side-cats button.on { color: var(--text); font-weight: 700; background: var(--line-2); }
.dot { width: 9px; height: 9px; border-radius: 50%; flex: none; display: inline-block; }
.side-user {
  margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 10px 8px 0;
  border-top: 1px solid var(--line);
}
.side-user .who { min-width: 0; flex: 1; }
.side-user .who b { display: block; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-user .who small { color: var(--muted); font-size: 11.5px; }

.avatar {
  width: 30px; height: 30px; border-radius: 50%; display: inline-grid; place-items: center; flex: none;
  color: #fff; font-weight: 700; font-size: 12px; letter-spacing: -.02em;
}
.avatar.sm { width: 22px; height: 22px; font-size: 10px; }

.main { overflow: hidden; display: flex; flex-direction: column; min-width: 0; }
.topbar {
  display: flex; align-items: center; gap: 12px; padding: 14px 24px; border-bottom: 1px solid var(--line);
  background: var(--surface); min-height: 64px;
}
.topbar h1 { font-size: 19px; margin: 0; letter-spacing: -.02em; font-weight: 800; }
.topbar .spacer { flex: 1; }
.menu-btn { display: none; }
.view { flex: 1; overflow: auto; }

/* ---------- calendário ---------- */
.cal-layout { display: grid; grid-template-columns: minmax(0, 1fr) 420px; height: 100%; }
.cal-wrap { display: flex; flex-direction: column; padding: 18px 20px 20px 24px; min-height: 0; overflow: auto; }
.cal-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.cal-head h2 { margin: 0; font-size: 26px; font-weight: 800; letter-spacing: -.03em; text-transform: capitalize; }
.cal-head .month-stats { flex-wrap: nowrap; }
.cal-head h2 span { color: var(--faint); font-weight: 500; }
.cal-head .spacer { flex: 1; }
.month-stats { display: flex; gap: 6px; flex-wrap: wrap; }
.pill {
  display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 99px;
  background: var(--surface); border: 1px solid var(--line); font-size: 12px; font-weight: 600; color: var(--muted);
}
.pill b { color: var(--text); }

.cal-grid {
  flex: 1; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); grid-template-rows: auto;
  grid-auto-rows: minmax(108px, 1fr); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; background: var(--line); gap: 1px; box-shadow: var(--shadow-sm);
}
.cal-dow { background: var(--surface); padding: 9px 10px; font-size: 11.5px; font-weight: 700; color: var(--faint); text-transform: uppercase; letter-spacing: .06em; }
.cal-day {
  background: var(--surface); padding: 7px 7px 6px; display: flex; flex-direction: column; gap: 3px;
  cursor: pointer; position: relative; min-width: 0; transition: background .12s; border: 0; text-align: left;
}
.cal-day:hover { background: var(--surface-2); }
.cal-day.weekend { background: var(--weekend); }
.cal-day.holiday { background: var(--holiday); }
.cal-day.out { opacity: .42; }
.cal-day.sel { box-shadow: inset 0 0 0 2px var(--brand); z-index: 1; }
.cal-day.over { background: var(--brand-50); outline: 2px dashed var(--brand); outline-offset: -3px; }
.cal-day .num { display: flex; align-items: center; gap: 6px; font-weight: 700; font-size: 13px; }
.cal-day .num .n { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; }
.cal-day.today .num .n { background: var(--brand); color: #fff; }
.cal-day .hol { font-size: 10.5px; color: #B7791F; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-day .badge-open { margin-left: auto; font-size: 10.5px; font-weight: 700; color: var(--brand); background: var(--brand-50); padding: 1px 6px; border-radius: 99px; }
.cal-day .badge-open.urg { color: var(--danger); background: var(--danger-50); }
.chip {
  display: flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 500; padding: 2px 6px;
  border-radius: 6px; background: var(--line-2); white-space: nowrap; overflow: hidden; min-width: 0;
  border-left: 3px solid var(--c, var(--faint));
}
.chip span { overflow: hidden; text-overflow: ellipsis; }
.chip.done span { text-decoration: line-through; color: var(--faint); }
.chip .t { color: var(--muted); font-weight: 600; font-variant-numeric: tabular-nums; flex: none; }
.cal-day .more { font-size: 11px; color: var(--muted); font-weight: 600; padding-left: 4px; }

/* ---------- painel do dia ---------- */
.day-panel { border-left: 1px solid var(--line); background: var(--surface); display: flex; flex-direction: column; min-height: 0; }
.day-head { padding: 18px 20px 12px; border-bottom: 1px solid var(--line-2); }
.day-head .row { display: flex; align-items: flex-start; gap: 8px; }
.day-head h3 { margin: 0; font-size: 20px; letter-spacing: -.02em; font-weight: 800; flex: 1; }
.day-head h3 small { display: block; font-size: 12.5px; font-weight: 600; color: var(--muted); letter-spacing: 0; margin-top: 2px; }
.day-head h3 small::first-letter { text-transform: uppercase; }
.day-head .hol-tag { display: inline-block; margin-top: 6px; font-size: 11.5px; font-weight: 700; color: #B7791F; background: var(--accent-50); padding: 2px 8px; border-radius: 99px; }
.day-summary { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }

.quick { padding: 12px 20px; border-bottom: 1px solid var(--line-2); display: grid; gap: 8px; }
.quick-box {
  display: flex; align-items: center; gap: 6px; border: 1.5px solid var(--line); border-radius: 12px;
  padding: 4px 4px 4px 12px; background: var(--surface-2); transition: border-color .15s, box-shadow .15s;
}
.quick-box:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-100); background: var(--surface); }
.quick-box input { flex: 1; border: 0; background: transparent; height: 34px; outline: none; min-width: 0; }
.kind-toggle { display: inline-flex; background: var(--line-2); border-radius: 8px; padding: 2px; }
.kind-toggle button { border: 0; background: transparent; height: 28px; padding: 0 10px; border-radius: 6px; font-size: 12px; font-weight: 700; color: var(--muted); }
.kind-toggle button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.quick .hint code { background: var(--line-2); padding: 0 4px; border-radius: 4px; font-size: 11.5px; }

.day-filter { display: flex; gap: 4px; padding: 10px 20px 0; flex-wrap: wrap; }
.day-filter button { border: 1px solid var(--line); background: var(--surface); border-radius: 99px; height: 26px; padding: 0 10px; font-size: 12px; font-weight: 600; color: var(--muted); }
.day-filter button.on { background: var(--text); color: var(--surface); border-color: var(--text); }

.day-list { flex: 1; overflow-y: auto; padding: 12px 20px 24px; display: flex; flex-direction: column; gap: 10px; }
.section-title { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); margin: 8px 0 0; display: flex; align-items: center; gap: 8px; }
.section-title button { margin-left: auto; }

.empty { text-align: center; color: var(--muted); padding: 34px 12px; }
.empty svg { width: 64px; height: 64px; opacity: .9; margin-bottom: 8px; }
.empty b { display: block; color: var(--text); font-size: 15px; margin-bottom: 4px; }

/* ---------- cartões ---------- */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 11px 13px 10px 15px;
  position: relative; cursor: pointer; transition: box-shadow .15s, border-color .15s, transform .15s;
  box-shadow: var(--shadow-sm);
}
.card::before { content: ''; position: absolute; left: 0; top: 10px; bottom: 10px; width: 4px; border-radius: 0 4px 4px 0; background: var(--c, var(--faint)); }
.card:hover { border-color: var(--faint); box-shadow: var(--shadow); }
.card.urgent { border-color: color-mix(in srgb, var(--danger) 45%, var(--line)); }
.card.pinned { background: var(--accent-50); border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); }
.card .top { display: flex; align-items: center; gap: 7px; font-size: 11.5px; color: var(--muted); font-weight: 600; margin-bottom: 3px; flex-wrap: wrap; }
.card .top .cat { color: var(--c); font-weight: 700; }
.card .top .time { font-variant-numeric: tabular-nums; color: var(--text); }
.card .title-row { display: flex; align-items: flex-start; gap: 8px; }
.card .title { font-weight: 700; font-size: 14.5px; flex: 1; word-break: break-word; }
.card.done .title { text-decoration: line-through; color: var(--faint); }
.card .tick {
  width: 20px; height: 20px; border-radius: 6px; border: 2px solid var(--faint); background: transparent; flex: none;
  display: grid; place-items: center; margin-top: 1px; padding: 0; color: #fff;
}
.card .tick:hover { border-color: var(--ok); }
.card .tick svg { width: 13px; height: 13px; opacity: 0; }
.card.done .tick { background: var(--ok); border-color: var(--ok); }
.card.done .tick svg { opacity: 1; }
.card.doing .tick { border-color: var(--warn); background: color-mix(in srgb, var(--warn) 20%, transparent); }
.card .body { color: var(--muted); font-size: 13px; margin-top: 4px; max-height: 120px; overflow: hidden; word-break: break-word; }
.card .foot { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size: 11.5px; color: var(--muted); flex-wrap: wrap; }
.card .foot .sp { flex: 1; }
.card .foot .meta { display: inline-flex; align-items: center; gap: 3px; }
.card .foot svg { width: 13px; height: 13px; }
.tag { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 99px; }
.tag.urg { background: var(--danger-50); color: var(--danger); }
.tag.high { background: var(--accent-50); color: #B7791F; }
.tag.todo { background: var(--line-2); color: var(--muted); }
.tag.doing { background: color-mix(in srgb, var(--warn) 18%, transparent); color: #B45309; }
.tag.done { background: var(--ok-50); color: #047857; }
.tag.late { background: var(--danger-50); color: var(--danger); }
.tag.pin { background: var(--accent-50); color: #B7791F; }

/* corpo com checklist */
.rich p { margin: 0 0 4px; }
.rich ul { margin: 0 0 4px; padding-left: 18px; }
.rich .cl { display: flex; align-items: flex-start; gap: 7px; margin: 2px 0; }
.rich .cl input { margin-top: 3px; accent-color: var(--ok); cursor: pointer; }
.rich .cl.ok span { text-decoration: line-through; color: var(--faint); }
.rich a { word-break: break-all; }

/* ---------- quadro ---------- */
.board-wrap { padding: 18px 24px 24px; height: 100%; display: flex; flex-direction: column; gap: 14px; min-height: 0; }
.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.toolbar .input { width: auto; height: 34px; }
.board { flex: 1; display: grid; grid-template-columns: repeat(3, minmax(260px, 1fr)); gap: 14px; min-height: 0; overflow-x: auto; }
.col { background: var(--line-2); border-radius: var(--radius); display: flex; flex-direction: column; min-height: 0; border: 1px solid var(--line); }
.col-head { display: flex; align-items: center; gap: 8px; padding: 12px 14px; font-weight: 800; }
.col-head .n { font-size: 12px; color: var(--muted); background: var(--surface); padding: 1px 8px; border-radius: 99px; }
.col-list { flex: 1; overflow-y: auto; padding: 0 10px 12px; display: flex; flex-direction: column; gap: 8px; min-height: 80px; }
.col.over { border-color: var(--brand); background: var(--brand-50); }
.card[draggable="true"] { cursor: grab; }
.card.dragging { opacity: .4; }

/* ---------- listas genéricas (busca, atividade, equipe) ---------- */
.page { padding: 20px 24px 40px; max-width: 980px; }
.page.wide { max-width: 1200px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow-sm); }
.panel + .panel { margin-top: 16px; }
.panel h3 { margin: 0 0 12px; font-size: 15px; font-weight: 800; }
.grid-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; align-items: end; }
.results { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; }
.group-date { font-size: 12.5px; font-weight: 800; color: var(--muted); margin: 14px 0 0; }
.group-date:first-child { margin-top: 0; }

.feed { display: flex; flex-direction: column; }
.feed-item { display: flex; gap: 12px; padding: 11px 4px; border-bottom: 1px solid var(--line-2); align-items: flex-start; }
.feed-item:last-child { border-bottom: 0; }
.feed-item .txt { flex: 1; min-width: 0; }
.feed-item .txt a { cursor: pointer; font-weight: 600; color: var(--text); text-decoration: none; border-bottom: 1px dashed var(--faint); }
.feed-item small { color: var(--muted); font-size: 12px; }

table.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--faint); font-weight: 700; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.tbl td { padding: 10px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl .who { display: flex; align-items: center; gap: 10px; }

.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.stat small { color: var(--muted); font-weight: 600; font-size: 12px; }
.stat b { display: block; font-size: 28px; letter-spacing: -.03em; font-weight: 800; }
.bars { display: grid; gap: 8px; }
.bar-row { display: grid; grid-template-columns: 130px 1fr 40px; gap: 10px; align-items: center; font-size: 13px; }
.bar-row .track { height: 10px; border-radius: 99px; background: var(--line-2); overflow: hidden; }
.bar-row .fill { height: 100%; border-radius: 99px; }
.bar-row .v { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.bar-row .lbl { display: flex; align-items: center; gap: 7px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.swatches { display: flex; gap: 6px; flex-wrap: wrap; }
.swatches button { width: 24px; height: 24px; border-radius: 50%; border: 2px solid transparent; padding: 0; }
.swatches button.on { border-color: var(--text); box-shadow: inset 0 0 0 2px var(--surface); }
.cat-row { display: flex; align-items: center; gap: 10px; padding: 6px 0; }
.cat-row .input { flex: 1; }
.cat-row input[type="color"] { width: 38px; height: 38px; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 3px; background: var(--surface); }

/* ---------- modal ---------- */
.overlay {
  position: fixed; inset: 0; background: rgba(15, 16, 32, .45); backdrop-filter: blur(3px);
  display: flex; align-items: flex-start; justify-content: center; padding: 5vh 16px; z-index: 50; overflow-y: auto;
  animation: fade .15s ease-out;
}
@keyframes fade { from { opacity: 0; } }
.modal {
  width: 100%; max-width: 760px; background: var(--surface); border-radius: 18px; box-shadow: var(--shadow-lg);
  animation: pop .18s ease-out; border: 1px solid var(--line);
}
.modal.sm { max-width: 440px; }
@keyframes pop { from { transform: translateY(10px) scale(.98); opacity: 0; } }
.modal-head { display: flex; align-items: center; gap: 10px; padding: 16px 18px 0 22px; }
.modal-head .crumb { font-size: 12.5px; color: var(--muted); font-weight: 600; flex: 1; }
.modal-body { padding: 10px 22px 18px; display: grid; gap: 14px; }
.title-input { border: 0; font-size: 22px; font-weight: 800; letter-spacing: -.02em; width: 100%; background: transparent; outline: none; padding: 4px 0; }
.title-input::placeholder { color: var(--faint); }
.props { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.modal-foot { display: flex; align-items: center; gap: 8px; padding: 14px 22px; border-top: 1px solid var(--line-2); flex-wrap: wrap; }
.modal-foot .spacer { flex: 1; }
.subsec { border-top: 1px solid var(--line-2); padding-top: 12px; }
.subsec h4 { margin: 0 0 8px; font-size: 13px; font-weight: 800; display: flex; align-items: center; gap: 8px; }
.subsec h4 .n { color: var(--muted); font-weight: 600; }
.files { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.file {
  border: 1px solid var(--line); border-radius: 10px; padding: 8px; display: flex; flex-direction: column; gap: 6px;
  font-size: 12px; position: relative; background: var(--surface-2); min-width: 0;
}
.file .thumb { height: 86px; border-radius: 6px; background: var(--line-2) center/cover no-repeat; display: grid; place-items: center; color: var(--muted); font-weight: 800; font-size: 13px; text-decoration: none; }
.file .name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file .x { position: absolute; top: 4px; right: 4px; width: 24px; height: 24px; border-radius: 50%; border: 0; background: rgba(0,0,0,.55); color: #fff; display: grid; place-items: center; padding: 0; }
.file .x svg { width: 13px; height: 13px; }
.drop { border: 1.5px dashed var(--line); border-radius: 10px; padding: 12px; text-align: center; color: var(--muted); font-size: 12.5px; cursor: pointer; display: grid; place-items: center; min-height: 60px; }
.drop.over, .drop:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-50); }
.comments { display: grid; gap: 10px; }
.comment { display: flex; gap: 10px; }
.comment .bubble { flex: 1; background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 10px; padding: 8px 11px; min-width: 0; }
.comment .bubble .h { font-size: 12px; color: var(--muted); display: flex; gap: 6px; align-items: center; }
.comment .bubble .h b { color: var(--text); }
.comment .bubble .h button { margin-left: auto; border: 0; background: none; color: var(--faint); font-size: 11.5px; padding: 0; }
.comment .bubble .h button:hover { color: var(--danger); }
.comment-form { display: flex; gap: 8px; align-items: flex-start; }
.comment-form textarea { min-height: 42px; height: 42px; }
.history { font-size: 12px; color: var(--muted); display: grid; gap: 3px; max-height: 140px; overflow-y: auto; }

/* ---------- atalhos / toasts ---------- */
#toasts { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); display: grid; gap: 8px; z-index: 100; }
.toast {
  background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 10px; font-weight: 600; font-size: 13px;
  box-shadow: var(--shadow-lg); animation: pop .2s ease-out; display: flex; gap: 12px; align-items: center;
}
:root[data-theme="dark"] .toast { background: #2A2C4A; }
.toast.err { background: var(--danger); }
.toast button { background: none; border: 0; color: var(--accent); font-weight: 800; padding: 0; }
.kbd { display: inline-block; min-width: 20px; text-align: center; font-size: 11px; font-weight: 700; padding: 1px 5px; border-radius: 5px; border: 1px solid var(--line); border-bottom-width: 2px; background: var(--surface-2); }
.shortcuts { display: grid; grid-template-columns: auto 1fr; gap: 8px 14px; align-items: center; }

/* ---------- responsivo ---------- */
@media (max-width: 1180px) {
  .cal-layout { grid-template-columns: minmax(0, 1fr) 360px; }
}
@media (max-width: 980px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; inset: 0 auto 0 0; width: 270px; z-index: 40; transform: translateX(-100%);
    transition: transform .2s; box-shadow: var(--shadow-lg);
  }
  .shell.menu-open .sidebar { transform: none; }
  .shell.menu-open::after { content: ''; position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 30; }
  .menu-btn { display: inline-flex; }
  .topbar { padding: 10px 16px; min-height: 56px; }
  .view { overflow-y: auto; }
  .cal-layout { grid-template-columns: 1fr; height: auto; }
  .cal-wrap { padding: 14px 16px; overflow: visible; }
  .cal-grid { grid-auto-rows: minmax(64px, auto); }
  .cal-day .chip, .cal-day .more, .cal-day .hol { display: none; }
  .cal-day .dots { display: flex; }
  .day-panel { border-left: 0; border-top: 1px solid var(--line); }
  .day-list { overflow: visible; }
  .day-head, .quick, .day-list { padding-left: 16px; padding-right: 16px; }
  .day-filter { padding-left: 16px; padding-right: 16px; }
  .board-wrap { padding: 14px 16px; height: auto; }
  .board { grid-template-columns: 1fr; overflow: visible; }
  .col-list { overflow: visible; }
  .page { padding: 16px; }
  .cal-head h2 { font-size: 21px; min-width: 0; }
  .month-stats { display: none; }
}
.dots { display: none; gap: 3px; flex-wrap: wrap; margin-top: auto; }
.dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--c); }
@media (max-width: 560px) {
  .cal-dow { padding: 6px 4px; font-size: 10px; text-align: center; }
  .cal-day { padding: 4px; align-items: center; }
  .cal-day .num { justify-content: center; }
  .cal-day .badge-open { display: none; }
  .bar-row { grid-template-columns: 90px 1fr 32px; }
  .modal-body, .modal-foot { padding-left: 16px; padding-right: 16px; }
  .overlay { padding: 0; }
  .modal { border-radius: 0; min-height: 100vh; }
  .tbl .hide-sm { display: none; }
}

/* ---------- impressão do dia ---------- */
@media print {
  body { background: #fff; }
  .sidebar, .topbar, .cal-wrap, .quick, .day-filter, .day-head .btn, .tick, #toasts { display: none !important; }
  .shell, .cal-layout { display: block; height: auto; }
  .view, .main, .day-list { overflow: visible; }
  .day-panel { border: 0; }
  .card { break-inside: avoid; box-shadow: none; }
}
@media (max-width: 1360px) and (min-width: 981px) { .month-stats .pill:nth-child(n+2) { display: none; } }
