/* ==========================================================================
   MOVA SAC — Sistema de design
   Tokens · Base · Sidebar · Cabeçalho · Botões · Menu · Chamados
   ========================================================================== */
:root {
  color-scheme: light;

  /* Neutros */
  --ink: #241f1d;
  --ink-2: #4b423e;
  --muted: #7d726d;
  --subtle: #a89f9a;
  --line: #ece6e2;
  --line-strong: #ddd4cf;
  --paper: #ffffff;
  --canvas: #f7f5f3;
  --wash: #faf8f6;

  /* Marca */
  --brand: #F57601;
  --brand-dark: #c25a00;
  --brand-pale: #fff4ea;
  --brand-subtle: #ffe5cc;
  --brand-border: #f9cfa6;
  --brand-shadow: rgba(245, 118, 1, .28);

  /* Semântica */
  --green: #1f8a5b;
  --green-dark: #17694a;
  --green-pale: #e8f6ef;
  --amber: #b87314;
  --amber-pale: #fff5e3;
  --red: #c8372d;
  --red-pale: #fff0ee;
  --blue: #2f6fa8;
  --blue-pale: #eaf2fa;
  --violet: #6d58a3;
  --violet-pale: #f1edfa;
  --navy: #33425f;

  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --shadow-sm: 0 1px 2px rgba(36, 31, 29, .05);
  --shadow-md: 0 10px 30px rgba(36, 31, 29, .10);

  --font: "Plus Jakarta Sans", Inter, "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
  font-family: var(--font);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

* { box-sizing: border-box; }

body {
  min-width: 360px;
  margin: 0;
  color: var(--ink);
  background: var(--canvas);
  font-size: 14px;
  line-height: 1.45;
}

body.modal-open, html.modal-open { overflow: hidden !important; }

button, input, select, textarea { color: inherit; font: inherit; }
button, select, summary { cursor: pointer; }
a { color: inherit; }
h1, h2, h3, h4, p { margin-top: 0; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.app-shell { min-height: 100vh; }

/* ================= SIDEBAR ================= */
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 5;
  display: flex;
  width: 232px;
  flex-direction: column;
  gap: 4px;
  padding: 24px 14px 16px;
  border-right: 1px solid var(--line);
  background: var(--paper);
}

.brand {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2px 0 18px;
  text-decoration: none;
}
.brand-logo { max-width: 150px; max-height: 44px; width: auto; height: auto; object-fit: contain; display: block; }
.brand-logo-collapsed { display: none; width: 36px; height: 36px; object-fit: contain; }

.attendant-selector-box {
  margin: 0 0 18px;
  padding: 10px 12px 12px;
  background: var(--wash);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
}
.attendant-label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
}
.attendant-control-row { display: flex; gap: 6px; align-items: center; }
.attendant-select {
  flex: 1;
  min-width: 0;
  height: 32px;
  padding: 0 8px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  background: #fff;
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
}
.button-icon-small {
  display: inline-flex;
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  background: #fff;
  color: var(--brand);
  font-size: 17px;
  font-weight: 700;
  line-height: 1;
  transition: background .15s, border-color .15s;
}
.button-icon-small:hover { background: var(--brand-pale); border-color: var(--brand-border); }

.nav-caption { display: none; }
.primary-nav { display: grid; gap: 3px; }
.nav-link {
  display: flex;
  min-height: 42px;
  align-items: center;
  gap: 12px;
  padding: 0 12px;
  border-radius: 10px;
  color: var(--ink-2);
  font-size: 13.5px;
  font-weight: 550;
  text-decoration: none;
  transition: background .15s, color .15s;
}
.nav-link:hover { background: var(--wash); color: var(--ink); }
.nav-link.is-active { color: var(--brand-dark); background: var(--brand-pale); font-weight: 700; }
.nav-link.is-active svg { color: var(--brand); }

.nav-count {
  margin-left: auto;
  min-width: 24px;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--canvas);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-align: center;
}
.nav-link.is-active .nav-count { background: #fff; color: var(--brand-dark); }

.sidebar-bottom {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  padding: 14px 6px 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}
.connection-dot, .summary-dot {
  width: 8px; height: 8px; flex: 0 0 8px; border-radius: 50%; background: var(--green);
  box-shadow: 0 0 0 3px var(--green-pale);
}
.summary-dot { box-shadow: none; }
.button-logout {
  margin-left: auto;
  padding: 5px 10px;
  border: 0;
  border-radius: var(--r-sm);
  background: none;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  transition: color .15s, background .15s;
}
.button-logout:hover { color: var(--red); background: var(--red-pale); }

/* ================= ÍCONES SVG ================= */
svg { max-width: 100%; }
.nav-link svg, .button svg, .search-box svg, .menu-item svg {
  width: 18px; height: 18px; flex: 0 0 18px;
  fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8;
}
.button svg { width: 16px; height: 16px; flex-basis: 16px; }

.svg-icon {
  width: 16px !important; height: 16px !important; flex: 0 0 16px !important;
  max-width: 16px !important; max-height: 16px !important;
  display: inline-block !important; vertical-align: middle !important; stroke: currentColor;
}
.modal-header h2 svg, .modal-header h2 .svg-icon {
  width: 20px !important; height: 20px !important; flex: 0 0 20px !important; max-width: 20px !important; max-height: 20px !important;
}
.feedback-tab-btn svg, .feedback-tab-btn .svg-icon {
  width: 16px !important; height: 16px !important; flex: 0 0 16px !important; max-width: 16px !important; max-height: 16px !important;
}
.feedback-badge svg, .feedback-badge .svg-icon {
  width: 16px !important; height: 16px !important; flex: 0 0 16px !important; max-width: 16px !important; max-height: 16px !important;
  display: inline-block !important; vertical-align: middle !important; margin-right: 3px;
}
.btn-pin svg, .btn-pin .svg-icon {
  width: 14px !important; height: 14px !important; flex: 0 0 14px !important; max-width: 14px !important; max-height: 14px !important;
}

/* ================= BACKUP ================= */
.modal-backup { max-width: 540px; width: 90vw; }
.backup-gate-alert {
  background: #fef7ed; border: 1px solid #f97316; border-radius: var(--r-md);
  padding: 14px 16px; margin-bottom: 16px; color: #9a3412; font-size: 13px; line-height: 1.45;
}
.backup-gate-alert strong { display: block; font-size: 14px; margin-bottom: 4px; color: #c2410c; }
.backup-card { background: var(--wash); border: 1px solid var(--line); border-radius: var(--r-md); padding: 14px; margin: 14px 0; }
.backup-hash-badge {
  display: block; font-family: ui-monospace, Menlo, monospace; font-size: 11px; background: var(--canvas);
  padding: 6px 10px; border-radius: 6px; color: var(--ink-2); word-break: break-all; margin-top: 6px;
}
.backup-actions-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }

/* ================= CONTEÚDO / CABEÇALHO ================= */
.main-content {
  width: min(100% - 232px, 1560px);
  margin-left: 232px;
  padding: 30px clamp(22px, 3.4vw, 52px) 24px;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px 20px;
  margin-bottom: 22px;
}
.page-header h1 {
  margin: 0;
  font-size: clamp(26px, 2.2vw, 31px);
  font-weight: 750;
  letter-spacing: -.035em;
  line-height: 1.1;
}
.header-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; }

.overline { margin: 0 0 6px; color: var(--muted); font-size: 12px; font-weight: 600; }
.page-subtitle { margin: 0; color: var(--muted); font-size: 13px; }

/* ================= BOTÕES ================= */
.button {
  position: relative;
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 15px;
  border: 1px solid transparent;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 650;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s, box-shadow .15s, transform .1s;
}
.button:active { transform: translateY(1px); }

.button-primary {
  color: #fff;
  background: var(--brand);
  border-color: var(--brand);
  box-shadow: 0 4px 14px var(--brand-shadow);
}
.button-primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); }

.button-light {
  border-color: var(--line-strong);
  color: var(--ink-2);
  background: #fff;
  box-shadow: var(--shadow-sm);
}
.button-light:hover { border-color: var(--brand-border); color: var(--brand-dark); background: var(--brand-pale); }

.button-small { min-height: 34px; padding: 0 12px; font-size: 12px; }

.count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--red);
  color: #fff;
  font-size: 11px;
  font-weight: 750;
  line-height: 1;
  text-align: center;
  flex-shrink: 0;
  box-sizing: border-box;
  margin-left: 2px;
}

