/* SeriPet CRM — brand: navy #142b6f · crema #f9f6ea · giallo #ffd601 · Baskerville */
* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --navy: #142b6f; --navy-2: #0e2054; --crema: #f9f6ea; --giallo: #ffd601;
  --ink: #142b6f; --muted: #5b6ba0; --line: #d9d2ba;
  --ok: #1d7a3d; --warn: #b06a00; --bad: #a32020;
}
body { background: var(--navy); color: var(--ink); font: 15px/1.45 system-ui, sans-serif; min-height: 100vh; }
h1, h2, h3 { font-family: Baskerville, 'Libre Baskerville', Georgia, serif; }

/* topbar */
.topbar { display: flex; align-items: center; gap: 24px; padding: 14px 26px; color: var(--crema); }
.brand { display: flex; align-items: center; gap: 10px; }
.brand-dot { width: 14px; height: 14px; border-radius: 50%; background: var(--giallo); }
.brand h1 { font-size: 24px; font-weight: 600; }
.brand h1 em { color: var(--giallo); font-style: normal; }
nav { display: flex; gap: 8px; flex: 1; }
.tab { background: transparent; color: var(--crema); border: 1px solid rgba(249,246,234,.35);
  padding: 8px 22px; border-radius: 999px; font-size: 15px; cursor: pointer; }
.tab.active { background: var(--giallo); color: var(--navy); border-color: var(--giallo); font-weight: 700; }
.ghost { background: transparent; border: none; color: rgba(249,246,234,.6); cursor: pointer; font-size: 14px; }
.ghost:hover { color: var(--crema); }

main { padding: 6px 26px 40px; }
.card { background: var(--crema); border-radius: 14px; padding: 18px; box-shadow: 0 2px 10px rgba(0,0,0,.25); }

/* kanban */
.kanban { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; align-items: start; }
.kcol { background: rgba(249,246,234,.08); border: 1px solid rgba(249,246,234,.15);
  border-radius: 14px; padding: 10px; min-height: 320px; }
