.panel-card {
  border: 1px solid var(--uplift-border);
  border-radius: 14px;
  box-shadow: var(--uplift-shadow);
  background-color: var(--uplift-white);
}

.panel-card .card-body {
  padding: 1.05rem;
}

.api-status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--uplift-border);
}

.api-status-row:last-child {
  border-bottom: 0;
}

.api-status-row span {
  color: var(--uplift-muted);
}

.api-status-row strong,
.api-status-row code {
  text-align: right;
  overflow-wrap: anywhere;
}

.api-config-box {
  display: grid;
  gap: 0.35rem;
  margin: 1rem 0;
  padding: 0.8rem;
  border: 1px solid var(--uplift-border);
  border-radius: 8px;
  background: #fbfaf8;
}

.api-config-box span {
  color: var(--uplift-muted);
  font-size: 0.82rem;
}

.api-example {
  overflow: auto;
  padding: 1rem;
  border-radius: 8px;
  background: #272727;
  color: #fff;
  font-size: 0.85rem;
}

.partner-logo {
  width: 92px;
  height: 64px;
  object-fit: contain;
  border: 1px solid var(--uplift-border);
  border-radius: 10px;
  background: #fff;
}

.partner-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(150px, 1fr));
  gap: 1rem 1.5rem;
}

.partner-summary-grid span,
.partner-field span {
  display: block;
  color: var(--uplift-muted);
  font-size: 0.78rem;
  margin-bottom: 0.2rem;
}

.partner-field strong {
  font-size: 0.9rem;
  overflow-wrap: anywhere;
}

.partner-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem 1.2rem;
}

.partner-user-avatar {
  display: inline-flex;
  width: 34px;
  height: 34px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--uplift-gold-soft);
  color: var(--uplift-gold-dark);
  font-weight: 700;
}

.partner-actions {
  min-width: 260px;
}

.partner-actions .btn {
  margin: 0.1rem;
}

.kpi-title {
  font-size: 0.8rem;
  color: var(--uplift-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.45rem;
}

.kpi-value {
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.1;
}

.kpi-trend {
  margin-top: 0.35rem;
  font-size: 0.82rem;
  font-weight: 600;
}

.trend-up {
  color: var(--uplift-success);
}

.trend-down {
  color: #a34242;
}

.profile-avatar {
  width: 62px;
  height: 62px;
  border-radius: 50%;
  background-color: var(--uplift-gold);
  color: #fff;
  font-size: 1.5rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.5rem;
  border-radius: 99px;
  background-color: #e8f5eb;
  color: var(--uplift-success);
  font-size: 0.78rem;
  font-weight: 600;
}

.info-row {
  margin-bottom: 0.9rem;
}

.info-row > span {
  display: block;
  margin-bottom: 0.35rem;
  color: var(--uplift-muted);
  font-size: 0.83rem;
}

.link-arrow {
  font-size: 0.86rem;
  font-weight: 600;
}

.benefits-list {
  margin: 0;
  padding-left: 1rem;
  color: var(--uplift-muted);
}

.benefits-list li {
  margin-bottom: 0.22rem;
}

.progress {
  --bs-progress-bg: #eee6d8;
  height: 8px;
}

.progress-bar {
  background-color: var(--uplift-gold);
}

.chart-bars {
  height: 220px;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  align-items: end;
  gap: 0.65rem;
  margin-top: 1rem;
}

.chart-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  height: 100%;
}

.chart-bar {
  width: 100%;
  background: linear-gradient(180deg, #d9b16f 0%, #b78947 100%);
  border-radius: 8px 8px 4px 4px;
}

.chart-item span {
  font-size: 0.78rem;
  color: var(--uplift-muted);
}

.link-create-modal-dialog {
  width: min(1280px, calc(100vw - 2rem));
  max-width: none;
}

.link-create-modal-content {
  border: 1px solid var(--uplift-border);
  border-radius: 8px;
  box-shadow: 0 18px 55px rgba(30, 28, 24, 0.2);
  overflow: hidden;
}

.link-create-header {
  padding: 1.1rem 1.35rem 0.85rem;
  border-bottom: 0;
  align-items: flex-start;
}

.link-create-header .modal-title {
  color: #101936;
  font-size: 1.75rem;
  font-weight: 700;
}

.link-create-header p {
  margin: 0.25rem 0 0;
  color: #64708f;
  font-size: 0.95rem;
  line-height: 1.35;
}

.link-create-body {
  padding: 0 1.35rem 0.9rem;
  background: #fff;
}

.link-create-main {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(250px, 0.8fr);
  gap: 0.8rem;
}

.link-create-panel {
  border: 1px solid #e2e7ef;
  border-radius: 6px;
  padding: 0.85rem;
  background: #fff;
}

.link-create-panel h3 {
  margin: 0;
  color: #101936;
  font-size: 1.05rem;
  font-weight: 700;
}

.link-create-help,
.field-hint,
.optional-label {
  color: #64708f;
  font-size: 0.85rem;
}

.link-create-help {
  margin: 0.2rem 0 0.75rem;
  line-height: 1.35;
}

.link-create-grid,
.utm-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem 0.85rem;
}

