* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #05060a;
  --panel: #11131c;
  --line: #232736;
  --line-soft: #1a1d29;
  --text: #f5f7ff;
  --muted: #9ca3b8;
  --input-bg: #0a0c13;
  --primary: #f3f4f6;
  --primary-text: #111217;
  --secondary: #1a1d28;
  --shadow: 0 20px 40px rgba(0, 0, 0, 0.35);
  --good: #8df0b5;
  --bad: #ff9d9d;
  --medium: #ffd98a;
}

html {
  scrollbar-gutter: stable;
}

body {
  font-family: Arial, Helvetica, sans-serif;
  background: linear-gradient(180deg, #05060a 0%, #06070d 100%);
  color: var(--text);
  min-height: 100vh;
}

a {
  color: inherit;
  text-decoration: none;
}

.container {
  width: min(1320px, calc(100% - 32px));
  margin: 0 auto;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(9, 10, 15, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.topbar-inner {
  min-height: 74px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.nav {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  row-gap: 8px;
}

.nav a {
  font-size: 14px;
  color: var(--muted);
}

.nav a.active,
.nav a:hover {
  color: var(--text);
}

.notification-widget {
  position: relative;
  display: inline-flex;
}

.notification-btn {
  position: relative;
  border: 1px solid var(--line);
  background: #111827;
  color: var(--text);
  border-radius: 12px;
  padding: 8px 12px;
  font-weight: 700;
  cursor: pointer;
}

.notification-badge {
  position: absolute;
  top: -8px;
  right: -8px;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  font-size: 12px;
  line-height: 1;
}

.notification-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: min(360px, calc(100vw - 32px));
  display: none;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #0b1020;
  box-shadow: var(--shadow);
  z-index: 30;
}

.notification-widget.is-open .notification-menu {
  display: grid;
  gap: 8px;
}

.notification-item,
.notification-empty {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
}

.notification-item strong {
  color: var(--text);
}

.notification-item span {
  font-size: 13px;
  line-height: 1.45;
}

.notification-item small {
  color: #7c86a3;
}

.notification-item.is-unread {
  border-color: rgba(141, 240, 181, 0.45);
  background: rgba(20, 83, 45, 0.18);
}

.notification-menu {
  max-height: min(520px, calc(100vh - 140px));
  overflow-y: auto;
}

.notification-menu .notification-item {
  grid-template-columns: 1fr auto;
  align-items: start;
}

.notification-item-link {
  display: grid;
  gap: 4px;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

.notification-delete-btn {
  border: 1px solid rgba(248, 113, 113, 0.32);
  background: rgba(127, 29, 29, 0.38);
  color: #fecaca;
  border-radius: 10px;
  padding: 6px 9px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.notification-delete-btn:disabled {
  opacity: 0.55;
  cursor: pointer;
}

.notification-item {
  transition: opacity 120ms ease, transform 120ms ease, max-height 120ms ease, padding 120ms ease, margin 120ms ease;
}

.notification-item.is-removing {
  opacity: 0;
  transform: translateY(-4px);
  max-height: 0;
  margin: 0;
  padding-top: 0;
  padding-bottom: 0;
  pointer-events: none;
}

.support-request-card.is-highlighted {
  border-color: rgba(141, 240, 181, 0.72);
  box-shadow: 0 0 0 3px rgba(141, 240, 181, 0.12), var(--shadow);
}

.page {
  padding: 36px 0 60px;
}

.hero {
  max-width: 880px;
  margin-bottom: 24px;
}

.hero-badge {
  display: inline-block;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 12px;
  color: #c7ccda;
  background: rgba(255, 255, 255, 0.02);
  margin-bottom: 18px;
}

.hero h1 {
  font-size: 34px;
  line-height: 1.2;
  margin-bottom: 12px;
}

.hero p {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.7;
}

.stats-grid {
  display: grid;
  gap: 14px;
  margin-bottom: 18px;
}

.stats-grid-7 {
  grid-template-columns: repeat(7, 1fr);
}

.stats-grid-4 {
  grid-template-columns: repeat(4, 1fr);
}

.stat-card {
  background: linear-gradient(180deg, rgba(18, 20, 30, 0.96), rgba(14, 16, 24, 0.98));
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px;
  box-shadow: var(--shadow);
}

.stat-label {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 8px;
}

.stat-value {
  font-size: 28px;
  font-weight: 700;
}

.stat-money {
  font-size: 20px;
}

.panel {
  background: linear-gradient(180deg, rgba(18, 20, 30, 0.96), rgba(14, 16, 24, 0.98));
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px;
  box-shadow: var(--shadow);
}

.batch-page-panel + .batch-page-panel {
  margin-top: 18px;
}

.notification-panel {
  margin-bottom: 18px;
}

.panel-header {
  margin-bottom: 16px;
}

.panel-header h2 {
  font-size: 20px;
  margin-bottom: 8px;
}

.panel-header p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.panel-header-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.toolbar,
.header-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.filter-bar {
  display: grid;
  grid-template-columns: minmax(260px, 1.6fr) repeat(4, minmax(150px, 1fr)) auto;
  gap: 12px;
  margin-bottom: 18px;
  align-items: end;
}

.filter-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.filter-field label {
  color: #f8fafc;
  font-size: 13px;
  font-weight: 500;
}

.filter-field input,
.filter-field select {
  width: 100%;
  min-height: 44px;
  background: rgba(2, 6, 23, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.16);
  color: #f8fafc;
  border-radius: 12px;
  padding: 0 14px;
  font-size: 14px;
  outline: none;
}

.filter-field input::placeholder {
  color: #64748b;
}

.filter-field input:focus,
.filter-field select:focus {
  border-color: rgba(96, 165, 250, 0.4);
  box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.12);
}

.filter-actions {
  display: flex;
  align-items: end;
}

.partner-filter-bar {
  grid-template-columns: minmax(280px, 1.8fr) minmax(180px, 1fr) minmax(180px, 1fr) auto;
}

.partner-account-filter-bar {
  grid-template-columns: minmax(320px, 1.8fr) minmax(180px, 1fr) minmax(180px, 1fr) auto;
}

.notification-badge {
  min-width: 84px;
  min-height: 42px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(96, 165, 250, 0.18);
  background: rgba(15, 23, 42, 0.85);
  color: #dbeafe;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
}

.notification-btn .notification-badge {
  position: absolute;
  top: -8px;
  right: -8px;
  min-width: 20px;
  min-height: 20px;
  height: 20px;
  padding: 0 6px;
  border: 0;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  font-size: 12px;
  line-height: 1;
}

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

.misa-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(320px, 0.9fr);
  gap: 18px;
}

.misa-main,
.misa-side {
  display: grid;
  gap: 18px;
  align-content: start;
}

.misa-full {
  display: grid;
  gap: 38px;
}

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

.misa-sync-card {
  min-height: 126px;
}

.misa-sync-meta {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.misa-sync-meta strong {
  color: var(--text);
  font-weight: 600;
}

.misa-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.misa-status-pill::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: currentColor;
}

.misa-status-pill.connected {
  color: #b5f5cb;
  background: rgba(16, 64, 38, 0.24);
  border-color: rgba(119, 255, 170, 0.18);
}

.misa-status-pill.partial {
  color: #ffe2a3;
  background: rgba(97, 72, 15, 0.22);
  border-color: rgba(255, 214, 107, 0.2);
}

.misa-status-pill.disconnected {
  color: #ffb2b2;
  background: rgba(96, 27, 27, 0.22);
  border-color: rgba(255, 139, 139, 0.18);
}

.misa-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.misa-toolbar-note {
  color: var(--muted);
  font-size: 13px;
}

.misa-table-wrap {
  overflow-x: auto;
}

.misa-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 960px;
}

.misa-table th,
.misa-table td {
  text-align: left;
  padding: 16px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  vertical-align: top;
}

.misa-table th {
  font-size: 13px;
  color: #d7dcec;
  font-weight: 700;
}

.misa-table td {
  font-size: 14px;
  color: #eef2ff;
}

.misa-table tr.selected-row td {
  background: rgba(255, 255, 255, 0.035);
}

.misa-row-title {
  font-weight: 700;
  margin-bottom: 4px;
}

.misa-row-subtitle {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
}

.misa-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
}

.misa-badge.success {
  color: #b5f5cb;
  background: rgba(16, 64, 38, 0.22);
  border-color: rgba(119, 255, 170, 0.16);
}

.misa-badge.warning {
  color: #ffe2a3;
  background: rgba(97, 72, 15, 0.2);
  border-color: rgba(255, 214, 107, 0.18);
}

.misa-badge.danger {
  color: #ffb2b2;
  background: rgba(96, 27, 27, 0.2);
  border-color: rgba(255, 139, 139, 0.16);
}

.misa-badge.neutral {
  color: #dbe6ff;
}

.misa-empty {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.8;
  padding: 10px 0 2px;
}

.misa-summary-list {
  display: grid;
  gap: 10px;
  margin-top: 6px;
}

.misa-inline-summary {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.45fr);
  gap: 16px;
  margin-top: 10px;
}

