/*!*****************************************************************************************************************************************************************************************************************************************************************!*\
  !*** css ./node_modules/next/dist/build/webpack/loaders/css-loader/src/index.js??ruleSet[1].rules[14].oneOf[12].use[2]!./node_modules/next/dist/build/webpack/loaders/postcss-loader/src/index.js??ruleSet[1].rules[14].oneOf[12].use[3]!./src/app/globals.css ***!
  \*****************************************************************************************************************************************************************************************************************************************************************/
:root {
  --bg: #f3f7f5;
  --surface: #fdfffe;
  --surface-2: #eaf1ee;
  --surface-3: #e0e9e5;
  --ink: #16211c;
  --ink-muted: #5c6b64;
  --ink-faint: #8b978f;
  --line: #dee6e2;
  --line-strong: #c7d2cd;
  --accent: #146c52;
  --accent-ink: #ffffff;
  --accent-soft: #e4f2ec;
  --accent-soft-line: #bfe0d1;
  --accent-msg: #ddf0e6;
  --accent-msg-ink: #0f3f2e;
  --wait: #a3690f;
  --wait-soft: #faf0dd;
  --wait-line: #edd9ae;
  --progress: #2a5fa5;
  --progress-soft: #e6edf7;
  --progress-line: #c3d3ec;
  --danger: #a83a3a;
  --danger-soft: #f8e6e6;
  --danger-line: #edc2c2;
  --shadow: 0 1px 2px rgba(20, 30, 25, 0.04), 0 8px 24px -12px rgba(20, 30, 25, 0.14);
  --font-ui: Helvetica, 'Helvetica Neue', Arial, sans-serif;
  --font-mono: 'SF Mono', 'Cascadia Code', 'Roboto Mono', Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1512; --surface: #131c18; --surface-2: #182420; --surface-3: #1e2c26;
    --ink: #e7efea; --ink-muted: #93a29b; --ink-faint: #64726b;
    --line: #22322a; --line-strong: #2c3f35;
    --accent: #3ab68b; --accent-ink: #06140f; --accent-soft: #16362b; --accent-soft-line: #23543f;
    --accent-msg: #1a3c30; --accent-msg-ink: #cdeee0;
    --wait: #d8a24d; --wait-soft: #302514; --wait-line: #4a3a1e;
    --progress: #6f9fe0; --progress-soft: #17253a; --progress-line: #24395c;
    --danger: #e08080; --danger-soft: #341c1c; --danger-line: #522a2a;
    --shadow: 0 1px 2px rgba(0,0,0,0.3), 0 8px 24px -12px rgba(0,0,0,0.5);
  }
}
:root[data-theme='dark'] {
  --bg: #0d1512; --surface: #131c18; --surface-2: #182420; --surface-3: #1e2c26;
  --ink: #e7efea; --ink-muted: #93a29b; --ink-faint: #64726b;
  --line: #22322a; --line-strong: #2c3f35;
  --accent: #3ab68b; --accent-ink: #06140f; --accent-soft: #16362b; --accent-soft-line: #23543f;
  --accent-msg: #1a3c30; --accent-msg-ink: #cdeee0;
  --wait: #d8a24d; --wait-soft: #302514; --wait-line: #4a3a1e;
  --progress: #6f9fe0; --progress-soft: #17253a; --progress-line: #24395c;
  --danger: #e08080; --danger-soft: #341c1c; --danger-line: #522a2a;
}
:root[data-theme='light'] {
  --bg: #f3f7f5; --surface: #fdfffe; --surface-2: #eaf1ee; --surface-3: #e0e9e5;
  --ink: #16211c; --ink-muted: #5c6b64; --ink-faint: #8b978f;
  --line: #dee6e2; --line-strong: #c7d2cd;
  --accent: #146c52; --accent-ink: #ffffff; --accent-soft: #e4f2ec; --accent-soft-line: #bfe0d1;
  --accent-msg: #ddf0e6; --accent-msg-ink: #0f3f2e;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-ui);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
button { font-family: inherit; cursor: pointer; }
input { font-family: inherit; }

/* ================= login (fora do shell de 4 colunas) ================= */
.login-page {
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.login-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 300px;
  background: var(--surface);
  padding: 24px;
  border-radius: 10px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.login-form label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
  color: var(--ink-muted);
}
.login-form input {
  padding: 8px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  font-size: 13px;
}
.login-form button {
  background: var(--accent);
  color: var(--accent-ink);
  border: none;
  border-radius: 8px;
  padding: 10px;
  font-size: 13px;
  font-weight: 700;
}
.erro { color: var(--danger); font-size: 12.5px; }

/* ================= shell de 4 colunas ================= */
.app { display: grid; grid-template-columns: 236px 250px 1fr 272px; height: 100vh; min-height: 640px; transition: grid-template-columns 160ms ease; }
.app.nav-collapsed { grid-template-columns: 60px 250px 1fr 272px; }
.app.info-collapsed { grid-template-columns: 236px 250px 1fr 0px; }
.app.nav-collapsed.info-collapsed { grid-template-columns: 60px 250px 1fr 0px; }

/* COLUMN 1 — nav */
.nav { background: var(--surface); border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.nav-top { display: flex; align-items: center; gap: 8px; padding: 14px 12px 10px; flex-shrink: 0; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 13.5px; overflow: hidden; white-space: nowrap; }
.brand .mark { width: 20px; height: 20px; border-radius: 5px; background: var(--accent); flex-shrink: 0; }
.nav.collapsed .brand span { display: none; }
.collapse-btn { margin-left: auto; width: 24px; height: 24px; border-radius: 6px; border: none; background: transparent; color: var(--ink-faint); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.collapse-btn:hover { background: var(--surface-2); }
.nav.collapsed .nav-top { justify-content: center; }
.nav.collapsed .collapse-btn { margin-left: 0; }

.nav-actions { padding: 4px 10px; flex-shrink: 0; }
.nav-item {
  display: flex; align-items: center; gap: 10px; width: 100%; border: none; background: transparent;
  padding: 7px 8px; border-radius: 7px; font-size: 13px; color: var(--ink); text-align: left; white-space: nowrap; overflow: hidden;
}
.nav-item:hover { background: var(--surface-2); }
.nav-item:disabled { color: var(--ink-faint); cursor: default; }
.nav-item:disabled:hover { background: transparent; }
.nav-item .ic { width: 22px; height: 22px; border-radius: 6px; background: var(--surface-2); display: flex; align-items: center; justify-content: center; color: var(--ink-muted); flex-shrink: 0; }
.nav-item.primary .ic { background: var(--accent-soft); color: var(--accent); }
.nav.collapsed .nav-item span:not(.ic) { display: none; }
.nav.collapsed .nav-item { justify-content: center; padding: 7px 0; }
.nav.collapsed .nav-item .ic { background: transparent; }

.nav-divider { height: 1px; background: var(--line); margin: 10px 12px; flex-shrink: 0; }
.nav.collapsed .nav-divider { margin: 10px 8px; }

.nav-section-head { display: flex; align-items: center; padding: 4px 18px 6px; flex-shrink: 0; }
.nav-section-head span { font-size: 10.5px; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; color: var(--ink-faint); }
.nav.collapsed .nav-section-head { display: none; }

.tree { flex: 1 1; overflow-y: auto; padding: 0 8px; min-height: 0; }
.nav.collapsed .tree { display: none; }
.sector-node { margin-bottom: 1px; }
.sector-head {
  display: flex; align-items: center; gap: 7px; width: 100%; border: none; background: transparent;
  padding: 7px 8px; border-radius: 7px; font-size: 13px; font-weight: 600; color: var(--ink); text-align: left;
}
.sector-head:hover { background: var(--surface-2); }
.chev { width: 12px; height: 12px; color: var(--ink-faint); flex-shrink: 0; transition: transform 140ms ease; }
.sector-node.open .chev { transform: rotate(90deg); }
.sector-head .badge { margin-left: auto; font-family: var(--font-mono); font-size: 10.5px; color: var(--ink-faint); background: var(--surface-2); border-radius: 20px; padding: 1px 6px; }
.sub-list { display: none; padding-left: 21px; }
.sector-node.open .sub-list { display: block; }
.sub-item {
  display: flex; align-items: center; gap: 8px; width: 100%; border: none; background: transparent;
  padding: 6px 8px; border-radius: 7px; font-size: 12.5px; color: var(--ink-muted); text-align: left;
}
.sub-item:hover { background: var(--surface-2); }
.sub-item.active { background: var(--accent-soft); color: var(--ink); font-weight: 600; }
.sub-item .sdot { width: 6px; height: 6px; border-radius: 50%; background: var(--line-strong); flex-shrink: 0; }
.sub-item.active .sdot { background: var(--accent); }
.sub-item .n { margin-left: auto; font-family: var(--font-mono); font-size: 10.5px; color: var(--ink-faint); }

.nav-bottom { border-top: 1px solid var(--line); padding: 8px; flex-shrink: 0; }
.identity { display: flex; align-items: center; gap: 9px; padding: 7px 8px; border-radius: 8px; }
.identity .avatar { width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: flex; align-items: center; justify-content: center; font-size: 10.5px; font-weight: 700; flex-shrink: 0; }
.identity .who { flex: 1 1; min-width: 0; overflow: hidden; }
.identity .name { font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.identity .role { font-size: 10.5px; color: var(--ink-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav.collapsed .identity .who { display: none; }
.nav.collapsed .identity { justify-content: center; }

/* COLUMN 2 — conversation list */
.clist { border-right: 1px solid var(--line); background: var(--bg); display: flex; flex-direction: column; min-height: 0; }
.clist-head { display: flex; align-items: center; gap: 8px; padding: 15px 16px 4px; flex-shrink: 0; }
.clist-head h1 { margin: 0; font-size: 14.5px; font-weight: 700; flex: 1 1; }
.clist-sub { padding: 0 16px 10px; font-size: 11.5px; color: var(--ink-faint); flex-shrink: 0; }
.clist-items { flex: 1 1; overflow-y: auto; padding: 2px 8px 10px; min-height: 0; }
.citem { display: flex; gap: 10px; padding: 9px 9px; border-radius: 8px; align-items: flex-start; width: 100%; text-align: left; border: 1px solid transparent; background: transparent; }
.citem:hover { background: var(--surface); }
.citem.selected { background: var(--surface); box-shadow: var(--shadow); border-color: var(--line-strong); }
.citem .ca { width: 30px; height: 30px; border-radius: 50%; background: var(--surface-3); color: var(--ink-muted); display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; flex-shrink: 0; }
.citem.selected .ca { background: var(--accent); color: var(--accent-ink); }
.citem .cb { min-width: 0; flex: 1 1; }
.citem .cb-top { display: flex; align-items: baseline; gap: 6px; }
.citem .cname { font-size: 12.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1 1; }
.citem .ctime { font-family: var(--font-mono); font-size: 10px; color: var(--ink-faint); flex-shrink: 0; }
.citem .cpreview { font-size: 11.5px; color: var(--ink-faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 1px; }
.vazio { padding: 16px; font-size: 12.5px; color: var(--ink-faint); }

/* COLUMN 3 — chat */
.chat { display: flex; flex-direction: column; min-height: 0; background: var(--surface); }
.chat-header { display: flex; align-items: center; gap: 10px; padding: 13px 20px; border-bottom: 1px solid var(--line); flex-shrink: 0; }
.chat-header .ca { width: 32px; height: 32px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: flex; align-items: center; justify-content: center; font-size: 11.5px; font-weight: 700; flex-shrink: 0; }
.chat-header .who .name { font-size: 13.5px; font-weight: 700; }
.chat-header .who .sub { font-size: 11px; color: var(--ink-faint); font-family: var(--font-mono); }
.chat-header .pill { margin-left: auto; font-size: 10px; font-weight: 700; letter-spacing: 0.03em; text-transform: uppercase; padding: 3px 8px; border-radius: 20px; background: var(--progress-soft); color: var(--progress); border: 1px solid var(--progress-line); }
.chat-header .pill.aguardando { background: var(--wait-soft); color: var(--wait); border-color: var(--wait-line); }
.chat-header .pill.encerrado { background: var(--surface-2); color: var(--ink-faint); border-color: var(--line); }
.chat-header .assumir-btn { margin-left: 10px; background: var(--accent); color: var(--accent-ink); border: none; border-radius: 8px; padding: 7px 12px; font-size: 12.5px; font-weight: 700; }

.thread { flex: 1 1; overflow-y: auto; padding: 18px 24px; display: flex; flex-direction: column; gap: 4px; min-height: 0; }
.vazio-central { flex: 1 1; display: flex; align-items: center; justify-content: center; color: var(--ink-faint); font-size: 13px; }
.row { display: flex; margin: 4px 0; }
.row.in { justify-content: flex-start; }
.row.out { justify-content: flex-end; }
.bubble { max-width: 68%; border-radius: 13px; padding: 9px 12px; font-size: 13.2px; line-height: 1.44; }
.row.in .bubble { background: var(--bg); border: 1px solid var(--line); border-bottom-left-radius: 3px; }
.row.out .bubble { background: var(--accent-msg); color: var(--accent-msg-ink); border-bottom-right-radius: 3px; }
.bubble p { margin: 0; }
.bubble .time { font-family: var(--font-mono); font-size: 9.5px; opacity: 0.62; margin-top: 5px; text-align: right; }

.composer { display: flex; align-items: center; gap: 10px; padding: 12px 20px 16px; border-top: 1px solid var(--line); flex-shrink: 0; }
.composer input { flex: 1 1; min-height: 36px; border: 1px solid var(--line-strong); border-radius: 10px; padding: 8px 12px; font-size: 13px; color: var(--ink); }
.send-btn { width: 36px; height: 36px; border-radius: 10px; border: none; background: var(--accent); color: var(--accent-ink); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.send-btn:disabled { opacity: 0.5; }

/* COLUMN 4 — info */
.info { border-left: 1px solid var(--line); background: var(--surface); overflow-y: auto; min-height: 0; padding: 20px 18px; }
.app.info-collapsed .info { padding: 0; overflow: hidden; border-left: none; }
.info-toggle-btn { width: 28px; height: 28px; border-radius: 7px; border: 1px solid var(--line); background: var(--surface-2); color: var(--ink-muted); display: flex; align-items: center; justify-content: center; margin-left: 8px; flex-shrink: 0; }
.info-toggle-btn:hover { background: var(--surface-3); }
.theme-toggle-btn { width: 24px; height: 24px; border-radius: 6px; border: none; background: transparent; color: var(--ink-faint); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.theme-toggle-btn:hover { background: var(--surface-2); }
.contact-card { text-align: center; padding-bottom: 16px; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.contact-card .ca-lg { width: 56px; height: 56px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: flex; align-items: center; justify-content: center; font-size: 18px; font-weight: 700; margin: 0 auto 10px; }
.contact-card .cname { font-size: 14.5px; font-weight: 700; }
.contact-card .cphone { font-family: var(--font-mono); font-size: 12px; color: var(--ink-muted); margin-top: 6px; }

.info h3 { margin: 0 0 12px; font-size: 12px; font-weight: 700; letter-spacing: 0.03em; text-transform: uppercase; color: var(--ink-faint); }
.info-grid { display: flex; flex-direction: column; gap: 11px; margin-bottom: 18px; }
.info-item .k { font-size: 10px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-faint); margin-bottom: 2px; }
.info-item .v { font-size: 12.5px; font-weight: 600; }
.info-item .v.mono { font-family: var(--font-mono); font-feature-settings: "tnum"; font-variant-numeric: tabular-nums; font-weight: 400; }
.info-item select { width: 100%; padding: 6px 8px; border: 1px solid var(--line-strong); border-radius: 6px; font-size: 12.5px; }

.btn-danger-outline { width: 100%; background: transparent; color: var(--danger); border: 1px solid var(--danger-line); border-radius: 8px; padding: 10px 14px; font-size: 13px; font-weight: 700; margin-bottom: 8px; }
.btn-secondary { width: 100%; background: transparent; color: var(--ink-muted); border: 1px solid var(--line-strong); border-radius: 8px; padding: 10px 14px; font-size: 13px; font-weight: 600; }
.btn-secondary:disabled, .btn-danger-outline:disabled { opacity: 0.5; }

button:focus-visible, .nav-item:focus-visible, .sector-head:focus-visible, .sub-item:focus-visible, .citem:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}

/* barra de rolagem fina, no estilo do design (em vez do padrão do SO) */
.tree, .clist-items, .thread, .info {
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}
.tree::-webkit-scrollbar, .clist-items::-webkit-scrollbar, .thread::-webkit-scrollbar, .info::-webkit-scrollbar {
  width: 8px;
}
.tree::-webkit-scrollbar-track, .clist-items::-webkit-scrollbar-track, .thread::-webkit-scrollbar-track, .info::-webkit-scrollbar-track {
  background: transparent;
}
.tree::-webkit-scrollbar-thumb, .clist-items::-webkit-scrollbar-thumb, .thread::-webkit-scrollbar-thumb, .info::-webkit-scrollbar-thumb {
  background-color: var(--line-strong);
  border-radius: 20px;
  border: 2px solid transparent;
  background-clip: content-box;
}
.tree::-webkit-scrollbar-thumb:hover, .clist-items::-webkit-scrollbar-thumb:hover, .thread::-webkit-scrollbar-thumb:hover, .info::-webkit-scrollbar-thumb:hover {
  background-color: var(--ink-faint);
  background-clip: content-box;
}

@media (max-width: 1180px) {
  .app, .app.nav-collapsed { grid-template-columns: 60px 230px 1fr 0px; }
  .info { display: none; }
}
@media (max-width: 860px) {
  .app, .app.nav-collapsed { grid-template-columns: 0px 210px 1fr 0px; }
  .nav { display: none; }
}

/* ================= admin (CRUD simples, fora do shell de 4 colunas) ================= */
.admin { max-width: 720px; margin: 0 auto; padding: 24px; }
.admin a { color: var(--accent); }
.admin section { margin-bottom: 32px; }
.admin form { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 8px; }
.admin form input, .admin form select { padding: 6px 8px; border: 1px solid var(--line-strong); border-radius: 4px; font-size: 13px; }
.admin form button { background: var(--accent); color: var(--accent-ink); border: none; border-radius: 6px; padding: 8px 14px; font-size: 13px; }
.admin fieldset { border: 1px solid var(--line); border-radius: 4px; }

