/* Seasonal artwork, lettering and palettes for the Beta cabinet. */
@font-face {
  font-family: 'Holiday Russo';
  src: url('holiday-themes/fonts/russo-one.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Holiday Golos';
  src: url('holiday-themes/fonts/golos-text.woff2') format('woff2');
  font-weight: 400 900;
  font-display: swap;
}
@font-face {
  font-family: 'Holiday Russo';
  src: url('holiday-themes/fonts/golos-text.woff2') format('woff2');
  font-weight: 400;
  font-variation-settings: 'wght' 820;
  unicode-range: U+20BD;
  font-display: swap;
}

html[data-holiday-theme="newyear"] {
  color-scheme: dark;
  --canvas: #10271f;
  --surface: #19362c;
  --raised: #224534;
  --tint: #28503e;
  --ink: #fff8e6;
  --muted: #cad7c7;
  --line: #64846b;
  --accent: #ffda89;
  --punch: #db6666;
  --ribbon: #853344;
  --ribbon-finish: linear-gradient(108deg, #a43c49, #712d3d);
  --stripe: #f2c57c;
  --rule: #14281f;
  --vi-outline: #231529;
  --vi-edge: #df7898;
  --face: linear-gradient(#fffdf2, #fff8ed 44%, #ffdfcb 78%, #ffbecf);
  --reward: #61383d;
  --reward-ink: #fff7dc;
  --soft-warn: #4f3c27;
  --warn: #ffdc99;
  --error: #ffc4bf;
  --error-surface: #503036;
  --on-active: #1b2520;
  --selection: #ffda89;
  --holiday-art: url('holiday-themes/newyear/overview.webp');
}
html[data-holiday-theme="mandarin"] {
  color-scheme: light;
  --canvas: #faf6ec;
  --surface: #fffef8;
  --raised: #dfedf0;
  --tint: #deebe2;
  --ink: #172e48;
  --muted: #42596a;
  --line: #90a6ab;
  --accent: #205943;
  --punch: #b74b1d;
  --ribbon: #deeff2;
  --ribbon-finish: linear-gradient(104deg, #deeff2 70%, #eef7f8);
  --stripe: #f18438;
  --rule: #274457;
  --vi-outline: #17283b;
  --vi-edge: #cf627d;
  --face: linear-gradient(#fffef1, #fff4dd 47%, #ffdfbc 78%, #ffc6c8);
  --reward: #ffdaa8;
  --reward-ink: #2e3743;
  --soft-warn: #ffeed6;
  --warn: #794413;
  --error: #9b2932;
  --error-surface: #fce9e7;
  --on-active: #fffdf2;
  --selection: #205943;
  --holiday-art: url('holiday-themes/mandarin/overview.webp');
}

html[data-holiday-theme="newyear"][data-theme-screen="works"] { --holiday-art: url('holiday-themes/newyear/works.webp'); }
html[data-holiday-theme="newyear"][data-theme-screen="bookings"] { --holiday-art: url('holiday-themes/newyear/bookings.webp'); }
html[data-holiday-theme="newyear"][data-theme-screen="calendar"] { --holiday-art: url('holiday-themes/newyear/calendar.webp'); }
html[data-holiday-theme="newyear"][data-theme-screen="menu"] { --holiday-art: url('holiday-themes/newyear/menu.webp'); }
html[data-holiday-theme="newyear"][data-theme-screen="team"] { --holiday-art: url('holiday-themes/newyear/team.webp'); }
html[data-holiday-theme="newyear"][data-theme-screen="timesheet"] { --holiday-art: url('holiday-themes/newyear/timesheet.webp'); }
html[data-holiday-theme="newyear"][data-theme-screen="manager"] { --holiday-art: url('holiday-themes/newyear/manager.webp'); }
html[data-holiday-theme="mandarin"][data-theme-screen="works"] { --holiday-art: url('holiday-themes/mandarin/works.webp'); }
html[data-holiday-theme="mandarin"][data-theme-screen="bookings"] { --holiday-art: url('holiday-themes/mandarin/bookings.webp'); }
html[data-holiday-theme="mandarin"][data-theme-screen="calendar"] { --holiday-art: url('holiday-themes/mandarin/calendar.webp'); }
html[data-holiday-theme="mandarin"][data-theme-screen="menu"] { --holiday-art: url('holiday-themes/mandarin/menu.webp'); }
html[data-holiday-theme="mandarin"][data-theme-screen="team"] { --holiday-art: url('holiday-themes/mandarin/team.webp'); }
html[data-holiday-theme="mandarin"][data-theme-screen="timesheet"] { --holiday-art: url('holiday-themes/mandarin/timesheet.webp'); }
html[data-holiday-theme="mandarin"][data-theme-screen="manager"] { --holiday-art: url('holiday-themes/mandarin/manager.webp'); }

html:is([data-holiday-theme="newyear"], [data-holiday-theme="mandarin"]) {
  --display: 'Holiday Russo', 'Holiday Golos', 'Segoe UI', sans-serif;
  --body: 'Holiday Golos', 'Segoe UI', sans-serif;
  --vi-shadow: drop-shadow(1px 0 var(--vi-outline)) drop-shadow(-1px 0 var(--vi-outline))
    drop-shadow(0 -1px var(--vi-outline)) drop-shadow(0 2px var(--vi-outline)) drop-shadow(1px 1px var(--vi-edge));
  --gta-display: var(--display);
  --desk-type: var(--display);
  --gta-ink: var(--canvas);
  --gta-cream: var(--ink);
  --desk-cream: var(--ink);
  --gta-muted: var(--muted);
  --desk-soft: var(--muted);
  --gta-panel: var(--surface);
  --gta-card: var(--surface);
  --desk-card: var(--surface);
  --gta-deep: var(--surface);
  --desk-deep: var(--surface);
  --gta-stroke: var(--line);
  --gta-line: var(--line);
  --desk-line: var(--line);
  --gta-divider: var(--line);
  --desk-rule: var(--line);
  --gta-cyan: var(--accent);
  --desk-cyan: var(--accent);
  --gta-pink: var(--punch);
  --desk-pink: var(--punch);
  --gta-coral: var(--punch);
  --desk-coral: var(--punch);
  --gta-warn: var(--warn);
  --desk-warning: var(--warn);
  --gta-error: var(--error);
  --desk-error: var(--error);
  font-family: var(--body);
  background: var(--canvas);
  color: var(--ink);
  accent-color: var(--accent);
  scrollbar-color: var(--line) var(--canvas);

  & :is(body, .app-shell, .workspace) { background: var(--canvas); color: var(--ink); }
  & :is(input, select, textarea) { color-scheme: inherit; }
  & :is(.sidebar, .topbar, .mobile-nav) {
    background: var(--surface);
    border-color: var(--line);
    scrollbar-color: var(--line) var(--surface);
    box-shadow: none;
  }
  & .app-variant-beta .app-variant-banner {
    background: var(--tint);
    color: var(--accent);
    border-color: var(--line);
  }
  & .sidebar :is(.brand, .sidebar-user), & .page-footer { border-color: var(--line); }
  & :is(.connection-note, .breadcrumb span, .sidebar-caption, .page-footer) { color: var(--muted); }
  & :is(.sidebar .desktop-wordmark, .gta-wordmark) {
    transform: none;
    color: #fff4de;
    font-family: var(--display);
    font-weight: 400;
    line-height: .97;
    -webkit-text-stroke: 1.4px var(--vi-outline);
    paint-order: stroke fill;
    text-shadow: 1px 2px var(--vi-outline), 2px 3px var(--vi-edge);
  }
  & .sidebar .desktop-wordmark { font-size: clamp(18px, 1.55vw, 29px); }
  & .gta-wordmark { font-size: 15px; }
  & :is(.gta-wordmark, .desktop-wordmark) b { font-weight: 400; }
  & :is(.mobile-nav, .desktop-nav) .nav-item { color: var(--muted); }
  & :is(.mobile-nav, .desktop-nav) .nav-item:is(:hover, .active) {
    color: var(--accent);
    background: var(--tint);
    border-color: var(--line);
  }
  & .nav-item.active::before, & .gta-wordmark::after, & .desktop-wordmark::after { background: var(--punch); }
  & .topbar :is(.icon-button, .pwa-install-button), & #sidebar-toggle {
    background: var(--surface);
    color: var(--accent);
    border-color: var(--line);
  }
  & :is(.topbar, .month-switcher) .icon-button:hover:not(:disabled) { color: var(--accent); background: var(--tint); }
  & :is(.topbar .report-warning-button, .order-rate-warning) { color: var(--warn); }
  & .sidebar-user .avatar, & .person-label .avatar, & .employee-button .avatar, & .activity-person .avatar,
  & :is(.role-chip, .work-icon, .order-works .work-icon, .booking-car-icon, .support-card .metric-icon, .payroll-rate) {
    background: var(--tint);
    border-color: var(--line);
    color: var(--accent);
  }

  /* In the original layouts the title can be visually hidden and the garage
     photo is behind the total. Give the illustration a single consistent place. */
  & #main:has(#page-title) .page-heading {
    display: grid;
    grid-template-columns: minmax(0,1fr) minmax(0,1.4fr);
    align-items: stretch;
    min-height: 0;
    padding: 0;
    gap: 0;
    margin: 4px 0 17px;
    overflow: hidden;
    border: 1px solid var(--rule);
    border-radius: 7px;
    background: var(--ribbon);
    box-shadow: 0 2px 0 var(--rule);
  }
  & #main:has(#page-title) .page-heading::before {
    content: '';
    display: block;
    grid-area: 1 / 2;
    min-height: clamp(130px, 13vw, 192px);
    background: var(--holiday-art) center / cover no-repeat;
    border-left: 1px solid var(--rule);
  }
  & #main:has(#page-title) .page-heading > div:first-child,
  & #main:not(.manager-payroll-view):has(#view-content > .overview-grid, #view-content > .team-overview) .page-heading > div:first-child {
    position: static;
    grid-area: 1 / 1;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    width: auto;
    height: auto;
    min-height: 0;
    padding: clamp(12px, 1.6vw, 26px);
    margin: 0;
    overflow: visible;
    clip-path: none;
    white-space: normal;
    border: none;
    border-inline-start: 6px solid var(--stripe);
    border-radius: 0;
    background: var(--ribbon-finish);
  }
  & #main .page-heading #page-title {
    max-width: 100%;
    font: 400 clamp(23px, 2.3vw, 38px)/1.15 var(--display);
    letter-spacing: -.03em;
    text-transform: uppercase;
    overflow-wrap: anywhere;
    text-wrap: balance;
    color: #fff2dd;
    -webkit-text-stroke: 0;
    text-shadow: none;
    filter: var(--vi-shadow);
  }
  & #main .page-heading :is(#page-description, #page-eyebrow) { display: none; }
  &[data-theme-screen="works"] #main:has(#page-title) .page-heading {
    grid-template-columns: minmax(0, 1fr) 28%;
    margin-block: 4px 12px;
  }
  &[data-theme-screen="works"] #main:has(#page-title) .page-heading::before {
    grid-area: 1 / 2;
    min-height: 52px;
    aspect-ratio: auto;
    border: 0;
    border-inline-start: 1px solid var(--rule);
  }
  &[data-theme-screen="works"] #main:has(#page-title) .page-heading > div:first-child {
    grid-area: 1 / 1;
    padding: 9px 12px;
  }
  /* The unfiltered list repeats the page title. Keep its section label for
     assistive technology and keep the distinct filtered heading visible. */
  &[data-theme-screen="works"] section:not(:has(.work-filter-clear)) > .section-title-row:has(#works-heading) {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
  & #main .earnings-card, & #main .team-overview .team-stat:first-child {
    min-height: 0;
    padding: clamp(15px, 2vw, 28px);
    background: var(--reward);
    border-color: var(--rule);
    border-radius: 8px;
    color: var(--reward-ink);
    box-shadow: 0 2px 0 var(--rule);
  }
  & .earnings-card::before, & .earnings-card::after, & .team-overview .team-stat:first-child::before,
  & .team-overview .team-stat:first-child::after, & .earnings-value::after, & .team-overview .team-stat:first-child strong::after { content: none; }
  & #main .earnings-card .earnings-value, & #main .team-stat:first-child strong {
    font-family: var(--body);
    font-size: clamp(37px, 5vw, 72px);
    line-height: 1.15;
    font-weight: 800;
    letter-spacing: -.035em;
    padding: 0 0 .07em;
    color: var(--ink);
    -webkit-text-stroke: 0;
    text-shadow: none;
  }
  & #main :is(.earnings-value, .team-stat:first-child strong)[data-gta-long],
  & #main .earnings-value.missing { font-size: clamp(27px, 4vw, 54px); }
  & #main .earnings-card .currency { color: inherit; font: inherit; }
  @supports (background-clip: text) {
    & #main .page-heading #page-title {
      background: var(--face);
      background-clip: text;
      color: transparent;
    }
  }
  & .earnings-card :is(.earnings-label, .earnings-caption, .metric-value, .metric-label),
  & .team-overview .team-stat:first-child .stat-label { color: var(--reward-ink); text-shadow: none; }
  & .earnings-card .earnings-bottom { margin: 10px 0 0; padding: 0; background: none; }
  & .earnings-card .earnings-card-rule { margin: 12px 0 0; background: var(--line); }
  & .earnings-bottom > div + div { border-color: var(--line); }
  & :is(.metric-value, .hours-value, .quantity-row strong, .team-stat strong, .order-earnings strong,
    .payroll-component-amount, .section-title-row h2, .earnings-trend h2, .dialog-header h2,
    .booking-day-heading h2, .employee-name, .payroll-component h3, .booking-car-name) {
    font-family: var(--display);
    font-weight: 400;
  }
  & .section-title-row h2, & .earnings-trend h2 { letter-spacing: -.025em; }

  & :is(#section-menu, .settings-fields, .feedback-card, .period-panel, .earnings-trend, .booking-controls, .work-calendar-panel,
    .team-table, .activity-table, .work-item, .order-card, .booking-card, .team-stat, .payroll-component,
    .support-card .metric-icon, .activity-table-wrap, .details-dialog, .detail-earnings,
    .pwa-install-dialog .dialog-header, .timesheet-selection-dialog, .timesheet-selection-panel,
    .timesheet-selection-dialog .timesheet-selection-heading, .timesheet-selection-dialog .timesheet-selection-actions) {
    color: var(--ink);
    background: var(--surface);
    border-color: var(--line);
  }
  & .section-link, & .settings-fields > label { color: var(--ink); border-color: var(--line); }
  & .section-link > .icon:first-child, & .section-link > .icon:last-child { color: var(--accent); }
  & :is(.section-link:hover, .booking-summary:hover, .order-summary:hover, .work-item:hover, .inst-row:hover) { background: var(--tint); }
  & :is(.earnings-report-controls .month-switcher, .timesheet-month, .timesheet-month select,
    .settings-fields select, .period-controls input, .period-presets .filter-button, .person-select,
    .booking-owner-filter select, .booking-datebox, .timesheet-field :is(select,input),
    .feedback-card textarea, .feedback-kinds label, .inst-secondary, .timesheet-weeks button,
    .timesheet-departments button, .timesheet-selection-range input, .timesheet-view-switch) {
    border-color: var(--line);
    color: var(--ink);
    box-shadow: none;
    background: var(--surface);
  }
  & :is(.month-switcher select, .booking-datebox input) { color: var(--ink); }
  & select option { color: var(--ink); background: var(--surface); }
  & :is(.filter-button.active, .period-presets .filter-button:is(.active,[aria-pressed="true"]),
    .trend-modes button[aria-pressed="true"], .mobile-earnings-views > button[aria-pressed="true"],
    .timesheet-view-switch button.active, .timesheet-weeks button[aria-pressed="true"],
    .timesheet-departments button[aria-pressed="true"], .booking-day[aria-pressed="true"],
    .primary-button, .inst-primary, .pwa-browser-link, .pwa-browser-link:hover,
    .period-controls .primary-button, .primary-button:hover:not(:disabled)) {
    background: var(--selection);
    border-color: var(--selection);
    color: var(--on-active);
    box-shadow: none;
  }
  & .booking-day[aria-pressed="true"] strong { color: var(--on-active); }
  & :is(.mobile-earnings-views, .trend-modes) > button[aria-pressed="true"]:focus-visible {
    outline: 2px solid var(--on-active);
    outline-offset: -4px;
  }
  & :is(.booking-week, .booking-details, .order-works, .work-calendar-totals, .work-calendar-grid .is-blank,
    .timesheet-group th, .timesheet-summary th, .timesheet-summary td, .timesheet-table .timesheet-total,
    .team-table tfoot td, .team-table tfoot tr, .timesheet-table thead th, .activity-table thead th, .team-table th) {
    color: var(--ink);
    background: var(--raised);
    border-color: var(--line);
  }
  & .booking-day:hover:not([aria-pressed="true"]) { background: var(--tint); }
  & :is(.booking-comment, .booking-concern-text, .trend-axis, .trend-column span,
    .work-calendar-grid .is-blank .work-calendar-mark, .section-link, .booking-plate, .booking-time,
    .feedback-card :is(legend,label), #timesheet-grid .timesheet-band-label) { color: var(--ink); }
  & :is(.work-calendar-grid .is-adjacent, #feedback-length) { color: var(--muted); }
  & :is(.order-vehicle, .order-vehicle .vehicle-plate, .work-calendar-legend, .timesheet-legend) { color: var(--muted); }
  & .work-calendar-grid .is-today { outline-color: var(--accent); box-shadow: inset 0 0 0 3px var(--surface); }
  & .work-calendar-totals :is(dt,dd) { color: var(--ink); }
  & #timesheet-grid .timesheet-table { background: var(--surface); border-color: var(--line); }
  & .timesheet-table .timesheet-person { background: var(--surface); color: var(--ink); box-shadow: none; }
  & .timesheet-table .timesheet-person button { color: var(--ink); }
  & .timesheet-table thead .timesheet-weekend { color: var(--warn); background: var(--soft-warn); }
  & .timesheet-day.timesheet-weekend { background: var(--soft-warn); }
  & .timesheet-remove-button {
    min-height: 44px;
    font-size: 14px;
    color: var(--error);
    background: var(--error-surface);
    border-color: var(--error);
  }
  & .timesheet-remove-button:hover:not(:disabled) {
    color: var(--error-surface);
    background: var(--error);
  }
  & :is(.timesheet-cell, .timesheet-table .is-blank, .timesheet-legend .is-blank) { color: var(--muted); }
  & .trend-series button.trend-column svg { fill: var(--accent); }
  & .trend-series button.trend-column[aria-pressed="true"] {
    background: var(--tint);
    box-shadow: inset 0 0 0 1px var(--accent);
  }
  & .trend-series button.trend-column[aria-pressed="true"] svg { fill: var(--ink); }
  & .trend-series button.trend-column[aria-pressed="true"]::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: 1px;
    width: 8px;
    max-width: 80%;
    height: 5px;
    transform: translateX(-50%);
    background: var(--ink);
    clip-path: polygon(50% 0, 100% 100%, 0 100%);
  }
  & .trend-grid .trend-zero { border-color: var(--muted); }
  & .timesheet-weekend .timesheet-day-heading small, & .timesheet-day-heading small { color: var(--muted); }
  & :is(.timesheet-guide > summary, .timesheet-person-totals > summary,
    .inst-back, .inst-link, .missing-rate-link, .booking-expand, .text-button:hover, .refresh-button:hover) { color: var(--accent); }
  & :is(.order-count, .work-icon, .order-works .work-icon, .booking-car-icon, .payroll-rate,
    .saved-notice, .timesheet-saved, .timesheet-net-preview, .timesheet-bitrix-preview, .mapping-access.ready,
    .formula, .timesheet-current-value, .inst-segments, .inst-photo, #tool-preview) {
    color: var(--accent); background: var(--tint); border-color: var(--line);
  }
  & :is(.notice, .activity-period-empty, .mapping-access.unknown, .demo-banner) {
    background: var(--soft-warn); color: var(--warn); border-color: var(--line);
  }
  & .notice.error, & .feedback-card [role="alert"] { color: var(--error); background: var(--surface); }
  & .skeleton { background-image: linear-gradient(90deg, var(--tint), var(--raised), var(--tint)); }
  & :is(.sidebar, .instruments-view, dialog) {
    --inst-line: var(--line); --inst-surface: var(--surface);
    --inst-accent: var(--accent); --inst-text: var(--ink); --inst-muted: var(--muted);
  }
  & .inst-choice[aria-pressed="true"] { background: var(--selection); color: var(--on-active); }
  & :is(.inst-inactive, .inst-error, .inst-access-remove) { color: var(--error); }
  & .inst-status { color: var(--accent); }
  & .app-shell :where(button, input, a, select, textarea, summary):focus-visible { outline-color: var(--accent); }
}