.kcol.dragover { outline: 2px dashed var(--giallo); }
.kcol h3 { color: var(--crema); font-size: 17px; padding: 4px 8px 10px; display: flex; justify-content: space-between; }
.kcol h3 .count { color: var(--giallo); }
.kcard { background: var(--crema); border-radius: 10px; padding: 10px 12px; margin-bottom: 10px; cursor: grab; }
.kcard:active { cursor: grabbing; }
.kcard .nome { font-weight: 700; }
.kcard .pet { color: var(--muted); font-size: 13px; }
.kcard .azione { font-size: 13px; margin-top: 6px; border-left: 3px solid var(--giallo); padding-left: 7px; }
.kcard .meta { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.kanban-empty { color: rgba(249,246,234,.7); padding: 30px; text-align: center; grid-column: 1 / -1; }

/* badges */
.badge { font-size: 11.5px; font-weight: 700; padding: 2px 9px; border-radius: 999px; letter-spacing: .2px; }
.b-lead { background: #e3e0d2; color: #555; }
.b-acquisito { background: #d5ecdc; color: var(--ok); }
.b-fidelizzato { background: var(--giallo); color: var(--navy); }
.b-dormiente { background: #f4dcc2; color: var(--warn); }
.b-proc { background: var(--navy); color: var(--crema); }
.b-si { background: #d5ecdc; color: var(--ok); }
.b-no { background: #f3d3d3; color: var(--bad); }
.b-mai { background: #e3e0d2; color: #666; }

/* clienti */
.filters { display: flex; gap: 10px; margin: 6px 0 14px; flex-wrap: wrap; align-items: center; }
.filters input[type=search] { flex: 1; min-width: 240px; padding: 10px 16px; border-radius: 999px;
  border: none; font-size: 15px; background: var(--crema); color: var(--ink); }
.chip { background: transparent; color: var(--crema); border: 1px solid rgba(249,246,234,.35);
  padding: 6px 16px; border-radius: 999px; cursor: pointer; font-size: 13.5px; }
.chip.on { background: var(--giallo); color: var(--navy); border-color: var(--giallo); font-weight: 700; }
table.lista { width: 100%; border-collapse: collapse; }
table.lista th { text-align: left; font-size: 12.5px; text-transform: uppercase; letter-spacing: .4px;
  color: var(--muted); padding: 8px 10px; border-bottom: 2px solid var(--line); }
table.lista td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.lista tr:hover td { background: rgba(20,43,111,.05); cursor: pointer; }
.tot { color: rgba(249,246,234,.75); font-size: 13.5px; margin: 10px 2px; }
.pager { display: flex; gap: 8px; margin-top: 12px; }
.pager button { padding: 6px 18px; border-radius: 999px; border: none; cursor: pointer;
  background: var(--crema); color: var(--navy); font-weight: 600; }
.pager button:disabled { opacity: .4; cursor: default; }

/* overlay + scheda */
.overlay { position: fixed; inset: 0; background: rgba(10,18,45,.72); display: flex;
  align-items: flex-start; justify-content: center; padding: 4vh 3vw; z-index: 50; overflow: auto; }
.hidden { display: none !important; }
.scheda { width: min(1100px, 96vw); position: relative; padding: 26px 30px; }
.close { position: absolute; top: 12px; right: 16px; background: none; border: none;
  font-size: 30px; color: var(--muted); cursor: pointer; line-height: 1; }
.s-head { display: flex; gap: 14px; align-items: baseline; flex-wrap: wrap; margin-bottom: 4px; }
.s-head h2 { font-size: 28px; }
.s-contatti { color: var(--muted); font-size: 14px; margin-bottom: 14px; }
.s-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.s-box { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.s-box.wide { grid-column: 1 / -1; }
.s-box h3 { font-size: 16px; margin-bottom: 8px; color: var(--navy); }
.s-box ul { list-style: none; }
.s-box li { padding: 4px 0; border-bottom: 1px dashed var(--line); font-size: 14px; }
.s-box li:last-child { border-bottom: none; }
.kv { color: var(--muted); }
.pipeline-form { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.pipeline-form select, .pipeline-form input { padding: 8px 12px; border-radius: 8px;
  border: 1px solid var(--line); font-size: 14px; background: #fff; }
.pipeline-form input { flex: 1; min-width: 160px; }
.pipeline-form button, .gate-box button { background: var(--navy); color: var(--crema); border: none;
  padding: 9px 22px; border-radius: 999px; font-size: 14px; font-weight: 600; cursor: pointer; }
.pipeline-form button:hover, .gate-box button:hover { background: var(--navy-2); }

/* chat */
.chat { display: flex; flex-direction: column; gap: 6px; max-height: 340px; overflow: auto; padding: 4px; }
.msg { max-width: 78%; padding: 7px 11px; border-radius: 12px; font-size: 13.5px; }
.msg .who { font-size: 11px; color: var(--muted); margin-bottom: 2px; }
.msg.in { background: #eee9d6; align-self: flex-start; border-bottom-left-radius: 3px; }
.msg.out { background: #dbe3f8; align-self: flex-end; border-bottom-right-radius: 3px; }

/* follow-up */
.fu-badge { background: var(--giallo); color: var(--navy); border-radius: 999px;
  padding: 1px 8px; font-size: 12px; font-weight: 800; margin-left: 4px; }
.tab.active .fu-badge { background: var(--navy); color: var(--giallo); }
.fu-list { display: flex; flex-direction: column; gap: 12px; max-width: 1000px; }
.fu-card { padding: 14px 18px; }
.fu-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.fu-head .nome { font-weight: 700; font-size: 16px; cursor: pointer; }
.fu-head .nome:hover { text-decoration: underline; }
.fu-head .kv { font-size: 12.5px; }
.fu-azione { margin: 8px 0 4px; border-left: 3px solid var(--giallo); padding: 2px 0 2px 9px; font-size: 14px; }
.fu-card textarea { width: 100%; min-height: 64px; margin-top: 8px; padding: 9px 12px;
  border: 1px solid var(--line); border-radius: 8px; font: 14px/1.4 system-ui, sans-serif;
  background: #fff; resize: vertical; }
.fu-actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; align-items: center; }
.fu-actions button { border: none; border-radius: 999px; padding: 8px 18px;
  font-size: 13.5px; font-weight: 600; cursor: pointer; }
.btn-invia { background: var(--navy); color: var(--crema); }
.btn-invia:disabled { opacity: .35; cursor: default; }
.btn-tpl { background: var(--giallo); color: var(--navy); }
.btn-skip { background: #e3e0d2; color: #555; }
.btn-scheda { background: transparent; border: 1px solid var(--line) !important; color: var(--muted); }
.fu-empty { color: rgba(249,246,234,.75); padding: 26px; text-align: center; }

/* template picker */
.tpl-box { width: min(680px, 94vw); margin-top: 6vh; position: relative; }
.tpl-item { border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px;
  margin-top: 10px; background: #fff; }
.tpl-item .body { font-size: 13px; color: var(--muted); white-space: pre-wrap; margin: 6px 0; }
.tpl-item input { width: 100%; padding: 7px 10px; margin-top: 6px;
  border: 1px solid var(--line); border-radius: 8px; font-size: 13.5px; }
.tpl-item button { margin-top: 8px; background: var(--navy); color: var(--crema);
  border: none; border-radius: 999px; padding: 7px 18px; font-size: 13px; cursor: pointer; }

/* gate + toast */
.gate-box { width: min(420px, 92vw); margin-top: 14vh; text-align: center; }
.gate-box h2 { margin-bottom: 8px; }
.gate-box p { font-size: 14px; color: var(--muted); margin-bottom: 14px; }
.gate-box input { width: 100%; padding: 11px 14px; border-radius: 8px; border: 1px solid var(--line);
  margin-bottom: 14px; font-size: 15px; }
.err { color: var(--bad); font-size: 13.5px; margin-top: 10px; }
.toast { position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%);
  background: var(--giallo); color: var(--navy); font-weight: 700; padding: 11px 26px;
  border-radius: 999px; box-shadow: 0 4px 14px rgba(0,0,0,.35); z-index: 99; }

@media (max-width: 980px) {
  .kanban { grid-template-columns: repeat(2, 1fr); }
  .s-grid { grid-template-columns: 1fr; }
}
