/* ── Design tokens ── */
:root {
  --green:        #0e7a46;
  --green-hover:  #0a6035;
  --green-light:  #e8f5ee;
  --green-mid:    #c8e6d4;
  --blue:         #0f766e;
  --blue-hover:   #0b5f59;
  --blue-light:   #e7f6f2;
  --red:          #dc2626;
  --red-light:    #fef2f2;
  --amber:        #d97706;
  --amber-light:  #fffbeb;

  --text:         #17212f;
  --text-2:       #384657;
  --text-3:       #536274;
  --text-4:       #8a9aac;
  --text-5:       #b0bec8;

  --bg:           #f4f7f5;
  --bg-2:         #edf2ef;
  --surface:      #ffffff;
  --line:         #dde5e0;
  --line-2:       #e8eeeb;

  --radius-sm:    6px;
  --radius:       8px;
  --radius-lg:    8px;
  --radius-xl:    8px;

  --shadow-sm:    0 1px 3px rgba(17,34,51,0.08);
  --shadow:       0 4px 16px rgba(17,34,51,0.09);
  --shadow-lg:    0 12px 40px rgba(17,34,51,0.12);

  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Helvetica Neue', Arial, sans-serif;
  --font-mono: 'SFMono-Regular', Consolas, 'Liberation Mono', monospace;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-font-smoothing: antialiased; scroll-behavior: smooth; }
body { font-family: var(--font); color: var(--text); background: var(--bg); line-height: 1.6; min-height: 100vh; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font-family: inherit; font-size: inherit; }

/* ── Keyboard access ── */
.skip-link {
  position: fixed;
  top: 0.6rem;
  left: 0.75rem;
  z-index: 80;
  padding: 0.55rem 0.75rem;
  border-radius: var(--radius-sm);
  background: var(--text);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 700;
  transform: translateY(-160%);
  transition: transform 140ms ease;
}
.skip-link:focus { transform: translateY(0); }
.visually-hidden {
  position: absolute !important;
  overflow: hidden !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  border: 0 !important;
  clip: rect(0 0 0 0) !important;
  white-space: nowrap !important;
}

/* ── Layout shell ── */
.auth-shell {
  display: grid;
  min-height: 100vh;
  grid-template-columns: 1fr;
  align-items: start;
}
@media (min-width: 960px) {
  .auth-shell { grid-template-columns: 440px 1fr; }
}

.auth-panel {
  min-height: 100vh;
  background: var(--surface);
  border-right: 1px solid var(--line);
  padding: 0;
  display: flex;
  flex-direction: column;
}

.auth-panel-header {
  padding: 2rem 2.5rem 0;
}

.auth-panel-body {
  flex: 1;
  padding: 2.5rem 2.5rem 3rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.auth-panel-footer {
  padding: 1.5rem 2.5rem;
  border-top: 1px solid var(--line-2);
  font-size: 0.82rem;
  color: var(--text-4);
}

.auth-aside {
  display: none;
  position: sticky;
  top: 0;
  height: 100vh;
  background: linear-gradient(145deg, #f0faf4 0%, #e8f5ee 40%, #eef3ff 100%);
  align-items: center;
  justify-content: center;
  padding: 3rem;
}
@media (min-width: 960px) { .auth-aside { display: flex; } }

/* ── Site logo ── */
.site-logo { display: inline-flex; align-items: center; }
.site-logo img { height: 2rem; width: auto; max-width: 14rem; object-fit: contain; }

/* ── Typography ── */
.page-title {
  font-size: 1.55rem;
  font-weight: 740;
  color: var(--text);
  letter-spacing: -0.025em;
  line-height: 1.2;
  margin-bottom: 0.35rem;
}
.page-sub {
  font-size: 0.9rem;
  color: var(--text-3);
  line-height: 1.6;
  margin-bottom: 2rem;
}
.eyebrow {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--green);
  margin-bottom: 0.5rem;
}
.section-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.2rem;
}

/* ── Form controls ── */
.field { display: flex; flex-direction: column; gap: 0.35rem; margin-bottom: 1rem; }
.field:last-of-type { margin-bottom: 0; }

label.field-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-2);
  letter-spacing: 0.01em;
}

