:root {
  --orange: #ff8a00;
  --orange-dark: #d96f00;
  --orange-soft: #fff3df;
  --bg: #f3f6fb;
  --panel: #ffffff;
  --line: #dbe4f0;
  --line-soft: #edf2f7;
  --text: #101828;
  --muted: #667085;
  --sidebar: #101828;
  --sidebar-soft: #182436;
  --green: #087443;
  --red: #b42318;
  --amber: #b25e09;
  --blue: #175cd3;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.06);
  --shadow-md: 0 14px 36px rgba(16, 24, 40, 0.09);
  --radius: 10px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at top right, rgba(255, 138, 0, 0.10), transparent 34rem),
    linear-gradient(180deg, #f7f9fc 0%, var(--bg) 22rem);
  color: var(--text);
  font-family: "Segoe UI", Arial, Helvetica, sans-serif;
  font-size: 13px;
  line-height: 1.45;
}

.auth-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
}

.auth-card {
  width: min(420px, 100%);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 24px;
  box-shadow: var(--shadow-md);
}

.auth-brand {
  color: var(--text);
  padding: 0 0 16px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.auth-brand small {
  color: var(--muted);
}

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

.auth-form button.primary {
  width: 100%;
  justify-self: stretch;
  min-height: 42px;
}

.auth-form .muted {
  margin: 0;
  text-align: center;
}

a {
  color: inherit;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 230px;
  background:
    radial-gradient(circle at 20% 0%, rgba(255, 138, 0, 0.20), transparent 13rem),
    linear-gradient(180deg, var(--sidebar-soft) 0%, var(--sidebar) 100%);
  color: #fff;
  padding: 18px 12px;
  overflow-y: auto;
  box-shadow: 10px 0 30px rgba(16, 24, 40, 0.16);
}

.brand {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 8px 8px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.16);
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: linear-gradient(135deg, #ffb547 0%, var(--orange) 100%);
  font-weight: 700;
  box-shadow: 0 12px 24px rgba(255, 138, 0, 0.28);
}

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

.brand small {
  color: #b9c3cf;
  margin-top: 2px;
}

nav {
  display: grid;
  gap: 5px;
  margin-top: 18px;
}

nav a {
  padding: 10px 12px;
  border-radius: 9px;
  color: #e8eef5;
  text-decoration: none;
  border: 1px solid transparent;
  transition: background 0.16s ease, color 0.16s ease, border-color 0.16s ease, transform 0.16s ease;
}

nav a:hover,
nav a.active {
  background: rgba(255, 255, 255, 0.11);
  border-color: rgba(255, 255, 255, 0.10);
  transform: translateX(2px);
}

nav a.active {
  color: #fff;
  border-left: 3px solid var(--orange);
  background: linear-gradient(90deg, rgba(255, 138, 0, 0.22), rgba(255, 255, 255, 0.08));
}

.nav-section {
  margin: 12px 8px 4px;
  color: #fbbf24;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.collapsible-section {
  cursor: pointer;
  user-select: none;
}

.collapsible-section::after {
  content: " -";
}

.collapsible-section.collapsed::after {
  content: " +";
}

.app {
  margin-left: 230px;
  padding: 24px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 18px;
  padding: 18px 20px;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(14px);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
}

h1,
h2 {
  margin: 0;
  line-height: 1.2;
}

h1 {
  font-size: 25px;
  letter-spacing: 0;
}

h2 {
  font-size: 16px;
  letter-spacing: 0;
}

.topbar p {
  margin: 5px 0 0;
  color: var(--muted);
}

.search {
  display: flex;
  min-width: 380px;
}

input,
textarea,
select,
button {
  font: inherit;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 9px;
  padding: 9px 11px;
  background: #fff;
  color: var(--text);
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--orange);
  box-shadow: 0 0 0 4px rgba(255, 138, 0, 0.14);
  outline: none;
}

textarea {
  resize: vertical;
}

