/* =========================
   FINTECH DARK OVERRIDE
   ========================= */

:root {
  --app-body: #0d0f12;
  --app-topbar: #13161c;
  --app-sidebar: #111318;
  --app-card: #14171d;
  --app-hover: #1a1d23;
  --app-input: #1b1f27;

  --app-border-soft: #1a1d24;
  --app-border-card: #1e222a;
  --app-border-strong: #2a2e39;

  --app-text-main: #e5e5e5;
  --app-text-soft: #c7c7c7;
  --app-text-muted: #aab2c0;
  --app-text-dim: #7f8794;
}

/* === глобально === */
html.dark,
body.dark {
  background: var(--app-body);
  color: var(--app-text-main);
}

/* === layout === */
.app-shell {
  background: var(--app-body);
}

.app-topbar-shell {
  background: var(--app-topbar);
  border-color: var(--app-border-soft);
}

.app-sidebar-shell {
  background: var(--app-sidebar);
  border-color: var(--app-border-soft);
}

.app-card-shell {
  background: var(--app-card);
  border: 1px solid var(--app-border-card);
}

/* === текст === */
.app-text-main { color: var(--app-text-main); }
.app-text-soft { color: var(--app-text-soft); }
.app-text-muted { color: var(--app-text-muted); }
.app-text-dim { color: var(--app-text-dim); }

/* === кнопки === */
.app-btn-shell {
  background: #22262f;
  border: 1px solid #3a4150;
  color: #d7d8e4;
  transition: .15s;
}

.app-btn-shell:hover {
  background: #2a303b;
  border-color: #4a5366;
  color: #fff;
}

/* === inputs === */
.app-input-shell {
  background: var(--app-input);
  border: 1px solid var(--app-border-strong);
  color: var(--app-text-main);
}

.app-input-shell:focus {
  border-color: #4a5366;
  background: #1d2027;
}

/* =========================
   УБИВАЕМ СИНЕВУ TAILADMIN
   ========================= */

.dark .bg-gray-950,
.dark .bg-gray-900,
.dark .bg-gray-900\/95 {
  background: #0d0f12 !important;
}

.dark .bg-gray-800,
.dark .bg-white\/5 {
  background: #14171d !important;
}

.dark .border-gray-800,
.dark .border-gray-700 {
  border-color: #1e222a !important;
}

.dark .text-white,
.dark .text-white\/90 {
  color: #e5e5e5 !important;
}

.dark .text-gray-300,
.dark .text-gray-400 {
  color: #aab2c0 !important;
}

.dark .hover\:bg-gray-700:hover,
.dark .hover\:bg-gray-800:hover {
  background: #1a1d23 !important;
}


.app-border-card {
  border-color: #1e222a;
}

.app-toggle-track {
  background: #2a2e39;
}

.peer:checked + .app-toggle-track,
.peer-checked\:app-toggle-track {
  background: #4a5366;
}

.app-toggle-thumb {
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}

.app-toggle-track {
  background: #2a2e39;
}

label .peer:checked + .app-toggle-track {
  background: #4a5366;
}

.app-card-shell {
  background: #14171d;
  border: 1px solid #1e222a;
  transition: border-color .15s ease, background .15s ease;
}

.app-card-shell:hover {
  border-color: #2a2e39;
}

.app-border-card {
  border-color: #1e222a;
}

.table-divider > * + * {
  border-top: 1px solid #1e222a;
}

.app-table-row:hover {
  background: #1a1d23;
}

.app-code-chip {
  background: #1b1f27;
  color: #d8dbe3;
  border: 1px solid #2a2e39;
}

.app-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.25rem 0.75rem;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
}

.app-badge-neutral {
  background: rgba(127, 135, 148, 0.14);
  color: #c7c7c7;
  border: 1px solid rgba(127, 135, 148, 0.2);
}

.app-badge-success {
  background: rgba(76, 217, 100, 0.14);
  color: #4cd964;
  border: 1px solid rgba(76, 217, 100, 0.2);
}

.app-badge-warning {
  background: rgba(247, 144, 9, 0.14);
  color: #f79009;
  border: 1px solid rgba(247, 144, 9, 0.2);
}

.app-badge-orange {
  background: rgba(251, 101, 20, 0.14);
  color: #fb6514;
  border: 1px solid rgba(251, 101, 20, 0.2);
}

.app-badge-error {
  background: rgba(240, 68, 56, 0.14);
  color: #f04438;
  border: 1px solid rgba(240, 68, 56, 0.2);
}

.app-badge-progress {
  background: rgba(139, 92, 246, 0.12);
  color: #c4b5fd;
  border: 1px solid rgba(139, 92, 246, 0.25);
}


.app-toggle-track {
  background: #2a2e39;
}

/* OFF */
.app-toggle-track {
  background: #2a2e39;
  transition: background 0.2s ease;
}

/* ON — зелёный */
label .peer:checked + .app-toggle-track {
  background: #12b76a;
}