.input {
  width: 100%;
  height: 2.75rem;
  padding: 0 0.875rem;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font-size: 0.9rem;
  transition: border-color 0.15s, box-shadow 0.15s;
  outline: none;
  appearance: none;
}
.input:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(14,122,70,0.1);
}
.input::placeholder { color: var(--text-5); }
.input.error { border-color: var(--red); }
.input.error:focus { box-shadow: 0 0 0 3px rgba(220,38,38,0.1); }

.input-row { display: grid; grid-template-columns: 1fr auto; gap: 0.5rem; }
.input-row .input { border-radius: var(--radius) 0 0 var(--radius); }

.engineered-number-field {
  position: relative;
  display: inline-flex;
  min-width: 8.5rem;
  max-width: 100%;
  flex: 0 1 11rem;
  align-items: stretch;
}
.engineered-number-field > input {
  width: 100%;
  padding-right: 3.85rem !important;
  font-variant-numeric: tabular-nums;
}
.engineered-number-suffix {
  pointer-events: none;
  position: absolute;
  right: 0.68rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-4);
  font-size: 0.68rem;
  font-weight: 720;
  letter-spacing: 0;
}
.engineered-number-error {
  position: absolute;
  left: 0;
  top: calc(100% + 0.2rem);
  z-index: 2;
  color: var(--red);
  font-size: 0.68rem;
  font-weight: 680;
  white-space: nowrap;
}
.engineered-number-error[hidden] { display: none; }
.engineered-number-field input[aria-invalid="true"] {
  border-color: rgba(220, 38, 38, 0.58) !important;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.08) !important;
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: var(--radius);
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: background 0.14s, border-color 0.14s, color 0.14s, opacity 0.14s, transform 0.08s;
  white-space: nowrap;
  text-decoration: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.48; cursor: not-allowed; pointer-events: none; }

.btn-primary {
  background: var(--green);
  color: #fff;
  border-color: var(--green);
  height: 2.75rem;
  padding: 0 1.25rem;
}
.btn-primary:hover { background: var(--green-hover); border-color: var(--green-hover); }

.btn-primary-full { width: 100%; }

.btn-secondary {
  background: var(--surface);
  color: var(--text-2);
  border-color: var(--line);
  height: 2.75rem;
  padding: 0 1.1rem;
}
.btn-secondary:hover { border-color: var(--text-4); background: var(--bg-2); }

.btn-ghost {
  background: transparent;
  color: var(--green);
  border-color: transparent;
  height: 2.25rem;
  padding: 0 0.75rem;
  font-weight: 500;
  font-size: 0.85rem;
}
.btn-ghost:hover { background: var(--green-light); }

.btn-danger {
  background: var(--red-light);
  color: var(--red);
  border-color: #fecaca;
  height: 2.25rem;
  padding: 0 0.9rem;
  font-size: 0.82rem;
  font-weight: 600;
}
.btn-danger:hover { background: #fee2e2; }

.btn-sm {
  height: 2.1rem;
  padding: 0 0.85rem;
  font-size: 0.8rem;
}

/* Code send button — attached to input */
.btn-code {
  height: 2.75rem;
  padding: 0 1rem;
  background: var(--green-light);
  color: var(--green);
  border: 1.5px solid var(--green-mid);
  border-left: none;
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.14s;
  flex-shrink: 0;
}
.btn-code:hover { background: var(--green-mid); }
.btn-code:disabled { opacity: 0.5; cursor: not-allowed; }

/* ── Alerts / feedback ── */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  font-size: 0.85rem;
  line-height: 1.55;
  margin-bottom: 1.25rem;
}
.alert-error   { background: var(--red-light);   color: var(--red);   border: 1px solid #fecaca; }
.alert-success { background: var(--green-light);  color: var(--green); border: 1px solid var(--green-mid); }
.alert-info    { background: #eff6ff;             color: #1d4ed8;      border: 1px solid #bfdbfe; }
.alert-warn    { background: var(--amber-light);  color: var(--amber); border: 1px solid #fde68a; }

/* ── Divider ── */
.divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.78rem;
  color: var(--text-5);
  margin: 1.5rem 0;
}
.divider::before, .divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--line);
}

/* ── Tab bar ── */
.tabs {
  display: flex;
  border-bottom: 1.5px solid var(--line);
  margin-bottom: 1.75rem;
  gap: 0;
}
.tab {
  padding: 0.6rem 1.1rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-3);
  border-bottom: 2px solid transparent;
  margin-bottom: -1.5px;
  cursor: pointer;
  transition: color 0.14s, border-color 0.14s;
  user-select: none;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--green); border-bottom-color: var(--green); font-weight: 600; }