.misa-summary-item {
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.02);
  padding: 16px 18px;
}

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

.misa-summary-label {
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 6px;
}

.misa-summary-value {
  color: var(--text);
  font-size: 19px;
  font-weight: 700;
}

.misa-summary-value.small {
  font-size: 15px;
  line-height: 1.6;
  font-weight: 600;
}

.misa-side-list {
  display: grid;
  gap: 14px;
  margin-top: 8px;
}

.misa-side-item {
  border-left: 3px solid rgba(255, 255, 255, 0.12);
  padding-left: 12px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

.misa-side-item strong {
  color: var(--text);
}

.misa-decision-card {
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 16px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.03);
}

.misa-decision-card h3 {
  font-size: 17px;
  margin-bottom: 8px;
}

.misa-decision-card p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
  margin-bottom: 12px;
}

.misa-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.misa-note {
  border-top: 1px dashed rgba(255, 255, 255, 0.08);
  margin-top: 14px;
  padding-top: 14px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.rating-score {
  font-size: 46px;
  font-weight: 800;
  line-height: 1;
  margin-bottom: 10px;
}

.rating-score.good {
  color: #9af3ba;
}

.rating-score.medium {
  color: #ffd98a;
}

.rating-score.bad {
  color: #ff9d9d;
}

.rating-grade {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 54px;
  min-height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  font-size: 16px;
  font-weight: 800;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.rating-rank-btn {
  cursor: pointer;
  font-family: inherit;
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.rating-rank-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.22);
  box-shadow: 0 10px 24px rgba(2, 6, 23, 0.24);
}

.rating-rank-cell {
  position: relative;
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}

.rating-rank-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 20;
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 10px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 16px;
  background: rgba(2, 6, 23, 0.96);
  box-shadow: 0 18px 36px rgba(2, 6, 23, 0.46);
}

.rating-rank-option {
  min-width: 38px;
  min-height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  padding: 0 12px;
  font-family: inherit;
  font-weight: 800;
  cursor: pointer;
}

.rating-rank-option.good {
  color: #0f311d;
  background: #9af3ba;
}

.rating-rank-option.medium {
  color: #4b3304;
  background: #ffd98a;
}

.rating-rank-option.bad {
  color: #4f1010;
  background: #ffb0b0;
}

.rating-rank-option.neutral {
  color: #dbeafe;
  background: rgba(15, 23, 42, 0.98);
}

.rating-grade.good {
  color: #0f311d;
  background: #9af3ba;
}

.rating-grade.medium {
  color: #4b3304;
  background: #ffd98a;
}

.rating-grade.bad {
  color: #4f1010;
  background: #ffb0b0;
}

.rating-grade.neutral {
  color: var(--muted);
  background: rgba(255, 255, 255, 0.05);
}

.rating-full {
  margin-bottom: 28px;
}

.rating-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
  gap: 18px;
}

.rating-main,
.rating-side {
  display: grid;
  gap: 18px;
  align-content: start;
}

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

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

.rating-metric-card {
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.02);
  padding: 14px 15px;
}

.rating-metric-label {
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 6px;
}

.rating-metric-value {
  color: var(--text);
  font-size: 22px;
  font-weight: 700;
}

.rating-metric-note {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.rating-profile-head {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  gap: 16px;
  align-items: stretch;
  margin-bottom: 16px;
}

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

.rating-profile-summary {
  margin-bottom: 0;
}

.rating-metric-copy {
  font-size: 18px;
  line-height: 1.5;
}

.rating-guidance-grid {
  display: grid;
  gap: 16px;
  margin-top: 20px;
}

.rating-edit-form {
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 18px;
  background: rgba(2, 6, 23, 0.35);
  margin-top: 18px;
  padding: 18px;
}

.rating-edit-grid {
  display: grid;
  grid-template-columns: minmax(180px, 0.35fr) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.rating-edit-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.form-message {
  color: var(--muted);
  font-size: 14px;
}

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

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

@media (max-width: 720px) {
  .rating-kpis,
  .rating-metric-grid {
    grid-template-columns: 1fr;
  }

  .rating-profile-head {
    grid-template-columns: 1fr;
  }

  .rating-edit-grid {
    grid-template-columns: 1fr;
  }
}

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

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

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

@media (max-width: 720px) {
  .misa-sync-grid {
    grid-template-columns: 1fr;
  }

  .misa-inline-summary {
    grid-template-columns: 1fr;
  }
}

.notification-list {
  display: grid;
  gap: 12px;
}

.notification-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 14px;
  align-items: flex-start;
  background: rgba(2, 6, 23, 0.72);
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 14px;
  padding: 14px 16px;
}

.notification-item.is-read {
  opacity: 0.72;
  border-color: rgba(148, 163, 184, 0.08);
}

.notification-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  margin-top: 8px;
  background: #60a5fa;
  box-shadow: 0 0 0 6px rgba(96, 165, 250, 0.12);
}

