
:root {
  --bg: #f4f6f8;
  --panel: #ffffff;
  --text: #18202a;
  --muted: #687386;
  --border: #e2e7ec;
  --accent: #0f766e;
  --accent-2: #115e59;
  --sidebar: #101820;
  --sidebar-muted: #94a3b8;
  --success: #166534;
  --warning: #92400e;
  --danger: #991b1b;
  --info: #1d4ed8;
  --shadow: 0 10px 32px rgba(15, 23, 42, .07);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
}

button, input, select { font: inherit; }

button { cursor: pointer; }

#app { min-height: 100vh; display: grid; grid-template-columns: 248px 1fr; }

.sidebar {
  background: var(--sidebar);
  color: white;
  padding: 24px 18px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand { display: flex; gap: 12px; align-items: center; margin-bottom: 30px; }
.brand-mark {
  width: 42px; height: 42px; border-radius: 12px;
  display: grid; place-items: center;
  background: white; color: var(--sidebar);
  font-weight: 800;
}
.brand strong { display: block; font-size: 15px; }
.brand span { display: block; color: var(--sidebar-muted); font-size: 12px; margin-top: 3px; }

nav { display: grid; gap: 6px; }

.nav-item {
  text-align: left;
  border: 0;
  background: transparent;
  color: #d5dde6;
  padding: 11px 12px;
  border-radius: 9px;
}
.nav-item:hover, .nav-item.active { background: rgba(255,255,255,.09); color: white; }

.sidebar-bottom { margin-top: auto; display: grid; gap: 12px; }
.server-status { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--sidebar-muted); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #64748b; }
.dot.ok { background: #4ade80; }
.dot.error { background: #f87171; }

.main { min-width: 0; }
.topbar {
  background: rgba(244,246,248,.92);
  backdrop-filter: blur(12px);
  position: sticky; top: 0; z-index: 20;
  min-height: 88px;
  padding: 20px 32px;
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid var(--border);
}
.topbar h1 { margin: 0; font-size: 23px; }
.topbar p { margin: 5px 0 0; color: var(--muted); font-size: 13px; }
.top-actions, .detail-actions, .modal-actions { display: flex; gap: 10px; }

.page { display: none; padding: 28px 32px 48px; }
.page.active { display: block; }

.primary, .secondary, .ghost {
  border-radius: 9px;
  padding: 10px 14px;
  border: 1px solid transparent;
  font-weight: 650;
}
.primary { background: var(--accent); color: white; }
.primary:hover { background: var(--accent-2); }
.secondary { background: #eef6f5; color: var(--accent-2); border-color: #cce3e0; }
.ghost { background: white; color: var(--text); border-color: var(--border); }
.sidebar .ghost { background: transparent; color: #d5dde6; border-color: rgba(255,255,255,.14); }
.small { padding: 8px 10px; font-size: 12px; }
.full { width: 100%; }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(120px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}
.stat {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 13px;
  padding: 18px;
  box-shadow: var(--shadow);
}
.stat span { color: var(--muted); font-size: 12px; }
.stat strong { display: block; font-size: 28px; margin-top: 6px; }

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow);
  overflow: hidden;
  margin-bottom: 20px;
}
.panel-head {
  padding: 18px 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  border-bottom: 1px solid var(--border);
}
.panel-head h2, .upload-panel h2 { margin: 0; font-size: 17px; }
.panel-head p, .upload-panel p { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.analytics-export-actions { display: grid; gap: 7px; justify-items: end; min-width: 205px; }
.analytics-export-actions .button-row { display: flex; gap: 7px; flex-wrap: wrap; justify-content: flex-end; }

.search-wrap input, .control select, .modal-card input {
  border: 1px solid var(--border);
  border-radius: 9px;
  background: white;
  padding: 10px 12px;
  min-width: 260px;
  outline: none;
}
.search-wrap input:focus, .modal-card input:focus { border-color: #7cb8b2; box-shadow: 0 0 0 3px rgba(15,118,110,.1); }

.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 13px 18px; border-bottom: 1px solid var(--border); text-align: left; font-size: 13px; }
th { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .04em; background: #fafbfc; }
tr:last-child td { border-bottom: 0; }
tr:hover td { background: #fbfcfd; }

.badge {
  display: inline-flex; align-items: center;
  padding: 5px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .02em;
  white-space: nowrap;
}
.badge.success { background: #dcfce7; color: var(--success); }
.badge.warning { background: #fef3c7; color: var(--warning); }
.badge.danger { background: #fee2e2; color: var(--danger); }
.badge.info { background: #dbeafe; color: var(--info); }
.badge.neutral { background: #edf0f3; color: #526070; }

.title-grid { padding: 18px; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.title-card {
  border: 1px solid var(--border); border-radius: 12px; padding: 16px;
  background: white;
}
.title-card:hover { border-color: #c5cfda; box-shadow: 0 8px 22px rgba(15,23,42,.06); }
.title-card .row { display: flex; justify-content: space-between; gap: 12px; }
.title-card h3 { margin: 0; font-size: 17px; }
.title-card p { margin: 7px 0 0; color: var(--muted); font-size: 12px; }
.title-card .meta { margin-top: 14px; display: flex; gap: 6px; flex-wrap: wrap; }
.title-filters { display: grid; grid-template-columns: repeat(4, minmax(130px, 1fr)) auto; align-items: end; gap: 10px; padding: 0 18px 16px; }
.title-filters label { display: grid; gap: 5px; color: var(--muted); font-size: 10px; font-weight: 750; }
.title-filters select { width: 100%; min-width: 0; border: 1px solid var(--border); border-radius: 8px; padding: 8px 9px; background: white; color: var(--text); }
.title-group { grid-column: 1 / -1; margin-top: 5px; padding: 8px 2px 2px; color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.title-card-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 12px; }
.titles-search-summary { padding: 0 18px 13px; color: var(--muted); font-size: 11px; }
.title-card-actions .archive-audit-btn { color: #8d3b32; border-color: #f0d0ca; background: #fffafa; }
.title-card-actions .archive-audit-btn:hover { border-color: #d59d94; background: #fff3f0; }
.operational-badge { border-color: #c7d8e4; background: #edf5f8; color: #24556b; }
.title-operational-hint { display: block; margin-top: 8px; color: var(--muted); font-size: 10px; line-height: 1.4; }

.batch-controls { padding: 16px 20px; display: flex; align-items: center; gap: 16px; border-bottom: 1px solid var(--border); }
.control { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.control select { min-width: 200px; }
.check { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.grow { flex: 1; }
.batch-list { max-height: 430px; overflow: auto; }
.batch-row { padding: 11px 20px; display: grid; grid-template-columns: 30px 90px minmax(170px, 1fr) minmax(230px, 1.4fr) auto 120px; align-items: center; gap: 12px; border-bottom: 1px solid var(--border); }
.batch-row:last-child { border-bottom: 0; }
.batch-row > span { min-width: 0; font-size: 12px; }
.batch-row > span small { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; }
.batch-execution-state { color: var(--muted); font-size: 10px !important; font-weight: 800; letter-spacing: .03em; }
.batch-execution-state.is-running { color: #9a6700; }
.batch-execution-state.is-done { color: #167a55; }
.batch-execution-state.is-error { color: #b42318; }

.progress { height: 8px; margin: 20px; background: #edf0f3; border-radius: 999px; overflow: hidden; }
.progress > div { height: 100%; width: 0; background: var(--accent); transition: width .25s ease; }
.job-results { padding: 0 20px 16px; display: grid; gap: 8px; }
.job-item { border: 1px solid var(--border); border-radius: 9px; padding: 10px 12px; display: flex; justify-content: space-between; gap: 10px; font-size: 13px; }
.logs { margin: 0 20px 20px; border: 1px solid var(--border); border-radius: 9px; padding: 10px 12px; }
.logs pre { max-height: 240px; overflow: auto; white-space: pre-wrap; color: #354152; font-size: 11px; }

.upload-panel { max-width: 720px; margin: 0 auto; padding: 24px; overflow: visible; }
.dropzone {
  margin: 22px 0 14px;
  border: 2px dashed #cbd5df;
  border-radius: 14px;
  min-height: 230px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 7px;
  color: var(--muted);
  background: #fafbfc;
}
.dropzone.drag { border-color: var(--accent); background: #f0f9f8; }
.drop-icon { width: 54px; height: 54px; display: grid; place-items: center; border-radius: 12px; background: #e8eeef; color: var(--accent-2); font-weight: 900; }
.dropzone strong { color: var(--text); }
.upload-info { margin-top: 12px; font-size: 13px; color: var(--muted); white-space: pre-line; }

.back { margin-bottom: 15px; }
.detail-head { display: flex; justify-content: space-between; gap: 20px; align-items: flex-end; margin-bottom: 18px; }
.eyebrow { text-transform: uppercase; font-size: 10px; color: var(--muted); font-weight: 800; letter-spacing: .08em; }
.detail-head h2 { margin: 3px 0; font-size: 30px; }
.detail-head p { margin: 0; color: var(--muted); }

.detail-summary { display: grid; grid-template-columns: repeat(6, minmax(135px, 1fr)); gap: 12px; margin-bottom: 20px; }
.summary-box { background: white; border: 1px solid var(--border); border-radius: 12px; padding: 15px; }
.summary-box span { font-size: 11px; color: var(--muted); display: block; }
.summary-box strong { font-size: 15px; display: block; margin-top: 6px; }

.analytics-note { display: grid; gap: 4px; margin-bottom: 18px; }
.analytics-note strong { font-size: 20px; }
.analytics-note > span:last-child { color: var(--muted); font-size: 13px; }
.analytics-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.analytics-stats .stat strong { font-size: 22px; }
.export-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: -6px 0 16px; color: var(--muted); font-size: 12px; }
.export-bar span { margin-right: 4px; font-weight: 700; color: var(--text); }
.overview-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-top: 18px; }
.overview-columns h4 { margin: 0 0 8px; }
.lead-copy { color: var(--muted); line-height: 1.7; }
.compact-list { margin: 0; padding-left: 18px; color: var(--muted); font-size: 13px; line-height: 1.65; }
.attention-box { border: 1px solid #f4c7a1; background: #fff8ed; border-radius: 10px; padding: 12px 14px; margin-top: 16px; }

.tabs { display: flex; gap: 3px; border-bottom: 1px solid var(--border); margin-bottom: 16px; overflow-x: auto; }
.tab { border: 0; background: transparent; color: var(--muted); padding: 11px 13px; border-bottom: 2px solid transparent; }
.tab.active { color: var(--accent-2); border-color: var(--accent); font-weight: 700; }
.tab-content { display: none; }
.tab-content.active { display: block; }

.kv-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.kv { background: white; border: 1px solid var(--border); border-radius: 10px; padding: 13px; }
.kv span { display: block; color: var(--muted); font-size: 10px; text-transform: uppercase; }
.kv strong { display: block; margin-top: 5px; font-size: 13px; overflow-wrap: anywhere; }

.doc-list, .recon-list, .finding-list { display: grid; gap: 10px; }
.doc, .recon, .finding { background: white; border: 1px solid var(--border); border-radius: 11px; padding: 14px; }
.doc { display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.doc small { color: var(--muted); display: block; margin-top: 4px; }
.recon-head, .finding-head { display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.recon h4, .finding h4 { margin: 0; }
.recon p, .finding p { color: var(--muted); font-size: 12px; line-height: 1.6; }

pre.json {
  background: #111827;
  color: #e5eef7;
  padding: 18px;
  border-radius: 12px;
  overflow: auto;
  max-height: 650px;
  font-size: 12px;
  line-height: 1.55;
}

#toast {
  position: fixed; right: 22px; bottom: 22px; z-index: 100;
  display: grid; gap: 8px;
}
.toast {
  min-width: 280px; max-width: 430px;
  background: #17212b; color: white;
  border-radius: 10px; padding: 12px 14px;
  box-shadow: var(--shadow);
  font-size: 13px;
}
.toast.error { background: #7f1d1d; }

.modal {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(2,8,23,.55);
  display: grid; place-items: center;
  padding: 20px;
}
.modal-card { width: min(430px, 100%); background: white; border-radius: 15px; padding: 22px; box-shadow: 0 24px 80px rgba(0,0,0,.25); }
.modal-card h2 { margin-top: 0; }
.modal-card p { color: var(--muted); font-size: 13px; line-height: 1.5; }
.modal-card input { width: 100%; min-width: 0; margin: 8px 0 16px; }
.modal-actions { justify-content: flex-end; }

.hidden { display: none !important; }

/* Painel corporativo: a visão geral prioriza decisão, risco e valor financeiro. */
#app { min-height: 100vh; display: grid; grid-template-columns: 244px minmax(0, 1fr); align-items: start; }

.corporate-header {
  grid-column: 1;
  grid-row: 1;
  min-height: 100vh;
  height: 100vh;
  padding: 24px 16px 18px;
  display: flex;
  align-items: stretch;
  flex-direction: column;
  gap: 22px;
  background: linear-gradient(180deg, #10202b 0%, #0b1720 100%);
  color: #f8fafc;
  border-right: 1px solid rgba(255,255,255,.08);
  position: sticky;
  top: 0;
  z-index: 40;
}
.brand-button { border: 0; padding: 0; background: transparent; color: inherit; cursor: pointer; text-align: left; margin: 0; }
.corporate-header .brand { flex: 0 0 auto; margin: 0; }
.corporate-header .brand span { color: #94a3b8; }
.primary-nav { display: grid !important; align-content: start; align-items: center; gap: 5px; flex: 1; overflow-y: auto; }
.nav-section-label { padding: 12px 10px 4px; color: #8295a5; font-size: 9px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.primary-nav .nav-item { display: flex; align-items: center; gap: 11px; min-height: 42px; color: #bfccd8; white-space: nowrap; padding: 9px 11px; border: 1px solid transparent; border-radius: 10px; }
.primary-nav .nav-item:hover, .primary-nav .nav-item.active { background: rgba(255,255,255,.09); border-color: rgba(255,255,255,.07); color: #fff; }
.primary-nav .nav-item.active { box-shadow: inset 3px 0 #5eead4; }
.nav-icon { width: 20px; flex: 0 0 20px; color: #8fa5b5; font-size: 17px; font-weight: 800; text-align: center; }
.nav-item.active .nav-icon { color: #5eead4; }
.header-actions { display: grid; align-items: stretch; gap: 11px; margin: auto 0 0; }
.header-actions .server-status { color: #a8b7c7; white-space: nowrap; }
.header-actions .ghost { background: rgba(255,255,255,.06); color: #eff6ff; border-color: rgba(255,255,255,.14); }
.user-context { display: grid; text-align: left; min-width: 104px; padding: 9px 10px; border: 1px solid rgba(255,255,255,.08); border-radius: 9px; background: rgba(255,255,255,.035); }
.user-context span { color: #94a3b8; font-size: 10px; text-transform: uppercase; letter-spacing: .08em; }
.user-context strong { font-size: 12px; color: #f8fafc; margin-top: 3px; }
.export-menu-wrap { position: relative; }
.export-menu { position: absolute; right: 0; top: calc(100% + 8px); min-width: 170px; padding: 6px; display: grid; background: #fff; border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow); z-index: 60; }
.export-menu button { border: 0; background: transparent; color: var(--text); text-align: left; padding: 9px 10px; border-radius: 7px; }
.export-menu button:hover { background: #f1f5f9; }
.main { grid-column: 2; grid-row: 1; min-width: 0; }
.workspace-head { min-height: 74px; padding: 16px 32px; display: flex; align-items: center; justify-content: space-between; gap: 18px; border-bottom: 1px solid var(--border); background: rgba(255,255,255,.97); position: sticky; top: 0; z-index: 25; box-shadow: 0 5px 18px rgba(15,23,42,.035); }
.workspace-head h1 { margin: 0; font-size: 21px; letter-spacing: -.02em; }
.workspace-head p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }

.command-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 18px; }
.command-heading h2 { margin: 4px 0 5px; font-size: 25px; letter-spacing: -.03em; }
.command-heading p { margin: 0; color: var(--muted); font-size: 13px; }
.updated-note { color: var(--muted); font-size: 12px; text-align: right; max-width: 220px; }
.command-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.command-kpi { background: #fff; padding: 17px 18px; border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 5px 18px rgba(15,23,42,.04); }
.command-kpi span { display: block; color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; }
.command-kpi strong { display: block; font-size: 28px; margin: 7px 0 2px; letter-spacing: -.04em; }
.command-kpi small { color: #7a8898; font-size: 11px; }
.financial-strip { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); background: #0f766e; color: #f8fffe; border-radius: 13px; overflow: hidden; margin-bottom: 20px; box-shadow: 0 10px 26px rgba(15,118,110,.15); }
.financial-strip > div { padding: 17px 20px; border-right: 1px solid rgba(255,255,255,.16); }
.financial-strip > div:last-child { border-right: 0; }
.financial-strip span { display: block; color: #c9eeea; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; }
.financial-strip strong { display: block; font-size: 20px; margin-top: 6px; letter-spacing: -.03em; }
.priority-panel { border-color: #dbe5ed; }
.priority-panel .panel-head { background: #fbfcfd; }
.priority-reason { color: #526070; max-width: 510px; line-height: 1.45; }
.priority-panel small, #pendingTable small { color: var(--muted); font-size: 11px; }
.empty-state { color: var(--muted); text-align: center; padding: 26px; }

.work-focus-panel { overflow: visible; }
.work-filters {
  display: grid;
  grid-template-columns: repeat(5, minmax(135px, 1fr)) auto;
  align-items: end;
  gap: 12px;
  padding: 16px 20px;
  background: #f8fafc;
  border-bottom: 1px solid var(--border);
}
.work-filters label { display: grid; gap: 6px; color: var(--muted); font-size: 11px; font-weight: 750; }
.work-filters select, .work-filters input { width: 100%; min-width: 0; border: 1px solid var(--border); border-radius: 9px; padding: 9px 10px; background: #fff; color: var(--text); }
.work-filter-summary { padding: 12px 20px; color: var(--muted); font-size: 12px; font-weight: 650; }
.analytics-note-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 20px; background: #fbfcfd; border-bottom: 1px solid var(--border); }
.analytics-note-toolbar > div:first-child { display: grid; gap: 4px; }
.analytics-note-toolbar strong { font-size: 13px; color: var(--text); }
.analytics-note-toolbar small { color: var(--muted); font-size: 11px; }
.analytics-note-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.analytics-note-actions select { min-width: 178px; border: 1px solid var(--border); border-radius: 9px; padding: 8px 10px; background: #fff; color: var(--text); }
.analytics-row-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.table-link { border: 0; padding: 0; background: transparent; color: var(--accent-2); font-weight: 750; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.table-link:hover { color: var(--accent); }
.analytics-note-check { width: 16px; height: 16px; accent-color: var(--accent); }
.work-focus-panel td small, .work-focus-panel td strong + small { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; font-weight: 500; }
.work-focus-panel td:first-child strong, .work-focus-panel td:nth-child(2) strong { white-space: nowrap; }
.work-focus-panel td.critical-point { min-width: 260px; max-width: 390px; color: #526070; font-size: 12px; line-height: 1.35; }

.work-click-target {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--accent-2);
  font: inherit;
  font-weight: 800;
  text-align: left;
  cursor: pointer;
}
.work-click-target:hover { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.analytics-work-row:hover td { background: #f8fbfc; }
.work-drawer { position: fixed; inset: 0; z-index: 150; }
.work-drawer-backdrop { position: absolute; inset: 0; background: rgba(2, 8, 23, .42); }
.work-drawer-panel {
  position: absolute;
  top: 0;
  right: 0;
  display: flex;
  width: min(var(--work-drawer-width, 600px), 100vw);
  min-width: 0;
  height: 100%;
  flex-direction: column;
  background: #fff;
  box-shadow: -18px 0 45px rgba(15, 23, 42, .22);
  animation: work-drawer-in .18s ease-out;
}
.work-drawer-resize-handle {
  position: absolute;
  z-index: 3;
  top: 0;
  bottom: 0;
  left: -8px;
  width: 16px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: col-resize;
  touch-action: none;
}
.work-drawer-resize-handle::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 6px;
  width: 3px;
  height: 58px;
  border-radius: 3px;
  background: #c8d3df;
  transform: translateY(-50%);
  transition: background-color .16s ease, height .16s ease;
}
.work-drawer-resize-handle:hover::before,
.work-drawer-resize-handle:focus-visible::before,
.work-drawer-panel.is-resizing .work-drawer-resize-handle::before { background: var(--accent); height: 78px; }
.work-drawer-resize-handle:focus-visible { outline: 2px solid var(--accent); outline-offset: -1px; }
body.work-drawer-resizing, body.work-drawer-resizing * { user-select: none !important; cursor: col-resize !important; }
.work-drawer-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 20px 22px; border-bottom: 1px solid var(--border); }
.work-drawer-head h2 { margin: 5px 0 4px; font-size: 23px; letter-spacing: -.02em; }
.work-drawer-head p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.work-drawer-head-actions { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.work-drawer-resize-hint { color: var(--muted); font-size: 10px; white-space: nowrap; }
.work-drawer-body { overflow-y: auto; padding: 18px 22px 30px; }
.work-drawer-summary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.work-drawer-summary .summary-box { padding: 12px; }
.work-drawer-summary .summary-box strong { font-size: 14px; }
.work-drawer-section { margin-top: 21px; padding-top: 17px; border-top: 1px solid var(--border); }
.work-drawer-section h3 { margin: 0 0 10px; font-size: 15px; }
.work-drawer-section > p { color: var(--muted); font-size: 12px; line-height: 1.55; }
.work-drawer-list { display: grid; gap: 9px; margin: 0; padding: 0; list-style: none; }
.work-drawer-list li { padding: 11px 12px; border: 1px solid var(--border); border-radius: 10px; background: #fbfcfd; color: #3f4d5d; font-size: 12px; line-height: 1.5; }
.work-drawer-list li strong { color: var(--text); }
.work-drawer-note { display: grid; gap: 8px; padding: 12px; border: 1px solid var(--border); border-radius: 11px; background: #fff; }
.work-drawer-note + .work-drawer-note { margin-top: 9px; }
.work-drawer-note-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.work-drawer-note-title { color: var(--text); font-weight: 800; }
.work-drawer-note-meta { display: flex; flex-wrap: wrap; gap: 6px; color: var(--muted); font-size: 11px; }
.work-drawer-note-actions { display: flex; flex-wrap: wrap; gap: 7px; }
.drawer-breadcrumb { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; margin-bottom: 14px; color: var(--muted); font-size: 11px; }
.drawer-breadcrumb strong { color: var(--text); font-size: 12px; }
.drawer-breadcrumb .ghost { padding: 4px 8px; }
.drawer-note-hero { display: grid; gap: 10px; padding: 14px; border: 1px solid #dce7ee; border-radius: 12px; background: linear-gradient(135deg, #f7fbfc, #fff); }
.work-drawer-report-callout { padding: 14px; border: 1px solid #cfe8e3; border-radius: 12px; background: #f2fbf8; }
.work-drawer-report-callout h3 { margin-bottom: 6px; }
.work-drawer-report-callout p { margin-bottom: 11px; }
.drawer-note-hero h3 { margin: 0; font-size: 18px; }
.drawer-note-hero p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.drawer-note-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.drawer-audit-explain { margin: 0 0 12px; color: var(--muted); font-size: 12px; line-height: 1.55; }
.work-drawer-doc-list { display: grid; gap: 8px; }
.work-drawer-doc { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 11px; border: 1px solid var(--border); border-radius: 10px; background: #fbfcfd; }
.work-drawer-doc > div:first-child { min-width: 0; }
.work-drawer-doc strong, .work-drawer-doc small { display: block; overflow-wrap: anywhere; }
.work-drawer-doc strong { color: var(--text); font-size: 12px; }
.work-drawer-doc small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.work-drawer-doc .ghost { flex: 0 0 auto; }
.work-note-findings { display: grid; gap: 8px; }
.work-note-finding { padding: 10px 11px; border: 1px solid var(--border); border-radius: 10px; background: #fbfcfd; color: #3f4d5d; font-size: 12px; line-height: 1.5; }
.work-note-finding strong { color: var(--text); }
.work-evidence-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.work-evidence-card { overflow: hidden; margin: 0; border: 1px solid var(--border); border-radius: 10px; background: #f8fafc; }
.work-evidence-card img { display: block; width: 100%; height: 190px; object-fit: contain; background: #eef2f5; cursor: zoom-in; }
.work-evidence-card figcaption { padding: 8px 9px; color: var(--muted); font-size: 10px; line-height: 1.4; overflow-wrap: anywhere; }
.work-drawer-loading { padding: 15px; border: 1px dashed #b9c8d5; border-radius: 10px; color: var(--muted); font-size: 12px; text-align: center; }
.work-drawer-empty { color: var(--muted); font-size: 12px; line-height: 1.55; }
body.work-drawer-open { overflow: hidden; }
@keyframes work-drawer-in { from { transform: translateX(18px); opacity: .75; } to { transform: translateX(0); opacity: 1; } }

.treatment-stats { margin-bottom: 18px; }
.treatment-filter-panel { overflow: visible; }
.treatment-filters { grid-template-columns: repeat(6, minmax(135px, 1fr)) auto; }
.treatment-bulkbar { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; padding: 12px 20px; border-top: 1px solid var(--border); background: #fff; }
.treatment-bulkbar strong { margin-right: auto; font-size: 12px; color: var(--text); }
.treatment-bulkbar input, .treatment-bulkbar select { min-width: 155px; border: 1px solid var(--border); border-radius: 9px; padding: 8px 10px; background: #fff; color: var(--text); }
.kanban-board { display: grid; grid-template-columns: repeat(6, minmax(245px, 1fr)); gap: 12px; overflow-x: auto; padding: 2px 2px 12px; scroll-snap-type: x proximity; }
.kanban-column { min-height: 360px; border: 1px solid var(--border); border-radius: 12px; background: #f8fafc; transition: border-color .16s ease, background-color .16s ease, transform .16s ease; }
.kanban-column { scroll-snap-align: start; }
.kanban-column.is-drag-over { border-color: var(--accent); background: #effaf8; transform: translateY(-2px); }
.kanban-column-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px; border-bottom: 1px solid var(--border); background: #fff; border-radius: 12px 12px 0 0; }
.kanban-column-head strong { font-size: 12px; }
.kanban-column-head .badge { min-width: 25px; justify-content: center; }
.kanban-cards { display: grid; gap: 9px; padding: 10px; }
.kanban-instruction { margin: -8px 0 12px; color: var(--muted); font-size: 12px; }
.kanban-drop-hint { margin: 9px 10px 0; padding: 7px 9px; border: 1px dashed #b7c8d1; border-radius: 8px; color: #607482; background: rgba(255,255,255,.65); font-size: 10px; text-align: center; }
.kanban-empty { padding: 20px 12px; color: var(--muted); font-size: 11px; text-align: center; }
.kanban-card { display: grid; gap: 8px; padding: 12px; border: 1px solid var(--border); border-radius: 10px; background: #fff; box-shadow: 0 3px 12px rgba(15,23,42,.04); cursor: grab; transition: transform .18s ease, opacity .18s ease, box-shadow .18s ease, border-color .18s ease; }
.kanban-card:active { cursor: grabbing; }
.kanban-card.is-dragging { opacity: .42; transform: rotate(1deg) scale(.98); }
.kanban-card.is-moving { opacity: .62; transform: scale(.98); }
.kanban-card-enter { animation: kanban-card-enter .36s ease-out; }
@keyframes kanban-card-enter { from { opacity: .25; transform: translateY(-8px) scale(.97); } to { opacity: 1; transform: translateY(0) scale(1); } }
.kanban-card:hover { border-color: #9fb4c3; box-shadow: 0 8px 18px rgba(15,23,42,.08); }
.kanban-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.kanban-card-head strong { color: var(--accent-2); font-size: 13px; }
.kanban-card small { color: var(--muted); font-size: 10px; line-height: 1.4; }
.kanban-card .card-line { display: flex; flex-wrap: wrap; gap: 5px; }
.kanban-card .card-action { color: #526070; font-size: 11px; line-height: 1.4; }
.kanban-card .card-action strong { color: var(--text); }
.kanban-card .card-footer { display: flex; align-items: center; justify-content: space-between; gap: 7px; padding-top: 7px; border-top: 1px solid #edf1f4; }
.kanban-card .card-footer .ghost { white-space: nowrap; }
.kanban-audit-split { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(280px, .8fr); gap: 13px; margin-bottom: 18px; align-items: start; }
.kanban-audit-pane { min-width: 0; padding: 14px; border: 1px solid var(--border); border-radius: 12px; background: #fff; box-shadow: 0 4px 14px rgba(15,23,42,.035); }
.kanban-audit-pane.decision { border-color: #c8e3df; background: linear-gradient(160deg, #f4fbfa, #fff 65%); }
.kanban-audit-pane-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; margin-bottom: 11px; }
.kanban-audit-pane-head h3 { margin: 2px 0 0; font-size: 14px; }
.kanban-audit-pane-head .eyebrow { font-size: 9px; }
.kanban-audit-rules { display: grid; gap: 7px; max-height: 390px; overflow: auto; padding-right: 3px; }
.kanban-audit-rule { padding: 9px 10px; border: 1px solid #e7edf0; border-radius: 9px; background: #fbfcfd; }
.kanban-audit-rule-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.kanban-audit-rule-head strong { font-size: 11px; line-height: 1.4; }
.kanban-audit-rule p, .kanban-decision-copy { margin: 6px 0 0; color: #526070; font-size: 11px; line-height: 1.5; overflow-wrap: anywhere; }
.kanban-audit-rule small { display: block; margin-top: 5px; color: var(--muted); font-size: 9px; }
.kanban-decision-kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; margin: 10px 0; }
.kanban-decision-kpi { padding: 9px; border: 1px solid #dcebe8; border-radius: 8px; background: rgba(255,255,255,.8); }
.kanban-decision-kpi span, .kanban-decision-kpi strong { display: block; }
.kanban-decision-kpi span { color: var(--muted); font-size: 9px; }
.kanban-decision-kpi strong { margin-top: 4px; font-size: 12px; }
.kanban-decision-trace { margin-top: 9px; }
.kanban-decision-trace summary { cursor: pointer; color: var(--accent-2); font-size: 10px; font-weight: 750; }
.kanban-decision-trace pre { max-height: 190px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 9px; }
.kanban-audit-loading, .kanban-audit-empty { padding: 14px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.workflow-form { display: grid; gap: 13px; }
.workflow-form label { display: grid; gap: 6px; color: var(--muted); font-size: 11px; font-weight: 750; }
.workflow-form input, .workflow-form select, .workflow-form textarea { width: 100%; min-width: 0; border: 1px solid var(--border); border-radius: 9px; padding: 9px 10px; background: #fff; color: var(--text); font: inherit; }
.workflow-form textarea { min-height: 76px; resize: vertical; }
.workflow-form .form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.workflow-form .check { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.workflow-form .check input { width: 16px; }
.workflow-form-actions { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.workflow-checklist { display: grid; gap: 8px; margin-top: 16px; }
.workflow-check-item { display: flex; align-items: flex-start; gap: 8px; padding: 9px 10px; border: 1px solid var(--border); border-radius: 9px; background: #fbfcfd; font-size: 12px; }
.workflow-check-item input { margin-top: 2px; accent-color: var(--accent); }
.workflow-check-item small { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; }
@media (prefers-reduced-motion: reduce) {
  .kanban-column, .kanban-card { transition: none; }
  .kanban-card-enter { animation: none; }
}
.workflow-timeline { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.workflow-event { padding-left: 12px; border-left: 2px solid #c9d8e2; }
.workflow-event strong { display: block; color: var(--text); font-size: 11px; }
.workflow-event small { color: var(--muted); font-size: 10px; }
.workflow-event p { margin: 4px 0 0; color: #526070; font-size: 11px; line-height: 1.45; }
.management-panel { display: grid; gap: 16px; }
.management-panel .panel-head { margin: 0; }
.management-columns { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 16px; }
.visually-hidden { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }
.batch-stepper { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; padding: 0 20px 16px; }
.batch-step { display: flex; align-items: flex-start; gap: 9px; padding: 11px 12px; border: 1px solid var(--border); border-radius: 10px; background: #fbfcfd; }
.batch-step > span { display: grid; place-items: center; width: 24px; height: 24px; flex: 0 0 24px; border-radius: 50%; background: #e8eef1; color: var(--muted); font-weight: 800; font-size: 12px; }
.batch-step strong, .batch-step small { display: block; }
.batch-step strong { color: var(--text); font-size: 12px; }
.batch-step small { margin-top: 3px; color: var(--muted); font-size: 10px; line-height: 1.35; }
.batch-step.is-current { border-color: #b8dcd7; background: #f2fbf9; }
.batch-step.is-current > span { background: var(--accent); color: white; }
.batch-mode-picker { display: grid; grid-template-columns: repeat(2, minmax(220px, 1fr)); gap: 9px; width: min(100%, 650px); }
.batch-mode-card { display: flex; align-items: flex-start; gap: 8px; min-height: 60px; padding: 10px 11px; border: 1px solid var(--border); border-radius: 10px; background: white; cursor: pointer; }
.batch-mode-card input { margin-top: 3px; accent-color: var(--accent); }
.batch-mode-card strong, .batch-mode-card small { display: block; }
.batch-mode-card strong { color: var(--text); font-size: 12px; }
.batch-mode-card small { margin-top: 4px; color: var(--muted); font-size: 10px; line-height: 1.4; }
.batch-mode-card.is-selected { border-color: #77bcb3; box-shadow: 0 0 0 2px rgba(15,118,110,.08); background: #f4fbfa; }
.batch-review { margin: 0 20px 16px; padding: 13px 14px; border: 1px solid #d8e5e9; border-radius: 11px; background: #f8fbfc; }
.batch-review-title { display: flex; justify-content: space-between; gap: 12px; align-items: center; color: var(--muted); font-size: 11px; }
.batch-review-title strong { color: var(--text); font-size: 13px; }
.batch-review-grid { display: grid; grid-template-columns: repeat(5, minmax(100px, 1fr)); gap: 8px; margin-top: 10px; }
.batch-review-card { padding: 9px 10px; border: 1px solid var(--border); border-radius: 8px; background: white; }
.batch-review-card span { display: block; color: var(--muted); font-size: 10px; }
.batch-review-card strong { display: block; margin-top: 4px; color: var(--text); font-size: 14px; }
.batch-queue-notice { margin: 10px 0 0; color: #526070; font-size: 11px; line-height: 1.45; }
.batch-actions { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; padding: 0 20px 16px; }
.batch-list-head { display: grid; grid-template-columns: 30px 90px minmax(170px, 1fr) minmax(230px, 1.4fr) auto 120px; gap: 12px; padding: 9px 20px; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.batch-overview { display: grid; grid-template-columns: repeat(7, minmax(100px, 1fr)); gap: 8px; padding: 0 20px 16px; }
.batch-kpi { padding: 11px 12px; border: 1px solid var(--border); border-radius: 9px; background: #fbfcfd; }
.batch-kpi span { display: block; color: var(--muted); font-size: 10px; text-transform: uppercase; }
.batch-kpi strong { display: block; margin-top: 5px; font-size: 17px; }
.job-counters { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 20px 14px; }
.job-counters .badge { padding: 5px 9px; }
.job-label { margin-right: 3px; color: var(--muted); font-size: 10px; font-weight: 700; }
.job-actions { display: flex; justify-content: flex-end; padding: 0 20px 16px; }
.decision-hero { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(260px, .95fr); gap: 15px; margin-bottom: 20px; padding: 15px; border: 1px solid #c8e3df; border-radius: 12px; background: linear-gradient(135deg, #f1fbf9, #fff); }
.decision-hero h3 { margin: 4px 0 5px; font-size: 18px; }
.decision-hero p { margin: 0; color: #526070; font-size: 12px; line-height: 1.55; }
.decision-hero-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.decision-hero-grid > div { padding: 10px; border: 1px solid #d7e8e5; border-radius: 9px; background: rgba(255,255,255,.75); }
.decision-hero-grid span, .decision-hero-grid strong { display: block; }
.decision-hero-grid span { color: var(--muted); font-size: 10px; }
.decision-hero-grid strong { margin-top: 5px; color: var(--text); font-size: 12px; line-height: 1.4; }
.batch-decision-state small, .batch-execution-state small { display: block; margin-bottom: 4px; color: var(--muted); font-size: 9px; font-weight: 700; text-transform: uppercase; }
.recon-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; margin-top: 8px; }
.recon-meta .badge { font-size: 10px; }
.recon-requirement { color: var(--muted); font-size: 10px; }
.recon-evidence { display: grid; gap: 3px; margin-top: 12px; padding: 9px 10px; border-radius: 8px; background: #f7fafb; color: #526070; font-size: 11px; line-height: 1.4; }
.recon-evidence strong { color: var(--text); }
.recon-action { line-height: 1.45; }
.recon-link-note { display: flex; gap: 7px; align-items: center; margin: 0 0 9px; padding: 8px 10px; border: 1px solid #d8e8e6; border-radius: 8px; background: #f2fbf9; color: #3f5c60; font-size: 11px; }
.recon-link-note strong { color: var(--accent-2); }
.jobs-history-panel { margin-top: 20px; }
.jobs-history-panel td small { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; }

.migration-summary-panel { margin-top: 20px; }
.migration-summary-panel .panel-head { margin-bottom: 0; }
.migration-coverage { display: grid; gap: 12px; padding: 0 20px 18px; }
.migration-coverage.compact { padding-top: 0; }
.migration-kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 9px; }
.migration-kpi { padding: 11px 12px; border: 1px solid var(--border); border-radius: 9px; background: #fbfcfd; }
.migration-kpi span { display: block; color: var(--muted); font-size: 10px; font-weight: 700; text-transform: uppercase; }
.migration-kpi strong { display: block; margin-top: 5px; font-size: 20px; letter-spacing: -.03em; }
.migration-progress { height: 9px; overflow: hidden; border-radius: 99px; background: #e7edf1; }
.migration-progress-bar { height: 100%; border-radius: inherit; background: #0f766e; transition: width .25s ease; }
.migration-progress-caption { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 11px; }
.migration-gate { margin: 0 20px 18px; padding: 13px 14px; border: 1px solid var(--border); border-radius: 10px; background: #fbfcfd; }
.migration-gate-head { display: flex; justify-content: space-between; gap: 12px; align-items: center; color: var(--muted); font-size: 11px; }
.migration-gate-head strong { color: var(--text); font-size: 13px; }
.migration-checks { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 10px; }
.migration-check { display: inline-flex; align-items: center; gap: 5px; padding: 5px 8px; border-radius: 999px; font-size: 11px; }
.migration-check.ok { color: #166534; background: #dcfce7; }
.migration-check.pending { color: #92400e; background: #fef3c7; }
.migration-check > span { font-weight: 900; }
.migration-table-wrap { overflow-x: auto; }
.migration-table { min-width: 1180px; }
.migration-table td { vertical-align: top; line-height: 1.35; }
.migration-table td small { display: block; margin-top: 4px; color: var(--muted); font-size: 10px; overflow-wrap: anywhere; }
.migration-table details { margin-top: 6px; color: var(--muted); font-size: 10px; }
.migration-table summary { cursor: pointer; color: var(--accent-2); font-weight: 700; }
.migration-muted { color: var(--muted); }
.migration-loading { padding: 24px; color: var(--muted); text-align: center; }

/* Assistente IA: uma extensão de consulta do sistema, não um segundo produto. */
.assistant-intro { display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; margin-bottom: 18px; }
.assistant-intro h2 { margin: 4px 0 7px; font-size: 24px; letter-spacing: -.025em; }
.assistant-intro p { max-width: 760px; margin: 0; color: var(--muted); font-size: 13px; line-height: 1.55; }
.assistant-layout { display: grid; grid-template-columns: minmax(0, 1fr) 276px; align-items: start; gap: 18px; }
.assistant-panel { min-height: 560px; display: flex; flex-direction: column; }
.assistant-context { margin: 18px 18px 0; padding: 11px 13px; border: 1px solid #cce3e0; border-radius: 10px; background: #eef6f5; color: var(--accent-2); font-size: 12px; line-height: 1.45; }
.assistant-context strong { color: #0d4b46; }
.assistant-history { display: grid; gap: 14px; flex: 1; min-height: 310px; max-height: 560px; overflow: auto; padding: 20px; align-content: start; }
.assistant-empty { display: grid; place-items: center; min-height: 240px; padding: 34px; color: var(--muted); text-align: center; line-height: 1.6; }
.assistant-empty strong { display: block; color: var(--text); font-size: 15px; margin-bottom: 5px; }
.assistant-message { max-width: min(780px, 92%); padding: 13px 15px; border: 1px solid var(--border); border-radius: 13px; background: #fff; box-shadow: 0 4px 14px rgba(15,23,42,.035); }
.assistant-message.user { justify-self: end; background: #0f766e; border-color: #0f766e; color: white; }
.assistant-message.assistant { justify-self: start; }
.assistant-message.error { justify-self: start; border-color: #fecaca; background: #fff7f7; color: var(--danger); }
.assistant-message-label { display: block; margin-bottom: 5px; color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.assistant-message.user .assistant-message-label { color: #c9f3ed; }
.assistant-message-text { font-size: 13px; line-height: 1.62; overflow-wrap: anywhere; }
.assistant-tool-row, .assistant-link-row { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 11px; }
.assistant-tool { display: inline-flex; align-items: center; gap: 5px; padding: 5px 8px; border-radius: 999px; background: #edf5f8; color: #24556b; font-size: 10px; font-weight: 750; }
.assistant-link { padding: 6px 8px; font-size: 11px; }
.assistant-loading { display: flex; align-items: center; gap: 8px; margin: 0 20px 14px; color: var(--muted); font-size: 12px; }
.assistant-spinner { width: 15px; height: 15px; border: 2px solid #cce3e0; border-top-color: var(--accent); border-radius: 50%; animation: assistant-spin .75s linear infinite; }
@keyframes assistant-spin { to { transform: rotate(360deg); } }
.assistant-error { margin: 0 20px 14px; padding: 10px 12px; border: 1px solid #fecaca; border-radius: 9px; background: #fff7f7; color: var(--danger); font-size: 12px; line-height: 1.45; }
.assistant-composer { margin-top: auto; padding: 16px 18px 18px; border-top: 1px solid var(--border); background: #fbfcfd; }
.assistant-composer textarea { display: block; width: 100%; min-height: 84px; resize: vertical; border: 1px solid var(--border); border-radius: 10px; padding: 11px 12px; color: var(--text); background: white; font: inherit; outline: none; }
.assistant-composer textarea:focus { border-color: #7cb8b2; box-shadow: 0 0 0 3px rgba(15,118,110,.1); }
.assistant-composer-actions { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 10px; }
.assistant-composer-actions span { color: var(--muted); font-size: 11px; line-height: 1.4; }
.assistant-sidecard { display: grid; gap: 10px; padding: 18px; border: 1px solid var(--border); border-radius: 14px; background: white; box-shadow: var(--shadow); }
.assistant-sidecard h3 { margin: -2px 0 4px; font-size: 16px; }
.assistant-suggestion { padding: 10px 11px; border: 1px solid var(--border); border-radius: 9px; background: #fbfcfd; color: #344152; text-align: left; font: inherit; font-size: 12px; line-height: 1.4; }
.assistant-suggestion:hover { border-color: #a7cfc9; color: var(--accent-2); background: #f2fbfa; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }

@media (max-width: 1180px) {
  .stats-grid { grid-template-columns: repeat(3, 1fr); }
  .detail-summary { grid-template-columns: repeat(3, 1fr); }
  .kv-grid { grid-template-columns: repeat(2, 1fr); }
  .migration-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .assistant-layout { grid-template-columns: 1fr; }
  .assistant-sidecard { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .assistant-sidecard .eyebrow, .assistant-sidecard h3 { grid-column: 1 / -1; }
}

@media (max-width: 820px) {
  #app { display: block; }
  .corporate-header { position: sticky; top: 0; height: auto; min-height: 0; padding: 12px 16px; flex-direction: row; align-items: center; flex-wrap: wrap; gap: 12px; }
  .primary-nav { order: 3; flex-basis: 100%; display: flex !important; flex-direction: row; align-items: center; overflow-x: auto; gap: 5px; }
  .nav-section-label { display: none; }
  .primary-nav .nav-item { min-height: 38px; padding: 8px 9px; }
  .nav-icon { display: none; }
  .header-actions { display: flex; align-items: center; gap: 8px; margin: 0 0 0 auto; }
  .user-context { display: none; }
  .main { min-width: 0; }
  .topbar { padding: 16px; }
  .page { padding: 18px 16px 34px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .panel-head, .detail-head, .batch-controls { align-items: stretch; flex-direction: column; }
  .analytics-export-actions { justify-items: start; min-width: 0; }
  .analytics-export-actions .button-row { justify-content: flex-start; }
  .analytics-note-toolbar { align-items: stretch; flex-direction: column; }
  .analytics-note-actions { justify-content: flex-start; }
  .search-wrap input { width: 100%; min-width: 0; }
  .detail-summary, .kv-grid, .overview-columns, .analytics-grid { grid-template-columns: 1fr; }
  .title-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .migration-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .migration-progress-caption, .migration-gate-head { align-items: flex-start; flex-direction: column; }
  .batch-row { grid-template-columns: 30px 80px 1fr; }
  .batch-row > :nth-child(n+4) { display: none; }
  .batch-list-head { display: none; }

  .header-actions .server-status, .user-context { display: none; }
  .workspace-head { padding: 16px; }
  .command-heading { align-items: flex-start; flex-direction: column; }
  .updated-note { text-align: left; }
  .command-kpis, .financial-strip { grid-template-columns: 1fr; }
  .financial-strip > div { border-right: 0; border-bottom: 1px solid rgba(255,255,255,.16); }
  .financial-strip > div:last-child { border-bottom: 0; }
  .work-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .work-drawer-summary { grid-template-columns: 1fr; }
  .treatment-filters { grid-template-columns: repeat(3, minmax(135px, 1fr)); }
  .kanban-audit-split { grid-template-columns: 1fr; }
  .batch-overview { grid-template-columns: repeat(4, minmax(100px, 1fr)); }
  .batch-stepper, .batch-mode-picker, .decision-hero { grid-template-columns: 1fr; }
  .batch-review-grid { grid-template-columns: repeat(3, minmax(100px, 1fr)); }
  .management-columns { grid-template-columns: 1fr; }
  .assistant-intro { align-items: stretch; flex-direction: column; }
  .assistant-intro .ghost { align-self: flex-start; }
}

@media (max-width: 560px) {
  .work-drawer-head, .work-drawer-body { padding-left: 16px; padding-right: 16px; }
  .work-drawer-resize-hint { display: none; }
  .work-drawer-resize-handle { left: 0; width: 22px; }
  .work-evidence-grid { grid-template-columns: 1fr; }
  .treatment-filters { grid-template-columns: 1fr; }
  .kanban-audit-pane { padding: 12px; }
  .primary-nav .nav-item { font-size: 11px; }
  .batch-overview { grid-template-columns: repeat(2, minmax(100px, 1fr)); padding-left: 16px; padding-right: 16px; }
  .batch-stepper, .batch-review { margin-left: 16px; margin-right: 16px; }
  .batch-stepper { padding-left: 0; padding-right: 0; }
  .batch-review-grid { grid-template-columns: repeat(2, minmax(100px, 1fr)); }
  .batch-review-title { align-items: flex-start; flex-direction: column; }
  .title-filters { grid-template-columns: 1fr; }
  .workflow-form .form-grid { grid-template-columns: 1fr; }
  .assistant-sidecard { grid-template-columns: 1fr; }
  .assistant-composer-actions { align-items: stretch; flex-direction: column; }
  .assistant-composer-actions .primary { width: 100%; }
}

@media (max-width: 560px) {
  .work-filters { grid-template-columns: 1fr; }
}