/* Menu "Mais" (details/summary, sem JS) */
.menu { position: relative; }
.menu > summary { list-style: none; }
.menu > summary::-webkit-details-marker { display: none; }
.menu > summary .chev { width: 14px; height: 14px; transition: transform .15s; }
.menu[open] > summary { border-color: var(--brand-border); color: var(--brand-dark); background: var(--brand-pale); }
.menu[open] > summary .chev { transform: rotate(180deg); }
.menu-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 30;
  min-width: 240px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: #fff;
  box-shadow: var(--shadow-md);
}
.menu-item {
  display: flex;
  width: 100%;
  min-height: 40px;
  align-items: center;
  gap: 11px;
  padding: 0 12px;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 550;
  text-align: left;
  text-decoration: none;
}
.menu-item:hover { background: var(--wash); color: var(--brand-dark); }
.menu-item svg { color: var(--muted); }
.menu-item:hover svg { color: var(--brand); }
.menu-sep { height: 1px; margin: 5px 6px; background: var(--line); }

.notice-host { position: fixed; top: 14px; right: 16px; z-index: 9999; }
.notice {
  max-width: min(440px, calc(100vw - 32px));
  padding: 12px 16px;
  border: 1px solid var(--brand-border);
  border-radius: var(--r-md);
  color: var(--brand-dark);
  background: var(--brand-pale);
  box-shadow: var(--shadow-md);
  font-size: 13px;
  font-weight: 550;
}
.notice.is-error { border-color: #f0d1cd; color: #963d38; background: #fff6f4; }

/* ================= SUPERFÍCIES ================= */
.surface, .metric-card {
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--paper);
}
.loading-copy, .empty-copy { margin: 14px 0; color: var(--subtle); font-size: 13px; }
.empty-state { padding: 48px 20px; color: var(--muted); font-size: 13px; text-align: center; }

.page-footer { padding: 22px 0 4px; color: var(--subtle); font-size: 12px; text-align: center; }
.page-footer span { padding: 0 4px; }