.notification-item.is-read .notification-dot {
  background: #64748b;
  box-shadow: 0 0 0 6px rgba(100, 116, 139, 0.12);
}

.notification-main {
  min-width: 0;
}

.notification-title {
  font-size: 15px;
  font-weight: 700;
  color: #f8fafc;
  margin-bottom: 6px;
}

.notification-desc,
.notification-meta {
  color: #94a3b8;
  font-size: 13px;
  line-height: 1.6;
}

.notification-meta strong {
  color: #e2e8f0;
}

.notification-item-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.notification-read-btn {
  min-width: 94px;
}

.primary-btn,
.secondary-btn {
  height: 42px;
  padding: 0 16px;
  border-radius: 10px;
  border: 1px solid transparent;
  font-weight: 600;
  cursor: pointer;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.primary-btn {
  background: var(--primary);
  color: var(--primary-text);
}

.secondary-btn {
  background: var(--secondary);
  color: var(--text);
  border-color: #232838;
}

.full-btn {
  width: 100%;
}

.table-wrap {
  overflow-x: auto;
}

.partner-cell-title {
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}

.partner-cell-subtitle {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
}

.partner-cell-subtext {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
}

.deal-table {
  width: 100%;
  border-collapse: collapse;
}

.batch-table {
  min-width: 1180px;
}

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

.batch-summary-item {
  min-height: 96px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 14px;
  background: rgba(2, 6, 23, 0.72);
}

.batch-summary-item span {
  color: #94a3b8;
  font-size: 13px;
  line-height: 1.45;
}

.batch-summary-item strong {
  color: #f8fafc;
  font-size: 20px;
  line-height: 1.25;
}

.selected-batch-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
  padding: 12px 14px;
  border: 1px solid rgba(251, 191, 36, 0.24);
  border-radius: 12px;
  background: rgba(251, 191, 36, 0.08);
}

.selected-batch-banner span {
  color: #fcd34d;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
}

.selected-batch-banner strong {
  color: #f8fafc;
  font-size: 15px;
  text-align: right;
}

.subdeal-table-scroll {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0 0 10px;
  overscroll-behavior-x: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(148, 163, 184, 0.55) rgba(15, 23, 42, 0.82);
}

.subdeal-table-scroll::-webkit-scrollbar {
  height: 10px;
}

.subdeal-table-scroll::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.82);
  border-radius: 999px;
}

.subdeal-table-scroll::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.55);
  border-radius: 999px;
}

.subdeal-dashboard-table {
  width: 100%;
  min-width: 2180px;
  table-layout: fixed;
}

.subdeal-dashboard-table th,
.subdeal-dashboard-table td {
  vertical-align: top;
  white-space: normal;
  overflow-wrap: break-word;
  word-break: normal;
  line-height: 1.35;
}

.deal-table .subdeal-table-group-row th {
  padding: 11px 12px;
  text-align: center;
  vertical-align: middle;
  border-bottom: 1px solid var(--border);
  letter-spacing: 0.03em;
  text-transform: uppercase;
  font-size: 0.78rem;
}

.deal-table .subdeal-table-group-debt {
  background: rgba(147, 197, 253, 0.14);
  color: #dbeafe;
}

.deal-table .subdeal-table-group-counter {
  background: rgba(251, 191, 36, 0.16);
  color: #fef3c7;
}

.deal-table .subdeal-table-group-available {
  background: rgba(134, 239, 172, 0.16);
  color: #dcfce7;
}

.deal-table .subdeal-table-group-support {
  background: rgba(251, 146, 60, 0.14);
  color: #fed7aa;
}

.deal-table .subdeal-table-group-note {
  background: rgba(251, 113, 133, 0.18);
  color: #fed7aa;
}

.deal-table .subdeal-table-group-rating {
  background: rgba(148, 163, 184, 0.22);
  color: #e5e7eb;
}

.deal-table .subdeal-table-group-actions {
  background: rgba(15, 23, 42, 0.92);
  color: var(--text);
}

.subdeal-dashboard-table th:last-child,
.subdeal-dashboard-table td:last-child {
  width: 165px;
}

.subdeal-col-hospital {
  width: 13%;
}

.subdeal-col-invoice {
  width: 7%;
}

.subdeal-col-money {
  width: 7.5%;
}

.subdeal-col-money-wide {
  width: 8.5%;
}

.subdeal-col-date {
  width: 7.5%;
}

.subdeal-col-status {
  width: 6%;
}

.subdeal-col-actions {
  width: 8%;
}

.subdeal-col-note {
  width: 9%;
}

.subdeal-col-rating {
  width: 7%;
}

.muted-table-note {
  display: block;
  margin-top: 5px;
  color: #93a4bd;
  font-size: 13px;
  line-height: 1.35;
}

.deal-table th,
.deal-table td {
  text-align: left;
  padding: 14px 12px;
  border-bottom: 1px solid #1d2231;
  font-size: 14px;
  vertical-align: top;
}

.deal-table th {
  color: #c9d0de;
  font-weight: 600;
}

.deal-table td {
  color: #eef2ff;
}

.empty-cell {
  text-align: center !important;
  color: var(--muted) !important;
  padding: 28px !important;
}

.status-badge,
.overdue-badge {
  display: inline-block;
  padding: 7px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

.status-new {
  background: #1a2130;
  color: #d7e3ff;
}

.status-reviewing {
  background: #2d2413;
  color: #ffd98a;
}

.status-approved {
  background: #13243a;
  color: #a8d0ff;
}

.status-funded {
  background: #123323;
  color: #8df0b5;
}

.status-rejected {
  background: #331818;
  color: #ff9d9d;
}

.status-closed {
  background: #2b2436;
  color: #e1c7ff;
}

.overdue-good {
  background: #13271d;
  color: #8df0b5;
}

.overdue-warning {
  background: #2d2413;
  color: #ffd98a;
}

.overdue-bad {
  background: #331818;
  color: #ff9d9d;
}

.overdue-normal {
  background: #1a2130;
  color: #d7e3ff;
}

.table-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.is-action-pending {
  opacity: 0.82;
  pointer-events: none;
}

.partner-account-row {
  transition: opacity 140ms ease, transform 140ms ease;
}

.partner-account-row.is-removing {
  opacity: 0;
  transform: translateX(10px);
  pointer-events: none;
}

.action-link {
  display: inline-block;
  padding: 8px 12px;
  border-radius: 10px;
  background: #171b27;
  border: 1px solid #232838;
  color: #f4f6ff;
  font-size: 13px;
}

button.action-link {
  cursor: pointer;
  font-family: inherit;
}

.collection-page-container {
  width: min(1760px, calc(100vw - 48px));
}

.collection-step-panel[hidden] {
  display: none;
}

.table-scroll {
  width: 100%;
  overflow-x: auto;
}

.collection-target-table tbody tr.is-selected {
  background: rgba(15, 23, 42, 0.82);
}

.collection-form-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  gap: 18px;
  align-items: start;
}

