/* ============================================================
   Central de Chamados Agex — Estilos globais
   Identidade: verde-petróleo escuro + laranja de destaque
   ============================================================ */

:root {
  --sidebar-bg: #0c3338;
  --sidebar-bg-2: #0e3d43;
  --sidebar-text: #b8d4d8;
  --sidebar-active: #134b52;
  --primary: #0e7490;
  --primary-hover: #0a5c73;
  --teal: #14b8a6;
  --accent: #f97316;
  --accent-hover: #ea580c;
  --bg: #f1f5f9;
  --card: #ffffff;
  --border: #e2e8f0;
  --text: #0f172a;
  --text-2: #475569;
  --text-3: #94a3b8;
  --danger: #dc2626;
  --success: #16a34a;
  --warning: #d97706;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(15, 23, 42, .08);
  --shadow-lg: 0 10px 30px rgba(15, 23, 42, .18);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14.5px;
  line-height: 1.5;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0 0 .5em; line-height: 1.25; }
p { margin: 0 0 .8em; }
.icon { vertical-align: -3px; flex-shrink: 0; }

/* ---------- Estrutura ---------- */
.shell { display: flex; min-height: 100vh; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.content { padding: 22px 26px 60px; max-width: 1500px; width: 100%; margin: 0 auto; }

/* ---------- Sidebar ---------- */
.sidebar {
  width: 240px; flex-shrink: 0; background: var(--sidebar-bg); color: var(--sidebar-text);
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; z-index: 40;
}
.sidebar-brand { padding: 20px 18px 14px; }
.sidebar-logo { width: 130px; height: auto; display: block; }
.brand-sub { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: 1.2px; color: #6fa3aa; margin-top: 6px; }
.sidebar-new { margin: 4px 14px 14px; justify-content: center; }
.sidebar-nav { flex: 1; overflow-y: auto; padding: 4px 10px; }
.nav-section { font-size: 10.5px; text-transform: uppercase; letter-spacing: 1.2px; color: #5d8f96; padding: 16px 10px 6px; }
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 9px 11px; margin: 2px 0;
  border-radius: 8px; color: var(--sidebar-text); font-weight: 500; font-size: 14px;
}
.nav-item:hover { background: var(--sidebar-bg-2); color: #fff; text-decoration: none; }
.nav-item.active { background: var(--sidebar-active); color: #fff; box-shadow: inset 3px 0 0 var(--teal); }
.sidebar-foot { padding: 12px 16px; border-top: 1px solid rgba(255,255,255,.08); }
.sidebar-user { display: flex; align-items: center; gap: 10px; font-size: 13px; color: #d7e8ea; }
.sidebar-username { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-backdrop { display: none; }

/* ---------- Topbar ---------- */
.topbar {
  display: flex; align-items: center; gap: 14px; padding: 10px 22px;
  background: var(--card); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 30;
}
.icon-btn.sidebar-toggle { display: inline-flex; }
/* Desktop: o botão de menu recolhe a barra lateral para ganhar espaço */
@media (min-width: 901px) {
  body.sidebar-collapsed .sidebar { display: none; }
}
.topbar-search {
  display: flex; align-items: center; gap: 8px; background: var(--bg);
  border: 1px solid var(--border); border-radius: 8px; padding: 6px 12px; color: var(--text-3);
}
.topbar-search input { border: 0; background: transparent; outline: none; font-size: 14px; width: 130px; color: var(--text); }
.topbar-search input::-webkit-outer-spin-button, .topbar-search input::-webkit-inner-spin-button { -webkit-appearance: none; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.icon-btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border: 0; background: transparent; border-radius: 8px;
  color: var(--text-2); cursor: pointer;
}
.icon-btn:hover { background: var(--bg); }
.bell-count {
  position: absolute; top: 3px; right: 2px; background: var(--danger); color: #fff;
  font-size: 10px; font-weight: 700; border-radius: 99px; padding: 1px 5px; line-height: 1.3;
}
.user-chip { display: flex; align-items: center; gap: 6px; border: 0; background: transparent; cursor: pointer; padding: 4px; border-radius: 8px; color: var(--text-2); }
.user-chip:hover { background: var(--bg); }

/* ---------- Avatar ---------- */
.avatar {
  display: inline-flex; align-items: center; justify-content: center; border-radius: 50%;
  color: #fff; font-weight: 700; flex-shrink: 0; user-select: none;
}

/* ---------- Dropdown ---------- */
.dropdown { position: relative; }
.dropdown-menu {
  position: absolute; right: 0; top: calc(100% + 6px); min-width: 250px; max-width: min(340px, calc(100vw - 24px));
  width: max-content; background: var(--card);
  border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg);
  padding: 6px; display: none; z-index: 60;
}
.dropdown.open .dropdown-menu { display: block; }
.dropdown-header { padding: 8px 12px; border-bottom: 1px solid var(--border); margin-bottom: 4px; }
.dropdown-header small { display: block; color: var(--text-3); }
.dropdown-item {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 8px 12px;
  border: 0; background: transparent; border-radius: 7px; color: var(--text); font-size: 14px; cursor: pointer;
  white-space: nowrap;
}
.dropdown-item > svg { flex-shrink: 0; }
.dropdown-item:hover { background: var(--bg); text-decoration: none; }
.dropdown-item-danger { color: var(--danger); }
.dropdown-notifications { width: 340px; max-height: 460px; overflow-y: auto; }
.dropdown-loading { padding: 18px; text-align: center; color: var(--text-3); font-size: 13px; }
.notif-item { display: block; padding: 10px 12px; border-radius: 7px; border-bottom: 1px solid var(--bg); }
.notif-item:hover { background: var(--bg); text-decoration: none; }
.notif-item.unread { background: #eff8fa; }
.notif-item strong { display: block; font-size: 13.5px; color: var(--text); }
.notif-item span { font-size: 12.5px; color: var(--text-2); }
.notif-item time { display: block; font-size: 11.5px; color: var(--text-3); margin-top: 2px; }
.notif-footer {
  display: block; text-align: center; padding: 10px 9px; font-size: 13px; font-weight: 600;
  position: sticky; bottom: -6px; margin: 0 -6px -6px; background: var(--card); border-top: 1px solid var(--border);
}

/* ---------- Botões ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 7px; padding: 9px 16px; border-radius: 9px;
  border: 1px solid transparent; font-size: 14px; font-weight: 600; line-height: 1.2; cursor: pointer;
  background: var(--bg); color: var(--text); text-decoration: none; white-space: nowrap;
  box-sizing: border-box; transition: background .12s, border-color .12s;
}
.btn:hover { text-decoration: none; filter: brightness(.97); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { background: var(--accent-hover); }
.btn-outline { background: var(--card); border-color: var(--border); color: var(--text-2); }
.btn-outline:hover { border-color: var(--text-3); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--bg); }
.btn-sm { padding: 5px 11px; font-size: 13px; border-radius: 7px; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn-block { width: 100%; justify-content: center; }

/* ---------- Cards ---------- */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 18px; }
.card-header {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 18px; border-bottom: 1px solid var(--border);
}
.card-header h2, .card-header h3 { margin: 0; font-size: 16px; }
.card-body { padding: 18px; }
.card-body.compact { padding: 10px 18px; }

/* ---------- Page header ---------- */
.page-header { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 18px; flex-wrap: wrap; }
.page-header h1 { margin: 0; font-size: 21px; }
.page-header .page-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.page-sub { color: var(--text-2); font-size: 13.5px; margin-top: 2px; }

/* ---------- Grid ---------- */
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-5 { grid-template-columns: repeat(5, 1fr); }
.grid-6 { grid-template-columns: repeat(6, 1fr); }
.grid-7 { grid-template-columns: repeat(7, 1fr); }

/* ---------- Stat cards ---------- */
.stat-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 16px; box-shadow: var(--shadow); display: block; color: inherit;
}
a.stat-card:hover { text-decoration: none; border-color: var(--primary); }
.stat-label { font-size: 12.5px; color: var(--text-2); display: flex; align-items: center; gap: 6px; }
.stat-value { font-size: 26px; font-weight: 800; margin-top: 4px; }
.stat-value.danger { color: var(--danger); }
.stat-value.warning { color: var(--warning); }
.stat-value.success { color: var(--success); }
.stat-value.primary { color: var(--primary); }

/* ---------- Formulários ---------- */
.form-group { margin-bottom: 15px; }
.form-group label { display: block; font-weight: 600; font-size: 13.5px; margin-bottom: 5px; color: var(--text); }
.form-group .hint { font-size: 12.5px; color: var(--text-3); margin-top: 4px; }
label .req { color: var(--danger); }
.input {
  width: 100%; padding: 9px 12px; border: 1px solid var(--border); border-radius: 8px;
  font-size: 14px; font-family: inherit; background: var(--card); color: var(--text); outline: none;
}
.input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(14, 116, 144, .12); }
textarea.input { resize: vertical; min-height: 90px; }
select.input { appearance: auto; }
.input-row { display: flex; gap: 12px; }
.input-row > * { flex: 1; }
.checkbox-line { display: flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }
.checkbox-line input { width: 16px; height: 16px; accent-color: var(--primary); }
.form-actions { display: flex; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
.input-with-icon { position: relative; }
.input-with-icon .input { padding-right: 38px; }
.input-with-icon .toggle-pass {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  border: 0; background: transparent; color: var(--text-3); cursor: pointer; padding: 6px;
}

/* ---------- Insumos: linhas repetíveis (vários materiais numa solicitação) ---------- */
.insumo-item {
  display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr) 38px;
  gap: 8px; align-items: center; margin-bottom: 8px;
}
.insumo-item .input { width: 100%; }
.ii-remove {
  display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px;
  border: 1px solid var(--border); background: var(--card); color: var(--text-3);
  border-radius: 8px; cursor: pointer; padding: 0;
}
.ii-remove:hover { color: var(--danger); background: #fef2f2; border-color: #fecaca; }
@media (max-width: 700px) {
  .insumo-item { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 38px; }
  .insumo-item .ii-produto { grid-column: 1 / -1; }
}

/* Coluna "Insumos" da lista de tickets: quantidade + "+N" com a lista no tooltip */
.insumo-cell { white-space: nowrap; }
.insumo-cell .insumo-qtd { font-weight: 600; }
.insumo-more {
  display: inline-flex; align-items: center; margin-left: 6px; padding: 1px 8px;
  border-radius: 99px; background: #ecfeff; color: var(--primary); border: 1px solid #a5f3fc;
  font-size: 11.5px; font-weight: 700; cursor: help;
}

/* ---------- Tabelas ---------- */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th {
  text-align: left; padding: 10px 14px; font-size: 12px; text-transform: uppercase;
  letter-spacing: .6px; color: var(--text-3); border-bottom: 1px solid var(--border); white-space: nowrap;
}
.table td { padding: 11px 14px; border-bottom: 1px solid var(--bg); vertical-align: middle; }
.table tbody tr:hover { background: #f8fafc; }
.table .row-link { font-weight: 600; }
.table td.actions { text-align: right; white-space: nowrap; }
.table .muted { color: var(--text-3); font-size: 13px; }

/* ---------- Badges ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 99px;
  font-size: 12.5px; font-weight: 600; background: var(--bg); color: var(--text-2); white-space: nowrap;
}
.priority-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.sla-badge {
  display: inline-flex; align-items: center; gap: 3px; padding: 2px 7px; border-radius: 6px;
  font-size: 11px; font-weight: 700; margin-left: 4px;
}
.sla-red { background: #fee2e2; color: #b91c1c; }
.sla-amber { background: #fef3c7; color: #b45309; }
.sla-green { background: #dcfce7; color: #15803d; }
.sla-gray { background: #e2e8f0; color: #475569; }
.sla-neutral { background: #f1f5f9; color: #64748b; }

/* ---------- Alerts / flash ---------- */
.alert {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 11px 16px; border-radius: 9px; margin-bottom: 14px; font-size: 14px; border: 1px solid;
}
.alert-success { background: #f0fdf4; border-color: #bbf7d0; color: #15803d; }
.alert-error { background: #fef2f2; border-color: #fecaca; color: #b91c1c; }
.alert-info { background: #eff6ff; border-color: #bfdbfe; color: #1d4ed8; }
.alert-close { border: 0; background: transparent; font-size: 18px; cursor: pointer; color: inherit; line-height: 1; }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 2px; border-bottom: 2px solid var(--border); margin-bottom: 18px; overflow-x: auto; }
.tab {
  padding: 10px 16px; border: 0; background: transparent; font-size: 14px; font-weight: 600;
  color: var(--text-2); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -2px;
  white-space: nowrap; display: inline-flex; align-items: center; gap: 7px; text-decoration: none;
}
.tab:hover { color: var(--text); text-decoration: none; }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab .tab-count { background: var(--bg); border-radius: 99px; padding: 1px 8px; font-size: 12px; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ---------- Modal ---------- */
.modal {
  display: none; position: fixed; inset: 0; background: rgba(15, 23, 42, .45);
  z-index: 100; align-items: flex-start; justify-content: center; padding: 60px 16px; overflow-y: auto;
}
.modal.open { display: flex; }
.modal-card { background: var(--card); border-radius: 14px; box-shadow: var(--shadow-lg); width: 100%; max-width: 520px; }
.modal-card.wide { max-width: 720px; }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.modal-header h3 { margin: 0; font-size: 16px; }
.modal-body { padding: 20px; }
.modal-close { border: 0; background: transparent; cursor: pointer; color: var(--text-3); padding: 4px; }

/* ---------- Empty state ---------- */
.empty-state { text-align: center; padding: 50px 20px; color: var(--text-3); }
.empty-state h2 { color: var(--text-2); font-size: 17px; margin: 12px 0 4px; }
.empty-state .btn { margin-top: 14px; }

/* ---------- Mensagens (comunicação) ---------- */
.msg { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 12px; }
.msg-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.msg-head .who { font-weight: 700; font-size: 14px; }
.msg-head .when { color: var(--text-3); font-size: 12.5px; margin-left: auto; white-space: nowrap; }
/* As quebras de linha já chegam como <br> (nl2br no PHP); "pre-wrap" duplicaria cada quebra. */
.msg-body { white-space: normal; word-wrap: break-word; overflow-wrap: break-word; color: var(--text); }
.msg.msg-interna { background: #fffbeb; border-color: #fde68a; }
.msg.msg-interna .msg-tag { background: #fef3c7; color: #92400e; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 5px; }
/* Chat aberto: mensagens da própria pessoa destacadas; etiqueta T.I */
.chat { margin-bottom: 14px; }
.msg.msg-mine { background: #eff8fa; border-color: #bfe3ea; }
.msg-head .msg-tag-ti { background: var(--primary); color: #fff; font-size: 10.5px; font-weight: 700; padding: 1px 7px; border-radius: 5px; letter-spacing: .3px; }
.msg-attachments { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 8px; }
.attachment-chip {
  display: inline-flex; align-items: center; gap: 6px; background: var(--bg); border: 1px solid var(--border);
  padding: 5px 10px; border-radius: 7px; font-size: 12.5px; color: var(--text-2);
}
.attachment-chip:hover { border-color: var(--primary); color: var(--primary); text-decoration: none; }
/* Anexo salvo + botão de excluir ao lado (o form não pode ficar dentro do <a>) */
.attachment-item { display: inline-flex; align-items: center; gap: 3px; max-width: 100%; }
.attachment-item .attachment-chip { min-width: 0; }
.attachment-del-form { display: inline-flex; margin: 0; }
.attachment-del {
  display: inline-flex; align-items: center; justify-content: center; border: 1px solid transparent;
  background: transparent; color: var(--text-3); cursor: pointer; padding: 5px; border-radius: 7px; flex-shrink: 0;
}
.attachment-del:hover { color: var(--danger); background: #fef2f2; border-color: #fecaca; }

/* ---------- Seleção acumulativa de arquivos (antes do envio) ---------- */
.file-pick-list { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.file-pick-item {
  display: flex; align-items: center; gap: 8px; background: var(--bg); border: 1px solid var(--border);
  border-radius: 8px; padding: 6px 10px; font-size: 13px; color: var(--text-2); min-width: 0;
}
.file-pick-item .fp-name { font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.file-pick-item .fp-meta { color: var(--text-3); font-size: 12px; flex-shrink: 0; white-space: nowrap; }
.file-pick-remove {
  margin-left: auto; border: 0; background: transparent; color: var(--text-3); cursor: pointer;
  border-radius: 6px; padding: 3px 7px; line-height: 1; font-size: 15px; flex-shrink: 0;
}
.file-pick-remove:hover { color: var(--danger); background: #fef2f2; }

/* ---------- Cotações (Compras) no chat ---------- */
.quote-msg { border-left: 4px solid #8b5cf6; }
.quote-msg.quote-aprovado { border-left-color: var(--success); background: #f4fcf7; }
.quote-msg.quote-rejeitado { border-left-color: var(--danger); background: #fef5f5; }
.quote-tag { background: #ede9fe; color: #6d28d9; font-size: 10.5px; font-weight: 700; padding: 1px 8px; border-radius: 5px; display: inline-flex; align-items: center; gap: 4px; }
.quote-foot { display: flex; align-items: center; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.quote-act { display: inline-flex; margin: 0; }
.quote-btn { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--border); background: var(--card); cursor: pointer; }
.quote-btn.ok { color: var(--success); }
.quote-btn.ok:hover { background: #dcfce7; border-color: var(--success); }
.quote-btn.no { color: var(--danger); }
.quote-btn.no:hover { background: #fee2e2; border-color: var(--danger); }
.quote-status { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 700; }
.quote-status.pend { color: var(--warning); }
.quote-status.ok { color: var(--success); }
.quote-status.no { color: var(--danger); }
/* Botão "+" de cotação (estilo "anexar") */
.quote-add { margin-top: 12px; }
.quote-add > summary {
  list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 13px; border: 1px dashed var(--border); border-radius: 8px; font-size: 13.5px;
  font-weight: 600; color: var(--text-2); width: fit-content; user-select: none;
}
.quote-add > summary::-webkit-details-marker { display: none; }
.quote-add > summary:hover { border-color: #8b5cf6; color: #6d28d9; }
.quote-add[open] > summary { border-style: solid; border-color: #8b5cf6; color: #6d28d9; margin-bottom: 10px; }

/* ---------- Kanban ---------- */
.kanban-board {
  display: flex; gap: 14px; align-items: flex-start;
  overflow-x: auto; overflow-y: hidden; padding-bottom: 12px;
  min-height: calc(100vh - 230px);   /* ocupa a tela; a barra fica perto do rodapé */
}
.kanban-board.panning { cursor: grabbing; user-select: none; scroll-behavior: auto; }
.kanban-board.panning .kanban-card { cursor: grabbing; }
/* Barra de rolagem horizontal oculta (rola arrastando a área vazia ou com shift+scroll) */
.kanban-board { scrollbar-width: none; -ms-overflow-style: none; }
.kanban-board::-webkit-scrollbar { height: 0; width: 0; display: none; }
.kanban-col { background: #e9eef4; border-radius: 12px; min-width: 280px; width: 280px; flex-shrink: 0; }
.kanban-col-header { display: flex; align-items: center; gap: 8px; padding: 12px 14px; font-weight: 700; font-size: 13.5px; }
.kanban-col-header .count { background: #fff; border-radius: 99px; padding: 1px 9px; font-size: 12px; color: var(--text-2); }
.kanban-cards { padding: 4px 8px 10px; min-height: 60px; display: flex; flex-direction: column; gap: 8px; }
.kanban-col.drag-over .kanban-cards { outline: 2px dashed var(--primary); outline-offset: -4px; border-radius: 10px; }
.kanban-card {
  background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 11px 12px;
  box-shadow: var(--shadow); cursor: grab; display: block; color: inherit;
}
.kanban-card:hover { text-decoration: none; border-color: var(--primary); }
.kanban-card.dragging { opacity: .5; }
.kanban-card .kc-num { font-size: 12px; color: var(--text-3); font-weight: 700; }
.kanban-card .kc-title { font-weight: 600; font-size: 13.5px; margin: 3px 0 6px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.kanban-card .kc-meta { font-size: 12.5px; color: var(--text-2); margin-bottom: 8px; }
.kanban-card .kc-foot { display: flex; align-items: center; gap: 6px; }
.kanban-card .kc-foot .spacer { flex: 1; }

/* ---------- Popup do card (visão rápida) ---------- */
.modal-card.cartao-modal { max-width: 880px; }
.cartao-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.cartao-head-left { display: flex; flex-direction: column; gap: 6px; }
.cartao-head-left h2 { margin: 0; font-size: 17px; }
.cartao-head-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.cartao-body { display: grid; grid-template-columns: 1fr 270px; gap: 18px; padding: 18px 20px; max-height: 70vh; overflow-y: auto; }
.cartao-sec { font-size: 13px; color: var(--text-2); margin: 16px 0 8px; display: flex; align-items: center; gap: 6px; }
.cartao-sec:first-child { margin-top: 0; }
.cartao-meta { display: flex; flex-wrap: wrap; gap: 12px; font-size: 12.5px; color: var(--text-2); align-items: center; }
.cartao-meta span { display: inline-flex; align-items: center; gap: 4px; }
.cartao-chat { max-height: 240px; overflow-y: auto; }
.cartao-side { border-left: 1px solid var(--border); padding-left: 16px; }
.cartao-side .timeline { padding-left: 20px; }
@media (max-width: 760px) { .cartao-body { grid-template-columns: 1fr; } .cartao-side { border-left: 0; border-top: 1px solid var(--border); padding-left: 0; padding-top: 12px; } }

/* ---------- Checklist ---------- */
.checklist { display: flex; flex-direction: column; }
.checklist-progress { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.checklist-count { font-size: 12.5px; font-weight: 700; color: var(--text-2); min-width: 34px; }
.checklist-bar { flex: 1; height: 8px; background: #e2e8f0; border-radius: 6px; overflow: hidden; }
.checklist-bar > span { display: block; height: 100%; background: var(--success); border-radius: 6px; transition: width .25s; }
.check-item {
  display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 9px;
  border: 1px solid var(--border); background: var(--card); transition: background .12s, border-color .12s;
}
.check-item + .check-item { margin-top: 7px; }
.check-item:hover { border-color: #cbd5e1; background: #f8fafc; }
.check-item.done { background: #f4fcf7; border-color: #bbf7d0; }
.check-toggle-form, .check-del-form { display: inline-flex; margin: 0; }
.check-box {
  width: 22px; height: 22px; border: 2px solid #cbd5e1; border-radius: 6px; background: var(--card);
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0; padding: 0;
  transition: background .12s, border-color .12s;
}
button.check-box:hover { border-color: var(--success); }
.check-item.done .check-box { background: var(--success); border-color: var(--success); }
/* Marca de "check" desenhada em CSS (funciona via classe .done, sem recarregar) */
.check-item.done .check-box::after {
  content: ""; width: 5px; height: 10px; border: solid #fff; border-width: 0 2px 2px 0;
  transform: rotate(45deg); margin-top: -2px;
}
.check-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.check-label { font-size: 14px; line-height: 1.35; word-break: break-word; }
.check-item.done .check-label { text-decoration: line-through; color: var(--text-3); }
.check-done-meta { font-size: 11.5px; color: var(--text-3); display: flex; align-items: center; gap: 5px; }
.check-item:not(.done) .check-done-meta { display: none; }
.check-del { border: 0; background: transparent; color: var(--text-3); cursor: pointer; padding: 5px; border-radius: 6px; opacity: .4; flex-shrink: 0; }
.check-item:hover .check-del { opacity: 1; }
.check-del:hover { color: var(--danger); background: #fef2f2; }
.check-add-form { margin-top: 13px; gap: 8px; }
.check-add-form .input { font-size: 14px; }
.checklist-empty { color: var(--text-3); font-size: 13px; padding: 4px 0 2px; margin: 0; }

/* ---------- Lista agrupada (fila) ---------- */
.group-block { margin-bottom: 10px; }
.group-head {
  display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: var(--card);
  border: 1px solid var(--border); border-radius: 9px; cursor: pointer; user-select: none; font-weight: 700; font-size: 14px;
}
.group-head .count { color: var(--text-3); font-weight: 600; }
.group-head .chev { display: inline-flex; align-items: center; transition: transform .15s; }
.group-block.collapsed .chev { transform: rotate(-90deg); }
.group-block.collapsed .group-body { display: none; }
.group-body { padding-top: 6px; }

/* ---------- Filtros ---------- */
.filter-bar { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.filter-bar .form-group { margin-bottom: 0; min-width: 150px; flex: 1; max-width: 220px; }
.filter-bar .form-group.grow { max-width: none; }

/* ---------- Paginação ---------- */
.pagination { display: flex; gap: 5px; margin-top: 16px; flex-wrap: wrap; }
.page-btn {
  display: inline-flex; align-items: center; justify-content: center; min-width: 34px; height: 34px;
  padding: 0 8px; border-radius: 8px; border: 1px solid var(--border); background: var(--card);
  font-size: 13.5px; color: var(--text-2); text-decoration: none;
}
.page-btn:hover { border-color: var(--primary); color: var(--primary); text-decoration: none; }
.page-btn.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.page-btn.disabled { opacity: .45; pointer-events: none; }

/* ---------- Estrelas (avaliação) ---------- */
.stars { display: inline-flex; gap: 4px; }
.stars button { border: 0; background: transparent; cursor: pointer; color: #cbd5e1; padding: 2px; }
.stars button.on { color: #f59e0b; }
.stars .icon { width: 26px; height: 26px; }
.stars button.on .icon { fill: #f59e0b; }
.stars-static { color: #f59e0b; display: inline-flex; gap: 1px; }
.stars-static .off { color: #cbd5e1; }
.stars-static .on .icon { fill: #f59e0b; }

/* ---------- Auth ---------- */
.auth-body { display: flex; min-height: 100vh; background: var(--bg); align-items: center; justify-content: center; padding: 24px 16px; }
.auth-center { width: 100%; max-width: 430px; display: flex; flex-direction: column; align-items: center; text-align: center; }
.auth-logo { margin-bottom: 20px; }
.auth-logo img { width: 230px; max-width: 80vw; height: auto; display: block; margin: 0 auto; }
.auth-card { background: var(--card); border-radius: 16px; box-shadow: var(--shadow-lg); padding: 32px 36px; width: 100%; text-align: left; }
.auth-brand-sub { display: block; color: var(--text-2); font-size: 12px; letter-spacing: 3px; text-transform: uppercase; margin-top: 10px; }
.auth-card h1 { font-size: 18px; color: var(--text); }
.auth-links { display: flex; justify-content: space-between; align-items: center; font-size: 13px; margin: 4px 0 6px; }
.auth-foot { color: var(--text-3); font-size: 12.5px; margin-top: 18px; }
.terms-box { max-height: 320px; overflow-y: auto; border: 1px solid var(--border); border-radius: 9px; padding: 16px; background: #f8fafc; margin-bottom: 16px; font-size: 13.5px; color: var(--text-2); }

/* ---------- Abertura de chamado (catálogo) ---------- */
.choice-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
.choice-card {
  display: block; background: var(--card); border: 1px solid var(--border); border-radius: 11px;
  padding: 16px; color: inherit; text-align: left; cursor: pointer; font-family: inherit; font-size: 14px;
}
.choice-card:hover { border-color: var(--primary); text-decoration: none; box-shadow: var(--shadow); }
.choice-card .ch-icon { color: var(--primary); margin-bottom: 8px; }
.choice-card strong { display: block; margin-bottom: 3px; }
.choice-card small { color: var(--text-3); display: block; }
.steps { display: flex; gap: 6px; align-items: center; color: var(--text-3); font-size: 13px; margin-bottom: 16px; flex-wrap: wrap; }
.steps .step { display: flex; align-items: center; gap: 6px; }
.steps .step.done { color: var(--primary); font-weight: 600; }
.steps .sep { color: var(--border); }

/* ---------- Detalhe do chamado ---------- */
.ticket-title { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.ticket-title h1 { font-size: 19px; }
.meta-list { display: grid; gap: 10px; font-size: 13.5px; }
.meta-list .meta-item { display: flex; justify-content: space-between; gap: 12px; }
.meta-list .meta-item dt { color: var(--text-3); font-weight: 500; }
.meta-list .meta-item dd { margin: 0; text-align: right; font-weight: 600; }
/* Idem .msg-body: o texto vem com <br>, então não preservar o \n bruto do código-fonte. */
.desc-box { white-space: normal; word-wrap: break-word; overflow-wrap: break-word; }
.timeline { position: relative; padding-left: 24px; }
.timeline::before { content: ""; position: absolute; left: 7px; top: 6px; bottom: 6px; width: 2px; background: var(--border); }
.timeline-item { position: relative; padding: 0 0 16px; }
.timeline-item::before {
  content: ""; position: absolute; left: -23px; top: 5px; width: 12px; height: 12px;
  border-radius: 50%; background: var(--card); border: 3px solid var(--primary);
}
.timeline-item .tl-time { font-size: 12px; color: var(--text-3); }
.timeline-item .tl-text { font-size: 13.5px; }

/* ---------- Detalhe do ticket (layout empilhado: info → descrição → checklist → conversa) ---------- */
.ticket-info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(175px, 1fr)); gap: 14px 20px; }
.ti-item { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.ti-label { font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--text-3); font-weight: 700; }
.ti-val { font-size: 14px; font-weight: 600; color: var(--text); word-break: break-word; }
.ti-val .badge { font-weight: 600; }
.ti-contact { display: flex; align-items: center; gap: 12px; margin-top: 16px; padding-top: 15px; border-top: 1px solid var(--border); }
.ti-contact strong { font-size: 14px; }
/* ---------- Pessoas do ticket (solicitante, solucionador, observadores) ---------- */
.people-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; }
.person-block { display: flex; flex-direction: column; gap: 8px; }
.person-role { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--text-3); font-weight: 700; }
.person-role svg { color: var(--text-3); }
.person { display: flex; align-items: center; gap: 11px; }
.person-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.person-info strong { font-size: 14px; }
.person-info span { word-break: break-word; }
.person-empty .avatar { opacity: .5; }
.watchers { margin-top: 18px; padding-top: 15px; border-top: 1px solid var(--border); }
.watcher-list { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.watcher-chip { display: inline-flex; align-items: center; gap: 7px; background: var(--bg); border: 1px solid var(--border); border-radius: 999px; padding: 4px 6px 4px 4px; }
.watcher-name { font-size: 13px; font-weight: 600; color: var(--text); }
.watcher-remove { display: inline-flex; }
.watcher-remove button { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; border: 0; border-radius: 999px; background: transparent; color: var(--text-3); cursor: pointer; }
.watcher-remove button:hover { background: var(--border); color: var(--text); }
.ticket-section { border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow); margin-bottom: 18px; overflow: hidden; }
.ticket-section > summary {
  list-style: none; cursor: pointer; padding: 14px 18px; font-weight: 700; font-size: 15px;
  display: flex; align-items: center; gap: 8px; color: var(--text); user-select: none;
}
.ticket-section > summary::-webkit-details-marker { display: none; }
.ticket-section > summary::after {
  content: ""; margin-left: auto; width: 8px; height: 8px; border-right: 2px solid var(--text-3);
  border-bottom: 2px solid var(--text-3); transform: rotate(-45deg); transition: transform .15s;
}
.ticket-section[open] > summary::after { transform: rotate(45deg); }
.ticket-section > summary:hover { background: #f8fafc; }
.ticket-section .tab-count { background: var(--bg); border-radius: 99px; padding: 1px 9px; font-size: 12px; font-weight: 700; color: var(--text-2); }
.ticket-section-body { padding: 4px 16px 14px; }
.ticket-section-body .card:last-child, .ticket-section-body .table-wrap:last-child { margin-bottom: 0; }
.conversa-card .card-body { padding-top: 6px; }

/* ---------- Gráficos ---------- */
.chart-box svg { width: 100%; height: auto; display: block; }
.chart-legend { display: flex; gap: 16px; font-size: 11.5px; color: var(--text-2); margin-top: 6px; flex-wrap: wrap; }
.chart-legend .lg { display: inline-flex; align-items: center; gap: 6px; }
.chart-legend .sw { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.bar-row { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; font-size: 13px; }
.bar-row .bar-label { width: 160px; text-align: right; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex-shrink: 0; }
.bar-row .bar-track { flex: 1; background: var(--bg); border-radius: 6px; height: 20px; overflow: hidden; }
.bar-row .bar-fill { height: 100%; background: var(--primary); border-radius: 6px; min-width: 2px; }
.bar-row .bar-value { width: 40px; font-weight: 700; }

/* ---------- Relatórios (estilo padronizado) ---------- */
.report-bar { display: flex; align-items: center; justify-content: flex-end; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.report-bar .spacer { flex: 1; }
/* Barra superior dos relatórios: título + filtros + exportar numa linha; abas embaixo */
.report-top { display: flex; align-items: center; gap: 8px 10px; flex-wrap: wrap; justify-content: flex-end; margin-bottom: 12px; }
.report-top .report-h1 { margin: 0 auto 0 0; font-size: 21px; }
.report-top .report-bar { margin: 0; gap: 7px; justify-content: flex-end; }
.report-top-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.report-top-right .report-subnav { margin: 0; }
.report-filter {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--card); font-size: 13px; color: var(--text-2);
  cursor: pointer; font-family: inherit; line-height: 1.4;
}
.report-filter .icon { width: 15px; height: 15px; }
.report-filter select { font-size: 13px; }
.report-filter:hover { border-color: var(--text-3); text-decoration: none; }
.report-filter.active { border-color: var(--primary); color: var(--primary); background: #ecfeff; }
.report-filter select { border: 0; background: transparent; font: inherit; color: inherit; outline: none; cursor: pointer; }
.report-subnav { display: flex; gap: 4px; background: #e9eef4; padding: 4px; border-radius: 11px; margin: 0 0 18px auto; width: fit-content; flex-wrap: wrap; }
.report-subnav a {
  display: inline-flex; align-items: center; gap: 7px; padding: 8px 16px; border-radius: 8px;
  font-size: 14px; font-weight: 600; color: var(--text-2); text-decoration: none;
}
.report-subnav a:hover { color: var(--text); }
.report-subnav a.active { background: var(--card); color: var(--primary); box-shadow: var(--shadow); }

.kpi-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); }
.kpi-card .kpi-label { font-size: 13px; color: var(--text-2); margin-bottom: 8px; display: flex; align-items: center; gap: 6px; }
.kpi-card .kpi-value { font-size: 30px; font-weight: 800; line-height: 1.1; color: var(--text); }
.kpi-card .kpi-value small { font-size: 15px; font-weight: 700; color: var(--text-3); }
.kpi-card .kpi-sub { font-size: 12.5px; color: var(--text-3); margin-top: 4px; }
.kpi-delta { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 99px; margin-top: 10px; }
.kpi-delta.up { background: #dcfce7; color: #15803d; }
.kpi-delta.down { background: #fee2e2; color: #b91c1c; }
.kpi-delta.flat { background: var(--bg); color: var(--text-3); }
.kpi-split { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.kpi-split .big { font-size: 30px; font-weight: 800; }
.kpi-split .small { font-size: 22px; font-weight: 800; color: var(--text-2); }
.kpi-bar { height: 8px; border-radius: 6px; background: var(--accent); margin-top: 10px; }
.kpi-bar-track { height: 8px; border-radius: 6px; background: #e2e8f0; margin-top: 10px; overflow: hidden; }
.kpi-bar-track > span { display: block; height: 100%; background: var(--accent); }

.gauge-wrap { text-align: center; }
.gauge-wrap svg { max-width: 260px; width: 100%; height: auto; }
.donut-wrap { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.donut-wrap svg { width: 150px; height: 150px; flex-shrink: 0; }
.donut-legend { flex: 1; min-width: 140px; }
.donut-legend .lg { display: flex; align-items: center; gap: 8px; font-size: 13px; padding: 3px 0; color: var(--text-2); }
.donut-legend .lg .sw { width: 11px; height: 11px; border-radius: 3px; flex-shrink: 0; }
.donut-legend .lg b { margin-left: auto; color: var(--text); }

.rank-table td .rank-pos { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 50%; background: var(--bg); font-size: 12px; font-weight: 700; color: var(--text-2); }
.stars-inline { color: #f59e0b; font-weight: 700; white-space: nowrap; }
.target-card { border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 12px; background: var(--card); }
.target-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 6px; }
.target-head .t-name { font-weight: 700; }
.target-head .t-alvo { font-size: 12.5px; color: var(--text-3); }
.target-metrics { display: flex; gap: 22px; flex-wrap: wrap; }
.target-metrics .tm { font-size: 12.5px; color: var(--text-3); }
.target-metrics .tm b { display: block; font-size: 17px; color: var(--text); font-weight: 800; }

/* ---------- Relatório SLA (estilo dashboard) ---------- */
.sla-kpis .kpi-card { display: flex; flex-direction: column; padding: 0; overflow: hidden; }
.sla-kpis .kpi-label { margin: 0; padding: 13px 18px; border-bottom: 1px solid var(--border); font-size: 14px; font-weight: 600; color: var(--text); }
.sla-kpis .kpi-value { padding: 0 18px; margin-top: 18px; font-size: 34px; }
.sla-kpis .kpi-sub { padding: 0 18px; }
.sla-kpis .gauge-wrap { flex: 1; display: flex; flex-direction: column; justify-content: center; padding: 4px 10px 0; }
.sla-kpis .kpi-spark { margin-top: auto; padding: 14px 0 0; }
.kpi-label.spread { justify-content: space-between; }
.kpi-card .kpi-value { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.kpi-label .kpi-delta, .kpi-value .kpi-delta, .tgt-m .kpi-delta { margin-top: 0; }
.kpi-spark { margin-top: auto; padding-top: 12px; }
.sla-kpis .gauge-wrap svg { max-width: 280px; width: 100%; }
.sla-tabs { display: flex; gap: 3px; background: #e9eef4; padding: 3px; border-radius: 9px; flex-wrap: wrap; }
.sla-tab { border: 0; background: transparent; padding: 6px 13px; border-radius: 7px; font-size: 13px; font-weight: 600; color: var(--text-2); cursor: pointer; }
.sla-tab:hover { color: var(--text); }
.sla-tab.active { background: var(--card); color: var(--primary); box-shadow: var(--shadow); }
.tgt-card { padding: 16px 18px; }
.tgt-head { display: flex; justify-content: space-between; gap: 18px 26px; flex-wrap: wrap; align-items: flex-start; margin-bottom: 6px; }
.tgt-title .t-name { font-weight: 700; font-size: 14px; }
.tgt-title .t-alvo { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.tgt-metrics { display: flex; gap: 8px; flex-wrap: wrap; }
.tgt-m { display: flex; flex-direction: column; gap: 3px; border: 0; background: transparent; cursor: pointer; text-align: left; padding: 7px 13px; border-radius: 10px; transition: background .12s; }
.tgt-m:hover { background: #f1f5f9; }
.tgt-m.active { background: var(--bg); box-shadow: inset 0 0 0 1px var(--border); }
.tgt-m > span { font-size: 11.5px; color: var(--text-3); }
.tgt-m > b { font-size: 16px; font-weight: 800; color: var(--text); display: inline-flex; align-items: center; gap: 6px; }
.tgt-card .chart-box { margin-top: 6px; }

/* Ícone de informação (i) ao lado dos títulos */
.kpi-i { display: inline-flex; align-items: center; justify-content: center; width: 15px; height: 15px; border-radius: 50%;
  background: var(--bg); color: var(--text-3); font-size: 10px; font-style: italic; font-weight: 700; cursor: help; font-family: Georgia, serif; }

/* Tooltip dos gráficos (cursor sobre a linha) */
.chart-tip { position: absolute; top: 6px; transform: translateX(-50%); background: var(--card); border: 1px solid var(--border);
  border-radius: 9px; box-shadow: var(--shadow-lg); padding: 8px 11px; font-size: 12px; pointer-events: none; z-index: 6; white-space: nowrap; }
.chart-tip.flip { transform: translateX(-88%); }
.chart-tip .th { font-weight: 700; color: var(--text); margin-bottom: 4px; }
.chart-tip .tr { display: flex; align-items: center; gap: 6px; color: var(--text-2); line-height: 1.7; }
.chart-tip .tr i { width: 9px; height: 9px; border-radius: 2px; display: inline-block; }
.chart-tip .tr b { color: var(--text); font-weight: 700; }

/* Barra de período do relatório de SLA */
.sla-daterange { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
  border: 1px solid var(--border); background: var(--card); border-radius: var(--radius); padding: 9px 14px; font-size: 13px; margin-bottom: 16px; }

/* Tabela "Performance da equipe" */
.sla-team td { vertical-align: middle; }
.sla-team .team-spark { width: 130px; height: 40px; }

/* Dados da visita no popup do card */
.visita-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px 18px; margin: 4px 0 2px; }
.visita-grid .vi dt { font-size: 11px; color: var(--text-3); margin: 0; }
.visita-grid .vi dd { font-size: 13px; color: var(--text); margin: 1px 0 0; }

/* ---------- Utilitários ---------- */
.text-muted { color: var(--text-3); }
.text-small { font-size: 13px; }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.text-right { text-align: right; }
.text-center { text-align: center; }
.mb-0 { margin-bottom: 0; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.flex { display: flex; gap: 10px; align-items: center; }
.flex-wrap { flex-wrap: wrap; }
.spacer { flex: 1; }
.w-100 { width: 100%; }
.divider { border: 0; border-top: 1px solid var(--border); margin: 16px 0; }

/* ---------- Responsivo ---------- */
/* 7 cards em uma linha só em telas largas; abaixo disso quebra em 4 colunas
   (a sidebar de 240px consome parte da largura útil). */
@media (max-width: 1500px) {
  .grid-7 { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 1100px) {
  .grid-4, .grid-5, .grid-6 { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 900px) {
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; transform: translateX(-100%);
    transition: transform .2s ease; height: 100vh;
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-backdrop { position: fixed; inset: 0; background: rgba(15,23,42,.4); z-index: 35; }
  body.sidebar-open .sidebar-backdrop { display: block; }
  .icon-btn.sidebar-toggle { display: inline-flex; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .grid-4, .grid-5, .grid-6, .grid-7 { grid-template-columns: repeat(2, 1fr); }
  [data-tabs-scope] { grid-template-columns: 1fr !important; } /* detalhe do chamado: coluna lateral desce no mobile */
  .content { padding: 16px 14px 50px; }
  .auth-card { padding: 26px 22px; }
  .input-row { flex-direction: column; gap: 0; }
  .bar-row .bar-label { width: 110px; }
  .meta-list .meta-item { flex-direction: column; gap: 2px; }
  .meta-list .meta-item dd { text-align: left; }
}
@media (max-width: 540px) {
  .grid-4, .grid-5, .grid-6, .grid-7 { grid-template-columns: 1fr 1fr; }
  .topbar-search input { width: 80px; }
  .page-header h1 { font-size: 18px; }
}

/* ---------- Toasts (mensagens flutuantes das ações AJAX) ---------- */
.toast-wrap {
  position: fixed;
  z-index: 1200;
  right: 18px;
  bottom: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: min(380px, calc(100vw - 36px));
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  padding: 12px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  box-shadow: var(--shadow-lg);
  font-size: 14px;
  line-height: 1.4;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity .25s ease, transform .25s ease;
  word-break: break-word;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast-success { background: #f0fdf4; border-color: #bbf7d0; color: #15803d; }
.toast-error { background: #fef2f2; border-color: #fecaca; color: #b91c1c; }
.toast-info { background: #eff6ff; border-color: #bfdbfe; color: #1d4ed8; }
.toast-warning { background: #fffbeb; border-color: #fde68a; color: #b45309; }
.toast-notif { border-left: 3px solid var(--primary); }
.toast-notif strong { display: block; font-size: 13.5px; color: var(--text); }
.toast-notif span { display: block; font-size: 12.5px; color: var(--text-2); margin-top: 2px; }

/* Aviso para ativar as notificações do computador */
.notif-enable { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  background: #eff6ff; border: 1px solid #bfdbfe; color: #1d4ed8; border-radius: var(--radius); padding: 10px 14px; margin-bottom: 14px; font-size: 13.5px; }

/* Botão "ocupado" enquanto a ação AJAX está em andamento */
.btn.is-busy, button.is-busy { opacity: .6; cursor: progress; }
.is-submitting { opacity: .75; transition: opacity .15s ease; }

@media (max-width: 640px) {
  .toast-wrap { right: 12px; left: 12px; bottom: 12px; max-width: none; }
}

/* ---------- Tour guiado (apresentação do sistema) ---------- */
.tour-backdrop { position: fixed; inset: 0; background: rgba(8, 32, 37, .55); z-index: 4000; display: none; }
.tour-hl {
  position: fixed; z-index: 4001; border-radius: 10px; display: none; pointer-events: none;
  box-shadow: 0 0 0 100vmax rgba(8, 32, 37, .55), 0 0 0 3px rgba(249, 115, 22, .9), 0 0 18px rgba(249, 115, 22, .45);
  transition: top .25s ease, left .25s ease, width .25s ease, height .25s ease;
}
.tour-tip {
  position: fixed; z-index: 4002; display: none;
  width: min(350px, calc(100vw - 24px));
  background: var(--card); border-radius: 14px; padding: 16px 18px;
  box-shadow: 0 18px 50px rgba(2, 20, 25, .38);
}
.tour-tip.center { left: 50% !important; top: 50% !important; transform: translate(-50%, -50%); }
.tour-tip h3 { margin: 0 0 6px; font-size: 15.5px; }
.tour-tip p { margin: 0 0 12px; font-size: 13.5px; color: var(--text-2); line-height: 1.55; }
.tour-tip p b { color: var(--text); }
.tour-foot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tour-progress { font-size: 12px; color: var(--text-3); margin-right: auto; white-space: nowrap; }

/* ---------- Print (gerar relatório do chamado) ---------- */
@media print {
  .sidebar, .topbar, .page-actions, .no-print, .toast-wrap { display: none !important; }
  .content { padding: 0; }
  body { background: #fff; }
  .card { box-shadow: none; }
}