/* Clarity front-end design for enterprise shortcodes */
.cds {
  --cds-color-bg: #f8fafc;
  --cds-color-surface: #ffffff;
  --cds-color-surface-2: #f1f5f9;
  --cds-color-text: #0f172a;
  --cds-color-muted: #64748b;
  --cds-color-border: #d1d9e6;
  --cds-color-brand: #2563eb;
  --cds-color-brand-600: #1d4ed8;
  --cds-color-success: #0f9d58;
  --cds-color-warning: #f59e0b;
  --cds-color-danger: #dc2626;
  --cds-color-focus: #1e90ff;
  --cds-color-badge: #eff6ff;
  --cds-color-badge-fg: #1d4ed8;
  --cds-font: 'Inter', system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, Cantarell, Arial, "Helvetica Neue", sans-serif;
  --cds-font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Courier New", monospace;
  --cds-line: 1.5;
  --cds-radius: 14px;
  --cds-shadow: 0 14px 35px rgba(15, 23, 42, 0.12);
  --cds-space-1: .25rem;
  --cds-space-2: .5rem;
  --cds-space-3: .75rem;
  --cds-space-4: 1rem;
  --cds-space-5: 1.5rem;
  --cds-pad: 18px;
  --cds-gap: 22px;
}

.cds[data-density="compact"] {
  --cds-radius: 10px;
  --cds-pad: 14px;
  --cds-gap: 18px;
}

@media (prefers-color-scheme: dark) {
  .cds {
    --cds-color-bg: #0f172a;
    --cds-color-surface: #111827;
    --cds-color-surface-2: #1f2937;
    --cds-color-text: #f8fafc;
    --cds-color-muted: #94a3b8;
    --cds-color-border: #334155;
    --cds-color-badge: #1e293b;
    --cds-color-badge-fg: #bfdbfe;
    --cds-shadow: none;
  }
}

.cds, .cds * {
  box-sizing: border-box;
}

.cds {
  font-family: var(--cds-font);
  line-height: var(--cds-line);
  color: var(--cds-color-text);
  background: var(--cds-color-bg);
}

.cds a {
  color: var(--cds-color-brand);
}

.cds :focus {
  outline: 2px solid var(--cds-color-focus);
  outline-offset: 2px;
}

.cds h1, .cds h2, .cds h3 {
  margin: 0 0 var(--cds-space-3);
  font-weight: 700;
}

.cds h1 { font-size: 2rem; }
.cds h2 { font-size: 1.5rem; }
.cds h3 { font-size: 1.125rem; }

.cds .muted {
  color: var(--cds-color-muted);
}

/* Cards */
.cds .card {
  background: var(--cds-color-surface);
  border-radius: var(--cds-radius);
  border: 1px solid rgba(148, 163, 184, 0.25);
  box-shadow: var(--cds-shadow);
  overflow: hidden;
}

.cds .card-h {
  padding: calc(var(--cds-pad) - 2px) var(--cds-pad);
  border-bottom: 1px solid var(--cds-color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--cds-color-surface-2);
}

.cds .card-b {
  padding: var(--cds-pad);
}

.cds .card-actions {
  margin-top: var(--cds-space-4);
  display: flex;
  justify-content: flex-end;
}

/* Buttons */
.cds .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 999px;
  padding: 10px 18px;
  border: 1px solid transparent;
  font-weight: 600;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease;
}

.cds .btn.primary {
  background: linear-gradient(135deg, var(--cds-color-brand), var(--cds-color-brand-600));
  color: #fff;
  box-shadow: 0 10px 20px rgba(37, 99, 235, 0.25);
}
.cds .btn.primary:hover {
  background: linear-gradient(135deg, #3b82f6, var(--cds-color-brand));
  box-shadow: 0 14px 28px rgba(37, 99, 235, 0.28);
}

.cds .btn.secondary {
  background: var(--cds-color-surface-2);
  border-color: var(--cds-color-border);
}

.cds .btn.ghost {
  background: transparent;
  border-color: var(--cds-color-border);
  color: inherit;
}

.cds .btn.sm {
  padding: 8px 14px;
  font-size: .9rem;
}

.cds .btn:active {
  transform: translateY(1px);
}

/* Alerts */
.cds .alert {
  border-radius: var(--cds-radius);
  border: 1px solid rgba(220, 38, 38, 0.2);
  background: rgba(254, 226, 226, 0.6);
  padding: var(--cds-pad);
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: 0 8px 16px rgba(220, 38, 38, 0.08);
}

.cds .alert[data-variant="danger"] {
  border-color: rgba(220, 38, 38, 0.35);
  background: rgba(254, 226, 226, 0.85);
}

.cds .alert[data-variant="success"] {
  border-color: rgba(15, 157, 88, 0.35);
  background: rgba(187, 247, 208, 0.75);
}

.cds .alert ul {
  margin: 0;
  padding-left: 20px;
}

/* Badges */
.cds .badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 999px;
  font-weight: 600;
  font-size: .85rem;
  border: 1px solid var(--cds-color-border);
  background: var(--cds-color-badge);
  color: var(--cds-color-badge-fg);
}