/* Mark colours remain distinct in the light theme, including in edit dialogs. */
html[data-holiday-theme="mandarin"] :is(.timesheet-table, .timesheet-legend, .work-calendar-grid, .work-calendar-legend, .timesheet-selection-calendar) {
  & .is-hours { background: #d6e9dc; color: #164733; }
  & .is-off { background: #dfeafa; color: #2a466b; }
  & .is-leave { background: #eee2f4; color: #56386b; }
  & .is-sick { background: #ffedc6; color: #704600; }
  & .is-extra { background: #ccebe9; color: #085454; }
  & .is-absence { background: #f6dcd9; color: #793531; }
  & .is-other { background: #e6e8e5; color: #3c504e; }
  & .work-calendar-mark { color: inherit; }
}

@media (max-width: 700px), (orientation: landscape) and (pointer: coarse) and (max-height: 500px) and (max-width: 960px) {
  html:is([data-holiday-theme="newyear"], [data-holiday-theme="mandarin"]) {
    & #main:has(#page-title) .page-heading,
    & #main:not(.manager-payroll-view):has(#view-content > .overview-grid, #view-content > .team-overview) .page-heading {
      grid-template-columns: minmax(0,1fr);
      margin: 3px 0 13px;
    }
    & #main:has(#page-title) .page-heading::before {
      grid-area: 1 / 1;
      min-height: 0;
      aspect-ratio: 2.55;
      max-height: 186px;
      border: none;
      border-bottom: 1px solid var(--rule);
    }
    & #main:has(#page-title) .page-heading > div:first-child,
    & #main:not(.manager-payroll-view):has(#view-content > .overview-grid, #view-content > .team-overview) .page-heading > div:first-child {
      grid-area: 2 / 1;
      padding: 8px 13px 9px;
    }
    & #main .page-heading #page-title { font-size: clamp(21px, 5.8vw, 29px); }
    & #main .earnings-card, & #main .team-overview .team-stat:first-child { padding: 14px 16px 15px; }
    & #main .earnings-card .earnings-value, & #main .team-stat:first-child strong { font-size: clamp(35px, 10.9vw, 54px); }
    & #main .earnings-card .earnings-value:is([data-gta-long],.missing), & #main .team-stat:first-child strong[data-gta-long] { font-size: clamp(27px, 8vw, 46px); }
    & :is(.support-card .hours-value, .support-card .support-card-header, .support-card .quantity-row) { background: var(--raised); border-color: var(--line); }
  }
}
@media (max-height: 520px) and (max-width: 960px) and (orientation: landscape) {
  html[data-holiday-theme] #main:has(#page-title) .page-heading::before { max-height: 98px; }
}
