/*
 * CORBAN — DARK COHERENCE v285
 * Resolves legacy green !important rules that superseded futuristic v284.
 * Uniform navy + azure + cyan interface. Green only for semantic success/active states.
 * Scope: dark-mode authenticated application. No functionality/layout reshaping.
 */
html[data-app-theme="dark"] .app-view {
  --app-bg: #07101e !important;
  --app-bg-soft: #0a192b !important;
  --app-sidebar: #0a1b31 !important;
  --app-surface: #0e2339 !important;
  --app-surface-2: #132e49 !important;
  --app-surface-3: #173650 !important;
  --app-panel: #10263e !important;
  --app-panel-soft: #142e47 !important;
  --app-border: #264a65 !important;
  --app-border-strong: #3e789a !important;
  --app-text: #e7f4fc !important;
  --app-text-strong: #fbfeff !important;
  --app-muted: #b0c4d4 !important;
  --app-muted-2: #8caac1 !important;
  --app-accent: #5ed8fa !important;
  --app-accent-soft: rgba(71, 179, 241, .14) !important;
  --app-mint: #70d7ea !important;
  --app-violet: #a8a2fa !important;
  --app-control: #10283f !important;
  --app-control-hover: #1a3853 !important;
  --app-table-hover: rgba(69, 169, 221, .085) !important;
  --app-primary-text: #061a2b !important;
  --app-button-bg: #47c8ef !important;
  --app-button-text: #061a2b !important;
  --app-shadow-soft: 0 9px 28px rgba(0, 6, 22, .25) !important;
  --app-shadow: 0 18px 45px rgba(0, 5, 20, .36) !important;
  color: #e7f4fc;
}

