/* ============================================================
   Kanban São Rafael — versão compacta
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }

:root {
  --fundo: #F4F1EA;
  --texto: #1C1917;
  --suave: #57534E;
  --branco: #FFFFFF;
  --campo: #F4F1EA;
  --destaque: #F59E0B;
  --sombra: 0 1px 2px rgba(28,25,23,.07), 0 2px 8px rgba(28,25,23,.04);
}

body {
  margin: 0;
  background: var(--fundo);
  color: var(--texto);
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  font-size: 13.5px;
  -webkit-font-smoothing: antialiased;
}

button { font: inherit; color: inherit; cursor: pointer; border: none; background: none; }
button:disabled { opacity: .6; cursor: wait; }
:focus-visible { outline: 2px solid #2563EB; outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- Topo ---------- */
.topo {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 12px; padding: 12px 20px 0;
}
.marca { display: flex; align-items: center; gap: 10px; }
.logo {
  width: 36px; height: 36px; border-radius: 10px; flex: none;
  background: #DC2626; color: #fff; font-weight: 800; font-size: 14px;
  display: flex; align-items: center; justify-content: center;
}
.marca-txt { display: flex; flex-direction: column; line-height: 1.25; }
.marca-txt strong { font-size: 15px; font-weight: 800; }
.marca-txt span { font-size: 12px; color: var(--suave); }

