:root {
  --bg: #f4f6f8;
  --surface: #ffffff;
  --surface-2: #f9fafb;
  --border: #e2e6ea;
  --text: #1c2733;
  --muted: #5f6b78;
  --brand: #234e70;
  --brand-2: #2f6a96;
  --brand-soft: #e6eef5;

  --red: #d64545;      --red-soft: #fdecec;
  --yellow: #d9a400;   --yellow-soft: #fff6d6;
  --green: #2e9e5b;    --green-soft: #e5f5eb;

  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
  --shadow-lg: 0 12px 32px rgba(16, 24, 40, .18);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-size: 15px; line-height: 1.45;
  background: var(--bg); color: var(--text);
}
a { color: var(--brand-2); }
h1, h2, h3 { margin: 0; line-height: 1.25; }
h1 { font-size: 1.45rem; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.loading { padding: 48px; text-align: center; color: var(--muted); }
.hidden { display: none !important; }

/* ---------- Botões e campos ---------- */
button, .btn {
  font: inherit; cursor: pointer; border-radius: 8px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  padding: 8px 14px; font-weight: 500;
  display: inline-flex; align-items: center; gap: 6px; text-decoration: none;
}
button:hover { background: var(--surface-2); }
button:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-2); }
.btn-danger { color: var(--red); border-color: #f2c4c4; }
.btn-danger:hover { background: var(--red-soft); }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-sm { padding: 4px 10px; font-size: .85rem; }

label { display: block; font-weight: 500; font-size: .88rem; margin-bottom: 4px; }
input[type=text], input[type=email], input[type=password], input[type=date], select, textarea {
  font: inherit; width: 100%; padding: 8px 10px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
}
textarea { resize: vertical; min-height: 80px; }
input:focus, select:focus, textarea:focus, button:focus-visible {
  outline: 2px solid var(--brand-2); outline-offset: 1px;
}
.field { margin-bottom: 14px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; }
.row > .field { flex: 1 1 180px; }
.checkbox { display: inline-flex; align-items: center; gap: 6px; font-weight: 400; }

/* ---------- Login ---------- */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.auth-card {
  width: 100%; max-width: 400px; background: var(--surface);
  border-radius: 14px; box-shadow: var(--shadow-lg); padding: 28px;
}
.auth-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
.logo {
  width: 36px; height: 36px; border-radius: 9px; background: var(--brand); color: #fff;
  display: grid; place-items: center; font-weight: 700;
}
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 18px; }
.tabs button {
  border: none; background: none; border-radius: 0; padding: 8px 10px;
  color: var(--muted); border-bottom: 2px solid transparent;
}
.tabs button.active { color: var(--brand); border-bottom-color: var(--brand); font-weight: 600; }
.notice { padding: 10px 12px; border-radius: 8px; font-size: .9rem; margin-bottom: 14px; }
.notice.error { background: var(--red-soft); color: #9b2c2c; }
.notice.ok { background: var(--green-soft); color: #1e6b3d; }
.notice.info { background: var(--brand-soft); color: var(--brand); }

/* ---------- Estrutura ---------- */
.layout { display: grid; grid-template-columns: 390px 1fr; min-height: 100vh; }
.sidebar {
  background: var(--brand); color: #dfe9f2; padding: 18px 12px;
  display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.sidebar .brand { display: flex; align-items: center; gap: 10px; color: #fff; padding: 4px 8px 16px; }
.sidebar .brand .logo { background: #fff; color: var(--brand); }
.sidebar .section { text-transform: uppercase; font-size: .72rem; letter-spacing: .06em; opacity: .7; padding: 14px 8px 4px; }
.sidebar a.nav {
  display: flex; align-items: center; gap: 8px; color: #dfe9f2; text-decoration: none;
  padding: 7px 8px; border-radius: 7px; font-size: .92rem;
}
.sidebar a.nav:hover { background: rgba(255,255,255,.08); }
.sidebar a.nav.active { background: rgba(255,255,255,.16); color: #fff; font-weight: 600; }
.sidebar a.nav .lock { margin-left: auto; opacity: .6; font-size: .75rem; }
.sidebar .user { margin-top: auto; padding: 12px 8px 0; border-top: 1px solid rgba(255,255,255,.15); font-size: .88rem; }
.sidebar .user button { margin-top: 8px; background: transparent; color: #dfe9f2; border-color: rgba(255,255,255,.3); }
.sidebar .user button:hover { background: rgba(255,255,255,.08); }
.sidebar .new-btn { margin: 6px 8px; justify-content: center; background: rgba(255,255,255,.12); color: #fff; border-color: rgba(255,255,255,.25); }
.sidebar .new-btn:hover { background: rgba(255,255,255,.2); }

.main { padding: 24px 28px 48px; min-width: 0; }

/* Projetos do menu como itens independentes */
.sidebar a.nav.proj {
  font-size: .74rem; line-height: 1.3; padding: 8px 10px; margin: 0 4px 6px;
  border: 1px solid rgba(255,255,255,.22); border-radius: 9px; background: rgba(255,255,255,.04);
}
.sidebar a.nav.proj:hover { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.4); }
.sidebar a.nav.proj.active {
  background: #fff; color: var(--brand); border-color: #fff; font-weight: 700;
  box-shadow: 0 2px 8px rgba(0,0,0,.25), inset 4px 0 0 #f0b429;
}
.sidebar a.nav.proj .lock { font-size: .7rem; }

.proj-desc { max-width: 760px; white-space: pre-wrap; margin: 10px 0 0; }
.proj-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.link-chip {
  display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 6px 12px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border); color: var(--brand-2); text-decoration: none;
  font-size: .88rem; font-weight: 500; box-shadow: var(--shadow); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.link-chip:hover { border-color: var(--brand-2); background: var(--brand-soft); }
.link-row { display: flex; gap: 8px; margin-bottom: 8px; }
.link-row .l-label { flex: 0 0 34%; }
.link-row .l-url { flex: 1; min-width: 0; }
@media (max-width: 600px) { .link-row { flex-wrap: wrap; } .link-row .l-label { flex: 1 1 100%; } }

/* Elementos só do celular (escondidos no computador) */
.m-top, .m-tabs, .m-cards, .fab, .drawer-backdrop { display: none; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 16px 18px; }

/* ---------- Etiquetas ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px;
  font-size: .75rem; font-weight: 600; background: var(--brand-soft); color: var(--brand); white-space: nowrap;
}
.badge.gray { background: #eef0f2; color: var(--muted); }
.badge.pendente { background: var(--red-soft); color: var(--red); }
.badge.agendado { background: var(--yellow-soft); color: #8a6800; }
.badge.feito { background: var(--green-soft); color: var(--green); }
.badge.late { background: var(--red); color: #fff; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex: none; }
.dot.pendente { background: var(--red); }
.dot.agendado { background: var(--yellow); }
.dot.feito { background: var(--green); }

/* ---------- Painel ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat { padding: 14px 16px; }
.stat .n { font-size: 1.7rem; font-weight: 700; }
.stat .l { color: var(--muted); font-size: .85rem; display: flex; align-items: center; gap: 6px; }
.stat.pendente { border-left: 4px solid var(--red); }
.stat.agendado { border-left: 4px solid var(--yellow); }
.stat.feito { border-left: 4px solid var(--green); }
.stat.late { border-left: 4px solid #7a1f1f; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
th { font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; background: var(--surface-2); }
tr.click { cursor: pointer; }
tr.click:hover td { background: var(--surface-2); }

.progress { display: flex; height: 8px; border-radius: 999px; overflow: hidden; background: #eef0f2; min-width: 120px; }
.progress span { display: block; height: 100%; }
.progress .p-feito { background: var(--green); }
.progress .p-agendado { background: var(--yellow); }
.progress .p-pendente { background: var(--red); }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 20px; }
.list { list-style: none; margin: 0; padding: 0; }
.list li { padding: 10px 16px; border-top: 1px solid var(--border); display: flex; gap: 10px; align-items: center; cursor: pointer; }
.list li:hover { background: var(--surface-2); }
.list li .grow { flex: 1; min-width: 0; }
.list li .sub { font-size: .8rem; color: var(--muted); }
.empty { padding: 18px 16px; color: var(--muted); font-size: .9rem; }

.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.filters select, .filters input { width: auto; }

/* ---------- Quadro (Kanban) ---------- */
.board {
  display: flex; gap: 14px; align-items: flex-start; overflow-x: auto; padding-bottom: 12px;
  scroll-snap-type: x proximity;
}
.column {
  flex: 1 1 0; min-width: 260px; border-radius: 14px; padding: 10px; min-height: 180px; scroll-snap-align: start;
  background: #f1f3f6; border: 1px solid transparent; display: flex; flex-direction: column;
}
.column.pendente { background: #fbf1f1; }
.column.agendado { background: #fdf8e8; }
.column.feito { background: #eef8f1; }
.column.drag-over { border-color: var(--brand-2); box-shadow: inset 0 0 0 2px var(--brand-2); }
.column-head { display: flex; align-items: center; gap: 8px; padding: 2px 4px 10px; }
.status-pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 6px;
  font-size: .74rem; font-weight: 700; letter-spacing: .04em; color: #fff;
}
.status-pill.pendente { background: var(--red); }
.status-pill.agendado { background: var(--yellow); color: #3b2d00; }
.status-pill.feito { background: var(--green); }
.column-head .count { color: var(--muted); font-weight: 600; font-size: .85rem; }
.col-add {
  margin-left: auto; border: none; background: transparent; color: var(--muted);
  width: 28px; height: 28px; padding: 0; justify-content: center; border-radius: 6px; font-size: 1rem;
}
.col-add:hover { background: rgba(0,0,0,.06); color: var(--text); }
.col-body { display: flex; flex-direction: column; gap: 8px; min-height: 8px; }
.task {
  background: var(--surface); border-radius: 10px; padding: 10px 12px 10px;
  box-shadow: 0 1px 1px rgba(16,24,40,.08), 0 0 0 1px rgba(16,24,40,.06);
  cursor: pointer; transition: box-shadow .12s, transform .12s;
}
.task:hover { box-shadow: 0 6px 16px rgba(16,24,40,.14), 0 0 0 1px rgba(16,24,40,.08); transform: translateY(-1px); }
.task.dragging { opacity: .45; transform: rotate(2deg); }
.task .label {
  display: inline-block; color: #fff; font-size: .7rem; font-weight: 700; padding: 2px 8px;
  border-radius: 4px; margin-bottom: 6px; letter-spacing: .02em;
}
.task .t-title { font-weight: 500; font-size: .95rem; line-height: 1.35; margin-bottom: 8px; word-break: break-word; color: var(--text); }
.task.feito .t-title { color: var(--muted); }
.t-check {
  display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 50%;
  background: var(--green); color: #fff; font-size: .65rem; margin-right: 6px; vertical-align: 1px;
}
.t-foot { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; }
.t-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: .76rem; color: var(--muted); }
.t-meta .icon { display: inline-flex; align-items: center; gap: 3px; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 6px; border-radius: 4px; background: #eef0f2; color: var(--muted); font-weight: 500; }
.chip-late { background: var(--red); color: #fff; }
.chip-soon { background: var(--yellow); color: #3b2d00; }
.chip-sched { background: var(--yellow-soft); color: #8a6800; }
.chip-done { background: var(--green-soft); color: var(--green); }
.avatar {
  flex: none; width: 28px; height: 28px; border-radius: 50%; color: #fff; font-size: .72rem; font-weight: 700;
  display: inline-grid; place-items: center; box-shadow: 0 0 0 2px #fff;
}
.add-task {
  width: 100%; justify-content: flex-start; background: transparent; border: none; color: var(--muted);
  margin-top: 6px; padding: 8px; border-radius: 8px; font-weight: 500;
}
.add-task:hover { background: rgba(0,0,0,.06); color: var(--text); }

/* ---------- Logo ---------- */
.brand-logo { width: 58px; height: 58px; object-fit: contain; flex: none; }
.logo.logo-img { width: 52px; height: 52px; border-radius: 50%; padding: 5px; background: var(--brand); }
.logo.logo-img img { width: 100%; height: 100%; object-fit: contain; }

.project-meta { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 6px; }

/* ---------- Modal ---------- */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(15, 23, 32, .45);
  display: flex; align-items: flex-start; justify-content: center; padding: 40px 16px; overflow-y: auto; z-index: 50;
}
.modal { background: var(--surface); border-radius: 14px; box-shadow: var(--shadow-lg); width: 100%; max-width: 720px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.modal-body { padding: 18px 20px; }
.modal-foot { display: flex; justify-content: space-between; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--border); flex-wrap: wrap; }
.modal-foot .right { display: flex; gap: 8px; margin-left: auto; }
.close-x { border: none; background: none; font-size: 1.4rem; line-height: 1; padding: 4px 8px; color: var(--muted); }

.status-picker { display: flex; gap: 8px; flex-wrap: wrap; }
.status-picker button { flex: 1 1 120px; justify-content: center; }
.status-picker button.sel.pendente { background: var(--red); color: #fff; border-color: var(--red); }
.status-picker button.sel.agendado { background: var(--yellow); color: #3b2d00; border-color: var(--yellow); }
.status-picker button.sel.feito { background: var(--green); color: #fff; border-color: var(--green); }

.section-title { font-weight: 600; margin: 20px 0 8px; display: flex; align-items: center; gap: 8px; }
.files { list-style: none; margin: 0 0 10px; padding: 0; border: 1px solid var(--border); border-radius: 8px; }
.files li { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-top: 1px solid var(--border); font-size: .9rem; }
.files li:first-child { border-top: none; }
.files li .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dropzone {
  border: 2px dashed var(--border); border-radius: 8px; padding: 16px; text-align: center; color: var(--muted);
  font-size: .9rem; cursor: pointer;
}
.dropzone.over { border-color: var(--brand-2); background: var(--brand-soft); }
.comments { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.comment { background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 8px 12px; font-size: .9rem; }
.comment .c-head { display: flex; gap: 8px; align-items: baseline; font-size: .8rem; color: var(--muted); margin-bottom: 2px; }
.comment .c-head b { color: var(--text); }
.comment .c-body { white-space: pre-wrap; word-break: break-word; }

.access-table td { padding: 6px 10px; }

/* ---------- Aviso ---------- */
#toast-root { position: fixed; bottom: 16px; right: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 100; }
.toast { background: var(--text); color: #fff; padding: 10px 14px; border-radius: 8px; box-shadow: var(--shadow-lg); font-size: .9rem; max-width: 340px; }
.toast.error { background: var(--red); }

/* ---------- Celular ---------- */
.menu-btn { display: none; }
@media (max-width: 860px) {
  body { font-size: 15px; }
  .layout { grid-template-columns: 1fr; }
  .d-only { display: none !important; }

  /* Barra superior fixa */
  .m-top {
    display: flex; align-items: center; gap: 10px; position: sticky; top: 0; z-index: 30;
    background: var(--brand); color: #fff; margin: -12px -12px 14px; padding: 10px 12px;
    box-shadow: 0 2px 6px rgba(0,0,0,.15);
  }
  .m-icon {
    border: none; background: rgba(255,255,255,.12); color: #fff; width: 40px; height: 40px; padding: 0;
    border-radius: 10px; display: grid; place-items: center; font-size: 1.15rem; text-decoration: none; flex: none;
  }
  .m-logo { width: 34px; height: 34px; object-fit: contain; flex: none; }
  .m-title { flex: 1; min-width: 0; font-weight: 600; font-size: .95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

  /* Menu lateral vira gaveta */
  .sidebar { position: fixed; inset: 0 auto 0 0; width: min(86vw, 360px); height: 100%; z-index: 60; transform: translateX(-100%); transition: transform .22s; }
  .sidebar.open { transform: none; box-shadow: var(--shadow-lg); }
  .sidebar a.nav { padding: 11px 10px; font-size: .95rem; }
  .sidebar a.nav.proj { font-size: .85rem; padding: 10px 12px; }
  .drawer-backdrop.show { display: block; position: fixed; inset: 0; background: rgba(15,23,32,.45); z-index: 50; }

  .main { padding: 12px 12px 96px; }
  .page-head { margin-bottom: 12px; }
  .page-head h1 { font-size: 1.2rem; }
  .page-head .actions { width: 100%; }
  .page-head .actions button { flex: 1; justify-content: center; }
  #new-task { display: none; }
  .filters select { flex: 1 1 140px; }

  /* Painel */
  .stats { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .stat { padding: 10px 12px; }
  .stat .n { font-size: 1.35rem; }
  .m-cards { display: flex; flex-direction: column; gap: 10px; }
  .m-pcard { padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; cursor: pointer; }
  .m-pcard-top { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
  .m-pcard-counts { display: flex; flex-wrap: wrap; gap: 6px; }
  .grid-2 { grid-template-columns: 1fr; }

  /* Quadro: uma coluna por vez, com abas */
  .m-tabs {
    display: flex; gap: 6px; position: sticky; top: 52px; z-index: 20; background: var(--bg);
    padding: 6px 0 10px; margin-bottom: 4px;
  }
  .m-tab {
    flex: 1; justify-content: center; flex-direction: column; gap: 0; padding: 7px 4px; font-size: .78rem;
    border-radius: 10px; border-width: 2px; line-height: 1.2;
  }
  .m-tab span { font-weight: 700; font-size: 1rem; }
  .m-tab.pendente { color: var(--red); } .m-tab.agendado { color: #8a6800; } .m-tab.feito { color: var(--green); }
  .m-tab.sel.pendente { background: var(--red); color: #fff; border-color: var(--red); }
  .m-tab.sel.agendado { background: var(--yellow); color: #3b2d00; border-color: var(--yellow); }
  .m-tab.sel.feito { background: var(--green); color: #fff; border-color: var(--green); }
  .board { display: block; overflow: visible; }
  .column { display: none; min-width: 0; background: transparent !important; padding: 0; }
  .column.m-show { display: flex; }
  .column-head { display: none; }
  .add-task { display: none; }
  .task { padding: 12px 14px; }
  .task .t-title { font-size: 1rem; }

  /* Botão flutuante */
  .fab {
    display: grid; place-items: center; position: fixed; right: 18px; bottom: 22px; z-index: 35;
    width: 58px; height: 58px; border-radius: 50%; border: none; padding: 0;
    background: var(--brand); color: #fff; font-size: 1.7rem; box-shadow: 0 6px 18px rgba(16,24,40,.3);
  }

  .modal-backdrop { padding: 0; }
  .modal { border-radius: 0; min-height: 100vh; }
  .modal-foot { position: sticky; bottom: 0; background: var(--surface); }
  .status-picker button { flex: 1 1 100%; }
  #toast-root { left: 12px; right: 12px; bottom: 90px; }
}

/* ---------- Anexos ---------- */
.btn:hover { background: var(--surface-2); }
.back-link { display: inline-block; font-size: .85rem; color: var(--muted); text-decoration: none; margin-bottom: 4px; }
.back-link:hover { color: var(--brand); }
.att-section { margin-bottom: 16px; }
.att-section h2 { font-size: 1.05rem; margin: 0 0 2px; }
.att-section > p { margin: 0 0 12px; }
.att-section .dropzone { margin-bottom: 12px; display: block; }
.att-task { margin-bottom: 12px; }
.att-task-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; flex-wrap: wrap; }
.att-task-head .status-pill { font-size: .7rem; }
.link-btn { border: none; background: none; padding: 0; color: var(--brand); font-weight: 600; text-align: left; }
.link-btn:hover { background: none; text-decoration: underline; }
@media (max-width: 860px) {
  .files li { flex-wrap: wrap; }
  .files li .grow { flex-basis: calc(100% - 40px); }
  .page-head .actions .btn { flex: 1; justify-content: center; }
}

/* ---------- Confirmação ---------- */
.confirm-root .confirm-backdrop { z-index: 200; }
.confirm-box { max-width: 460px; }
.confirm-box h2 { font-size: 1.1rem; margin: 0; }
.confirm-box p { margin: 0 0 10px; }
.confirm-check { display: flex; gap: 8px; align-items: center; margin-top: 12px; padding: 10px 12px; background: var(--red-soft); border-radius: 8px; font-size: .9rem; cursor: pointer; }
.btn-danger-solid { background: var(--red); border-color: var(--red); color: #fff; }
.btn-danger-solid:hover { background: #b83232; }
.btn-danger-solid:disabled:hover { background: var(--red); }

/* ---------- Por integrante ---------- */
.people-layout { display: grid; grid-template-columns: 320px 1fr; gap: 16px; align-items: start; }
.people-list { display: flex; flex-direction: column; gap: 6px; position: sticky; top: 12px; max-height: calc(100vh - 140px); overflow: auto; }
.person { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); text-decoration: none; color: var(--text); }
.person:hover { background: var(--surface-2); }
.person.sel { border-color: var(--brand); box-shadow: inset 3px 0 0 var(--brand); background: var(--brand-soft); }
.person .p-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.person .p-info b { font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.person .p-counts { display: flex; gap: 3px; }
.mini { font-size: .72rem; font-weight: 700; min-width: 20px; text-align: center; padding: 1px 5px; border-radius: 6px; color: #fff; }
.mini.pendente { background: var(--red); } .mini.agendado { background: var(--yellow); color: #3b2d00; } .mini.feito { background: var(--green); }
.mini.late { background: #7a1f1f; }
.person-head { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; margin-bottom: 14px; }
.person-head h2 { margin: 0; font-size: 1.2rem; }
.person-stats { display: flex; gap: 14px; }
.person-stats div { display: flex; flex-direction: column; align-items: center; }
.person-stats b { font-size: 1.25rem; }
.person-stats span { font-size: .72rem; color: var(--muted); }
.person-stats .pendente b { color: var(--red); } .person-stats .agendado b { color: #b38700; } .person-stats .feito b { color: var(--green); } .person-stats .late b { color: #7a1f1f; }
.person-group { margin-bottom: 12px; }
.pg-head { display: flex; align-items: center; gap: 8px; padding-top: 10px; padding-bottom: 10px; }
.pg-head .count { color: var(--muted); font-weight: 600; }

/* ---------- Histórico ---------- */
.h-card { padding: 4px 0; }
.h-day { padding: 12px 16px 4px; font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.h-item { display: flex; gap: 12px; padding: 8px 16px; border-left: 4px solid transparent; font-size: .9rem; }
.h-item .grow { flex: 1; min-width: 0; }
.h-item .sub { font-size: .78rem; color: var(--muted); }
.h-time { color: var(--muted); font-variant-numeric: tabular-nums; font-size: .82rem; padding-top: 1px; }
.h-item.del { border-left-color: var(--red); background: var(--red-soft); }
.h-item.add { border-left-color: var(--green); }
.h-item.status { border-left-color: var(--yellow); }
.h-item.edit { border-left-color: var(--border); }
.st { font-weight: 600; padding: 0 5px; border-radius: 5px; }
.st.pendente { background: var(--red-soft); color: var(--red); } .st.agendado { background: var(--yellow-soft); color: #8a6a00; } .st.feito { background: var(--green-soft); color: var(--green); }

@media (max-width: 860px) {
  .people-layout { grid-template-columns: 1fr; }
  .people-list { position: static; max-height: none; flex-direction: row; overflow-x: auto; padding-bottom: 4px; }
  .people-list .person { flex: 0 0 auto; }
  .people-list .person .p-info span { display: none; }
  .person-stats { gap: 10px; }
  .h-item { padding: 8px 12px; }
}
@media print {
  .sidebar, .m-top, .people-list, .page-head, #print, .drawer-backdrop { display: none !important; }
  .layout { display: block !important; }
  .people-layout { display: block; }
  .card { box-shadow: none; break-inside: avoid; }
}

/* ---------- Agendamento de equipamentos ---------- */
.nav-badge { margin-left: auto; background: var(--red); color: #fff; font-size: .72rem; font-weight: 700; border-radius: 10px; padding: 1px 7px; }
.sidebar a.nav { display: flex; align-items: center; gap: 4px; }
#bk-form label, .eq-row label, .conflict label { display: block; margin-bottom: 12px; }
#bk-form input:not([type=radio]):not([type=checkbox]), #bk-form select, .eq-row input:not([type=checkbox]), .conflict input {
  font: inherit; width: 100%; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--text); margin-top: 4px; font-weight: 400;
}
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
label.inline { display: flex !important; align-items: center; gap: 8px; font-weight: 400; margin-bottom: 6px !important; }
label.inline input { width: auto !important; margin: 0 !important; }
.for-who { border: 1px solid var(--border); border-radius: 10px; padding: 10px 14px; margin: 0 0 12px; }
.for-who legend { font-weight: 600; font-size: .88rem; padding: 0 4px; }
.for-who #b-ext { margin-top: 8px; }
.conflict { background: var(--yellow-soft); border: 1px solid #f0d77a; border-radius: 10px; padding: 12px 14px; margin-top: 6px; }
.conflict ul { margin: 6px 0; padding-left: 18px; }
.eq-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 4px 0 12px; }
.eq-tab { padding: 7px 14px; border-radius: 20px; border: 1px solid var(--border); background: var(--surface); color: var(--text); text-decoration: none; font-weight: 500; font-size: .9rem; }
.eq-tab:hover { background: var(--surface-2); }
.eq-tab.sel { background: var(--brand); border-color: var(--brand); color: #fff; }
.week-nav { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.week-nav .legend { margin-left: auto; display: flex; align-items: center; gap: 6px; font-size: .8rem; color: var(--muted); }
.lg { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-left: 6px; }
.lg.mine, .bk.mine, .ag-item.mine { background: #2f6a96; }
.lg.other, .bk.other, .ag-item.other { background: #8a94a3; }
.lg.ext, .bk.ext, .ag-item.ext { background: #7b4fd6; }
.cal { overflow: hidden; }
.cal-head { display: grid; grid-template-columns: 56px repeat(7, 1fr); border-bottom: 1px solid var(--border); font-size: .85rem; }
.cal-head > div { padding: 8px 6px; text-align: center; color: var(--muted); }
.cal-head .today { color: var(--brand); background: var(--brand-soft); }
.cal-body { display: grid; grid-template-columns: 56px repeat(7, 1fr); position: relative; }
.cal-hours div { font-size: .72rem; color: var(--muted); text-align: right; padding: 2px 6px 0 0; box-sizing: border-box; border-top: 1px solid transparent; }
.cal-day { position: relative; border-left: 1px solid var(--border); cursor: copy;
  background-image: linear-gradient(to bottom, var(--border) 1px, transparent 1px); }
.cal-day.today { background-color: #f3f8fc; }
.cal-day:hover { background-color: var(--surface-2); }
.cal-off { position: absolute; left: 0; right: 0; background: rgba(120, 130, 145, .16); pointer-events: none; }
.cal-hours div.off { background: rgba(120, 130, 145, .16); }
.cal-hours div { font-size: .68rem !important; line-height: 1; }
.bk { position: absolute; z-index: 1; left: 3px; right: 3px; border-radius: 5px; color: #fff; font-size: .7rem; padding: 1px 5px; overflow: hidden; cursor: pointer; line-height: 1.25; box-shadow: 0 1px 2px rgba(0,0,0,.15); }
.bk:hover { filter: brightness(1.1); }
.agenda-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.agenda-list.m-only { display: none; }
.ag-day { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; }
.ag-day.today { border-color: var(--brand-2); }
.ag-date { font-weight: 700; font-size: .85rem; text-transform: capitalize; display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.ag-add { padding: 0 8px; }
.ag-item { display: flex; gap: 8px; color: #fff; border-radius: 7px; padding: 6px 8px; margin-bottom: 5px; font-size: .84rem; cursor: pointer; }
.ag-item .muted { color: rgba(255,255,255,.85); }
.ag-time { font-weight: 700; white-space: nowrap; }
.ag-empty { color: var(--muted); font-size: .82rem; }
.req-card { margin-bottom: 14px; overflow: hidden; }
.req { display: flex; gap: 8px; align-items: center; padding: 10px 14px; border-top: 1px solid var(--border); flex-wrap: wrap; font-size: .9rem; }
.req:first-child { border-top: none; }
.req .grow { flex: 1 1 260px; }
.req .sub { font-size: .8rem; color: var(--muted); }
.req.for-me { background: var(--yellow-soft); }
.req.ok { background: var(--green-soft); }
.req.no { background: var(--red-soft); }
.eq-row { display: flex; gap: 10px; align-items: center; margin-bottom: 8px; }
.eq-row input:not([type=checkbox]) { flex: 1; margin-top: 0 !important; }
.eq-row label { margin: 0 !important; white-space: nowrap; }
.bk-details p { margin: 0 0 8px; }
@media (max-width: 860px) {
  .agenda-list, .agenda-list.m-only { display: grid; grid-template-columns: 1fr; }
  .week-nav .legend { margin-left: 0; width: 100%; }
  .eq-tabs { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; }
  .eq-tab { white-space: nowrap; }
  .row2 { grid-template-columns: 1fr; gap: 0; }
}
.qr-body { text-align: center; }
.qr-canvas { width: 100%; max-width: 330px; height: auto; border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow); margin-bottom: 10px; }
.qr-body code { font-size: .75rem; word-break: break-all; }
.eq-row .btn-sm { white-space: nowrap; }
/* ---------- Artigos ---------- */
.badge.art { font-weight: 600; }
.badge.art.redacao { background: var(--yellow-soft); color: #8a6a00; }
.badge.art.submetido { background: #e8eefc; color: #2f4fa8; }
.badge.art.aceito { background: #f1e8fb; color: #6b3aa0; }
.badge.art.publicado { background: var(--green-soft); color: #1f7a44; }
.art-fields { border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 14px 4px; margin: 10px 0; }
.art-fields legend { font-weight: 700; font-size: .85rem; padding: 0 6px; }
.art-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.art-chips .chip { border: 1px solid var(--border); background: var(--surface); color: var(--text); border-radius: 999px; padding: 6px 12px; font-size: .86rem; cursor: pointer; }
.art-chips .chip span { color: var(--muted); font-weight: 600; margin-left: 4px; }
.art-chips .chip.sel { background: var(--brand); border-color: var(--brand); color: #fff; }
.art-chips .chip.sel span { color: rgba(255,255,255,.85); }
.art-section { margin-bottom: 22px; }
.art-section h2 { font-size: 1.05rem; display: flex; align-items: center; gap: 8px; margin: 14px 0 10px; }
.art-section h2 .count { background: var(--bg); border: 1px solid var(--border); border-radius: 999px; font-size: .78rem; padding: 1px 9px; color: var(--muted); }
.art-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.art-card { padding: 14px; display: flex; flex-direction: column; gap: 8px; border-left: 4px solid var(--border); }
.art-card.redacao { border-left-color: var(--yellow); }
.art-card.submetido { border-left-color: #4a6fd1; }
.art-card.aceito { border-left-color: #8a55c4; }
.art-card.publicado { border-left-color: var(--green); }
.art-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.art-venue { font-size: .82rem; color: var(--muted); flex: 1 1 100%; order: 3; min-width: 0; }
.art-edit { margin-left: auto; }
.art-title { font-weight: 700; color: var(--text); text-decoration: none; line-height: 1.3; }
.art-title:hover { color: var(--brand); text-decoration: underline; }
.art-authors { font-size: .86rem; color: var(--muted); }
.art-foot { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: auto; }
.art-copy { white-space: nowrap; }
.doi { font-size: .84rem; word-break: break-all; }
.art-prog { display: flex; align-items: center; gap: 8px; width: 100%; }
.art-prog > :first-child { flex: 1; }
.art-empty { padding: 6px 2px; }
@media (max-width: 860px) { .art-grid { grid-template-columns: 1fr; } }
/* Artigos: quadro com uma coluna por situação */
.art-board { display: grid; grid-template-columns: repeat(4, minmax(240px, 1fr)); gap: 14px; align-items: start; }
.art-board.single { grid-template-columns: minmax(0, 520px); }
.art-col { background: #eef1f4; border-radius: var(--radius); padding: 10px; min-width: 0; }
.art-col h2 { font-size: .95rem; display: flex; align-items: center; gap: 8px; margin: 2px 4px 10px; }
.art-col h2 .count { background: var(--surface); border: 1px solid var(--border); border-radius: 999px; font-size: .75rem; padding: 1px 8px; color: var(--muted); margin-left: auto; }
.art-col.redacao h2 { color: #8a6a00; } .art-col.submetido h2 { color: #2f4fa8; } .art-col.aceito h2 { color: #6b3aa0; } .art-col.publicado h2 { color: #1f7a44; }
.art-list { display: flex; flex-direction: column; gap: 10px; }
.art-list .art-card { padding: 12px; }
.art-list .art-title { font-size: .93rem; }
.art-list .art-authors { font-size: .82rem; }
a.art-title[data-read]::after { content: ' 📖'; font-size: .85em; }
@media (max-width: 1200px) { .art-board { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 700px) { .art-board, .art-board.single { grid-template-columns: 1fr; } }
.art-list .art-top .badge.art { display: none; }
.art-list .art-venue { order: 0; flex: 1 1 0; }
.art-prog > :first-child { min-width: 0; }
.art-prog .small { white-space: nowrap; }
/* Artigos: cartões compactos */
.art-list { gap: 6px; }
.art-list .art-card { padding: 7px 10px; gap: 3px; }
.art-list .art-top { gap: 6px; }
.art-list .art-venue { font-size: .74rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.art-list .art-edit { padding: 0 4px; font-size: .8rem; line-height: 1.2; }
.art-list .art-title { font-size: .85rem; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.art-list .art-authors { font-size: .74rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.art-list .art-foot { gap: 4px 10px; }
.art-list .art-foot:empty { display: none; }
.art-list .art-foot .btn-sm { padding: 1px 6px; font-size: .74rem; }
.art-list .doi { font-size: .74rem; }
.art-col { padding: 8px; }
.art-col h2 { margin-bottom: 8px; }
/* Barra lateral: grupo recolhível de artigos submetidos/publicados */
.nav-group summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 6px; }
.nav-group summary::-webkit-details-marker { display: none; }
.nav-group summary::before { content: '▸'; font-size: .8em; }
.nav-group[open] summary::before { content: '▾'; }
.nav-count { background: rgba(255,255,255,.18); border-radius: 999px; padding: 0 7px; font-size: .72rem; }
.art-ic { font-size: .8em; margin-right: -2px; }
.eq-proto { margin-top: -4px; margin-bottom: 12px; }
.eq-proto input { font-size: .82rem; }
.proj-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.proj-title #rename-project { font-size: .9rem; opacity: .6; }
.proj-title #rename-project:hover { opacity: 1; }
.proj-title input { flex: 1 1 320px; font-size: 1.1rem; font-weight: 700; padding: 6px 10px; }
.avatar.all { background: var(--brand-2); font-size: .8rem; }
.sidebar a.nav.proj.noaccess { opacity: .6; }
.sidebar a.nav.proj.noaccess .dot { background: transparent; border: 1px solid rgba(255,255,255,.5); }
.noaccess-ic { margin-left: auto; display: inline-flex; opacity: .8; flex-shrink: 0; }
.noaccess-msg { display: flex; gap: 10px; align-items: center; }
.noaccess-msg .noaccess-ic { margin-left: 0; }
/* Equipamentos com canais (calorímetro) e temperatura */
.eq-info { display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 8px 12px; margin: 0 0 12px; font-size: .9rem; }
.eq-temp { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.eq-proto .eq-ch { flex: 0 0 90px !important; }
.ch-box { border: 1px solid var(--border); border-radius: var(--radius); padding: 8px 12px 12px; margin: 10px 0; }
.ch-box legend { font-weight: 700; font-size: .85rem; padding: 0 6px; }
.ch-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.ch-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 6px; }
.ch { display: flex; flex-direction: column; align-items: center; gap: 1px; border: 1px solid var(--border); border-radius: 8px; padding: 6px 4px; cursor: pointer; background: var(--green-soft); font-size: .78rem; margin: 0 !important; user-select: none; }
.ch input { position: absolute; opacity: 0; pointer-events: none; }
.ch b { font-size: 1rem; }
.ch span { color: var(--muted); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ch.busy { background: var(--red-soft); }
.ch.on { outline: 2px solid var(--brand); background: var(--brand); color: #fff; }
.ch.on span { color: rgba(255,255,255,.85); }
.bk .bk-ch { display: block; font-size: .7rem; opacity: .9; }
.ch-grid label.ch { display: flex; flex-direction: column; }
