/* RusLink visual system inspired by the supplied finance dashboard references.
   This file is loaded after module styles so that every workspace uses one palette. */
:root {
  color-scheme: dark;
  --canvas: #0b1028;
  --canvas-edge: #080d23;
  --nav: #191f42;
  --paper: #1b2145;
  --surface: #1b2145;
  --surface-deep: #121832;
  --surface-raised: #252c56;
  --ink: #f5f7ff;
  --muted: #aeb8d4;
  --line: #343d68;
  --accent: #21c9c7;
  --accent2: #12aead;
  --danger: #ff6677;
  --warning: #ffa448;
  --calm: #9c79ff;
  --radius: 20px;
  --shadow: 0 18px 38px rgba(2, 5, 20, .16);
}

html, body { min-height: 100%; background: var(--canvas) !important; color: var(--ink); }
body { padding: 0 !important; font-family: Inter, "Segoe UI", Arial, sans-serif; }
body, button, input, select, textarea { font-family: Inter, "Segoe UI", Arial, sans-serif; }
::selection { background: #6b43d4; color: #fff; }
:focus-visible { outline: 2px solid var(--accent) !important; outline-offset: 2px; }
* { scrollbar-color: #515c91 #111630; }

/* Frame, navigation, and header. */
.app-shell {
  width: 100% !important;
  max-width: none !important;
  min-height: 100vh !important;
  margin: 0 !important;
  grid-template-columns: 228px minmax(0, 1fr) !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: var(--canvas) !important;
  box-shadow: none !important;
}
.sidebar {
  background: var(--nav) !important;
  color: var(--ink) !important;
  border: 1px solid #2b335b !important;
  box-shadow: 0 14px 38px rgba(1, 3, 19, .18);
}
@media (min-width: 761px) {
  .sidebar {
    position: relative !important;
    inset: auto !important;
    width: calc(100% - 18px) !important;
    height: auto !important;
    min-height: calc(100vh - 36px) !important;
    margin: 18px 0 18px 18px;
    padding: 25px 12px 18px;
    border-radius: 25px;
    align-self: stretch;
  }
  .sidebar nav { overflow: visible !important; max-height: none !important; }
}
.brand { margin: 0 8px 30px; gap: 12px; }
.brand b { color: #fff !important; font-size: 20px; letter-spacing: -.04em; }
.brand span:not(.brand-mark) { color: #a8b4d0 !important; font-size: 11px; }
.brand-mark, .brand-mark.small {
  background: linear-gradient(140deg, #6731c3, #3c2b9c) !important;
  color: #fff !important;
  box-shadow: 0 8px 18px rgba(52, 27, 136, .26) !important;
  border-radius: 13px;
}
.sidebar .nav-section-label { color: #8492bb !important; font-size: 10px; letter-spacing: .13em; }
.sidebar .nav-item {
  min-height: 43px;
  padding: 10px 12px;
  color: #c2cbe2 !important;
  font-size: 13px;
  border-radius: 10px;
}
.sidebar .nav-item:hover { background: #29325c !important; color: #fff !important; transform: none; }
.sidebar .nav-item.active, .sidebar .nav-item.active:hover {
  background: #30285f !important;
  color: #fff !important;
  box-shadow: inset 3px 0 #a27bff !important;
}
.sidebar .nav-icon { stroke: currentColor; }
.card-size-control, .interface-scale-control { color: var(--muted) !important; border-color: var(--line) !important; }
.card-size-control label, .interface-scale-control label,
.card-size-control output, .interface-scale-control output { color: var(--muted) !important; }
.sidebar-foot { border-color: var(--line) !important; color: #fff !important; }
.sidebar-foot b { color: #fff !important; }
.sidebar-foot small { color: #aab5d0 !important; }
.sidebar-avatar, .header-avatar, .owner-avatar {
  background: #6230b8 !important;
  color: #fff !important;
}
.workspace {
  min-width: 0;
  padding: 0 30px 52px;
  background: var(--canvas) !important;
  color: var(--ink) !important;
}
.topbar {
  position: sticky;
  top: 0;
  display: grid;
  grid-template-columns: minmax(150px, .85fr) minmax(180px, 290px) minmax(155px, 195px) auto;
  align-items: center;
  gap: 18px;
  min-height: 100px;
  margin: 0 -30px 25px;
  padding: 20px 30px 18px;
  background: rgba(11, 16, 40, .97) !important;
  border: 0 !important;
  border-bottom: 1px solid #252c50 !important;
  box-shadow: none !important;
  backdrop-filter: blur(14px);
  z-index: 40;
}
.topbar .eyebrow { color: #94a1be !important; letter-spacing: .06em; }
.topbar h1 { color: #fff !important; font-size: clamp(22px, 2vw, 29px); font-weight: 760; }
.global-search, .global-office select,
.top-actions select, .filters input, .filters select {
  background: #1b2145 !important;
  border: 1px solid #30395f !important;
  color: var(--ink) !important;
  border-radius: 11px;
}
.global-search { min-height: 42px; color: #9eabcb !important; }
.global-search input { color: #fff !important; background: transparent !important; }
.global-search input { border: 0 !important; box-shadow: none !important; padding: 0 !important; }
.global-search:focus-within { border-color: var(--accent) !important; box-shadow: 0 0 0 3px rgba(33,201,199,.15); }
.global-office { color: var(--muted) !important; }
.top-actions { gap: 8px; }
.header-user { border-left-color: var(--line) !important; color: #fff; }
.header-user b { color: #fff !important; }

/* Shared surfaces and type. */
.workspace :is(.panel, .metric, .process-card, .company-card, .kanban-lane, .task-lane,
  .task-board-card, .board-card, .notification-center-item) {
  background: var(--surface) !important;
  border: 1px solid #2d355e !important;
  border-radius: 21px !important;
  color: var(--ink) !important;
  box-shadow: var(--shadow) !important;
}
.workspace :is(.panel, .process-card, .company-card, .kanban-lane):hover {
  border-color: #4d5485 !important;
}
.workspace :is(h1, h2, h3, h4),
.workspace :is(.panel, .metric, .process-card, .company-card, .kanban-lane) :is(h1, h2, h3, h4) {
  color: #fff !important;
}
.workspace :is(.section-note, .meta, .empty, small, .metric span, .metric small),
.workspace :is(.panel, .process-card, .company-card) :is(.section-note, .meta, .empty, small) {
  color: var(--muted) !important;
}
.workspace .eyebrow { color: #28c8c9 !important; }
.workspace .section-tools h2 { color: #fff !important; font-size: clamp(23px, 2vw, 30px); }
.workspace .section-tools .section-note { color: #aeb8d4 !important; }
.workspace .panel-head { border-color: var(--line) !important; }
.workspace .panel-head h2 { font-size: clamp(17px, 1.35vw, 21px); }
.workspace .text-button, .workspace a:not(.primary):not(.secondary),
.workspace .budget-process-link, .workspace .task-process-link { color: #38d2d2 !important; }
.workspace .text-button:hover, .workspace a:hover { color: #86efec !important; }
.workspace :is(.my-workday-stat, .china-office-summary article, .expense-office-summary > div,
  .expense-currency-totals, .expense-currency-grid .metric, .budget-unassigned,
  .expense-advanced-filters, .appearance-item, .process-progress-panel,
  .permissions, .schedule-row, .task-requirements, .task-waiting-fields,
  .task-waiting-note, .task-bulk-toolbar, .task-calendar-period,
  .process-flow-card, .task-column-menu, .task-gantt-head, .task-gantt-label,
  .attendance-calendar-day, .attendance-employee-schedule) {
  background: var(--surface-deep) !important;
  border-color: var(--line) !important;
  color: var(--ink) !important;
}
.workspace :is(.card-module, .card-main-module, .card-meta-module, .card-field,
  .card-status-module, .detail-columns > section, .process-wizard-stage,
  .process-wizard-preview, .process-wizard-budget, .wizard-preview,
  .wizard-task-fields, .wizard-task-row, .task-calendar-day,
  .task-calendar-blank, .task-board-card, .task-lane > header,
  .company-card .company-profile, .client-group) {
  background: #161c3b !important;
  border-color: #303960 !important;
  color: var(--ink) !important;
}
.workspace .process-card :is(.field-label, .company-meta, .board-owner, .status-caption, .due-date),
.workspace .company-card .company-profile dt,
.workspace .owner-name { color: #adb8d4 !important; }
.workspace .process-card .field-value,
.workspace .company-card .company-profile dd,
.workspace #companyGrid .company-card .company-profile dd,
.workspace #companyGrid .company-card .company-profile > b { color: #f3f5ff !important; }
.workspace #companyGrid > .client-group {
  background: #141a38 !important;
  border-color: #303960 !important;
  border-radius: 21px;
  box-shadow: none;
}
.workspace #companyGrid .client-group-head h3 { color: #fff !important; }
.workspace #companyGrid .company-card .company-profile dl > div { border-color: #31395f !important; }
.workspace #companyGrid .company-copy-button { background: #29305a !important; border-color: #55658b !important; color: #65e1dc !important; }

/* Dashboard modules carry the reference's orange, purple, and teal accents. */
.metrics { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; gap: 17px; }
.expense-metrics { grid-template-columns: repeat(auto-fit, minmax(175px, 1fr)) !important; }
.attendance-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
.attendance-employee-metrics { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; }
.workspace .metric { min-height: 145px; padding: 22px 24px; overflow: hidden; }
.workspace .metric span { color: #d1d8ec !important; font-size: 14px; font-weight: 680; }
.workspace .metric strong { color: #fff !important; font-size: clamp(28px, 2.5vw, 39px); letter-spacing: -.035em; }
.workspace .metric small { color: #aeb8d4 !important; }
#dashboardView > .metrics > .metric:first-child {
  background: linear-gradient(115deg, #ff7a18 0%, #f45749 52%, #e63668 100%) !important;
  border-color: transparent !important;
}
#dashboardView > .metrics > .metric:first-child :is(span, strong, small) { color: #fff !important; }
#dashboardView > .metrics > .metric:first-child::before { display: none !important; }
.workspace .metric.danger strong { color: #ff7386 !important; }
.workspace .metric.warning strong { color: #b99aff !important; }
.workspace .metric.calm strong { color: #29d0ce !important; }
.workspace .metric.danger::before { background: #ec5069 !important; }
.workspace .metric.warning::before { background: #7546cd !important; }
.workspace .metric.calm::before { background: #16c9a3 !important; }
.dashboard-extras { grid-column: 1 / -1; }
.workspace .status-bars i, .workspace .team-load i, .workspace .budget-usage-track i { background: #13d1ad !important; }
.workspace :is(.status-bars, .team-load, .my-task-list, .process-table) { color: var(--ink); }
.workspace :is(.status-bars, .team-load) :is(span, small) { color: var(--muted) !important; }

/* Tables and list views. */
.workspace :is(.expense-table-wrap, .task-list-panel, .task-list, .role-matrix,
  .attendance-team-calendar-table, .audit-table) { background: transparent !important; }
.workspace table { border-collapse: separate; border-spacing: 0; font-size: 13px; color: var(--ink); }
.workspace table thead th {
  background: #f16e20 !important;
  color: #fff !important;
  border-color: #ef7d32 !important;
  padding: 12px 13px;
  font-weight: 750;
}
.workspace table thead th:first-child { border-top-left-radius: 9px; }
.workspace table thead th:last-child { border-top-right-radius: 9px; }
.workspace table tbody tr { background: #111731 !important; }
.workspace table tbody tr:nth-child(even) { background: #151b37 !important; }
.workspace table tbody td,
.workspace table tbody th {
  color: #e8ecfa !important;
  border-color: #2b3457 !important;
  line-height: 1.45;
}
.workspace table tbody tr:hover > td,
.workspace table tbody tr:hover > th { background: #252d55 !important; }
.workspace :is(.budget-table, .role-matrix) thead th { background: #642ac4 !important; border-color: #7037cd !important; }
.workspace :is(.attendance-table, .attendance-team-calendar-table) thead th { background: #119eaa !important; border-color: #1bb2bd !important; }
.workspace :is(.task-list-head, .task-list-row, .process-row, .my-task-row,
  .notification-item, .notification-center-item, .schedule-row, .expense-bar-row) {
  border-color: #303960 !important;
  color: #ebefff !important;
}
.workspace :is(.task-list-head, .task-lane > header) { background: #141a38 !important; color: #bfc8e2 !important; }
.workspace :is(.task-list-row, .process-row, .my-task-row):hover { background: #252d55 !important; }
.workspace .task-list-title b { color: #fff !important; }
.workspace .view-switch { background: #171d3d !important; border-color: #343d68 !important; }
.workspace .view-mode { color: #b8c3dc !important; }
.workspace .view-mode.active { background: #6530b9 !important; color: #fff !important; box-shadow: none !important; }
.workspace .view-mode:hover { background: #2a315a !important; color: #fff !important; }
.workspace .view-mode.active:hover { background: #6530b9 !important; }

/* Controls, buttons, and dialogs. */
.workspace :is(input, select, textarea),
dialog :is(input, select, textarea), .login-card input {
  background: #121831 !important;
  color: #f5f7ff !important;
  border: 1px solid #3a446d !important;
  border-radius: 10px;
}
.workspace :is(input, textarea)::placeholder,
dialog :is(input, textarea)::placeholder,
.login-card input::placeholder { color: #8d9ab8 !important; opacity: 1; }
.workspace :is(input, select, textarea):focus,
dialog :is(input, select, textarea):focus,
.login-card input:focus { border-color: var(--accent) !important; box-shadow: 0 0 0 3px rgba(33,201,199,.14); }
.workspace select option, dialog select option { background: #121831; color: #fff; }
.workspace input[type="checkbox"], .workspace input[type="radio"],
dialog input[type="checkbox"], dialog input[type="radio"] { accent-color: #844fda; }
.primary, button.primary {
  color: #fff !important;
  border: 1px solid transparent !important;
  border-radius: 10px;
  background: linear-gradient(110deg, #fb7620, #e73d66) !important;
  box-shadow: 0 7px 20px rgba(222, 61, 92, .18) !important;
}
.primary:hover, button.primary:hover { filter: brightness(1.1); transform: translateY(-1px); }
.secondary, .mini-button, .board-arrow, .workspace .task-saved-view-tools button,
.workspace .task-bulk-toolbar button {
  background: #29305a !important;
  color: #f3f5ff !important;
  border: 1px solid #45507a !important;
  border-radius: 10px;
}
.secondary:hover, .mini-button:hover, .board-arrow:hover { background: #353e70 !important; }
.workspace :is(.filters, .section-tools, .board-tools, .schedule-actions) { color: var(--ink); }
.workspace :is(.filters, .section-tools) label { color: var(--muted) !important; }
.workspace :is(.priority-pill, .status-pill, .tag, .lane-count) { border-color: #48537f !important; }
.workspace :is(.status-waiting_client, .status-waiting_contractor, .status-waiting,
  .task-status-waiting, .priority-high, .process-stage-missing) {
  background: #423254 !important; color: #ffc875 !important; border-color: #6f5262 !important;
}
.workspace :is(.priority-critical, .task-overdue, .expense-status-rejected) { color: #ff8493 !important; }
.workspace :is(.task-status-done, .expense-status-reviewed) { background: #173e47 !important; color: #5bdfcc !important; }
.workspace .process-card select { background: #171d3b !important; color: #f4f6ff !important; }
.workspace .process-card .tag,
.workspace .process-card .priority-pill {
  background: #30295d !important;
  color: #e3d5ff !important;
  border: 1px solid #5c4b94 !important;
}
.workspace .process-card .priority-high,
.workspace .process-card .priority-critical {
  background: #513047 !important;
  color: #ffc389 !important;
  border-color: #82536b !important;
}
.workspace .open-process-button {
  background: #29315d !important;
  color: #5fe1df !important;
  border: 1px solid #485683 !important;
  border-radius: 10px;
}
.workspace .open-process-button:hover { background: #353e70 !important; }
dialog {
  background: #1b2145 !important;
  color: #f5f7ff !important;
  border: 1px solid #47517d !important;
  border-radius: 20px !important;
  box-shadow: 0 30px 90px rgba(0, 3, 18, .66) !important;
}
dialog::backdrop { background: rgba(2, 5, 21, .78) !important; }
dialog :is(h2, h3, h4, strong, b) { color: #fff; }
dialog label, dialog small, dialog .section-note { color: #b9c4dc !important; }
dialog :is(.detail-columns > section, .expense-detail-summary, .expense-detail-side,
  .expense-payment-form, .process-wizard-stage, .process-wizard-preview,
  .process-wizard-budget, .permissions, .attachment-picker, .apply-template-panel) {
  background: #141a37 !important; border-color: #343e67 !important; color: var(--ink) !important;
}
dialog :is(.dialog-head, .dialog-actions, .history, .expense-history li) { border-color: #343e67 !important; }
dialog .dialog-actions { background: #1b2145 !important; }
dialog .eyebrow { color: var(--accent) !important; }

/* Notifications, calendars, finance, and specialist panels. */
.notification-toggle, .notification-panel, .notification-panel > header,
.notification-item, .notification-center-link, .notification-filter-row button,
.notification-mark-read {
  background: #1b2145 !important;
  color: #f0f3ff !important;
  border-color: #37416b !important;
}
.notification-panel { box-shadow: 0 25px 65px rgba(0, 3, 18, .55) !important; }
.notification-panel :is(b, small, span),
.notification-center-item :is(b, span, small) { color: #e8ecfb !important; }
.notification-item:hover, .notification-center-link:hover { background: #29315a !important; }
.notification-filter-row button.active { background: #5635a2 !important; color: #fff !important; }
.notification-center-icon, .notification-office-hours, .notification-absence {
  background: #29315a !important; border-color: #3d4773 !important; color: #7ee8e5 !important;
}
.workspace :is(.task-calendar-weekday, .task-calendar-day, .task-calendar-blank,
  .task-gantt-head, .task-gantt-label, .attendance-calendar-day,
  .attendance-calendar-blank, .task-column-picker > summary) {
  background: #151b38 !important; border-color: #303a61 !important; color: #e8ecfa !important;
}
.workspace :is(.task-calendar-day.today, .attendance-calendar-day.today) { border-color: var(--accent) !important; }
.workspace :is(.task-calendar-event, .task-review-open) { background: #2c315e !important; color: #f0f2ff !important; }
.workspace :is(.expense-detail-summary, .expense-detail-side, .expense-payment-form,
  .expense-advanced-filters, .budget-unassigned, .expense-currency-totals) {
  background: #151b38 !important; border-color: #343d67 !important; color: #f2f4ff !important;
}
.workspace .budget-usage-track { background: #313960 !important; }
.workspace .notification-center-heading h2 { color: #fff !important; }
.workspace .global-search input { border: 0 !important; box-shadow: none !important; padding: 0 !important; }
.workspace .notification-center-search input { border: 0 !important; box-shadow: none !important; background: transparent !important; padding: 0 !important; }
.workspace details > summary { color: #dce4f7 !important; }
.workspace .expense-advanced-filter-count { background: #6033aa !important; color: #fff !important; }

/* Login receives the same visual language as the workspace. */
.login-page { min-height: 100vh; display: grid; place-items: center; background: #0b1028 !important; }
.login-shell {
  width: min(1040px, calc(100% - 40px));
  border: 1px solid #303960 !important;
  border-radius: 25px !important;
  overflow: hidden;
  background: #171d3b !important;
  box-shadow: 0 35px 100px rgba(1, 3, 18, .46) !important;
}
.login-brand {
  background: radial-gradient(circle at 15% 20%, rgba(35, 203, 201, .16), transparent 38%),
              linear-gradient(145deg, #202652, #161b3b) !important;
  color: #fff !important;
}
.login-brand h1 { color: #fff !important; }
.login-brand .eyebrow, .login-card .eyebrow { color: #37d1ce !important; }
.login-brand > p:last-child { color: #b7c3de !important; }
.login-card { background: #1b2145 !important; color: #f5f7ff !important; }
.login-card h2 { color: #fff !important; }
.login-card label, .login-card .security-note { color: #b5c0d8 !important; }
.login-card .lang-pill { background: #272e58 !important; color: #c3cce4 !important; border-color: #424b73 !important; }
.login-card .lang-pill.active { background: #6530b9 !important; color: #fff !important; }
.login-card .error { background: #4d253d !important; color: #ffd1d6 !important; border-color: #8c3c59 !important; }

@media (max-width: 1600px) and (min-width: 761px) {
  .topbar { grid-template-columns: minmax(0, 1fr) auto; }
  .topbar-context { grid-column: 1; grid-row: 1; }
  .top-actions { grid-column: 2; grid-row: 1; }
  .global-search-wrap { grid-column: 1; grid-row: 2; }
  .global-office { grid-column: 2; grid-row: 2; }
}
@media (max-width: 1100px) and (min-width: 761px) {
  .app-shell { grid-template-columns: 200px minmax(0, 1fr) !important; }
  .workspace { padding-left: 20px; padding-right: 20px; }
  .topbar { margin-left: -20px; margin-right: -20px; padding-left: 20px; padding-right: 20px; }
  .topbar { grid-template-columns: minmax(0, 1fr) auto; }
  .global-search-wrap { grid-column: 1; grid-row: 2; }
  .global-office { grid-column: 2; grid-row: 2; }
  .top-actions { grid-column: 2; grid-row: 1; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .expense-metrics, .attendance-metrics, .attendance-employee-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}
@media (max-width: 760px) {
  body { padding: 0 !important; }
  .app-shell { grid-template-columns: minmax(0, 1fr) !important; }
  .sidebar {
    position: fixed !important;
    inset: auto 0 0 !important;
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    display: block !important;
    margin: 0 !important;
    padding: 0 6px env(safe-area-inset-bottom) !important;
    border: 0 !important;
    border-top: 1px solid #323b66 !important;
    border-radius: 0 !important;
    background: #191f42 !important;
    z-index: 100;
  }
  .sidebar nav {
    display: flex !important;
    flex-direction: row !important;
    align-items: stretch !important;
    gap: 2px !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
  }
  .sidebar .nav-section { display: contents !important; }
  .sidebar .nav-section-label { display: none !important; }
  .sidebar .brand, .sidebar .sidebar-foot,
  .sidebar .card-size-control, .sidebar .interface-scale-control { display: none !important; }
  .sidebar .nav-item {
    flex: 0 0 72px;
    min-width: 72px;
    min-height: 54px;
    flex-direction: column;
    justify-content: center;
    gap: 3px;
    padding: 6px 3px;
    text-align: center;
    font-size: 10px;
  }
  .sidebar .nav-item.active { box-shadow: inset 0 3px #a27bff !important; }
  .workspace { grid-column: 1; padding: 0 16px calc(92px + env(safe-area-inset-bottom)); }
  .topbar {
    position: relative;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 11px;
    margin: 0 -16px 20px;
    padding: 19px 16px 16px;
    min-height: auto;
  }
  .topbar-context { grid-column: 1; }
  .top-actions { grid-column: 2; grid-row: 1; flex-wrap: wrap; }
  .global-search-wrap { grid-column: 1 / -1; grid-row: 2; }
  .global-office { grid-column: 1 / -1; grid-row: 3; }
  .global-office select { max-width: none; flex: 1; }
  .topbar h1 { font-size: 23px; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 10px; }
  .expense-metrics, .attendance-metrics, .attendance-employee-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
  .workspace .metric { min-height: 120px; padding: 15px; }
  .workspace .metric strong { font-size: 27px; }
  .workspace :is(.panel, .process-card, .company-card, .kanban-lane) { border-radius: 16px !important; }
  .workspace table { font-size: 12px; }
  .workspace table thead th { padding: 10px; }
  .login-shell { width: min(100% - 24px, 520px); }
}
@media (max-width: 480px) {
  .topbar { grid-template-columns: 1fr; }
  .top-actions { grid-column: 1; grid-row: 2; justify-content: flex-start; }
  .global-search-wrap { grid-row: 3; }
  .global-office { grid-row: 4; }
  .header-user { display: none; }
  .metrics { grid-template-columns: minmax(0, 1fr) !important; }
  .expense-metrics, .attendance-metrics, .attendance-employee-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
  .workspace .metric { min-height: 104px; }
}

/* Contrast pass: legacy light surfaces inside the dark workspace. */
#tasksView .section-tools .filters,
.workspace :is(.board-tools, .global-search-results, .task-collaboration,
  .internal-task-collab, .internal-task-label, .wizard-template-actions,
  .role-scope-guide article, .workday-personal-context,
  .process-review-actions, .expense-advanced-filter,
  .attendance-csv-format code, .company-drawer-tabs) {
  background: #1b2145 !important;
  border-color: #3a446e !important;
  color: #f5f7ff !important;
}
#tasksView .section-tools .filters :is(label, .task-process-controls label),
.workspace :is(.company-service-list, .company-case-list, .company-actions) small {
  color: #c1cce5 !important;
}
.workspace :is(.company-service-chip, .company-case-list button,
  .company-drawer-cases button, .task-lane > header span,
  .wizard-step-indicator, .wizard-step-indicator span,
  .process-wizard-stage-controls button, .task-column-menu label:hover,
  .task-review-open, .expense-detail-summary .task-expense-caption) {
  background: #242c53 !important;
  border-color: #434e79 !important;
  color: #f5f7ff !important;
}
.workspace :is(.company-case-list button, .company-drawer-cases button):hover,
.workspace :is(.process-expense-row, .expense-bar-row):hover {
  background: #313b6d !important;
}
.workspace .company-service-chip small {
  background: #294d5d !important;
  color: #b7ffef !important;
}
.workspace .company-case-list button .status-pill {
  background: #244954 !important;
  color: #8df3e8 !important;
  border: 1px solid #337d83 !important;
}
.workspace .company-case-list button .status-waiting_client,
.workspace .company-case-list button .status-waiting_contractor {
  background: #59402f !important;
  color: #ffd292 !important;
  border-color: #8b6244 !important;
}
.workspace .company-card .stat { color: #28d3cf !important; }
.workspace .company-drawer-tabs [role="tab"] { color: #ced8ed !important; }
.workspace .company-drawer-tabs [role="tab"]:hover { background: #2a335d !important; color: #fff !important; }
.workspace .company-drawer-tabs [role="tab"][aria-selected="true"] {
  background: #3b2c70 !important; color: #fff !important; border-bottom-color: #aa83ff !important;
}
.workspace :is(.icon-action:hover, .icon-action:focus-visible,
  .danger-text:hover, .wizard-step-indicator.active) {
  background: #343d70 !important; color: #fff !important;
}
.workspace :is(.task-item.global-search-task-focus, .task-list-row.global-search-task-focus,
  .task-sequence-blocked, .process-office-warning, .process-flow-alert,
  .process-flow-parallel, .process-flow-step.completed .process-flow-card,
  .process-flow-step.current .process-flow-card,
  .process-flow-step.waiting.current .process-flow-card,
  .process-flow-parallel .process-flow-card,
  .process-flow-parallel .process-flow-step.current .process-flow-card) {
  background: #28294f !important; border-color: #544d82 !important; color: #f5f7ff !important;
}
.workspace :is(.status-pill, .priority-pill, .tag, .task-list-status, .lane-count) {
  background: #2b355e !important; color: #dfebff !important; border: 1px solid #495982 !important;
}
.workspace :is(.status-in_progress, .status-review, .status-done, .status-closed,
  .task-status-done) {
  background: #194d58 !important; color: #8af4e8 !important; border-color: #327986 !important;
}
.workspace :is(.priority-high, .status-waiting_client, .status-waiting_contractor,
  .status-waiting, .task-status-waiting) {
  background: #59402f !important; color: #ffd292 !important; border-color: #8b6244 !important;
}
.workspace :is(.priority-critical, .task-overdue) {
  background: #603248 !important; color: #ffb1bf !important; border-color: #9f5570 !important;
}
.workspace .attention-panel .process-row {
  min-height: 63px;
  border-top: 1px solid #3b4772 !important;
  color: #f5f7ff !important;
}
.workspace .attention-panel .process-title b { color: #fff !important; font-weight: 760; }
.workspace .attention-panel .process-title small,
.workspace .attention-panel .process-row .meta { color: #c4d0e9 !important; }
.workspace .attention-panel .process-row:hover { background: #2a345f !important; }
dialog :is(.company-drawer-tabs, .company-drawer-cases button,
  .wizard-step-indicator, .wizard-step-indicator span,
  .process-wizard-stage-controls button, .expense-advanced-filter) {
  background: #242c53 !important; border-color: #434e79 !important; color: #f5f7ff !important;
}
dialog .company-drawer-tabs [role="tab"] { color: #cbd6ee !important; }
dialog .company-drawer-tabs [role="tab"][aria-selected="true"] {
  background: #3b2c70 !important; color: #fff !important; border-bottom-color: #aa83ff !important;
}
.workspace :is(.attachment-picker, .wizard-step-indicator,
  .task-board-card, .task-lane-review, .task-review-open,
  .expense-currency-grid .metric, .attendance-correction-actions) {
  background: #1b2145 !important; border-color: #3a446e !important; color: #f5f7ff !important;
}
.workspace .role-matrix .role-scope-note td,
.workspace .attendance-team-calendar-table tbody th:first-child {
  background: #202749 !important; color: #d5def3 !important;
}
.workspace .process-progress-waiting > span,
.workspace .expense-status-reviewed,
.workspace .expense-status-reimbursement_due,
.workspace .expense-status-partially_reimbursed {
  background: #59402f !important; color: #ffd292 !important; border-color: #8b6244 !important;
}
.workspace :is(.expense-status-needs_correction, .expense-status-rejected),
dialog .error {
  background: #603248 !important; color: #ffb1bf !important; border-color: #9f5570 !important;
}
.workspace :is(.expense-status-approved, .expense-status-reimbursed,
  .expense-status-verified, .expense-status-closed) {
  background: #194d58 !important; color: #8af4e8 !important; border-color: #327986 !important;
}
.workspace .expense-status-submitted {
  background: #2b3d69 !important; color: #c7dcff !important; border-color: #50669a !important;
}
.workspace .review-return-button,
dialog .review-return-button {
  background: #2a355d !important; color: #d0ecff !important; border-color: #536991 !important;
}
.workspace .review-return-button:hover,
dialog .review-return-button:hover { background: #35436f !important; }
dialog .company-drawer-panel > h3 { color: #fff !important; }
dialog .company-drawer-panel > dl dt { color: #aebcda !important; }
dialog .company-drawer-panel > dl dd { color: #f3f6ff !important; }

/* Process details live in a dialog outside .workspace. */
#processDetailDialog :is(.process-progress-panel, .task-collaboration,
  .task-requirements, .task-waiting-fields, .task-waiting-note,
  .process-review-actions, .task-sequence-blocked,
  .process-office-warning, .process-flow-alert) {
  background: #171e3d !important;
  border-color: #3b4774 !important;
  color: #f2f6ff !important;
}
#processDetailDialog .process-progress-head :is(b, strong),
#processDetailDialog .process-progress-step b,
#processDetailDialog .task-requirements header b,
#processDetailDialog .task-requirements li label,
#processDetailDialog .process-review-actions > div b {
  color: #f8faff !important;
}
#processDetailDialog .process-progress-head span,
#processDetailDialog .process-progress-step small,
#processDetailDialog .task-requirements header small,
#processDetailDialog .task-requirements-files > b,
#processDetailDialog .process-review-actions > div span {
  color: #bdcbe8 !important;
}
#processDetailDialog .process-progress-track { background: #303a63 !important; }
#processDetailDialog .process-progress-track i { background: #22cfca !important; }
#processDetailDialog .process-progress-step > span {
  background: #29345d !important; color: #d8e4fa !important;
}
#processDetailDialog .process-progress-done > span {
  background: #20565a !important; color: #9cf8e8 !important;
}
#processDetailDialog .process-progress-in_progress > span {
  background: #50359a !important; color: #f6ecff !important;
}
#processDetailDialog .process-progress-waiting > span {
  background: #51402f !important; color: #ffd597 !important;
}
#processDetailDialog .task-collaboration > summary {
  color: #61e5e6 !important;
}
#processDetailDialog .task-requirements-files {
  border-color: #3b4774 !important;
}
#processDetailDialog .task-description,
dialog .task-description,
.workspace :is(.task-description, .company-description) {
  color: #c4d0e9 !important;
}
.process-detail-status-error {
  margin: 14px 0 0;
  padding: 11px 13px;
  border: 1px solid #a4546c;
  border-radius: 10px;
  background: #512c42;
  color: #ffe4eb;
  font-size: 13px;
  line-height: 1.45;
}
.process-detail-status-error[hidden] { display: none; }
#toast { max-width: min(540px, calc(100vw - 32px)); line-height: 1.45; }