/* ================= STATUS ================= */
.status-pill {
  display: inline-flex;
  max-width: 100%;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: 999px;
  color: var(--ink-2);
  background: var(--canvas);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.status-pill::before { width: 6px; height: 6px; border-radius: 50%; background: var(--subtle); content: ""; }
.status-pill.status-new { color: #24517a; background: var(--blue-pale); }
.status-pill.status-new::before { background: var(--blue); }
.status-pill.status-analysis { color: #82590f; background: var(--amber-pale); }
.status-pill.status-analysis::before { background: #d49a2a; }
.status-pill.status-waiting { color: #54437c; background: var(--violet-pale); }
.status-pill.status-waiting::before { background: var(--violet); }
.status-pill.status-resolved { color: var(--green-dark); background: var(--green-pale); }
.status-pill.status-resolved::before { background: var(--green); }

/* ================= PÁGINA CHAMADOS ================= */
.ticket-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.ticket-summary > div {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-areas: "dot label" "num num";
  align-items: center;
  column-gap: 8px;
  row-gap: 4px;
  padding: 14px 18px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: #fff;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}
.ticket-summary > div > :nth-child(1) { grid-area: dot; }
.ticket-summary > div > :nth-child(2) { grid-area: label; }
.ticket-summary strong {
  grid-area: num;
  color: var(--ink);
  font-size: 30px;
  font-weight: 750;
  letter-spacing: -.04em;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.ticket-summary > div:last-child { border-color: #f3cdc7; background: linear-gradient(180deg, #fff 0%, var(--red-pale) 100%); }
.ticket-summary > div:last-child strong { color: var(--red); }
.ticket-summary > div:last-child > :nth-child(2) { color: var(--red); }

.dot-all { background: var(--ink-2); }
.dot-open { background: #d49a2a; }
.dot-resolved { background: var(--green); }
.dot-late { background: var(--red); }

.ticket-workspace { overflow: hidden; border-radius: var(--r-lg); }

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}
.search-box {
  display: flex;
  min-width: 240px;
  height: 40px;
  flex: 1 1 300px;
  align-items: center;
  gap: 9px;
  padding: 0 13px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--wash);
  color: var(--muted);
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.search-box:focus-within { border-color: var(--brand); background: #fff; box-shadow: 0 0 0 3px var(--brand-subtle); }
.search-box input { width: 100%; border: 0; outline: 0; background: transparent; font-size: 13.5px; }
.search-box input::placeholder { color: var(--subtle); }

.filter-select, .filter-date-input {
  height: 40px;
  max-width: 180px;
  padding: 0 34px 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  outline-color: var(--brand);
  color: var(--ink-2);
  background-color: #fff;
  font-size: 13px;
  font-weight: 550;
  transition: border-color .15s;
}
.filter-select:hover, .filter-select:focus { border-color: var(--brand-border); }

.field select, .filter-select, .detail-status, .status-select {
  appearance: none;
  background-image: url('data:image/svg+xml;utf8,<svg viewBox="0 0 24 24" fill="none" stroke="%23a89f9a" stroke-width="2.4" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><polyline points="6 9 12 15 18 9"></polyline></svg>');
  background-repeat: no-repeat;
  background-position: right 11px center;
  background-size: 14px;
  padding-right: 34px;
}

.ticket-results-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px 12px;
}
.ticket-results-heading p { margin: 0; color: var(--muted); font-size: 13px; font-weight: 550; }

.view-switch { display: flex; gap: 2px; padding: 3px; border-radius: 10px; background: var(--canvas); }
.view-switch button {
  padding: 7px 14px;
  border: 0;
  border-radius: 8px;
  color: var(--muted);
  background: transparent;
  font-size: 12.5px;
  font-weight: 600;
}
.view-switch button.is-selected { color: var(--brand-dark); background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .1); }

/* Tabela */
.ticket-table-wrap { overflow-x: auto; padding: 0 6px 8px; }
.ticket-table { width: 100%; border-collapse: collapse; text-align: left; }
.ticket-table th {
  height: 38px;
  padding: 0 12px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  white-space: nowrap;
}
.ticket-table td { padding: 10px 12px; border-top: 1px solid var(--line); color: var(--ink-2); font-size: 13.5px; vertical-align: middle; }
.ticket-table tbody tr:first-child td { border-top: 0; }
.ticket-table tbody tr:hover td { background: var(--wash); }

.customer-cell { display: flex; min-width: 180px; align-items: center; gap: 10px; }
.customer-avatar {
  display: grid; width: 34px; height: 34px; flex: 0 0 34px; place-items: center; border-radius: 50%;
  color: var(--brand-dark); background: var(--brand-pale); font-size: 12.5px; font-weight: 700;
}
.customer-info { min-width: 0; }
.customer-info strong, .customer-info small { display: block; max-width: 220px; word-wrap: break-word; }
.customer-info strong { color: var(--ink); font-size: 13.5px; font-weight: 650; }
.customer-info small { margin-top: 1px; color: var(--muted); font-size: 12px; }
.ticket-subject { max-width: 260px; color: var(--ink); word-wrap: break-word; }
.ticket-subject small { display: block; margin-top: 2px; color: var(--muted); font-size: 12px; }
.store-cell { max-width: 180px; word-wrap: break-word; }

.sla-warning { display: inline-flex; align-items: center; gap: 4px; margin-top: 4px; color: var(--red); font-size: 11.5px; font-weight: 700; }
.row-overdue td:first-child { box-shadow: inset 3px 0 var(--red); }

.icon-action {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; padding: 0; border: 0; border-radius: 8px;
  background: transparent; color: var(--muted); transition: background .15s, color .15s;
}
.icon-action:hover { color: var(--brand-dark); background: var(--brand-pale); }
.icon-action svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2; }
.icon-action-danger { color: var(--subtle); }
.icon-action-danger:hover { color: var(--red); background: var(--red-pale); }

.status-select {
  max-width: 150px;
  height: 32px;
  padding: 0 30px 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  color: var(--ink-2);
  background-color: #fff;
  font-size: 12.5px;
  font-weight: 550;
}

/* Quadro (kanban) — colunas rolam sozinhas, a página não estica */
.kanban-board {
  display: grid;
  grid-template-columns: repeat(4, minmax(240px, 1fr));
  gap: 12px;
  padding: 2px 16px 16px;
  overflow-x: auto;
  align-items: start;
}
.kanban-column {
  display: flex;
  flex-direction: column;
  min-height: 200px;
  max-height: calc(100vh - 310px);
  padding: 0 10px 6px;
  overflow-y: auto;
  border-top: 3px solid var(--subtle);
  border-radius: 12px;
  background: var(--canvas);
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}
.kanban-column:nth-child(1) { border-top-color: var(--blue); }
.kanban-column:nth-child(2) { border-top-color: #d49a2a; }
.kanban-column:nth-child(3) { border-top-color: var(--violet); }
.kanban-column:nth-child(4) { border-top-color: var(--green); }

.kanban-heading {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 -10px 8px;
  padding: 12px 12px 10px;
  background: var(--canvas);
}
.kanban-heading h3 { margin: 0; font-size: 13.5px; font-weight: 700; letter-spacing: -.01em; }
.kanban-heading span {
  display: grid; min-width: 24px; height: 24px; padding: 0 7px; place-items: center; border-radius: 999px;
  color: var(--ink-2); background: #fff; font-size: 12px; font-weight: 700; box-shadow: var(--shadow-sm);
}

.kanban-card {
  margin-bottom: 8px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: var(--shadow-sm);
  font-size: 12px;
  transition: box-shadow .15s, border-color .15s;
}
.kanban-card:hover { border-color: var(--line-strong); box-shadow: 0 6px 18px rgba(36, 31, 29, .08); }
.kanban-card.is-overdue { border-left: 3px solid var(--red); }
.kanban-card h4 {
  margin: 8px 0 6px;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.38;
  color: var(--ink);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.kanban-card p { margin: 0 0 4px; color: var(--muted); font-size: 12px; }
.kanban-card-actions {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 6px;
  margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line);
}
.kanban-card-actions .status-select { height: 30px; font-size: 12px; max-width: 128px; }

.kanban-stopwatch-pill {
  display: inline-flex; align-items: center; gap: 3px; margin-left: 6px; padding: 2px 8px; border-radius: 999px;
  color: var(--ink-2); background: var(--canvas); font-size: 11px; font-weight: 650; vertical-align: middle;
}
.kanban-stopwatch-pill svg { width: 11px; height: 11px; stroke: currentColor; }


/* ================= MODALS & DIALOGS ================= */
.modal {
  width: min(690px, calc(100% - 28px));
  max-height: min(92vh, 900px);
  padding: 0;
  overflow: auto;
  border: 0;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.3);
}
.modal::backdrop {
  background: rgba(30, 24, 22, 0.55);
  backdrop-filter: blur(3px);
}
.modal-narrow { width: min(480px, calc(100% - 28px)); }

.modal-content { padding: 25px; }
.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 20px;
}
.modal-header h2 { margin: 0; font-size: 21px; font-weight: 680; letter-spacing: -.03em; }
.modal-header p {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
}

.close-button {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  place-items: center;
  border: 0;
  border-radius: 6px;
  color: #786d67;
  background: #f4efec;
  font-size: 22px;
  transition: background .15s, color .15s;
}
.close-button:hover {
  background: var(--brand-pale);
  color: var(--brand);
}

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field { display: grid; gap: 6px; color: #625752; font-size: 12px; font-weight: 650; }
.field-full { grid-column: 1 / -1; }
.field input, .field select, .field textarea {
  width: 100%;
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid #dcd4d0;
  border-radius: 6px;
  outline-color: var(--brand);
  color: #372d28;
  background: #fff;
  font-size: 14px;
  transition: border-color .15s, box-shadow .15s;
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-subtle);
}

.field textarea { resize: vertical; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.form-error { min-height: 16px; margin: 9px 0 0; color: #a53e38; font-size: 12px; }

.repeat-alert {
  margin-top: 14px;
  padding: 11px;
  border: 1px solid #f0dba8;
  border-radius: 6px;
  color: #715417;
  background: #fff9eb;
  font-size: 11px;
}
.repeat-alert ul { margin: 7px 0 0; padding-left: 17px; line-height: 1.8; }

/* ================= MODAL DETAIL & SPLIT SCREEN ================= */
.modal-detail {
  width: min(840px, calc(100% - 28px));
  max-width: 840px;
  max-height: min(94vh, 920px);
  padding: 0;
  overflow: hidden;
  transition: max-width 0.25s cubic-bezier(0.16, 1, 0.3, 1), width 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-detail.is-split {
  width: min(1440px, calc(100% - 24px));
  max-width: 1440px;
}

.split-container {
  display: flex;
  width: 100%;
  max-height: min(94vh, 920px);
  overflow: hidden;
}

.split-left {
  flex: 1 1 100%;
  min-width: 0;
  max-height: min(94vh, 920px);
  overflow-y: auto;
  overflow-x: hidden;
  padding: 26px;
  background: #fff;
}

.modal-detail.is-split .split-left {
  flex: 1 1 52%;
  border-right: 1px solid var(--line);
}

.split-right {
  display: none;
  flex: 1 1 48%;
  min-width: 0;
  max-height: min(94vh, 920px);
  overflow-y: auto;
  overflow-x: hidden;
  padding: 26px;
  background: #fbf9f8;
}

.modal-detail.is-split .split-right {
  display: flex;
  flex-direction: column;
}

.detail-client {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 16px;
  border: 1px solid #ebe4e0;
  border-radius: 8px;
  background: #faf7f5;
}

.detail-person { display: flex; min-width: 0; align-items: center; gap: 12px; }
.detail-avatar {
  display: grid;
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  place-items: center;
  border-radius: 50%;
  color: var(--brand);
  background: var(--brand-pale);
  border: 1px solid var(--brand-border);
  font-size: 15px;
  font-weight: 750;
}
.detail-person h3 { margin: 0 0 5px; font-size: 15px; font-weight: 680; }
.detail-person p { margin: 0; color: #877b75; font-size: 11px; }

.whatsapp-button {
  color: #fff;
  background: #25744e;
  border-color: #25744e;
}
.whatsapp-button:hover {
  background: #1c5b3d;
  border-color: #1c5b3d;
}

.btn-rede-split {
  color: #fff;
  background: var(--brand);
  border-color: var(--brand);
}
.btn-rede-split:hover {
  background: var(--brand-dark);
  border-color: var(--brand-dark);
}
.btn-rede-split.is-active {
  background: #4a413d;
  border-color: #4a413d;
}

.detail-contact-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 16px 0 20px;
}

.contact-item {
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid #ece4e0;
  border-radius: 8px;
  background: #fff;
}
.contact-item span {
  display: block;
  margin-bottom: 6px;
  color: #988c86;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
}

.contact-copy-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.contact-copy-row strong {
  display: block;
  color: #372d28;
  font-size: 13px;
  font-weight: 650;
  word-break: break-all;
}

.copy-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  padding: 0;
  border: 1px solid #e2dad6;
  border-radius: 6px;
  background: #fff;
  color: #8c807b;
  cursor: pointer;
  transition: all .15s ease;
}
.copy-btn:hover {
  color: var(--brand);
  border-color: var(--brand-border);
  background: var(--brand-pale);
}
.copy-btn.copied {
  color: #238258;
  border-color: #a8dfc4;
  background: #ebf7f0;
}
.copy-btn svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.detail-section { margin-top: 20px; }
.detail-section h3 {
  margin: 0 0 10px;
  color: #6e625c;
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0;
  text-transform: none;
}
.detail-description {
  margin: 0;
  padding: 16px;
  border-radius: 8px;
  color: #443a35;
  background: #faf7f5;
  border: 1px solid #ede5e1;
  font-size: 13px;
  line-height: 1.65;
  white-space: pre-wrap;
}

.detail-meta {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.detail-meta .contact-item { min-width: 0; }
.detail-status {
  width: 100%;
  min-width: 0;
  padding: 10px;
  border: 1px solid #dcd4d0;
  border-radius: 6px;
  background: #fff;
  font-size: 12px;
}

/* ================= CENTRAL DE FEEDBACK ================= */
.feedback-center {
  margin-top: 22px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  overflow: hidden;
}
.feedback-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  background: #faf7f5;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.feedback-tabs {
  display: flex;
  gap: 6px;
}
.feedback-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #7d716c;
  font-size: 12px;
  font-weight: 650;
  transition: all .15s ease;
}
.feedback-tab-btn:hover {
  color: var(--ink);
  background: rgba(0, 0, 0, 0.04);
}
.feedback-tab-btn.is-active {
  color: var(--brand);
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}
.feedback-panel-body {
  padding: 18px;
}
.feedback-panel-body textarea {
  width: 100%;
  min-height: 90px;
  padding: 12px;
  border: 1px solid #dcd4d0;
  border-radius: 6px;
  outline-color: var(--brand);
  font-size: 13px;
  line-height: 1.5;
  box-sizing: border-box;
}
.feedback-panel-body textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-subtle);
}

.feedback-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  margin-bottom: 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  color: #2b2523;
  background: #f4efec;
  border: 1px solid #e5deda;
}
.feedback-badge strong { color: var(--brand); }

/* ================= PAINEL LATERAL: FEEDBACK REDE (E-MAIL) ================= */
.network-panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 18px;
}
.network-panel-header h3 {
  margin: 0 0 4px;
  color: var(--brand);
  font-size: 15px;
  font-weight: 750;
  letter-spacing: -.01em;
}
.network-panel-header p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
}

.pinned-group {
  display: flex;
  gap: 6px;
  align-items: center;
}
.pinned-group input {
  flex: 1;
}

.btn-pin {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 11px 12px;
  border: 1px solid #dcd4d0;
  border-radius: 6px;
  background: #fff;
  color: #7d716c;
  font-size: 11px;
  font-weight: 650;
  white-space: nowrap;
  transition: all .15s ease;
}
.btn-pin:hover {
  border-color: var(--brand-border);
  color: var(--brand);
  background: var(--brand-pale);
}
.btn-pin.is-pinned {
  border-color: var(--brand);
  color: #fff;
  background: var(--brand);
}

.network-form-grid {
  display: grid;
  gap: 14px;
}

.network-emails-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 520px;
  overflow-y: auto;
  padding-right: 4px;
  margin-bottom: 16px;
}

