html[data-theme="dark"] {
  color-scheme: dark;
  --ink: #e2e8f4;
  --muted: #aab7cd;
  --line: #354158;
  --surface: #192233;
  --canvas: #101722;
  --blue: #a3b4ff;
  --blue-hover: #bcc8ff;
  --blue-soft: #263454;
  --green: #79d5ac;
  --orange: #f1bc73;
}
html[data-theme="light"] {
  color-scheme: light;
}
.theme-picker {
  display: flex !important;
  align-items: center;
  flex-direction: row !important;
  gap: 7px;
  font-size: 12px;
  white-space: nowrap;
}
.theme-picker select {
  width: auto !important;
  min-width: 90px !important;
  max-width: 130px;
}
html[data-theme="dark"] body {
  background: var(--canvas) !important;
  color: var(--ink) !important;
}
html[data-theme="dark"]
  :is(
    .orbit-sidebar,
    .orbit-topbar,
    .account-popover,
    .orbit-account .account-popover,
    .workspace-switch,
    .sidebar-settings,
    dialog,
    .choice-popover,
    .settings-card,
    .security-card,
    .phase-panel,
    .card,
    .company-card,
    .company-table-wrap,
    .project-card,
    .project-table,
    .project-drawer,
    .board,
    .board-toolbar,
    .board-footer,
    .project-summary,
    .project-summary-line,
    .filter-bar,
    .filter-section,
    .work-filters,
    .filters,
    .metric-card,
    .chart-card,
    .approval-container,
    .table-wrap,
    .table-container,
    .contained-table,
    .work-metrics > div,
    .workspace-banner,

    .security-detail,
    .popover,
    .panel,
    .heading,
    .metrics > div,
    .timeline,
    .time-label,
    .group-spacer,
    .edit-cell,
    .time-row,
    .login-card,
    .login-panel,
    .auth-card,
    .activation-card
  ) {
  background-color: var(--surface) !important;
  color: var(--ink) !important;
  border-color: var(--line) !important;
}
html[data-theme="dark"] :is(table, tbody, tr, td) {
  background-color: var(--surface) !important;
  color: var(--ink);
  border-color: var(--line) !important;
}
html[data-theme="dark"]
  :is(th, thead, .task-group-heading th, .time-row.ruler, .company-table th) {
  background-color: #222e43 !important;
  color: #b9c7df !important;
  border-color: var(--line) !important;
}
html[data-theme="dark"] :is(tbody tr:hover, tbody tr:hover td) {
  background-color: #243249 !important;
}
html[data-theme="dark"]
  :is(
    h1,
    h2,
    h3,
    h4,
    strong,
    .orbit-brand,
    .account-button,
    .breadcrumb strong,
    .note-title,
    .login-title
  ) {
  color: var(--ink) !important;
}
html[data-theme="dark"]
  :is(
    p,
    small,
    label,
    dt,
    .eyebrow,
    .nav-caption,
    .work-metrics span,
    .phase-section-heading > span,
    .work-heading p,
    .work-notification p,
    .settings-card p,
    .settings-card small,
    .sidebar-note,
    .breadcrumb,
    .time-label small
  ) {
  color: var(--muted) !important;
}
html[data-theme="dark"] a {
  color: var(--blue);
}
html[data-theme="dark"] :is(input, select, textarea) {
  background-color: #111b2c !important;
  color: var(--ink) !important;
  border-color: #465571 !important;
}
html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder {
  color: #97a6bf;
}
html[data-theme="dark"]
  button:not(.status-trigger):not(.status-option):not(.color-swatch):not(
    .bar
  ):not(.primary):not(.btn-primary):not([type="submit"]) {
  background-color: #253249 !important;
  color: var(--ink) !important;
  border-color: var(--line) !important;
}
html[data-theme="dark"]
  :is(
    .primary,
    .btn-primary,
    button[type="submit"],
    #searchButton,
    #updateButton
  ) {
  background-color: #5369d9 !important;
  color: #fff !important;
  border-color: #7186ef !important;
}
html[data-theme="dark"] :is(.orbit-nav a, .sidebar-settings) {
  color: #bbc8df !important;
}
html[data-theme="dark"]
  :is(
    .orbit-nav a.is-current,
    .company-tabs [aria-current],
    .settings-nav a:target,
    .phase-tabs button[aria-selected="true"],
    .workspace-icon,
    .company-badge
  ) {
  background-color: #2c395b !important;
  color: #c0cbff !important;
}
html[data-theme="dark"] :is(.company-badge.good, .ok) {
  background-color: #173d32 !important;
  color: #a0e4bf !important;
}
html[data-theme="dark"] :is(.company-badge.bad, .late, .row-danger td) {
  background-color: #482a36 !important;
  color: #ffc3d0 !important;
}
html[data-theme="dark"] :is(.work-warning, .warning, .estimate-over) {
  color: #f6c386 !important;
}
html[data-theme="dark"] .work-warning {
  background: #392e20 !important;
}
html[data-theme="dark"] :is(.track, .bar-track) {
  background-color: #131d2e !important;
  border-color: var(--line) !important;
}
html[data-theme="dark"] :is(.closed, .nonworking) {
  background-color: #283044 !important;
}
html[data-theme="dark"] dialog::backdrop {
  background: #0009;
}
html[data-theme="dark"] :focus-visible {
  outline-color: #a8b8ff !important;
}
html[data-theme="dark"]
  :is(.company-rock-header button[data-act="toggle"], .phase-tabs button) {
  background: transparent !important;
}
@media (max-width: 760px) {
  .topbar-right .theme-picker > span {
    display: none;
  }
  .topbar-right .theme-picker select {
    min-width: 80px !important;
    max-width: 95px;
  }
  .topbar-right {
    gap: 8px;
  }
}
@media print {
  html[data-theme="dark"] body,
  html[data-theme="dark"]
    :is(table, tr, td, th, .card, .phase-panel, .company-card) {
    background: white !important;
    color: black !important;
  }
}

