:root {
  --navy: #0d213d;
  --navy-2: #152c4c;
  --teal: #00b982;
  --teal-dark: #008b65;
  --teal-ink: #0f3d31;
  --teal-100: #e2f0e7;
  --cream: #f5f1e7;
  --paper: #ffffff;
  --ink: #1b2320;
  --ink-soft: #4d564f;
  --muted: #718096;
  --line: #e6dfcd;
  --line-strong: #d8cfb6;
  --canvas: #f4f1e8;
  --rust: #b5502e;
  --amber: #c9a35c;
  --shadow: 0 8px 24px -8px rgba(15, 61, 49, .16);
  --radius: 10px;
  --sidebar-width: 236px;
  --page-fs: 11px;
}

* { box-sizing: border-box; }
html { font-size: 15px; }
html, body { height: 100%; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--canvas);
  font-family: "IBM Plex Sans", sans-serif;
  font-size: 13px;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
.mono { font-family: "IBM Plex Mono", ui-monospace, monospace; }
.muted { color: var(--muted); font-size: 12px; }
.ui-icon { width: 16px; height: 16px; flex: 0 0 auto; }

.brand-mark {
  width: 36px; height: 36px; display: grid; place-items: center;
  border: 2px solid var(--teal); color: var(--teal);
  border-radius: 11px 4px 11px 4px; font: 700 18px/1 "IBM Plex Sans", sans-serif;
}
.brand-mark--large { width: 46px; height: 46px; color: #fff; background: rgba(255,255,255,.04); }

/* Login — versão 2 */
.login-body { background: var(--navy); }
.login-screen {
  min-height: 100vh; display: flex; flex-direction: column;
  padding: 32px 5vw 22px; color: #fff; position: relative; overflow: hidden;
}
.login-screen::after {
  content: ""; position: absolute; left: -15vw; bottom: -28vw; width: 50vw; height: 50vw;
  background: radial-gradient(circle, rgba(0,185,130,.18), transparent 65%);
}
.login-brand { display: flex; align-items: center; gap: 14px; position: relative; z-index: 2; }
.login-brand strong { font-size: 14px; letter-spacing: .06em; }
.login-brand span { display: block; color: #8ea2bd; font-size: 11px; margin-top: 3px; }
.login-panel {
  position: relative; z-index: 2;
  display: grid; grid-template-columns: minmax(300px, 1fr) 400px;
  align-items: center; gap: min(8vw, 120px); width: min(1100px, 100%);
  margin: auto; padding: 40px 0;
}
.eyebrow { color: var(--teal); font-size: 10px; font-weight: 600; letter-spacing: .18em; text-transform: uppercase; }
.login-copy h1 { margin: 16px 0; font-size: clamp(32px, 4.4vw, 54px); line-height: 1.08; letter-spacing: -.03em; font-weight: 600; }
.login-copy h1 em { color: var(--teal); font-style: normal; }
.login-copy > p { max-width: 520px; color: #a9b7ca; line-height: 1.55; }
.login-proof { display: flex; gap: 36px; margin-top: 40px; }
.login-proof > div { border-left: 2px solid rgba(0,185,130,.5); padding-left: 12px; }
.login-proof strong { display: block; font-size: 22px; }
.login-proof span { display: block; margin-top: 6px; color: #91a3bb; font-size: 11px; }
.login-card { padding: 28px; color: var(--ink); background: #fff; border-radius: 16px; box-shadow: 0 24px 60px rgba(0,0,0,.22); }
.login-card__head { display: flex; align-items: center; gap: 8px; margin-bottom: 18px; color: var(--teal-dark); font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--teal); box-shadow: 0 0 0 4px #e5f8f1; }
.login-card h2 { margin: 0 0 6px; font-size: 24px; }
.login-card > p { margin: 0 0 18px; color: var(--muted); }
.login-footer { display: flex; justify-content: space-between; position: relative; z-index: 2; color: #71859f; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; font-size: 12px; font-weight: 600; color: var(--ink-soft); }
.field[hidden] { display: none; }
.field input, .field select, .field textarea {
  width: 100%; border: 1px solid var(--line-strong); border-radius: 8px; padding: 10px 12px;
  font-weight: 400; background: #fff;
}
.field input[type="checkbox"],
.field input[type="radio"] {
  width: 16px; height: 16px; min-width: 16px; padding: 0; border: 0; border-radius: 3px;
  flex: 0 0 16px; accent-color: #155542;
}
.field input[type="file"] {
  width: 100%; padding: 8px; min-height: 0;
}
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid rgba(0,185,130,.25); border-color: var(--teal); }
.input-wrap { position: relative; }
.input-wrap .ui-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: #9aa7b7; }
.input-wrap input { padding-left: 38px; padding-right: 40px; }
.icon-btn { border: 0; background: transparent; color: var(--muted); display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; }
.icon-btn--inside { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); }
.form-alert { margin-bottom: 14px; padding: 10px 12px; border-radius: 8px; background: #f5e2e0; color: #8a3030; font-size: 12px; }
.form-alert.is-ok { background: var(--teal-100); color: var(--teal-ink); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 38px; padding: 0 14px; border: 1px solid transparent; border-radius: 8px;
  font-size: 13px; font-weight: 600;
}
.btn-primary { color: #fff; background: var(--teal); }
.btn-primary:hover { background: #00aa78; }
.btn-ghost { background: #fff; border-color: var(--line-strong); color: #41516a; }
.btn-wide { width: 100%; }
.btn-sm { min-height: 30px; font-size: 12px; font-weight: 500; }

/* App shell — navy sidebar (v2) + cream canvas (v1) */
.app-shell { display: flex; min-height: 100vh; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar-width);
  display: flex; flex-direction: column; color: #d8e1ec; background: var(--navy);
}
.sidebar-brand { display: flex; align-items: center; gap: 12px; height: 68px; padding: 0 18px; border-bottom: 1px solid rgba(255,255,255,.07); }
.brand-name { display: flex; flex-direction: column; }
.brand-name strong { color: #fff; font-size: 12px; letter-spacing: .06em; }
.brand-name span { color: #7f94ad; font-size: 10px; margin-top: 2px; }
.nav { display: flex; flex-direction: column; gap: 3px; padding: 18px 12px; overflow: auto; }
.nav-label { margin: 14px 10px 6px; color: #627a97; font-size: 9px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; }
.nav-label:first-child { margin-top: 0; }
.nav-item {
  display: flex; align-items: center; gap: 10px; height: 40px; padding: 0 10px;
  border-radius: 8px; color: #9fb0c3; font-size: 13px;
}
.nav-item:hover { color: #fff; background: rgba(255,255,255,.05); }
.nav-item.is-active { color: #fff; background: rgba(0,185,130,.13); box-shadow: inset 3px 0 0 var(--teal); }
.nav-item.is-active .ui-icon { color: var(--teal); }
.nav-item b { margin-left: auto; min-width: 20px; padding: 2px 6px; color: #fff; background: #f47c48; border-radius: 10px; font-size: 10px; text-align: center; font-weight: 600; }
.sidebar-foot { margin-top: auto; padding: 12px; }
.mailbox-card { display: flex; align-items: center; gap: 10px; padding: 10px; border: 1px solid rgba(255,255,255,.07); border-radius: 10px; background: rgba(255,255,255,.035); }
.mailbox-card__icon { position: relative; display: grid; place-items: center; width: 30px; height: 30px; color: var(--teal); background: rgba(0,185,130,.1); border-radius: 8px; }
.mailbox-card__icon i { position: absolute; top: 1px; right: 1px; width: 7px; height: 7px; border: 2px solid var(--navy); border-radius: 50%; background: var(--teal); }
.mailbox-card strong { display: block; color: #e8eef6; font-size: 10px; }
.mailbox-card span { display: block; color: #71869e; font-size: 9px; margin-top: 3px; }
.version { display: flex; justify-content: space-between; margin: 12px 4px 0; color: #60758f; font-size: 8px; letter-spacing: .1em; text-transform: uppercase; }

.app-area { width: calc(100% - var(--sidebar-width)); margin-left: var(--sidebar-width); min-height: 100vh; }
.topbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 22px 10px; background: var(--canvas);
}
.page-kicker { font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--rust); font-weight: 600; }
.page-title { margin: 2px 0 0; font-size: 22px; color: var(--teal-ink); font-weight: 600; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.page { padding: 8px 22px 28px; font-size: var(--page-fs); }

.user-chip { display: flex; align-items: center; gap: 8px; }
.user-chip strong { display: block; font-size: 12px; font-weight: 600; }
.user-chip small { display: block; color: var(--muted); font-size: 10px; }
.avatar {
  width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  background: var(--teal-100); color: var(--teal-ink); font-size: 11px; font-weight: 600;
}

.avail-toggle, .avail-mini {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--line-strong); background: #fff; border-radius: 20px;
  padding: 6px 10px; font-size: 11px; font-weight: 600; color: var(--teal-ink);
}
.avail-toggle.is-away, .avail-mini.is-away { color: var(--rust); }
.avail-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--teal); }
.avail-toggle.is-away .avail-dot, .avail-mini.is-away { }
.avail-toggle.is-away .avail-dot { background: var(--rust); }

.kpi-row { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; margin-bottom: 14px; }
.kpi {
  position: relative; overflow: hidden; display: block;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px 12px 14px; box-shadow: var(--shadow);
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.kpi:hover { transform: translateY(-1px); box-shadow: 0 10px 22px -10px rgba(15, 61, 49, .28); }
.kpi:focus-visible { outline: 2px solid var(--teal-dark); outline-offset: 2px; }
.kpi-label { display: block; color: var(--muted); font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.kpi-value { display: block; margin-top: 6px; font-size: 22px; font-weight: 600; color: var(--ink); }
.kpi-bar { position: absolute; left: 0; bottom: 0; height: 3px; width: 100%; background: var(--muted); }

.kpi--novo { background: #efe0b8; border-color: #ddc78a; }
.kpi--novo .kpi-label { color: #7a5818; }
.kpi--novo .kpi-bar { background: #c9a35c; }

.kpi--atribuido { background: #d5e0f0; border-color: #b4c4db; }
.kpi--atribuido .kpi-label { color: #33466f; }
.kpi--atribuido .kpi-bar { background: #5a6b9a; }

.kpi--em_tratamento { background: #d3e3e6; border-color: #b3c8cc; }
.kpi--em_tratamento .kpi-label { color: #355056; }
.kpi--em_tratamento .kpi-bar { background: #5a7a82; }

.kpi--aguarda_solicitante { background: #edd6cb; border-color: #d8b6a6; }
.kpi--aguarda_solicitante .kpi-label { color: #8a4630; }
.kpi--aguarda_solicitante .kpi-bar { background: #b5502e; }

.kpi--resolvido { background: #c5e6d2; border-color: #99cbb0; }
.kpi--resolvido .kpi-label { color: #1b6842; }
.kpi--resolvido .kpi-value { color: #155c3c; }
.kpi--resolvido .kpi-bar { background: #2f8f5b; }

.kpi--fechado { background: #e3dfd6; border-color: #cdc8bc; }
.kpi--fechado .kpi-label { color: #56544e; }
.kpi--fechado .kpi-bar { background: #8b8577; }

.dash-grid { display: grid; grid-template-columns: 1.35fr 1fr; gap: 14px; margin-bottom: 14px; }
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); }
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 14px; }
.panel-head h3 { margin: 0; font-size: 15px; color: var(--teal-ink); font-weight: 600; }
.queue-bar-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.qname { width: 140px; flex: 0 0 auto; font-size: 12px; color: var(--ink-soft); }
.qname em { font-style: normal; color: var(--rust); font-size: 10px; }
.queue-bar-track { flex: 1; height: 8px; background: var(--line); border-radius: 20px; overflow: hidden; }
.queue-bar-fill { height: 100%; background: #1f9370; }
.qcount { width: 24px; text-align: right; font-family: "IBM Plex Mono", monospace; font-size: 11px; }
.op-row { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.op-row:last-child { border-bottom: 0; }
.op-row .name { flex: 1; font-size: 12px; font-weight: 500; }
.op-row .load { font-family: "IBM Plex Mono", monospace; font-size: 11px; color: var(--muted); }
.stat-pill { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px; border-radius: 8px; background: var(--teal-100); margin-bottom: 12px; }
.stat-pill.is-warn { background: #f6e6dd; }
.stat-pill strong { font-family: "IBM Plex Mono", monospace; }
a.stat-pill { color: inherit; text-decoration: none; }
.flow-diagram { display: flex; align-items: center; gap: 0; margin: 8px 0 12px; }
.flow-step { width: 88px; text-align: center; font-size: 10px; font-weight: 600; color: var(--ink-soft); }
.flow-diagram i { flex: 1; height: 2px; background: repeating-linear-gradient(90deg, #1f9370 0 6px, transparent 6px 11px); }

.filter-bar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.chip-filter { padding: 6px 12px; border-radius: 20px; border: 1px solid var(--line-strong); background: #fff; font-size: 12px; font-weight: 500; color: var(--ink-soft); }
.chip-filter.is-active { background: #155542; color: #fff; border-color: #155542; }
.filter-meta { margin-left: auto; }

.tickets-layout { display: grid; grid-template-columns: minmax(0, 1fr) 228px; gap: 14px; align-items: start; }
.queue-rail { position: sticky; top: 12px; display: flex; flex-direction: column; gap: 7px; }
.queue-rail-head {
  font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em;
  color: var(--muted); padding: 2px 4px 2px;
}
.queue-chip {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px; border-radius: var(--radius);
  border: 1px solid var(--line); background: var(--paper); box-shadow: var(--shadow);
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.queue-chip:hover { transform: translateY(-1px); box-shadow: 0 10px 22px -10px rgba(15, 61, 49, .28); }
.queue-chip:focus-visible { outline: 2px solid var(--teal-dark); outline-offset: 2px; }
.queue-chip__name { flex: 1; min-width: 0; font-size: 12px; font-weight: 500; color: var(--teal-ink); line-height: 1.3; }
.queue-chip__name em { display: block; font-style: normal; font-size: 10px; color: var(--rust); font-weight: 600; }
.queue-chip__count { font-family: "IBM Plex Mono", monospace; font-size: 12px; color: var(--muted); }
.queue-chip.is-active { border-color: #155542; box-shadow: inset 0 0 0 1px #155542; }
.queue-chip.is-active .queue-chip__count { color: #155542; font-weight: 600; }
.queue-chip--none { background: #eeece8; border-color: #d6d1c8; }
.queue-chip--0 { background: #efe0b8; border-color: #ddc78a; }
.queue-chip--1 { background: #d5e0f0; border-color: #b4c4db; }
.queue-chip--2 { background: #d3e3e6; border-color: #b3c8cc; }
.queue-chip--3 { background: #edd6cb; border-color: #d8b6a6; }
.queue-chip--4 { background: #dceee3; border-color: #b5d6c2; }
.queue-chip.is-triage { background: #edd6cb; border-color: #d8b6a6; }

.toolbar { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 12px; }
.table-wrap { overflow: auto; padding: 0; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
  text-align: left; font-size: 10px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--muted); font-weight: 600; padding: 11px 14px; border-bottom: 1px solid var(--line); background: #faf7ee;
}
.data-table td { padding: 12px 14px; border-bottom: 1px solid var(--line); font-size: 12.5px; font-weight: 400; }
.data-table tbody tr:hover { background: #faf8f1; }
.td-sub { color: var(--ink); }
.td-req { color: var(--muted); font-size: 11px; }
.name-cell { display: flex; align-items: center; gap: 8px; }
.td-actions { display: flex; justify-content: flex-end; align-items: center; gap: 8px; text-align: right; }
.empty-state, .empty-copy { padding: 28px 8px; color: var(--muted); text-align: center; }
.empty-state strong { display: block; color: var(--teal-ink); margin-bottom: 6px; font-size: 15px; }

.pill { display: inline-block; padding: 3px 8px; border-radius: 20px; font-size: 10px; font-weight: 600; }
.pill-novo { background: #f5ecd8; color: #8a6420; }
.pill-atribuido { background: #e8ecf8; color: #3d4f9e; }
.pill-em_tratamento { background: var(--teal-100); color: #155542; }
.pill-aguarda_solicitante { background: #f6e6dd; color: var(--rust); }
.pill-resolvido { background: #e8efe9; color: #3d5a4a; }
.pill-fechado { background: #eee; color: #6b6b6b; }
.pill-critica { background: #f5e2e0; color: #8a3030; }
.pill-alta { background: #f6e6dd; color: var(--rust); }
.pill-media { background: #f5ecd8; color: #8a6420; }
.pill-baixa { background: #e8ecf8; color: #3d4f9e; }
.triage-tag { color: var(--rust); font-style: normal; font-size: 10px; }

.queue-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.queue-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.qtop { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 8px; }
.queue-card h3 { margin: 0; font-size: 15px; color: var(--teal-ink); }
.qmode { font-size: 10px; font-weight: 600; text-transform: uppercase; padding: 3px 8px; border-radius: 20px; }
.qmode.manual { background: #f5ecd8; color: #8a6420; }
.qmode.auto { background: var(--teal-100); color: #155542; }
.qstats { display: flex; gap: 16px; margin: 12px 0; }
.qstat b { display: block; font-size: 18px; }
.qstat span { font-size: 10px; color: var(--muted); }
.qactions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

.settings-tabs {
  display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 14px;
  padding: 4px; width: fit-content; max-width: 100%;
  background: #fff; border: 1px solid var(--line); border-radius: 10px;
}
.settings-tab {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 34px; padding: 0 14px; border: 0; border-radius: 8px;
  background: transparent; color: var(--muted); font-size: 12px; font-weight: 600;
}
.settings-tab.is-active { color: var(--teal-ink); background: var(--teal-100); }
.settings-form { display: flex; flex-direction: column; gap: 14px; }
.settings-panel { max-width: 640px; display: flex; flex-direction: column; gap: 14px; }
.settings-panel.is-wide { max-width: 880px; }
.settings-panel[hidden] { display: none; }
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field-narrow { max-width: 220px; }
.settings-actions { display: flex; }
.logo-preview { display: flex; align-items: center; gap: 12px; margin: 8px 0 12px; }
.logo-preview img { max-height: 52px; max-width: 180px; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 6px; }
.tpl-hint { font-size: 12px; color: var(--muted); margin: 0 0 12px; }
.tpl-hint code { font-size: 11px; background: #f4efe4; padding: 1px 5px; border-radius: 4px; }
.sig-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: start; }
.sig-preview { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 14px; }
.sig-preview__block { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 12px; color: var(--ink-soft); line-height: 1.45; }
.sig-preview__personal { margin-bottom: 10px; }
.sig-preview__block img { display: block; max-height: 52px; max-width: 180px; margin: 0 0 8px; }
.sig-preview__block strong { display: block; color: var(--teal-ink); font-weight: 600; }
#userModal .modal__box { width: min(640px, 92vw); }
.sla-dot {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; color: var(--ink-soft); white-space: nowrap;
}
.sla-dot::before {
  content: ""; width: 8px; height: 8px; border-radius: 50%; background: #b9c3cf; flex: 0 0 auto;
}
.sla-dot--on_track::before { background: #2f8f5b; }
.sla-dot--warning::before { background: #c9a35c; }
.sla-dot--breached::before { background: #b5502e; }
.sla-dot--paused::before { background: #8b8577; }
.sla-dot--met::before { background: #1a7a5c; }
.sla-dot small { color: var(--muted); font-size: 10px; }
.sla-block { display: flex; flex-direction: column; gap: 10px; }
.sla-line { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; border-radius: 8px; background: #f7f4ec; }
.sla-line strong { font-size: 12px; color: var(--teal-ink); font-weight: 600; }
.sla-line span { font-size: 12px; }
.sla-line small { color: var(--muted); font-size: 11px; }
.sla-line--on_track { background: #edf5ef; }
.sla-line--warning { background: #f7f1df; }
.sla-line--breached { background: #f6ece8; }
.sla-line--paused { background: #f0eeea; }
.sla-line--met { background: #e8f3ee; }
.sla-rule {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 12px;
  align-items: end;
  margin: 14px 0 4px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.sla-rule > input[type="hidden"] { display: none; }
.sla-rule .field { margin-bottom: 0; }
.sla-rule .check-row { margin: 0; padding-bottom: 8px; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 12px; }
.field-span, fieldset.field { grid-column: 1 / -1; }
.check-row { display: flex; align-items: flex-start; gap: 10px; margin: 0 0 10px; font-weight: 500; font-size: 13px; color: var(--ink); line-height: 1.35; }
.check-row input[type="checkbox"],
.check-row input[type="radio"] {
  width: 16px; height: 16px; min-width: 16px; margin-top: 2px; padding: 0; border: 0;
  flex: 0 0 16px; accent-color: #155542;
}
.check-row span { flex: 1; min-width: 0; }
.check-grid { display: flex; flex-wrap: wrap; gap: 8px; }
fieldset.field { border: 0; padding: 0; margin: 8px 0 0; }
fieldset.field legend { font-size: 12px; font-weight: 600; color: var(--ink-soft); margin-bottom: 8px; }
.chip-check { position: relative; display: inline-flex; cursor: pointer; margin: 0; }
.chip-check input { position: absolute; opacity: 0; pointer-events: none; width: 1px; height: 1px; }
.chip-check span {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 36px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 8px;
  background: #fff; color: var(--ink-soft); font-size: 12px; font-weight: 600; white-space: nowrap;
}
.chip-check input:checked + span { background: #155542; color: #fff; border-color: #155542; }
.chip-check input:focus-visible + span { outline: 2px solid rgba(0,185,130,.35); }
.holiday-toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; margin-bottom: 14px; }
.holiday-add { display: grid; grid-template-columns: 170px 1fr; gap: 10px; flex: 1; min-width: 240px; }
.holiday-import {
  display: flex; flex-direction: column; gap: 6px;
  margin: 0 0 16px; padding: 12px 14px; background: #f7f4ec; border: 1px solid var(--line); border-radius: 10px;
}
.holiday-import .field { margin: 0; }
.holiday-list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; }
.holiday-item {
  display: grid; grid-template-columns: 108px 1fr auto; gap: 10px; align-items: center;
  padding: 8px 10px; background: #fff; border: 1px solid var(--line); border-radius: 8px;
}
.holiday-item time { font-size: 12px; font-weight: 600; color: var(--teal-ink); }
.holiday-item span { font-size: 13px; font-weight: 500; }
.survey-edit {
  display: grid; grid-template-columns: 1fr 140px auto; gap: 8px 12px; align-items: end;
  margin: 0 0 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: #fff;
}
.survey-edit .field { margin-bottom: 0; }
.survey-edit .field-span { grid-column: 1 / -1; }
.survey-answer { margin: 0 0 10px; }
.survey-answer span { display: block; color: var(--muted); font-size: 11px; font-weight: 600; }
.survey-answer strong { display: block; margin-top: 2px; font-size: 13px; font-weight: 600; color: var(--teal-ink); }

.survey-body { background: #f4efe4; }
.survey-page { min-height: 100vh; padding: 36px 16px 48px; }
.survey-brand { display: flex; align-items: center; gap: 10px; max-width: 560px; margin: 0 auto 16px; color: var(--teal-ink); }
.survey-brand strong { font-size: 13px; letter-spacing: .04em; }
.survey-card {
  max-width: 560px; margin: 0 auto; padding: 28px 26px;
  background: #fff; border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow);
}
.survey-card h1 { margin: 6px 0 8px; font-size: 24px; color: var(--teal-ink); }
.survey-card > p { color: var(--ink-soft); line-height: 1.5; }
.survey-meta { margin: 0 0 16px; color: var(--muted); font-size: 12px; }
.survey-form { display: flex; flex-direction: column; gap: 16px; }
.survey-q { border: 0; padding: 0; margin: 0; }
.survey-q legend { margin-bottom: 8px; font-size: 14px; font-weight: 600; color: var(--ink); }
.survey-q legend em { margin-left: 6px; color: var(--muted); font-style: normal; font-size: 11px; font-weight: 500; }
.survey-q textarea {
  width: 100%; border: 1px solid var(--line-strong); border-radius: 8px; padding: 10px 12px; font-weight: 400;
}
.survey-scale { display: flex; gap: 8px; }
.survey-scale label { flex: 1; cursor: pointer; }
.survey-scale input { position: absolute; opacity: 0; pointer-events: none; }
.survey-scale span {
  display: flex; align-items: center; justify-content: center; min-height: 44px;
  border: 1px solid var(--line-strong); border-radius: 8px; background: #fff;
  font-size: 15px; font-weight: 600; color: var(--ink-soft);
}
.survey-scale input:checked + span { background: #155542; color: #fff; border-color: #155542; }
.survey-scale-axis { display: flex; justify-content: space-between; margin-top: 6px; color: var(--muted); font-size: 11px; }
.survey-choice { display: flex; gap: 8px; }

.modal, .app-dialog { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; }
.modal[hidden], .app-dialog[hidden] { display: none; }
.modal__backdrop, .app-dialog__backdrop { position: absolute; inset: 0; background: rgba(15, 30, 25, .36); }
.modal__box, .app-dialog__box {
  position: relative; width: min(560px, 92vw); background: var(--cream);
  border-radius: 12px; box-shadow: var(--shadow); padding: 0;
}
.app-dialog__box { background: #fff; padding: 20px 22px; }
.app-dialog__box h2 { margin: 0 0 8px; font-size: 16px; }
.app-dialog__actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.modal__head, .modal__foot { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; }
.modal__head { border-bottom: 1px solid var(--line); }
.modal__head h2 { margin: 0; font-size: 16px; color: var(--teal-ink); }
.modal__body { padding: 16px 18px; }
.modal__foot { border-top: 1px solid var(--line); justify-content: flex-end; gap: 8px; }

.ticket-ref { color: var(--teal-dark); font-weight: 600; }
.data-table tr.is-link { cursor: pointer; }
.back-link { display: inline-flex; align-items: center; gap: 4px; margin-bottom: 12px; color: var(--muted); font-size: 12px; font-weight: 600; }
.btn-danger { color: #fff; background: #b5502e; border-color: #b5502e; }
.btn-danger:hover { background: #9a4326; }
.btn-danger-quiet { color: #b5502e; border-color: #e8c4b6; background: #fff; }
.detail-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 16px; }
.detail-purge { flex: 0 0 auto; }
.detail-title-line { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.detail-head h1 { margin: 0; font-size: 22px; color: var(--teal-ink); font-weight: 600; max-width: 760px; }
.detail-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; color: var(--muted); font-size: 12px; }
.detail-meta i { width: 3px; height: 3px; border-radius: 50%; background: #b9c3cf; }
.detail-layout { display: grid; grid-template-columns: minmax(0,1fr) 280px; gap: 14px; }
.conversation-card { padding: 0; }
.conversation-thread { padding: 18px 18px 8px; }
.message { display: grid; grid-template-columns: 32px minmax(0,1fr); gap: 10px; margin-bottom: 16px; }
.message__head { display: flex; justify-content: space-between; gap: 10px; font-size: 12px; }
.message__head span { color: var(--muted); font-size: 11px; }
.message__bubble { margin-top: 6px; padding: 12px 14px; background: #f4f6f8; border-radius: 4px 10px 10px 10px; font-size: 13px; line-height: 1.55; font-weight: 400; }
.message--operator .message__bubble { background: #edf8f5; }
.message--note .message__bubble { color: #77531e; background: #fff8e8; border-left: 3px solid #edb84f; }
.message-label { display: inline-flex; align-items: center; gap: 5px; margin-top: 6px; color: #a07121; font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.composer { margin: 0 16px 16px; border: 1px solid var(--line-strong); border-radius: 10px; overflow: hidden; background: #fff; }
.composer-tabs { display: flex; border-bottom: 1px solid var(--line); background: #fafbfc; }
.composer-tab { display: inline-flex; align-items: center; gap: 6px; min-height: 38px; padding: 0 12px; border: 0; border-right: 1px solid var(--line); background: transparent; color: var(--muted); font-size: 12px; font-weight: 600; }
.composer-tab.is-active { color: var(--teal-dark); background: #fff; }
.composer-form { margin: 0; }
.composer textarea { display: block; width: 100%; min-height: 100px; padding: 14px; border: 0; resize: vertical; font-weight: 400; }
.composer textarea:focus { outline: 0; }
.composer-actions { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; padding: 8px; border-top: 1px solid var(--line); }
.composer-file {
  position: relative; display: inline-flex; align-items: center; gap: 6px;
  min-height: 32px; padding: 0 10px; border: 1px solid var(--line-strong);
  border-radius: 8px; color: var(--teal-dark); background: #fff;
  font-size: 12px; font-weight: 600; cursor: pointer;
}
.composer-file:hover { background: var(--teal-100); }
.composer-file input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.composer-file-hint { flex: 1 1 180px; font-size: 11px; }
.message-files { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.att-thumb {
  display: flex; flex-direction: column; width: 168px; overflow: hidden;
  border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--teal-ink);
  text-decoration: none;
}
.att-thumb img { display: block; width: 100%; height: 110px; object-fit: cover; background: #eef2f6; }
.att-thumb span { padding: 6px 8px; font-size: 11px; line-height: 1.35; word-break: break-word; }
.att-chip {
  display: inline-flex; align-items: center; gap: 6px;
  max-width: 100%; padding: 8px 10px; border: 1px solid var(--line);
  border-radius: 8px; background: #fff; color: var(--teal-ink); text-decoration: none;
}
.att-chip span { font-size: 12px; font-weight: 600; word-break: break-word; }
.att-chip small { color: var(--muted); font-size: 11px; }
.detail-aside { display: flex; flex-direction: column; gap: 12px; }
.aside-section { padding: 14px 16px; }
.aside-section h3 { margin: 0 0 12px; font-size: 13px; color: var(--teal-ink); display: flex; align-items: center; gap: 6px; }
.stack-form .btn { margin-top: 4px; }
.confidence { padding: 10px; border-radius: 8px; background: var(--teal-100); }
.confidence__head { display: flex; justify-content: space-between; color: var(--teal-ink); font-size: 12px; font-weight: 600; }
.confidence-bar { height: 6px; margin: 8px 0; background: #cfe6d9; border-radius: 6px; overflow: hidden; }
.confidence-bar span { display: block; height: 100%; background: #1a7a5c; }
.confidence p { margin: 0; color: #51776a; font-size: 11px; line-height: 1.45; }
.confidence.is-low { background: #f6ece8; }
.confidence.is-low .confidence__head { color: var(--rust); }
.confidence.is-low .confidence-bar span { background: var(--rust); }
.ai-reason { margin-top: 6px !important; font-style: italic; }
.history-item { position: relative; display: grid; grid-template-columns: 20px 1fr; gap: 8px; padding-bottom: 12px; }
.history-item::after { content: ""; position: absolute; left: 9px; top: 20px; bottom: 0; width: 1px; background: var(--line); }
.history-item:last-child { padding-bottom: 0; }
.history-item:last-child::after { display: none; }
.history-item__icon { z-index: 1; display: grid; place-items: center; width: 20px; height: 20px; color: var(--teal-dark); background: var(--teal-100); border-radius: 50%; }
.history-item__icon .ui-icon { width: 11px; height: 11px; }
.history-item p { margin: 0 0 2px; font-size: 12px; font-weight: 400; }
.history-item small { color: var(--muted); font-size: 10px; }

.report-tabs {
  display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 14px;
  padding: 4px; width: fit-content; max-width: 100%;
  background: #fff; border: 1px solid var(--line); border-radius: 10px;
}
.report-tab {
  display: inline-flex; align-items: center; min-height: 34px; padding: 0 14px;
  border-radius: 8px; color: var(--muted); font-size: 12px; font-weight: 600;
}
.report-tab.is-active { color: var(--teal-ink); background: var(--teal-100); }
.report-filters {
  display: flex; flex-wrap: wrap; align-items: end; gap: 10px; margin-bottom: 8px;
}
.report-presets { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 4px; }
.report-presets .chip-filter { position: relative; cursor: pointer; }
.report-presets .chip-filter:has(input:checked) { background: #155542; color: #fff; border-color: #155542; }
.report-presets input { position: absolute; opacity: 0; pointer-events: none; }
.report-date { margin: 0; min-width: 140px; }
.report-date input, .report-date select { min-height: 38px; }
.report-range { margin: 0 0 16px; color: var(--muted); font-size: 12px; }
.report-note { margin: 0 0 14px; color: var(--ink-soft); font-size: 12px; line-height: 1.45; max-width: 72ch; }
.report-kpis {
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px;
}
.report-kpi {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px; box-shadow: var(--shadow);
}
.report-kpi span { display: block; color: var(--muted); font-size: 11px; font-weight: 600; }
.report-kpi strong { display: block; margin: 6px 0 2px; font-size: 26px; font-weight: 600; color: var(--teal-ink); letter-spacing: -.03em; }
.report-kpi small { color: var(--muted); font-size: 11px; }
.report-kpi.is-warn { border-color: #ead9a8; background: #fbf6ea; }
.report-kpi.is-alert { border-color: #e8c4b6; background: #f8eeea; }
.report-kpi.is-alert strong, .report-kpi.is-warn strong { color: var(--rust); }
.report-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px; }
.report-load { display: grid; grid-template-columns: 28px 1fr auto minmax(60px, 1fr) 28px; gap: 8px; align-items: center; margin-bottom: 8px; }
.report-load-bar { max-width: none; }
.report-op { display: inline-flex; align-items: center; gap: 8px; }
.report-table td, .report-table th { white-space: nowrap; }
.report-spark { display: flex; align-items: flex-end; gap: 3px; height: 88px; padding: 4px 2px 0; }
.report-spark-col { flex: 1; display: flex; align-items: flex-end; height: 100%; min-width: 4px; }
.report-spark-col span { display: block; width: 100%; border-radius: 3px 3px 0 0; background: #1f9370; min-height: 3px; }
.report-spark-axis { display: flex; justify-content: space-between; margin-top: 6px; color: var(--muted); font-size: 10px; }
.report-ia-meta { margin: -4px 0 10px; padding-left: 0; }

@media (max-width: 1200px) {
  .report-kpis { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 980px) {
  .report-kpis, .report-grid { grid-template-columns: 1fr 1fr; }
  .report-load { grid-template-columns: 28px 1fr auto; }
  .report-load-bar { display: none; }
}
.field textarea { min-height: 90px; resize: vertical; font-weight: 400; }

.mail-toast {
  position: fixed; right: 22px; bottom: 22px; z-index: 80;
  min-width: 240px; max-width: 340px; padding: 12px 14px;
  color: #fff; background: var(--navy); border-radius: 10px;
  box-shadow: 0 12px 32px rgba(13, 33, 61, .28);
  display: flex; flex-direction: column; gap: 2px;
}
.mail-toast[hidden] { display: none; }
.mail-toast strong { font-size: 13px; font-weight: 600; }
.mail-toast span { color: #c5d0de; font-size: 12px; }

@media (max-width: 1200px) {
  .kpi-row { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 980px) {
  .login-panel, .dash-grid, .queue-grid, .settings-grid, .detail-layout, .sig-layout, .holiday-add, .holiday-item { grid-template-columns: 1fr; }
  .kpi-row { grid-template-columns: repeat(2, 1fr); }
  .sidebar { transform: translateX(-100%); }
  .app-area { margin-left: 0; width: 100%; }
}
@media (max-width: 720px) {
  .tickets-layout { grid-template-columns: 1fr; }
  .queue-rail { position: static; display: grid; grid-template-columns: repeat(2, 1fr); }
  .queue-rail-head { grid-column: 1 / -1; }
  .sla-rule, .survey-edit { grid-template-columns: 1fr; }
}