/* ── Card ── */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
}

/* ── Status badges ── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.6rem;
  border-radius: 100px;
  font-size: 0.74rem;
  font-weight: 600;
  white-space: nowrap;
}
.badge-green  { background: var(--green-light); color: var(--green); }
.badge-blue   { background: var(--blue-light);  color: var(--blue); }
.badge-amber  { background: var(--amber-light); color: var(--amber); }
.badge-red    { background: var(--red-light);   color: var(--red); }
.badge-gray   { background: var(--bg-2);        color: var(--text-4); }

/* ── Product card (dashboard) ── */
.product-card {
  border: 1.5px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  background: var(--surface);
  transition: box-shadow 0.2s, border-color 0.2s;
  position: relative;
  overflow: hidden;
}
.product-card.active   { border-color: var(--green-mid); box-shadow: 0 0 0 3px rgba(14,122,70,0.06); }
.product-card.locked   { opacity: 0.6; }
.product-card.active::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--green);
  border-radius: 3px 3px 0 0;
}
.product-card-token.active::before { background: var(--blue); }
.product-card-token.active { border-color: #c7d8fd; box-shadow: 0 0 0 3px rgba(36,92,230,0.06); }

.product-icon-badge {
  display: inline-grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--radius);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  margin-bottom: 1rem;
}
.badge-cdn-icon   { background: var(--green-light); color: var(--green); }
.badge-token-icon { background: var(--blue-light);  color: var(--blue); }

.product-card h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.3rem;
}
.product-card p {
  font-size: 0.84rem;
  color: var(--text-3);
  line-height: 1.6;
  margin-bottom: 1.25rem;
}