/* hover (чуть живее) */
label:hover .peer:checked + .app-toggle-track {
  background: #0ea765;
}

.app-toggle-thumb {
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
  transform: translateX(0);
}

label .peer:checked + .app-toggle-track .app-toggle-thumb {
  transform: translateX(20px);
}


.auth-submit-btn {
  background: #e5e7eb;
  color: #111318;
  border: 1px solid #d1d5db;
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease,
    transform 0.15s ease;
}

.auth-submit-btn:hover {
  background: #ffffff;
  border-color: #e5e7eb;
}

.auth-submit-btn:active {
  transform: translateY(1px);
}

.auth-error-box {
  background: rgba(240, 68, 56, 0.12);
  border: 1px solid rgba(240, 68, 56, 0.22);
  color: #ff8a80;
}


.app-input-shell {
  background: #1b1f27;
  border: 1px solid #2a2e39;
  color: #e5e7eb;
}

.app-input-shell::placeholder {
  color: #7f8794;
}

.app-input-shell:focus {
  outline: none;
  border-color: #4a5366;
  background: #1d2027;
}

#jsonFields {
  display: grid;
  gap: 16px;
}

#jsonFields .json-row,
#jsonFields .json-field,
#jsonFields > div {
  border-top: 1px solid #1e222a;
  padding-top: 16px;
}

#jsonFields .json-row:first-child,
#jsonFields .json-field:first-child,
#jsonFields > div:first-child {
  border-top: 0;
  padding-top: 0;
}

#jsonFields pre {
  margin: 8px 0 0;
  overflow-x: auto;
  border-radius: 12px;
  border: 1px solid #2a2e39;
  background: #1b1f27;
  color: #d8dbe3;
  padding: 14px 16px;
  font-size: 12px;
  line-height: 1.5;
}

#jsonFields code {
  color: #d8dbe3;
}


.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 9999999;
  border-radius: 10px;
  border: 1px solid #2c313c;
  background: #1f242d;
  color: #e6e8ee;
  padding: 10px 14px;
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  animation: toast-in 0.15s ease forwards;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.json-table {
  display: grid;
  gap: 18px;
}

.json-detail-row {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 16px;
  border-top: 1px solid #1e222a;
  padding-top: 18px;
}

.json-detail-row:first-child {
  border-top: 0;
  padding-top: 0;
}

.json-key {
  color: #8b93a7;
  font-size: 13px;
  font-weight: 600;
  word-break: break-word;
  padding-top: 4px;
}

.json-value {
  min-width: 0;
  color: #e6eaf2;
  font-size: 14px;
}

.nested-json {
  margin: 0;
  overflow-x: auto;
  border-radius: 14px;
  border: 1px solid #2a2e39;
  background: #151922;
  color: #d8dee9;
  padding: 16px 18px;
  font-size: 12.5px;
  line-height: 1.65;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.02),
    0 8px 24px rgba(0, 0, 0, 0.22);
  white-space: pre-wrap;
  word-break: break-word;
}

/* inline primitive values */
.value-null {
  color: #7f8794;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.value-boolean {
  color: #c792ea;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-weight: 600;
}

.value-number {
  color: #f78c6c;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.value-string {
  color: #c3e88d;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.value-default {
  color: #d8dee9;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

/* syntax highlight inside <pre> */
.json-key-inline {
  color: #82aaff;
  font-weight: 600;
}

.json-string {
  color: #c3e88d;
}

.json-number {
  color: #f78c6c;
}

.json-boolean {
  color: #c792ea;
  font-weight: 600;
}

.json-null {
  color: #7f8794;
  font-style: italic;
}

@media (max-width: 768px) {
  .json-detail-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .json-key {
    padding-top: 0;
  }

  .nested-json {
    padding: 14px;
    font-size: 12px;
  }
}



.tx-info-list {
  display: grid;
  gap: 0;
}

.tx-info-row {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  padding: 12px 0;
  border-top: 1px solid #1e222a;
}

.tx-info-row:first-child {
  border-top: 0;
  padding-top: 0;
}

.tx-info-row:last-child {
  padding-bottom: 0;
}

.tx-info-label {
  color: #7f8794;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.5;
}

.tx-info-value {
  min-width: 0;
  color: #e5e5e5;
  font-size: 14px;
  line-height: 1.5;
  word-break: break-word;
}

@media (max-width: 768px) {
  .tx-info-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .tx-info-label {
    font-size: 12px;
  }
}

.json-box-wrap {
  position: relative;
}

.json-box-actions {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 8px;
}

.json-copy-btn {
  border: 1px solid #2a2e39;
  background: #1b1f27;
  color: #aab2c0;
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.json-copy-btn:hover {
  background: #222834;
  border-color: #4a5366;
  color: #ffffff;
}

.json-copy-btn-small {
  padding: 5px 9px;
  font-size: 11px;
}

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

.json-inline-value {
  min-width: 0;
  flex: 1;
}

.table-divider > tr + tr {
  border-top: 1px solid #1e222a;
}

.app-table-row:hover {
  background: #1a1d23;
}


.app-input-shell::placeholder {
  color: #7f8794;
}

.app-input-shell {
  appearance: none;
}


.audit-details-row td {
  background: transparent;
}

.audit-view-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: 1fr 1fr;
}

.audit-panel {
  border: 1px solid #1e222a;
  background: #14171d;
  border-radius: 16px;
  padding: 16px;
}

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

.audit-panel-head h4 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: #e5e5e5;
}