.collection-summary-cards {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.collection-entry-form {
  margin-top: 12px;
}

.collection-section-title {
  margin: 0 0 12px;
  color: #f8fafc;
  font-size: 17px;
}

@media (max-width: 1180px) {
  .collection-form-grid {
    grid-template-columns: 1fr;
  }
}

.muted-text {
  margin-top: 4px;
  color: #9fb2d6;
  font-size: 12px;
}

.delete-btn {
  display: inline-block;
  padding: 8px 12px;
  border-radius: 10px;
  background: #331818;
  border: 1px solid #4b2323;
  color: #ffb3b3;
  font-size: 13px;
  cursor: pointer;
}

.delete-btn:hover {
  background: #431d1d;
}

.delete-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.detail-layout {
  display: grid;
  grid-template-columns: 1.5fr 0.85fr;
  gap: 18px;
}

.detail-main,
.detail-side {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.deal-detail-container {
  width: min(1960px, calc(100vw - 48px));
}

.deal-detail-container .panel {
  padding: 20px;
}

.deal-detail-container .subdeal-dashboard-table {
  min-width: 0;
  width: 100%;
  table-layout: auto;
}

.deal-detail-container .subdeal-table-scroll {
  overflow-x: visible;
  padding-bottom: 0;
}

.deal-detail-container .subdeal-dashboard-table th,
.deal-detail-container .subdeal-dashboard-table td {
  padding: 9px 7px;
  font-size: 11px;
  line-height: 1.28;
}

.deal-detail-container .deal-table .subdeal-table-group-row th {
  padding: 10px 8px;
  font-size: 11px;
}

.deal-detail-container .subdeal-dashboard-table th:last-child,
.deal-detail-container .subdeal-dashboard-table td:last-child {
  width: auto;
}

.deal-detail-container .subdeal-col-hospital {
  width: 11%;
}

.deal-detail-container .subdeal-col-date {
  width: 5.4%;
}

.deal-detail-container .subdeal-col-invoice {
  width: 4.8%;
}

.deal-detail-container .subdeal-col-money {
  width: 5.9%;
}

.deal-detail-container .subdeal-col-money-wide {
  width: 6.3%;
}

.deal-detail-container .subdeal-col-status {
  width: 4.2%;
}

.deal-detail-container .subdeal-col-note {
  width: 4.2%;
}

.deal-detail-container .subdeal-col-rating {
  width: 4.2%;
}

.deal-detail-container .subdeal-col-actions {
  width: 4%;
}

.deal-detail-container .table-action-stack {
  gap: 6px;
}

.deal-detail-container .table-action-btn {
  padding: 7px 6px;
  font-size: 11px;
  line-height: 1.2;
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.detail-item {
  background: #0c0e16;
  border: 1px solid #1d2231;
  border-radius: 14px;
  padding: 14px;
}

.detail-item-label {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 8px;
}

.detail-item-value {
  color: #f4f6ff;
  font-size: 15px;
  line-height: 1.6;
  word-break: break-word;
}

.files-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.file-card {
  background: #0c0e16;
  border: 1px solid #1d2231;
  border-radius: 12px;
  padding: 12px;
}

.file-card a {
  color: #dbe6ff;
  font-size: 14px;
}

.file-meta {
  color: var(--muted);
  font-size: 12px;
  margin-top: 6px;
}

.loading-box {
  color: var(--muted);
  padding: 20px 0;
}

.form-group {
  margin-bottom: 14px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
}

.form-group select,
.form-group input {
  width: 100%;
  background: var(--input-bg);
  border: 1px solid var(--line-soft);
  color: var(--text);
  border-radius: 10px;
  padding: 13px 14px;
  font-size: 14px;
  outline: none;
}

.overdue-box {
  border-radius: 12px;
  padding: 14px;
  font-weight: 600;
}

@media (max-width: 1440px) {
  .stats-grid-7 {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 1024px) {
  .detail-layout {
    grid-template-columns: 1fr;
  }

  .stats-grid-7 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 720px) {
  .topbar-inner {
    flex-direction: column;
    align-items: flex-start;
    padding: 14px 0;
  }

  .detail-grid,
  .stats-grid-7 {
    grid-template-columns: 1fr;
  }

  .panel-header-row {
    flex-direction: column;
  }

  .hero h1 {
    font-size: 28px;
  }
}
/* ===== ANALYSIS PAGE ===== */

.analysis-report {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.analysis-hero-card {
  padding: 20px;
  border-radius: 12px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
}

.analysis-hero-title {
  font-size: 24px;
  font-weight: bold;
  margin-bottom: 8px;
}

.analysis-hero-text {
  color: #ccc;
  line-height: 1.6;
}

.analysis-good {
  border-left: 4px solid #00ff99;
}

.analysis-medium {
  border-left: 4px solid #ffaa00;
}

.analysis-bad {
  border-left: 4px solid #ff4444;
}

/* GRID */
.analysis-section-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

/* CARD */
.analysis-card {
  padding: 18px;
  border-radius: 12px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
}

.analysis-card h3 {
  margin-bottom: 12px;
  font-size: 16px;
  color: #fff;
}

/* METRIC */
.analysis-metric-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.analysis-metric {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
}

.analysis-metric span {
  color: #aaa;
}

.analysis-metric strong {
  color: #fff;
}

/* LIST */
.analysis-list {
  padding-left: 18px;
  line-height: 1.7;
}

.analysis-list li {
  margin-bottom: 6px;
  color: #ddd;
}

.good-list li {
  color: #00ff99;
}

.warning-list li {
  color: #ff6666;
}

/* SUMMARY */
.summary-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.summary-item {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
}

.summary-label {
  color: #aaa;
}

.summary-value {
  color: #fff;
  font-weight: 500;
}

/* LOADING */
.loading-box {
  padding: 20px;
  text-align: center;
  color: #aaa;
}

.collections-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

.collections-summary-item {
  background: #0c0e16;
  border: 1px solid #1d2231;
  border-radius: 12px;
  padding: 12px;
}

.collections-summary-item span {
  display: block;
  color: #9ca3b8;
  font-size: 13px;
  margin-bottom: 6px;
}

.collections-summary-item strong {
  color: #f4f6ff;
  font-size: 15px;
}

@media (max-width: 720px) {
  .collections-summary {
    grid-template-columns: 1fr;
  }
}


.collections-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

.collections-summary-item {
  background: #0c0e16;
  border: 1px solid #1d2231;
  border-radius: 12px;
  padding: 12px;
}

.collections-summary-item span {
  display: block;
  color: #9ca3b8;
  font-size: 13px;
  margin-bottom: 6px;
}

.collections-summary-item strong {
  color: #f4f6ff;
  font-size: 15px;
}

@media (max-width: 720px) {
  .collections-summary {
    grid-template-columns: 1fr;
  }
}


.activity-log-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.activity-log-item {
  background: #0c0e16;
  border: 1px solid #1d2231;
  border-radius: 12px;
  padding: 14px;
}

.activity-log-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.activity-log-action {
  font-weight: 700;
  color: #f4f6ff;
}

.activity-log-time {
  color: #9ca3b8;
  font-size: 13px;
}

.activity-log-message {
  color: #d7dcef;
  margin-bottom: 8px;
  line-height: 1.6;
}

.activity-log-meta {
  background: #090b12;
  border: 1px solid #1a1d29;
  border-radius: 10px;
  padding: 10px;
  color: #b8c0d6;
  font-size: 12px;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-x: auto;
}


.page-header {
  margin-bottom: 20px;
}

.page-header p {
  color: #94a3b8;
  margin-top: 6px;
}

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

.back-link {
  text-decoration: none;
}

.analysis-hero-box {
  background: #020817;
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 14px;
  padding: 18px;
  margin-bottom: 18px;
}

.analysis-hero-label {
  font-size: 13px;
  color: #94a3b8;
  margin-bottom: 8px;
}

.analysis-hero-title {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 10px;
}

.analysis-hero-text {
  color: #e2e8f0;
  line-height: 1.6;
}

.analysis-grid-two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.analysis-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 18px;
}

.stat-like-card {
  min-height: 92px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.stat-main {
  font-size: 24px;
  font-weight: 700;
  margin-top: 6px;
  color: #f8fafc;
}

.analysis-list-tight p {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin: 0;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.analysis-list-tight p:last-child {
  border-bottom: none;
}

.analysis-list-tight span {
  color: #94a3b8;
}

.analysis-list-tight strong {
  color: #f8fafc;
  text-align: right;
}

.analysis-list-tight.compact p {
  padding: 8px 0;
}

.analysis-bullet {
  margin: 0;
  padding-left: 18px;
}

.analysis-bullet li {
  margin: 10px 0;
  line-height: 1.6;
}

.good-list li {
  color: #dcfce7;
}

.warning-list li {
  color: #fde68a;
}

.neutral-list li {
  color: #e2e8f0;
}

.empty-note {
  color: #94a3b8;
  padding: 6px 0;
}

.analysis-progress-box {
  background: #020817;
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: 12px;
  padding: 16px;
}

.analysis-progress-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
  color: #cbd5e1;
}

.analysis-progress-bar {
  width: 100%;
  height: 10px;
  background: rgba(255,255,255,0.06);
  border-radius: 999px;
  overflow: hidden;
}

.analysis-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #22c55e, #38bdf8);
  border-radius: 999px;
}

.decision-box {
  border-radius: 12px;
  padding: 4px 0 0;
}

.decision-title {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 8px;
}

.decision-note {
  color: #94a3b8;
  line-height: 1.6;
  margin-bottom: 16px;
}

.decision-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.full-btn {
  width: 100%;
}

.decision-good .decision-title,
.score-good {
  color: #4ade80;
}

.decision-mid .decision-title,
.score-mid {
  color: #facc15;
}

.decision-bad .decision-title,
.score-bad {
  color: #f87171;
}

.score-card-main {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.score-number {
  font-size: 34px;
  font-weight: 800;
  line-height: 1;
}

.score-level {
  font-size: 16px;
  color: #cbd5e1;
}

.mini-divider {
  height: 1px;
  background: rgba(255,255,255,0.06);
  margin: 14px 0;
}

@media (max-width: 1100px) {
  .analysis-summary-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .analysis-grid-two {
    grid-template-columns: 1fr;
  }
}


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

.detail-main,
.detail-side {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-width: 0;
}

.panel {
  background: linear-gradient(180deg, rgba(15,23,42,0.98), rgba(2,6,23,0.98));
  border: 1px solid rgba(148,163,184,0.16);
  border-radius: 22px;
  padding: 18px;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.015) inset;
  min-width: 0;
}

.detail-side .panel {
  overflow-wrap: anywhere;
}

@media (min-width: 1500px) {
  .container.detail-layout {
    width: min(2040px, calc(100vw - 120px));
    margin-left: auto;
    margin-right: auto;
  }

  .container.detail-layout > .detail-main {
    display: contents;
  }

  .container.detail-layout > .detail-main > .panel:first-child {
    grid-column: 1;
    grid-row: 1;
  }

  .container.detail-layout > .detail-main > .panel:nth-child(2) {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .container.detail-layout > .detail-side {
    grid-column: 2;
    grid-row: 1;
  }

  .subdeal-dashboard-table {
    min-width: 100%;
  }
}

@media (min-width: 1820px) {
  .container.detail-layout {
    width: min(2160px, calc(100vw - 144px));
    grid-template-columns: minmax(0, 1fr) minmax(320px, 360px);
    gap: 24px;
  }
}

.panel-header h2 {
  font-size: 22px;
  line-height: 1.2;
  margin: 0 0 8px;
}

.panel-header p {
  color: #94a3b8;
  line-height: 1.5;
}

.panel-header-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.header-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.back-link {
  text-decoration: none;
}

.info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 8px;
}

.info-card {
  background: rgba(2, 6, 23, 0.7);
  border: 1px solid rgba(148,163,184,0.12);
  border-radius: 14px;
  padding: 14px 16px;
}

.info-card-wide {
  grid-column: 1 / -1;
}

.info-card h3 {
  font-size: 13px;
  color: #94a3b8;
  margin: 0 0 8px;
  font-weight: 500;
}

.info-card p {
  margin: 0;
  font-size: 16px;
  color: #f8fafc;
  line-height: 1.5;
}

.info-card-support-summary {
  min-height: 260px;
}

.deal-support-summary {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid rgba(148, 163, 184, 0.16);
}

.deal-support-summary-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  color: #cbd5e1;
  font-size: 14px;
  line-height: 1.35;
}

.deal-support-summary-row strong {
  flex: 0 0 auto;
  color: #f8fafc;
  font-size: 15px;
  font-weight: 800;
  text-align: right;
  white-space: nowrap;
}

.deal-support-summary-row.negative strong {
  color: #fca5a5;
}

.detail-list-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.detail-list-block p {
  margin: 0;
  font-size: 16px;
  color: #f8fafc;
  line-height: 1.5;
}

.detail-list-block-money p {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.detail-list-block-money p strong {
  color: #f8fafc;
  font-weight: 700;
  text-align: right;
  flex: 0 0 auto;
}

.file-list-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.file-chip {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(15,23,42,0.9);
  border: 1px solid rgba(148,163,184,0.18);
  color: #e2e8f0;
  text-decoration: none;
  font-size: 14px;
}

.stack-block + .stack-block {
  margin-top: 16px;
}

.stack-block h3 {
  font-size: 14px;
  color: #94a3b8;
  margin-bottom: 10px;
  font-weight: 500;
}

.summary-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 16px;
}

.mini-stat-card {
  background: rgba(2, 6, 23, 0.7);
  border: 1px solid rgba(148,163,184,0.12);
  border-radius: 14px;
  padding: 14px 16px;
}

.mini-stat-label {
  color: #94a3b8;
  font-size: 13px;
  margin-bottom: 6px;
}

.mini-stat-value {
  color: #f8fafc;
  font-size: 17px;
  font-weight: 700;
}

.activity-log-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.activity-log-item {
  background: rgba(2, 6, 23, 0.65);
  border: 1px solid rgba(148,163,184,0.1);
  border-radius: 14px;
  padding: 14px 16px;
}

.activity-log-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  color: #e2e8f0;
}

.activity-log-head span {
  color: #94a3b8;
  font-size: 13px;
  white-space: nowrap;
}

.activity-log-desc {
  color: #cbd5e1;
  line-height: 1.6;
}

.loading-box,
.empty-note {
  color: #94a3b8;
  padding: 8px 0;
}

.form-group {
  margin-top: 12px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  color: #f8fafc;
  font-size: 15px;
  font-weight: 500;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  background: rgba(2, 6, 23, 0.9);
  border: 1px solid rgba(148,163,184,0.16);
  color: #f8fafc;
  border-radius: 12px;
  padding: 14px 14px;
  font-size: 15px;
  outline: none;
}

.form-group textarea {
  resize: vertical;
  min-height: 110px;
  font-family: inherit;
  line-height: 1.6;
}

.date-input-wrap {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
}

.date-input-wrap input {
  min-width: 0;
}

.date-picker-trigger {
  min-width: 72px;
  min-height: 46px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid rgba(148,163,184,0.16);
  background: rgba(15,23,42,0.95);
  color: #f8fafc;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.date-picker-trigger:hover {
  background: rgba(30, 41, 59, 0.95);
}

.form-group input::placeholder {
  color: #64748b;
}

.primary-btn,
.secondary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 16px;
  border-radius: 12px;
  border: 1px solid rgba(148,163,184,0.16);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}

.primary-btn {
  background: #f8fafc;
  color: #0f172a;
}

.secondary-btn {
  background: rgba(15,23,42,0.95);
  color: #f8fafc;
}

.full-btn {
  width: 100%;
  margin-top: 12px;
}

.inline-context-note {
  margin-top: 4px;
  margin-bottom: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid rgba(148, 163, 184, 0.12);
  color: #cbd5e1;
  font-size: 13px;
  line-height: 1.5;
}

.deal-table {
  width: 100%;
  border-collapse: collapse;
}

.deal-table th,
.deal-table td {
  text-align: left;
  padding: 14px 12px;
  border-bottom: 1px solid rgba(148,163,184,0.1);
}

.deal-table th {
  color: #e2e8f0;
  font-size: 15px;
}

.deal-table td {
  color: #f8fafc;
  font-size: 15px;
}

.subdeal-table tbody tr.is-selected {
  background: rgba(15, 23, 42, 0.68);
}

.limit-amount-input {
  min-width: 180px;
  background: rgba(2, 6, 23, 0.95);
  border: 1px solid rgba(148,163,184,0.18);
  border-radius: 12px;
  padding: 13px 14px;
  color: #f8fafc;
  font-size: 15px;
  line-height: 1.2;
}

.limit-amount-input:focus {
  border-color: rgba(248, 250, 252, 0.42);
  box-shadow: 0 0 0 3px rgba(148, 163, 184, 0.08);
}

.limit-amount-input:disabled {
  opacity: 0.72;
  background: rgba(15, 23, 42, 0.85);
}

.calculated-limit-input {
  border-color: rgba(34, 197, 94, 0.24);
  background: rgba(2, 6, 23, 0.72);
  font-weight: 800;
}

.calculated-limit-input:read-only {
  cursor: default;
}

.table-action-btn {
  min-height: 38px;
  padding: 0 12px;
  font-size: 14px;
  white-space: nowrap;
}

.table-action-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-start;
}