.network-sent-card {
  padding: 16px;
  border: 1px solid #cce2d6;
  border-radius: 8px;
  background: #f2f9f5;
  color: #1a5637;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.network-sent-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.network-sent-header h4 {
  margin: 0;
  color: #145934;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
}
.sent-timestamp {
  font-size: 11px;
  color: #2b744b;
  font-weight: 600;
}
.sent-body-preview {
  font-size: 11px;
  line-height: 1.5;
  color: #24583b;
  background: rgba(255, 255, 255, 0.7);
  padding: 10px;
  border-radius: 6px;
  border: 1px solid #d5ebd0;
  max-height: 100px;
  overflow-y: auto;
  white-space: pre-wrap;
}
.sent-card-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  margin-top: 4px;
}
.network-panel-bottom-actions {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.network-sent-card svg,
.network-sent-card h4 svg {
  width: 15px !important;
  height: 15px !important;
  flex: 0 0 15px !important;
  fill: none !important;
  stroke: currentColor !important;
  stroke-width: 2.5 !important;
  stroke-linecap: round !important;
  stroke-linejoin: round !important;
  display: inline-block !important;
  vertical-align: middle !important;
}
.sent-check-circle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  border-radius: 50%;
  background: #238258;
  color: #fff;
  box-shadow: 0 2px 5px rgba(35, 130, 88, 0.25);
}
.sent-check-circle svg {
  width: 12px !important;
  height: 12px !important;
  flex: 0 0 12px !important;
  stroke: #ffffff !important;
  fill: none !important;
  stroke-width: 3 !important;
}
.network-sent-meta {
  font-size: 11px;
  line-height: 1.5;
  color: #316d4c;
}
.network-sent-meta p {
  margin: 3px 0;
}

/* ================= MODAL DE CONFIRMAÇÃO DE E-MAIL ================= */
.modal-email-confirm {
  width: min(680px, calc(100% - 24px));
}
.email-preview-box {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
  margin: 16px 0;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.04);
}
.email-preview-head {
  padding: 16px;
  background: #faf7f5;
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 8px;
  font-size: 12px;
}
.email-preview-row {
  display: flex;
  gap: 8px;
}
.email-preview-row span {
  width: 75px;
  flex: 0 0 75px;
  color: #8c807a;
  font-weight: 750;
  text-transform: none;
  font-size: 11px;
}
.email-preview-row strong {
  color: #352c28;
  word-break: break-all;
}
.email-preview-text {
  padding: 20px;
  color: #372d28;
  font-size: 13px;
  line-height: 1.7;
  white-space: pre-wrap;
  background: #fff;
  max-height: 280px;
  overflow-y: auto;
}

.outlook-cc-tip {
  margin: 12px 0 16px;
  padding: 11px 14px;
  border-radius: 6px;
  background: #fef7ed;
  border: 1px solid #fed7aa;
  color: #9a3412;
  font-size: 11px;
  line-height: 1.5;
}
.outlook-cc-tip svg {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  stroke: currentColor;
}

/* ================= MODAL DE CONFIRMAÇÃO DE DISPARO (3 OPÇÕES) ================= */
.modal-dispatch-status {
  width: min(540px, calc(100% - 24px));
}
.dispatch-status-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 12px;
}
.dispatch-status-icon-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  background: var(--brand-pale);
  border: 1px solid var(--brand-border);
  border-radius: 8px;
}
.dispatch-icon-circle {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}
.dispatch-icon-circle svg {
  width: 20px;
  height: 20px;
  stroke: #fff;
}
.dispatch-status-icon-banner h3 {
  margin: 0 0 4px;
  font-size: 14px;
  color: var(--brand-dark);
}
.dispatch-status-icon-banner p {
  margin: 0;
  font-size: 12px;
  color: #6a5d57;
  line-height: 1.4;
}
.dispatch-summary-box {
  padding: 12px;
  border-radius: 6px;
  background: #fbf9f8;
  border: 1px solid var(--line);
  font-size: 12px;
  line-height: 1.5;
}
.dispatch-summary-box p {
  margin: 4px 0;
  color: #4b3e39;
}
.dispatch-info-text {
  margin: 0;
  font-size: 12px;
  color: #726762;
  line-height: 1.5;
}
.dispatch-action-group {
  display: flex;
  flex-direction: row;
  gap: 10px;
  margin-top: 10px;
}
.btn-dispatch-opt {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  text-align: center !important;
  padding: 12px 14px !important;
  border-radius: 8px !important;
  gap: 8px !important;
  cursor: pointer;
  transition: all .15s ease !important;
  flex: 1 1 0 !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  white-space: nowrap !important;
}
.btn-dispatch-opt svg {
  width: 16px !important;
  height: 16px !important;
  flex: 0 0 16px !important;
  stroke: currentColor !important;
}
.button-success {
  background: #238258 !important;
  border: 1px solid #1a6d47 !important;
  color: #fff !important;
  box-shadow: 0 2px 6px rgba(35, 130, 88, 0.25);
}
.button-success:hover {
  background: #1c6d47 !important;
}
.button-danger-light {
  background: #fff5f5 !important;
  border: 1px solid #fecaca !important;
  color: #b91c1c !important;
}
.button-danger-light:hover {
  background: #fee2e2 !important;
  border-color: #f87171 !important;
}
.button-edit-opt {
  background: #fff !important;
  border: 1px solid #dcd4d0 !important;
  color: #3f3632 !important;
}
.button-edit-opt:hover {
  background: #fbf9f8 !important;
  border-color: var(--brand-border) !important;
  color: var(--brand) !important;
}

@media (max-width: 540px) {
  .dispatch-action-group {
    flex-direction: column;
  }
}

.btn-clear-history {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 9px;
  font-size: 11px;
  font-weight: 600;
  color: #b91c1c;
  background: #fff5f5;
  border: 1px solid #fecaca;
  border-radius: 5px;
  cursor: pointer;
  transition: all .15s ease;
}
.btn-clear-history:hover {
  background: #fee2e2;
  border-color: #f87171;
}
.btn-clear-history svg {
  width: 13px !important;
  height: 13px !important;
  stroke: #b91c1c !important;
}
.btn-delete-single-email {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  color: #b91c1c;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: 0.65;
  transition: all .15s ease;
}
.btn-delete-single-email:hover {
  opacity: 1;
  background: #fee2e2;
}
.btn-delete-single-email svg {
  width: 14px !important;
  height: 14px !important;
  stroke: #b91c1c !important;
}

.kanban-stopwatch-pill {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 1px 7px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  color: #726762;
  background: #f0ece9;
  margin-left: 6px;
  vertical-align: middle;
}
.kanban-stopwatch-pill svg {
  width: 11px;
  height: 11px;
  stroke: currentColor;
}

/* ================= CRONÔMETRO DE STATUS ================= */
.ticket-title-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.status-stopwatch-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 11px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0;
  background: var(--brand-pale);
  color: var(--brand-dark);
  border: 1px solid var(--brand-border);
}
.status-stopwatch-badge.status-resolved {
  background: #ebf7f0;
  color: #196644;
  border-color: #c3e6d2;
}
.status-stopwatch-badge.status-analysis {
  background: #fff5df;
  color: #88611d;
  border-color: #f7dfa8;
}
.status-stopwatch-badge.status-waiting {
  background: #f1edfa;
  color: #554477;
  border-color: #dacff5;
}

.stopwatch-pulse {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 0 rgba(224, 72, 34, 0.6);
  animation: pulse-ring 2s infinite;
}
@keyframes pulse-ring {
  0% { transform: scale(0.9); opacity: 0.95; }
  50% { transform: scale(1.35); opacity: 0.45; }
  100% { transform: scale(0.9); opacity: 0.95; }
}

.stopwatch-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.08);
  color: inherit;
  cursor: pointer;
  transition: all .15s ease;
}
.stopwatch-icon-btn:hover {
  background: rgba(0, 0, 0, 0.18);
  transform: scale(1.1);
}
.stopwatch-icon-btn svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  fill: none;
}

