:root {
  --bg: #eef1f4;
  --surface: #ffffff;
  --surface-muted: #f6f8fa;
  --line: #d9e0e7;
  --text: #15202b;
  --muted: #657384;
  --blue: #1d5fd1;
  --blue-dark: #164ba5;
  --green: #15845b;
  --amber: #b7791f;
  --red: #b42318;
  --shadow: 0 16px 50px rgba(27, 39, 52, 0.12);
  --soft-shadow: 0 10px 28px rgba(27, 39, 52, 0.08);
  --icon-file: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M7 3h7l5 5v13H7z' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M14 3v5h5' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  --icon-check: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='m5 12 4 4L19 6' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  --icon-search: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='11' cy='11' r='7' fill='none' stroke='black' stroke-width='2'/%3E%3Cpath d='m16.5 16.5 4 4' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
  --icon-plus: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12 5v14M5 12h14' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round'/%3E%3C/svg%3E");
  --icon-download: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12 3v12m0 0 5-5m-5 5-5-5M5 21h14' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  --icon-refresh: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M20 12a8 8 0 1 1-2.3-5.7M20 4v6h-6' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  --icon-trash: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M3 6h18M8 6V4h8v2M19 6l-1 14H6L5 6' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  --icon-settings: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='12' cy='12' r='3' fill='none' stroke='black' stroke-width='2'/%3E%3Cpath d='M19 12a7 7 0 0 0-.1-1l2-1.5-2-3.4-2.4 1a7 7 0 0 0-1.8-1L14.4 3h-4.8l-.3 3.1a7 7 0 0 0-1.8 1l-2.4-1-2 3.4 2 1.5a7 7 0 0 0 0 2l-2 1.5 2 3.4 2.4-1a7 7 0 0 0 1.8 1l.3 3.1h4.8l.3-3.1a7 7 0 0 0 1.8-1l2.4 1 2-3.4-2-1.5c.1-.3.1-.7.1-1Z' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
}

button,
input,
select,
textarea {
  font: inherit;
  min-width: 0;
}

.app-shell {
  width: min(1720px, calc(100vw - 24px));
  min-height: calc(100vh - 24px);
  margin: 12px auto;
  display: grid;
  grid-template-columns: clamp(224px, 15vw, 280px) minmax(0, 1fr);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.auth-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at top right, rgba(29, 95, 209, 0.16), transparent 380px),
    var(--bg);
}

.auth-card {
  width: min(420px, calc(100vw - 32px));
  display: grid;
  gap: 18px;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.auth-brand strong,
.auth-brand small {
  display: block;
}

.auth-brand strong {
  font-size: 22px;
}

.auth-brand small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
}

.auth-form {
  display: grid;
  gap: 12px;
}

.auth-form label {
  display: grid;
  gap: 7px;
}

.auth-form label span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.auth-form input {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
}

.auth-form button {
  width: 100%;
}

.auth-message {
  min-height: 20px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding: 24px 18px;
  background:
    linear-gradient(180deg, rgba(29, 95, 209, 0.18), rgba(29, 95, 209, 0) 34%),
    #17212d;
  color: #f7fbff;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-logo {
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
  border-radius: 8px;
  object-fit: contain;
  background: rgba(255, 255, 255, 0.08);
  filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.18));
}

.brand strong,
.brand small {
  display: block;
}

.brand small {
  margin-top: 3px;
  color: #afbdca;
  font-size: 12px;
  line-height: 1.25;
}

.nav {
  display: grid;
  gap: 8px;
}

.nav-item {
  height: 42px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px 0 14px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #c6d1dd;
  text-align: left;
  cursor: pointer;
}

.nav-icon {
  width: 21px;
  height: 21px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  color: currentColor;
}

.nav-icon svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-item:hover,
.nav-item.active {
  background: #263445;
  color: #ffffff;
}

.nav-item.active {
  box-shadow: inset 3px 0 0 #22c58b;
}

.sidebar-note {
  margin-top: auto;
  padding: 14px;
  border: 1px solid #34465b;
  border-radius: 8px;
}