.overdue-good,
.overdue-bad {
  font-size: 16px;
  font-weight: 700;
}

.overdue-good {
  color: #4ade80;
}

.overdue-bad {
  color: #f87171;
}

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

  .info-grid {
    grid-template-columns: 1fr;
  }

  .summary-cards {
    grid-template-columns: 1fr;
  }

  .batch-summary-grid {
    grid-template-columns: 1fr;
  }

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

  .panel-header-row {
    flex-direction: column;
  }

  .activity-log-head {
    flex-direction: column;
  }
}

@media (max-width: 720px) {
  .filter-bar {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1024px) {
  .stats-grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }

  .partner-filter-bar,
  .partner-account-filter-bar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .stats-grid-4,
  .partner-filter-bar,
  .partner-account-filter-bar {
    grid-template-columns: 1fr;
  }
}


.danger-btn {
  background: rgba(127, 29, 29, 0.95);
  color: #fff;
  border: 1px solid rgba(248, 113, 113, 0.18);
  min-height: 40px;
  padding: 0 14px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.danger-btn:hover {
  background: rgba(153, 27, 27, 1);
}

.danger-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.admin-login-page {
  min-height: 100vh;
  padding: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at top left, rgba(96, 165, 250, 0.12), transparent 28%),
    radial-gradient(circle at bottom right, rgba(148, 163, 184, 0.08), transparent 24%),
    linear-gradient(180deg, #05060a 0%, #070911 100%);
}

.admin-login-shell {
  width: min(1120px, 100%);
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(360px, 420px);
  gap: 28px;
  align-items: stretch;
}

.admin-login-brand,
.admin-login-card {
  background: linear-gradient(180deg, rgba(18, 20, 30, 0.96), rgba(14, 16, 24, 0.98));
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.admin-login-brand {
  padding: 36px;
  position: relative;
  overflow: hidden;
}

.admin-login-brand::after {
  content: "";
  position: absolute;
  inset: auto -60px -80px auto;
  width: 240px;
  height: 240px;
  background: radial-gradient(circle, rgba(96, 165, 250, 0.18), transparent 68%);
  pointer-events: none;
}

.admin-login-badge,
.admin-login-eyebrow {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  background: rgba(15, 23, 42, 0.72);
  color: #dbeafe;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.admin-login-brand h1 {
  margin-top: 20px;
  font-size: 42px;
  line-height: 1.08;
}

.admin-login-brand > p {
  margin-top: 14px;
  max-width: 560px;
  color: #cbd5e1;
  font-size: 16px;
  line-height: 1.75;
}

.admin-login-points {
  margin-top: 28px;
  display: grid;
  gap: 14px;
}

.admin-login-point {
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.12);
  background: rgba(8, 12, 22, 0.72);
}

.admin-login-point strong {
  display: block;
  margin-bottom: 8px;
  font-size: 15px;
  color: #f8fafc;
}

.admin-login-point span {
  color: #94a3b8;
  line-height: 1.65;
  font-size: 14px;
}

.admin-login-card {
  padding: 30px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.admin-login-card-head h2 {
  margin-top: 16px;
  font-size: 30px;
  margin-bottom: 10px;
}

.admin-login-card-head p:last-child {
  color: var(--muted);
  line-height: 1.7;
  font-size: 14px;
}

.admin-login-form {
  margin-top: 28px;
  display: grid;
  gap: 16px;
}

.admin-login-field {
  display: grid;
  gap: 8px;
}

.admin-login-field span {
  color: #f8fafc;
  font-size: 14px;
  font-weight: 600;
}

.admin-login-field input {
  width: 100%;
  min-height: 52px;
  background: rgba(2, 6, 23, 0.92);
  border: 1px solid rgba(148, 163, 184, 0.16);
  color: #f8fafc;
  border-radius: 14px;
  padding: 0 16px;
  font-size: 15px;
  outline: none;
}

.admin-login-field input::placeholder {
  color: #64748b;
}

.admin-login-field input:focus {
  border-color: rgba(96, 165, 250, 0.42);
  box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.12);
}

.admin-login-btn {
  width: 100%;
  min-height: 52px;
  border-radius: 14px;
  margin-top: 4px;
}

.admin-login-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.admin-login-error {
  display: none;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid rgba(248, 113, 113, 0.18);
  background: rgba(127, 29, 29, 0.16);
  color: #fecaca;
  font-size: 14px;
  line-height: 1.6;
}

.admin-login-error.is-visible {
  display: block;
}

@media (max-width: 980px) {
  .admin-login-shell {
    grid-template-columns: 1fr;
  }

  .admin-login-brand h1 {
    font-size: 34px;
  }
}

@media (max-width: 640px) {
  .admin-login-page {
    padding: 18px;
  }

  .admin-login-brand,
  .admin-login-card {
    padding: 22px;
    border-radius: 20px;
  }

  .admin-login-brand h1 {
    font-size: 30px;
  }
}

.support-request-list {
  display: grid;
  gap: 14px;
}

.support-request-card {
  background: rgba(2, 6, 23, 0.84);
  border: 1px solid rgba(148, 163, 184, 0.12);
  border-radius: 18px;
  max-height: 560px;
  overflow: hidden;
  padding: 18px;
  transition: opacity 140ms ease, transform 140ms ease, max-height 140ms ease, padding 140ms ease, margin 140ms ease;
}

.support-request-card.is-removing {
  opacity: 0;
  transform: translateX(10px);
  max-height: 0;
  margin: 0;
  padding-top: 0;
  padding-bottom: 0;
  pointer-events: none;
}

.support-request-head,
.support-request-footer {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.support-request-company {
  font-size: 18px;
  font-weight: 700;
  color: #f8fafc;
  margin-bottom: 8px;
}

.support-request-meta,
.support-request-time,
.support-handled-by {
  color: #94a3b8;
  font-size: 14px;
  line-height: 1.6;
}

.support-request-body {
  margin: 16px 0;
  color: #dbe4f0;
  font-size: 15px;
  line-height: 1.75;
  white-space: pre-wrap;
}

.fee-admin-summary {
  background:
    linear-gradient(135deg, rgba(20, 83, 45, 0.16), transparent 42%),
    rgba(15, 23, 42, 0.72);
}

.fee-admin-rule-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.fee-admin-rule-grid > div {
  border: 1px solid rgba(134, 239, 172, 0.14);
  border-radius: 16px;
  padding: 16px;
  background: rgba(2, 6, 23, 0.5);
}

.fee-admin-rule-grid span {
  display: block;
  color: #94a3b8;
  font-size: 13px;
  margin-bottom: 8px;
}

.fee-admin-rule-grid strong {
  display: block;
  color: #f8fafc;
  font-size: 24px;
  margin-bottom: 8px;
}

.fee-admin-rule-grid p {
  color: #94a3b8;
  font-size: 13px;
  line-height: 1.6;
}

.fee-admin-table td {
  vertical-align: top;
}

.excel-import-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  margin-top: 24px;
  padding: 18px;
  border: 1px solid rgba(96, 165, 250, 0.2);
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.95), rgba(8, 13, 28, 0.96));
}

