:root {
  --navy: #061f3e;
  --deep: #03152d;
  --ink: #071426;
  --muted: #64748b;
  --line: #dce5ef;
  --soft: #f5f8fb;
  --teal: #08a99e;
  --green: #17a56a;
  --blue: #2d7df0;
  --orange: #ff9b33;
  --red: #ff4d4f;
  --purple: #8b5cf6;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background: #eef3f7;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid rgba(8, 169, 158, 0.28);
  outline-offset: 2px;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr);
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 100vh;
  padding: 22px 14px;
  color: #eff7ff;
  background: radial-gradient(circle at 18% 0%, rgba(11, 169, 159, 0.28), transparent 28%), linear-gradient(180deg, #06284b, #03162e 70%, #021125);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 6px 6px;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: #052c36;
  background: linear-gradient(135deg, #20dbc7, #0bb58a);
  font-size: 24px;
  font-weight: 950;
}

.brand strong {
  font-size: 28px;
  letter-spacing: 0;
}

.firm-select {
  display: grid;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid rgba(226, 241, 255, 0.22);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.055);
}

.firm-select span {
  font-size: 13px;
  font-weight: 750;
}

.firm-select select {
  width: 100%;
  border: 0;
  color: #d9eaff;
  background: transparent;
  outline: 0;
}

.nav {
  display: grid;
  gap: 7px;
}

.nav-item,
.sub-nav {
  min-height: 46px;
  border: 0;
  border-radius: 8px;
  padding: 0 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: #eaf5ff;
  background: transparent;
  text-align: left;
  font-weight: 720;
}

.nav-item i {
  width: 24px;
  height: 24px;
  border-radius: 7px;
  display: grid;
  place-items: center;
  color: #9fd6e2;
  border: 1px solid rgba(201, 225, 240, 0.45);
  font-size: 10px;
  font-style: normal;
}

.nav-item b {
  margin-left: auto;
  min-width: 28px;
  height: 24px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: var(--teal);
  color: #fff;
  font-size: 12px;
}

.nav-item:hover,
.nav-item.active {
  background: linear-gradient(135deg, rgba(18, 196, 177, 0.9), rgba(7, 94, 117, 0.88));
}

.sub-nav {
  margin-left: 40px;
  min-height: 30px;
  padding-left: 12px;
  color: #b8cbe0;
  border-left: 1px solid rgba(219, 236, 255, 0.25);
}

.sub-nav.active {
  color: #35e5d0;
}

.month-card,
.user-card {
  border: 1px solid rgba(226, 241, 255, 0.2);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
}

.month-card {
  margin-top: auto;
  padding: 16px;
}

.month-card p {
  margin: 0 0 12px;
  font-weight: 800;
}