.cds .badge-info {
  background: rgba(37, 99, 235, 0.08);
  color: var(--cds-color-brand);
}

/* Form fields */
.cds .field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cds .field.field-color .color-control {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.cds .field.field-color .color-control > input.modern-input,
.cds .field.field-color .color-control > input[type="text"] {
  flex: 1 1 220px;
  min-width: 180px;
}

.cds .field.field-color .wp-picker-container {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.cds .field.field-color .wp-picker-input-wrap input[type="text"] {
  flex: 1 1 160px;
  min-width: 140px;
}

.cds .acp-color-fallback {
  width: 40px;
  min-width: 40px;
  height: 45px;
  padding: 0;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

.cds .acp-color-fallback::-webkit-color-swatch,
.cds .acp-color-fallback::-moz-color-swatch {
  border: 1px solid var(--cds-color-border);
  border-radius: 4px;
}

.cds .field-grid {
  display: grid;
  gap: var(--cds-gap);
}

.cds .inline-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
  align-items: center;
  width: 100%;
}

@media (min-width: 768px) {
  .cds .field-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .cds .field-grid .field--full {
    grid-column: span 2;
  }
}

.cds label {
  font-weight: 600;
  color: var(--cds-color-text);
}

.cds input.modern-input,
.cds select.modern-input,
.cds textarea.modern-input,
.cds .modern-input {
  width: 100%;
  border-radius: 10px;
  border: 1px solid var(--cds-color-border);
  background: var(--cds-color-surface);
  padding: 10px 14px;
  font: inherit;
  color: inherit;
  transition: border-color .15s ease, box-shadow .15s ease;
}

.cds .modern-input:focus {
  border-color: var(--cds-color-brand);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.cds .field-help,
.cds .hint {
  font-size: .85rem;
  color: var(--cds-color-muted);
}

.cds .field.checkbox {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--cds-radius);
  border: 1px solid var(--cds-color-border);
  background: var(--cds-color-surface-2);
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}

.cds .field.checkbox:hover {
  border-color: var(--cds-color-brand);
}

.cds .field.checkbox:focus-within {
  border-color: var(--cds-color-brand);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.cds .field-toggle__control {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: start;
  gap: 12px;
}

.cds .field-toggle__checkbox {
  margin: 2px 0 0;
  width: 18px;
  height: 18px;
  accent-color: var(--cds-color-brand);
}

.cds .field-toggle__label {
  margin: 0;
  font-weight: 600;
  line-height: 1.45;
  cursor: pointer;
  color: var(--cds-color-text);
}

.cds .field-toggle__preview {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.cds .field-toggle__preview-label {
  font-size: .9rem;
  color: var(--cds-color-muted);
  font-weight: 500;
}

.cds .field-toggle__preview-btn {
  pointer-events: none;
  background: var(--preview-color, var(--cds-color-brand));
  border-color: var(--preview-color, var(--cds-color-brand));
  color: var(--preview-contrast, #ffffff);
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.08);
  transition: background .2s ease, border-color .2s ease, color .2s ease;
}
.cds .field-toggle__preview-btn:hover {
  filter: brightness(1.08);
}

/* Registration layout */
.enterprise-register {
  max-width: 680px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: var(--cds-gap);
  padding: 40px 16px 60px;
}

.register-hero {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.08), rgba(129, 140, 248, 0.1));
  border: 1px solid rgba(37, 99, 235, 0.25);
  box-shadow: 0 20px 45px rgba(37, 99, 235, 0.18);
}

.hero-stack {
  display: flex;
  align-items: center;
  gap: 18px;
}

.hero-icon {
  width: 64px;
  height: 64px;
  border-radius: 20px;
  background: rgba(37, 99, 235, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--cds-color-brand);
}

.hero-icon svg {
  width: 36px;
  height: 36px;
}

/* Enterprise dashboard */
.acp-enterprise-dashboard {
  display: flex;
  flex-direction: column;
  gap: var(--cds-gap);
  padding: 40px 16px 80px;
  background-color: #ffffff;
}

.enterprise-settings {
  display: flex;
  flex-direction: column;
  gap: var(--cds-gap);
}

.field-upload {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

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

.logo-preview {
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-preview img {
  max-height: 64px;
  border-radius: 10px;
  border: 1px solid var(--cds-color-border);
  padding: 6px;
  background: var(--cds-color-surface);
}

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

.table-scroll table {
  width: 100%;
  border-collapse: collapse;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--cds-color-border);
  background: var(--cds-color-surface);
  min-width: 640px;
}

#acp-platforms-table td:first-child input[type="text"] {
  max-width: 160px;
}

.table-scroll thead {
  background: var(--cds-color-surface-2);
}

.table-scroll th,
.table-scroll td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--cds-color-border);
}