.utm-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.link-create-panel .form-label {
  margin-bottom: 0.25rem;
  color: #1b2545;
  font-size: 0.95rem;
  font-weight: 600;
}

.required-label::after {
  content: " *";
  color: #c56f32;
}

.link-create-panel .form-control,
.link-create-panel .form-select {
  min-height: 40px;
  padding: 0.5rem 0.7rem;
  border-color: #dfe4ec;
  border-radius: 5px;
  color: #273354;
  font-size: 0.95rem;
}

.field-hint {
  display: block;
  margin-top: 0.22rem;
}

.character-count {
  color: #64708f;
  font-size: 0.8rem;
  text-align: right;
}

.link-create-divider {
  border-top: 1px solid #e9edf3;
  margin: 0.85rem 0;
}

.link-toggle {
  display: flex;
  gap: 0.55rem;
  margin-top: 0.55rem;
  color: #273354;
  font-size: 0.95rem;
}

.link-toggle input {
  width: 15px;
  height: 15px;
  margin-top: 0.05rem;
  accent-color: var(--uplift-gold);
}

.link-toggle strong,
.link-toggle small {
  display: block;
}

.link-toggle small {
  color: #64708f;
  font-size: 0.8rem;
}

.link-preview-url {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  margin: 0.85rem 0;
  padding: 0.45rem 0.55rem;
  border: 1px solid #dfe4ec;
  border-radius: 5px;
  color: #273354;
  font-size: 0.85rem;
  overflow-wrap: anywhere;
}

.link-preview-url button {
  border: 0;
  background: transparent;
  color: #273354;
}

.qr-preview {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin-bottom: 0.65rem;
}