/* Background and chrome must share one cool hue instead of green vs blue. */
html[data-app-theme="dark"] .app-view,
html[data-app-theme="dark"] .app-view .content {
  background: transparent !important;
}
html[data-app-theme="dark"] .app-view {
  background-color: #07101e !important;
}
html[data-app-theme="dark"] .app-view .content {
  background-image: none !important;
}
html[data-app-theme="dark"] .app-view .main {
  background:
    radial-gradient(ellipse 80% 56% at 90% -8%, rgba(34, 118, 210, .12), transparent 69%),
    radial-gradient(ellipse 65% 62% at -10% 96%, rgba(28, 144, 206, .075), transparent 70%),
    linear-gradient(160deg, #071222 0%, #0a1728 48%, #07111f 100%) !important;
}
html[data-app-theme="dark"] .app-view .sidebar {
  background:
    radial-gradient(circle at 25% 0%, rgba(38, 126, 228, .14), transparent 40%),
    linear-gradient(180deg, #0b1d34, #081529 58%, #071222) !important;
  border-right-color: #25435f !important;
  box-shadow: 8px 0 32px rgba(0, 5, 20, .24) !important;
}
html[data-app-theme="dark"] .app-view .topbar {
  background: linear-gradient(95deg, rgba(12, 30, 50, .94), rgba(8, 23, 41, .95)) !important;
  border-bottom-color: #294b66 !important;
}

/* Selected tabs and sidebar items are blue/cyan, not lime green. */
html[data-app-theme="dark"] .app-view .nav.active {
  color: #eefaff !important;
  border-color: rgba(94, 216, 250, .49) !important;
  background: linear-gradient(95deg, rgba(53, 139, 230, .24), rgba(71, 198, 238, .065)) !important;
  box-shadow: inset 3px 0 0 #61dbfb, 0 0 18px rgba(61, 162, 236, .10) !important;
}
html[data-app-theme="dark"] .app-view .nav:not(.active):hover {
  color: #edfaff !important;
  background: rgba(38, 102, 160, .17) !important;
  border-color: rgba(93, 186, 236, .26) !important;
}
html[data-app-theme="dark"] .app-view .nav.active::before {
  background: #6bdcf5 !important;
  box-shadow: 0 0 12px rgba(79, 208, 247, .60) !important;
}

/* Common cards and major work areas: shared glass-blue surfaces */
html[data-app-theme="dark"] .app-view :is(
  .pipeline-commandbar, .pipeline-stage, .pipeline-filter-drawer,
  .settings-module-card, .employees-panel, .tables-panel,
  .phases-panel, .banks-settings-panel, .products-settings-panel,
  .company-license-state-card, .futuristic-card, .tech-card,
  .pipeline-inline-edit-actions, .profile-identity-card,
  .company-commandbar, .company-data-stage, .company-list-stage,
  .automation-banks-admin-stage, .automation-bank-admin-card,
  .company-list-item, .table-bank-card, .table-promoter-card,
  .bank-settings-row, .phase-row, .company-commission-row,
  .bank-settings-modal-card, .phase-modal-card, .employee-modal-card,
  .workers-commandbar, .workers-list-card, .worker-card,
  .workers-stats article, .company-bank-access-panel,
  .company-bank-access-card, .company-license-metric,
  .company-license-overview, .reports-launch-card,
  .proposal-drawer, .proposal-followup-panel
) {
  border-color: rgba(99, 170, 210, .31) !important;
  background:
    radial-gradient(ellipse at 98% -15%, rgba(38, 112, 201, .11), transparent 52%),
    linear-gradient(145deg, #112941 0%, #0c2035 100%) !important;
  box-shadow: inset 0 1px 0 rgba(190, 234, 255, .065), 0 12px 31px rgba(0, 7, 23, .23) !important;
}
html[data-app-theme="dark"] .app-view :is(
  .company-list-item, .automation-bank-admin-card, .settings-module-card,
  .reports-launch-card, .bank-settings-row, .phase-row
):hover {
  border-color: rgba(105, 213, 246, .52) !important;
  background: linear-gradient(140deg, #163752, #0d283e) !important;
  box-shadow: 0 11px 29px rgba(0, 7, 24, .25), 0 0 17px rgba(66, 164, 225, .11) !important;
}
html[data-app-theme="dark"] .app-view :is(
  .pipeline-stage-toolbar, .pipeline-stage-rail,
  .employees-panel-top, .tables-searchbar,
  .phases-toolbar, .banks-settings-toolbar, .products-settings-toolbar,
  .company-list-stage-toolbar, .company-data-rail,
  .pipeline-filter-active-strip
) {
  background: linear-gradient(90deg, #142d47, #10263d) !important;
  border-color: rgba(92, 166, 205, .24) !important;
}
html[data-app-theme="dark"] .app-view .automation-banks-admin-commandbar {
  background: transparent !important;
  box-shadow: none !important;
  border: 0 !important;
}
html[data-app-theme="dark"] .app-view .company-commandbar {
  background: linear-gradient(90deg, #142d47, #10253b) !important;
}

/* Data tables do not switch between green/grey/blue row stripes. */
html[data-app-theme="dark"] .app-view .pipeline-stage {
  background: linear-gradient(150deg, #0e2238, #0a1a2b) !important;
}
html[data-app-theme="dark"] .app-view .pipeline-table thead,
html[data-app-theme="dark"] .app-view .pipeline-table thead th {
  background: #173249 !important;
  border-color: #2a506b !important;
  color: #c4dce9 !important;
}
html[data-app-theme="dark"] .app-view .pipeline-table tbody td {
  background: #102438 !important;
  border-color: #233f58 !important;
}
html[data-app-theme="dark"] .app-view .pipeline-table tbody tr:nth-child(even) td {
  background: #122940 !important;
}
html[data-app-theme="dark"] .app-view .pipeline-table tbody tr:hover td {
  background: #1a3952 !important;
}
html[data-app-theme="dark"] .app-view .pipeline-tab:not(.is-active) {
  background: #10273d !important;
  color: #b5cfe1 !important;
  border-color: #2c506b !important;
}
html[data-app-theme="dark"] .app-view .pipeline-tab.is-active {
  background: #1a3c57 !important;
  color: #f1fcff !important;
  border-color: #5bbce7 !important;
}

/* One single PRIMARY button gradient — include old green buttons with !important */
html[data-app-theme="dark"] .app-view :is(
  .btn.primary, .company-new-button, .company-register-button,
  .automation-banks-admin-new, .credential-finish-button,
  .profile-save-button, .employee-new-button, .employee-save-button,
  .pipeline-add-button, .proposal-save-button, .table-catalog-save-button,
  .tables-primary-action, .banks-settings-primary-action,
  .phases-primary-action, .products-settings-primary-action,
  .workers-primary, .automation-banks-admin-empty button,
  .company-bank-access-save
) {
  color: #06192a !important;
  border-color: rgba(110, 221, 254, .66) !important;
  background: linear-gradient(112deg, #419dea 0%, #59c7f5 50%, #65deed 100%) !important;
  box-shadow: inset 0 1px 0 rgba(239, 252, 255, .22),
              0 8px 23px rgba(32, 139, 219, .23) !important;
  text-shadow: none !important;
}
html[data-app-theme="dark"] .app-view :is(
  .btn.primary, .company-new-button, .company-register-button,
  .automation-banks-admin-new, .credential-finish-button,
  .profile-save-button, .employee-new-button, .employee-save-button,
  .pipeline-add-button, .proposal-save-button, .table-catalog-save-button,
  .tables-primary-action, .banks-settings-primary-action,
  .phases-primary-action, .products-settings-primary-action,
  .workers-primary, .company-bank-access-save
):hover:not(:disabled) {
  color: #041727 !important;
  border-color: #84e7ff !important;
  background: linear-gradient(112deg, #57b1f5, #70d7f7 64%, #7deaf0) !important;
  box-shadow: 0 10px 29px rgba(31, 153, 226, .30), 0 0 18px rgba(66, 197, 242, .10) !important;
}

/* Secondary buttons, toggles, dropdowns — no green backgrounds */
html[data-app-theme="dark"] .app-view :is(
  .btn.secondary, .toolbar-button, .theme-toggle,
  .sidebar-toggle, .logout-button, .sidebar-theme-toggle,
  .proposal-cancel-button, .profile-photo-button,
  .table-catalog-icon-button, .corban-stepper-button,
  .automation-banks-admin-refresh, .workers-secondary, .workers-refresh,
  .pipeline-icon-action, .settings-back-button, .company-license-action
) {
  color: #d5eaf6 !important;
  border-color: rgba(88, 166, 208, .34) !important;
  background: linear-gradient(135deg, #142e47, #0d2237) !important;
  box-shadow: inset 0 1px 0 rgba(198, 239, 255, .055) !important;
}
html[data-app-theme="dark"] .app-view :is(
  .btn.secondary, .toolbar-button, .theme-toggle,
  .sidebar-toggle, .logout-button, .sidebar-theme-toggle,
  .automation-banks-admin-refresh, .pipeline-icon-action
):hover:not(:disabled) {
  color: #effaff !important;
  border-color: rgba(108, 205, 245, .52) !important;
  background: linear-gradient(135deg, #1b425f, #123047) !important;
  box-shadow: 0 0 15px rgba(68, 172, 225, .13) !important;
}

/* Forms: common neutral blue instead of dark green and stronger text contrast. */
html[data-app-theme="dark"] .app-view :is(
  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]),
  textarea, select, .corban-employee-select-trigger,
  .corban-employee-select-search, .pipeline-inline-input,
  .pipeline-inline-select, .pipeline-inline-readonly,
  .pipeline-inline-dropdown-trigger-v2,
  .pipeline-inline-dropdown-search-shell-v2,
  .company-commission-field
) {
  color: #e9f7fd !important;
  background: #112940 !important;
  border-color: rgba(91, 170, 212, .42) !important;
}
html[data-app-theme="dark"] .app-view :is(
  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]),
  select, textarea, .corban-employee-select-trigger,
  .pipeline-inline-dropdown-trigger-v2
):focus {
  border-color: #73dafa !important;
  box-shadow: 0 0 0 3px rgba(73, 183, 241, .17) !important;
}
html[data-app-theme="dark"] .app-view :is(input, textarea)::placeholder {
  color: #99b6ca !important;
  opacity: 1;
}
/* Search remains integrated in the company commandbar, with no black/green box */
html[data-app-theme="dark"] .app-view .company-search-shell input {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  color: #e7f5fb !important;
}

/* Dark dropdowns and modals, many legacy components were !important grey. */
html[data-app-theme="dark"] .app-view :is(
  .corban-employee-select-menu, .pipeline-inline-dropdown-menu-v2,
  .pipeline-filter-drawer, .proposal-drawer, .bank-settings-modal-card,
  .phase-modal-card, .product-settings-modal-card, .modal,
  .employee-modal-card, .pipeline-tab-color-modal-card
) {
  color: #e9f8ff !important;
  background: radial-gradient(circle at 100% 0%, rgba(47, 136, 217, .12), transparent 52%), #0f263d !important;
  border-color: #417394 !important;
  box-shadow: 0 24px 65px rgba(0, 4, 18, .48) !important;
}
html[data-app-theme="dark"] .app-view :is(
  .corban-employee-select-option.is-selected,
  .pipeline-inline-dropdown-option-v2.is-selected
) {
  color: #8ce5ff !important;
  background: rgba(46, 142, 208, .20) !important;
}
html[data-app-theme="dark"] .app-view :is(
  .corban-employee-select-option:hover, .pipeline-inline-dropdown-option-v2:hover,
  .pipeline-filter-option:hover
) {
  color: #f7fdff !important;
  background: #234563 !important;
}

/* Stronger contrast on the exact scenes shown in the screenshots */
html[data-app-theme="dark"] .app-view .automation-banks-admin-kicker {
  color: #83dfff !important;
}
html[data-app-theme="dark"] .app-view .automation-banks-admin-heading > strong,
html[data-app-theme="dark"] .app-view .automation-bank-admin-copy strong,
html[data-app-theme="dark"] .app-view .company-list-name strong {
  color: #f5fbff !important;
}
html[data-app-theme="dark"] .app-view .automation-banks-admin-heading > small,
html[data-app-theme="dark"] .app-view .automation-bank-admin-copy small,
html[data-app-theme="dark"] .app-view .automation-banks-admin-stage-head strong,
html[data-app-theme="dark"] .app-view .automation-banks-admin-stage-head span {
  color: #b0c8d9 !important;
  opacity: 1 !important;
}
html[data-app-theme="dark"] .app-view .automation-bank-admin-copy small {
  font-size: 10px !important;
  line-height: 1.45;
}
html[data-app-theme="dark"] .app-view .automation-bank-admin-logo {
  border-color: #3c7497 !important;
  color: #9aeaff !important;
  background: #183c58 !important;
}
html[data-app-theme="dark"] .app-view .company-list-item {
  color: #e9f5fc !important;
  background: linear-gradient(115deg, #122c42, #102439) !important;
  border-color: #315976 !important;
}
html[data-app-theme="dark"] .app-view .company-list-item::before {
  background: linear-gradient(180deg, #64d2f4, #306bd2) !important;
}
html[data-app-theme="dark"] .app-view .company-list-detail small {
  color: #a6c4d6 !important;
  font-size: 10px !important;
}
html[data-app-theme="dark"] .app-view .company-list-detail > strong,
html[data-app-theme="dark"] .app-view .company-list-master > strong {
  color: #e9f7ff !important;
  font-size: 11px !important;
}
html[data-app-theme="dark"] .app-view .company-list-name small {
  color: #a8c0d3 !important;
}
html[data-app-theme="dark"] .app-view .company-list-name strong {
  font-size: 13px !important;
}
html[data-app-theme="dark"] .app-view .company-data-rail span,
html[data-app-theme="dark"] .app-view .company-data-rail span:nth-child(2) {
  background: #58caee !important;
}
html[data-app-theme="dark"] .app-view .automation-bank-admin-copy small,
html[data-app-theme="dark"] .app-view .company-list-name small {
  opacity: 1 !important;
}

/* Preserve meaning: green is ONLY for success, online and active badges. */
html[data-app-theme="dark"] .app-view :is(
  .automation-bank-admin-status:not(.is-off),
  .company-list-status .badge, .worker-status.is-online,
  .worker-status-dot.is-online, .company-live-indicator span
) {
  color: #80e9c0;
}
html[data-app-theme="dark"] .app-view .automation-bank-admin-status:not(.is-off) {
  background: rgba(21, 121, 97, .18);
  border-color: rgba(63, 202, 157, .40);
}

/* Accessible strong contrast for secondary labels across common panels */
html[data-app-theme="dark"] .app-view :is(
  .company-list-stage-head strong, .bank-settings-copy small,
  .phase-copy small, .employee-row-cell small, .settings-module-copy small,
  .reports-launch-copy small, .workers-commandbar small
) {
  color: #a9c7d8 !important;
}
@media (prefers-reduced-motion: reduce) {
  html[data-app-theme="dark"] .app-view :is(.nav, .settings-module-card, .reports-launch-card) {
    transition: none !important;
  }
}