.stopwatch-summary-card {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 14px;
  background: #faf7f5;
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-bottom: 16px;
}
.stopwatch-summary-item span {
  display: block;
  font-size: 11px;
  text-transform: none;
  color: var(--muted);
  font-weight: 700;
  margin-bottom: 4px;
}
.stopwatch-summary-item strong {
  display: block;
  font-size: 16px;
  color: var(--ink);
}
.stopwatch-summary-item small {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-top: 3px;
}
.stopwatch-current-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 13px !important;
  font-weight: 750 !important;
  background: #fff;
  border: 1px solid var(--line);
}

.stopwatch-status-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.stopwatch-status-card {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.stopwatch-status-card.is-active-status {
  border-color: var(--brand);
  background: var(--brand-pale);
  box-shadow: 0 0 0 1px var(--brand);
}
.stopwatch-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.status-live-tag {
  font-size: 11px;
  font-weight: 750;
  text-transform: none;
  color: var(--brand);
  background: #fff;
  padding: 2px 6px;
  border-radius: 10px;
  border: 1px solid var(--brand-border);
}
.stopwatch-card-time {
  display: block;
  font-size: 15px;
  color: var(--ink);
  font-weight: 700;
}
.stopwatch-card-pct {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}

.stopwatch-timeline-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 190px;
  overflow-y: auto;
  padding: 4px 6px 4px 2px;
}
.timeline-step-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  position: relative;
}
.timeline-marker {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #b0a7a2;
  margin-top: 5px;
  flex: 0 0 9px;
}
.timeline-marker.is-current {
  background: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-subtle);
}
.timeline-content {
  flex: 1;
}
.timeline-head {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
}
.timeline-duration {
  font-weight: 700;
  color: var(--brand-dark);
}
.timeline-dates {
  font-size: 11px;
  color: var(--muted);
}


/* ================= LOADING SPINNER COM O MOVA SAQ ================= */
@keyframes movaLogoSpin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

@keyframes movaPopIn {
  from {
    transform: scale(0.92);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.mova-loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 999999;
  background: rgba(30, 24, 22, 0.68);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity .25s ease, visibility .25s ease;
}

.mova-loading-overlay.is-active {
  opacity: 1;
  visibility: visible;
}

.mova-loading-box {
  background: #ffffff;
  border-radius: 16px;
  padding: 34px 30px;
  text-align: center;
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(220, 212, 208, 0.6);
  width: min(340px, 90vw);
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: movaPopIn .2s cubic-bezier(0.16, 1, 0.3, 1);
}

.mova-spinner-logo {
  width: 68px;
  height: 68px;
  object-fit: contain;
  animation: movaLogoSpin 1.1s linear infinite;
  display: block;
  margin: 0 auto 16px;
  filter: drop-shadow(0 4px 12px rgba(224, 72, 34, 0.25));
}

.mova-loading-box h3 {
  margin: 0 0 6px;
  font-size: 16px;
  font-weight: 750;
  color: #2b2523;
  letter-spacing: -.01em;
}

.mova-loading-box p {
  margin: 0;
  font-size: 12px;
  color: #7d726d;
  line-height: 1.45;
}


/* ==========================================================================
   VISÃO GERAL — filtros, abas, KPIs, gráficos, modo reunião
   ========================================================================== */

/* ---- Barra de filtros ---- */
.dashboard-filter-bar {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 18px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--paper);
}
.filter-group { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.filter-item { display: flex; align-items: center; }
.filter-item label {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.filter-item .filter-select { height: 38px; max-width: none; padding-left: 11px; font-size: 12.5px; }
.filter-item.is-period .filter-select { font-weight: 700; color: var(--ink); background-color: var(--wash); }
.custom-dates { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; }
.filter-date-input { height: 38px; padding: 0 10px; }
.button-ghost {
  min-height: 38px; padding: 0 12px; border: 0; border-radius: 10px; background: none;
  color: var(--muted); font-size: 13px; font-weight: 600;
}
.button-ghost:hover { color: var(--brand-dark); background: var(--brand-pale); }

/* ---- Abas + visões salvas ---- */
.bi-bar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--line);
}
.bi-tabs-nav { display: flex; gap: 2px; margin: 0; overflow-x: auto; scrollbar-width: none; }
.bi-tabs-nav::-webkit-scrollbar { display: none; }
.bi-tab-btn {
  position: relative;
  padding: 12px 16px;
  border: 0;
  border-radius: 10px 10px 0 0;
  background: none;
  color: var(--muted);
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;
  transition: color .15s, background .15s;
}
.bi-tab-btn:hover { color: var(--ink); background: var(--wash); }
.bi-tab-btn.is-active { color: var(--brand-dark); font-weight: 700; background: none; }
.bi-tab-btn.is-active::after {
  content: ""; position: absolute; left: 12px; right: 12px; bottom: -1px; height: 3px; border-radius: 3px 3px 0 0; background: var(--brand);
}
.saved-views { display: flex; align-items: center; gap: 8px; padding-bottom: 8px; }
.saved-views .filter-select { height: 36px; min-width: 180px; font-size: 12.5px; }
.active-view-tag { color: var(--brand-dark); font-size: 12px; font-weight: 650; }
.active-view-tag:empty { display: none; }

