/* ==========================================================================
   Fala Tio — Plataforma de Prospecção de Escolas
   Estilos base
   ========================================================================== */

:root {
  /* Identidade visual Fala Tio */
  --primary: #0022D1;        /* Azul Fala Tio */
  --primary-light: #3651E0;
  --primary-dark: #071056;   /* Azul de apoio (marinho) */
  --primary-soft: #E6EAFF;
  --accent: #FF6428;         /* Laranja Fala Tio */
  --accent-soft: #FFE7DC;
  --accent2: #10B981;
  --danger: #EF4444;
  --danger-soft: #FEE2E2;

  --bg: #F2F4FB;
  --card: #FFFFFF;
  --card-2: #F5F7FD;
  --text: #071056;
  --text-muted: #5A648A;
  --border: #E2E6F5;
  --border-strong: #CBD3EC;

  --shadow-sm: 0 1px 3px rgba(7, 16, 86, 0.08);
  --shadow: 0 6px 24px rgba(0, 34, 209, 0.10);
  --shadow-lg: 0 16px 48px rgba(7, 16, 86, 0.22);
  --radius: 14px;
  --radius-sm: 10px;

  /* Cores das etapas do funil */
  --st-novo: #94A3B8;
  --st-contato: #3B82F6;
  --st-decisor: #8B5CF6;
  --st-reuniao: #F59E0B;
  --st-coordenacao: #14B8A6;
  --st-fechado: #10B981;
  --st-perdido: #EF4444;
}