html[data-theme="dark"]
  :is(.table-wrap, .table-container, .contained-table, .company-table-wrap) {
  scrollbar-color: #576985 #182334;
}
html[data-theme="dark"]
  :is(
    .table-wrap,
    .table-container,
    .contained-table
  )::-webkit-scrollbar-track {
  background: #182334;
}
html[data-theme="dark"]
  :is(
    .table-wrap,
    .table-container,
    .contained-table
  )::-webkit-scrollbar-thumb {
  background: #576985;
}

html[data-theme="dark"]
  body
  :is(main, .main-content, .layout, .app-container, .container) {
  background-color: var(--canvas) !important;
  color: var(--ink) !important;
}
html[data-theme="dark"]
  body
  :is(
    .search-section,
    .project-summary,
    #projectDataDisplay,
    #messageDisplay,
    .report-notice,
    .board-content,
    .project-cards,
    .tab-content,
    .tabs,
    .security-panel,
    .security-metric,
    .stat-card,
    .metric,
    .toolbar,
    .report-toolbar
  ) {
  background-color: var(--surface) !important;
  color: var(--ink) !important;
  border-color: var(--line) !important;
}

/* Navigation groups share the same accessible, scrollable sidebar layout. */
.orbit-nav {
  min-height: 0;
  overflow-y: auto;
  flex: 1 1 auto;
  scrollbar-width: thin;
}
.orbit-sidebar > .workspace-switch,
.orbit-sidebar > .nav-caption,
.orbit-sidebar > .sidebar-settings {
  flex-shrink: 0;
}
.company-nav a {
  padding-left: 26px;
}
html[data-theme="dark"] body :is(.portfolio, .impact-app, #scheduleWorkspace) {
  --ink: #e2e8f4;
  --muted: #aab7cd;
  --line: #354158;
  --blue: #a3b4ff;
  --surface: #192233;
  --canvas: #101722;
  background-color: var(--canvas) !important;
  color: var(--ink) !important;
}
html[data-theme="dark"]
  body
  :is(
    .scenario,
    .timeline-panel,
    .changes,
    .explanation,
    .project-outcomes,
    .apply-bar,
    .scenario-options,
    .calendar-strip,
    .ruler,
    .group-label,
    .summary,
    .planner,
    .hint,
    .cell,
    .empty-calendar,
    .calendar-info,
    .settings-actions,
    .employee-options,
    .employee-lane-label,
    .employee-lane-track,
    .resource-dropdown,
    .resource-dropdown [data-panel],
    #projectScheduleSummary,
    #impactResources,
    #resourceMenu,
    #allocationTotals,
    .pto-balance,
    .pto-estimate,
    .control-links > a,
    .demo-banner,
    .login-form,
    .login-form-section
  ) {
  background: var(--surface) !important;
  color: var(--ink) !important;
  border-color: var(--line) !important;
}
html[data-theme="dark"]
  body
  :is(
    .badge,
    .security-badge,
    .pill,
    .step,
    .tag,
    .mode-tabs,
    #cdrPanel,
    .callout,
    .resource-hour,
    .employee-day,
    .baseline-key,
    .selected,
    .settings-nav a[aria-current="true"],
    .view-tabs [aria-selected="true"]
  ) {
  background: #293952 !important;
  color: #c5d2ef !important;
  border-color: var(--line) !important;
}
html[data-theme="dark"] body :is(.pill.off, .closed, .shade, .tick.nonworking) {
  background: #252e3e !important;
  color: #aab7cd !important;
}
html[data-theme="dark"]
  body
  :is(.holiday-shade, .holiday-key, .tick.holiday, .closure-gap) {
  background: #49323c !important;
  color: #ffc8cf !important;
}
html[data-theme="dark"] body :is(.pto-shade, .pto-key, .employee-pto) {
  background: repeating-linear-gradient(
    135deg,
    #322b49 0,
    #322b49 4px,
    #423858 4px,
    #423858 8px
  ) !important;
  color: #ded0ff !important;
}
html[data-theme="dark"]
  body
  :is(
    .over,
    .shade.over,
    .capacity-label,
    .employee-over,
    .conflict-key,
    .daily-total.over-total
  ) {
  background: #542d39 !important;
  color: #ffd0d8 !important;
}
html[data-theme="dark"]
  body
  :is(.daily-total, .pill:not(.off), #demoNotice:not(:empty)) {
  background: #204237 !important;
  color: #a9e8c8 !important;
}
html[data-theme="dark"] body :is(.pto-capacity) {
  background: #362f4b !important;
  color: #d6c7f3 !important;
}
html[data-theme="dark"]
  body
  :is(.track, .project-group .track, .employee-lane-track) {
  background: repeating-linear-gradient(
      to right,
      transparent 0,
      transparent 29px,
      #344058 29px,
      #344058 30px
    )
    #131d2e !important;
}
html[data-theme="dark"] body #scheduleWorkspace .track {
  background: repeating-linear-gradient(
      to right,
      transparent 0,
      transparent calc(var(--unit) - 1px),
      #344058 calc(var(--unit) - 1px),
      #344058 var(--unit)
    )
    #131d2e !important;
}
html[data-theme="dark"] body .bar.old {
  background: #38445a !important;
  color: #dbe5f6 !important;
}
html[data-theme="dark"] body .bar:not(.old) {
  background: color-mix(in srgb, var(--color, #6b80e9) 45%, #192233) !important;
  color: #edf2ff !important;
}
html[data-theme="dark"]
  body
  :is(
    #scheduleWorkspace input,
    #scheduleWorkspace select,
    #scheduleWorkspace textarea,
    #scheduleWorkspace .resource-picker,
    #scheduleWorkspace #employeeDropdown summary,
    .portfolio input,
    .portfolio select,
    .impact-app input,
    .impact-app select
  ) {
  background: #111b2c !important;
  color: #e2e8f4 !important;
  border-color: #465571 !important;
}
html[data-theme="dark"] body :is(#scheduleWorkspace .weekday-options span) {
  background: #202e45 !important;
  color: #c4d0e5 !important;
}
html[data-theme="dark"]
  body
  #scheduleWorkspace
  .weekday-options
  input:checked
  + span {
  background: #394b7a !important;
  color: #e2eaff !important;
}
html[data-theme="dark"]
  body
  :is(
    .group-label,
    .time-label,
    .edit-cell,
    .ruler,
    .calendar-strip,
    .apply-bar
  ) {
  border-color: var(--line) !important;
}
html[data-theme="dark"] body .company-nav a.is-current {
  background: #2c395b !important;
  color: #c0cbff !important;
}

@media (max-height: 900px) {
  .orbit-sidebar .sidebar-note {
    display: none;
  }
}
html[data-theme="dark"] body .skip-link {
  background: var(--surface);
  color: var(--blue);
}
html[data-theme="dark"] body .company-badge.good {
  background: #173d32 !important;
  color: #a0e4bf !important;
}
html[data-theme="dark"] body .company-badge.bad {
  background: #482a36 !important;
  color: #ffc3d0 !important;
}
.subscription-banner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  margin-bottom: 18px;
  border: 1px solid #bf7c25;
  border-radius: 8px;
  background: #fff4df;
  color: #573900;
  font-weight: 600;
}
.subscription-banner a { color: inherit; text-decoration: underline; }
html[data-theme="dark"] .subscription-banner { background: #392c17; color: #ffe0a3; }