.excel-import-panel h3 {
  margin: 0 0 6px;
}

.excel-import-panel p {
  margin: 0;
  color: #9db5d8;
  line-height: 1.6;
}

.excel-import-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.excel-import-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.excel-file-picker {
  min-width: 340px;
  max-width: 460px;
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border: 1px dashed rgba(125, 211, 252, 0.42);
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(14, 165, 233, 0.11), rgba(15, 23, 42, 0.86)),
    rgba(3, 7, 18, 0.72);
  color: #e5eefc;
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.excel-file-picker:hover {
  border-color: rgba(125, 211, 252, 0.78);
  background:
    linear-gradient(135deg, rgba(14, 165, 233, 0.18), rgba(15, 23, 42, 0.92)),
    rgba(3, 7, 18, 0.78);
  transform: translateY(-1px);
}

.excel-import-input:focus-visible + .excel-file-picker {
  outline: 2px solid rgba(96, 165, 250, 0.75);
  outline-offset: 4px;
}

.excel-file-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 54px;
  height: 42px;
  border-radius: 14px;
  background: rgba(34, 197, 94, 0.14);
  border: 1px solid rgba(34, 197, 94, 0.32);
  color: #86efac;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.12em;
}

.excel-file-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.excel-file-label {
  color: #f8fafc;
  font-size: 15px;
  font-weight: 800;
}

