.onb-page {
  --onb-track: #dce5f5;
  --onb-progress-start: #ef4444;
  --onb-progress-mid: #f59e0b;
  --onb-progress-end: #22c55e;
  --onb-glow: rgba(34, 197, 94, 0.25);

  color: #0f172a;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.onb-page,
.onb-page * {
  box-sizing: border-box;
}

.onb-shell {
  border-radius: 18px;
  border: 1px solid #d9e2ec;
  background: #ffffff;
  padding: 18px;
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.07);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.onb-shell-head {
  padding: 2px 2px 12px;
}

.onb-title {
  margin: 0 0 6px;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: 0.2px;
}

.onb-subtitle {
  margin: 0;
  color: #4a5f55;
  font-size: 14px;
}

.onb-card {
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 16px;
  padding: 14px;
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.06);
}

.onb-card-main {
  border-color: #d8e4ff;
  background: linear-gradient(180deg, #fafdff 0%, #eef4ff 100%);
}

.onb-card-table {
  border-color: #d5e9dd;
  background: linear-gradient(180deg, #f9fffb 0%, #effaf3 100%);
}

.onb-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.onb-btn {
  border: 1px solid rgba(0, 0, 0, 0.2);
  background: #fff;
  color: #111;
  border-radius: 11px;
  padding: 10px 14px;
  cursor: pointer;
  font-weight: 700;
  transition:
    transform 0.14s ease,
    box-shadow 0.14s ease;
}

.onb-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 7px 14px rgba(15, 23, 42, 0.12);
}

.onb-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.onb-btn-primary {
  border-color: #16a34a;
  color: #fff;
  background: linear-gradient(180deg, #22c55e 0%, #16a34a 100%);
  box-shadow: 0 8px 16px rgba(22, 163, 74, 0.22);
}

.onb-btn-export {
  border-color: #2563eb;
  color: #fff;
  background: linear-gradient(180deg, #3b82f6 0%, #2563eb 100%);
  box-shadow: 0 8px 16px rgba(37, 99, 235, 0.22);
}

#onbLoadBtn,
#onbExportBtn {
  min-width: 180px;
  box-shadow: 0 5px 10px rgba(15, 23, 42, 0.14);
}

#onbLoadBtn:hover,
#onbExportBtn:hover {
  box-shadow: 0 6px 12px rgba(15, 23, 42, 0.16);
}

#onbLoadBtn:disabled,
#onbExportBtn:disabled {
  box-shadow: none;
}

.onb-btn-cached {
  border-color: #ea580c;
  color: #fff;
  background: linear-gradient(180deg, #f97316 0%, #ea580c 100%);
  box-shadow: 0 8px 16px rgba(234, 88, 12, 0.24);
}

#onbLoadCachedBtn:disabled {
  opacity: 1;
  border-color: #cbd5e1;
  color: #f8fafc;
  background: linear-gradient(180deg, #d5b6a3 0%, #c29a84 100%);
  box-shadow: none;
  filter: saturate(0.45) brightness(0.95);
}

.onb-perm-hint {
  margin-top: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  color: #475569;
  font-size: 12px;
  font-weight: 700;
}

.onb-status {
  min-height: 18px;
  margin-top: 10px;
  font-size: 12px;
  font-weight: 700;
  color: #334155;
}

.onb-status.is-error {
  color: #b91c1c;
}

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

.onb-kpi-card {
  border-radius: 12px;
  padding: 10px;
  border: 1px solid #dbe5f0;
  background: linear-gradient(180deg, #ffffff 0%, #edf4fb 100%);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.onb-kpi-label {
  font-size: 12px;
  color: #516070;
  font-weight: 700;
}

.onb-kpi-value {
  font-size: 22px;
  font-weight: 800;
  color: #0f172a;
}

.onb-meta {
  margin-top: 10px;
  font-size: 12px;
  color: #475569;
  font-weight: 600;
}

.onb-table-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.onb-input {
  min-height: 40px;
  border: 2px solid #c4d4ea;
  border-radius: 12px;
  padding: 9px 11px;
  background: #fff;
  color: #111;
  min-width: 260px;
  width: min(560px, 100%);
  box-shadow: 0 3px 10px rgba(30, 64, 175, 0.08);
}

.onb-input:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.16);
  outline: none;
}

.onb-table-count {
  font-size: 12px;
  font-weight: 700;
  color: #475569;
}

.onb-table-wrap {
  border-radius: 12px;
  border: 1px solid #d5e0ef;
  background: #fff;
  overflow: auto;
}

.onb-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 1600px;
}

.onb-table thead th {
  text-align: left;
  font-size: 13px;
  font-weight: 800;
  color: #334155;
  background: #f1f6fd;
  border-bottom: 2px solid #c9d7ea;
  padding: 0;
  white-space: nowrap;
  position: relative;
}

.onb-th-wrap {
  position: relative;
  display: flex;
  align-items: stretch;
}

.onb-sort-btn {
  border: none;
  background: transparent;
  width: calc(100% - 8px);
  text-align: left;
  padding: 10px 8px 10px 10px;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
  font-weight: 800;
  color: inherit;
  cursor: pointer;
}

.onb-sort-btn:hover {
  background: rgba(37, 99, 235, 0.08);
}

.onb-sort-btn:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: -2px;
}