/* ---- KPIs em faixa única ---- */
.metric-grid-6, .metric-strip {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 1px;
  margin-bottom: 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--line);
}
.metric-strip.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.metric-strip.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.metric-grid-6 .metric-card, .metric-strip .metric-card {
  display: flex;
  min-height: 0;
  flex-direction: column;
  gap: 6px;
  padding: 18px 20px 16px;
  border: 0;
  border-radius: 0;
  background: var(--paper);
}
.metric-label { display: block; color: var(--muted); font-size: 12.5px; font-weight: 600; line-height: 1.3; }
.metric-card > strong {
  display: block;
  margin: 0;
  color: var(--ink);
  font-size: 34px;
  font-weight: 750;
  letter-spacing: -.045em;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
}
.metric-card > strong.is-amber { color: var(--amber); }
.metric-card > strong.is-green { color: var(--green); }
.metric-card > strong.is-red { color: var(--red); }
.metric-card > strong.is-violet { color: var(--violet); }
.metric-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin-top: 2px; }
.metric-variation {
  display: inline-flex; align-items: center; gap: 3px; padding: 2px 7px; border-radius: 6px;
  font-size: 11.5px; font-weight: 700; line-height: 1.3; white-space: nowrap;
}
.metric-variation.is-good { color: var(--green-dark); background: var(--green-pale); }
.metric-variation.is-bad { color: var(--red); background: var(--red-pale); }
.metric-variation.is-neutral { color: var(--muted); background: var(--canvas); }
.metric-subtext, .metric-card > small { display: block; margin: 0; color: var(--subtle); font-size: 11.5px; line-height: 1.35; }
.metric-card-alert { background: linear-gradient(180deg, #fff 55%, var(--red-pale) 100%) !important; }

/* ---- Painéis ---- */
.executive-charts-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.chart-panel { min-height: 0; padding: 22px 24px; }
.chart-panel-executive { padding: 22px 24px; }
.section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 4px; }
.section-heading h2 { margin: 0; font-size: 16px; font-weight: 700; letter-spacing: -.02em; }
.section-note { margin: 4px 0 0; color: var(--muted); font-size: 12.5px; }
.quiet-link { color: var(--brand-dark); font-size: 12.5px; font-weight: 650; text-decoration: none; white-space: nowrap; }
.quiet-link:hover { text-decoration: underline; }

/* ---- Rankings ---- */
.rank-list { display: flex; flex-direction: column; gap: 2px; margin-top: 14px; }
.rank-item {
  display: grid;
  grid-template-columns: 22px minmax(170px, 1.7fr) minmax(70px, .8fr) 84px;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  border-radius: 10px;
  text-decoration: none;
  cursor: pointer;
  transition: background .12s;
}
.rank-item:hover { background: var(--wash); }
.rank-index { color: var(--subtle); font-size: 12px; font-weight: 700; text-align: center; font-variant-numeric: tabular-nums; }
.rank-item:nth-child(-n+3) .rank-index { color: var(--brand); }
.rank-title-box { display: flex; align-items: center; gap: 8px; min-width: 0; }
.rank-badge {
  flex-shrink: 0; padding: 2px 6px; border-radius: 5px; color: #FFF; background: var(--brand-pale);
  font-size: 11px; font-weight: 700;
}
.rank-name { overflow: hidden; color: var(--ink); font-size: 13px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.rank-city { margin-left: 4px; color: var(--muted); font-size: 12px; font-weight: 400; }
.rank-track { position: relative; height: 8px; overflow: hidden; border-radius: 999px; background: var(--canvas); }
.rank-fill { height: 100%; border-radius: 999px; background: var(--brand); transition: width .4s ease-out; }
.rank-fill-store { background: var(--navy); }
.rank-metrics { text-align: right; white-space: nowrap; }
.rank-count { color: var(--ink); font-size: 13.5px; font-weight: 750; font-variant-numeric: tabular-nums; }
.rank-share { margin-left: 5px; color: var(--muted); font-size: 12px; font-weight: 600; }

/* ---- Evolução no tempo ---- */
.time-evolution-panel { margin-bottom: 16px; }
.time-chart-legend { display: flex; align-items: center; gap: 16px; color: var(--muted); font-size: 12.5px; font-weight: 550; }
.legend-item { display: flex; align-items: center; gap: 7px; }
.legend-color-curr, .legend-color-prev { width: 10px; height: 10px; border-radius: 3px; background: var(--brand); }
.legend-color-prev { background: #d8cfca; }
.time-bars-chart {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 6px;
  height: 220px;
  margin-top: 16px;
  padding: 12px 0 28px;
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
  background: repeating-linear-gradient(to top, transparent 0, transparent calc(25% - 1px), var(--line) calc(25% - 1px), var(--line) 25%);
  background-origin: content-box;
}
.time-bar-group { position: relative; display: flex; flex: 1 1 0; min-width: 26px; max-width: 76px; height: 100%; flex-direction: column; align-items: center; justify-content: flex-end; }
.time-bars-pair { display: flex; width: 100%; height: 100%; align-items: flex-end; justify-content: center; gap: 3px; }
.tbar { width: 38%; max-width: 18px; min-height: 3px; border-radius: 5px 5px 0 0; transition: height .3s ease-out; }
.tbar-curr { background: var(--brand); }
.tbar-prev { background: #d8cfca; }
.time-bar-label { position: absolute; bottom: -22px; color: var(--muted); font-size: 11px; white-space: nowrap; font-variant-numeric: tabular-nums; }

/* ---- Chamados recentes ---- */
.recent-panel { padding: 22px 24px 8px; }
.recent-list { margin-top: 12px; }
.recent-row {
  display: grid;
  grid-template-columns: 70px minmax(150px, 1.1fr) minmax(90px, .7fr) minmax(180px, 1.6fr) 120px;
  align-items: center;
  gap: 14px;
  min-height: 60px;
  padding: 10px 8px;
  border-top: 1px solid var(--line);
  border-radius: 0;
  font-size: 13px;
  transition: background .12s;
}
.recent-row:hover { background: var(--wash); }
.recent-id { color: var(--muted); font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; }
.recent-person, .recent-subject { min-width: 0; }
.recent-person strong, .recent-person small, .recent-subject strong, .recent-subject small { display: block; word-wrap: break-word; }
.recent-person strong, .recent-subject strong { color: var(--ink); font-size: 13.5px; font-weight: 600; }
.recent-person small, .recent-subject small { margin-top: 2px; color: var(--muted); font-size: 12px; }
.recent-store { color: var(--ink-2); word-wrap: break-word; }
.recent-row .status-pill { justify-self: end; }

/* ---- Tabelas geradas pelo app.js (lojas, atendentes, relatório, compliance) ---- */
#all-stores-table-container table, #attendant-productivity-table table, #monthly-report-body table,
#compliance-breakdown-container table, #meeting-mom-table-container table, .mom-table {
  width: 100%; border-collapse: collapse; font-size: 13px;
}
#all-stores-table-container th, #attendant-productivity-table th, #monthly-report-body th,
#compliance-breakdown-container th, #meeting-mom-table-container th, .mom-table th {
  position: sticky; top: 0; padding: 10px 12px; border-bottom: 1px solid var(--line); background: #fff;
  color: var(--muted); font-size: 12px; font-weight: 650; text-align: left; white-space: nowrap;
}
#all-stores-table-container td, #attendant-productivity-table td, #monthly-report-body td,
#compliance-breakdown-container td, #meeting-mom-table-container td, .mom-table td {
  padding: 11px 12px; border-bottom: 1px solid var(--line); color: var(--ink-2); font-variant-numeric: tabular-nums;
}
#all-stores-table-container tbody tr:hover td, #attendant-productivity-table tbody tr:hover td, .mom-table tbody tr:hover td { background: var(--wash); }

/* ---- Macrotemas (treemap) ---- */
.treemap-container { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; margin-top: 16px; }
.treemap-macro-card { padding: 16px; border: 1px solid var(--line); border-left: 4px solid var(--brand); border-radius: var(--r-md); background: #fff; }
.treemap-macro-header { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--line); font-weight: 650; }
.treemap-sub-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.treemap-sub-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border: 1px solid transparent; border-radius: 8px;
  background: var(--canvas); color: var(--ink); font-size: 12.5px; text-decoration: none; transition: background .15s, border-color .15s;
}
.treemap-sub-chip:hover { background: var(--brand-pale); border-color: var(--brand-border); }

/* ---- SLA: medidor em anel ---- */
.gauge { --pct: 0; --target: 85; --gauge-color: var(--brand); position: relative; width: 210px; aspect-ratio: 1; margin: 14px auto 6px; }
.gauge.is-ok { --gauge-color: var(--green); }
.gauge.is-low { --gauge-color: var(--amber); }
.gauge-ring {
  position: absolute; inset: 0; border-radius: 50%;
  background: conic-gradient(var(--gauge-color) calc(var(--pct) * 1%), var(--canvas) 0);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 18px), #000 calc(100% - 17px));
          mask: radial-gradient(farthest-side, transparent calc(100% - 18px), #000 calc(100% - 17px));
}
.gauge-mark { display: none; }
.gauge-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.gauge-center strong { color: var(--ink); font-size: 44px; font-weight: 750; letter-spacing: -.05em; line-height: 1; font-variant-numeric: tabular-nums; }
.gauge-center span { margin-top: 6px; color: var(--muted); font-size: 12.5px; font-weight: 600; }

/* ---- Modo reunião ---- */
body.is-meeting-mode .sidebar { display: none !important; }
body.is-meeting-mode .main-content { width: 100% !important; max-width: 100% !important; margin-left: 0 !important; padding: 22px 44px !important; }
.meeting-header-bar { display: none; }
body.is-meeting-mode .meeting-header-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px;
  padding: 14px 24px; border: 1px solid var(--line); border-radius: var(--r-lg); background: #fff; box-shadow: var(--shadow-md);
}
.meeting-brand { display: flex; align-items: center; gap: 16px; }
.meeting-brand img { height: 36px; }
.meeting-brand h2 { margin: 0; font-size: 17px; font-weight: 750; letter-spacing: -.02em; }
.meeting-brand p { margin: 2px 0 0; color: var(--muted); font-size: 12.5px; }
.meeting-actions { display: flex; align-items: center; gap: 10px; }
body.is-meeting-mode .metric-card { padding: 22px 24px; }
body.is-meeting-mode .metric-card > strong { font-size: 42px; }

.meeting-takeaway-banner {
  display: flex; align-items: center; gap: 18px; margin-bottom: 20px; padding: 20px 26px;
  border: 1px solid var(--brand-border); border-left: 6px solid var(--brand); border-radius: var(--r-lg);
  background: linear-gradient(90deg, var(--brand-pale), #fff 70%); box-shadow: var(--shadow-sm);
}
.meeting-takeaway-tag { color: var(--brand-dark); font-size: 12.5px; font-weight: 700; }
.meeting-takeaway-text { margin: 4px 0 0; color: var(--ink); font-size: 17px; font-weight: 650; line-height: 1.45; letter-spacing: -.01em; }
.meeting-section { margin-bottom: 20px; }

.anomalies-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; margin-top: 14px; }
.anomaly-card { padding: 14px 16px; border: 1px solid #fcd9b8; border-left: 4px solid var(--brand); border-radius: var(--r-md); background: #fff; }
.anomaly-title-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; gap: 8px; }
.anomaly-surge-badge { padding: 2px 8px; border-radius: 6px; color: var(--brand-dark); background: var(--brand-pale); font-size: 12px; font-weight: 750; }

