:root {
    --interface-surface: #fff;
    --interface-soft: #f5f7fa;
    --interface-border: #dfe5ec;
    --interface-text: #243247;
    --interface-muted: #596779;
    --interface-accent: #526781;
    --interface-shadow: 0 4px 16px rgba(20, 35, 55, .04);
    --interface-radius: 16px;
    --interface-card-inline: 24px;
    --interface-card-block: 24px;
    --interface-card-padding: var(--interface-card-block) var(--interface-card-inline);
    --interface-card-gap: 24px;
    --interface-card-action-size: 60px;
    --interface-card-action-background: #fafafa;
    --interface-card-action-border: #d9dde2;
    --interface-card-action-hover: #f3f4f6;
    --interface-card-action-hover-border: #c9cdd2;
    --interface-section-content-gap: 12px;
    --interface-page-title-size: clamp(22px, 4vw, 28px);
    --interface-section-title-size: 17px;
    --notify-before-background: linear-gradient(135deg, #FFF9DB, #FEF3C7);
    --notify-before-border: #E7C85A;
}

body.dark-mode {
    --interface-card-action-background: #292b30;
    --interface-card-action-border: #4a4d53;
    --interface-card-action-hover: #303238;
    --interface-card-action-hover-border: #555960;
    --interface-surface: var(--dark-surface, #292a2e);
    --interface-soft: var(--dark-bg-secondary, #27282b);
    --interface-border: var(--dark-border, #44464b);
    --interface-text: var(--dark-text, #f1f1f1);
    --interface-muted: var(--dark-text-secondary, #b8bac0);
    --interface-accent: #a7b8d0;
    --notify-before-background: linear-gradient(135deg, #4A4020, #3A321B);
    --notify-before-border: #A88E32;
}

body.technician-interface {
    --interface-section-content-gap: 14px;
}

body.technician-module {
    --interface-card-inline: 14px;
    --interface-card-block: 12px;
    --interface-card-padding: var(--interface-card-block) var(--interface-card-inline);
    --interface-card-gap: 16px;
    --interface-section-content-gap: 10px;
    --interface-page-title-size: clamp(21px, 3vw, 24px);
    --technician-section-title-size: 16px;
}

@media (max-width: 600px) {
    :root {
        --interface-card-inline: 16px;
        --interface-card-block: 18px;
    }
}

body.technician-interface :where(#content) :is(h1, .interface-page-title) {
    color: var(--interface-text);
    font-size: var(--interface-page-title-size);
    font-weight: 700;
    line-height: 1.25;
    text-align: left;
    overflow-wrap: anywhere;
}

body.technician-interface :where(#content) :is(h1, h2):has(.interface-page-title) {
    margin: 0 0 4px;
    line-height: 1.25;
}

body.technician-module #content :is(h1, h2):has(.interface-page-title) {
    display: flow-root;
    margin: 0 0 var(--interface-section-content-gap);
    font-size: var(--interface-page-title-size);
}

body.technician-interface :where(#content) .interface-breadcrumb {
    color: var(--interface-muted);
    font-size: 14px;
}

body.technician-interface :where(#content) .section {
    border-radius: var(--interface-radius);
    box-shadow: var(--interface-shadow);
}

body.technician-interface :where(#content) .section:not(:where(.service-detail *)) {
    margin-block: 0 var(--interface-card-gap);
}

body.technician-interface :where(#content) .parcours-section {
    display: block;
    border-radius: var(--interface-radius);
}

body.technician-interface :where(#content) .parcours-section:focus-visible {
    outline-offset: 2px;
}

body.dark-mode .work-order-list-card > a.parcours-section {
    color: var(--interface-text);
    text-decoration: none;
}

body.technician-interface :where(#content) .parcours-section:hover > .section:not(.call-card-with-status, .card-with-open-punch) {
    border-color: var(--interface-accent);
}

body.technician-interface :where(#content) .section:not(:where(.service-detail *, .section-client, .note-client, .client-directory *, .search-criteria, .payment-section, .signature-section)) {
    background-color: var(--interface-surface);
    border-color: var(--interface-border);
    color: var(--interface-text);
}

.call-list-grid,
.work-order-list-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-auto-rows: 1fr;
    gap: var(--interface-card-gap);
}

@media (min-width: 600px) {
    .call-list-grid,
    .work-order-list-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 900px) {
    .call-list-grid,
    .work-order-list-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

body.technician-interface :where(#content) .call-list-grid > .parcours-section {
    display: flex;
    min-width: 0;
}

body.technician-interface :where(#content) .call-list-grid .call-card {
    flex: 1;
    min-width: 0;
    min-height: 340px;
    margin: 0;
    overflow-wrap: anywhere;
}

body.technician-interface :where(#content) .section.call-card-with-status {
    border-inline-start: 4px solid var(--call-status-color);
}

body.technician-interface :where(#content) .section.call-card-with-status > .section-header {
    margin-block-start: calc(-1 * var(--interface-card-block));
    margin-inline: calc(-1 * var(--interface-card-inline));
    padding: 12px var(--interface-card-inline);
    background-color: color-mix(in srgb, var(--call-status-color) 14%, var(--interface-surface));
}

body.technician-interface :where(#content) .section:not(:where(.service-detail *, .search-criteria, .client-documents, .purchased-services, .call-history, .client-directory *, .section-client, .section-list, .note-client, .payment-section, .signature-section, :has(> .map-section-heading), :has(#myMap))) {
    padding: var(--interface-card-padding);
}

body.technician-interface :where(#content) .section:not(:where(.service-detail *, .search-criteria, .client-documents, .purchased-services, .call-history, .client-directory *, .section-client, .section-list, .note-client, .payment-section, .signature-section, :has(> .map-section-heading), :has(#myMap))) .section-header {
    margin: 0 0 var(--interface-section-content-gap);
    padding: 0 0 10px;
    border-bottom-color: var(--interface-border);
    color: var(--interface-text);
}

body.technician-interface :where(#content) .section .section-header {
    background-color: transparent;
}

body.technician-interface :where(#content) .section-header:is(.titre, .client-profile-section-heading),
body.technician-interface :where(#content) .section-header :is(h2, h3, h4),
body.technician-interface :where(#content) .client-card :is(h2, h3),
body.technician-interface :where(#content) .parcours-title {
    font-size: var(--interface-section-title-size);
    font-weight: 700;
    line-height: 1.4;
}

body.technician-module :where(#content) .section .section-header,
body.technician-module :where(#content) .section .section-header > :is(h2, h3, h4),
body.technician-module :where(#content) :is(.service-group-title, .parcours-title, .client-card h3) {
    font-size: var(--technician-section-title-size);
    font-weight: 700;
    line-height: 1.4;
    text-transform: none;
}

body.technician-module :where(#content) .section .section-header > :is(h2, h3, h4) {
    margin-block: 0;
}

body.technician-module :where(#content) .section:not(:where(.call-card-with-status, .search-criteria)) > .section-header:not(:where(.map-section-heading, .client-document-heading, .client-profile-section-heading, .client-contract-year-heading, .purchased-services-toggle, .call-history-heading, .technician-help-banner)),
body.technician-module :where(#content) .service-group-title {
    margin-block: 0 var(--interface-section-content-gap);
}

body.technician-module :where(#content) .search-criteria-title {
    font-size: var(--technician-section-title-size);
    font-weight: 700;
}

body.technician-interface :where(#content) .section:not(:where(.service-detail *, .search-criteria, .client-documents, .purchased-services, .client-directory *, .section-client, .section-list, .note-client, .payment-section, .signature-section, :has(> .map-section-heading), :has(#myMap))) > :is(.section-seperator, .section-footer) {
    margin-inline: 0;
    border-color: var(--interface-border);
}

body.technician-interface :where(#content) .section:not(:where(.service-detail *, .search-criteria, .client-documents, .purchased-services, .client-directory *, .section-client, .section-list, .note-client, .payment-section, .signature-section, :has(> .map-section-heading), :has(#myMap))) > .section-footer {
    margin-bottom: 0;
    padding-inline: 0;
}

body.technician-interface :where(#content) .section.search-criteria {
    --criteria-bg: var(--interface-surface);
    --criteria-bar: var(--interface-surface);
    --criteria-border: var(--interface-border);
    --criteria-text: var(--interface-text);
    --criteria-muted: var(--interface-muted);
    background: var(--criteria-bg);
    border-color: var(--criteria-border);
}

body.technician-interface :where(#content) .parcours-card > .parcours-section {
    min-height: 390px;
    color: inherit;
}

body.technician-interface :where(#content) :is(.section, .section .section-header).technician-help-banner {
    background-color: #dbeafe;
    color: #1d4ed8;
    font-weight: 700;
    text-align: center;
}

body.technician-interface :where(#content) .section .section-header.technician-help-banner {
    margin-block-start: calc(-1 * var(--interface-card-block));
    margin-inline: calc(-1 * var(--interface-card-inline));
    padding: 10px var(--interface-card-inline);
}

.parcours-punch-status {
    margin: 0 calc(-1 * var(--interface-card-inline)) var(--interface-section-content-gap);
    padding: 12px var(--interface-card-inline);
    min-height: 44px;
    box-sizing: border-box;
    background-color: var(--punch-background);
    color: var(--punch-text, #241c0b);
    font-weight: 700;
}

body.technician-interface :where(#content) .section.card-with-open-punch {
    --open-punch-border: var(--punch-accent);
    border: 3px solid var(--open-punch-border);
}

body.dark-mode.technician-interface :where(#content) .section.card-with-open-punch {
    --open-punch-border: color-mix(in srgb, var(--punch-accent) 55%, var(--punch-background));
}

@media (prefers-reduced-motion: no-preference) {
    body.technician-interface :where(#content) .section.card-with-open-punch,
    .search-criteria-actions .work-order-current-link {
        animation: open-punch-border-pulse 1.8s ease-in-out infinite;
    }
}

@keyframes open-punch-border-pulse {
    0%, 100% {
        border-color: var(--open-punch-border);
    }

    50% {
        border-color: color-mix(in srgb, var(--open-punch-border) 25%, var(--punch-background));
        box-shadow: 0 0 0 4px color-mix(in srgb, var(--punch-accent) 35%, transparent);
    }
}

.card-with-open-punch .parcours-punch-status {
    color: var(--punch-accent);
}

.search-criteria-actions > .work-order-current-action {
    margin-inline-end: auto;
}

.button.work-order-current-link {
    --open-punch-border: var(--punch-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    width: 100%;
    margin: 0;
}

.button.work-order-current-button {
    height: 42px;
    font-weight: 700;
    text-decoration: none;
}

.button.work-order-current-button:not(:disabled) {
    border-color: var(--punch-accent);
    background-color: var(--punch-background);
    color: var(--punch-accent);
}

.button.work-order-current-button:not(:disabled):hover {
    background-color: color-mix(in srgb, var(--punch-background) 90%, var(--punch-accent));
}

.button.work-order-current-button:focus-visible {
    outline: 2px solid var(--punch-accent);
    outline-offset: 2px;
}

.parcours-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--interface-section-content-gap);
    margin-top: var(--interface-section-content-gap);
    padding-top: var(--interface-section-content-gap);
    border-top: 1px solid var(--interface-border);
}

.parcours-card-actions .parcours-action-button {
    appearance: none;
    box-sizing: border-box;
    flex: 0 0 var(--interface-card-action-size);
    width: var(--interface-card-action-size);
    height: var(--interface-card-action-size);
    min-height: var(--interface-card-action-size);
    margin: 0;
    padding: 0;
    border-color: var(--interface-card-action-border);
    background-color: var(--interface-card-action-background);
    background-image: var(--parcours-action-icon);
    background-repeat: no-repeat;
    background-position: center;
    background-size: 32px;
}

.parcours-card-actions .parcours-action-button:enabled:hover {
    background-color: var(--interface-card-action-hover);
    border-color: var(--interface-card-action-hover-border);
}

body .parcours-card-actions .parcours-action-button:disabled {
    --disabled-icon-overlay: color-mix(in srgb, var(--interface-card-action-background) 55%, transparent);
    background-color: var(--interface-card-action-background);
    background-image: linear-gradient(var(--disabled-icon-overlay), var(--disabled-icon-overlay)), var(--parcours-action-icon);
    border-color: var(--interface-card-action-border);
    border-style: dashed;
    filter: none;
    opacity: 1;
}

.parcours-card-actions .parcours-action-reset {
    --parcours-action-icon: url('../Images/cloud_reload.png');
}

.parcours-card-actions .parcours-action-notify {
    --parcours-action-icon: url('../Images/notify.png');
}

body.dark-mode .parcours-card-actions .parcours-action-reset {
    --parcours-action-icon: url('../Images/cloud_reload_dark.png');
}

body.dark-mode .parcours-card-actions .parcours-action-notify {
    --parcours-action-icon: url('../Images/notify_dark.png');
}

body:not(.technician-module) .technician-stats {
    --interface-card-inline: 16px;
    --interface-card-block: 14px;
    --interface-card-gap: 18px;
}

.technician-stats .section .section-seperator {
    margin-inline: 0;
    border-bottom-color: var(--interface-border);
}

.technician-stats .stats-total-caption {
    display: inline-block;
    min-width: 150px;
}

body.technician-module :where(#content) .section > :is(.map-section-heading, .client-document-heading, .client-profile-section-heading, .client-contract-year-heading, .call-history-heading) {
    min-height: 56px;
    margin-block: 0;
    padding: 0 var(--interface-card-inline);
}

.section.technician-map-card {
    padding: 0;
}

.section.technician-map-card > .map-section-heading {
    margin: 0;
    padding: 0 var(--interface-card-inline);
}

.technician-map-card iframe {
    display: block;
    width: 100%;
    margin: 0;
}

.technician-map-caption {
    padding: var(--interface-card-padding);
}

.call-detail-metadata {
    margin-block-start: 10px;
    padding-block-start: 10px;
    border-block-start: 1px solid var(--interface-border);
}

body.technician-interface :where(#content) :is(.call-detail, .client-profile) .client-document-heading,
body.technician-interface :where(#content) .call-detail .purchased-services > .section-header {
    padding-inline: var(--interface-card-inline);
}

:is(.call-detail, .client-profile) .client-document-content {
    padding: var(--interface-card-padding);
}

.call-detail-actions {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, 1fr);
    gap: 12px;
}

.call-detail-actions :is(input[type="submit"], input[type="button"], .client-return-button) {
    margin: 0;
}

@media (max-width: 599px) {
    .call-detail-actions {
        grid-auto-flow: row;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .call-detail-actions > :nth-child(3):last-child {
        grid-column: 1 / -1;
    }
}

.work-order-footer-actions .work-order-service-call {
    width: 100%;
    margin-top: 0;
}

@media (max-width: 899px) {
    .work-order-footer-actions[class-usoft~="row"] {
        display: grid;
        grid-template-columns: repeat(6, minmax(0, 1fr));
        gap: 10px;
        margin-inline: 0;
    }

    .work-order-footer-actions::before,
    .work-order-footer-actions::after {
        display: none;
    }

    .work-order-footer-actions > [class-usoft~="col"] {
        grid-column: span 3;
        min-width: 0;
        width: auto;
        padding: 0;
    }

    .work-order-footer-actions:has(> :last-child:nth-child(odd)) > :nth-last-child(-n+3) {
        grid-column: span 2;
    }

    .work-order-footer-actions :is(input, button, .client-return-button) {
        margin: 0;
        padding-inline: 4px;
    }

    .work-order-footer-actions .work-order-service-call {
        padding-block: 0;
        line-height: 1.15;
        white-space: normal;
    }
}

.work-order-timer {
    margin-bottom: 10px;
}

.work-order-notice {
    margin: 0 15px var(--interface-section-content-gap);
    padding: 9px 12px;
    border-inline-start: 3px solid var(--work-order-notice-color);
    border-radius: 6px;
    background: color-mix(in srgb, var(--work-order-notice-color) 10%, var(--interface-surface));
    color: var(--interface-text);
    font-size: 14px;
    font-weight: 600;
}

.section > .work-order-notice {
    margin-inline: 0;
}

.work-order-notice-confirmed {
    --work-order-notice-color: #43845b;
}

.work-order-notice-wait {
    --work-order-notice-color: var(--text-danger);
}

.work-order-notice-notify {
    --work-order-notice-color: var(--notify-before-border);
    background: var(--notify-before-background);
}

body.technician-interface :where(#content) .section :where(input:not([type]), input:is([type="text"], [type="tel"], [type="email"], [type="date"], [type="number"], [type="search"], [type="password"]), select, textarea) {
    border-radius: 8px;
    max-inline-size: 100%;
}

body.technician-interface :where(#content) .section :where(input:not([type]), input:is([type="text"], [type="tel"], [type="email"], [type="date"], [type="number"], [type="search"], [type="password"]), select, textarea):focus-visible {
    outline: 2px solid var(--interface-accent);
    outline-offset: 1px;
}

.interface-message-page {
    margin: 0;
    background: var(--interface-soft);
}

body:is(.technician-interface, .interface-map-page) .map-control-button {
    box-sizing: border-box;
    min-width: 52px;
    min-height: 52px;
    border-color: var(--interface-border);
    border-radius: 8px;
    background-color: var(--interface-surface);
    box-shadow: var(--interface-shadow);
}

body:is(.technician-interface, .interface-map-page) .map-control-button:hover {
    background-color: var(--interface-soft);
}

body:is(.technician-interface, .interface-map-page) .map-control-button:focus-visible {
    outline: 2px solid var(--interface-accent);
    outline-offset: 2px;
}

.interface-message {
    max-width: 720px;
    margin: var(--interface-card-gap);
    padding: var(--interface-card-padding);
    border: 1px solid var(--interface-border);
    border-radius: var(--interface-radius);
    background: var(--interface-surface);
    box-shadow: var(--interface-shadow);
    color: var(--interface-text);
    font: 15px/1.5 'Segoe UI', Arial, sans-serif;
}

.interface-message h1 {
    margin: 0 0 8px;
    font-size: var(--interface-page-title-size);
    line-height: 1.25;
}

.interface-message p {
    margin: 0;
    color: var(--interface-muted);
}

@media (prefers-color-scheme: dark) {
    .interface-message-page {
        --interface-surface: #292a2e;
        --interface-soft: #27282b;
        --interface-border: #44464b;
        --interface-text: #f1f1f1;
        --interface-muted: #b8bac0;
    }
}