.excel-file-name {
  max-width: 330px;
  color: #93a4bd;
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.excel-import-status {
  grid-column: 1 / -1;
  min-height: 20px;
  color: #9db5d8;
  font-size: 14px;
}

.excel-import-status.success {
  color: #86efac;
}

.excel-import-status.error {
  color: #fecaca;
}

@media (max-width: 720px) {
  .excel-import-panel {
    grid-template-columns: 1fr;
  }

  .excel-import-actions {
    justify-content: flex-start;
  }

  .excel-file-picker,
  .excel-import-actions .secondary-btn {
    width: 100%;
    max-width: 100%;
    justify-content: center;
  }
}

.create-deal-subheader {
  margin-top: 28px;
}

.create-deal-container {
  width: min(1880px, calc(100% - 32px));
}

.admin-invoice-table-wrap {
  overflow-x: auto;
  overflow-y: hidden;
  margin-top: 12px;
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 18px;
  scrollbar-gutter: stable;
}

.ui-hidden-column,
.ui-hidden-summary {
  display: none !important;
}

.admin-table {
  width: max(100%, 2350px);
  min-width: 0;
  table-layout: fixed;
  border-collapse: collapse;
}

.admin-table th,
.admin-table td {
  padding: 12px 10px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
  text-align: left;
  vertical-align: top;
}

.admin-table th {
  color: #dbeafe;
  font-size: 14px;
  font-weight: 800;
}

.admin-table input {
  width: 100%;
  min-height: 46px;
  border-radius: 12px;
  border: 1px solid #1d2638;
  background: #030712;
  color: #f8fafc;
  padding: 0 12px;
  font: inherit;
}

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

.admin-table th:nth-child(2),
.admin-table td:nth-child(2),
.admin-table th:nth-child(8),
.admin-table td:nth-child(8),
.admin-table th:nth-child(10),
.admin-table td:nth-child(10),
.admin-table th:nth-child(12),
.admin-table td:nth-child(12) {
  width: 140px;
}

.admin-table th:nth-child(3),
.admin-table td:nth-child(3),
.admin-table th:nth-child(6),
.admin-table td:nth-child(6) {
  width: 130px;
}

.admin-table th:nth-child(4),
.admin-table td:nth-child(4),
.admin-table th:nth-child(7),
.admin-table td:nth-child(7),
.admin-table th:nth-child(9),
.admin-table td:nth-child(9) {
  width: 150px;
}

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

.admin-table th:nth-child(11),
.admin-table td:nth-child(11) {
  width: 160px;
}

.admin-table th:nth-child(13),
.admin-table td:nth-child(13) {
  width: 74px;
}

.create-deal-summary {
  margin-top: 18px;
}

.form-hint {
  display: block;
  margin-top: 8px;
  color: #9db5d8;
  font-size: 13px;
}

.submit-status {
  margin-top: 16px;
  min-height: 20px;
  color: #9db5d8;
}

.submit-status.success {
  color: #86efac;
}

.submit-status.error {
  color: #fecaca;
}

.small-btn {
  min-height: 38px;
  padding: 0 12px;
}

.support-status-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  border: 1px solid rgba(148, 163, 184, 0.16);
}