.pareto-list { margin-top: 14px; }
.badge-pareto-a, .badge-pareto-b, .badge-pareto-c { margin-left: 6px; padding: 2px 7px; border-radius: 6px; font-size: 11px; font-weight: 700; }
.badge-pareto-a { color: #9b1f1f; background: #fee2e2; }
.badge-pareto-b { color: #92400e; background: #fef3c7; }
.badge-pareto-c { color: #4b5563; background: #f3f4f6; }

/* ---- Compliance ---- */
.chart-panel.is-critical { border-left: 4px solid var(--red); }

/* ---- Impressão ---- */
@media print {
  .sidebar, .dashboard-filter-bar, .bi-bar, .header-actions, .meeting-header-bar, .quiet-link, .modal, .menu { display: none !important; }
  .main-content { width: 100% !important; margin: 0 !important; padding: 0 !important; }
  .metric-grid-6, .metric-strip, .surface { border: 1px solid #ccc !important; box-shadow: none !important; break-inside: avoid; }
  body { background: #fff !important; color: #000 !important; }
}


/* ==========================================================================
   FASE 6 — OPERAÇÃO, MODO LIGAÇÃO, RECLASSIFICAÇÃO E ADMIN
   ========================================================================== */

.modal-wide {
  max-width: 860px;
  width: 92vw;
}

/* Modo Ligação (Atendimento Telefônico Rápido) */
.call-mode-search-box {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}

.call-mode-input {
  flex: 1;
  padding: 12px 14px;
  font-size: 15px;
  border: 1px solid #dcd4d0;
  border-radius: 6px;
  outline-color: var(--brand);
}

.customer-history-card {
  background: #fdfbf9;
  border: 1px solid #ebdcd5;
  border-radius: 8px;
  padding: 14px 16px;
  margin-bottom: 16px;
}

.customer-history-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  border-bottom: 1px solid #eee5e0;
  padding-bottom: 8px;
}

.customer-history-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
}

.customer-past-ticket {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid #f2ece8;
  font-size: 12px;
}

.customer-past-ticket:last-child {
  border-bottom: none;
}

/* Fila de Reclassificação em Massa */
.reclassify-queue-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  margin-top: 10px;
}

.reclassify-queue-table th {
  background: #f7f3f1;
  padding: 8px 10px;
  text-align: left;
  font-weight: 650;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
}

.reclassify-queue-table td {
  padding: 8px 10px;
  border-bottom: 1px solid #f2ece8;
}

.reclassify-batch-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: #fdf2ee;
  border: 1px solid var(--brand-border);
  border-radius: 6px;
  padding: 10px 14px;
  margin-top: 14px;
}

/* Admin de Catálogos e Temas */
.admin-tabs-nav {
  display: flex;
  gap: 6px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 16px;
}

.admin-tab-btn {
  padding: 8px 14px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
}

.admin-tab-btn.is-active {
  color: var(--brand);
  border-bottom-color: var(--brand);
}

.admin-list-container {
  max-height: 380px;
  overflow-y: auto;
  border: 1px solid #ebe4e1;
  border-radius: 6px;
}

.admin-list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid #f2ece8;
  font-size: 12.5px;
}

.admin-list-row:last-child {
  border-bottom: none;
}

/* Notificações e Feed de Alertas de SLA */
.notif-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 420px;
  overflow-y: auto;
  padding: 4px 2px;
}

.notif-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px 14px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid var(--line);
  cursor: pointer;
  transition: all 0.2s ease;
}

.notif-item:hover {
  border-color: var(--brand);
  background: #faf6f4;
}

.notif-item.is-unread {
  border-left: 4px solid var(--brand);
  background: #fffbfa;
}

.notif-item.is-danger {
  border-left-color: #c0392b;
}

.notif-item.is-warning {
  border-left-color: #d35400;
}

.notif-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.notif-item.is-danger .notif-icon {
  background: #fde8e4;
  color: #c0392b;
}

.notif-item.is-warning .notif-icon {
  background: #fef0e6;
  color: #d35400;
}

.notif-item.is-info .notif-icon {
  background: #eaf2f8;
  color: #2980b9;
}

.notif-body {
  flex: 1;
  min-width: 0;
}

.notif-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.notif-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
}

.notif-time {
  font-size: 11px;
  color: var(--muted);
}

.notif-text {
  font-size: 12px;
  color: #555;
  line-height: 1.45;
  margin: 0;
}

/* Card de SLA no Detalhe */
.sla-detail-card {
  background: #faf8f7;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  margin-bottom: 16px;
}

.sla-detail-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  font-weight: 750;
  text-transform: none;
  letter-spacing: 0;
  color: var(--muted);
  margin-bottom: 10px;
}

.sla-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.sla-metric-box {
  background: #fff;
  border: 1px solid #ebe4e1;
  border-radius: 6px;
  padding: 10px 12px;
}

.sla-metric-label {
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 3px;
}

.sla-metric-val {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
}

.sla-pill {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 700;
  text-transform: none;
}

.sla-pill.is-ok {
  background: #e8f8f5;
  color: #117a65;
}

.sla-pill.is-paused {
  background: #fef5e7;
  color: #b9770e;
}

.sla-pill.is-breached {
  background: #fdedec;
  color: #c0392b;
}

/* CRM 360 — Ficha do Cliente e Linha do Tempo */
.customer-360-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 16px;
  background: #faf7f5;
  border-radius: 8px;
  border: 1px solid var(--line);
  margin-bottom: 16px;
  gap: 16px;
  flex-wrap: wrap;
}

.customer-360-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--ink);
  margin: 0 0 4px;
}

.customer-360-sub {
  font-size: 12px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.segment-pill {
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 750;
  text-transform: none;
  letter-spacing: 0;
}

.segment-pill.is-vip {
  background: #f3e8ff;
  color: #7e22ce;
  border: 1px solid #d8b4fe;
}

.segment-pill.is-critico {
  background: #fee2e2;
  color: #b91c1c;
  border: 1px solid #fca5a5;
}

.segment-pill.is-recorrente {
  background: #ffedd5;
  color: #c2410c;
  border: 1px solid #fed7aa;
}

.segment-pill.is-novo {
  background: #e0f2fe;
  color: #0369a1;
  border: 1px solid #bae6fd;
}

.score-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 8px 14px;
  border-radius: 8px;
  background: #fff;
  border: 2px solid #ebe4e1;
  text-align: center;
}

.score-badge.score-low {
  border-color: #27ae60;
  color: #27ae60;
}

.score-badge.score-med {
  border-color: #f39c12;
  color: #f39c12;
}

.score-badge.score-high {
  border-color: #e74c3c;
  color: #e74c3c;
}

.score-number {
  font-size: 20px;
  font-weight: 850;
  line-height: 1;
}

.score-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: none;
  letter-spacing: 0;
  margin-top: 2px;
}

.customer-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.customer-kpi-item {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 12px;
  text-align: center;
}

.customer-kpi-item span {
  font-size: 11px;
  color: var(--muted);
  display: block;
  margin-bottom: 4px;
}

.customer-kpi-item strong {
  font-size: 16px;
  font-weight: 800;
  color: var(--ink);
}

.contact-log-card {
  background: #fff;
  border: 1px solid #ebe4e1;
  border-radius: 6px;
  padding: 10px 12px;
  margin-bottom: 8px;
  font-size: 12px;
}

.contact-log-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.contact-result-tag {
  font-size: 11px;
  font-weight: 750;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: none;
}

.result-atendeu, .result-resolvido {
  background: #e8f8f5;
  color: #117a65;
}

.result-nao_atendeu, .result-sem_retorno {
  background: #fdedec;
  color: #c0392b;
}

.result-caixa_postal {
  background: #fef5e7;
  color: #b9770e;
}

/* ==========================================================================
   RESPONSIVO
   ========================================================================== */
@media (max-width: 1280px) {
  .metric-grid-6, .metric-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .recent-row { grid-template-columns: 64px minmax(140px, 1fr) minmax(160px, 1.4fr) 116px; }
  .recent-store { display: none; }
}

@media (max-width: 1100px) {
  .dashboard-filter-bar { flex-wrap: wrap; }
  .ticket-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bi-bar { flex-wrap: wrap; }
}

@media (max-width: 1024px) {
  .executive-charts-grid { grid-template-columns: 1fr; }
  .metric-strip.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 980px) {
  .modal-detail.is-split { width: min(100% - 20px, 780px); max-height: 94vh; }
  .split-container { flex-direction: column; overflow-y: auto; }
  .split-left { flex: 1 1 auto; border-right: none !important; border-bottom: 2px dashed var(--line); max-height: none; overflow-y: visible; }
  .split-right { flex: 1 1 auto; max-height: none; overflow-y: visible; }
}