.ring {
  width: 78px;
  height: 78px;
  margin-left: auto;
  margin-bottom: 10px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: conic-gradient(#42e2c5 0 78%, rgba(255, 255, 255, 0.16) 78% 100%);
  position: relative;
}

.ring::after {
  content: "";
  position: absolute;
  inset: 12px;
  border-radius: inherit;
  background: #082544;
}

.ring strong {
  position: relative;
  z-index: 1;
  font-size: 18px;
}

.month-card small {
  display: block;
  color: #c2d5e8;
  line-height: 1.55;
}

.month-card button {
  width: 100%;
  height: 40px;
  margin-top: 14px;
  border: 1px solid #18cdbc;
  border-radius: 8px;
  color: #e8fffb;
  background: transparent;
}

.user-card {
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-card span,
.avatar {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  background: #dce8f2;
  color: #26364d;
  font-weight: 850;
}

.user-card small {
  display: block;
  color: #bdd0e6;
}

.workspace {
  min-width: 0;
  overflow-x: auto;
}

.topbar {
  min-height: 78px;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 16px 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  position: sticky;
  top: 0;
  z-index: 20;
}

.title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.demo-badge {
  border: 1px solid rgba(8, 169, 158, 0.22);
  border-radius: 999px;
  padding: 5px 10px;
  color: #05756e;
  background: #e7fbf8;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.demo-strip {
  margin: 14px 24px 0;
  border: 1px solid rgba(8, 169, 158, 0.2);
  border-radius: 8px;
  padding: 12px 14px;
  color: #075d58;
  background: linear-gradient(135deg, #e7fbf8, #f7fffd);
  font-weight: 750;
}

.topbar h1 {
  margin: 0;
  font-size: 24px;
}

.topbar p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.global-filter {
  margin-left: auto;
  min-width: 280px;
  height: 44px;
  border: 1px solid #ccd8e5;
  border-radius: 8px;
  display: grid;
  grid-template-columns: 1fr 120px;
  align-items: center;
  overflow: hidden;
  background: #fff;
}

.global-filter span {
  padding-left: 14px;
  font-weight: 780;
}

.global-filter select {
  height: 100%;
  border: 0;
  border-left: 1px solid var(--line);
  background: #fff;
  padding: 0 10px;
}

.date-btn,
.icon-btn {
  height: 44px;
  border: 1px solid #ccd8e5;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
}

.date-btn {
  padding: 0 18px;
}

.icon-btn {
  width: 44px;
  font-weight: 850;
}

.alert {
  color: var(--teal);
}

.view {
  display: none;
  padding: 20px 24px;
}

.view.active {
  display: block;
}

.panel,
.kpi-card,
.action-strip,
.flow-area,
.automation-side article,
.metric-box {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 14px 32px rgba(25, 46, 72, 0.06);
}

.panel {
  padding: 16px;
  min-width: 0;
}

.panel-head,
.rule-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.panel h2,
.panel-head h2 {
  margin: 0;
  font-size: 16px;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(170px, 1fr)) 1.6fr;
  gap: 14px;
}

.kpi-card {
  min-height: 124px;
  padding: 22px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.kpi-card:hover,
tbody tr:hover,
.client-card:hover,
.doc-card:hover,
.flow-node:hover {
  outline: 2px solid rgba(8, 169, 158, 0.22);
  outline-offset: -2px;
}

.kpi-icon {
  width: 62px;
  height: 62px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  font-weight: 950;
}

.kpi-icon.teal {
  color: #073f46;
  background: linear-gradient(135deg, #60dfcf, #28c5b0);
}

.kpi-icon.orange {
  color: #9b4700;
  background: #ffe0bb;
}

.kpi-icon.blue {
  color: #0b55bd;
  background: #cfe7ff;
}

.kpi-icon.green {
  color: #066539;
  background: #c9f4da;
}

.kpi-icon.red {
  color: #b41f28;
  background: #ffd3d6;
}

.kpi-card p {
  margin: 0;
  color: var(--muted);
  font-weight: 760;
}

.kpi-card strong {
  display: block;
  margin: 2px 0;
  color: var(--ink);
  font-size: 30px;
}

.kpi-card small {
  color: var(--green);
}

.wide small {
  color: var(--red);
}

.action-strip {
  min-height: 76px;
  margin: 14px 0;
  padding: 16px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.action-strip button {
  border: 1px solid rgba(8, 169, 158, 0.52);
  border-radius: 8px;
  color: #047a70;
  background: #f7fffd;
  font-weight: 850;
}

.action-strip button:nth-child(3) {
  color: var(--blue);
  border-color: rgba(45, 125, 240, 0.45);
  background: #f7fbff;
}

.action-strip button:nth-child(4) {
  color: #6d35c9;
  border-color: rgba(139, 92, 246, 0.45);
  background: #fbf8ff;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 1.1fr 1.18fr 1.4fr 0.78fr;
  gap: 14px;
}

.chart-panel {
  grid-column: 3 / 5;
  grid-row: 1;
}

.missing-panel {
  grid-column: 1 / 2;
}

.remind-panel {
  grid-column: 2 / 3;
}

.ocr-panel {
  grid-column: 3 / 5;
}

.filed-panel {
  grid-column: 1 / 4;
}

.deliver-panel {
  grid-column: 4 / 5;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

th,
td {
  padding: 10px 8px;
  border-bottom: 1px solid #ebf1f6;
  text-align: left;
  vertical-align: middle;
}

th {
  color: var(--muted);
  font-weight: 740;
}

.avatar {
  width: 30px;
  height: 30px;
  margin-right: 8px;
  font-size: 11px;
}

.bar {
  width: 86px;
  height: 6px;
  border-radius: 999px;
  overflow: hidden;
  background: #e8eef4;
}

.bar i {
  display: block;
  height: 100%;
  background: var(--red);
}

.red-text {
  color: var(--red);
  font-weight: 850;
}

.donut-layout {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 22px;
  align-items: center;
}

.donut {
  width: 156px;
  height: 156px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  position: relative;
  background: conic-gradient(var(--teal) 0 47%, var(--blue) 47% 72%, var(--orange) 72% 89%, var(--purple) 89% 96%, #9aa1a9 96% 100%);
}

.donut::after {
  content: "";
  position: absolute;
  inset: 42px;
  border-radius: inherit;
  background: #fff;
}

.donut strong,
.donut small {
  position: relative;
  z-index: 1;
}

.donut strong {
  transform: translateY(16px);
  font-size: 23px;
}

.donut small {
  transform: translateY(-16px);
  color: var(--muted);
  font-size: 11px;
}

.legend p {
  display: grid;
  grid-template-columns: 14px 1fr auto auto;
  gap: 12px;
  align-items: center;
  margin: 10px 0;
  color: #334155;
}

.legend i {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #9aa1a9;
}

.teal-bg {
  background: var(--teal) !important;
}

.blue-bg {
  background: var(--blue) !important;
}

.orange-bg {
  background: var(--orange) !important;
}

.purple-bg {
  background: var(--purple) !important;
}

.tag,
.score {
  padding: 4px 8px;
  border-radius: 7px;
  font-size: 11px;
}

.green-tag {
  color: #087545;
  background: #dff8e9;
}

.blue-tag {
  color: #0d5fc4;
  background: #e2efff;
}

.orange-tag {
  color: #b45700;
  background: #fff0df;
}

.purple-tag {
  color: #6730bd;
  background: #eee5ff;
}

.gray-tag {
  color: #475569;
  background: #e8edf3;
}

.score {
  display: inline-grid;
  place-items: center;
  min-width: 44px;
  color: var(--green);
  border: 2px solid var(--green);
  border-radius: 999px;
  font-weight: 850;
}

.file,
.doc-thumb {
  width: 34px;
  height: 40px;
  margin-right: 8px;
  border-radius: 6px;
  display: inline-grid;
  place-items: center;
  color: #fff;
  background: var(--red);
  font-size: 10px;
  font-weight: 900;
}

.img {
  background: var(--teal);
}

.blue-file {
  background: var(--blue);
}

.queue-list {
  display: grid;
  gap: 8px;
}

.queue-list button,
.deliver-panel button {
  width: 100%;
  border: 0;
  border-bottom: 1px solid #edf2f7;
  padding: 10px 4px;
  display: grid;
  grid-template-columns: 36px 1fr auto auto;
  align-items: center;
  gap: 10px;
  background: transparent;
  text-align: left;
}

.queue-list span {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: #dce8f2;
  font-size: 11px;
  font-weight: 850;
}

.queue-list small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-weight: 450;
}

.queue-list em {
  padding: 4px 8px;
  border-radius: 7px;
  color: #b45700;
  background: #fff0df;
  font-size: 11px;
  font-style: normal;
}

.queue-list .high {
  color: #d52929;
  background: #ffe5e5;
}

.queue-list .low {
  color: #087545;
  background: #dff8e9;
}

.link-btn {
  width: 100%;
  height: 36px;
  border: 0;
  margin-top: 10px;
  color: #5b6d82;
  background: transparent;
}

.deliver-panel {
  display: grid;
  gap: 10px;
  align-content: start;
}

.deliver-panel button {
  border: 1px solid #d7e3f0;
  border-radius: 8px;
  grid-template-columns: 1fr auto;
  padding: 12px 14px;
  color: #31445e;
  background: #fff;
}

.deliver-panel b {
  min-width: 34px;
  height: 28px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  color: var(--blue);
  background: #e8f2ff;
}

.ocr-layout {
  display: grid;
  grid-template-columns: 290px minmax(700px, 1fr) 390px;
  gap: 14px;
}

.client-column,
.whatsapp-column,
.ocr-main {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.client-column {
  padding: 14px;
}

.client-column h2 {
  margin: 0 0 14px;
  font-size: 20px;
}

.search-box {
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  grid-template-columns: 1fr 56px;
  align-items: center;
  margin-bottom: 12px;
  overflow: hidden;
}

.search-box input {
  border: 0;
  outline: 0;
  padding-left: 12px;
}

.search-box span {
  height: 100%;
  display: grid;
  place-items: center;
  color: var(--muted);
  border-left: 1px solid var(--line);
  font-size: 12px;
}

.client-list {
  display: grid;
  gap: 8px;
}

.client-card {
  min-height: 98px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 13px;
  background: #fff;
  text-align: left;
}

.client-card.active {
  border-color: var(--teal);
  background: #f1fffc;
}

.client-card strong,
.client-card small {
  display: block;
}

.client-card small {
  color: var(--muted);
  margin: 7px 0;
}

.client-card em,
.ocr-title em {
  padding: 4px 8px;
  border-radius: 999px;
  color: #fa6400;
  background: #fff0df;
  font-style: normal;
  font-size: 12px;
}

.client-card .done {
  color: var(--green);
  background: #dff8e9;
}

.mini-panel {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.mini-panel h3 {
  margin: 0 0 10px;
  font-size: 14px;
}

.mini-panel p {
  display: flex;
  justify-content: space-between;
  margin: 9px 0;
  color: #334155;
}

.mini-panel b {
  color: var(--red);
}

.mini-panel .ok {
  color: var(--green);
}

.danger {
  background: #fffafa;
}

.ocr-main {
  min-width: 0;
}

.ocr-title {
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.ocr-title h1 {
  margin: 0 0 12px;
  font-size: 30px;
}

.ocr-title div {
  display: flex;
  align-items: center;
  gap: 24px;
}

.ocr-title strong {
  font-size: 22px;
}

.ocr-workbench {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  min-height: 520px;
}

.incoming-docs {
  padding: 14px;
  border-right: 1px solid var(--line);
}

.incoming-docs h2 {
  margin: 0 0 12px;
  font-size: 16px;
}

.upload-card {
  width: 100%;
  min-height: 90px;
  border: 1px dashed #b9c7d7;
  border-radius: 8px;
  color: var(--muted);
  background: #fbfdff;
}

.upload-card b {
  display: block;
  color: var(--teal);
}

.doc-card {
  width: 100%;
  min-height: 106px;
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  display: grid;
  grid-template-columns: 52px 1fr;
  grid-template-rows: auto auto auto;
  column-gap: 10px;
  background: #fff;
  text-align: left;
}

.doc-card.active {
  border-color: var(--teal);
  background: #f4fffc;
}

.doc-card .doc-thumb {
  grid-row: 1 / 4;
  width: 52px;
  height: 72px;
  margin: 0;
}

.doc-card small {
  color: var(--muted);
}

.doc-card em {
  width: fit-content;
  padding: 4px 8px;
  border-radius: 7px;
  color: var(--green);
  background: #ddf8e8;
  font-style: normal;
}

.received {
  margin: 18px 0 0;
  color: var(--muted);
}

.document-preview {
  padding: 14px;
  background: #fbfdff;
}

.invoice-sheet {
  min-height: 450px;
  border: 1px solid #b8c5d3;
  border-radius: 8px;
  padding: 26px 34px;
  background: #fff;
  position: relative;
}

.atlas {
  position: absolute;
  top: 42px;
  right: 230px;
  font-size: 32px;
  font-weight: 950;
  letter-spacing: 0;
}

.invoice-sheet h3 {
  position: absolute;
  top: 62px;
  right: 98px;
  margin: 0;
}

.invoice-sheet p {
  max-width: 310px;
  margin: 8px 0;
  line-height: 1.45;
  font-size: 13px;
}

.highlight {
  width: fit-content;
  border: 2px solid #30c970;
  border-radius: 3px;
  padding: 2px 4px;
  font-weight: 850;
  background: rgba(60, 218, 111, 0.08);
}

.invoice-meta {
  position: absolute;
  top: 118px;
  right: 42px;
  display: grid;
  gap: 8px;
  font-size: 12px;
}

.invoice-meta b,
.invoice-total b {
  border: 2px solid #30c970;
  border-radius: 4px;
  padding: 2px 6px;
  color: #112033;
}

.invoice-sheet table {
  width: 76%;
  margin: 32px 0 18px auto;
  border: 1px solid #111;
  font-size: 13px;
}

.invoice-sheet th,
.invoice-sheet td {
  border: 1px solid #111;
  padding: 8px;
}

.invoice-total {
  width: 290px;
  margin-left: auto;
}

.invoice-total p {
  max-width: none;
  display: flex;
  justify-content: space-between;
}

.preview-toolbar {
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--muted);
}

.preview-toolbar button {
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
}

.preview-toolbar b {
  margin-left: auto;
  color: var(--ink);
}

.ocr-bottom {
  display: grid;
  grid-template-columns: 1fr 1.15fr 1.15fr;
  gap: 10px;
  padding: 0 14px 14px;
}

.result-row {
  display: grid;
  grid-template-columns: 1fr auto 48px;
  gap: 8px;
  align-items: center;
  min-height: 36px;
  border-bottom: 1px solid #edf2f7;
  color: var(--muted);
}

.result-row b {
  color: #26364d;
}

.result-row em {
  padding: 4px 7px;
  border-radius: 7px;
  color: var(--green);
  background: #dff8e9;
  font-style: normal;
  font-size: 11px;
}

.warning-panel {
  background: #fffaf2;
  border-color: #ffc672;
}

.warning-panel div {
  border: 1px solid #ffd087;
  border-radius: 8px;
  padding: 10px;
  margin-top: 10px;
  position: relative;
}

.warning-panel p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.warning-panel button {
  position: absolute;
  right: 10px;
  top: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
}

.folder-panel input {
  width: 100%;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
}

.folder-panel ul {
  margin: 12px 0 0;
  padding-left: 24px;
  line-height: 1.8;
}

.folder-panel .active {
  padding: 2px 8px;
  border: 1px solid var(--teal);
  border-radius: 7px;
  background: #eefffb;
}

.whatsapp-column {
  display: grid;
  grid-template-rows: auto 1fr auto auto;
  overflow: hidden;
}

.whatsapp-head {
  min-height: 58px;
  padding: 14px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.whatsapp-head strong {
  font-size: 18px;
}

.whatsapp-head button {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
}

.chat {
  padding: 18px;
  background: #f5efe9;
}

.chat p {
  width: fit-content;
  max-width: 86%;
  padding: 12px 14px;
  border-radius: 8px;
  line-height: 1.45;
  background: #fff;
}

.chat small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  text-align: right;
}

.outgoing,
.attachment {
  margin-left: auto;
  background: #dcf8c6 !important;
}

.attachment {
  max-width: 82%;
  border-radius: 8px;
  margin-bottom: 10px;
  padding: 10px;
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 8px;
}

.attachment .file {
  grid-row: 1 / 3;
}

.attachment small {
  display: block;
}

.message-input {
  height: 46px;
  margin: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 12px 16px;
  color: var(--muted);
  background: #fff;
}

.side-actions {
  display: grid;
  gap: 10px;
  padding: 14px;
}

.side-actions button {
  height: 54px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: #172033;
  background: #fff;
  font-weight: 820;
}

.side-actions button:first-child {
  color: #fff;
  border: 0;
  background: linear-gradient(135deg, #0bb58a, #079c8f);
}

.orange-btn {
  color: #fff !important;
  border: 0 !important;
  background: linear-gradient(135deg, #ff9b33, #ff6a00) !important;
}

.automation-layout {
  display: grid;
  grid-template-columns: minmax(860px, 1fr) 390px;
  gap: 14px;
}

.flow-area {
  padding: 14px;
}

.rule-head {
  min-height: 64px;
  margin-bottom: 12px;
}

.rule-head h1 {
  margin: 0 0 8px;
  font-size: 20px;
}

.rule-head h2 {
  margin: 0;
  font-size: 17px;
}

.rule-head span {
  margin-left: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  color: var(--green);
  background: #dff8e9;
  font-size: 12px;
}

.rule-head button {
  height: 38px;
  min-width: 92px;
  border: 1px solid #ccd8e5;
  border-radius: 8px;
  background: #fff;
}

.publish-btn {
  color: #fff !important;
  border: 0 !important;
  background: linear-gradient(135deg, #0bb58a, #079c8f) !important;
}

.flow-canvas {
  height: 650px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background-image: radial-gradient(#dce7ef 1px, transparent 1px);
  background-size: 14px 14px;
  position: relative;
  overflow: hidden;
}

.flow-canvas::before {
  content: "";
  position: absolute;
  left: 104px;
  right: 205px;
  top: 132px;
  height: 2px;
  background: #0b2447;
}

.flow-canvas::after {
  content: "";
  position: absolute;
  right: 315px;
  top: 290px;
  bottom: 88px;
  width: 2px;
  background: #0b2447;
}

.toolbox {
  position: absolute;
  left: 12px;
  top: 12px;
  width: 42px;
  display: grid;
  gap: 6px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  z-index: 2;
}

.toolbox button {
  height: 30px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  font-size: 10px;
}

.flow-node {
  position: absolute;
  min-width: 150px;
  min-height: 62px;
  border: 1px solid #94d5ba;
  border-radius: 8px;
  padding: 10px 12px;
  background: #f8fffc;
  color: #142338;
  text-align: center;
  box-shadow: 0 10px 24px rgba(14, 42, 70, 0.06);
}

.flow-node small,
.flow-node strong {
  display: block;
}

.flow-node small {
  color: #087545;
  font-size: 11px;
  margin-bottom: 6px;
}

.start {
  left: 70px;
  top: 110px;
  width: 48px;
  min-width: 48px;
  height: 48px;
  min-height: 48px;
  border-radius: 999px;
  padding: 0;
  display: grid;
  place-items: center;
  color: var(--green);
  font-weight: 900;
}

.n1 {
  left: 145px;
  top: 86px;
}

.decision {
  width: 86px;
  height: 86px;
  min-width: 86px;
  min-height: 86px;
  transform: rotate(45deg);
  border-color: #ffa826;
  color: #e27700;
  background: #fffaf0;
  display: grid;
  place-items: center;
  font-weight: 850;
}

.decision:hover {
  transform: rotate(45deg) translateY(-2px);
}

.n2 {
  left: 360px;
  top: 96px;
}

.n3 {
  left: 535px;
  top: 105px;
}

.n4 {
  left: 720px;
  top: 105px;
}

.n5 {
  right: 190px;
  top: 96px;
}

.n6 {
  left: 520px;
  top: 245px;
}

.n7 {
  right: 105px;
  top: 260px;
}

.n8 {
  right: 105px;
  top: 370px;
}

.n9 {
  right: 105px;
  top: 480px;
}

.n10 {
  right: 105px;
  top: 585px;
}

.blue-node {
  border-color: #83b8f7;
  background: #f4f9ff;
}

.purple-node {
  border-color: #b8a3f5;
  background: #fbf8ff;
}

.red-node {
  border-color: #ff9d9d;
  background: #fff8f8;
}

.green-node {
  border-color: #8ed8bf;
  background: #f6fffb;
}

.orange-node {
  border-color: #ffc174;
  background: #fffaf2;
}

.automation-side {
  display: grid;
  gap: 12px;
  align-content: start;
}

.phone {
  width: 270px;
  min-height: 355px;
  margin: 12px auto 0;
  border: 10px solid #1a293a;
  border-radius: 34px;
  overflow: hidden;
  background: #f5f0ea;
}

.phone-top {
  height: 46px;
  background: #e7edf4;
}

.phone-chat {
  min-height: 238px;
  padding: 18px;
}

.phone-chat p {
  padding: 14px;
  border-radius: 8px;
  background: #dcf8c6;
  line-height: 1.45;
}

.phone-chat small {
  display: block;
  color: var(--muted);
  text-align: right;
}

.phone-input {
  height: 46px;
  margin: 0 14px 14px;
  border-radius: 999px;
  padding: 12px 14px;
  color: var(--muted);
  background: #fff;
}

.sample-files {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.sample-files h2,
.variables h2 {
  grid-column: 1 / -1;
  margin: 0;
}

.sample-files div {
  min-height: 110px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

.sample-files .file {
  margin-bottom: 8px;
}

.sample-files strong,
.sample-files small {
  display: block;
}

.variables p {
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 8px 0;
  margin: 0;
  border-bottom: 1px solid #edf2f7;
  color: var(--teal);
  font-weight: 850;
}

.variables span {
  color: var(--muted);
  font-weight: 500;
}

.automation-bottom {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(3, 150px) 1.1fr 1fr 1fr;
  gap: 12px;
}

.metric-box {
  min-height: 118px;
  padding: 16px;
}

.metric-box small,
.metric-box span {
  color: var(--muted);
}

.metric-box strong {
  display: block;
  margin: 10px 0;
  font-size: 30px;
}

.performance svg {
  width: 100%;
  height: 105px;
}

.error-table h2 b,
.approve-table h2 b {
  float: right;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  color: var(--red);
  background: #ffe2e2;
  font-size: 12px;
}

.approve-table h2 b {
  color: #c96b00;
  background: #fff1d9;
}

.approve-table button {
  height: 30px;
  border: 0;
  border-radius: 7px;
  color: #fff;
  background: var(--teal);
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  padding: 14px 18px;
  border-radius: 8px;
  color: #fff;
  background: #061f3e;
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.22);
  opacity: 0;
  transform: translateY(18px);
  pointer-events: none;
  transition: 0.2s;
  z-index: 50;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

tbody tr,
.kpi-card,
.flow-node {
  cursor: pointer;
}

.selected {
  outline: 2px solid rgba(45, 125, 240, 0.34) !important;
  outline-offset: -2px;
}

@media (max-width: 1300px) {
  .app-shell {
    grid-template-columns: 230px 1fr;
  }

  .kpi-grid,
  .dashboard-grid,
  .ocr-layout,
  .automation-layout,
  .automation-bottom {
    grid-template-columns: 1fr;
  }

  .chart-panel,
  .missing-panel,
  .remind-panel,
  .ocr-panel,
  .filed-panel,
  .deliver-panel {
    grid-column: auto;
  }

  .flow-canvas {
    min-width: 1060px;
  }
}

@media (max-width: 900px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    min-height: auto;
  }

  .topbar {
    flex-wrap: wrap;
  }

  .global-filter {
    width: 100%;
    margin-left: 0;
  }

  .action-strip,
  .ocr-workbench,
  .ocr-bottom,
  .sample-files {
    grid-template-columns: 1fr;
  }
}