.support-status-chip.is-new {
  background: rgba(59, 130, 246, 0.14);
  color: #bfdbfe;
}

.support-status-chip.is-handled {
  background: rgba(34, 197, 94, 0.16);
  color: #bbf7d0;
}

.support-status-chip.is-approved {
  background: rgba(34, 197, 94, 0.16);
  color: #bbf7d0;
}

.support-status-chip.is-pending {
  background: rgba(59, 130, 246, 0.14);
  color: #bfdbfe;
}

.support-status-chip.is-rejected {
  background: rgba(239, 68, 68, 0.16);
  color: #fecaca;
}

.support-status-chip.is-disabled {
  background: rgba(148, 163, 184, 0.16);
  color: #cbd5e1;
}

.support-request-top-actions,
.support-request-footer-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.adjustment-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 14px;
}

.adjustment-summary-card,
.adjustment-form-card {
  border: 1px solid rgba(148, 163, 184, 0.16);
  background: rgba(2, 6, 23, 0.38);
  border-radius: 18px;
}

.adjustment-summary-card {
  min-height: 98px;
  padding: 16px;
}

.adjustment-summary-card span,
.adjustment-card-meta span,
.adjustment-field span {
  display: block;
  color: #9db5d8;
  font-size: 13px;
  margin-bottom: 8px;
}

.adjustment-summary-card strong,
.adjustment-card-meta strong {
  display: block;
  color: #f8fafc;
  font-size: 20px;
  line-height: 1.25;
}

.adjustment-form-list {
  display: grid;
  gap: 18px;
}

.adjustment-form-card {
  padding: 18px;
}

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

.adjustment-card-head h3 {
  margin: 6px 0 4px;
  font-size: 22px;
}

.adjustment-card-head p {
  color: #9db5d8;
}

.muted-inline {
  color: #94a3b8;
  font-size: 13px;
}

.adjustment-card-meta {
  min-width: 180px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(148, 163, 184, 0.12);
}

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

.adjustment-field {
  display: flex;
  flex-direction: column;
}

.adjustment-field-wide {
  grid-column: 1 / -1;
}

.adjustment-input,
.adjustment-field textarea {
  width: 100%;
  min-height: 48px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  background: rgba(2, 6, 23, 0.9);
  color: #f8fafc;
  border-radius: 14px;
  padding: 12px 14px;
  font: inherit;
  outline: none;
}

.adjustment-field textarea {
  min-height: 96px;
  resize: vertical;
}

.adjustment-input:focus,
.adjustment-field textarea:focus {
  border-color: rgba(248, 250, 252, 0.4);
  box-shadow: 0 0 0 3px rgba(148, 163, 184, 0.08);
}

.adjustment-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.adjustment-save-status {
  min-height: 20px;
  color: #9db5d8;
}

.adjustment-save-status.success {
  color: #86efac;
}

.adjustment-save-status.error {
  color: #fecaca;
}

@media (max-width: 1100px) {
  .adjustment-summary-grid,
  .adjustment-form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .adjustment-card-head {
    flex-direction: column;
  }
}

@media (max-width: 720px) {
  .support-request-head,
  .support-request-footer {
    flex-direction: column;
  }

  .fee-admin-rule-grid {
    grid-template-columns: 1fr;
  }

  .adjustment-summary-grid,
  .adjustment-form-grid {
    grid-template-columns: 1fr;
  }
}