button,
.btn-mini {
  border: 0;
  border-radius: 9px;
  background: linear-gradient(180deg, #ff9f22 0%, var(--orange) 100%);
  color: #fff;
  cursor: pointer;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 8px 16px rgba(255, 138, 0, 0.18);
  transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

button {
  padding: 8px 13px;
}

.btn-mini {
  display: inline-block;
  padding: 6px 10px;
  white-space: nowrap;
}

.search input {
  border-radius: 5px 0 0 5px;
}

.search button {
  border-radius: 0 5px 5px 0;
}

.primary:hover,
button:hover,
.btn-mini:hover {
  background: var(--orange-dark);
  box-shadow: 0 10px 20px rgba(255, 138, 0, 0.24);
  transform: translateY(-1px);
}

.ghost {
  background: #253044;
  box-shadow: 0 8px 16px rgba(16, 24, 40, 0.12);
}

.danger {
  background: #b42318;
}

.danger:hover {
  background: #8f1d14;
}

.flash {
  padding: 12px 14px;
  border-radius: 12px;
  margin-bottom: 12px;
  border: 1px solid transparent;
  box-shadow: var(--shadow-sm);
}

.flash.success {
  background: #ecfdf3;
  color: #17633a;
  border-color: #abefc6;
}

.flash.error {
  background: #fef3f2;
  color: #a12828;
  border-color: #fecdca;
}

.import-wizard {
  border-color: #ffc36f;
}

.wizard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(280px, 0.8fr);
  gap: 14px;
  padding: 14px;
}

.wizard-copy {
  margin: 8px 0 14px;
  color: var(--muted);
}

.wizard-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.wizard-form input {
  font-size: 14px;
}

.example-link {
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.inline-error,
.progress-box {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 6px;
}

.inline-error {
  background: #fff0f0;
  color: #a12828;
  border: 1px solid #f2b8b8;
}

.progress-box {
  background: #fff7e8;
  color: #8a4d00;
  border: 1px solid #ffc36f;
  font-weight: 700;
}

button:disabled {
  cursor: wait;
  opacity: 0.75;
}

.login-card {
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 12px;
  background: #fffaf2;
}

.login-card h3 {
  margin: 0 0 10px;
  font-size: 14px;
}

.login-card dl {
  display: grid;
  gap: 8px;
  margin: 0;
}

.login-card div {
  display: grid;
  grid-template-columns: 80px minmax(0, 1fr);
  gap: 8px;
}

.login-card dt {
  color: var(--muted);
  font-weight: 700;
}

.login-card dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.mini-filter {
  min-width: min(420px, 100%);
}

.mini-filter label,
.mini-form {
  display: grid;
  gap: 6px;
}

.mini-form {
  grid-template-columns: repeat(4, minmax(0, 1fr)) auto;
  align-items: end;
}

.check-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 8px;
}

.check-grid label {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

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

.response-folder {
  display: grid;
  gap: 8px;
  align-content: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbfdff;
}

.response-folder h3,
.pack-card strong {
  margin: 0;
}

.response-folder p,
.pack-card small {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.split.inner {
  padding: 14px;
  border-bottom: 1px solid var(--line);
}

.pack-card {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffaf2;
  margin-bottom: 8px;
}

.response-help {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid #ffe0ad;
  border-radius: 8px;
  background: #fffaf2;
}

.response-help span {
  color: var(--muted);
}

.response-hero {
  border-color: #ffd49a;
  background:
    linear-gradient(135deg, rgba(255, 138, 0, 0.08), transparent 42%),
    #fff;
}

.response-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  padding: 14px;
  border-bottom: 1px solid var(--line);
}

.response-kpis div,
.flow-card {
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #fbfdff;
  padding: 12px;
}

.response-kpis span,
.flow-card span,
.response-collapse summary small {
  color: var(--muted);
}

.response-kpis strong {
  display: block;
  margin-top: 4px;
  font-size: 19px;
  color: var(--text);
}

.response-flow {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  padding: 12px;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.flow-card {
  display: grid;
  gap: 5px;
  align-content: start;
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.flow-card strong {
  color: var(--text);
}

.flow-card.ok {
  border-color: #abefc6;
  background: #ecfdf3;
}

.flow-card.warn {
  border-color: #fedf89;
  background: #fffaeb;
}

.response-collapse {
  background: #fff;
}

.response-collapse summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  cursor: pointer;
  border-bottom: 1px solid var(--line);
  list-style: none;
}

.response-collapse summary::-webkit-details-marker {
  display: none;
}

.response-collapse summary::after {
  content: "+";
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  color: #fff;
  background: var(--orange);
  font-weight: 800;
}

.response-collapse[open] summary::after {
  content: "-";
}

.response-collapse summary span {
  font-size: 16px;
  font-weight: 800;
}

.status-form {
  display: flex;
  gap: 10px;
  align-items: end;
  padding: 0 14px 14px;
  flex-wrap: wrap;
  border-top: 1px solid var(--line-soft);
  padding-top: 12px;
}

.checklist-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  padding: 14px;
}

.check-item {
  display: grid;
  gap: 4px;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid var(--line);
}

.check-item.ok {
  background: #e8f6ef;
  color: var(--green);
}

.check-item.missing {
  background: #fff0f0;
  color: var(--red);
}

.preview-box {
  padding: 14px;
  border-top: 1px solid var(--line);
}

.preview-box h3 {
  margin: 0 0 10px;
}

.import-steps {
  margin: 0;
  padding: 0 14px 14px 38px;
  color: #344054;
}

.import-steps li {
  padding: 3px 0;
}

.stats,
.market-dashboard {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.stats div,
.summary-card,
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04);
}

.stats div,
.summary-card {
  padding: 14px;
}

.stats strong {
  display: block;
  color: var(--orange);
  font-size: 24px;
}

.stats span {
  color: var(--muted);
}

.summary-card {
  display: grid;
  gap: 5px;
  align-content: start;
  border-top: 3px solid transparent;
}

.summary-card.wide {
  grid-column: span 2;
}

.summary-card span {
  color: var(--muted);
  font-weight: 700;
}

.summary-card strong {
  color: #111827;
  font-size: 17px;
  overflow-wrap: anywhere;
}

.summary-card small {
  color: var(--text);
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.warning-card {
  border-top-color: var(--orange);
  background: #fffaf2;
}

.inline-form {
  margin-top: 6px;
}

.mini-inline-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
  margin-top: 8px;
}

.mini-inline-form select {
  min-width: 0;
  padding: 7px 9px;
}

.mini-list {
  display: grid;
  gap: 4px;
  margin: 6px 0 0;
  padding-left: 16px;
  color: #475467;
  font-size: 12px;
}

.panel {
  margin-bottom: 14px;
  overflow: hidden;
}

.panel h2,
.panel-head {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

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

.muted,
.hint {
  color: var(--muted);
}

.hint {
  margin: 0;
  padding: 10px 14px;
  font-size: 12px;
}

.table-wrap {
  overflow: auto;
}

.main-grid {
  min-height: 420px;
  max-height: calc(100vh - 260px);
}

.response-hero .detail-grid:not(.table-wrap) {
  display: grid;
  grid-template-columns: repeat(3, minmax(220px, 1fr));
  gap: 10px;
  padding: 14px;
  max-height: none;
}

.response-hero .detail-grid:not(.table-wrap) div {
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #fbfdff;
}

.response-hero .detail-grid:not(.table-wrap) dt {
  color: var(--muted);
  font-weight: 700;
}

.response-hero .detail-grid:not(.table-wrap) dd {
  margin: 4px 0 0;
  overflow-wrap: anywhere;
}

.docs-grid {
  min-height: 260px;
  max-height: calc(100vh - 300px);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 1100px;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f58b00;
  color: #fff;
  padding: 8px 7px;
  text-align: left;
  font-size: 12px;
  border-right: 1px solid rgba(255, 255, 255, 0.35);
}

.sortable-heading {
  cursor: pointer;
  user-select: none;
}

.sortable-heading::after {
  content: " ↕";
  opacity: 0.7;
  font-weight: 400;
}

.sortable-heading.sort-asc::after {
  content: " ↑";
}

.sortable-heading.sort-desc::after {
  content: " ↓";
}

td {
  padding: 7px;
  border-right: 1px solid #e4e7ec;
  border-bottom: 1px solid #e4e7ec;
  vertical-align: top;
}

.sortable-table td:not(.actions):not(.empty) {
  max-width: 340px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sortable-table td.actions,
.sortable-table td:has(input),
.sortable-table td:has(select),
.sortable-table td:has(textarea) {
  max-width: none;
  white-space: normal;
}

tbody tr:nth-child(even) td {
  background: #f8fafc;
}

tbody tr.selected td,
tbody tr:hover td {
  background: #fff1d6;
  color: #182230;
}

tbody tr.at-risk td {
  background: #fff8e8;
}

tbody tr.is-disabled td {
  color: #8a94a6;
  background: #f3f4f6;
}

.clickable-row {
  cursor: pointer;
}

.icon-link {
  font-size: 17px;
  text-decoration: none;
}

.empty {
  color: var(--muted);
  padding: 18px;
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
  gap: 14px;
  align-items: start;
}

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

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

.filter-grid {
  display: grid;
  grid-template-columns: minmax(220px, 1.2fr) repeat(3, minmax(160px, 0.8fr)) auto auto;
  gap: 10px;
  align-items: end;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}

.compact-filter {
  grid-template-columns: minmax(280px, 1fr) auto auto;
}

.prospectus-form {
  border-bottom: 1px solid var(--line);
}

label {
  display: grid;
  gap: 5px;
  color: #475467;
  font-weight: 700;
}

.span-2 {
  grid-column: span 2;
}

.checkbox-label {
  display: flex;
  gap: 8px;
  align-items: center;
  align-self: end;
}

.checkbox-label input {
  width: auto;
}

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

.collapsible {
  display: none;
}

.collapsible.open {
  display: block;
}

.doc-list,
.favorite-list {
  display: grid;
  gap: 8px;
  padding: 12px;
  margin: 0;
}

.doc-list a,
.favorite-list li {
  display: grid;
  gap: 4px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fafafa;
  text-decoration: none;
  list-style: none;
}

.doc-list span,
.favorite-list span {
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}

.inline-delete {
  display: inline;
  margin: 0;
}

.inline-delete button {
  padding: 6px 10px;
}

.form-actions {
  display: flex;
  gap: 8px;
  align-items: end;
  flex-wrap: wrap;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 3px 8px;
  border-radius: 999px;
  font-weight: 700;
  white-space: nowrap;
}

.badge-ok {
  color: var(--green);
  background: #e8f6ef;
}

.badge-warn {
  color: var(--amber);
  background: #fff0c2;
}

.badge-role {
  color: #344054;
  background: #eef2f7;
}

.compact-table {
  min-width: 620px;
}

.alert-log {
  padding: 12px 14px;
  border-top: 1px solid var(--line);
}

.alert-log h3 {
  margin: 0 0 8px;
  font-size: 14px;
}

.alert-log p {
  margin: 6px 0;
  color: #475467;
}

.detail-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  margin: 0;
  padding: 12px;
}

.detail-list div {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 12px;
  padding: 8px 10px;
  border-bottom: 1px solid #edf0f4;
}

.detail-list dt {
  color: #475467;
  font-weight: 700;
}

.detail-list dd {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* Visual polish layer */
.stats div,
.summary-card,
.panel {
  border-radius: 14px;
  box-shadow: var(--shadow-sm);
}

.stats div,
.summary-card,
.panel,
.doc-list a,
.favorite-list li,
.check-grid label,
.response-folder,
.pack-card {
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.stats div:hover,
.summary-card:hover,
.doc-list a:hover,
.favorite-list li:hover,
.check-grid label:hover,
.response-folder:hover,
.pack-card:hover {
  border-color: #c8d4e5;
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.warning-card {
  background: linear-gradient(180deg, #fffaf2 0%, #fff 100%);
}

.panel {
  margin-bottom: 16px;
}

.panel h2,
.panel-head {
  padding: 14px 16px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
}

.table-wrap {
  scrollbar-color: #cbd5e1 transparent;
  scrollbar-width: thin;
}

.table-wrap::-webkit-scrollbar,
.sidebar::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

.table-wrap::-webkit-scrollbar-thumb,
.sidebar::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 999px;
}

.sidebar::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.22);
}

table {
  background: #fff;
}

th {
  background: #172033;
  padding: 10px 9px;
  border-right: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 -2px 0 var(--orange);
}

.sortable-heading::after {
  content: " ^v";
  opacity: 0.7;
  font-weight: 400;
}

.sortable-heading.sort-asc::after {
  content: " ^";
}

.sortable-heading.sort-desc::after {
  content: " v";
}

td {
  padding: 9px;
  border-right: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
}

tbody tr:nth-child(even) td {
  background: #f9fbfd;
}

tbody tr.selected td,
tbody tr:hover td {
  background: #fff7e8;
  color: #182230;
}

.split {
  gap: 16px;
}

.form-grid {
  gap: 14px;
  padding: 16px;
}

.filter-grid {
  padding: 14px 16px;
  background: #fbfdff;
}

label {
  color: #344054;
}

.doc-list a,
.favorite-list li,
.check-grid label,
.response-folder {
  border-radius: 10px;
  background: #fbfdff;
}

.badge {
  padding: 4px 9px;
  border: 1px solid transparent;
}

.badge-ok {
  background: #ecfdf3;
  border-color: #abefc6;
}

.badge-warn {
  background: #fffaeb;
  border-color: #fedf89;
}

.badge-role {
  background: #f2f4f7;
  border-color: #eaecf0;
}

.alert-log {
  background: #fbfdff;
}

.alert-log p {
  padding: 8px 10px;
  border-radius: 9px;
  background: #fff;
  border: 1px solid var(--line-soft);
}

.domain-presets {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: #fbfdff;
}

.domain-group {
  padding: 8px 10px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: #fff;
}

.domain-group summary {
  cursor: pointer;
  font-weight: 800;
  color: #182230;
}

.confirm-small {
  min-width: 110px;
  align-self: center;
}

.confirm-input {
  max-width: 180px;
}

form.ajax-loading {
  opacity: 0.72;
  pointer-events: none;
}

.ajax-loading-page::before {
  content: "";
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 9999;
  height: 3px;
  background: linear-gradient(90deg, var(--orange), #ffd166, var(--orange));
  background-size: 220% 100%;
  animation: ajaxBar 1s linear infinite;
}

@keyframes ajaxBar {
  from {
    background-position: 0 0;
  }

  to {
    background-position: 220% 0;
  }
}

.ajax-error {
  margin-bottom: 12px;
}

.detail-list div {
  border-bottom: 1px solid var(--line-soft);
}

.empty {
  background: #fbfdff;
  border-radius: 10px;
}

@media (max-width: 1100px) {
  .sidebar {
    position: static;
    width: auto;
  }

  .app {
    margin-left: 0;
    padding: 12px;
  }

  .topbar,
  .split,
  .wizard-grid,
  .wizard-form {
    display: block;
  }

  .wizard-form button {
    margin-top: 10px;
    width: 100%;
  }

  .search {
    min-width: 0;
    margin-top: 12px;
  }

  .stats,
  .market-dashboard,
  .filter-grid,
  .form-grid,
  .form-grid.compact,
  .response-kpis,
  .response-flow,
  .response-folders,
  .checklist-grid,
  .detail-list {
    grid-template-columns: 1fr;
  }

  .mini-form {
    grid-template-columns: 1fr;
  }

  .status-form,
  .response-help {
    display: grid;
  }

  .main-grid,
  .docs-grid,
  .detail-grid {
    max-height: none;
  }

  .detail-list div {
    grid-template-columns: 1fr;
  }

  .span-2 {
    grid-column: auto;
  }

  .summary-card.wide {
    grid-column: auto;
  }
}

@media (max-width: 720px) {
  body {
    font-size: 14px;
  }

  .app {
    padding: 8px;
  }

  .panel,
  .response-collapse {
    border-radius: 10px;
  }

  .topbar,
  .panel-head,
  .actions,
  .status-form {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .response-hero .detail-grid:not(.table-wrap) {
    grid-template-columns: 1fr;
    padding: 10px;
  }

  .response-kpis div,
  .flow-card,
  .check-item {
    padding: 12px;
  }

  table {
    min-width: 760px;
  }

  .sortable-table td:not(.actions):not(.empty) {
    max-width: 220px;
  }

  .btn-mini,
  button,
  .primary {
    min-height: 40px;
  }
}

.app-v2 {
  background:
    radial-gradient(circle at 20% 0%, rgba(255, 143, 0, 0.08), transparent 26rem),
    linear-gradient(180deg, #f7f9fc 0%, #ffffff 38rem);
  min-height: 100vh;
}

.app-v2 .topbar {
  border: 1px solid #d9e2ef;
  box-shadow: 0 18px 45px rgba(16, 24, 40, 0.08);
}

.app-v2 .topbar h1 {
  letter-spacing: 0;
}

.app-v2 .panel,
.app-v2 .response-collapse {
  border: 1px solid #dbe4f0;
  box-shadow: 0 14px 35px rgba(16, 24, 40, 0.06);
  overflow: hidden;
}

.app-v2 .panel > h2,
.app-v2 .panel-head h2,
.app-v2 .response-collapse summary span {
  position: relative;
}

.app-v2 .panel > h2::after,
.app-v2 .panel-head h2::after,
.app-v2 .response-collapse summary span::after {
  content: "";
  display: block;
  width: 76px;
  height: 1px;
  margin-top: 10px;
  background: linear-gradient(90deg, var(--orange), transparent);
}

.app-v2 .filter-grid,
.app-v2 .form-grid,
.app-v2 .detail-grid {
  align-items: end;
}

.app-v2 input,
.app-v2 select,
.app-v2 textarea {
  border-radius: 10px;
  color: #182230;
  background: #fff;
}

.app-v2 option {
  color: #182230;
  background: #fff;
}

.app-v2 .primary,
.app-v2 .btn-mini {
  border-radius: 10px;
}

.app-v2 .table-wrap {
  border-radius: 12px;
  background: #fff;
}

.app-v2 table {
  table-layout: fixed;
}

.app-v2 td:not(.actions):not(.empty),
.app-v2 th {
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: top;
}

.app-v2 td {
  line-height: 1.35;
}

.app-v2 .actions {
  white-space: normal;
}

.app-v2 .response-hero {
  position: relative;
}

.app-v2 .response-hero::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  background: linear-gradient(90deg, var(--orange), #ffc857, #182230);
}

.app-v2 .response-kpis div,
.app-v2 .flow-card,
.app-v2 .check-item {
  border-radius: 12px;
}

.app-v2 .mini-filter {
  min-width: min(420px, 100%);
}

.app-v2 .mini-filter select {
  width: 100%;
}

@media (max-width: 720px) {
  .app-v2 {
    padding: 8px;
  }

  .app-v2 table {
    min-width: 900px;
  }

  .app-v2 .topbar,
  .app-v2 .panel {
    border-radius: 12px;
  }

  .app-v2 .filter-grid,
  .app-v2 .form-grid,
  .app-v2 .form-grid.compact {
    padding: 12px;
  }
}

.response2-top {
  align-items: end;
}

.response2-market {
  width: min(520px, 100%);
}

.response2-market label,
.response2-market select {
  width: 100%;
}

.response2-summary {
  padding-bottom: 0;
}

.response2-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  padding: 14px;
}

.response2-kpis article,
.response2-facts div,
.response2-checklist div {
  padding: 14px;
  border: 1px solid #e4eaf2;
  border-radius: 12px;
  background: #fbfdff;
}

.response2-kpis span,
.response2-facts dt {
  display: block;
  margin-bottom: 6px;
  color: #667085;
  font-size: 13px;
  font-weight: 700;
}

.response2-kpis strong {
  color: #101828;
  font-size: 24px;
}

.response2-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 0 14px 14px;
}

.response2-facts dd {
  margin: 0;
  color: #101828;
}

.response2-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
}

.response2-inline {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  padding: 14px;
}

.response2-checklist {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 0 14px 14px;
}

.response2-checklist .ok {
  background: #ecfdf3;
  border-color: #abefc6;
}

.response2-checklist .missing {
  background: #fff5f5;
  border-color: #fecdca;
}

.response2-checklist strong {
  display: block;
  margin-bottom: 4px;
}

.response2-packs {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid #e4eaf2;
  border-radius: 12px;
  background: #fbfdff;
}

.response2-packs label,
.response2-main-check {
  display: flex;
  align-items: center;
  gap: 8px;
}

.response2-main-check {
  padding: 0 14px 12px;
}

.response2 .table-wrap {
  max-height: none;
}

@media (max-width: 980px) {
  .response2-kpis,
  .response2-facts,
  .response2-grid,
  .response2-checklist,
  .response2-inline {
    grid-template-columns: 1fr;
  }
}

.reference-layout {
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.reference-pack-list {
  position: sticky;
  top: 12px;
}

.reference-cards {
  display: grid;
  gap: 10px;
  max-height: calc(100vh - 210px);
  overflow: auto;
  padding: 12px;
}

.reference-card {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid #dbe4f0;
  border-radius: 12px;
  background: #fff;
}

.reference-card.is-selected {
  border-color: var(--orange);
  background: #fff7eb;
  box-shadow: inset 4px 0 0 var(--orange);
}

.reference-card.is-disabled {
  opacity: 0.7;
}

.reference-card a {
  display: grid;
  gap: 5px;
  color: inherit;
  text-decoration: none;
}

.reference-card strong {
  color: #101828;
  font-size: 14px;
}

.reference-card span,
.reference-card small {
  color: #667085;
  font-size: 12px;
}

.reference-main {
  display: grid;
  gap: 16px;
}

.reference-panel {
  overflow: visible;
}

.reference-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 12px 14px 0;
}

.reference-summary div {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid #e4eaf2;
  border-radius: 10px;
  background: #fbfdff;
}

.reference-summary span {
  color: #667085;
  font-size: 12px;
  font-weight: 700;
}

.reference-summary strong {
  color: #101828;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reference-form {
  align-items: end;
}

.reference-doc-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 14px;
}

.reference-action-box {
  display: grid;
  gap: 10px;
  align-content: start;
  padding: 14px;
  border: 1px solid #e4eaf2;
  border-radius: 12px;
  background: #fbfdff;
}

.reference-action-box h3 {
  margin: 0;
  color: #101828;
  font-size: 14px;
}

.reference-action-box button {
  justify-self: start;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 10px;
  border: 1px solid #dbe4f0;
  border-radius: 999px;
  color: #475467;
  background: #f8fafc;
  font-size: 12px;
  font-weight: 800;
}

@media (max-width: 980px) {
  .reference-layout,
  .reference-doc-actions,
  .reference-summary {
    grid-template-columns: 1fr;
  }

  .reference-pack-list {
    position: static;
  }

  .reference-cards {
    max-height: none;
  }
}

@media (min-width: 761px) and (max-width: 1100px) {
  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 230px;
  }

  .app {
    margin-left: 230px;
    padding: 16px;
  }

  .topbar {
    display: flex;
  }
}