.table-scroll tbody tr:hover {
  background: rgba(15, 23, 42, 0.04);
}

.platform-link .acp-url-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--cds-color-border);
  background: var(--cds-color-surface-2);
  color: var(--cds-color-brand);
  transition: background-color .15s, color .15s, border-color .15s;
}

.platform-link .acp-url-icon .acp-url-icon-symbol {
  display: inline-flex;
  width: 16px;
  height: 16px;
  line-height: 1;
}

.platform-link .acp-url-icon .acp-url-icon-symbol svg {
  width: 100%;
  height: 100%;
}

.platform-link .acp-url-icon:hover,
.platform-link .acp-url-icon:focus-visible {
  background: var(--cds-color-brand);
  border-color: var(--cds-color-brand-600);
  color: #fff;
}

.platform-link .acp-url-icon.disabled,
.platform-link .acp-url-icon[disabled] {
  color: var(--cds-color-muted);
  background: var(--cds-color-surface-2);
  border-color: var(--cds-color-border);
  cursor: not-allowed;
  opacity: .6;
}

.platform-link .acp-url-icon.disabled:hover,
.platform-link .acp-url-icon.disabled:focus-visible,
.platform-link .acp-url-icon[disabled]:hover,
.platform-link .acp-url-icon[disabled]:focus-visible {
  color: var(--cds-color-muted);
  background: var(--cds-color-surface-2);
  border-color: var(--cds-color-border);
}

.form-link {
  padding-bottom: 8px;
}

#acp-platforms-table th.col-platform,
#acp-platforms-table td.col-platform {
  max-width: 150px;
}

#acp-platforms-table th.col-link,
#acp-platforms-table td.col-link {
  width: 400px;
  max-width: 400px !important;
}

#acp-platforms-table td.col-link .inline-field {
  width: 100%;
  max-width: 400px;
}

#acp-platforms-table th.col-note,
#acp-platforms-table td.col-note {
  width: 100px;
  min-width: 100px;
  max-width: 100px;
}

#acp-platforms-table th.col-priority,
#acp-platforms-table td.col-priority {
  width: 100px;
  min-width: 100px;
  max-width: 100px;
}

#acp-platforms-table td.col-note input[type="number"],
#acp-platforms-table td.col-priority input[type="number"] {
  width: 100%;
}

.col-actions {
  width: 80px;
  text-align: right;
}

.qr-layout {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  align-items: center;
}

.qr-box {
  width: 140px;
  height: 140px;
  border: 1px solid var(--cds-color-border);
  border-radius: 16px;
  background: var(--cds-color-surface);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
}

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

@media (min-width: 640px) {
  .qr-actions {
    flex-direction: row;
  }
}

.stats-filter {
  display: flex;
  flex-direction: column;
  gap: var(--cds-space-3);
  margin-bottom: var(--cds-space-4);
}

.stats-filter .filter-grid {
  display: grid;
  gap: var(--cds-space-3);
}

@media (min-width: 720px) {
  .stats-filter .filter-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    align-items: end;
  }

  .stats-filter .filter-grid .btn {
    justify-self: flex-end;
  }
}

.platform-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.platform-cell img {
  width: 28px;
  height: 28px;
  object-fit: contain;
  border-radius: 50%;
  border: 1px solid var(--cds-color-border);
  background: var(--cds-color-surface);
}

/* Legacy notice support */
.cds .acp-notice {
  margin: 0;
}

.cds .acp-notice-success {
  border-color: rgba(15, 157, 88, 0.35);
  background: rgba(187, 247, 208, 0.75);
}

.cds .acp-notice-error {
  border-color: rgba(220, 38, 38, 0.35);
  background: rgba(254, 202, 202, 0.8);
}

/* Modern form adjustments */
.modern-form .field-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: var(--cds-color-surface-2);
  color: var(--cds-color-brand);
  margin-right: 8px;
}

.form-field .required-indicator {
  color: var(--cds-color-danger);
}

.form-actions {
  margin-top: var(--cds-space-4);
}

.form-footer {
  margin-top: var(--cds-space-3);
  font-size: .9rem;
  color: var(--cds-color-muted);
}

.form-footer a {
  font-weight: 600;
}

.password-strength-indicator {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.strength-meter {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: var(--cds-color-surface-2);
  overflow: hidden;
}

.strength-bar {
  height: 100%;
  width: 0;
  background: var(--cds-color-brand);
  transition: width .3s ease;
}

.strength-text {
  font-size: .85rem;
  color: var(--cds-color-muted);
}

/* Misc */
.acp-column-help { display: none; }