.abas { display: flex; gap: 4px; background: var(--branco); padding: 4px; border-radius: 10px; }
.abas button { padding: 6px 14px; border-radius: 7px; font-weight: 700; font-size: 13px; color: #44403C; }
.abas button:hover { background: var(--fundo); }
.abas button.ativa { background: var(--texto); color: #fff; }

.eu { position: relative; }
.eu summary {
  list-style: none; display: flex; align-items: center; gap: 8px; cursor: pointer;
  background: var(--branco); padding: 4px 12px 4px 4px; border-radius: 999px;
}
.eu summary::-webkit-details-marker { display: none; }
.eu-txt { display: flex; flex-direction: column; line-height: 1.15; }
.eu-txt small { font-size: 10.5px; color: var(--suave); }
.eu-txt strong { font-size: 13px; }
.eu-menu {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; min-width: 200px;
  background: var(--branco); border-radius: 12px; padding: 12px; box-shadow: 0 10px 30px rgba(28,25,23,.18);
}
.eu-menu p { margin: 0 0 8px; font-weight: 700; }
.eu-menu a {
  display: block; text-align: center; text-decoration: none; font-weight: 700;
  background: #FEE2E2; color: #991B1B; padding: 8px; border-radius: 8px;
}

.avatar {
  width: 20px; height: 20px; flex: none; border-radius: 999px; color: #fff;
  font-size: 10px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center;
}
.avatar.grande { width: 28px; height: 28px; font-size: 12px; }

/* ---------- Área principal ---------- */
#app { padding: 14px 20px 40px; display: flex; flex-direction: column; gap: 12px; }
.vazio { color: var(--suave); font-size: 14px; padding: 20px 0; }

.barra { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.barra h1 { margin: 0; font-size: 18px; font-weight: 800; }
.nav-periodo { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.btn-icone {
  width: 32px; height: 32px; border-radius: 8px; background: var(--branco);
  display: inline-flex; align-items: center; justify-content: center; flex: none;
}
.btn-icone:hover { background: #E7E5E4; }
.btn-hoje { background: var(--branco); padding: 0 12px; height: 32px; border-radius: 8px; font-weight: 700; font-size: 12.5px; }
.btn-hoje:hover { background: #E7E5E4; }

.filtros { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.chip {
  padding: 5px 11px; border-radius: 999px; font-weight: 700; font-size: 12px;
  background: var(--c); color: #fff;
}
.chip.off { background: #E7E5E4; color: #57534E; }
.resumo { background: var(--branco); padding: 5px 11px; border-radius: 999px; font-size: 12px; }
.btn-novo {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 13px; border-radius: 8px;
  background: var(--destaque); color: var(--texto); font-weight: 800; font-size: 12.5px;
}
.btn-novo:hover { background: #FBBF24; }

/* ---------- Quadro semanal ---------- */
.quadro-scroll { overflow-x: auto; padding: 3px 3px 8px; margin: -3px; -webkit-overflow-scrolling: touch; }
.quadro { display: grid; grid-template-columns: repeat(7, minmax(168px, 1fr)); gap: 8px; min-width: 1230px; }

.coluna {
  background: var(--t); border-radius: 14px; padding: 8px;
  display: flex; flex-direction: column; gap: 8px; min-height: 460px;
}
.coluna.e-hoje { box-shadow: 0 0 0 2px var(--c); }
.coluna-topo {
  background: var(--c); color: #fff; border-radius: 9px; padding: 7px 10px;
  display: flex; align-items: center; gap: 6px;
}
.dia-nome { font-weight: 800; font-size: 13.5px; flex: 1; }
.dia-data { font-weight: 700; font-size: 11px; background: rgba(255,255,255,.22); padding: 2px 7px; border-radius: 999px; }
.badge-hoje { background: var(--destaque); color: var(--texto); font-size: 9.5px; font-weight: 800; padding: 2px 6px; border-radius: 999px; }

.lista { display: flex; flex-direction: column; gap: 6px; flex: 1; min-height: 40px; border-radius: 10px; transition: background .15s; }
.lista.alvo { background: rgba(255,255,255,.45); }
.marcador { height: 4px; border-radius: 999px; background: var(--c); flex: none; }

.card {
  background: var(--branco); border-radius: 9px; padding: 8px 9px;
  display: flex; flex-direction: column; gap: 6px; box-shadow: var(--sombra);
  cursor: grab; transition: opacity .2s, transform .15s;
}
.card:hover { transform: translateY(-1px); }
.card.arrastando { opacity: .3; }
.card.feito { opacity: .42; }
.card.feito:hover { opacity: .8; }
.card.feito .card-titulo { text-decoration: line-through; }

.card-topo { display: flex; align-items: center; justify-content: space-between; gap: 6px; flex-wrap: wrap; }
.tag, .status { font-weight: 700; font-size: 10px; padding: 2px 7px; border-radius: 999px; line-height: 1.4; }
.tag { color: #fff; }
.card-titulo { text-align: left; font-weight: 700; font-size: 12.5px; line-height: 1.35; padding: 0; word-break: break-word; }
.card-pe { display: flex; align-items: center; gap: 6px; }
.log { font-size: 10.5px; color: var(--suave); flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.btn-feito {
  width: 24px; height: 24px; border-radius: 6px; flex: none;
  background: #F5F5F4; color: #A8A29E; display: inline-flex; align-items: center; justify-content: center;
}
.btn-feito:hover { background: #DCFCE7; color: #15803D; }
.btn-feito.on { background: #15803D; color: #fff; }

.btn-add {
  background: rgba(255,255,255,.7); color: #44403C; font-weight: 700; font-size: 12px;
  padding: 7px; border-radius: 8px;
}
.btn-add:hover { background: var(--branco); }

/* ---------- Visão mensal ---------- */
.mes { min-width: 980px; display: flex; flex-direction: column; gap: 6px; }
.mes-cab, .mes-grade { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.mes-cab span { color: #fff; font-weight: 800; font-size: 12.5px; padding: 6px 10px; border-radius: 8px; }
.celula {
  background: var(--branco); border-radius: 10px; padding: 6px 7px; min-height: 92px;
  display: flex; flex-direction: column; gap: 4px; box-shadow: 0 1px 2px rgba(28,25,23,.07);
}
.celula.fora { background: rgba(255,255,255,.45); box-shadow: none; }
.celula.fora .cel-num { color: #78716C; }
.celula.e-hoje { box-shadow: 0 0 0 2px var(--destaque); }
.cel-topo { display: flex; align-items: center; gap: 4px; }
.cel-num { font-weight: 800; font-size: 12.5px; padding: 1px 5px; border-radius: 6px; margin-left: -5px; }
.cel-num:hover { background: var(--fundo); }
.cel-add {
  margin-left: auto; width: 22px; height: 22px; border-radius: 6px; color: #78716C;
  display: inline-flex; align-items: center; justify-content: center; opacity: 0; transition: opacity .15s;
}
.celula:hover .cel-add, .cel-add:focus-visible { opacity: 1; }
.cel-add:hover { background: var(--fundo); color: var(--texto); }
.pill {
  color: #fff; font-size: 10.5px; font-weight: 600; text-align: left;
  padding: 2px 6px; border-radius: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pill.feito { opacity: .4; text-decoration: line-through; }

/* ---------- Anotações ---------- */
.notas { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.nota {
  border-radius: 12px; padding: 12px; min-height: 140px; cursor: pointer;
  display: flex; flex-direction: column; gap: 8px; box-shadow: 0 1px 4px rgba(28,25,23,.06);
}
.nota-topo { display: flex; align-items: flex-start; gap: 6px; }
.nota-titulo { flex: 1; text-align: left; font-weight: 800; font-size: 13.5px; padding: 0; }
.nota-txt { margin: 0; flex: 1; font-size: 12.5px; line-height: 1.5; white-space: pre-line; word-break: break-word; }
.nota .log { color: #44403C; }
.btn-fixar {
  width: 24px; height: 24px; border-radius: 6px; flex: none; color: #44403C;
  background: rgba(255,255,255,.5); display: inline-flex; align-items: center; justify-content: center;
}
.btn-fixar.on { background: var(--texto); color: #fff; }

/* ---------- Modal ---------- */
#modal {
  border: none; padding: 0; border-radius: 16px; width: min(500px, calc(100vw - 20px));
  max-height: calc(100vh - 20px); box-shadow: 0 24px 60px rgba(28,25,23,.3); color: var(--texto);
}
#modal::backdrop { background: rgba(28,25,23,.55); }
#modal-corpo { padding: 18px; }
.modal-topo { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.modal-topo h2 { margin: 0; font-size: 16px; font-weight: 800; }
.modal-topo .btn-icone { background: var(--fundo); }

.form { display: flex; flex-direction: column; gap: 11px; }
.campo { display: flex; flex-direction: column; gap: 4px; border: none; padding: 0; margin: 0; min-width: 0; }
.campo > span, .campo > legend { font-weight: 700; font-size: 12px; padding: 0; margin-bottom: 4px; }
.campo input, .campo textarea {
  font: inherit; color: inherit; border: none; border-radius: 8px; background: var(--campo);
  padding: 8px 10px; width: 100%;
}
.campo textarea { resize: vertical; line-height: 1.45; }

.opcoes { display: flex; flex-wrap: wrap; gap: 5px; }
.opcao { position: relative; cursor: pointer; }
.opcao input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.opcao span {
  display: inline-block; padding: 5px 11px; border-radius: 999px; font-weight: 700; font-size: 12px;
  background: var(--campo); color: #44403C;
}
.opcao input:checked + span { background: var(--c); color: #fff; }
.opcao input:focus-visible + span { outline: 2px solid #2563EB; outline-offset: 2px; }

.cores { display: flex; gap: 8px; flex-wrap: wrap; }
.cor { position: relative; width: 28px; height: 28px; border-radius: 999px; background: var(--c); cursor: pointer; }
.cor input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.cor:has(input:checked) { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--texto); }
.cor:has(input:focus-visible) { outline: 2px solid #2563EB; outline-offset: 5px; }

.checar { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 12.5px; cursor: pointer; }
.checar input { width: 16px; height: 16px; accent-color: var(--texto); }

.modal-acoes { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 2px; }
.espaco { flex: 1; }
.btn-pri { background: var(--texto); color: #fff; padding: 8px 16px; border-radius: 8px; font-weight: 800; font-size: 13px; }
.btn-pri:hover { background: #44403C; }
.btn-pri.grande { padding: 11px; font-size: 14px; }
.btn-sec { background: var(--fundo); padding: 8px 14px; border-radius: 8px; font-weight: 700; font-size: 13px; }
.btn-excluir { background: #FEE2E2; color: #991B1B; padding: 8px 13px; border-radius: 8px; font-weight: 700; font-size: 13px; }

.historico { background: var(--fundo); border-radius: 10px; padding: 10px 12px; }
.historico h3 { margin: 0 0 8px; font-size: 12.5px; }
.historico ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 7px; max-height: 180px; overflow-y: auto; }
.historico li { display: flex; align-items: flex-start; gap: 7px; font-size: 12px; line-height: 1.4; }
.historico small { color: var(--suave); white-space: nowrap; }

/* ---------- Aviso ---------- */
#toast {
  position: fixed; left: 50%; bottom: 20px; transform: translate(-50%, 16px); z-index: 50;
  background: var(--texto); color: #fff; font-weight: 700; font-size: 13px; padding: 9px 16px; border-radius: 10px;
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s;
}
#toast.mostrar { opacity: 1; transform: translate(-50%, 0); }
#toast.erro { background: #B91C1C; }

/* ---------- Login ---------- */
.pagina-login {
  min-height: 100vh; background: var(--texto); display: flex; align-items: center; justify-content: center; padding: 20px;
}
.login-caixa {
  width: 100%; max-width: 380px; background: var(--branco); border-radius: 18px; padding: 24px;
  display: flex; flex-direction: column; gap: 16px;
}
.login-marca { display: flex; align-items: center; gap: 10px; }
.login-marca h1 { margin: 0; font-size: 18px; font-weight: 800; }
.login-marca p { margin: 1px 0 0; color: var(--suave); font-size: 12px; }
.login-abas { display: flex; gap: 4px; background: var(--fundo); padding: 4px; border-radius: 10px; }
.login-abas a {
  flex: 1; text-align: center; text-decoration: none; color: #44403C; font-weight: 700; font-size: 12.5px;
  padding: 7px 6px; border-radius: 7px;
}
.login-abas a.ativa { background: var(--texto); color: #fff; }
.login-erro { background: #FEE2E2; color: #991B1B; font-weight: 700; font-size: 13px; padding: 9px 12px; border-radius: 8px; }
.login-dica { margin: 0; color: var(--suave); font-size: 12px; text-align: center; }

/* ---------- Celular ---------- */
@media (max-width: 720px) {
  .topo { padding: 10px 12px 0; }
  #app { padding: 10px 12px 32px; }
  .marca-txt span { display: none; }
  .abas { order: 3; width: 100%; }
  .abas button { flex: 1; padding: 7px 4px; }
  .barra h1 { font-size: 16px; }
  .quadro { grid-template-columns: repeat(7, 80vw); min-width: 0; }
  .coluna { scroll-snap-align: start; }
  .quadro-scroll { scroll-snap-type: x mandatory; }
  .cel-add { opacity: 1; }
}
