:root{
  --bg:#f7f8fb; --card:#ffffff; --muted:#6b7280; --text:#0f172a; --border:#e5e7eb;
  --accent:#2563eb; --danger:#dc2626; --chip:#eef2ff;
}
*{box-sizing:border-box}
body{margin:0;background:var(--bg);color:var(--text);font:14px/1.45 system-ui,-apple-system,Segoe UI,Roboto,Helvetica,Arial}

/* ===== TOPBAR com logo/link ===== */
.topbar{background:#fff;border-bottom:1px solid var(--border)}
.brand{
  max-width:1400px;margin:0 auto;padding:10px 16px;
  display:flex;align-items:center;gap:12px;
}
.brand a{display:flex;align-items:center;gap:12px;text-decoration:none;color:inherit}
.topbar img.logo{height:56px !important;width:auto;display:block}  /* força 56px em todas as páginas */
.brand h1{font-size:18px;margin:0;font-weight:800;letter-spacing:.2px}

/* ===== layout comum ===== */
.wrap{max-width:1400px;margin:0 auto;padding:16px}
h2{font-size:20px;margin:0 0 12px}
.badge{display:inline-block;padding:2px 6px;border-radius:6px;font-size:11px;background:#ecfeff;border:1px solid #cffafe}
.top{display:flex;gap:10px;align-items:center;margin-bottom:14px}
.pill{background:var(--chip);padding:6px 10px;border-radius:999px;font-weight:600}
.actions{margin-left:auto;display:flex;gap:8px}

/* ===== Botões (funciona em <button> e <a>) ===== */
button,.btn{border:1px solid var(--border);background:#fff;border-radius:10px;padding:8px 12px;cursor:pointer;display:inline-block;text-decoration:none;color:inherit}
button:focus,.btn:focus{outline:2px solid rgba(37,99,235,.4); outline-offset:2px}
.btn-primary{background:var(--accent);color:#fff;border-color:var(--accent)}
.btn-outline{background:#fff;color:var(--accent);border-color:var(--accent)}
.btn-danger{background:var(--danger);color:#fff;border-color:var(--danger)}
.sub{color:var(--muted);font-size:13px;margin-bottom:16px}

/* ===== Cards da home ===== */
.cards{display:grid;grid-template-columns:repeat(2,1fr);gap:10px;max-width:900px}
.card{border:1px solid var(--border);border-radius:12px;padding:12px;background:#fff}
.card .title{font-weight:700}
.meta{font-size:12px;color:var(--muted);display:flex;gap:8px;flex-wrap:wrap;margin-top:4px}
.row{display:flex;gap:8px;flex-wrap:wrap;margin-top:10px}

/* ===== Evolução (colunas) ===== */
.kanban{display:grid;grid-template-columns:repeat(6,1fr);gap:12px}
.col{background:var(--card);border:1px solid var(--border);border-radius:14px;padding:10px;min-height:260px}
.col h3{margin:0 0 8px;font-size:15px}
.empty{border:1px dashed var(--border);border-radius:12px;padding:14px;color:var(--muted);text-align:center}
.flag{font-size:12px;color:#b45309;font-weight:700}

input,select,textarea{width:100%;padding:8px;border:1px solid var(--border);border-radius:10px;background:#fff}
textarea{min-height:64px}

/* ===== Modais ===== */
.modal{
  display:none; position:fixed; inset:0; z-index:1000;
  background:rgba(15,23,42,.45); padding:40px 16px;
  align-items:center; justify-content:center;
}
.modal .col{
  width:100%; max-width:720px; max-height:80vh; overflow:auto;
  background:#fff; border:1px solid var(--border); border-radius:14px; padding:12px;
  box-shadow:0 10px 30px rgba(0,0,0,.25);
}

/* grids */
.grid-2{display:grid;grid-template-columns:1fr 1fr;gap:10px}

/* responsivo */
@media (max-width:1200px){ .kanban{grid-template-columns:repeat(3,1fr)} }
@media (max-width:700px){
  .kanban{grid-template-columns:1fr}
  .cards{grid-template-columns:1fr}
}


.card.clickable { cursor: pointer; }
.card .row button { pointer-events: auto; }
.card-action-menu{
  position:absolute;
  min-width:200px;
  background:#fff;
  border:1px solid var(--border);
  border-radius:12px;
  padding:10px;
  box-shadow:0 10px 30px rgba(15,23,42,.2);
  z-index:5000;
  display:none;
}
.card-action-menu .menu-title{
  font-weight:600;
  font-size:13px;
  margin-bottom:8px;
  color:#0f172a;
}
.card-action-menu .menu-row{
  display:flex;
  gap:8px;
  margin-bottom:8px;
}
.card-action-menu button{
  width:100%;
  border:1px solid var(--border);
  border-radius:8px;
  padding:6px 10px;
  background:#f8fafc;
  font-weight:600;
}
.card-action-menu button:hover{
  background:#e0e7ff;
  border-color:#c7d2fe;
}

/* ===== Header ===== */
.site-header{position:sticky;top:0;background:#fff;border-bottom:1px solid var(--border);z-index:50}
.header-inner{display:flex;align-items:center;gap:16px;padding:10px 16px}
.brand img{height:54px;width:auto;display:block}
.main-nav{margin-left:auto;display:flex;gap:10px}
.main-nav a{padding:8px 12px;border:1px solid var(--border);border-radius:10px;text-decoration:none;color:var(--text);font-weight:600;background:#fff}
.main-nav a:hover{border-color:#cbd5e1}
.main-nav a.active{background:var(--accent);border-color:var(--accent);color:#fff}



.badge{display:inline-block;min-width:22px;padding:2px 6px;border-radius:999px;background:#ef4444;color:#fff;text-align:center;font-size:12px;line-height:16px}
.muted{color:var(--muted)}


/* ===== Header fixo e compacto ===== */
.site-header{
  position: sticky; top: 0; z-index: 50;
  background: #fff; border-bottom: 1px solid #eef0f3;
}
.site-header .inner{
  max-width: 1200px; margin: 0 auto;
  display: flex; align-items: center; gap: 16px;
  padding: 10px 16px;
}
.brand{ display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand img{ height: 56px; width: auto; display:block; border-radius: 50%; }
.brand-title{ font-weight: 700; font-size: 18px; color: #111; }

.main-nav{ display:flex; gap: 14px; margin-left: 8px; }
.nav-link{
  font-weight: 600; color: #374151; text-decoration: none;
  padding: 6px 10px; border-radius: 8px;
}
.nav-link:hover{ background:#f3f4f6; }

.badge{
  background: #2563eb; color:#fff; font-size: 12px; font-weight:700;
  line-height: 1; padding: 3px 7px; border-radius: 999px; margin-left: 6px;
}

.userbox{ margin-left: auto; display:flex; align-items:center; gap: 12px; }
.userbox .hello{ color:#6b7280; font-size: 14px; }
.userbox .logout{ color:#dc2626; font-weight:600; text-decoration:none; }
.userbox .logout:hover{ text-decoration:underline; }

/* Garante um respirinho abaixo do header */
.wrap{ max-width:1200px; margin: 18px auto; padding: 0 16px; }

/* Em telas pequenas reduzir a logo um pouco */
@media (max-width: 640px){
  .brand img{ height: 42px; }
  .brand-title{ display:none; } /* só a logo no mobile */
}






/* === HEADER === */
.site-header{
  position: sticky; top:0; z-index:50;
  background:#fff; border-bottom:1px solid #eef2f7;
}
.site-header__inner{
  max-width: 1200px; margin: 0 auto; padding: 10px 16px;
  display:flex; align-items:center; gap:16px;
}
.brand{ display:flex; align-items:center; gap:10px; text-decoration:none; color:inherit; }
.brand__logo{ width:38px; height:38px; border-radius:999px; object-fit:cover; }
.brand__name{ font-weight:600; }

.main-nav{ display:flex; align-items:center; gap:10px; flex:1; }
.nav-spacer{ flex:1; }

.nav-btn{
  display:inline-flex; align-items:center; gap:8px;
  background:#2563eb; color:#fff; text-decoration:none;
  padding:8px 14px; border-radius:12px; font-weight:600;
  box-shadow:0 2px 6px rgba(37,99,235,.25);
  transition:transform .15s ease, filter .15s ease;
}
.nav-btn:hover{ filter:brightness(.95); transform:translateY(-1px); }

.nav-btn--outline{
  background:#fff; color:#2563eb; border:1px solid #2563eb;
  box-shadow:none;
}
.nav-btn--outline:hover{ background:#f8fafc; }

.badge{
  background:#1d4ed8; color:#fff; border-radius:999px;
  padding:2px 7px; font-size:12px; line-height:1;
}

/* opcional: mantém “Olá, Nome” discreto */
.hello{ color:#475569; margin-right:6px; }




/* ==== MODAIS LIFE & COR ==== */
.modal {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.5);
  z-index: 2000;
  overflow-y: auto;
  padding: 40px 16px;
}

.modal-content {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.25);
  max-width: 800px;
  width: 100%;
  color: #111827;
  display: flex;
  flex-direction: column;
  animation: modalIn .25s ease-out;
}

.modal-content.small { max-width: 420px; }
.modal-content.large { max-width: 900px; }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #0f2f47;
  color: #fff;
  padding: 16px 20px;
  border-radius: 16px 16px 0 0;
}

.modal-header h2 {
  font-size: 18px;
  font-weight: 600;
  margin: 0;
}

.modal-header .close {
  background: transparent;
  border: none;
  color: #fff;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  transition: opacity .2s;
}
.modal-header .close:hover { opacity: 0.7; }

.modal-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.modal-body label {
  font-weight: 600;
  font-size: 14px;
  color: #374151;
}

.modal-body input,
.modal-body select,
.modal-body textarea {
  width: 100%;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid #d1d5db;
  background: #f9fafb;
  font-size: 14px;
  color: #111827;
  transition: border-color .2s, background .2s;
}
.modal-body input:focus,
.modal-body select:focus,
.modal-body textarea:focus {
  border-color: #0f2f47;
  background: #fff;
  outline: none;
}

.modal-body h3 {
  margin-top: 18px;
  font-size: 15px;
  font-weight: 700;
  color: #0f2f47;
  border-top: 1px solid #e5e7eb;
  padding-top: 10px;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 20px 20px;
  border-top: 1px solid #e5e7eb;
}

.btn-primary {
  background: #0f2f47;
  color: #fff;
  border: none;
  padding: 10px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  transition: background .2s;
}
.btn-primary:hover { background: #0b6e6d; }

.btn {
  background: #f3f4f6;
  color: #111827;
  border: 1px solid #d1d5db;
  padding: 10px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 500;
  transition: background .2s;
}
.btn:hover { background: #e5e7eb; }

@keyframes modalIn {
  from { transform: translateY(-20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* Mobile */
@media (max-width:600px){
  .modal-content.large,
  .modal-content.small{
    max-width: 100%;
    height: auto;
  }
  .modal-body{
    max-height: 80vh;
    overflow-y: auto;
  }
}


/* ===== CORREÇÃO DE MODAL NO DESKTOP ===== */
.modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: flex-start; /* começa mais em cima, mas com padding */
  justify-content: center;
  background: rgba(0,0,0,0.5);
  z-index: 2000;
  overflow-y: auto;
  padding: 60px 16px 40px; /* topo maior pra caber o header */
}

/* impede o body de rolar enquanto o modal está aberto */
body.modal-open {
  overflow: hidden !important;
}

/* centralização vertical só em telas grandes */
@media (min-width: 901px){
  .modal {
    align-items: center; /* centraliza na vertical */
    padding: 40px 16px;
  }
  .modal-body {
    max-height: 70vh;
    overflow-y: auto;
  }
}

/* melhora o scroll e remove barras duplas */
.modal-content {
  position: relative;
  overflow: hidden;
}

.modal-content.large {
  max-height: 90vh; /* nunca passa do viewport */
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.modal-body {
  flex: 1;
  overflow-y: auto;
  padding-bottom: 10px;
}



/* ======= FICHAS - Upload / Arquivos ======= */
.file-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.file-item {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 10px;
  text-align: center;
  position: relative;
  transition: all .2s ease;
}

.file-item:hover {
  background: #eef3ff;
  border-color: #c7d2fe;
}

.file-item i {
  font-size: 28px;
  display: block;
  margin-bottom: 6px;
  color: #3b82f6;
}

.file-item span {
  display: block;
  font-size: 13px;
  color: #334155;
  word-break: break-word;
}

.file-item button {
  position: absolute;
  top: 6px;
  right: 6px;
  border: none;
  background: transparent;
  color: #ef4444;
  font-size: 14px;
  cursor: pointer;
  display: none;
}

.file-item:hover button {
  display: inline;
}
.file-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fafafa;
  margin-bottom: 6px;
  transition: background .2s;
}
.file-item:hover { background: #f0f0f0; cursor: pointer; }
.file-item i { font-size: 18px; }
.file-item button {
  margin-left: auto;
  background: none;
  border: none;
  color: #c33;
  font-size: 16px;
  cursor: pointer;
}
/* ====== MINIATURAS DE ARQUIVOS ====== */
#fi_files {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 10px;
}

.file-thumb {
  width: 110px;
  height: 110px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  box-shadow: 0 1px 2px rgba(0,0,0,.05);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  cursor: pointer;
  transition: all .2s ease;
  overflow: hidden;
}

.file-thumb:hover {
  background: #eef3ff;
  transform: translateY(-2px);
}

.file-icon {
  font-size: 28px;
  line-height: 1;
  margin-bottom: 6px;
}

.file-name {
  font-size: 12px;
  color: #334155;
  word-break: break-word;
  padding: 0 4px;
  max-height: 2.8em;
  overflow: hidden;
  text-overflow: ellipsis;
}


/* ===== MINIATURAS COM BOTÃO DE EXCLUSÃO ===== */
.file-thumb {
  position: relative;
}
.file-del {
  position: absolute;
  top: 4px;
  right: 4px;
  background: rgba(255,255,255,.8);
  border: none;
  border-radius: 6px;
  cursor: pointer;
  opacity: 0;
  transition: opacity .2s ease;
  font-size: 14px;
  padding: 3px 6px;
}
.file-thumb:hover .file-del {
  opacity: 1;
}
.file-del:hover {
  background: #fee2e2;
}

.btn-pdv {
  background: #22c55e;      /* verde */
  border-color: #16a34a;
  color: #ffffff;
}

.btn-pdv:hover {
  background: #16a34a;
  border-color: #15803d;
  filter: brightness(0.98);
}



/* =========================================================
   Compactar botões nos cards do Kanban de atendimento
   (não mexe nos outros lugares do sistema)
   ========================================================= */

.kanban .card{
  padding:8px 10px;           /* card um pouco mais “magro” */
}

/* as linhas de botões dentro dos cards do kanban */
.kanban .row{
  display:block;              /* deixa de ser flex horizontal */
  margin-top:4px;             /* antes era 10px */
}

/* todos os botões dentro dos cards do kanban */
.kanban .row button,
.kanban .row .btn{
  width:100%;                 /* pega a largura toda do card */
  display:block;
  padding:4px 8px;            /* mais baixos */
  margin:2px 0;               /* bem pouco espaço entre eles */
  font-size:12px;
  line-height:1.2;
  text-align:center;
}

/* se tiver parágrafo ou texto logo antes dos botões, tira margens grandes */
.kanban .card p{
  margin:2px 0;
  font-size:13px;
}