/* ── Locked overlay ── */
.lock-notice {
  font-size: 0.8rem;
  color: var(--text-4);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

/* ── Verification status banner ── */
.verify-banner {
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}
.verify-banner .vb-icon {
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  font-size: 1rem;
}
.verify-banner .vb-body { flex: 1; min-width: 0; }
.verify-banner .vb-title { font-size: 0.9rem; font-weight: 700; margin-bottom: 0.2rem; }
.verify-banner .vb-desc  { font-size: 0.82rem; line-height: 1.6; }

.vb-unverified { background: var(--amber-light); border: 1px solid #fde68a; }
.vb-unverified .vb-icon { background: #fef3c7; color: var(--amber); }
.vb-unverified .vb-title { color: var(--amber); }
.vb-unverified .vb-desc  { color: #92400e; }

.vb-pending { background: #eff6ff; border: 1px solid #bfdbfe; }
.vb-pending .vb-icon { background: #dbeafe; color: #1d4ed8; }
.vb-pending .vb-title { color: #1d4ed8; }
.vb-pending .vb-desc  { color: #1e40af; }

.vb-approved { background: var(--green-light); border: 1px solid var(--green-mid); }
.vb-approved .vb-icon { background: #d1fae5; color: var(--green); }
.vb-approved .vb-title { color: var(--green); }
.vb-approved .vb-desc  { color: #064e3b; }

.vb-rejected { background: var(--red-light); border: 1px solid #fecaca; }
.vb-rejected .vb-icon { background: #fee2e2; color: var(--red); }
.vb-rejected .vb-title { color: var(--red); }
.vb-rejected .vb-desc  { color: #7f1d1d; }

/* ── User info widget ── */
.user-meta { display: flex; align-items: center; gap: 0.75rem; }
.user-avatar {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  background: var(--green-light);
  color: var(--green);
  font-weight: 700;
  font-size: 0.85rem;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.user-meta-text .name  { font-size: 0.875rem; font-weight: 600; color: var(--text); }
.user-meta-text .email { font-size: 0.78rem; color: var(--text-4); }

/* ── Aside illustration ── */
.aside-content { text-align: center; max-width: 380px; }
.aside-logo { height: 2.5rem; max-width: 18rem; object-fit: contain; margin-bottom: 2.5rem; }
.aside-headline {
  font-size: 1.65rem;
  font-weight: 740;
  color: var(--text);
  line-height: 1.25;
  letter-spacing: -0.02em;
  margin-bottom: 0.85rem;
}
.aside-sub { font-size: 0.9rem; color: var(--text-3); line-height: 1.7; margin-bottom: 2.25rem; }
.aside-features { list-style: none; text-align: left; display: flex; flex-direction: column; gap: 0.75rem; }
.aside-features li {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  font-size: 0.875rem;
  color: var(--text-2);
  line-height: 1.5;
}
.aside-features .dot {
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 50%;
  background: var(--green-light);
  color: var(--green);
  font-size: 0.65rem;
  font-weight: 800;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  margin-top: 1px;
}

/* ── Admin table ── */
.admin-wrap { max-width: 1200px; margin: 0 auto; padding: 2rem 1.5rem; }
.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.75rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--line);
}
.admin-header .logo img { height: 1.75rem; }

.table-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; }
table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
thead th {
  background: var(--bg);
  padding: 0.75rem 1rem;
  text-align: left;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-3);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
tbody td { padding: 0.85rem 1rem; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: var(--bg); }

.table-scroll-source {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.table-scroll-source::-webkit-scrollbar { display: none; }
.table-scroll-sync {
  width: 100%;
  height: 12px;
  overflow-x: auto;
  overflow-y: hidden;
  border-top: 1px solid var(--line-2);
  background: #f8faf9;
  scrollbar-color: #9fb4a7 transparent;
  scrollbar-width: thin;
}
.table-scroll-sync[hidden] { display: none; }
.table-scroll-sync:focus-visible {
  outline: 2px solid rgba(14, 122, 70, 0.22);
  outline-offset: 1px;
}
.table-scroll-sync::-webkit-scrollbar { height: 9px; }
.table-scroll-sync::-webkit-scrollbar-track { background: #f1f5f3; }
.table-scroll-sync::-webkit-scrollbar-thumb {
  border: 2px solid #f1f5f3;
  border-radius: 999px;
  background: #9fb4a7;
}
.table-scroll-sync::-webkit-scrollbar-thumb:hover { background: #789687; }
.table-scroll-sync-track { height: 1px; }

/* ── Modal ── */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(17,34,51,0.45);
  backdrop-filter: blur(3px);
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 1.5rem;
}
.modal {
  background: var(--surface);
  border-radius: var(--radius-xl);
  padding: 2rem;
  width: 100%;
  max-width: 480px;
  box-shadow: var(--shadow-lg);
  position: relative;
}
.modal-title { font-size: 1.1rem; font-weight: 700; margin-bottom: 0.25rem; }
.modal-sub { font-size: 0.85rem; color: var(--text-3); margin-bottom: 1.5rem; }
.modal-close {
  position: absolute;
  top: 1.25rem; right: 1.25rem;
  width: 2rem; height: 2rem;
  border: none; background: var(--bg-2);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 1rem;
  color: var(--text-3);
  display: grid; place-items: center;
}
.modal-close:hover { background: var(--line); color: var(--text); }

/* ── CloudTokenX design-system selector ── */
.ds-select {
  position: relative;
  display: block;
  width: 100%;
  min-width: 0;
  color: var(--text);
  font-size: 0.84rem;
}
.ds-select-native {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  min-width: 1px !important;
  min-height: 1px !important;
  max-width: 1px !important;
  max-height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
  border: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
}
.ds-select-trigger {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  min-height: 2.45rem;
  padding: 0.5rem 0.72rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text-2);
  font: inherit;
  line-height: 1.35;
  text-align: left;
  cursor: pointer;
  outline: none;
  transition: border-color 150ms ease, box-shadow 150ms ease, background-color 150ms ease;
}
.ds-select-value {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ds-select-chevron {
  width: 0.48rem;
  height: 0.48rem;
  flex: 0 0 auto;
  margin: -0.2rem 0.15rem 0 0;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  color: var(--text-4);
  transform: rotate(45deg);
  transition: transform 150ms ease;
}
.ds-select-trigger:hover { border-color: #b8ccc0; }
.ds-select-trigger:focus-visible,
.ds-select.is-open .ds-select-trigger {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(14, 122, 70, 0.1);
}
.ds-select.is-open .ds-select-chevron {
  margin-top: 0.22rem;
  transform: rotate(225deg);
}
.ds-select.is-placeholder .ds-select-value { color: var(--text-4); }
.ds-select.is-disabled .ds-select-trigger,
.ds-select-trigger:disabled {
  border-color: var(--line-2);
  background: var(--bg);
  color: var(--text-4);
  cursor: not-allowed;
}
.ds-select.is-invalid .ds-select-trigger {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.08);
}
.ds-select-error {
  display: block;
  margin-top: 0.35rem;
  color: var(--red);
  font-size: 0.76rem;
  line-height: 1.4;
}
.ds-select-error[hidden] { display: none; }
.ds-select[data-variant="status"] .ds-select-trigger::before {
  content: '';
  width: 0.48rem;
  height: 0.48rem;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--text-4);
}
.ds-select[data-variant="status"][data-status="all"] .ds-select-trigger::before { background: #708196; }
.ds-select[data-variant="status"][data-status="positive"] .ds-select-trigger::before { background: var(--green); }
.ds-select[data-variant="status"][data-status="pending"] .ds-select-trigger::before { background: var(--amber); }
.ds-select[data-variant="status"][data-status="negative"] .ds-select-trigger::before { background: var(--red); }

.ds-select-popover {
  position: fixed;
  z-index: 1000;
  max-height: min(21rem, calc(100dvh - 1rem));
  padding: 0.38rem;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 14px 34px rgba(21, 42, 31, 0.14), 0 2px 8px rgba(21, 42, 31, 0.06);
}
.ds-select-popover[hidden] { display: none; }
.ds-select-search {
  width: 100%;
  min-height: 2.35rem;
  padding: 0.48rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #f8faf9;
  color: var(--text);
  font: inherit;
  outline: none;
}
.ds-select-search:focus {
  border-color: var(--green);
  background: var(--surface);
  box-shadow: 0 0 0 3px rgba(14, 122, 70, 0.08);
}
.ds-select-options {
  max-height: 16.5rem;
  margin-top: 0.2rem;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: #b9c9bf transparent;
}
.ds-select-option {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  width: 100%;
  min-height: 2.35rem;
  padding: 0.48rem 0.6rem;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--text-2);
  font: inherit;
  line-height: 1.4;
  text-align: left;
  cursor: pointer;
}
.ds-select-option[hidden] { display: none; }
.ds-select-option:hover,
.ds-select-option.is-active {
  background: var(--green-light);
  color: var(--green-hover);
}
.ds-select-option.is-selected {
  color: var(--green);
  font-weight: 680;
}
.ds-select-option:disabled {
  color: var(--text-4);
  cursor: not-allowed;
  opacity: 0.65;
}
.ds-select-option-label {
  min-width: 0;
  flex: 1;
  overflow-wrap: anywhere;
}
.ds-select-option-check {
  width: 0.78rem;
  flex: 0 0 auto;
  color: var(--green);
  font-weight: 800;
}
.ds-select-option.is-selected .ds-select-option-check::before { content: '\2713'; }
.ds-select-status-dot {
  width: 0.48rem;
  height: 0.48rem;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--text-4);
}
.ds-select-status-dot.is-all { background: #708196; }
.ds-select-status-dot.is-positive { background: var(--green); }
.ds-select-status-dot.is-pending { background: var(--amber); }
.ds-select-status-dot.is-negative { background: var(--red); }
.ds-select-empty {
  padding: 0.8rem 0.65rem;
  color: var(--text-4);
  text-align: center;
}

.filter-bar > .ds-select { flex: 0 1 15rem; }
.filter-bar .ds-select-trigger { min-height: 2.35rem; }

.ds-toast-viewport {
  position: fixed;
  right: clamp(1rem, 2vw, 1.5rem);
  bottom: clamp(1rem, 2vw, 1.5rem);
  z-index: 1300;
  display: grid;
  gap: 0.65rem;
  width: min(24rem, calc(100vw - 2rem));
  pointer-events: none;
}
.ds-toast {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.28rem 0.85rem;
  padding: 0.85rem 0.9rem;
  border: 1px solid var(--line);
  border-left: 3px solid var(--green);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 18px 44px rgba(21, 42, 31, 0.16), 0 2px 8px rgba(21, 42, 31, 0.06);
  color: var(--text);
  pointer-events: auto;
  transform: translateY(0);
  transition: opacity 160ms ease, transform 160ms ease;
}
.ds-toast.is-leaving {
  opacity: 0;
  transform: translateY(0.35rem);
}
.ds-toast.is-error {
  border-left-color: var(--red);
}
.ds-toast.is-success {
  border-left-color: var(--green);
}
.ds-toast-title {
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 760;
  line-height: 1.35;
}
.ds-toast-body {
  grid-column: 1 / 2;
  color: var(--text-3);
  font-size: 0.78rem;
  line-height: 1.55;
  overflow-wrap: anywhere;
}
.ds-toast-close {
  grid-row: 1 / span 2;
  grid-column: 2 / 3;
  width: 1.6rem;
  height: 1.6rem;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--text-4);
  font-size: 1.05rem;
  line-height: 1;
  cursor: pointer;
}
.ds-toast-close:hover {
  background: var(--line-2);
  color: var(--text);
}

.ds-feedback-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1250;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(12, 24, 18, 0.28);
  backdrop-filter: blur(4px);
}
.ds-feedback-dialog {
  width: min(30rem, 100%);
  padding: 1.25rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: 0 24px 70px rgba(21, 42, 31, 0.2), 0 8px 24px rgba(21, 42, 31, 0.08);
}
.ds-feedback-title {
  margin: 0;
  color: var(--text);
  font-size: 1rem;
  font-weight: 760;
  line-height: 1.35;
}
.ds-feedback-description {
  margin: 0.35rem 0 0.9rem;
  color: var(--text-3);
  font-size: 0.82rem;
  line-height: 1.65;
}
.ds-feedback-input {
  width: 100%;
  min-height: 2.5rem;
  padding: 0.58rem 0.72rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  outline: none;
  resize: vertical;
}
.ds-feedback-input:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(14, 122, 70, 0.08);
}
.ds-feedback-input[aria-invalid="true"] {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.08);
}
.ds-feedback-error {
  margin-top: 0.4rem;
  color: var(--red);
  font-size: 0.76rem;
}
.ds-feedback-error[hidden] { display: none; }
.ds-feedback-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.55rem;
  margin-top: 1rem;
}
.field-row > .ds-select,
.support-field > .ds-select,
.invitation-form > .ds-select { align-self: stretch; }
.analysis-toolbar .ds-select-trigger {
  min-height: 2.15rem;
  padding: 0.38rem 0.62rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
}
.cdn-pricing-policy-form .ds-select { height: 2.35rem; }
.cdn-pricing-policy-form .ds-select-trigger { min-height: 2.35rem; }
.cdn-pricing-policy-form .ds-select.pricing-customer,
.cdn-pricing-policy-form .ds-select.pricing-provider { grid-column: span 6; }
.cdn-dispatch-fields label > .ds-select { margin-top: 0; }

@media (max-width: 700px) {
  .cdn-pricing-policy-form .ds-select.pricing-customer,
  .cdn-pricing-policy-form .ds-select.pricing-provider { grid-column: 1; }
}

/* ── Checkbox toggle (product open/close) ── */
.toggle { position: relative; display: inline-flex; align-items: center; gap: 0.5rem; cursor: pointer; }
.toggle input { position: absolute; opacity: 0; width: 0; height: 0; }
.toggle-track {
  width: 2.25rem; height: 1.25rem;
  background: var(--line);
  border-radius: 100px;
  transition: background 0.2s;
  position: relative;
}
.toggle input:checked ~ .toggle-track { background: var(--green); }
.toggle-thumb {
  position: absolute;
  top: 2px; left: 2px;
  width: 1rem; height: 1rem;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
  transition: left 0.18s;
}
.toggle input:checked ~ .toggle-track .toggle-thumb { left: calc(100% - 1.125rem); }
.toggle-label { font-size: 0.82rem; color: var(--text-2); font-weight: 500; }

/* ── Spinner ── */
@keyframes spin { to { transform: rotate(360deg); } }
.spinner {
  width: 1.1rem; height: 1.1rem;
  border: 2px solid rgba(255,255,255,0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  flex-shrink: 0;
}
.spinner-dark {
  border-color: rgba(14,122,70,0.25);
  border-top-color: var(--green);
}

/* ── Responsive ── */
@media (max-width: 640px) {
  .auth-panel-body { padding: 1.75rem 1.25rem 2.5rem; }
  .auth-panel-header { padding: 1.5rem 1.25rem 0; }
  .auth-panel-footer { padding: 1rem 1.25rem; }
  .admin-wrap { padding: 1rem; }
  table { font-size: 0.78rem; }
  thead th, tbody td { padding: 0.6rem 0.75rem; }
}

@media (max-width: 959px) {
  .auth-panel-body {
    justify-content: flex-start;
    padding-top: 3rem;
  }
}