@media (prefers-color-scheme: dark) {
  :root {
    --primary: #4A63F0; --primary-light: #6E84F5;
    --bg: #080B22; --card: #0F1436; --card-2: #151B41;
    --text: #EAECFB; --text-muted: #99A2CC; --border: #232A55;
    --border-strong: #2F3873; --primary-soft: #1A2150; --danger-soft: #3A1E24;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4);
    --shadow: 0 6px 24px rgba(0, 0, 0, 0.45);
    --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.55);
  }
}
:root[data-theme="dark"] {
  --primary: #4A63F0; --primary-light: #6E84F5;
  --bg: #080B22; --card: #0F1436; --card-2: #151B41;
  --text: #EAECFB; --text-muted: #99A2CC; --border: #232A55;
  --border-strong: #2F3873; --primary-soft: #1A2150; --danger-soft: #3A1E24;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.4); --shadow: 0 6px 24px rgba(0,0,0,.45);
  --shadow-lg: 0 16px 48px rgba(0,0,0,.55);
}
:root[data-theme="light"] {
  --primary: #0022D1; --primary-light: #3651E0;
  --bg: #F2F4FB; --card: #FFFFFF; --card-2: #F5F7FD;
  --text: #071056; --text-muted: #5A648A; --border: #E2E6F5;
  --border-strong: #CBD3EC; --primary-soft: #E6EAFF; --danger-soft: #FEE2E2;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Montserrat', 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ===== HEADER ===== */
header {
  background: #071056 url('../assets/header-bg.jpg') center center / cover no-repeat;
  color: #fff;
  position: relative;
  overflow: hidden;
}
.header-inner {
  max-width: 1360px; margin: 0 auto; padding: 20px 28px 0;
  position: relative; z-index: 1;
}
.header-top {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-logo {
  width: 44px; height: 44px; border-radius: 12px; flex-shrink: 0;
  background: #fff; color: var(--primary); font-weight: 900; font-size: 20px;
  display: grid; place-items: center; box-shadow: 0 4px 12px rgba(0,0,0,.2);
}
.brand h1 { font-size: 1.3rem; font-weight: 800; line-height: 1.1; }
.brand p { font-size: .8rem; opacity: .85; font-weight: 500; }
.brand-logo-img { height: 38px; width: auto; display: block; filter: drop-shadow(0 2px 5px rgba(0,0,0,.3)); }
.brand-sep { width: 1.5px; height: 32px; background: rgba(255,255,255,.32); border-radius: 2px; }
.login-logo { width: 200px; max-width: 72%; height: auto; margin: 0 auto 8px; display: block; }

.header-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* Stats row */
.stats {
  display: flex; gap: 14px; flex-wrap: wrap;
  padding: 18px 0 4px;
}
.stat {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(6px);
  border-radius: 12px; padding: 10px 16px; min-width: 110px;
}
.stat .num { font-size: 1.5rem; font-weight: 800; line-height: 1; }
.stat .lbl { font-size: .72rem; opacity: .82; text-transform: uppercase; letter-spacing: .04em; margin-top: 4px; }

/* Nav tabs */
nav.tabs { display: flex; gap: 4px; margin-top: 14px; }
nav.tabs button {
  background: transparent; border: none; color: rgba(255,255,255,.75);
  font-size: .92rem; font-weight: 600; padding: 12px 20px; cursor: pointer;
  border-radius: 10px 10px 0 0; position: relative; transition: .15s;
}
nav.tabs button:hover { color: #fff; background: rgba(255,255,255,.08); }
nav.tabs button.active { color: var(--primary); background: var(--bg); }

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: inherit; font-size: .86rem; font-weight: 600;
  padding: 9px 15px; border-radius: 10px; border: 1px solid transparent;
  cursor: pointer; transition: .15s; white-space: nowrap;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-ghost-light { background: rgba(255,255,255,.15); color: #fff; border-color: rgba(255,255,255,.25); }
.btn-ghost-light:hover { background: rgba(255,255,255,.25); }
.btn-outline { background: var(--card); color: var(--text); border-color: var(--border-strong); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { filter: brightness(.92); }
.btn-sm { padding: 6px 11px; font-size: .8rem; }
.btn-icon {
  width: 34px; height: 34px; padding: 0; justify-content: center;
  border-radius: 9px; background: var(--card); border: 1px solid var(--border);
  color: var(--text-muted); cursor: pointer; transition: .15s;
}
.btn-icon:hover { color: var(--primary); border-color: var(--primary); }

/* ===== MAIN ===== */
main { max-width: 1360px; margin: 0 auto; padding: 24px 28px 60px; }
.view { display: none; }
.view.active { display: block; animation: fade .2s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ===== TOOLBAR (filtros) ===== */
.toolbar {
  display: flex; gap: 10px; flex-wrap: wrap; align-items: center;
  margin-bottom: 18px;
}
.search {
  flex: 1 1 260px; min-width: 200px; position: relative;
}
.search input {
  width: 100%; padding: 11px 14px 11px 40px; border-radius: 11px;
  border: 1px solid var(--border-strong); background: var(--card); color: var(--text);
  font-size: .9rem; font-family: inherit; transition: .15s;
}
.search input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.search svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--text-muted); }
select.filter {
  padding: 10px 14px; border-radius: 11px; border: 1px solid var(--border-strong);
  background: var(--card); color: var(--text); font-size: .86rem; font-family: inherit;
  cursor: pointer; transition: .15s;
}
select.filter:focus { outline: none; border-color: var(--primary); }
.chk-prio {
  display: inline-flex; align-items: center; gap: 7px; cursor: pointer;
  padding: 10px 14px; border-radius: 11px; border: 1px solid var(--border-strong);
  background: var(--card); color: var(--text); font-size: .86rem; font-weight: 600;
  user-select: none; transition: .15s;
}
.chk-prio:hover { border-color: var(--primary); }
.chk-prio input { width: 15px; height: 15px; accent-color: var(--primary); cursor: pointer; }

/* ===== TABLE ===== */
.table-wrap {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); overflow-x: auto;
}
table { width: 100%; border-collapse: collapse; min-width: 880px; }
thead th {
  text-align: left; font-size: .72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .05em; color: var(--text-muted); padding: 14px 16px;
  border-bottom: 1px solid var(--border); background: var(--card-2);
  white-space: nowrap; cursor: pointer; user-select: none;
}
thead th.no-sort { cursor: default; }
thead th .arrow { opacity: .4; font-size: .7rem; }
thead th.sorted .arrow { opacity: 1; color: var(--primary); }
tbody td { padding: 13px 16px; border-bottom: 1px solid var(--border); font-size: .88rem; vertical-align: middle; }
tbody tr { transition: background .12s; }
tbody tr:hover { background: var(--card-2); }
tbody tr:last-child td { border-bottom: none; }

.school-name { font-weight: 700; color: var(--text); cursor: pointer; }
.school-name:hover { color: var(--primary); }
.school-sub { font-size: .76rem; color: var(--text-muted); margin-top: 2px; }
.muted { color: var(--text-muted); }

.decisor-name { font-weight: 600; }
.decisor-cargo { font-size: .76rem; color: var(--text-muted); }

.contacts { display: flex; flex-direction: column; gap: 3px; }
.contact-line { display: flex; align-items: center; gap: 6px; font-size: .82rem; }
.contact-line .tag { font-size: .64rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; width: 34px; }
.icon-link {
  display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 7px;
  color: var(--text-muted); transition: .15s; text-decoration: none; flex-shrink: 0;
}
.icon-link.wpp:hover { background: #dcfce7; color: #16a34a; }
.icon-link.tel:hover { background: var(--primary-soft); color: var(--primary); }

.uf-chip {
  font-size: .64rem; font-weight: 800; color: var(--primary); background: var(--primary-soft);
  padding: 1px 6px; border-radius: 6px; vertical-align: middle; margin-left: 5px;
}
.ym-badge { display: inline-block; font-size: .72rem; font-weight: 700; padding: 3px 11px; border-radius: 20px; }
.ym-badge.yes { background: #dcfce7; color: #15803d; }
.ym-badge.no { background: var(--danger-soft); color: var(--danger); }
@media (prefers-color-scheme: dark) { .ym-badge.yes { background: #16341f; color: #4ade80; } }
:root[data-theme="dark"] .ym-badge.yes { background: #16341f; color: #4ade80; }
:root[data-theme="light"] .ym-badge.yes { background: #dcfce7; color: #15803d; }

.score-badge {
  display: inline-grid; place-items: center; min-width: 38px; height: 30px; padding: 0 8px;
  border-radius: 8px; font-weight: 800; font-size: .82rem; color: #fff;
}

/* Etapa badge / select */
.etapa-select {
  appearance: none; border: none; border-radius: 20px; padding: 6px 26px 6px 12px;
  font-size: .76rem; font-weight: 700; color: #fff; cursor: pointer; font-family: inherit;
  background-repeat: no-repeat; background-position: right 9px center;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' fill='white' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
}
.etapa-select:focus { outline: 2px solid rgba(255,255,255,.6); outline-offset: 1px; }

.row-actions { display: flex; gap: 6px; justify-content: flex-end; }

.empty-state { text-align: center; padding: 60px 20px; color: var(--text-muted); }
.empty-state .big { font-size: 2.4rem; margin-bottom: 10px; }

/* ===== KANBAN ===== */
.kanban {
  display: flex; gap: 14px; overflow-x: auto; padding-bottom: 16px; align-items: flex-start;
}
.kanban-col {
  flex: 0 0 288px; background: var(--card-2); border: 1px solid var(--border);
  border-radius: var(--radius); display: flex; flex-direction: column; max-height: calc(100vh - 220px);
}
.kanban-col-head {
  padding: 13px 15px; display: flex; align-items: center; gap: 9px;
  border-bottom: 1px solid var(--border); position: sticky; top: 0;
}
.kanban-col-head .dot { width: 11px; height: 11px; border-radius: 50%; flex-shrink: 0; }
.kanban-col-head .title { font-weight: 700; font-size: .88rem; flex: 1; }
.kanban-col-head .count {
  background: var(--card); border: 1px solid var(--border); color: var(--text-muted);
  font-size: .72rem; font-weight: 700; padding: 2px 9px; border-radius: 20px;
}
.kanban-cards {
  padding: 10px; display: flex; flex-direction: column; gap: 10px;
  overflow-y: auto; flex: 1; min-height: 60px;
}
.kanban-cards.drag-over { background: var(--primary-soft); }
.kcard {
  background: var(--card); border: 1px solid var(--border); border-left: 4px solid var(--st-novo);
  border-radius: 11px; padding: 12px; cursor: grab; box-shadow: var(--shadow-sm); transition: .15s;
}
.kcard:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.kcard.dragging { opacity: .5; }
.kcard-title { font-weight: 700; font-size: .88rem; display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.kcard-title .score { font-size: .72rem; font-weight: 800; padding: 1px 7px; border-radius: 6px; color:#fff; flex-shrink:0; }
.kcard-meta { font-size: .78rem; color: var(--text-muted); margin-top: 6px; line-height: 1.5; }
.kcard-meta strong { color: var(--text); font-weight: 600; }
.kcard-foot { display: flex; align-items: center; gap: 6px; margin-top: 10px; }
.kcard-foot .city-tag {
  font-size: .68rem; font-weight: 700; color: var(--primary); background: var(--primary-soft);
  padding: 2px 8px; border-radius: 6px; margin-right: auto;
}
.kcard.has-next { box-shadow: 0 0 0 1.5px var(--accent), var(--shadow-sm); }

/* Estrela de prioridade (tem próximos passos) */
.star { color: var(--accent); }
.school-name .star { margin-right: 4px; }

/* Bloco "próximos passos" no card do Kanban */
.kcard-next {
  margin-top: 9px; background: rgba(255,100,40,.12); border: 1px solid rgba(255,100,40,.35);
  border-left: 3px solid var(--accent); border-radius: 8px; padding: 7px 9px;
  font-size: .78rem; color: var(--text); line-height: 1.45; cursor: text; white-space: pre-wrap;
}
.kcard-next .np-label { display: block; font-size: .64rem; font-weight: 800; text-transform: uppercase;
  letter-spacing: .04em; color: var(--accent); margin-bottom: 2px; }
.kcard-addnext {
  margin-top: 9px; width: 100%; text-align: left; font-family: inherit;
  font-size: .74rem; color: var(--text-muted); background: transparent;
  border: 1px dashed var(--border-strong); border-radius: 8px; padding: 6px 9px; cursor: pointer; transition: .15s;
}
.kcard-addnext:hover { border-color: var(--accent); color: var(--accent); }

.prio-legend { font-size: .76rem; color: var(--text-muted); font-weight: 600; margin-left: auto; align-self: center; }

/* ===== MODAL / DRAWER ===== */
.overlay {
  position: fixed; inset: 0; background: rgba(30, 27, 75, .5); backdrop-filter: blur(3px);
  z-index: 100; opacity: 0; pointer-events: none; transition: .2s;
}
.overlay.open { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; top: 0; right: 0; height: 100%; width: 480px; max-width: 92vw;
  background: var(--card); z-index: 101; box-shadow: var(--shadow-lg);
  transform: translateX(100%); transition: transform .25s cubic-bezier(.4,0,.2,1);
  display: flex; flex-direction: column;
}
.drawer.open { transform: none; }
.drawer-head {
  padding: 20px 22px; border-bottom: 1px solid var(--border);
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
}
.drawer-head h2 { font-size: 1.15rem; font-weight: 800; }
.drawer-head .sub { font-size: .8rem; color: var(--text-muted); margin-top: 3px; }
.drawer-body { padding: 20px 22px; overflow-y: auto; flex: 1; }
.drawer-foot {
  padding: 14px 22px; border-top: 1px solid var(--border);
  display: flex; gap: 10px; justify-content: space-between;
}

.field { margin-bottom: 15px; }
.field label { display: block; font-size: .76rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 6px; }
.field input, .field select, .field textarea {
  width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border-strong);
  background: var(--card); color: var(--text); font-size: .9rem; font-family: inherit; transition: .15s;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft);
}
.field textarea { resize: vertical; min-height: 84px; }
.field-row { display: flex; gap: 12px; }
.field-row .field { flex: 1; }

.detail-block { margin-bottom: 18px; }
.detail-block h3 {
  font-size: .74rem; text-transform: uppercase; letter-spacing: .05em; color: var(--primary);
  font-weight: 800; margin-bottom: 10px; border-bottom: 1px solid var(--border); padding-bottom: 6px;
}
.detail-row { display: flex; gap: 10px; padding: 7px 0; font-size: .88rem; }
.detail-row .k { color: var(--text-muted); width: 118px; flex-shrink: 0; font-weight: 600; }
.detail-row .v { font-weight: 500; }
.detail-row .v a { color: var(--primary); text-decoration: none; }
.detail-row .v a:hover { text-decoration: underline; }
.quick-contacts { display: flex; gap: 8px; margin-top: 4px; flex-wrap: wrap; }
.quick-contacts a {
  display: inline-flex; align-items: center; gap: 6px; font-size: .82rem; font-weight: 600;
  padding: 8px 12px; border-radius: 9px; text-decoration: none; border: 1px solid var(--border);
  color: var(--text); transition: .15s;
}
.quick-contacts a.wpp { background: #dcfce7; color: #15803d; border-color: transparent; }
.quick-contacts a.tel { background: var(--primary-soft); color: var(--primary); border-color: transparent; }
.quick-contacts a:hover { filter: brightness(.96); }

/* Modal (importação) */
.modal-card {
  position: fixed; top: 50%; left: 50%;
  transform: translate(-50%, -46%) scale(.98);
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); z-index: 102; width: 460px; max-width: 92vw; padding: 24px;
  opacity: 0; pointer-events: none; transition: .2s;
}
.modal-card.open { opacity: 1; pointer-events: auto; transform: translate(-50%, -50%) scale(1); }
.modal-card h2 { font-size: 1.2rem; font-weight: 800; margin-bottom: 4px; }
.modal-sub { font-size: .9rem; color: var(--text-muted); margin: 12px 0 6px; }
.import-info {
  background: var(--card-2); border: 1px solid var(--border); border-radius: 11px;
  padding: 13px 14px; font-size: .82rem; line-height: 1.7;
}
.import-info .k { font-weight: 700; color: var(--text-muted); }
.import-info .warn { color: var(--accent); margin-top: 5px; }
.modal-actions { display: flex; flex-direction: column; gap: 9px; margin-top: 18px; }
.modal-actions .btn { justify-content: center; padding: 12px; }

/* Login screen */
.login-screen {
  position: fixed; inset: 0; z-index: 300; display: none;
  align-items: center; justify-content: center; padding: 20px;
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 60%, var(--primary-light) 100%);
}
.login-screen.show { display: flex; }
.login-card {
  background: var(--card); border-radius: 18px; box-shadow: var(--shadow-lg);
  padding: 34px 30px; width: 370px; max-width: 92vw; text-align: center;
  display: flex; flex-direction: column; gap: 12px;
}
.login-card .brand-logo { margin: 0 auto 4px; width: 54px; height: 54px; font-size: 24px; }
.login-card h2 { font-size: 1.25rem; font-weight: 800; }
.login-card p { font-size: .85rem; color: var(--text-muted); margin-bottom: 6px; }
.login-card input {
  padding: 12px 14px; border: 1px solid var(--border-strong); border-radius: 11px;
  font-size: .95rem; font-family: inherit; background: var(--card); color: var(--text);
}
.login-card input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.login-card .btn { justify-content: center; padding: 12px; margin-top: 4px; }
.login-error { color: var(--danger); font-size: .82rem; min-height: 1.1em; }

/* User chip (header) */
.user-chip {
  display: inline-flex; align-items: center; gap: 8px; color: #fff;
  background: rgba(255,255,255,.15); border: 1px solid rgba(255,255,255,.25);
  padding: 5px 5px 5px 13px; border-radius: 22px; font-size: .82rem; font-weight: 600;
}
.user-chip button {
  background: rgba(255,255,255,.22); border: none; color: #fff; padding: 5px 12px;
  border-radius: 16px; font-size: .78rem; font-weight: 600; cursor: pointer; font-family: inherit;
}
.user-chip button:hover { background: rgba(255,255,255,.36); }

/* Histórico de atividades */
.hist-list { max-height: 62vh; overflow-y: auto; margin-top: 10px; }
.hist-item { display: flex; gap: 11px; padding: 11px 4px; border-bottom: 1px solid var(--border); }
.hist-item:last-child { border-bottom: none; }
.hist-ico { font-size: 1.15rem; line-height: 1.4; flex-shrink: 0; }
.hist-top { font-size: .88rem; }
.hist-acao { color: var(--text-muted); font-size: .8rem; }
.hist-det { font-size: .82rem; margin-top: 2px; }
.hist-meta { font-size: .72rem; color: var(--text-muted); margin-top: 3px; }

/* Toast */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--text); color: var(--bg); padding: 12px 20px; border-radius: 11px;
  font-size: .88rem; font-weight: 600; box-shadow: var(--shadow-lg); z-index: 200;
  opacity: 0; pointer-events: none; transition: .25s;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.pill {
  display: inline-block; font-size: .72rem; font-weight: 700; padding: 3px 10px;
  border-radius: 20px; background: var(--primary-soft); color: var(--primary);
}

/* Menu dropdown (dados) */
.menu-wrap { position: relative; }
.menu {
  position: absolute; right: 0; top: calc(100% + 6px); background: var(--card);
  border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-lg);
  min-width: 210px; padding: 6px; z-index: 50; display: none;
}
.menu.open { display: block; }
.menu button {
  display: flex; align-items: center; gap: 9px; width: 100%; text-align: left;
  background: transparent; border: none; color: var(--text); font-family: inherit;
  font-size: .86rem; font-weight: 500; padding: 9px 11px; border-radius: 8px; cursor: pointer;
}
.menu button:hover { background: var(--card-2); }
.menu button.danger { color: var(--danger); }
.menu hr { border: none; border-top: 1px solid var(--border); margin: 5px 0; }

@media (max-width: 640px) {
  .header-inner { padding: 16px 16px 0; }
  main { padding: 18px 16px 50px; }
  .brand h1 { font-size: 1.1rem; }
  nav.tabs button { padding: 11px 14px; font-size: .85rem; }
}

/* ===== Arraste (mouse + toque) ===== */
.kcard { cursor: grab; touch-action: pan-y; }
.kcard-clone {
  position: fixed !important; z-index: 500; pointer-events: none; margin: 0 !important;
  box-shadow: var(--shadow-lg); transform: rotate(1.5deg) scale(1.03); opacity: .96;
}
body.is-dragging { user-select: none; -webkit-user-select: none; }
body.is-dragging, body.is-dragging * { cursor: grabbing !important; }
.kanban-cards.drag-over { background: var(--primary-soft); outline: 2px dashed var(--primary); outline-offset: -4px; }

/* Botão editar no card do Kanban */
.kcard-edit {
  display: inline-flex; align-items: center; gap: 5px; font-family: inherit;
  font-size: .76rem; font-weight: 700; padding: 6px 11px; border-radius: 8px;
  background: var(--primary-soft); color: var(--primary); border: none; cursor: pointer; transition: .15s;
}
.kcard-edit:hover { background: var(--primary); color: #fff; }
.kcard-edit svg { width: 13px; height: 13px; }

/* ===== Mobile ===== */
@media (max-width: 680px) {
  header { background-position: 88% center; }
  .header-inner { padding: 14px 14px 0; }
  .header-top { gap: 10px; }
  .brand-logo-img { height: 30px; }
  .brand-sep { height: 26px; }
  .brand h1 { font-size: 1rem; }
  .brand p { display: none; }
  .header-actions { gap: 6px; }
  .header-actions .btn { padding: 9px 12px; font-size: .82rem; }
  .user-chip { padding: 5px 5px 5px 10px; }
  .user-chip #userEmail { max-width: 96px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

  .stats { gap: 8px; padding: 14px 0 2px; }
  .stat { min-width: 0; flex: 1 1 calc(50% - 4px); padding: 9px 12px; }
  .stat .num { font-size: 1.25rem; }

  nav.tabs button { flex: 1; text-align: center; padding: 11px 8px; }

  main { padding: 14px 12px 44px; }
  .toolbar { gap: 8px; }
  .search { flex: 1 1 100%; }
  select.filter { flex: 1 1 calc(50% - 4px); min-width: 0; padding: 11px 12px; }
  .chk-prio { flex: 1 1 100%; justify-content: center; }

  /* Kanban: colunas quase full-width para leitura e arraste confortável */
  .kanban { gap: 12px; }
  .kanban-col { flex-basis: 84vw; max-width: 340px; max-height: none; }

  /* Drawer e modal ocupam a tela */
  .drawer { width: 100vw; max-width: 100vw; }
  .drawer-head, .drawer-body, .drawer-foot { padding-left: 16px; padding-right: 16px; }
  .modal-card { width: 94vw; padding: 20px; }

  /* Toque: alvos maiores */
  .btn { padding: 11px 15px; }
  .btn-icon { width: 40px; height: 40px; }
  .icon-link { width: 32px; height: 32px; }
  .etapa-select { padding: 9px 26px 9px 12px; font-size: .8rem; }
  .kcard-edit { padding: 9px 13px; font-size: .82rem; }

  /* Tabela: rolagem horizontal mais suave */
  .table-wrap { -webkit-overflow-scrolling: touch; }
}