.onb-sort-indicator {
  font-size: 13px;
  font-weight: 900;
  color: #1e3a8a;
  min-width: 22px;
  text-align: center;
  border: 1px solid #bfdbfe;
  background: #e0ecff;
  border-radius: 999px;
  padding: 1px 6px;
}

.onb-sort-btn.is-active .onb-sort-indicator {
  color: #ffffff;
  background: #1d4ed8;
  border-color: #1d4ed8;
}

.onb-col-resizer {
  position: absolute;
  right: -3px;
  top: 0;
  width: 8px;
  height: 100%;
  cursor: col-resize;
  user-select: none;
  z-index: 3;
}

.onb-col-resizer::after {
  content: "";
  position: absolute;
  top: 20%;
  bottom: 20%;
  left: 3px;
  width: 2px;
  border-radius: 2px;
  background: rgba(71, 85, 105, 0.32);
}

.onb-col-resizer:hover::after {
  background: rgba(29, 78, 216, 0.8);
}

.onb-table tbody td {
  padding: 10px;
  border-bottom: 1px solid #e2e8f0;
  font-size: 13px;
  color: #0f172a;
  vertical-align: top;
}

.onb-table tbody tr:hover td {
  background: #f8fbff;
}

.onb-table tbody tr:last-child td {
  border-bottom: none;
}

.onb-cell-mail {
  color: #1d4ed8;
  font-weight: 700;
}

.onb-cell-missing {
  text-align: left;
  color: #b91c1c;
  vertical-align: top;
}

.onb-cell-missing-x {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  margin: 0;
  border-radius: 999px;
  font-size: 11px;
  line-height: 1;
  font-weight: 900;
  font-family: "Segoe UI Symbol", "Segoe UI", Arial, sans-serif;
  color: #b91c1c;
  background: #fee2e2;
  transform: translateY(-0.8px);
  transition:
    transform 0.16s ease,
    box-shadow 0.16s ease,
    filter 0.16s ease;
}

.onb-cell-missing-x:hover {
  transform: translateY(-1.8px);
  box-shadow:
    0 7px 14px rgba(185, 28, 28, 0.24),
    inset 0 -1px 0 rgba(255, 255, 255, 0.35);
  filter: saturate(1.08);
}

.onb-cell-date {
  font-weight: 700;
  color: #166534;
  white-space: nowrap;
}

.onb-empty {
  text-align: center;
  color: #64748b;
  font-weight: 700;
}

.onb-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1400;
  background: rgba(15, 23, 42, 0.34);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
}

.onb-modal-card {
  width: min(560px, 100%);
  border-radius: 14px;
  border: 1px solid #d5e0ef;
  background: #ffffff;
  box-shadow: 0 18px 36px rgba(15, 23, 42, 0.25);
  padding: 16px;
}

.onb-modal-title {
  margin: 0 0 4px;
  font-size: 18px;
  font-weight: 800;
  color: #0f172a;
}

.onb-modal-subtitle {
  margin: 0 0 12px;
  font-size: 13px;
  color: #475569;
}

.onb-modal-choice {
  display: grid;
  gap: 8px;
}

.onb-modal-choice-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.onb-modal-choice-btn {
  width: 100%;
  text-align: left;
}

.onb-cache-hint {
  font-size: 12px;
  font-weight: 800;
  color: #b91c1c;
  white-space: nowrap;
}

.onb-modal-progress {
  margin-top: 6px;
}

.onb-progress {
  width: 100%;
}

.onb-progress-track {
  position: relative;
  width: 100%;
  height: 12px;
  border-radius: 999px;
  background: var(--onb-track);
  overflow: hidden;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.14);
}

.onb-progress-bar {
  position: relative;
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background-image: linear-gradient(
    90deg,
    #dc2626 0%,
    #ef4444 10%,
    #f97316 24%,
    #f59e0b 38%,
    #facc15 52%,
    #84cc16 68%,
    #22c55e 82%,
    #16a34a 100%
  );
  background-size: calc(10000% / var(--onb-progress-percent, 100)) 100%;
  background-position: left top;
  background-repeat: no-repeat;
  box-shadow: 0 0 16px var(--onb-glow);
  transition:
    width 0.25s ease,
    background-size 0.24s ease,
    box-shadow 0.24s ease;
}

.onb-progress-bar.is-success {
  background-image: none;
  background-color: #22c55e;
  box-shadow:
    0 0 22px rgba(34, 197, 94, 0.52),
    0 0 38px rgba(34, 197, 94, 0.3),
    0 0 54px rgba(134, 239, 172, 0.22);
}

.onb-progress-text {
  margin-top: 8px;
  font-size: 13px;
  color: #2f4a3d;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.onb-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  display: inline-block;
  animation: onb-spin 0.8s linear infinite;
}

.onb-modal-error {
  margin-top: 8px;
  font-size: 12px;
  font-weight: 700;
  color: #b91c1c;
}

.onb-modal-actions {
  margin-top: 12px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.is-hidden {
  display: none !important;
}

body.onb-col-resize-active {
  cursor: col-resize;
  user-select: none;
}

@keyframes onb-spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 1050px) {
  .onb-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .onb-shell {
    padding: 12px;
  }

  .onb-kpi-grid {
    grid-template-columns: 1fr;
  }

  .onb-table-head {
    flex-direction: column;
    align-items: stretch;
  }

  .onb-input {
    min-width: 0;
    width: 100%;
  }
}
