/* The dark personal-center design mapped to the signed-in NOVA workspace. */
#nova-account {
  --workbench-ink: var(--ng-ink, #f5f4fb);
  --workbench-muted: var(--ng-soft, #c7c4d3);
  --workbench-accent: var(--ng-iris, #b8acff);
  --workbench-line: #403a50;
  --workspace-panel: #211d2b;
  --workspace-inset: #1a1722;
  --workspace-hover: #332a46;
  --workspace-purple: #6645f6;
  --workspace-purple-hover: #7154ee;
  --workspace-yellow: var(--ng-yellow, #ffda68);
  --workspace-green: #9ee6b9;
  --workspace-green-surface: #19342b;
  --workspace-warning: #ffda91;
  --workspace-warning-surface: #382d20;
  --workspace-danger: #ffb3c0;
  --workspace-danger-surface: #442534;
  --workspace-shadow: 0 18px 46px #08060f4d;
  color: var(--workbench-ink);
  color-scheme: dark;
}

body[data-page="login"] #nova-account,
body[data-page="account"] #nova-account {
  background: radial-gradient(ellipse at 75% 0%, #30263f 0, transparent 47rem), var(--ng-base, #0d0c12);
}

#nova-account .account-panel {
  background: linear-gradient(155deg, #302a40, var(--workspace-panel) 60%);
  border-color: var(--workbench-line);
  border-radius: 24px;
  color: var(--workbench-ink);
  box-shadow: var(--workspace-shadow);
}

#nova-account .account-panel p { color: var(--workbench-muted); }

#nova-account .workbench {
  --workbench-ink: var(--ng-ink, #f5f4fb);
  --workbench-muted: var(--ng-soft, #c7c4d3);
  --workbench-accent: var(--ng-iris, #b8acff);
  --workbench-line: #403a50;
  width: min(100%, 1440px);
  gap: clamp(20px, 3vw, 52px);
}

#nova-account .workbench-sidebar {
  position: sticky;
  top: 106px;
  max-height: calc(100svh - 126px);
  overflow: auto;
  padding: 16px 12px;
  background: linear-gradient(160deg, #302a40, #1c1925 66%);
  border-radius: 24px;
}

#nova-account .workbench-sidebar p {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-block: 4px 14px;
  color: var(--workbench-ink) !important;
  font-size: 1rem;
}

#nova-account .workbench-sidebar p::before {
  content: "";
  flex: 0 0 27px;
  height: 27px;
  border-radius: 9px;
  background: #e7e9eb url("../assets/images/nova-favicon.png") center / 21px no-repeat;
}

#nova-account .workbench-sidebar a,
#nova-account .workbench-sidebar .workbench-menu-group-title {
  border-radius: 14px;
  color: var(--workbench-muted);
}

#nova-account .workbench-sidebar a:hover,
#nova-account .workbench-sidebar .workbench-menu-group-title:hover,
#nova-account .workbench-sidebar .workbench-menu-group[data-active="true"] > summary {
  background: var(--workspace-hover);
  color: var(--workbench-ink);
}

#nova-account .workbench-sidebar a[aria-current="page"] {
  background: var(--workspace-purple);
  color: #fff;
}

#nova-account .workbench-heading h1 {
  font-size: clamp(1.9rem, 3.15vw, 3.25rem);
  font-weight: 680;
  letter-spacing: -.045em;
}

#nova-account :is(.workbench-summary > a, .workbench-panel) {
  background: var(--workspace-panel);
  border-color: var(--workbench-line);
  border-radius: 22px;
  color: var(--workbench-ink);
}

#nova-account .workbench-summary > a {
  background: radial-gradient(ellipse at 92% 0%, #7354bf3b, transparent 68%), linear-gradient(125deg, #211c30, #302541);
}

#nova-account .workbench-summary > a:hover { border-color: var(--workbench-accent); }
#nova-account .workbench-summary strong { color: var(--workspace-yellow); }
#nova-account .workbench-summary a:nth-child(2) strong { color: var(--workspace-green); }
#nova-account .workbench-summary a:nth-child(3) strong { color: var(--workbench-accent); }

#nova-account :is(.workbench-button, .workbench-filter-control) {
  border-color: var(--workbench-line);
  background-color: var(--workspace-inset);
  color: var(--workbench-ink);
}

#nova-account .workbench-button:not(:disabled):hover { background-color: var(--workspace-hover); }

#nova-account :is(.workbench-primary, .workbench-button.primary),
#nova-account .bot-ops-navigation button[aria-pressed="true"] {
  border-color: var(--workspace-purple);
  background-color: var(--workspace-purple);
  color: #fff;
}