.audit-kv {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.audit-kv:first-of-type {
  margin-top: 0;
}

.audit-kv-label {
  font-size: 13px;
  font-weight: 600;
  color: #7f8794;
}

.audit-kv-value {
  min-width: 0;
}

.audit-loading {
  border: 1px solid #1e222a;
  background: #14171d;
}

.audit-error-box {
  border: 1px solid rgba(240, 68, 56, 0.2);
  background: rgba(240, 68, 56, 0.08);
  color: #ff8a80;
  border-radius: 12px;
  padding: 14px 16px;
  font-size: 14px;
  font-weight: 500;
}

@media (max-width: 1100px) {
  .audit-view-grid {
    grid-template-columns: 1fr;
  }
}


.app-badge-info {
  background: rgba(59, 130, 246, 0.14);
  color: #93c5fd;
  border: 1px solid rgba(59, 130, 246, 0.24);
}

.app-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.25rem 0.65rem;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  border: 1px solid transparent;
  white-space: nowrap;
}

.app-chip-neutral {
  background: rgba(127, 135, 148, 0.14);
  color: #c7c7c7;
  border-color: rgba(127, 135, 148, 0.2);
}

.app-chip-provider {
  background: #1b1f27;
  color: #d8dbe3;
  border: 1px solid #2a2e39;
}

.app-chip-min {
  background: rgba(59, 130, 246, 0.14);
  color: #93c5fd;
  border: 1px solid rgba(59, 130, 246, 0.24);
}

.app-chip-max {
  background: rgba(76, 217, 100, 0.14);
  color: #4cd964;
  border: 1px solid rgba(76, 217, 100, 0.22);
}

.app-chip-route {
  background: rgba(168, 85, 247, 0.12);
  color: #d8b4fe;
  border: 1px solid rgba(168, 85, 247, 0.22);
}


.app-text-success {
  color: #4cd964;
}

.app-text-warning {
  color: #f59e0b;
}

.app-text-info-soft {
  color: rgba(59, 130, 246, 0.7);
}

.app-text-success-soft {
  color: rgba(76, 217, 100, 0.7);
}


.app-text-info {
  color: #60a5fa;
}



.app-tab-btn {
  border: 0;
  background: transparent;
  color: #aab2c0;
  border-radius: 10px;
  padding: 9px 14px;
  font-size: 14px;
  font-weight: 600;
  transition: background 0.15s ease, color 0.15s ease;
}

.app-tab-btn:hover {
  background: #1a1d23;
  color: #ffffff;
}

.app-tab-btn.active {
  background: #22262f;
  color: #ffffff;
  border: 1px solid #3a4150;
}


.mass-textarea {
  width: 100%;
  min-height: 280px;
  resize: vertical;
  border-radius: 16px;
  background: #1b1f27;
  border: 1px solid #2a2e39;
  color: #e5e7eb;
  padding: 14px 16px;
  font-size: 14px;
  line-height: 1.55;
}

.mass-textarea::placeholder {
  color: #7f8794;
}

.mass-textarea:focus {
  outline: none;
  border-color: #4a5366;
  background: #1d2027;
}

.mass-textarea-lg {
  min-height: 360px;
}

.mass-output-ide {
  min-height: 280px;
  margin: 0;
  overflow: auto;
  border-radius: 16px;
  border: 1px solid #2a2e39;
  background: #151922;
  color: #d8dee9;
  padding: 16px 18px;
  font-size: 13px;
  line-height: 1.65;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.02),
    0 8px 24px rgba(0, 0, 0, 0.22);
  white-space: pre-wrap;
  word-break: break-word;
}
.json-editor-pre {
    margin: 0;
    white-space: pre-wrap;
    word-break: break-word;
    overflow-x: auto;
}

.json-editor-shell {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.json-editor-textarea {
    width: 100%;
    min-height: 320px;
    resize: vertical;
    border-radius: 0.75rem;
    padding: 16px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 14px;
    line-height: 24px;
    white-space: pre;
    overflow: auto;
    tab-size: 2;
}

.json-editor-hint {
    font-size: 12px;
    opacity: 0.7;
}

.json-editor-error {
    border: 1px solid rgba(240, 68, 56, 0.2);
    background: rgba(240, 68, 56, 0.08);
    color: #ff8a80;
    border-radius: 0.75rem;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
}