.qr-pattern {
  width: 78px;
  height: 78px;
  flex: 0 0 78px;
  border: 5px solid #111;
  background: repeating-linear-gradient(45deg, #111 0 3px, #fff 3px 6px), repeating-linear-gradient(-45deg, transparent 0 4px, #111 4px 6px);
  background-blend-mode: multiply;
}

.btn-outline-gold {
  border: 1px solid var(--uplift-gold);
  color: #ad7d27;
  background: #fff;
  font-size: 0.85rem;
}

.link-information {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin: 0.75rem 0 0;
  font-size: 0.85rem;
}

.link-information dt,
.link-information dd {
  margin: 0;
  padding: 0.36rem 0;
  border-bottom: 1px solid #edf0f4;
}

.link-information dt { color: #52607e; }
.link-information dd { color: #1b2545; text-align: right; }

.link-tips {
  margin-top: 0.8rem;
  padding: 0.65rem 0.8rem;
  border: 1px solid #f0e3c8;
  border-radius: 6px;
  background: #fffaf0;
  color: #35415e;
  font-size: 0.85rem;
}

.link-tips strong { color: #182142; }
.link-tips ul { margin: 0.25rem 0 0; padding-left: 1rem; }
.link-tips li { margin: 0.12rem 0; }

.link-create-footer {
  justify-content: flex-end;
  gap: 0.55rem;
  padding: 0.8rem 1.35rem 1rem;
  border-top: 0;
}

.link-create-footer .btn {
  min-width: 116px;
  font-size: 0.95rem;
}

@media (max-width: 800px) {
  .link-create-main,
  .link-view-main { grid-template-columns: 1fr; }
  .utm-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 520px) {
  .link-create-grid,
  .utm-grid { grid-template-columns: 1fr; }
  .link-create-modal-dialog { width: calc(100vw - 0.75rem); margin: 0.375rem auto; }
  .link-create-header .modal-title { font-size: 1.2rem; }
}

.qr-placeholder {
  width: 150px;
  height: 150px;
  border-radius: 8px;
  margin: 0 auto;
  background:
    conic-gradient(from 90deg at 18px 18px, #000 90deg, #fff 0) 0 0 / 36px 36px,
    conic-gradient(from 90deg at 9px 9px, #000 90deg, #fff 0) 0 0 / 18px 18px,
    #fff;
  border: 6px solid #fff;
  box-shadow: inset 0 0 0 1px var(--uplift-border);
}

.link-view-modal-dialog {
  width: min(1280px, calc(100vw - 2rem));
  max-width: none;
}

.link-view-main {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(250px, 0.8fr);
  gap: 0.8rem;
}

.link-unsaved-notice {
  margin-bottom: 0.8rem;
  padding: 0.65rem 0.8rem;
  border: 1px solid #f0e3c8;
  border-radius: 6px;
  background: #fffaf0;
  color: #7b5b20;
  font-size: 0.85rem;
}

.link-cell {
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #52607e;
  font-size: 0.85rem;
}

.link-view-body {
  padding: 1.2rem 1.35rem;
}

.link-view-url {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 1rem;
  padding: 0.75rem;
  border: 1px solid #dfe4ec;
  border-radius: 6px;
  background: #fbfcfe;
}

.link-view-url span,
.link-view-description strong {
  color: #52607e;
  font-size: 0.85rem;
}

.link-view-url a {
  overflow-wrap: anywhere;
  font-size: 0.95rem;
}

.link-view-url-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.link-view-url-row a {
  flex: 1;
}

.link-view-url-row .btn {
  flex: 0 0 auto;
  white-space: nowrap;
}

.link-view-bottom-url {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: 100%;
  margin-top: 0.9rem;
  padding: 0.75rem 0.85rem;
  border: 1px solid #dfe4ec;
  border-radius: 6px;
  background: #fbfcfe;
}

.link-view-bottom-url > div {
  min-width: 0;
  flex: 1;
}

.link-view-bottom-url span {
  display: block;
  margin-bottom: 0.25rem;
  color: #52607e;
  font-size: 0.85rem;
}

.link-view-bottom-url a {
  display: block;
  overflow-wrap: anywhere;
  font-size: 0.95rem;
}

.link-editable-field[contenteditable="true"] {
  display: block;
  width: 100%;
  min-height: 2rem;
  margin: 0.2rem 0;
  padding: 0.35rem 0.55rem;
  border: 1px solid #111;
  border-radius: 4px;
  background: #fff;
  color: #17203d;
  text-align: left;
  outline: none;
}

.link-editing .link-information dt,
.link-editing .link-information dd {
  border-bottom: 0;
  padding-top: 0.28rem;
  padding-bottom: 0.28rem;
  text-align: left;
}

.link-editable-select {
  display: block;
  width: 100%;
  min-width: 170px;
  border: 1px solid #111;
  background-color: #fff;
  color: #273354;
  font-size: 0.85rem;
  box-shadow: none;
}

.link-editing .link-unsaved-notice {
  margin-top: 0.85rem;
  border: 0;
  background: transparent;
  color: #111;
  padding-left: 0;
}

.link-view-information {
  font-size: 0.95rem;
}

.link-view-description {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid #edf0f4;
}

.link-view-description p {
  margin: 0.4rem 0 0;
  color: #273354;
  font-size: 0.95rem;
}

.api-breadcrumb { margin-bottom: 0.45rem; color: #52607e; font-size: 0.78rem; }
.api-breadcrumb span { padding: 0 0.35rem; color: #aab4c5; }
.api-page-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 0.8rem; }
.api-header-actions { display: flex; align-items: center; gap: 0.75rem; }
.api-active-badge { padding: 0.65rem 1.35rem; border-radius: 6px; background: #e8f7eb; color: #16833a; font-weight: 700; }
.api-save-button { color: #98a2b3; cursor: not-allowed; }
.api-panel { border-radius: 6px; box-shadow: none; }
.api-page-header + section.row.g-3 > [class*="col-xl-"] { flex: 0 0 50%; max-width: 50%; }
.api-panel .card-body { padding: 0.85rem; }
.api-panel h2 { margin-bottom: 0.75rem; color: #101936; font-size: 1.1rem; font-weight: 700; }
.api-panel .form-label { margin-bottom: 0.3rem; color: #17203d; font-size: 0.9rem; font-weight: 700; }
.api-panel .form-control { min-height: 36px; border-color: #dfe4ec; font-size: 0.9rem; }
.api-input-with-action { display: flex; gap: 0.45rem; align-items: stretch; }
.api-input-with-action .form-control { min-width: 0; }
.api-endpoint-path { display: flex; min-width: 0; flex: 1 1 auto; align-items: center; padding: 0 0.7rem; overflow: hidden; border: 1px solid #dfe4ec; border-radius: 5px; background: #f8fafc; color: #52607e; font-size: 0.9rem; line-height: 1; white-space: nowrap; text-overflow: ellipsis; }
.api-input-with-action:has(.api-endpoint-path) .form-control { flex: 0 1 220px; width: 220px; }
.api-icon-button { width: 40px; border: 1px solid #dfe4ec; border-radius: 5px; background: #fff; color: #52607e; }
.api-generate-button { white-space: nowrap; font-size: 0.75rem; }
.api-switch-row { display: flex; align-items: center; gap: 0.4rem; margin-top: 0.85rem; color: #52607e; font-size: 0.75rem; }
.api-switch { width: 30px; height: 17px; padding: 2px; border-radius: 12px; background: #b8c0ca; }
.api-switch i { display: block; width: 13px; height: 13px; border-radius: 50%; background: #fff; }
.api-switch.on { background: #16833a; }
.api-switch.on i { margin-left: 13px; }
.api-hint { display: block; color: #64708f; font-size: 0.82rem; }
.api-success-box { display: grid; gap: 0.25rem; margin-top: 0.8rem; padding: 0.65rem; border-radius: 6px; background: #e8f7eb; color: #16833a; font-size: 0.78rem; }
.api-success-box span { color: #52607e; font-size: 0.7rem; }
.api-unit { display: flex; align-items: center; padding: 0 0.7rem; border: 1px solid #dfe4ec; border-left: 0; border-radius: 0 5px 5px 0; color: #52607e; font-size: 0.75rem; }
.api-tabs { display: flex; gap: 0.35rem; margin-bottom: 0.55rem; }
.api-tabs button { padding: 0.35rem 0.65rem; border: 1px solid #dfe4ec; border-radius: 5px; background: #fff; color: #52607e; font-size: 0.72rem; }
.api-tabs button.active { border-color: #116ac4; background: #116ac4; color: #fff; }
.code-panel pre { position: relative; min-height: 130px; margin: 0; padding: 0.75rem; overflow: auto; border-radius: 5px; background: #202a34; color: #e8edf2; font-size: 0.72rem; }
.api-copy-code { position: absolute; top: 0.55rem; right: 0.55rem; border: 0; background: transparent; color: #fff; font-size: 0.7rem; }
.api-test-result { display: grid; gap: 0.25rem; margin-top: 0.8rem; padding: 0.65rem; border-radius: 6px; background: #e8f7eb; color: #16833a; font-size: 0.75rem; }
.api-test-result span { color: #52607e; font-size: 0.7rem; }
.api-security-box { padding: 0.7rem; border-radius: 6px; background: #e8f2ff; color: #164b82; font-size: 0.75rem; }
.api-security-box ul { margin: 0; padding-left: 1.1rem; }
.api-last-call { display: grid; gap: 0.2rem; margin-top: 1rem; color: #52607e; font-size: 0.75rem; }
.api-last-call strong { color: #17203d; }
.api-last-call a { justify-self: end; color: #116ac4; }
.api-unsaved-bar { position: sticky; z-index: 20; bottom: 1rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: 1rem; padding: 0.8rem 1rem; border: 1px solid #d9dee8; border-radius: 6px; background: #fff; box-shadow: 0 8px 24px rgba(16, 25, 54, 0.14); color: #17203d; }
.api-unsaved-bar[hidden] { display: none; }
.api-unsaved-actions { display: flex; gap: 0.5rem; }
.header-help-button { color: #17203d; font-size: 1.15rem; font-weight: 700; line-height: 1; }
.header-help-button:hover, .header-help-button:focus { border-color: #116ac4; color: #116ac4; }
.api-help-modal .modal-content { overflow: hidden; border: 0; border-radius: 8px; box-shadow: 0 24px 70px rgba(16, 25, 54, 0.24); }
.api-help-header { align-items: flex-start; padding: 1.25rem 1.5rem; border-bottom-color: #dfe4ec; background: #f8fafc; }
.api-help-header .modal-title { margin-top: 0.15rem; color: #101936; font-size: 1.4rem; font-weight: 700; }
.api-help-header p { margin: 0.25rem 0 0; color: #52607e; }
.api-help-eyebrow { color: #116ac4; font-size: 0.72rem; font-weight: 700; letter-spacing: 0; text-transform: uppercase; }
.api-help-body { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 1.5rem; padding: 0; }
.api-help-nav { position: sticky; top: 0; display: flex; align-self: start; flex-direction: column; gap: 0.2rem; padding: 1.25rem 0.85rem; border-right: 1px solid #e5e9f0; }
.api-help-nav a { padding: 0.55rem 0.7rem; border-radius: 5px; color: #52607e; font-size: 0.85rem; font-weight: 600; text-decoration: none; }
.api-help-nav a:hover, .api-help-nav a:focus { background: #e8f2ff; color: #116ac4; }
.api-help-content { min-width: 0; padding: 0 1.5rem 1.5rem 0; }
.api-help-section { padding-top: 1.5rem; scroll-margin-top: 1rem; }
.api-help-section + .api-help-section { margin-top: 0.25rem; border-top: 1px solid #edf0f4; }
.api-help-section h3 { margin-bottom: 0.75rem; color: #101936; font-size: 1.1rem; font-weight: 700; }
.api-help-section p { color: #52607e; line-height: 1.55; }
.api-help-section code { color: #164b82; }
.api-help-note, .api-help-warning, .api-help-success { display: grid; gap: 0.2rem; padding: 0.8rem 0.9rem; border-radius: 6px; }
.api-help-note { border-left: 3px solid #116ac4; background: #e8f2ff; color: #164b82; }
.api-help-warning { margin-top: 0.6rem; border-left: 3px solid #c49335; background: #fff7e8; color: #61440d; }
.api-help-success { margin-top: 0.8rem; border-left: 3px solid #16833a; background: #e8f7eb; color: #126c31; }
.api-help-steps { display: grid; gap: 0.9rem; margin: 0; padding-left: 1.5rem; }
.api-help-steps li { padding-left: 0.35rem; color: #17203d; }
.api-help-steps li::marker { color: #116ac4; font-weight: 700; }
.api-help-steps p { margin: 0.2rem 0 0; }
.api-help-caption { margin: 0.85rem 0 0; font-size: 0.85rem; }
.api-help-code { margin: 1rem 0 0; padding: 1rem; overflow: auto; border-radius: 6px; background: #202a34; color: #e8edf2; font-size: 0.82rem; }
.api-help-code code { color: inherit; }
.api-help-errors { display: grid; gap: 0; margin: 0; }
.api-help-errors div { display: grid; grid-template-columns: 185px minmax(0, 1fr); gap: 1rem; padding: 0.7rem 0; border-bottom: 1px solid #edf0f4; }
.api-help-errors dt { color: #17203d; }
.api-help-errors dd { margin: 0; color: #52607e; }
.api-help-footer { justify-content: space-between; color: #52607e; font-size: 0.82rem; }

@media (max-width: 767px) {
  .api-page-header { display: block; }
  .api-header-actions { margin-top: 0.75rem; }
  .api-input-with-action { flex-wrap: wrap; }
  .api-input-with-action:has(.api-endpoint-path) .form-control { flex-basis: 100%; width: 100%; }
  .api-input-with-action:has(.api-endpoint-path) .api-endpoint-path { flex: 1 1 auto; min-height: 36px; }
  .api-generate-button { width: 100%; }
  .api-unsaved-bar { align-items: stretch; flex-direction: column; }
  .api-unsaved-actions { justify-content: flex-end; }
  .api-help-body { display: block; }
  .api-help-nav { position: static; flex-direction: row; padding: 0.75rem; overflow-x: auto; border-right: 0; border-bottom: 1px solid #e5e9f0; white-space: nowrap; }
  .api-help-content { padding: 0 1rem 1rem; }
  .api-help-errors div { grid-template-columns: 1fr; gap: 0.2rem; }
  .api-help-footer { align-items: stretch; flex-direction: column; }
}

@media (max-width: 1199px) {
  .api-page-header + section.row.g-3 > [class*="col-xl-"] { flex-basis: 100%; max-width: 100%; }
}