.sidebar-note span,
.sidebar-note strong {
  display: block;
}

.sidebar-note span {
  color: #afbdca;
  font-size: 12px;
}

.sidebar-note strong {
  margin-top: 4px;
  font-size: 13px;
}

.workspace {
  min-width: 0;
  padding: clamp(18px, 2vw, 30px);
  background:
    radial-gradient(circle at top right, rgba(29, 95, 209, 0.08), transparent 360px),
    var(--surface-muted);
  display: grid;
  gap: 18px;
  align-content: start;
  overflow-x: hidden;
}

.view-panel {
  display: none;
}

.view-panel.active {
  display: grid;
  gap: 18px;
  min-width: 0;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 20px;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.user-chip {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.compact-button {
  min-height: 34px;
  padding: 0 12px;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 28px;
  line-height: 1.1;
}

h2 {
  font-size: 18px;
  line-height: 1.2;
}

p {
  color: var(--muted);
  margin-top: 6px;
  line-height: 1.45;
}

.status-chip {
  min-width: 98px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.status-chip::before,
.date-chip::before {
  content: "";
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
  background: currentColor;
  -webkit-mask: var(--icon-check) center / contain no-repeat;
  mask: var(--icon-check) center / contain no-repeat;
}

.date-chip {
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.date-chip::before {
  -webkit-mask-image: var(--icon-settings);
  mask-image: var(--icon-settings);
}

.status-chip[data-state="success"] {
  color: var(--green);
  background: #ebf8f3;
  border-color: #bfe7d8;
}

.status-chip[data-state="error"] {
  color: var(--red);
  background: #fff1f0;
  border-color: #ffd1cc;
}

.status-chip[data-state="busy"] {
  color: var(--blue);
  background: #edf4ff;
  border-color: #c9dcff;
}

.overview-panel {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(280px, 1.08fr);
  gap: 20px;
  align-items: center;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, #ffffff 0%, #f7fbff 62%, #eef6ff 100%);
  box-shadow: var(--soft-shadow);
}

.overview-copy {
  display: grid;
  gap: 12px;
}

.eyebrow {
  width: fit-content;
  padding: 6px 10px;
  border-radius: 8px;
  background: #e8f3ff;
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.overview-copy h2 {
  max-width: 520px;
  font-size: 24px;
  line-height: 1.16;
}

.overview-copy p {
  max-width: 560px;
}

.metric-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 4px;
}

.metric-card {
  min-height: 72px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-content: center;
  gap: 4px;
  padding: 12px;
  border: 1px solid #dce8f7;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.8);
}

.metric-card::before,
.dashboard-card::before {
  content: "";
  width: 32px;
  height: 32px;
  grid-row: span 2;
  align-self: center;
  border-radius: 8px;
  background: #eaf2ff;
  -webkit-mask: var(--icon-file) center / 19px 19px no-repeat;
  mask: var(--icon-file) center / 19px 19px no-repeat;
  box-shadow: inset 0 0 0 999px var(--blue);
}

.metric-9805::before {
  -webkit-mask-image: var(--icon-check);
  mask-image: var(--icon-check);
}

.metric-9810::before {
  -webkit-mask-image: var(--icon-download);
  mask-image: var(--icon-download);
}

.metric-card strong {
  color: var(--blue);
  font-size: 18px;
}

.metric-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.dashboard-card {
  min-height: 110px;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  align-content: center;
  gap: 8px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--soft-shadow);
}

.dashboard-card::before {
  width: 38px;
  height: 38px;
  background: #edf7f2;
  -webkit-mask-size: 22px 22px;
  mask-size: 22px 22px;
  box-shadow: inset 0 0 0 999px var(--green);
}

.card-settings::before {
  -webkit-mask-image: var(--icon-settings);
  mask-image: var(--icon-settings);
  background: #eef3f7;
  box-shadow: inset 0 0 0 999px #536273;
}

.card-history::before {
  -webkit-mask-image: var(--icon-refresh);
  mask-image: var(--icon-refresh);
  background: #fff7e8;
  box-shadow: inset 0 0 0 999px var(--amber);
}

.dashboard-card strong {
  color: var(--text);
  font-size: 16px;
}

.dashboard-card span {
  color: var(--muted);
  line-height: 1.42;
}

.overview-visual {
  min-width: 0;
  display: grid;
  place-items: center;
}

.overview-visual img {
  width: 100%;
  max-height: 240px;
  object-fit: contain;
}

.tool-panel,
.result-panel,
.history-panel,
.validation-panel,
.database-panel,
.settings-panel {
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px;
  box-shadow: var(--soft-shadow);
}

.settings-locked {
  display: grid;
  gap: 10px;
  padding: 18px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}

.settings-locked strong {
  font-size: 16px;
}

.user-table-wrap {
  margin-top: 16px;
}

.users-table {
  min-width: 980px;
}

.stepper {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.step {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.step-number {
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #e6ebf1;
  color: #536273;
  font-size: 12px;
}

.step-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.step-copy strong,
.step-copy small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.step-copy small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.step.active {
  border-color: #adc8f8;
  color: var(--blue);
  background: #f4f8ff;
}

.step.active .step-number,
.step.done .step-number {
  color: #ffffff;
  background: var(--blue);
}

.step.done {
  color: var(--green);
}

.main-grid {
  display: grid;
  grid-template-columns: minmax(420px, 1.35fr) minmax(280px, 0.65fr);
  gap: 18px;
  min-width: 0;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 18px;
  margin-bottom: 14px;
}

.panel-head.compact {
  margin-bottom: 12px;
}

.record-count {
  height: 30px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border-radius: 8px;
  background: #eef3f7;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.template-link,
.download-button {
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--blue);
  background: #f8fbff;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.template-link::before,
.download-button::before {
  content: "";
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  background: currentColor;
  -webkit-mask: var(--icon-download) center / contain no-repeat;
  mask: var(--icon-download) center / contain no-repeat;
}

.upload-form {
  display: grid;
  gap: 16px;
}

.query-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  align-items: end;
  margin-bottom: 12px;
  min-width: 0;
}

.query-bar > button,
.query-bar > .primary,
.query-bar > .secondary {
  min-width: 150px;
}

.query-bar label {
  display: grid;
  gap: 7px;
}

.query-bar label span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.query-bar input,
.query-bar select {
  width: 100%;
  height: 40px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
}

.query-bar-9810 {
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.wide-filter {
  min-width: 0;
}

.multi-select {
  position: relative;
}

.multi-select-trigger {
  width: 100%;
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
  cursor: pointer;
}

.multi-select-trigger span:first-child {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  color: var(--text);
  font-size: 12px;
  text-transform: none;
}

.multi-tag {
  padding: 5px 8px;
  border-radius: 6px;
  background: #eef3f7;
  font-size: 11px;
  font-weight: 800;
}

.multi-select-menu {
  position: absolute;
  z-index: 50;
  top: calc(100% + 6px);
  left: 0;
  width: min(320px, 90vw);
  display: grid;
  gap: 2px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.multi-select-menu button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}

.multi-select-menu button:hover,
.multi-select-menu button.selected {
  background: #eaf2ff;
}

.multi-select-menu button.selected::after {
  content: "✓";
  color: var(--blue);
  font-size: 15px;
  font-weight: 900;
}

.table-scroll {
  max-width: 100%;
  overflow-x: auto;
  padding-bottom: 2px;
}

.data-table th:first-child,
.data-table td:first-child {
  width: 24%;
}

.table-9805 {
  min-width: 880px;
}

.table-9805 th:nth-child(1),
.table-9805 td:nth-child(1) {
  width: 220px;
}

.table-9805 th:nth-child(2),
.table-9805 td:nth-child(2) {
  width: 190px;
}

.table-9805 th:nth-child(3),
.table-9805 td:nth-child(3) {
  width: 88px;
}

.table-9805 th:nth-child(4),
.table-9805 td:nth-child(4) {
  width: 120px;
}

.table-9805 th:nth-child(5),
.table-9805 td:nth-child(5) {
  width: 130px;
}

.table-9805 th:nth-child(6),
.table-9805 td:nth-child(6) {
  width: 128px;
}

.table-9810 {
  min-width: 920px;
}

.table-9810 th:nth-child(1),
.table-9810 td:nth-child(1) {
  width: 180px;
}

.table-9810 th:nth-child(2),
.table-9810 td:nth-child(2) {
  width: 220px;
}

.table-9810 th:nth-child(3),
.table-9810 td:nth-child(3) {
  width: 170px;
}

.table-9810 th:nth-child(4),
.table-9810 td:nth-child(4) {
  width: 120px;
}

.table-9810 th:nth-child(5),
.table-9810 td:nth-child(5) {
  width: 170px;
}

.table-9810 th:nth-child(6),
.table-9810 td:nth-child(6) {
  width: 118px;
}

.row-action,
.icon-button {
  min-width: 34px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--blue);
  font-weight: 800;
  cursor: pointer;
}

.row-actions {
  display: flex;
  gap: 6px;
  min-width: 114px;
}

.row-action {
  width: 34px;
  padding: 0;
}

.row-action svg,
.icon-button svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.row-action.danger {
  background: #ef4444;
  border-color: #ef4444;
  color: #ffffff;
}

.actions-cell {
  overflow: visible;
}

.cell-clip {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hover-tooltip {
  position: fixed;
  z-index: 100;
  max-width: min(360px, calc(100vw - 28px));
  padding: 11px 13px;
  border-radius: 6px;
  background: #ffffff;
  color: var(--text);
  box-shadow: 0 16px 36px rgba(20, 33, 48, 0.18);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
  pointer-events: none;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.12s ease, transform 0.12s ease;
  white-space: normal;
  word-break: break-word;
}

.hover-tooltip.visible {
  opacity: 1;
  transform: translateY(0);
}

.pagination-bar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
}

.pager-pages {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pager-page,
.pager-arrow {
  min-width: 34px;
  height: 34px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
}

.pager-page.active {
  border: 1px solid var(--text);
  background: #ffffff;
}

.pager-arrow:disabled {
  opacity: 0.35;
  cursor: default;
}

.pager-ellipsis,
.pagination-bar span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.pagination-bar select {
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(12, 20, 30, 0.46);
}

.modal-panel {
  width: min(980px, calc(100vw - 40px));
  max-height: calc(100vh - 48px);
  overflow: auto;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.confirm-panel {
  width: min(420px, calc(100vw - 40px));
  display: grid;
  justify-items: center;
  gap: 16px;
  padding: 32px;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
  text-align: center;
}

.confirm-illustration {
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  border: 2px solid #1f2937;
  border-radius: 999px;
  color: #1f2937;
  font-size: 38px;
  font-weight: 800;
}

.confirm-panel h2 {
  max-width: 320px;
  font-size: 22px;
}

.confirm-panel p {
  max-width: 320px;
  margin: 0;
}

.confirm-actions {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 4px;
}

.danger-button {
  height: 46px;
  padding: 0 16px;
  border: 1px solid #ef3340;
  border-radius: 8px;
  background: #ef3340;
  color: #ffffff;
  font-weight: 800;
  cursor: pointer;
}

.crud-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.crud-form label {
  display: grid;
  gap: 7px;
}

.crud-form .wide {
  grid-column: 1 / -1;
}

.crud-form .status-control,
.crud-form .status-actions {
  order: 50;
}

.crud-form label span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.crud-form input,
.crud-form select,
.crud-form textarea {
  width: 100%;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
}

.crud-form input,
.crud-form select {
  height: 40px;
}

.crud-form textarea {
  padding-top: 10px;
  resize: vertical;
}

.segment-control {
  width: fit-content;
  display: flex;
  gap: 3px;
  padding: 3px;
  margin-bottom: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #eef3f7;
}

.segment {
  height: 32px;
  min-width: 58px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
  cursor: pointer;
}

.segment.active {
  background: #ffffff;
  color: var(--blue);
  box-shadow: 0 1px 3px rgba(20, 33, 48, 0.12);
}

.drop-zone {
  min-height: 150px;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 8px;
  border: 1px dashed #9fb2c7;
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(232, 243, 255, 0.64), rgba(255, 255, 255, 0.82)),
    #fbfcfe;
  cursor: pointer;
}

.drop-zone input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.upload-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #eaf2ff;
  color: var(--blue);
}

.upload-icon svg {
  width: 24px;
  height: 24px;
}

.drop-title {
  font-size: 18px;
  font-weight: 800;
}

.drop-subtitle {
  color: var(--muted);
  font-size: 14px;
}

.actions {
  display: flex;
  justify-content: end;
  gap: 10px;
}

.primary,
.secondary {
  min-height: 40px;
  height: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 16px;
  border-radius: 8px;
  border: 1px solid var(--line);
  font-weight: 800;
  cursor: pointer;
  line-height: 1.2;
  white-space: normal;
}

.primary::before,
.secondary::before {
  content: "";
  width: 16px;
  height: 16px;
  display: none;
  flex: 0 0 auto;
  background: currentColor;
  -webkit-mask: var(--icon-file) center / contain no-repeat;
  mask: var(--icon-file) center / contain no-repeat;
}

#clearButton::before,
#validateButton::before,
#processButton::before,
#db9800SearchButton::before,
#db9805SearchButton::before,
#db9810SearchButton::before,
#db9800GenerateButton::before,
#db9805GenerateButton::before,
#db9800CarryButton::before,
#db9800NewButton::before,
#db9805NewButton::before,
#uploadLogoButton::before,
#crud9800DeleteButton::before,
#crud9805DeleteButton::before,
#crud9810ProcessButton::before {
  display: block;
}

#clearButton::before {
  -webkit-mask-image: var(--icon-trash);
  mask-image: var(--icon-trash);
}

#validateButton::before,
#crud9810ProcessButton::before {
  -webkit-mask-image: var(--icon-check);
  mask-image: var(--icon-check);
}

#db9800SearchButton::before,
#db9805SearchButton::before,
#db9810SearchButton::before {
  -webkit-mask-image: var(--icon-search);
  mask-image: var(--icon-search);
}

#db9800CarryButton::before {
  -webkit-mask-image: var(--icon-refresh);
  mask-image: var(--icon-refresh);
}