#nova-account :is(.workbench-primary, .workbench-button.primary):not(:disabled):hover,
#nova-account .bot-ops-navigation button[aria-pressed="true"]:not(:disabled):hover {
  border-color: var(--workspace-purple-hover);
  background-color: var(--workspace-purple-hover);
}

#nova-account .workbench-danger {
  color: var(--workspace-danger);
  border-color: #654052;
}

#nova-account .workbench-danger:not(:disabled):hover { background-color: var(--workspace-danger-surface); }

#nova-account .workbench-danger-primary {
  border-color: #a64864;
  background-color: #a64864;
  color: #fff;
}

#nova-account .workbench-danger-primary:not(:disabled):hover { background-color: #b85473; }

#nova-account :is(.workbench-tasks a:hover, .workbench-filter-options li:is(:hover, [data-active="true"]),
  .workbench-tabs button[aria-pressed="true"], .workbench-media-actions button:enabled:is(:hover, [data-active="true"])) {
  background: var(--workspace-hover);
  color: var(--workbench-accent);
}

#nova-account :is(.workbench-editor, .workbench-profile-form, .workbench-identity-actions,
  .workbench-confirm-summary, .workbench-application-table th) {
  background: var(--workspace-inset);
}

#nova-account .workbench-dialog-editor { background: transparent; }

#nova-account :is(.workbench-confirm, .bot-dialog)[open] {
  border-color: var(--workbench-line) !important;
  background: var(--workspace-panel) !important;
  box-shadow: var(--workspace-shadow) !important;
  color: var(--workbench-ink);
}

#nova-account :is(.workbench-filter-options, .bot-workspace .bot-more > .bot-actions,
  .bot-workspace nav.bot-section-navigation .bot-section-list) {
  border-color: var(--workbench-line);
  background: #2b2538;
  box-shadow: var(--workspace-shadow);
}

#nova-account :is(.workbench-fields, .bot-workspace, .bot-dialog) :is(input:not([type="checkbox"], [type="radio"]), select, textarea) {
  background-color: var(--workspace-inset) !important;
  border-color: var(--workbench-line) !important;
  color: var(--workbench-ink) !important;
}

#nova-account :is(.workbench-fields, .bot-workspace, .bot-dialog) :is(input, select, textarea):focus-visible,
#nova-account .workbench-filter-control:is(:focus-visible, [aria-expanded="true"]) {
  outline: 2px solid var(--workbench-accent);
  outline-offset: 2px;
}

#nova-account :is(.workbench-fields, .bot-workspace, .bot-dialog) [aria-invalid="true"] {
  border-color: var(--workspace-danger) !important;
}

#nova-account .workbench-filter-control,
#nova-account :is(.bot-workspace, .bot-dialog) select:not([multiple]) {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='m4 6 4 4 4-4' fill='none' stroke='%23d3cbe8' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

#nova-account :is(.workbench-fields, .bot-workspace, .bot-dialog) :is(input, select, textarea):disabled { opacity: .6; }
#nova-account :is(input[type="checkbox"], input[type="radio"]) { accent-color: var(--workspace-purple); }

#nova-account :is(.workbench-identity-avatar, .workbench-status, .bot-status, .bot-current-symbol, .bot-group-selection,
  .bot-binding-dialog .bot-binding-symbol, .bot-binding-dialog .bot-binding-avatar, .bot-platform-notice,
  .bot-section-subnav button[aria-pressed="true"], .wa-group-tabs button[aria-pressed="true"]) {
  background: var(--workspace-hover);
  border-color: var(--workbench-line);
  color: var(--workbench-accent);
}

#nova-account :is(.workbench-notice, .workbench-status[data-status="resolved"],
  .bot-status:is([data-state="active"], [data-state="ready"], [data-state="verified"], [data-state="applied"],
  [data-state="enabled"], [data-state="succeeded"], [data-state="success"])) {
  background: var(--workspace-green-surface);
  color: var(--workspace-green) !important;
}

#nova-account :is(.workbench-notice[data-error="true"], .bot-feedback.bot-error,
  .bot-status:is([data-state="failed"], [data-state="credential_invalid"], [data-state="revoked"],
  [data-state="transport_conflict"], [data-state="execution_conflict"])) {
  background: var(--workspace-danger-surface);
  color: var(--workspace-danger) !important;
}

#nova-account :is(.form-error, .bot-error) { color: var(--workspace-danger) !important; }

#nova-account :is(.bot-warning, .bot-connection-takeover,
  .bot-status:is([data-state="pending"], [data-state="running"], [data-state="queued"], [data-state="unknown"],
  [data-state="setup_only"], [data-state="partial"])) {
  background: var(--workspace-warning-surface);
  border-color: #63503a;
  color: var(--workspace-warning) !important;
}