@media (max-width: 720px) {
  .sidebar { width: 62px; align-items: center; padding: 16px 9px; }
  .brand { width: 100%; padding-bottom: 12px; }
  .brand-logo { display: none; }
  .brand-logo-collapsed { display: block; }
  .attendant-selector-box, .sidebar-bottom { display: none; }
  .primary-nav { width: 100%; }
  .nav-link { justify-content: center; width: 44px; height: 44px; padding: 0; overflow: hidden; font-size: 0; }
  .nav-link svg { flex: 0 0 20px; width: 20px; height: 20px; }
  .nav-count { display: none; }
  .main-content { width: calc(100% - 62px); margin-left: 62px; padding: 20px 14px 16px; }
  .page-header { align-items: flex-start; flex-direction: column; }
  .header-actions { width: 100%; justify-content: flex-start; }
  .header-actions > .button, .header-actions > .menu { flex: 0 1 auto; }
  .menu-panel { right: auto; left: 0; }

  .metric-grid-6, .metric-strip, .metric-strip.cols-4, .metric-strip.cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metric-card > strong { font-size: 28px; }
  .chart-panel, .chart-panel-executive, .recent-panel { padding: 16px; }
  .recent-row { grid-template-columns: 56px minmax(90px, 1fr) 108px; gap: 10px; }
  .recent-subject { display: none; }

  .ticket-summary { gap: 8px; }
  .ticket-summary > div { padding: 12px 14px; }
  .ticket-summary strong { font-size: 24px; }
  .filter-bar { padding: 12px; }
  .search-box { flex-basis: 100%; }
  .filter-bar .filter-select { max-width: none; flex: 1 1 44%; }
  .filter-bar > .button { flex: 1 1 100%; }
  .ticket-results-heading { padding-inline: 14px; }
  .ticket-table { min-width: 820px; }
  .kanban-board { grid-template-columns: repeat(4, minmax(240px, 1fr)); padding-inline: 12px; }
  .kanban-column { max-height: 70vh; }

  .saved-views { width: 100%; padding-bottom: 12px; }
  .saved-views .filter-select { flex: 1; }
  .filter-item { flex: 1 1 44%; }
  .filter-item .filter-select { max-width: none; width: 100%; }
  .rank-item { grid-template-columns: 20px minmax(0, 1fr) 80px; }
  .rank-track { display: none; }
  .meeting-actions .button { padding-inline: 10px; }

  .form-grid { grid-template-columns: 1fr; }
  .field-full { grid-column: auto; }
  .detail-client, .detail-contact-grid { grid-template-columns: 1fr; }
  .detail-meta { grid-template-columns: 1fr 1fr; }
  .detail-status { min-width: 0; width: 100%; }
  .modal-content { padding: 17px; }
}

/* ---- Layout e Análise de Clientes CRM ---- */
.crm-customer-analytics-layout {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
  margin-top: 20px;
}
@media (max-width: 1040px) {
  .crm-customer-analytics-layout {
    grid-template-columns: 1fr;
  }
}

.crm-customers-sidebar {
  padding: 18px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
}

.crm-top-customer-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: #fff;
  margin-bottom: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
  color: inherit;
}
.crm-top-customer-item:hover {
  border-color: var(--brand);
  background: var(--brand-pale);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}
.crm-top-customer-item.is-selected {
  border-color: var(--brand);
  background: #fff7ed;
  box-shadow: 0 0 0 2px var(--brand-border);
}
.crm-top-customer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.crm-top-customer-name {
  font-weight: 700;
  font-size: 13.5px;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.crm-top-customer-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  color: var(--muted);
  flex-wrap: wrap;
}
.crm-top-customer-counts {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  font-size: 11px;
}

.crm-badge-segment {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
}
.crm-badge-critico { background: #fee2e2; color: #991b1b; }
.crm-badge-recorrente { background: #fef3c7; color: #92400e; }
.crm-badge-novo { background: #dcfce7; color: #166534; }

.crm-customer-focus-panel {
  padding: 20px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
}

.crm-profile-card {
  padding: 16px 18px;
  background: var(--canvas);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  margin-bottom: 20px;
}
.crm-profile-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.crm-profile-name {
  font-size: 19px;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -.02em;
}
.crm-profile-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.crm-profile-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 12px;
  color: var(--ink);
}

.crm-chart-card {
  padding: 18px 20px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}
.crm-chart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 14px;
}
.crm-chart-title {
  margin: 0;
  font-size: 16px;
  font-weight: 750;
  color: var(--ink);
}
.crm-trend-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
}
.crm-trend-badge.is-up {
  background: #fee2e2;
  color: #b91c1c;
  border: 1px solid #fca5a5;
}
.crm-trend-badge.is-down {
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #86efac;
}
.crm-trend-badge.is-stable {
  background: #f3f4f6;
  color: #4b5563;
  border: 1px solid #e5e7eb;
}
.crm-trend-badge.is-new {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}

.crm-filter-chips-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 16px;
  padding: 10px 12px;
  background: var(--canvas);
  border-radius: 8px;
  border: 1px solid var(--line);
}
.crm-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
  transition: all 0.15s ease;
}
.crm-filter-chip:hover {
  border-color: var(--brand);
}
.crm-filter-chip.is-active {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}
.crm-filter-chip .chip-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
}

.crm-svg-chart-wrapper {
  position: relative;
  width: 100%;
  height: 250px;
  margin-top: 10px;
}
.crm-chart-svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

/* ==========================================================================
   SEÇÃO DE ANEXOS E EVIDÊNCIAS NO MODAL DO CHAMADO
   ========================================================================== */
.detail-attachments-section {
  margin-top: 20px;
  padding: 16px;
  background: var(--canvas, #fbf9f8);
  border: 1px solid var(--line, #e2d9d5);
  border-radius: 8px;
}

.detail-attachments-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 8px;
}

.detail-attachments-heading {
  display: flex;
  align-items: center;
  gap: 8px;
}

.detail-attachments-heading h4 {
  margin: 0;
  font-size: 13px;
  font-weight: 750;
  color: var(--ink, #1f1d1b);
  display: flex;
  align-items: center;
  gap: 6px;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.detail-attachments-counter {
  background: #ede6e3;
  color: #524742;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 12px;
}

.detail-attachments-body {
  min-height: 48px;
}

.attachments-empty-state {
  text-align: center;
  padding: 18px 12px;
  background: #fff;
  border: 1px dashed var(--line, #dcd4d0);
  border-radius: 6px;
}

.attachments-empty-state p {
  margin: 0 0 6px;
  font-size: 12px;
  color: var(--muted, #7d726d);
}

.attachments-empty-state .button-link {
  background: none;
  border: none;
  color: var(--brand, #e04822);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
}

.attachments-empty-state .button-link:hover {
  color: #bf3412;
}

/* Grid de anexos */
.attachments-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 12px;
}

/* Card Genérico */
.attachment-card {
  background: #fff;
  border: 1px solid var(--line, #ebe4e1);
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
  position: relative;
}

.attachment-card:hover {
  border-color: #d0c5c0;
  box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}

/* Card de Imagem */
.attachment-img-thumb {
  height: 120px;
  background: #f0ebe8;
  position: relative;
  cursor: pointer;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.attachment-img-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.2s ease;
}

.attachment-img-thumb:hover img {
  transform: scale(1.04);
}

.attachment-img-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  opacity: 0;
  transition: opacity 0.2s ease;
  font-size: 12px;
  font-weight: 600;
  gap: 6px;
}

.attachment-img-thumb:hover .attachment-img-overlay {
  opacity: 1;
}

/* Card de Áudio */
.attachment-audio-body {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: #fdfaf9;
}

.attachment-audio-player {
  width: 100%;
  height: 36px;
  outline: none;
  border-radius: 18px;
}

/* Card de Documento / PDF */
.attachment-doc-body {
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fff;
}

.attachment-doc-badge {
  width: 38px;
  height: 38px;
  background: #fdf2f0;
  color: #e04822;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 800;
}

.attachment-doc-badge.is-pdf {
  background: #fee2e2;
  color: #b91c1c;
}

/* Rodapé / Meta do Anexo */
.attachment-footer {
  padding: 8px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fff;
  border-top: 1px solid #f4efed;
  gap: 6px;
}

.attachment-meta-info {
  min-width: 0;
  flex: 1;
}

.attachment-name {
  font-size: 12px;
  font-weight: 650;
  color: var(--ink, #1f1d1b);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}

.attachment-size {
  font-size: 11px;
  color: var(--muted, #7d726d);
  display: block;
}

.attachment-actions-row {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.button-icon-subtle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 4px;
  border: 1px solid #ebe4e1;
  background: #fff;
  color: var(--ink, #1f1d1b);
  cursor: pointer;
  padding: 0;
  transition: all 0.15s ease;
  text-decoration: none;
}

.button-icon-subtle:hover {
  background: #f7f4f2;
  border-color: #dcd4d0;
  color: var(--brand, #e04822);
}

.button-icon-subtle.button-icon-danger:hover {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #b91c1c;
}

/* Lightbox Modal de Imagem */
.attachment-lightbox-dialog {
  padding: 0;
  border: none;
  background: transparent;
  max-width: 90vw;
  max-height: 90vh;
}

.attachment-lightbox-dialog::backdrop {
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(4px);
}

.attachment-lightbox-wrap {
  position: relative;
  background: #111;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 16px 36px rgba(0,0,0,0.4);
  display: flex;
  flex-direction: column;
}

.attachment-lightbox-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  gap: 12px;
}

.attachment-lightbox-header span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 70vw;
}

.attachment-lightbox-img {
  max-width: 85vw;
  max-height: 75vh;
  object-fit: contain;
  display: block;
  margin: 0 auto;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}