#db9800NewButton::before,
#db9805NewButton::before {
  -webkit-mask-image: var(--icon-plus);
  mask-image: var(--icon-plus);
}

#uploadLogoButton::before,
#processButton::before,
#db9800GenerateButton::before,
#db9805GenerateButton::before {
  -webkit-mask-image: var(--icon-file);
  mask-image: var(--icon-file);
}

#crud9800DeleteButton::before,
#crud9805DeleteButton::before {
  -webkit-mask-image: var(--icon-trash);
  mask-image: var(--icon-trash);
}

.primary {
  background: var(--blue);
  border-color: var(--blue);
  color: #ffffff;
}

.primary:hover {
  background: var(--blue-dark);
}

.primary:disabled {
  opacity: 0.55;
  cursor: wait;
}

.secondary {
  background: #ffffff;
  color: var(--text);
}

.secondary:disabled {
  opacity: 0.55;
  cursor: wait;
}

.primary:disabled,
.secondary:disabled {
  filter: grayscale(0.25);
}

.check-list {
  display: grid;
  gap: 10px;
}

.check-row {
  display: grid;
  grid-template-columns: 32px 1fr;
  align-items: start;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}

.check-row.ok {
  border-color: #bee7d7;
  background: #f1fbf7;
}

.check-row.warn {
  border-color: #f1d59a;
  background: #fff9eb;
}