#nova-account :is(.bot-warning, .bot-connection-takeover) p { color: var(--workspace-warning) !important; }

#nova-account :is(.bot-panel, .bot-workspace .bot-section-empty, .bot-workspace .bot-overview-stats > .bot-overview-metric,
  .bot-manager-toolbar, .bot-workspace-toolbar, .bot-stat-grid > div, .bot-overview-metric, .bot-broadcast-message,
  .bot-broadcast-submit, .bot-flow-row, .bot-group-toolbar, .bot-progress) {
  background: var(--workspace-panel);
  border-color: var(--workbench-line);
}

#nova-account :is(.bot-workspace .bot-workspace-toolbar .bot-manager-toolbar, .bot-diagnostics-table tbody th) { background: transparent; }

#nova-account :is(.bot-feedback:not(.bot-error), .bot-module[open] > summary, .bot-table thead th, .bot-confirm-summary,
  .bot-preview-result, .bot-binding-footer, .bot-binding-account, .bot-groups-authorization-hint, .bot-ops-targets,
  .bot-broadcast-formatting, .bot-broadcast-preview, .bot-broadcast-button-row, .bot-broadcast-editable[contenteditable="false"],
  .bot-broadcast-message-text :is(pre, code), .bot-broadcast-preview-media :is(img, video), .bot-broadcast-document) {
  background: var(--workspace-inset);
  border-color: var(--workbench-line);
}

#nova-account :is(.bot-module, .bot-reply, .bot-message-preview, .bot-table th, .bot-table td, .bot-sync-targets, .bot-dialog-footer,
  .bot-broadcast-form-section, .bot-broadcast-rich-editor, .bot-broadcast-attachments > li, .bot-broadcast-target-controls,
  .bot-broadcast-target, .bot-broadcast-message-buttons > button, .bot-ops-confirm > div, .bot-ops-delivery, .bot-ops-template-list > div,
  .bot-ops-diff > div, .bot-ops-value-list > div, .bot-ops-poll-results > li, .bot-section-group-links > div, .bot-section-faq details) {
  border-color: var(--workbench-line);
}

#nova-account :is(.bot-broadcast-rich-editor, .bot-more > summary, .bot-broadcast-message-buttons > button) {
  border-color: var(--workbench-line);
  background-color: var(--workspace-inset);
  color: var(--workbench-accent);
}

#nova-account :is(.bot-table thead th, .bot-table td small, .bot-stat-grid span, .bot-confirm-summary span, .bot-confirm-summary small,
  .bot-detail-list dt, .bot-binding-body p, .bot-binding-account :is(span, small), .bot-ops-targets > small, .bot-ops-confirm dt,
  .bot-ops-value-list dt, .bot-broadcast-target small, .bot-dialog-close, .bot-binding-close, .bot-broadcast-formatting > button) {
  color: var(--workbench-muted);
}

#nova-account :is(.bot-binding-header h2, .bot-connection-body .bot-field, .bot-broadcast-message-text) { color: var(--workbench-ink); }

#nova-account :is(.bot-dialog .workbench-link, .bot-broadcast-submit strong, .bot-broadcast-document,
  .bot-broadcast-editable a, .bot-broadcast-message-text a),
#nova-account .bot-module summary::before {
  color: var(--workbench-accent);
}

#nova-account :is(.bot-more[open] > summary, .bot-dialog-close:hover, .bot-binding-close:hover, .bot-broadcast-formatting > button:hover,
  .bot-broadcast-target:has(input:checked), .bot-section-groups tr[data-selected="true"] td, .bot-registry-table tr[data-selected="true"] td,
  .bot-workspace nav.bot-section-navigation .bot-section-list .bot-section-item:is(:hover, [aria-current="page"])) {
  background: var(--workspace-hover);
  border-color: var(--workbench-line);
  color: var(--workbench-ink);
}

/* Keep QR backgrounds white so scanner contrast is independent of the theme. */
#nova-account #whatsapp-pairing-dialog img { background-color: #fff; }

@media (min-width: 761px) {
  #nova-account .workbench { grid-template-columns: clamp(185px, 16vw, 224px) minmax(0, 1fr); }
}

@media (max-width: 760px) {
  #nova-account .workbench { gap: 20px; }
  #nova-account .workbench-sidebar {
    position: static;
    max-height: none;
    border-radius: 17px;
  }
  #nova-account .workbench-sidebar nav { padding-top: 8px; border-top: 1px solid var(--workbench-line); }
  #nova-account :is(.workbench-summary > a, .workbench-panel) { border-radius: 17px; }
}
