/* Components owned by individual console pages share the console shell's tokens. */

/* Dashboard and inventory */
body:is(.sharedroid-console, .sharedroid-admin) :is(
  .dashboard-id-strip, .device-dashboard-card, .fleet-location-panel, .insight-panel,
  .status-card, .detail-panel, .location-view-modal, .screen-view-modal, .history-view-modal
) {
  background: var(--sd-surface);
  border: 1px solid var(--sd-border);
  border-radius: var(--sd-card-radius);
  box-shadow: var(--sd-shadow-sm);
}

body:is(.sharedroid-console, .sharedroid-admin) :is(
  .dashboard-id-strip, .device-setup-card
) {
  background: linear-gradient(145deg, var(--sd-surface) 30%, #eef5f5 100%) !important;
}

body:is(.sharedroid-console, .sharedroid-admin) :is(
  .panel-heading, .insight-header, .fleet-location-header, .screen-view-header,
  .console-section-header, .pagination-bar
) {
  background: var(--sd-surface-2);
  border-color: var(--sd-border);
}

body:is(.sharedroid-console, .sharedroid-admin) :is(
  .panel-heading h2, .panel-heading h3, .panel-header h2, .insight-title,
  .fleet-location-header h2, .screen-view-title, .detail-header h3,
  .console-section-header h4
) {
  color: var(--sd-ink);
  font-weight: 690;
  letter-spacing: -.024em;
  text-transform: none;
}

body:is(.sharedroid-console, .sharedroid-admin) :is(
  .dashboard-eyebrow, .selected-device-kicker, .status-label,
  .insight-total span, .history-last-user-label
) {
  color: var(--sd-green-700);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .09em;
}

body:is(.sharedroid-console, .sharedroid-admin) :is(
  .stat-value, .metric-tile strong, .activity-summary-item strong,
  .fleet-status strong, .insight-total, .mini-stat strong, .console-card strong
) {
  color: var(--sd-ink);
  font-weight: 690;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.035em;
}

body:is(.sharedroid-console, .sharedroid-admin) .stat-card::after {
  content: none;
}

body:is(.sharedroid-console, .sharedroid-admin) :is(
  .device-id-panel, .activity-summary-item, .metric-tile, .readiness-row,
  .activity-item, .map-shell, .location-view-body, .screen-view-body, .history-view-body,
  .detail-stats, .device-id-code, .selected-actions-bar, .history-table-wrap
) {
  background: var(--sd-soft);
  border-color: var(--sd-border);
}

body:is(.sharedroid-console, .sharedroid-admin) :is(
  .device-id-code, .status-value, .device-name, .selected-device-name, .row-title,
  .setup-title strong, .profile-card-title, .app-clear-title, .app-result-title
) {
  color: var(--sd-ink);
}

body:is(.sharedroid-console, .sharedroid-admin) :is(
  .dashboard-last-updated, .status-detail, .map-zoom-label, .choice span, .help,
  .switch-row span, .setup-line p, .sign-in-journey-copy span, .sign-in-layout-option span,
  .row-meta, .device-meta, .setup-title span, .setup-caption
) {
  color: var(--sd-muted);
}

body:is(.sharedroid-console, .sharedroid-admin) :is(.activity-bar-track, .activity-bar-fill) {
  border-radius: 5px 5px 0 0;
}

body:is(.sharedroid-console, .sharedroid-admin) .activity-bar-track {
  background: var(--sd-soft);
  box-shadow: inset 0 0 0 1px var(--sd-border);
}

body:is(.sharedroid-console, .sharedroid-admin) .activity-bar-fill {
  background: var(--sd-green-700);
}

body:is(.sharedroid-console, .sharedroid-admin) :is(
  .dashboard-refresh-btn, .pagination-btn, .pagination-number,
  .tab-btn, .action-btn:not(.action-btn-danger, .action-btn-warning, .action-btn-primary)
) {
  background: var(--sd-surface);
  border-color: var(--sd-border);
  border-radius: var(--sd-control-radius) !important;
  color: var(--sd-text);
  box-shadow: none;
}

body:is(.sharedroid-console, .sharedroid-admin) :is(
  .dashboard-refresh-btn, .pagination-btn, .pagination-number,
  .tab-btn, .action-btn:not(.action-btn-danger, .action-btn-warning, .action-btn-primary)
):not(:disabled):hover {
  background: var(--sd-soft);
  border-color: var(--sd-border-strong);
  color: var(--sd-brand);
  transform: none;
}

body:is(.sharedroid-console, .sharedroid-admin) :is(
  .dashboard-refresh-btn, .pagination-btn, .pagination-number, .tab-btn, .action-btn,
  .map-control-btn
):focus-visible {
  outline: 2px solid var(--sd-green-600);
  outline-offset: 2px;
}

body:is(.sharedroid-console, .sharedroid-admin) :is(
  .device-row.selected, .user-row.selected
) > td,
body:is(.sharedroid-console, .sharedroid-admin) :is(
  .tab-btn.active, .pagination-number.active, .action-btn-primary
) {
  background: var(--sd-green-100);
  border-color: #b6ddd3;
  color: var(--sd-brand);
}

body:is(.sharedroid-console, .sharedroid-admin) .action-btn-primary:not(:disabled):hover {
  background: var(--sd-brand);
  border-color: var(--sd-brand);
  color: var(--sd-surface);
  transform: none;
}

body:is(.sharedroid-console, .sharedroid-admin) :is(
  .device-icon, .session-avatar, .row-icon, .history-user-avatar, .app-clear-icon,
  .profile-icon:not(.microsoft),
  .app-search-icon, .required-policy-mark
) {
  background: var(--sd-green-100);
  border-radius: var(--sd-control-radius);
  color: var(--sd-brand);
}

body:is(.sharedroid-console, .sharedroid-admin) :is(.profile-badge, .row-pill:not(.row-pill-muted, .row-pill-warning), .recovery-code, .auth-chip-on) {
  background: var(--sd-green-100);
  border-color: #b6ddd3;
  color: var(--sd-brand);
}

body:is(.sharedroid-console, .sharedroid-admin) :is(.profile-meta-pill, .row-pill-muted, .auth-chip:not(.auth-chip-on, .auth-chip-pending)) {
  background: var(--sd-soft);
  border-color: var(--sd-border);
  color: var(--sd-muted);
}

body:is(.sharedroid-console, .sharedroid-admin) :is(.recovery-code strong, .manual-clear-list summary) {
  color: var(--sd-brand);
}

body.sharedroid-console .map-controls {
  background: var(--sd-surface);
  border-color: var(--sd-border);
  border-radius: var(--sd-control-radius);
  box-shadow: var(--sd-shadow-sm);
}

body.sharedroid-console .map-control-btn {
  background: var(--sd-soft);
  color: var(--sd-brand);
}

body.sharedroid-console .map-control-btn:not(:disabled):hover {
  background: var(--sd-brand);
  color: var(--sd-surface);
}

body.sharedroid-console .map-empty {
  background: linear-gradient(145deg, var(--sd-surface), #eef5f5);
  color: var(--sd-muted);
}

body.sharedroid-console .map-empty strong {
  color: var(--sd-ink);
}

body.sharedroid-console .device-map:not(:fullscreen) {
  background-color: var(--sd-soft);
  border-color: var(--sd-border);
  border-radius: var(--sd-control-radius);
}

body.sharedroid-console :is(.location-view-backdrop, .screen-view-backdrop, .history-view-backdrop) {
  background: rgb(11 23 36 / 58%);
}

body.sharedroid-console .screen-view-frame {
  background: var(--sd-nav);
  border-color: var(--sd-border-strong);
  color: var(--sd-green-100);
}

/* Settings, configuration and console SSO */
body:is(.sharedroid-console, .sharedroid-admin) :is(
  .config-item, .choice, .setup-item, .radio-card, .app-clear-card,
  .sign-in-layout-option, .sign-in-step, .tier-row, .mini-stat, .console-card,
  .console-section, .document-card, .history-last-user, .app-search-results
) {
  background: var(--sd-surface);
  border-color: var(--sd-border);
  border-radius: var(--sd-card-radius);
}

body:is(.sharedroid-console, .sharedroid-admin) :is(
  .required-policy, .sign-in-journey, .quote-card, .notice:not(.warning)
) {
  background: #eef7f4;
  border-color: #b6ddd3;
  border-radius: var(--sd-card-radius);
  color: var(--sd-brand);
}

body:is(.sharedroid-console, .sharedroid-admin) .notice:not(.warning) {
  border-inline-start-color: var(--sd-green-700);
}

body:is(.sharedroid-console, .sharedroid-admin) :is(
  .choice:has(input:checked), .app-clear-card:has(input:checked), .radio-card:has(input:checked),
  .profile-card.active, .sign-in-layout-option.selected, .billing-option.active,
  .tier-row.active, .deployment-card:has(input:checked),
  .profile-type-card:has(input:checked), .wallpaper-option.active
) {
  background: #eef7f4 !important;
  border-color: var(--sd-green-600) !important;
  box-shadow: inset 0 0 0 1px var(--sd-green-600) !important;
}

body:is(.sharedroid-console, .sharedroid-admin) :is(
  .tier-row.active strong, .quote-total strong, .sign-in-layout-option.selected span
) {
  color: var(--sd-brand);
}

body:is(.sharedroid-console, .sharedroid-admin) :is(
  .copy-value, .targeting-code, .capture-code, .legal-consent, .sign-in-step-state:not(.configured),
  .json-details pre
) {
  background: var(--sd-soft);
  border-color: var(--sd-border);
  border-radius: var(--sd-control-radius);
  color: var(--sd-text);
}

body.sharedroid-console :is(.switch-row, .setup-line) {
  border-color: var(--sd-border);
}

body.sharedroid-console .switch-track {
  background: #aebdc7;
}

body.sharedroid-console .switch input:checked + .switch-track {
  background: var(--sd-brand);
}

body.sharedroid-console .switch input:focus-visible + .switch-track {
  box-shadow: var(--sd-focus);
}

body:is(.sharedroid-console, .sharedroid-admin) :is(
  .empty-state, .profile-empty, .app-clear-empty, .empty-insight, .console-empty
) {
  background: var(--sd-soft) !important;
  border-color: var(--sd-border-strong) !important;
  border-radius: var(--sd-card-radius) !important;
  box-shadow: none !important;
  color: var(--sd-muted);
}

body:is(.sharedroid-console, .sharedroid-admin) :is(
  input:not([type=checkbox], [type=radio], [type=color], [type=range], [type=hidden]),
  select, textarea
):disabled {
  background: var(--sd-soft) !important;
  color: var(--sd-muted) !important;
}