.check-row.error {
  border-color: #ffd1cc;
  background: #fff5f3;
}

.check-row strong,
.check-row small {
  display: block;
}

.check-row strong {
  font-size: 14px;
}

.check-row small {
  margin-top: 3px;
  color: var(--muted);
  line-height: 1.35;
}

.check-dot {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #eef3f7;
  color: #7b8794;
}

.check-dot::before {
  content: "";
  width: 15px;
  height: 15px;
  background: currentColor;
  -webkit-mask: var(--icon-file) center / contain no-repeat;
  mask: var(--icon-file) center / contain no-repeat;
}

.check-row.ok .check-dot {
  background: #e8f8f0;
  color: var(--green);
}

.check-row.ok .check-dot::before {
  -webkit-mask-image: var(--icon-check);
  mask-image: var(--icon-check);
}

.check-row.warn .check-dot {
  background: #fff6e2;
  color: var(--amber);
}

.check-row.error .check-dot {
  background: #fff1f0;
  color: var(--red);
}

.check-row.error .check-dot::before {
  -webkit-mask-image: var(--icon-trash);
  mask-image: var(--icon-trash);
}

.check-row.muted {
  opacity: 0.86;
}

.result-status {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.label {
  color: var(--muted);
  display: block;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

pre {
  min-height: 54px;
  margin: 14px 0 0;
  padding: 14px;
  border-radius: 8px;
  background: #f4f7fa;
  color: #334155;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
}

table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 14px;
}

.settings-form {
  display: grid;
  grid-template-columns: minmax(220px, 0.7fr) minmax(320px, 1.3fr);
  gap: 12px 14px;
}

.logo-settings {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}

.if-logo-preview {
  width: 74px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.if-logo-preview img {
  max-width: 58px;
  max-height: 58px;
  object-fit: contain;
}

.logo-settings-copy {
  min-width: 0;
  display: grid;
  gap: 8px;
}

.logo-settings-copy span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.logo-settings-copy strong {
  font-size: 14px;
}

.logo-upload-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.logo-upload-row input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.file-button {
  height: 40px;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
  font-weight: 800;
  cursor: pointer;
}

.settings-form label {
  display: grid;
  gap: 7px;
}

.settings-form .wide {
  grid-column: 1 / -1;
}

.settings-form .identity-name {
  grid-column: auto;
}

.settings-form label span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.settings-form input,
.settings-form select {
  width: 100%;
  height: 40px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
}

.settings-form input[readonly] {
  background: #f4f7fa;
  color: var(--muted);
}

.settings-actions {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 12px;
}

.settings-actions span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

th,
td {
  padding: 11px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.empty-row {
  color: var(--muted);
}

.ok {
  color: var(--green);
  font-weight: 800;
}

.bad {
  color: var(--red);
  font-weight: 800;
}

.warn {
  color: var(--amber);
  font-weight: 800;
}

.muted-status {
  color: var(--muted);
  font-weight: 800;
}

.status-badge {
  width: fit-content;
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
}

.status-pendente {
  background: #fff3d8;
  color: #7a4c00;
}

.status-processando {
  background: #eaf2ff;
  color: #164ba5;
}

.status-finalizado {
  background: #e8f8f0;
  color: #106c49;
}

.hidden {
  display: none !important;
}

@media (max-width: 1360px) {
  .app-shell {
    width: min(100vw, calc(100vw - 12px));
    min-height: calc(100vh - 12px);
    margin: 6px auto;
    grid-template-columns: 212px minmax(0, 1fr);
  }

  .sidebar {
    gap: 18px;
    padding: 18px 14px;
  }

  .brand {
    gap: 10px;
  }

  .brand-logo {
    width: 42px;
    height: 42px;
  }

  .brand small {
    font-size: 11px;
  }

  .nav {
    gap: 6px;
  }

  .nav-item {
    height: 38px;
    padding: 0 10px 0 12px;
    font-size: 14px;
  }

  .workspace {
    gap: 14px;
    padding: 18px;
  }

  h1 {
    font-size: 25px;
  }

  .tool-panel,
  .result-panel,
  .history-panel,
  .validation-panel,
  .database-panel,
  .settings-panel {
    padding: 16px;
  }

  .stepper {
    gap: 6px;
  }

  .step {
    min-height: 38px;
    padding: 0 10px;
    font-size: 12px;
  }

  .main-grid {
    grid-template-columns: minmax(360px, 1.2fr) minmax(260px, 0.8fr);
    gap: 14px;
  }

  .query-bar {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  }

  .query-bar-9810 {
    grid-template-columns: repeat(auto-fit, minmax(155px, 1fr));
  }

  .drop-zone {
    min-height: 126px;
  }
}

@media (max-width: 1180px) {
  .main-grid,
  .overview-panel {
    grid-template-columns: 1fr;
  }

  .overview-visual img {
    max-height: 180px;
  }

  .dashboard-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 1100px) {
  .app-shell {
    width: 100vw;
    min-height: 100vh;
    margin: 0;
    grid-template-columns: 1fr;
    border: 0;
    border-radius: 0;
    overflow: visible;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 15;
    padding: 14px 18px;
    gap: 12px;
  }

  .nav {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .nav-item {
    min-width: max-content;
    text-align: center;
  }

  .nav-item.active {
    box-shadow: inset 0 -3px 0 #22c58b;
  }

  .sidebar-note {
    display: none;
  }

  .workspace {
    padding: 16px;
  }

  .topbar,
  .panel-head,
  .result-status {
    display: grid;
  }

  .top-actions {
    justify-content: start;
  }

  .stepper {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .metric-row,
  .dashboard-grid,
  .crud-form,
  .settings-form {
    grid-template-columns: 1fr;
  }
}

@media (max-height: 760px) and (min-width: 641px) {
  .app-shell {
    width: 100vw;
    min-height: 100vh;
    margin: 0;
    border-radius: 0;
  }

  .workspace {
    gap: 12px;
    padding-block: 14px;
  }

  .topbar {
    gap: 12px;
  }

  .drop-zone {
    min-height: 112px;
  }

  .tool-panel,
  .result-panel,
  .history-panel,
  .validation-panel,
  .database-panel,
  .settings-panel {
    padding-block: 14px;
  }
}

@media (max-width: 640px) {
  body {
    background: var(--surface-muted);
  }

  .sidebar {
    padding: 12px;
  }

  .brand {
    gap: 10px;
  }

  .brand-logo {
    width: 40px;
    height: 40px;
  }

  .brand small {
    display: none;
  }

  .nav {
    margin: 0 -4px;
    padding: 0 4px 4px;
  }

  .nav-item {
    height: 38px;
    padding: 0 11px;
    font-size: 13px;
  }

  .workspace {
    gap: 14px;
    padding: 14px;
  }

  h1 {
    font-size: 24px;
  }

  h2 {
    font-size: 17px;
  }

  p {
    font-size: 14px;
  }

  .top-actions {
    flex-wrap: wrap;
  }

  .status-chip,
  .date-chip {
    height: 32px;
    min-width: 0;
    font-size: 12px;
  }

  .stepper,
  .query-bar {
    grid-template-columns: 1fr;
  }

  .step {
    min-height: 38px;
    padding: 0 10px;
    font-size: 12px;
  }

  .overview-panel {
    padding: 16px;
  }

  .overview-copy h2 {
    font-size: 20px;
  }

  .overview-visual {
    display: none;
  }

  .metric-card,
  .dashboard-card {
    min-height: auto;
  }

  .panel-head {
    gap: 10px;
  }

  .record-count,
  .template-link,
  .download-button {
    width: 100%;
  }

  .query-bar > button,
  .query-bar > .primary,
  .query-bar > .secondary {
    width: 100%;
    min-width: 0;
  }

  .tool-panel,
  .result-panel,
  .history-panel,
  .validation-panel,
  .database-panel,
  .settings-panel {
    padding: 16px;
  }

  .actions {
    justify-content: stretch;
    flex-wrap: wrap;
  }

  .actions button {
    flex: 1;
  }

  .pagination-bar {
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
  }

  .pager-pages {
    order: 1;
    width: 100%;
    justify-content: center;
    gap: 6px;
  }

  .pagination-bar select {
    order: 2;
    width: 100%;
  }

  .table-scroll {
    overflow-x: visible;
  }

  .data-table,
  .data-table tbody,
  .data-table tr,
  .data-table td {
    display: block;
    width: 100% !important;
  }

  .data-table {
    min-width: 0 !important;
    table-layout: auto;
  }

  .data-table thead {
    display: none;
  }

  .data-table tr {
    margin-bottom: 10px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
  }

  .data-table td {
    display: grid;
    grid-template-columns: minmax(96px, 36%) minmax(0, 1fr);
    gap: 10px;
    align-items: start;
    padding: 8px 0;
    border-bottom: 1px solid #eef2f6;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    word-break: break-word;
  }

  .data-table td:last-child {
    border-bottom: 0;
  }

  .data-table td::before {
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
  }

  .data-table:not(.table-9805):not(.table-9810):not(.users-table) td:nth-child(1)::before {
    content: "ID";
  }

  .data-table:not(.table-9805):not(.table-9810):not(.users-table) td:nth-child(2)::before {
    content: "Documento";
  }

  .data-table:not(.table-9805):not(.table-9810):not(.users-table) td:nth-child(3)::before {
    content: "Valor";
  }

  .data-table:not(.table-9805):not(.table-9810):not(.users-table) td:nth-child(4)::before {
    content: "Origem";
  }

  .data-table:not(.table-9805):not(.table-9810):not(.users-table) td:nth-child(5)::before {
    content: "Status";
  }

  .data-table:not(.table-9805):not(.table-9810):not(.users-table) td:nth-child(6)::before {
    content: "Ações";
  }

  .table-9805 td:nth-child(1)::before {
    content: "ID 9800";
  }

  .table-9805 td:nth-child(2)::before {
    content: "Documento";
  }

  .table-9805 td:nth-child(3)::before {
    content: "Origem";
  }

  .table-9805 td:nth-child(4)::before {
    content: "Modalidade";
  }

  .table-9805 td:nth-child(5)::before {
    content: "Valor";
  }

  .table-9805 td:nth-child(6)::before {
    content: "Ações";
  }

  .table-9810 td:nth-child(1)::before {
    content: "Protocolo";
  }

  .table-9810 td:nth-child(2)::before {
    content: "ID Valor IF";
  }

  .table-9810 td:nth-child(3)::before {
    content: "Documento";
  }

  .table-9810 td:nth-child(4)::before {
    content: "Valor";
  }

  .table-9810 td:nth-child(5)::before {
    content: "Status";
  }

  .table-9810 td:nth-child(6)::before {
    content: "Ações";
  }

  .users-table td:nth-child(1)::before {
    content: "Nome";
  }

  .users-table td:nth-child(2)::before {
    content: "CPF";
  }

  .users-table td:nth-child(3)::before {
    content: "E-mail";
  }

  .users-table td:nth-child(4)::before {
    content: "Usuario";
  }

  .users-table td:nth-child(5)::before {
    content: "Perfil";
  }

  .users-table td:nth-child(6)::before {
    content: "Status";
  }

  .users-table td:nth-child(7)::before {
    content: "Ações";
  }

  .data-table .empty-row {
    display: block;
    padding: 10px 0;
    border: 0;
  }

  .data-table .empty-row::before {
    content: none !important;
  }

  .cell-clip {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
  }

  .actions-cell {
    align-items: center;
  }

  .row-actions {
    min-width: 0;
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .crud-form {
    gap: 12px;
  }

  .crud-form input,
  .crud-form select {
    height: 42px;
  }

  .settings-actions {
    display: grid;
    gap: 10px;
  }

  .settings-actions button {
    width: 100%;
  }

  .logo-settings {
    grid-template-columns: 1fr;
    justify-items: start;
  }

  .modal {
    display: block;
    padding: 0;
    overflow-y: auto;
  }

  .modal-panel,
  .confirm-panel {
    width: 100vw;
    min-height: 100dvh;
    max-height: none;
    padding: 16px;
    border: 0;
    border-radius: 0;
  }

  .confirm-actions {
    grid-template-columns: 1fr;
  }
}
