:root {
    --portal-sidebar-width: 252px;
    --portal-content-max-width: 1600px;
    --portal-content-padding-x: 28px;
    --portal-tablet-content-padding-x: 22px;
    --portal-touch-target-size: 44px;
    --portal-header-height: 76px;
    --portal-safe-area-top: env(safe-area-inset-top, 0px);
    --portal-safe-area-right: env(safe-area-inset-right, 0px);
    --portal-safe-area-bottom: env(safe-area-inset-bottom, 0px);
    --portal-safe-area-left: env(safe-area-inset-left, 0px);
    --portal-navy: #062746;
    --portal-navy-deep: #031d35;
    --portal-blue: #1769e8;
    --portal-blue-soft: #eaf2ff;
    --portal-text: #10213a;
    --portal-muted: #66758b;
    --portal-border: #e4eaf2;
    --portal-background: #f5f7fb;
    --portal-card: #ffffff;
}

@media (max-width: 767.98px) {
    :root {
        --portal-header-height: 68px;
    }
}

@media (min-width: 768px) and (max-width: 991.98px) {
    :root {
        --portal-header-height: 64px;
    }
}

@media (min-width: 992px) and (max-width: 1279.98px) {
    :root {
        --portal-header-height: 68px;
    }
}

* {
    box-sizing: border-box;
}

body {
    min-width: 320px;
    margin: 0;
    color: var(--portal-text);
    background: var(--portal-background);
    font-family: Inter, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.portal-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 1030;
    width: var(--portal-sidebar-width);
    color: #fff;
    background: linear-gradient(180deg, var(--portal-navy) 0%, var(--portal-navy-deep) 100%);
    box-shadow: 8px 0 24px rgba(11, 34, 61, 0.08);
}

.sidebar-inner {
    display: flex;
    flex: 1;
    flex-direction: column;
    min-height: 100%;
    padding: calc(22px + var(--portal-safe-area-top))
        14px
        calc(22px + var(--portal-safe-area-bottom))
        max(14px, var(--portal-safe-area-left));
}

.brand {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 0 12px;
    color: #fff;
    text-decoration: none;
}

.brand-logo {
    display: block;
    width: auto;
    height: 63px;
    max-width: 100%;
}

.sidebar-nav {
    display: grid;
    gap: 5px;
    margin-top: 26px;
}

.nav-section-label {
    padding: 14px 14px 2px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.customer-map-toolbar {
    padding: 12px;
}

.customer-map-container {
    position: relative;
}

.customer-map {
    min-height: 560px;
    height: calc(100vh - 260px);
    border-top: 1px solid var(--portal-border);
}

.customer-map-popup h3 {
    margin: 0 0 8px;
    font-size: 1rem;
}

.customer-map-popup p {
    margin-bottom: 8px;
}

.customer-map-popup .btn-primary,
.customer-map-popup .btn-primary:visited {
    color: #fff;
}

.customer-map-marker-container {
    background: transparent;
    border: 0;
}

.customer-map-marker {
    display: block;
    width: 28px;
    height: 28px;
    border: 3px solid #fff;
    border-radius: 50% 50% 50% 0;
    box-shadow: 0 2px 5px rgba(15, 23, 42, 0.35);
    background: var(--customer-marker-color);
    transform: rotate(-45deg);
}

.customer-map-marker--blue {
    --customer-marker-color: #2563eb;
}

.customer-map-marker--red {
    --customer-marker-color: #dc2626;
}

.customer-map-marker--black {
    --customer-marker-color: #111827;
}

.customer-map-marker--yellow {
    --customer-marker-color: #facc15;
}

.customer-map-legend {
    position: absolute;
    z-index: 500;
    top: 12px;
    right: 12px;
    display: grid;
    gap: 6px;
    padding: 10px 12px;
    border: 1px solid var(--portal-border);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.12);
    color: var(--portal-text);
    font-size: 0.78rem;
}

.customer-map-legend > label {
    display: flex;
    align-items: center;
    gap: 7px;
    margin: 0;
    white-space: nowrap;
    cursor: pointer;
}

.customer-map-legend input[type="checkbox"] {
    width: 13px;
    height: 13px;
    margin: 0;
    accent-color: var(--portal-primary);
}

.customer-map-legend-marker {
    width: 11px;
    height: 11px;
    flex: 0 0 11px;
    border: 1px solid rgba(15, 23, 42, 0.3);
    border-radius: 50%;
    background: var(--customer-marker-color);
}

.customer-map-legend-actions {
    display: flex;
    justify-content: flex-end;
    gap: 5px;
    padding-top: 4px;
    border-top: 1px solid var(--portal-border);
    color: var(--portal-muted);
}

.customer-map-legend-actions button {
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--portal-primary);
    font: inherit;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.nav-entry {
    display: flex;
    align-items: center;
    gap: 13px;
    min-height: 48px;
    padding: 0 14px;
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.88);
    font-size: 0.94rem;
    font-weight: 500;
    text-decoration: none;
    transition: background-color 160ms ease, color 160ms ease;
}

.nav-entry i {
    width: 22px;
    font-size: 1.1rem;
    text-align: center;
}

a.nav-entry:hover,
a.nav-entry:focus-visible {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

.nav-entry.active {
    color: #fff;
    background: linear-gradient(135deg, #2879f4, #1762dd);
    box-shadow: 0 8px 20px rgba(10, 90, 220, 0.28);
}

.placeholder-entry {
    cursor: default;
}

.placeholder-entry::after {
    content: "später";
    margin-left: auto;
    color: rgba(255, 255, 255, 0.44);
    font-size: 0.66rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.sidebar-footer {
    display: grid;
    gap: 3px;
    margin-top: auto;
    padding-top: 24px;
}

.portal-content {
    min-height: 100vh;
    margin-left: var(--portal-sidebar-width);
}

.auth-content {
    min-height: 100vh;
    display: flex;
    align-items: center;
    background: var(--portal-background);
}

.auth-content .portal-main {
    max-width: 720px;
}

.portal-header {
    position: sticky;
    top: 0;
    z-index: 1020;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: calc(var(--portal-header-height) + var(--portal-safe-area-top));
    padding: var(--portal-safe-area-top)
        max(
            var(--portal-content-padding-x),
            calc((100% - var(--portal-content-max-width)) / 2 + var(--portal-content-padding-x)),
            var(--portal-safe-area-right)
        )
        0
        max(
            var(--portal-content-padding-x),
            calc((100% - var(--portal-content-max-width)) / 2 + var(--portal-content-padding-x)),
            var(--portal-safe-area-left)
        );
    border-bottom: 1px solid var(--portal-border);
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(12px);
}

.portal-header h1 {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 720;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-date,
.notification-button {
    align-items: center;
    justify-content: center;
    min-height: 42px;
    border: 1px solid var(--portal-border);
    border-radius: 10px;
    background: #fff;
}

.header-date {
    display: flex;
    gap: 9px;
    padding: 0 14px;
    color: var(--portal-muted);
    font-size: 0.84rem;
}

.notification-button {
    display: inline-flex;
    width: 42px;
    color: var(--portal-text);
    position: relative;
}

.notification-count {
    position: absolute;
    top: -6px;
    right: -6px;
    min-width: 20px;
    padding: 2px 6px;
    border-radius: 999px;
    background: var(--bs-danger);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    line-height: 1.2;
    text-align: center;
}

.user-summary {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 132px;
}

.user-summary strong,
.user-summary small {
    display: block;
}

.user-summary strong {
    font-size: 0.83rem;
}

.user-summary small {
    color: var(--portal-muted);
    font-size: 0.73rem;
}

.user-initials {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    color: #fff;
    background: var(--portal-navy);
    font-size: 0.78rem;
    font-weight: 700;
}

.mobile-menu-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: var(--portal-touch-target-size);
    min-width: var(--portal-touch-target-size);
    height: var(--portal-touch-target-size);
    padding: 0;
    border: 1px solid var(--portal-border);
    color: var(--portal-text);
    background: #fff;
}

.portal-main {
    width: 100%;
    max-width: var(--portal-content-max-width);
    margin: 0 auto;
    padding: 26px
        max(var(--portal-content-padding-x), var(--portal-safe-area-right))
        calc(42px + var(--portal-safe-area-bottom))
        max(var(--portal-content-padding-x), var(--portal-safe-area-left));
}

.tablet-touch-target {
    min-width: var(--portal-touch-target-size);
    min-height: var(--portal-touch-target-size);
}

.safe-area-inline {
    padding-right: var(--portal-safe-area-right);
    padding-left: var(--portal-safe-area-left);
}

.safe-area-bottom {
    padding-bottom: var(--portal-safe-area-bottom);
}

.tablet-content-gutter {
    padding-right: var(--portal-tablet-content-padding-x);
    padding-left: var(--portal-tablet-content-padding-x);
}

.page-intro h2 {
    margin: 0;
    font-size: clamp(1.45rem, 2vw, 1.85rem);
    font-weight: 750;
    letter-spacing: -0.025em;
}

.eyebrow {
    margin: 0 0 5px;
    color: var(--portal-blue);
    font-size: 0.72rem;
    font-weight: 750;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.sample-label,
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    border-radius: 999px;
    color: #3f5c82;
    background: var(--portal-blue-soft);
    font-size: 0.75rem;
    font-weight: 650;
}

.sample-label {
    padding: 9px 13px;
}

.status-badge {
    padding: 6px 10px;
}

.sampling-status-open {
    color: #495057;
    background: #e9ecef;
}

.sampling-status-completed,
.sampling-result-positive {
    color: #17653a;
    background: #dff3e7;
}

.sampling-status-due {
    color: #111;
    background: #ffd966;
}

.sampling-result-negative {
    color: #842029;
    background: #f8d7da;
}

.sampling-result-open {
    color: #495057;
    background: #e9ecef;
}

.sampling-success-marker,
.sampling-result-swatch {
    display: inline-block;
    flex: 0 0 auto;
    width: 16px;
    height: 16px;
    border: 1px solid rgba(17, 24, 39, 0.35);
    border-radius: 50%;
    vertical-align: middle;
}

.sampling-successful,
.sampling-result-swatch.sampling-result-positive {
    background: #2f9e5b;
}

.sampling-failed,
.sampling-result-swatch.sampling-result-negative {
    background: #d94a4a;
}

.sampling-mixed {
    background: linear-gradient(90deg, #2f9e5b 50%, #d94a4a 50%);
}

.sampling-pending,
.sampling-result-swatch.sampling-result-open {
    background: #adb5bd;
}

.sampling-due-marker {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 18px;
    clip-path: polygon(50% 0, 100% 100%, 0 100%);
    color: #111;
    background: #111;
    font-size: 11px;
    font-style: normal;
    font-weight: 800;
    line-height: 1;
    position: relative;
}

.sampling-due-marker::before {
    position: absolute;
    inset: 2px;
    clip-path: polygon(50% 0, 100% 100%, 0 100%);
    background: #ffd43b;
    content: '';
}

.sampling-due-marker::after {
    position: relative;
    z-index: 1;
    margin-top: 5px;
    color: #111;
    content: '!';
    font-size: 11px;
    font-weight: 900;
    line-height: 1;
}

.sampling-legend,
.sampling-detail-legend {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 16px;
    color: var(--portal-muted);
    font-size: 0.75rem;
}

.sampling-legend span,
.sampling-detail-legend span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.sampling-legend-card .sampling-legend {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
}

.calendar-card {
    padding: 18px;
    overflow: hidden;
}

.calendar-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.calendar-filter {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 11px;
    border: 1px solid #e4e9f0;
    border-radius: 999px;
    color: #44546a;
    background: #f7f9fc;
    font-size: 0.78rem;
    font-weight: 650;
    line-height: 1;
    cursor: pointer;
    user-select: none;
    transition: opacity 120ms ease, background-color 120ms ease, border-color 120ms ease;
}

.calendar-filter:hover,
.calendar-filter:has(input:focus-visible) {
    border-color: #d4dce7;
    background: #eef3f8;
}

.calendar-filter:has(input:not(:checked)) {
    opacity: 0.45;
    background: #fafbfc;
}

.calendar-filter-check {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border: 1px solid #aab4c2;
    border-radius: 4px;
    color: #fff;
    background: var(--portal-blue);
    font-size: 0.72rem;
}

.calendar-filter input:not(:checked) + .calendar-filter-check {
    color: transparent;
    background: #fff;
}

.calendar-color {
    width: 11px;
    height: 11px;
    border-radius: 50%;
}

.calendar-color-visit { background: #2878d0; }
.calendar-color-task { background: #6c757d; }
.calendar-color-sampling { background: #e0a800; }
.calendar-color-offer { background: #27864b; }
.calendar-color-follow-up { background: #7950b6; }

#portalCalendar {
    min-height: 720px;
    --fc-border-color: #edf0f4;
    --fc-neutral-bg-color: #fff;
    --fc-page-bg-color: #fff;
    color: var(--portal-text);
    font-family: inherit;
}

#portalCalendar .fc-toolbar-title {
    color: var(--portal-text);
    font-size: 1.15rem;
}

#portalCalendar .fc-button-primary {
    border-color: var(--portal-blue);
    background: var(--portal-blue);
}

#portalCalendar .fc-button-primary:not(:disabled):hover,
#portalCalendar .fc-button-primary:not(:disabled):focus {
    border-color: #1557bd;
    background: #1557bd;
    box-shadow: none;
}

#portalCalendar .fc-button-primary:disabled {
    opacity: 0.52;
}

#portalCalendar .fc-scrollgrid {
    border: 0;
}

#portalCalendar .fc-theme-standard td,
#portalCalendar .fc-theme-standard th {
    border-color: #edf0f4;
}

#portalCalendar .fc-timegrid-axis {
    width: 48px;
    border-right: 0;
}

#portalCalendar .fc-timeGridWeek-view .fc-timegrid-slot {
    height: 56px;
    border-top: 1px solid #edf0f4;
}

#portalCalendar .fc-timeGridWeek-view .fc-timegrid-slot-minor {
    border-top: 0;
}

#portalCalendar .fc-timeGridWeek-view .fc-timegrid-slot-label {
    border: 0;
    color: #6b7280;
    font-size: 0.72rem;
    font-weight: 400;
    line-height: 1.25;
    vertical-align: top;
}

#portalCalendar .fc-timeGridWeek-view .fc-timegrid-slot-label-cushion {
    padding: 0 8px 0 0;
    transform: translateY(-0.55em);
}

#portalCalendar .fc-timeGridWeek-view .fc-timegrid-col {
    border-left: 1px solid #edf0f4;
}

#portalCalendar .fc-timegrid-col:first-child {
    border-left: 0;
}

#portalCalendar .fc-timegrid-now-indicator-line {
    border-color: #dc3545;
    border-width: 1px 0 0;
}

#portalCalendar .fc-col-header-cell {
    border-top: 0;
    border-bottom: 1px solid #e8edf3;
    background: #fff;
}

#portalCalendar .fc-timegrid .fc-col-header-cell-cushion {
    display: block;
    padding: 10px 4px 12px;
    color: inherit;
    text-decoration: none;
    cursor: default;
    pointer-events: none;
}

.calendar-day-heading {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 7px;
}

.calendar-day-weekday {
    color: #7c8796;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
}

.calendar-day-date {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 30px;
    padding: 0 7px;
    border-radius: 999px;
    color: #26364a;
    font-size: 0.94rem;
    font-weight: 600;
}

.calendar-day-today .calendar-day-weekday {
    color: var(--portal-blue);
}

.calendar-day-today .calendar-day-date {
    color: #fff;
    background: var(--portal-blue);
}

#portalCalendar .fc-timeGridWeek-view .fc-event {
    border: 0;
    border-radius: 6px;
    padding: 4px 6px;
    cursor: pointer;
    font-size: 0.76rem;
    line-height: 1.25;
    overflow: hidden;
}

#portalCalendar .fc-timeGridWeek-view .fc-event-main-frame,
#portalCalendar .fc-timeGridWeek-view .fc-event-main {
    min-height: 100%;
}

#portalCalendar .fc-timeGridWeek-view .fc-event strong {
    display: inline;
    margin-right: 3px;
    font-size: 0.7rem;
    font-weight: 500;
    opacity: 0.85;
}

#portalCalendar .fc-timeGridWeek-view .fc-event span {
    font-weight: 600;
    overflow-wrap: anywhere;
}

#portalCalendar .fc-event small {
    display: block;
    overflow: hidden;
    opacity: 0.88;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#portalCalendar .calendar-event-visit { background: #2878d0; }
#portalCalendar .calendar-event-task { background: #6c757d; }
#portalCalendar .calendar-event-sampling { color: #1d1d1d; background: #f4c542; }
#portalCalendar .calendar-event-offer { background: #27864b; }
#portalCalendar .calendar-event-follow_up { background: #7950b6; }
#portalCalendar .calendar-event-completed { text-decoration: line-through; opacity: 0.72; }
#portalCalendar .calendar-visit-completed { opacity: 0.66; }
#portalCalendar .calendar-visit-completed .fc-event-title::before { content: '✓ '; }
#portalCalendar .calendar-visit-not_completed { box-shadow: inset 4px 0 #b42318; }

.calendar-detail-grid {
    grid-template-columns: 1fr;
}

.calendar-user-picker { min-width: 260px; }
.calendar-matrix-card { padding: 0; overflow: hidden; }
.calendar-matrix-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 18px; border-bottom: 1px solid var(--portal-border); }
.calendar-matrix { min-width: 1040px; vertical-align: middle; }
.calendar-matrix > :not(caption) > * > * { padding: 12px; border-color: #edf0f4; }
.calendar-matrix thead th { color: var(--portal-muted); background: #f8fafc; font-size: 0.72rem; font-weight: 600; text-align: center; }
.calendar-matrix thead th:first-child { text-align: left; }
.calendar-matrix thead th span,
.calendar-matrix thead th strong { display: block; }
.calendar-matrix tbody th { min-width: 180px; font-size: 0.82rem; }
.calendar-matrix tbody th a { color: var(--portal-text); text-decoration: none; }
.supervisor-calendar .calendar-matrix tbody td { text-align: center; }
.supervisor-calendar .calendar-matrix-cell { align-items: center; text-align: center; }
.calendar-matrix-cell { display: flex; min-width: 138px; flex-direction: column; gap: 3px; color: var(--portal-text); text-decoration: none; }
.calendar-matrix-cell:hover { color: var(--portal-blue); }
.calendar-matrix-cell small { color: var(--portal-muted); font-size: 0.68rem; white-space: nowrap; }
.calendar-matrix-total { display: flex; min-width: 75px; flex-direction: column; text-align: center; }
.calendar-matrix-total small,
.calendar-matrix-total span { color: var(--portal-muted); font-size: 0.68rem; }

@media (max-width: 767.98px) {
    .calendar-card { padding: 10px; }
    #portalCalendar { min-height: 620px; }
    #portalCalendar .fc-header-toolbar { align-items: stretch; flex-direction: column; gap: 8px; }
}

.metric-card,
.content-card,
.info-card {
    border: 1px solid var(--portal-border);
    background: var(--portal-card);
    box-shadow: 0 5px 18px rgba(26, 51, 82, 0.045);
}

.metric-card {
    display: flex;
    align-items: center;
    gap: 15px;
    min-height: 126px;
    padding: 20px;
    border-radius: 11px;
}

.metric-card--today {
    background: #eef4ff;
}

.metric-card--visit-reports {
    background: #ecfdf3;
}

.metric-card--samplings {
    background: #fff7e6;
}

.metric-icon {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    color: #fff;
    font-size: 1.25rem;
}

.icon-blue { background: linear-gradient(135deg, #347ffa, #1761dd); }
.icon-green { background: linear-gradient(135deg, #34bd78, #139454); }
.icon-orange { background: linear-gradient(135deg, #ff9e2c, #eb7200); }
.icon-teal { background: linear-gradient(135deg, #23b9b1, #078b91); }

.metric-card > div {
    min-width: 0;
}

.metric-label,
.metric-card strong,
.metric-card small {
    display: block;
}

.metric-label {
    margin-bottom: 4px;
    color: var(--portal-muted);
    font-size: 0.69rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.metric-card strong {
    font-size: 1.08rem;
}

.metric-card small {
    margin-top: 3px;
    overflow: hidden;
    color: var(--portal-muted);
    font-size: 0.76rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.content-card {
    overflow: hidden;
    border-radius: 11px;
}

.card-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 74px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--portal-border);
}

.card-heading h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 730;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 285px;
    padding: 36px 24px;
    text-align: center;
}

.empty-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 66px;
    height: 66px;
    margin-bottom: 17px;
    border-radius: 50%;
    color: var(--portal-blue);
    background: var(--portal-blue-soft);
    font-size: 1.65rem;
}

.empty-state h4 {
    margin-bottom: 8px;
    font-size: 1rem;
    font-weight: 700;
}

.empty-state p {
    max-width: 470px;
    margin: 0;
    color: var(--portal-muted);
    font-size: 0.84rem;
    line-height: 1.65;
}

.card-footer-note {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    padding: 15px 20px;
    border-top: 1px solid var(--portal-border);
    color: var(--portal-muted);
    background: #fbfcfe;
    font-size: 0.78rem;
}

.dashboard-visit-list,
.dashboard-task-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.dashboard-visit-list li {
    display: grid;
    grid-template-columns: 54px 30px minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid #edf0f4;
}

.dashboard-visit-number {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    color: #fff;
    background: var(--portal-blue);
    font-size: 0.75rem;
    font-weight: 700;
}

.dashboard-visit-list li:not(:last-child) .dashboard-visit-number::after {
    content: '';
    position: absolute;
    top: 28px;
    left: 50%;
    width: 1px;
    height: 37px;
    background: #dbe5f2;
}

.dashboard-visit-customer a,
.dashboard-visit-customer small {
    display: block;
}

.dashboard-visit-customer a {
    color: var(--portal-text);
    font-weight: 700;
    text-decoration: none;
}

.dashboard-visit-customer small,
.dashboard-visit-duration,
.dashboard-visit-list time {
    color: var(--portal-muted);
    font-size: 0.76rem;
}

.dashboard-task-list li {
    display: grid;
    grid-template-columns: 18px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    padding: 14px 20px;
    border-bottom: 1px solid #edf0f4;
}

.dashboard-task-list li:last-child {
    border-bottom: 0;
}

.dashboard-task-list > li > i {
    color: #8ca0b8;
}

.dashboard-task-list a {
    color: var(--portal-text);
    font-size: 0.82rem;
    font-weight: 650;
    text-decoration: none;
}

.dashboard-task-due {
    padding: 3px 8px;
    border-radius: 999px;
    background: #eef3f8;
    color: #52677f;
    font-size: 0.68rem;
    font-weight: 700;
}

.dashboard-task-due--overdue {
    background: #fff0f0;
    color: #b42318;
}

.dashboard-task-due--today {
    background: #fff4e5;
    color: #a45100;
}

.dashboard-task-empty {
    padding: 28px 20px;
    color: var(--portal-muted);
    font-size: 0.84rem;
}

@media (max-width: 575.98px) {
    .dashboard-visit-list li {
        grid-template-columns: 44px 28px minmax(0, 1fr);
        gap: 8px;
    }

    .dashboard-visit-duration {
        grid-column: 3;
    }
}

.placeholder-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.placeholder-list li {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--portal-border);
}

.placeholder-list li:last-child {
    border-bottom: 0;
}

.list-icon {
    color: #aac0dd;
}

.placeholder-list strong,
.placeholder-list small {
    display: block;
}

.placeholder-list strong {
    font-size: 0.85rem;
}

.placeholder-list small {
    margin-top: 3px;
    color: var(--portal-muted);
    font-size: 0.75rem;
}

.notice-row {
    display: flex;
    gap: 14px;
    padding: 20px;
}

.notice-icon {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    color: var(--portal-blue);
    background: var(--portal-blue-soft);
}

.notice-row strong {
    font-size: 0.86rem;
}

.notice-row p {
    margin: 4px 0 0;
    color: var(--portal-muted);
    font-size: 0.76rem;
    line-height: 1.5;
}

.quick-access {
    padding-bottom: 20px;
}

.quick-access .card-heading {
    border-bottom: 0;
}

.quick-link {
    display: flex;
    align-items: center;
    gap: 13px;
    margin: 0 20px;
    padding: 14px;
    border: 1px solid var(--portal-border);
    border-radius: 10px;
    color: var(--portal-text);
    text-decoration: none;
}

.quick-link > span:nth-child(2) {
    min-width: 0;
    flex: 1;
}

.quick-link strong,
.quick-link small {
    display: block;
}

.quick-link strong {
    font-size: 0.86rem;
}

.quick-link small {
    margin-top: 3px;
    color: var(--portal-muted);
    font-size: 0.73rem;
}

a.quick-link:hover {
    border-color: #b8d0f5;
    background: #fbfdff;
}

.quick-link.disabled {
    opacity: 0.68;
}

.report-table-head {
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 16px;
    padding: 12px 20px;
    border-bottom: 1px solid var(--portal-border);
    color: var(--portal-muted);
    background: #fbfcfe;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
}

.report-empty {
    min-height: 360px;
}

.info-card {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    height: 100%;
    padding: 20px;
    border-radius: 11px;
}

.info-card > i {
    color: var(--portal-blue);
    font-size: 1.35rem;
}

.info-card strong {
    display: block;
    margin-bottom: 5px;
    font-size: 0.88rem;
}

.info-card p {
    margin: 0;
    color: var(--portal-muted);
    font-size: 0.78rem;
    line-height: 1.55;
}

.portal-offcanvas {
    width: min(86vw, 320px);
    color: #fff;
    background: var(--portal-navy-deep);
}

.portal-offcanvas .offcanvas-header {
    padding: calc(20px + var(--portal-safe-area-top))
        max(20px, var(--portal-safe-area-right))
        20px
        max(20px, var(--portal-safe-area-left));
}

.portal-offcanvas .offcanvas-body {
    padding: 0
        max(14px, var(--portal-safe-area-right))
        calc(24px + var(--portal-safe-area-bottom))
        max(14px, var(--portal-safe-area-left));
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

.portal-messages {
    margin-bottom: 20px;
}

.portal-primary-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding-right: 18px;
    padding-left: 18px;
    border-color: var(--portal-blue);
    background: var(--portal-blue);
    font-weight: 650;
}

.portal-table {
    min-width: 1040px;
    font-size: 0.82rem;
}

.portal-table th {
    padding: 13px 16px;
    border-bottom-color: var(--portal-border);
    color: var(--portal-muted);
    background: #fbfcfe;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.035em;
    text-transform: uppercase;
    white-space: nowrap;
}

.portal-table td {
    padding: 15px 16px;
    border-bottom-color: var(--portal-border);
    color: #40516a;
    white-space: nowrap;
}

.portal-table tbody tr:last-child td {
    border-bottom: 0;
}

.customer-history-table {
    table-layout: fixed;
}

.customer-history-table th:nth-child(1) { width: 105px; }
.customer-history-table th:nth-child(2) { width: 145px; }
.customer-history-table th:nth-child(3) { width: 170px; }
.customer-history-table th:nth-child(4) { width: auto; }
.customer-history-table th:nth-child(5) { width: 180px; }
.customer-history-table th:nth-child(6) { width: 90px; }

.customer-history-table .customer-history-summary,
.customer-history-table .customer-history-contact {
    overflow-wrap: anywhere;
    white-space: normal;
}

.customer-list-table {
    width: 100%;
    table-layout: auto;
}

.customer-list-table th,
.customer-list-table td {
    width: 1%;
    white-space: nowrap;
}

.customer-list-table .customer-column-company_name,
.customer-list-table td:nth-child(2),
.customer-list-table .customer-column-street,
.customer-list-table td:nth-child(4) {
    width: auto;
    min-width: 150px;
    white-space: normal;
    overflow-wrap: anywhere;
}

.customer-sort-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: inherit;
    text-decoration: none;
}

.customer-sort-link:hover,
.customer-sort-link:focus-visible {
    color: var(--portal-blue);
}

.portal-table tbody tr:hover td {
    background: #fbfdff;
}

.form-section-body {
    padding: 24px 20px;
}

.customer-form-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
}

.customer-header-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
}

.customer-card-layout {
    display: grid;
    gap: 20px;
    margin-top: 24px;
}

.customer-card-layout > .content-card,
.customer-card-layout > .alert {
    width: 100%;
}

.customer-card-layout .card-heading {
    min-height: 82px;
    padding: 18px 24px;
}

.customer-card-layout .form-section-body {
    padding: 28px 24px;
}

.section-eyebrow {
    margin: 0 0 4px;
    color: var(--portal-muted);
    font-size: 0.68rem;
    font-weight: 750;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.business-information-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
    gap: 32px;
    padding-top: 28px;
    border-top: 1px solid var(--portal-border);
}

.subsection-heading,
.google-business-panel {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.subsection-heading {
    min-height: 58px;
    margin-bottom: 18px;
}

.subsection-heading h4,
.google-business-panel h4 {
    margin: 0 0 5px;
    font-size: 0.95rem;
    font-weight: 720;
}

.subsection-heading p,
.google-business-panel p {
    margin: 0;
    color: var(--portal-muted);
    font-size: 0.8rem;
}

.google-business-panel {
    margin-top: 28px;
    padding: 22px;
    border: 1px solid var(--portal-border);
    border-radius: 10px;
    background: #f9fbfe;
}

.customer-location-preview {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 220px;
    padding: 28px;
    border: 1px dashed #b9c9dc;
    border-radius: 10px;
    background: linear-gradient(145deg, #f7faff, #eef4fb);
    color: var(--portal-muted);
    text-align: center;
}

.customer-location-preview i {
    margin-bottom: 12px;
    color: var(--portal-blue);
    font-size: 2rem;
}

.customer-location-preview strong {
    margin-bottom: 3px;
    color: var(--portal-text);
}

.customer-location-preview a {
    margin-top: 14px;
    font-weight: 650;
}

.accordion-heading {
    width: 100%;
    border: 0;
    border-bottom: 1px solid var(--portal-border);
    color: inherit;
    background: var(--portal-card);
    text-align: left;
}

.accordion-heading.collapsed {
    border-bottom-color: transparent;
}

.accordion-indicator {
    transition: transform 160ms ease;
}

.accordion-heading:not(.collapsed) .accordion-indicator {
    transform: rotate(180deg);
}

.system-information-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 22px;
    margin: 0;
}

.system-information-grid div {
    min-width: 0;
}

.system-information-grid dt {
    margin-bottom: 5px;
    color: var(--portal-muted);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.system-information-grid dd {
    margin: 0;
    overflow-wrap: anywhere;
    font-size: 0.88rem;
    font-weight: 600;
}

.customer-detail-header,
.customer-detail-title,
.customer-detail-actions {
    display: flex;
    align-items: center;
}

.customer-detail-header {
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    padding-bottom: 12px;
}

.customer-detail-title {
    flex-wrap: wrap;
    gap: 12px;
}

.customer-detail-title h2 {
    margin: 0;
}

.customer-detail-subtitle {
    margin: 7px 0 0;
    color: var(--portal-muted);
}

.portal-main .customer-detail-tabs {
    display: flex;
    flex-direction: row;
    gap: 38px;
    margin-top: 0;
    overflow-x: auto;
    border-bottom: 1px solid var(--portal-border);
    scrollbar-width: thin;
}

.portal-main .customer-detail-tabs a,
.portal-main .customer-detail-tabs span {
    flex: 0 0 auto;
    padding: 11px 4px 12px;
    color: var(--portal-muted);
    font-size: 0.79rem;
    font-weight: 600;
    text-decoration: none;
}

.portal-main .customer-detail-tabs a.active {
    margin-bottom: -1px;
    border-bottom: 2px solid var(--portal-blue);
    color: var(--portal-blue);
}

.portal-main .customer-detail-tabs span {
    cursor: default;
}

.portal-main .customer-quick-overview {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    width: 100%;
    margin-top: 12px;
    padding: 13px 10px;
}

.customer-quick-overview > div {
    display: flex;
    align-items: center;
    gap: 13px;
    min-width: 0;
    padding: 2px 20px;
    border-right: 1px solid var(--portal-border);
}

.customer-quick-overview > div:last-child {
    border-right: 0;
}

.customer-quick-overview i {
    flex: 0 0 auto;
    color: var(--portal-blue);
    font-size: 1.25rem;
}

.customer-quick-overview span:not(.status-badge),
.customer-quick-overview small,
.customer-quick-overview strong {
    display: block;
    min-width: 0;
}

.customer-quick-overview small {
    margin-bottom: 3px;
    color: var(--portal-muted);
    font-size: 0.68rem;
}

.customer-quick-overview strong {
    overflow-wrap: anywhere;
    font-size: 0.8rem;
}

.customer-quick-overview .status-badge {
    width: fit-content;
    padding: 4px 8px;
    font-size: 0.68rem;
}

.customer-status-active {
    color: #17643b;
    background: #e8f7ef;
}

.customer-status-inactive {
    color: #8d2630;
    background: #fbeaec;
}

.customer-tablet-only,
.tablet-context-actions {
    display: none;
}

.customer-detail-identity {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 14px;
    margin-top: 10px;
    color: var(--portal-muted);
    font-size: 0.82rem;
}

.customer-tablet-row,
.customer-history-row {
    position: relative;
}

.portal-main .customer-detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-areas:
        "master contact"
        "contacts representatives"
        "business geodata"
        "note note"
        "system system";
    align-items: start;
    width: 100%;
    gap: 16px;
    margin-top: 14px;
}

.customer-detail-card-wide {
    grid-column: 1 / -1;
}

.customer-master-data-card { grid-area: master; }
.customer-contact-card { grid-area: contact; }
.customer-contacts-card { grid-area: contacts; }
.customer-representatives-card { grid-area: representatives; }
.customer-business-card { grid-area: business; }
.customer-geodata-card { grid-area: geodata; }
.customer-note-card { grid-area: note; }
.customer-system-card { grid-area: system; }

.customer-detail-card .card-heading {
    min-height: 46px;
    padding: 10px 16px;
}

.customer-detail-card .form-section-body {
    padding: 13px 16px 15px;
}

.customer-detail-card .card-heading h3,
.customer-system-card .card-heading h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    font-size: 0.91rem;
}

.customer-detail-card .card-heading h3 i,
.customer-system-card .card-heading h3 i {
    font-size: 1rem;
}

.customer-system-card .card-heading h3 small {
    color: var(--portal-muted);
    font-size: 0.68rem;
    font-weight: 500;
}

.customer-detail-card .detail-data-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 24px;
    margin: 0;
}

.detail-data-grid dt,
.detail-contact-list dt {
    margin-bottom: 2px;
    color: var(--portal-muted);
    font-size: 0.71rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.detail-data-grid dd,
.detail-contact-list dd {
    margin: 0;
    overflow-wrap: anywhere;
    font-size: 0.9rem;
    font-weight: 600;
}

.detail-contact-list {
    display: grid;
    gap: 0;
    margin: 0;
}

.detail-contact-list > div {
    display: grid;
    grid-template-columns: minmax(110px, 0.34fr) minmax(0, 0.66fr);
    gap: 16px;
    padding: 7px 0;
}

.detail-contact-list dt i {
    width: 18px;
    margin-right: 5px;
    color: var(--portal-blue);
    font-size: 0.88rem;
}

.detail-contact-list a,
.contact-person-links a {
    text-decoration: none;
}

.detail-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 96px;
    padding: 18px;
    border: 1px dashed #ccd7e4;
    border-radius: 9px;
    color: var(--portal-muted);
    background: #fafcfe;
    text-align: center;
}

.detail-empty-state i {
    margin-bottom: 9px;
    font-size: 1.35rem;
}

.detail-empty-state p {
    margin: 0;
}

.detail-empty-state.compact {
    min-height: 82px;
    padding: 18px;
}

.detail-table-head,
.detail-table-row {
    display: grid;
    grid-template-columns: 1.1fr 0.8fr 0.9fr 1.2fr auto;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.detail-table-head {
    padding: 0 4px 8px;
    border-bottom: 1px solid var(--portal-border);
    color: var(--portal-muted);
    font-size: 0.67rem;
    font-weight: 700;
}

.detail-table-row {
    padding: 10px 4px;
    font-size: 0.78rem;
}

.detail-table-row + .detail-table-row {
    border-top: 1px solid var(--portal-border);
}

.detail-table-row > * {
    min-width: 0;
    overflow-wrap: anywhere;
}

.detail-table-row a {
    text-decoration: none;
}

.representative-table-head,
.representative-table-row {
    display: grid;
    grid-template-columns: minmax(120px, 0.7fr) minmax(0, 1.3fr);
    gap: 16px;
    padding: 9px 4px;
}

.representative-table-head {
    padding-top: 0;
    border-bottom: 1px solid var(--portal-border);
    color: var(--portal-muted);
    font-size: 0.67rem;
    font-weight: 700;
}

.representative-table-row {
    font-size: 0.79rem;
}

.representative-table-row + .representative-table-row {
    border-top: 1px solid var(--portal-border);
}

.customer-address {
    margin-bottom: 12px;
    color: var(--portal-text);
    font-style: normal;
    font-weight: 600;
}

.detail-geodata {
    margin-bottom: 14px;
}

.detail-card-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.detail-card-actions form {
    margin: 0;
}

.business-detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.detail-subheading {
    margin: 0 0 9px;
    font-size: 0.79rem;
    font-weight: 720;
}

.opening-hours-overview,
.closure-period-list {
    display: grid;
    gap: 4px;
}

.opening-hours-line {
    display: grid;
    grid-template-columns: minmax(100px, 0.7fr) minmax(150px, 1.3fr);
    gap: 10px;
    padding: 5px 8px;
    border-radius: 7px;
    background: #f7f9fc;
    font-size: 0.82rem;
}

.opening-hours-line span {
    color: var(--portal-muted);
}

.closure-period-list article {
    padding: 8px 10px;
    border: 1px solid var(--portal-border);
    border-radius: 8px;
}

.closure-period-list article strong,
.closure-period-list article span {
    display: block;
}

.closure-period-list article span,
.closure-period-list article p {
    color: var(--portal-muted);
    font-size: 0.78rem;
}

.closure-period-list article p {
    margin: 6px 0 0;
}

.google-business-summary {
    display: grid;
    gap: 4px;
    margin-top: 12px;
    padding: 10px;
    border-radius: 9px;
    background: #f4f7fb;
}

.google-business-summary > span {
    color: var(--portal-muted);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.google-business-summary a {
    font-size: 0.8rem;
}

.internal-note {
    line-height: 1.65;
    overflow-wrap: anywhere;
}

.system-information-card {
    opacity: 0.92;
}

@media (max-width: 1279.98px) {
    .business-information-grid {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 700px) and (max-width: 1279.98px) {
    .tablet-context-actions {
        position: sticky;
        top: calc(var(--portal-header-height) + var(--portal-safe-area-top));
        z-index: 1014;
        display: flex;
        width: 100%;
        max-width: var(--portal-content-max-width);
        flex-wrap: wrap;
        align-items: center;
        gap: 8px;
        margin: 0 auto;
        padding: 10px
            max(var(--portal-tablet-content-padding-x), var(--portal-safe-area-right))
            10px
            max(var(--portal-tablet-content-padding-x), var(--portal-safe-area-left));
        border-bottom: 1px solid var(--portal-border);
        background: rgba(255, 255, 255, 0.97);
        box-shadow: 0 8px 24px rgba(16, 33, 58, 0.1);
        backdrop-filter: blur(12px);
    }

    .tablet-context-actions > .btn,
    .tablet-context-actions > .dropdown,
    .tablet-context-actions > .dropdown > .btn {
        min-height: var(--portal-touch-target-size);
    }

    .tablet-context-actions > .btn,
    .tablet-context-actions > .dropdown > .btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 6px;
        transition: background-color 100ms ease-out;
    }

    .tablet-context-actions > .btn:active,
    .tablet-context-actions > .dropdown > .btn:active {
        border-color: #c9dcfb;
        color: var(--portal-blue);
        background-color: var(--portal-blue-soft);
    }

    .tablet-context-actions--customer > .btn,
    .tablet-context-actions--customer > .dropdown {
        flex: 1 1 140px;
    }

    .tablet-context-actions--customer > .dropdown > .btn {
        width: 100%;
    }

    .tablet-context-action-source {
        display: none !important;
    }

    .customer-desktop-only {
        display: none !important;
    }

    .customer-tablet-only {
        display: block;
    }

    .customer-list-filters .form-control,
    .customer-list-filters .form-select,
    .customer-list-filters .btn,
    #customerVisits .form-control,
    #customerVisits .form-select,
    #customerVisits .btn,
    #customerSamplings .form-control,
    #customerSamplings .form-select,
    #customerSamplings .btn,
    #customerHistory .form-control,
    #customerHistory .form-select,
    #customerHistory .btn,
    .customer-detail-tabs a,
    .customer-detail-tabs span {
        min-height: var(--portal-touch-target-size);
    }

    .customer-tablet-sort {
        padding: 10px var(--portal-tablet-content-padding-x);
        overflow-x: auto;
        white-space: nowrap;
        scrollbar-width: thin;
    }

    .customer-tablet-filter-form {
        padding: 16px var(--portal-tablet-content-padding-x);
    }

    .customer-tablet-search-row {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: end;
        gap: 12px;
    }

    .customer-tablet-filter-toggle {
        min-height: var(--portal-touch-target-size);
    }

    .customer-tablet-filter-collapse {
        padding-top: 14px;
    }

    .customer-tablet-filter-grid {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }

    .customer-tablet-filter-grid .form-select,
    .customer-tablet-search-row .form-control,
    .customer-tablet-filter-actions .btn {
        min-height: var(--portal-touch-target-size);
    }

    .customer-tablet-filter-actions {
        display: flex;
        justify-content: flex-end;
        gap: 8px;
        margin-top: 14px;
    }

    .customer-tablet-sort-links {
        display: inline-flex;
        gap: 6px;
        margin-left: 10px;
    }

    .customer-tablet-sort-links a {
        display: inline-flex;
        align-items: center;
        min-height: 36px;
        padding: 6px 10px;
        border: 1px solid var(--portal-border);
        border-radius: 999px;
        color: var(--portal-muted);
        font-size: 0.78rem;
        text-decoration: none;
    }

    .customer-tablet-sort-links a.active {
        border-color: var(--portal-blue);
        color: var(--portal-blue);
        background: var(--portal-blue-soft);
        font-weight: 700;
    }

    .customer-tablet-list,
    .customer-history-list {
        padding: 6px 18px;
    }

    .customer-tablet-row,
    .customer-history-row {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(180px, 0.45fr) auto;
        align-items: center;
        gap: 16px;
        min-height: 84px;
        padding: 13px 8px;
        border-bottom: 1px solid var(--portal-border);
    }

    .customer-tablet-row {
        transition: background-color 100ms ease-out;
    }

    .customer-tablet-row:active {
        background-color: var(--portal-blue-soft);
    }

    .customer-tablet-row:last-child,
    .customer-history-row:last-child {
        border-bottom: 0;
    }

    .customer-tablet-row-title,
    .customer-history-row-heading,
    .customer-history-row-footer,
    .customer-history-row-meta {
        display: flex;
        align-items: center;
        gap: 8px;
    }

    .customer-tablet-row-title strong {
        overflow: hidden;
        font-size: 0.98rem;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .customer-tablet-row-main,
    .customer-tablet-row-meta,
    .customer-history-wines {
        display: grid;
        min-width: 0;
        gap: 3px;
    }

    .customer-tablet-number,
    .customer-tablet-address,
    .customer-tablet-row-meta,
    .customer-history-row-meta {
        color: var(--portal-muted);
        font-size: 0.78rem;
    }

    .customer-tablet-open,
    .customer-history-row-footer a {
        display: inline-flex;
        align-items: center;
        justify-content: flex-end;
        gap: 5px;
        min-height: var(--portal-touch-target-size);
        color: var(--portal-blue);
        font-weight: 700;
        text-decoration: none;
    }

    .visit-report-tablet-row {
        grid-template-columns: minmax(0, 1.15fr) minmax(150px, 0.55fr) minmax(190px, 0.7fr) auto;
    }

    .visit-report-tablet-timing,
    .visit-report-tablet-meta {
        display: grid;
        min-width: 0;
        gap: 4px;
        color: var(--portal-muted);
        font-size: 0.78rem;
    }

    .visit-report-tablet-timing strong {
        color: var(--portal-text);
        font-size: 0.86rem;
    }

    .visit-report-tablet-meta .status-badge {
        width: fit-content;
    }

    .customer-detail-tabs {
        max-width: 100%;
        overscroll-behavior-inline: contain;
    }

    .customer-detail-tabs a,
    .customer-detail-tabs span {
        display: inline-flex;
        align-items: center;
        white-space: nowrap;
    }

    .customer-detail-card .detail-contact-list a {
        display: inline-flex;
        align-items: center;
        min-height: var(--portal-touch-target-size);
    }

    .customer-history-row {
        grid-template-columns: minmax(140px, 0.32fr) minmax(0, 1fr) minmax(180px, 0.42fr);
    }

    .customer-history-row > p {
        margin: 0;
        overflow-wrap: anywhere;
    }

    .customer-history-row-heading,
    .customer-history-row-footer,
    .customer-history-row-meta {
        justify-content: space-between;
    }

    .customer-history-row-heading,
    .customer-history-row-meta {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (min-width: 700px) and (max-width: 991.98px) {
    .customer-detail-header {
        align-items: flex-start;
        flex-direction: column;
        gap: 14px;
    }

    .customer-detail-grid {
        grid-template-columns: 1fr;
        grid-template-areas:
            "master"
            "contact"
            "contacts"
            "representatives"
            "business"
            "geodata"
            "note"
            "system";
    }

    .customer-detail-card-wide {
        grid-column: auto;
    }

    .customer-tablet-row,
    .customer-history-row {
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 8px 14px;
    }

    .customer-tablet-row-meta,
    .customer-history-row > p,
    .customer-history-wines,
    .customer-history-row-meta {
        grid-column: 1 / -1;
    }

    .customer-tablet-open {
        grid-column: 2;
        grid-row: 1;
    }

    .visit-report-tablet-row .visit-report-tablet-timing,
    .visit-report-tablet-row .visit-report-tablet-meta {
        grid-column: 1 / -1;
    }

    .customer-history-row-footer {
        grid-column: 1 / -1;
    }

    .customer-history-row-heading,
    .customer-history-row-meta {
        flex-direction: row;
        align-items: center;
    }

}

@media (min-width: 992px) and (max-width: 1279.98px) {
    .visit-report-tablet-row {
        grid-template-columns: minmax(0, 1.15fr) minmax(150px, 0.55fr) minmax(190px, 0.7fr) 112px;
    }

    .customer-tablet-filter-toggle {
        display: none;
    }

    .customer-tablet-filter-collapse.collapse {
        display: block;
    }

    .customer-tablet-filter-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .portal-main .customer-detail-grid {
        grid-template-columns: 1fr;
        grid-template-areas:
            "master"
            "contact"
            "contacts"
            "representatives"
            "business"
            "geodata"
            "note"
            "system";
    }

    .customer-detail-card-wide {
        grid-column: auto;
    }

    .portal-main .customer-quick-overview {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .customer-quick-overview > div:nth-child(2) {
        border-right: 0;
    }

    .customer-quick-overview > div:nth-child(n+3) {
        margin-top: 12px;
        padding-top: 12px;
        border-top: 1px solid var(--portal-border);
    }
}

@media (max-width: 767.98px) {
    .customer-detail-header {
        align-items: stretch;
        flex-direction: column;
    }

    .customer-detail-actions {
        align-self: flex-start;
    }

    .business-detail-grid {
        grid-template-columns: 1fr;
    }

    .customer-form-header {
        align-items: stretch;
        flex-direction: column;
    }

    .customer-header-actions {
        justify-content: flex-start;
    }

    .customer-header-actions .portal-primary-button {
        margin-left: auto;
    }

    .customer-card-layout .card-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .customer-card-layout .card-heading > .btn {
        width: 100%;
    }

    .google-business-panel {
        flex-direction: column;
    }

    .system-information-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .detail-table-head {
        display: none;
    }

    .detail-table-row {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .detail-table-row > :nth-child(2),
    .detail-table-row > :nth-child(3),
    .detail-table-row > :nth-child(4) {
        grid-column: 1 / -1;
    }
}

@media (max-width: 575.98px) {
    .portal-main .customer-detail-tabs {
        gap: 22px;
    }

    .portal-main .customer-quick-overview {
        grid-template-columns: 1fr;
        padding: 8px 16px;
    }

    .customer-quick-overview > div {
        margin-top: 0;
        padding: 12px 0;
        border-top: 1px solid var(--portal-border);
        border-right: 0;
    }

    .customer-quick-overview > div:first-child {
        border-top: 0;
    }

    .customer-quick-overview > div:nth-child(n+3) {
        margin-top: 0;
        padding-top: 12px;
    }

    .customer-detail-title {
        align-items: flex-start;
        flex-direction: column;
    }

    .customer-detail-actions,
    .customer-detail-actions .btn {
        width: 100%;
    }

    .customer-detail-card .form-section-body {
        padding: 22px 16px;
    }

    .customer-detail-card .detail-data-grid {
        grid-template-columns: 1fr;
    }

    .opening-hours-line {
        grid-template-columns: 1fr;
        gap: 3px;
    }

    .customer-header-actions .btn {
        flex: 1 1 auto;
    }

    .customer-header-actions .portal-primary-button {
        margin-left: 0;
    }

    .customer-card-layout .form-section-body {
        padding: 22px 16px;
    }

    .system-information-grid {
        grid-template-columns: 1fr;
    }
}

.form-label {
    margin-bottom: 7px;
    color: #263b58;
    font-size: 0.82rem;
    font-weight: 650;
}

.required-mark {
    color: #d92d3a;
}

.form-control,
.form-select {
    min-height: 44px;
    border-color: #d8e0eb;
    border-radius: 8px;
    color: var(--portal-text);
    font-size: 0.87rem;
}

textarea.form-control {
    min-height: auto;
}

.form-control:focus,
.form-select:focus,
.form-check-input:focus {
    border-color: #7aaaf1;
    box-shadow: 0 0 0 0.2rem rgba(23, 105, 232, 0.12);
}

.form-text {
    color: var(--portal-muted);
    font-size: 0.73rem;
}

.invalid-feedback {
    margin-top: 6px;
    font-size: 0.75rem;
}

.portal-switch {
    min-height: 48px;
    padding: 13px 14px 13px 48px;
    border: 1px solid var(--portal-border);
    border-radius: 9px;
    background: #fbfcfe;
}

.portal-switch .form-check-input {
    width: 2.1rem;
    height: 1.1rem;
    margin-left: -35px;
}

.portal-switch .form-check-label {
    font-size: 0.84rem;
    font-weight: 650;
}

.newsletter-signup-panel {
    padding: .75rem 1rem;
    border: 1px solid #e8cf83;
    border-radius: .65rem;
    background: #fffbed;
}

.newsletter-signup-panel .portal-switch {
    min-height: auto;
    padding-top: .15rem;
    padding-right: 0;
    padding-bottom: .15rem;
    border: 0;
    background: transparent;
    margin-bottom: 0;
}

.sampling-fields {
    padding: 18px;
    border: 1px solid #cfe0f8;
    border-radius: 10px;
    background: #f8fbff;
}

.sampling-fields-heading {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sampling-fields-heading > i {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    color: var(--portal-blue);
    background: var(--portal-blue-soft);
}

.sampling-fields-heading strong,
.sampling-fields-heading small {
    display: block;
}

.sampling-fields-heading strong {
    font-size: 0.85rem;
}

.sampling-fields-heading small {
    margin-top: 2px;
    color: var(--portal-muted);
    font-size: 0.73rem;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding-top: 20px;
}

.tablet-form-actionbar {
    display: none;
}

.sampling-item-rows {
    display: grid;
    gap: 12px;
}

.visit-report-form .content-card {
    overflow: visible;
}

.producer-combobox {
    position: relative;
    width: 100%;
}

.producer-combobox-toggle,
.producer-combobox-panel {
    display: none;
}

.producer-combobox.is-enhanced .producer-native-select {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    border: 0;
    opacity: 0;
    pointer-events: none;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
}

.producer-combobox-toggle {
    display: none;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    min-height: 44px;
    padding: 9px 12px;
    border: 1px solid #d8e0eb;
    border-radius: 8px;
    color: var(--portal-muted);
    background: #fff;
    font-size: 0.87rem;
    text-align: left;
}

.producer-combobox.is-enhanced .producer-combobox-toggle {
    display: flex;
}

.producer-combobox-toggle.has-value {
    color: var(--portal-text);
}

.producer-combobox-toggle:hover {
    border-color: #b7c6d9;
}

.producer-combobox-toggle:focus-visible,
.producer-combobox.is-open .producer-combobox-toggle {
    border-color: #7aaaf1;
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(23, 105, 232, 0.12);
}

.producer-combobox.has-error .producer-combobox-toggle {
    border-color: #dc3545;
}

.producer-combobox-toggle i {
    flex: 0 0 auto;
    font-size: 0.76rem;
    transition: transform 140ms ease;
}

.producer-combobox.is-open .producer-combobox-toggle i {
    transform: rotate(180deg);
}

.producer-combobox-panel {
    position: absolute;
    top: calc(100% + 7px);
    right: 0;
    left: 0;
    z-index: 1080;
    width: 100%;
    max-height: min(320px, calc(100vh - 24px));
    padding: 8px;
    border: 1px solid #d8e0eb;
    border-radius: 9px;
    background: #fff;
    box-shadow: 0 14px 34px rgba(16, 33, 58, 0.18);
}

.producer-combobox.is-enhanced .producer-combobox-panel:not([hidden]) {
    display: block;
}

.producer-combobox-panel.opens-upward {
    top: auto;
    bottom: calc(100% + 7px);
}

.producer-combobox-search-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.producer-combobox-search-wrap > i {
    position: absolute;
    left: 11px;
    z-index: 1;
    color: var(--portal-muted);
    font-size: 0.82rem;
    pointer-events: none;
}

.producer-combobox-search {
    width: 100%;
    min-height: 40px;
    padding: 8px 10px 8px 34px;
    border: 1px solid #d8e0eb;
    border-radius: 7px;
    color: var(--portal-text);
    background: #fff;
    font-size: 0.83rem;
}

.producer-combobox-search:focus {
    border-color: #7aaaf1;
    outline: 0;
    box-shadow: 0 0 0 0.16rem rgba(23, 105, 232, 0.1);
}

.producer-combobox-options {
    max-height: 230px;
    margin-top: 7px;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.producer-combobox-option {
    display: block;
    width: 100%;
    padding: 9px 10px;
    border: 0;
    border-radius: 6px;
    color: var(--portal-text);
    background: transparent;
    font-size: 0.83rem;
    text-align: left;
}

.producer-combobox-option:hover,
.producer-combobox-option.active {
    color: #1057bb;
    background: var(--portal-blue-soft);
}

.producer-combobox-option.selected {
    color: #1057bb;
    font-weight: 700;
}

.producer-combobox-empty {
    padding: 14px 10px 8px;
    color: var(--portal-muted);
    font-size: 0.78rem;
    text-align: center;
}

.sampling-item-row {
    position: relative;
    display: grid;
    grid-template-columns: 32px minmax(220px, 1.1fr) minmax(190px, 1fr) minmax(140px, 0.6fr) minmax(120px, 0.5fr) 46px;
    gap: 12px;
    align-items: start;
    padding: 16px;
    border: 1px solid var(--portal-border);
    border-radius: 9px;
    background: #fff;
}

.sampling-item-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    margin-top: 38.1px;
    border-radius: 50%;
    color: #fff;
    background: var(--portal-blue);
    font-size: 0.72rem;
    font-weight: 700;
}

.sampling-item-remove {
    width: 42px;
    height: 42px;
    margin-top: 27px;
    padding: 0;
}

.sampling-item-stock-field {
    margin-top: 35px;
}

.sampling-row-error {
    grid-column: 2 / -1;
}

@media (max-width: 991.98px) {
    .portal-content {
        margin-left: 0;
    }

    .portal-header {
        min-height: calc(var(--portal-header-height) + var(--portal-safe-area-top));
        padding: var(--portal-safe-area-top)
            max(18px, var(--portal-safe-area-right))
            0
            max(18px, var(--portal-safe-area-left));
    }

    .portal-main {
        padding: 22px
            max(18px, var(--portal-safe-area-right))
            calc(34px + var(--portal-safe-area-bottom))
            max(18px, var(--portal-safe-area-left));
    }

    .sampling-item-row {
        grid-template-columns: 30px 1fr 1fr;
    }

    .sampling-item-number {
        grid-row: 1 / 3;
    }

    .sampling-item-field.producer-field {
        grid-column: 2 / -1;
    }

    .sampling-item-remove {
        grid-column: 2 / -1;
        width: auto;
        margin-top: 0;
    }

    .sampling-item-stock-field {
        margin-top: 0;
    }
}

@media (min-width: 768px) and (max-width: 991.98px) {
    .portal-header {
        min-height: calc(var(--portal-header-height) + var(--portal-safe-area-top));
        padding-right: max(
            var(--portal-tablet-content-padding-x),
            var(--portal-safe-area-right)
        );
        padding-left: max(
            var(--portal-tablet-content-padding-x),
            var(--portal-safe-area-left)
        );
    }

    .portal-header > div:first-child,
    .portal-header h1 {
        min-width: 0;
    }

    .portal-header h1 {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .portal-header .header-date,
    .portal-header .user-summary-details {
        display: none !important;
    }

    .portal-main {
        padding-right: max(
            var(--portal-tablet-content-padding-x),
            var(--portal-safe-area-right)
        );
        padding-left: max(
            var(--portal-tablet-content-padding-x),
            var(--portal-safe-area-left)
        );
    }

}

@media (min-width: 992px) and (max-width: 1279.98px) {
    .portal-header {
        gap: 16px;
        min-height: calc(var(--portal-header-height) + var(--portal-safe-area-top));
        padding-right: max(
            32px,
            calc(var(--portal-safe-area-right) + 12px)
        );
        padding-left: max(
            var(--portal-tablet-content-padding-x),
            var(--portal-safe-area-left)
        );
    }

    .portal-header > div:first-child,
    .portal-header h1 {
        min-width: 0;
    }

    .portal-header h1 {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .portal-header .header-date {
        display: none !important;
    }

    .portal-header .header-actions {
        min-width: 0;
        flex: 0 1 auto;
        gap: 8px;
    }

    .portal-header .header-actions > form,
    .portal-header .user-summary,
    .portal-header .user-summary > a,
    .portal-header .user-summary-details {
        min-width: 0;
    }

    .portal-header .header-actions > form {
        flex: 1 1 150px;
    }

    .portal-header .header-actions > form .form-select {
        max-width: 180px;
    }

    .portal-header .user-summary {
        flex: 0 1 auto;
        gap: 8px;
    }

    .portal-header .user-summary > a {
        flex: 1 1 auto;
    }

    .portal-header .user-summary-details {
        max-width: 112px;
    }

    .portal-header .user-summary strong,
    .portal-header .user-summary small {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .portal-header .user-summary form,
    .portal-header .user-summary form .btn,
    .portal-header .notification-button {
        flex: 0 0 auto;
    }

    .portal-header .user-summary form .btn {
        min-height: var(--portal-touch-target-size);
    }

    .portal-main {
        padding-right: var(--portal-tablet-content-padding-x);
        padding-left: var(--portal-tablet-content-padding-x);
    }
}

@media (pointer: coarse) {
    .notification-button {
        width: var(--portal-touch-target-size);
        min-height: var(--portal-touch-target-size);
    }

    .dropdown-item {
        min-height: var(--portal-touch-target-size);
    }
}

@media (min-width: 768px) and (max-width: 1279.98px) {
    .portal-sidebar {
        display: none !important;
    }

    .mobile-menu-button {
        display: inline-flex !important;
    }

    .portal-content {
        margin-left: 0;
    }

    .portal-offcanvas {
        width: min(72vw, 380px);
    }

    .portal-offcanvas .btn-close {
        width: var(--portal-touch-target-size);
        height: var(--portal-touch-target-size);
        padding: 12px;
        background-position: center;
    }

    .tablet-work-form .tablet-form-actionbar {
        position: sticky;
        top: calc(var(--portal-header-height) + var(--portal-safe-area-top));
        z-index: 1015;
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
        gap: 12px;
        margin-bottom: 16px;
        padding: 10px
            max(12px, var(--portal-safe-area-right))
            10px
            max(12px, var(--portal-safe-area-left));
        border: 1px solid var(--portal-border);
        border-radius: 10px;
        background: rgba(255, 255, 255, 0.97);
        box-shadow: 0 8px 24px rgba(16, 33, 58, 0.12);
        backdrop-filter: blur(12px);
    }

    .tablet-work-form .tablet-form-customer-context:not([hidden]) {
        display: flex;
        min-width: 0;
        flex-direction: column;
    }

    .tablet-form-customer-context small {
        color: var(--portal-muted);
        font-size: 0.68rem;
        font-weight: 700;
        letter-spacing: 0.04em;
        text-transform: uppercase;
    }

    .tablet-form-customer-context strong {
        overflow: hidden;
        font-size: 0.84rem;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .tablet-work-form .tablet-form-action-buttons {
        grid-column: -2 / -1;
        display: flex;
        justify-content: flex-end;
        gap: 8px;
    }

    .tablet-work-form .tablet-form-action-buttons .btn,
    .tablet-work-form #addSamplingItem,
    .tablet-work-form .sampling-item-remove,
    .tablet-work-form .producer-combobox-option,
    .tablet-work-form .customer-combobox-results .list-group-item {
        min-height: var(--portal-touch-target-size);
    }

    .tablet-work-form .tablet-form-standard-actions {
        display: none;
    }

    .tablet-work-form .customer-combobox-toggle {
        width: var(--portal-touch-target-size);
    }

    .tablet-work-form .producer-combobox-search {
        min-height: var(--portal-touch-target-size);
    }

    .tablet-work-form .sampling-item-row {
        grid-template-columns: 32px minmax(0, 1fr) minmax(0, 1fr);
        gap: 14px;
    }

    .tablet-work-form .sampling-item-number {
        grid-row: 1 / 3;
    }

    .tablet-work-form .sampling-item-field.producer-field {
        grid-column: 2 / -1;
    }

    .tablet-work-form .sampling-item-field.wine-field {
        grid-column: 2;
    }

    .tablet-work-form .sampling-item-field.quantity-field {
        grid-column: 3;
    }

    .tablet-work-form .sampling-item-stock-field {
        grid-column: 2;
        margin-top: 0;
    }

    .tablet-work-form .sampling-item-remove {
        grid-column: 3;
        width: 100%;
        height: auto;
        margin-top: 0;
    }

    .tablet-work-form .sampling-row-error {
        grid-column: 2 / -1;
    }
}

@media (min-width: 1280px) {
    .portal-sidebar {
        display: flex !important;
    }

    .mobile-menu-button {
        display: none !important;
    }

    .portal-content {
        margin-left: var(--portal-sidebar-width);
    }

    .tablet-responsive-label {
        display: none;
    }
}

@media (min-width: 768px) and (max-width: 991.98px) {
    .tablet-work-form .tablet-form-actionbar {
        grid-template-columns: minmax(0, 1fr);
        gap: 8px;
    }

    .tablet-work-form .tablet-form-action-buttons {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        width: 100%;
    }

    .tablet-work-form .tablet-form-action-buttons .btn {
        min-width: 0;
        white-space: normal;
    }

    .sampling-create-form .sampling-data-grid > [class*="col-md-"] {
        width: 100%;
    }

    .tablet-work-form .sampling-item-row {
        grid-template-columns: 32px minmax(0, 1fr);
        padding: 16px;
    }

    .tablet-work-form .sampling-item-number {
        grid-row: auto;
    }

    .tablet-work-form .sampling-item-field,
    .tablet-work-form .sampling-item-field.producer-field,
    .tablet-work-form .sampling-item-field.wine-field,
    .tablet-work-form .sampling-item-field.quantity-field,
    .tablet-work-form .sampling-item-stock-field,
    .tablet-work-form .sampling-item-remove,
    .tablet-work-form .sampling-row-error {
        grid-column: 2;
    }

    .tablet-work-form #addSamplingItem {
        width: 100%;
    }
}

@media (max-width: 575.98px) {
    .portal-header h1 {
        font-size: 1.08rem;
    }

    .header-actions {
        gap: 8px;
    }

    .notification-button {
        width: 38px;
        min-height: 38px;
    }

    .user-summary {
        min-width: auto;
    }

    .user-initials {
        width: 36px;
        height: 36px;
    }

    .portal-main {
        padding-right: 14px;
        padding-left: 14px;
    }

    .customer-map {
        min-height: 440px;
        height: calc(100vh - 330px);
    }

    .customer-map-legend {
        top: auto;
        right: 8px;
        bottom: 8px;
        gap: 4px;
        padding: 8px 10px;
        font-size: 0.72rem;
    }

    .metric-card {
        min-height: 112px;
    }

    .card-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .quick-link {
        margin-right: 14px;
        margin-left: 14px;
    }

    .form-section-body {
        padding: 20px 16px;
    }

    .form-actions {
        align-items: stretch;
        flex-direction: column-reverse;
    }

    .form-actions .btn {
        width: 100%;
    }

    .sampling-item-row {
        grid-template-columns: 28px 1fr;
        padding: 14px;
    }

    .sampling-item-field,
    .sampling-item-field.producer-field,
    .sampling-item-remove,
    .sampling-row-error {
        grid-column: 2;
    }
}

.tour-planner-grid {
    display: grid;
    grid-template-columns: minmax(260px, 0.8fr) minmax(420px, 1.5fr) minmax(320px, 1fr);
    gap: 16px;
    min-height: 620px;
}

.tour-planner-grid > .card {
    min-width: 0;
}

.tour-customer-panel,
.tour-stop-list {
    max-height: 680px;
    overflow-y: auto;
}

.tour-map {
    min-height: 620px;
    height: 100%;
}

.tour-marker-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 14px;
    margin-top: 5px;
    color: var(--portal-muted);
    font-size: 0.72rem;
    font-weight: 400;
}

.tour-marker-legend > span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
}

.tour-customer-item,
.tour-stop-item {
    border-bottom: 1px solid #e5e8e6;
    padding: 12px 4px;
}

.tour-customer-item .btn {
    margin-top: 8px;
}

.tour-stop-item {
    cursor: grab;
}

.tour-endpoint {
    padding: 12px 4px;
    overflow-wrap: anywhere;
}

.tour-route-segment {
    position: relative;
    margin: 16px 4px 16px 18px;
    padding: 14px 0 22px 18px;
    border-left: 1px solid var(--portal-border);
    font-size: 0.85rem;
}

.tour-route-segment::before {
    content: '';
    position: absolute;
    top: 42px;
    left: 0;
    width: 18px;
    border-top: 1px solid var(--portal-border);
}

.tour-route-segment-block {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    width: fit-content;
    max-width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--portal-border);
    border-radius: 8px;
    background: var(--portal-blue-soft);
}

.tour-route-segment-block > i {
    flex-shrink: 0;
    color: var(--portal-blue);
    font-size: 1rem;
}

.tour-route-segment-details {
    display: grid;
    gap: 2px;
    min-width: 0;
    overflow-wrap: anywhere;
    color: var(--portal-text);
}

.tour-address-menu {
    width: 100%;
    min-width: 0;
    padding: 6px;
    box-shadow: 0 8px 24px rgb(16 33 58 / 10%);
}

.tour-address-menu .dropdown-item {
    white-space: normal;
    overflow-wrap: anywhere;
    border-radius: 5px;
    padding: 10px 12px;
}

.tour-address-menu .tour-home-option {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.tour-home-option > i {
    flex-shrink: 0;
    color: var(--portal-blue);
}

.tour-home-option:disabled > i {
    color: var(--portal-muted);
}

.tour-route-segment::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: -4px;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid var(--portal-muted);
}

.tour-endpoint-marker span {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 2px solid #fff;
    background: var(--portal-muted);
    color: #fff;
    box-shadow: 0 1px 5px rgb(0 0 0 / 25%);
}

.tour-stop-number,
.tour-numbered-marker span {
    align-items: center;
    background: var(--customer-marker-color, #294c3b);
    border-radius: 50%;
    color: #fff;
    display: inline-flex;
    font-weight: 700;
    height: 30px;
    justify-content: center;
    min-width: 30px;
}

.tour-numbered-marker span {
    border: 2px solid #fff;
    box-shadow: 0 1px 5px rgb(0 0 0 / 35%);
}

@media (max-width: 1399.98px) {
    .tour-planner-grid {
        grid-template-columns: minmax(250px, 0.8fr) minmax(400px, 1.4fr);
    }

    .tour-planner-grid > .card:last-child {
        grid-column: 1 / -1;
    }
}

@media (max-width: 991.98px) {
    .tour-planner-grid {
        display: flex;
        flex-direction: column;
    }

    .tour-map {
        min-height: 460px;
    }

    .tour-customer-panel,
    .tour-stop-list {
        max-height: none;
    }
}
.batch-progress .progress {
    height: 1.35rem;
}

.batch-progress .progress-bar {
    min-width: 0;
    font-weight: 600;
}

.task-layout {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(320px, 1fr);
    gap: 24px;
    align-items: start;
}

.task-day-navigation {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 20px;
    border-bottom: 1px solid #e5e8e6;
}

.task-selected-date {
    flex: 1;
    min-width: 180px;
}

.task-selected-date h2 {
    margin: 0;
    font-size: 1.2rem;
}

.task-date-picker {
    width: 160px;
}

.task-section {
    padding: 8px 20px 20px;
}

.task-overdue-section {
    margin: 16px;
    padding: 0 4px 4px;
    border: 1px solid #f1c3c7;
    border-radius: 10px;
    background: #fffafb;
}

.task-section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 12px 8px;
    color: #842029;
    font-weight: 600;
}

.task-row {
    display: grid;
    grid-template-columns: 38px 64px minmax(0, 1fr);
    gap: 12px;
    align-items: start;
    padding: 16px 4px;
    border-bottom: 1px solid #e5e8e6;
}

.task-row:last-child {
    border-bottom: 0;
}

.task-time {
    padding-top: 6px;
    font-weight: 700;
    color: #33443c;
}

.task-time span {
    display: block;
    color: #b02a37;
    font-size: 0.75rem;
}

.task-content > strong {
    display: block;
    padding-top: 5px;
    font-size: 1rem;
}

.task-title-line {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.task-title-line > strong {
    padding-top: 5px;
}

.task-edit-button {
    color: var(--portal-muted);
    text-decoration: none;
}

.task-status-button {
    border: 0;
    background: transparent;
    font-size: 1.1rem;
}

.task-status-button-completed {
    color: #4e745f;
}

.task-edit-panel {
    margin-top: 14px;
}

.task-edit-form {
    padding: 16px;
    border: 1px solid #dfe5e1;
    border-radius: 8px;
    background: #f8faf9;
}

.customer-search-field {
    position: relative;
}

.customer-combobox {
    position: relative;
}

.customer-combobox-input {
    padding-right: 42px;
}

.customer-combobox-toggle {
    position: absolute;
    z-index: 2;
    top: 1px;
    right: 1px;
    width: 40px;
    height: calc(100% - 2px);
    border: 0;
    border-left: 1px solid #dee2e6;
    border-radius: 0 0.375rem 0.375rem 0;
    background: transparent;
    color: var(--portal-muted);
}

.customer-combobox-results {
    position: absolute;
    z-index: 20;
    top: calc(100% + 4px);
    right: 0;
    left: 0;
    max-height: 240px;
    overflow-y: auto;
    box-shadow: 0 8px 20px rgb(0 0 0 / 12%);
}

.customer-combobox-results .list-group-item {
    font-size: 0.88rem;
}

.task-content > p {
    margin: 6px 0 0;
    color: var(--portal-muted);
}

.task-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 18px;
    margin-top: 8px;
    color: var(--portal-muted);
    font-size: 0.82rem;
}

.task-meta span,
.task-meta a {
    display: inline-flex;
    gap: 5px;
    align-items: center;
}

.task-completed {
    opacity: 0.58;
}

.task-completed .task-title-line > strong {
    text-decoration: line-through;
}

.task-empty {
    padding: 54px 20px;
    text-align: center;
    color: var(--portal-muted);
}

.task-empty i {
    font-size: 2rem;
}

.task-empty p {
    margin: 8px 0 0;
}

@media (max-width: 1199.98px) {
    .task-layout {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 767.98px) {
    .task-day-navigation {
        flex-wrap: wrap;
    }

    .task-selected-date {
        order: -1;
        width: 100%;
        flex-basis: 100%;
    }

    .task-date-picker {
        flex: 1;
    }

    .task-row {
        grid-template-columns: 38px 52px minmax(0, 1fr);
    }
}
/* Teamvergleich der Supervisor-Besuchsberichte. */
.supervisor-report-summary {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.supervisor-report-summary article {
    padding: 16px 20px;
}

.supervisor-dashboard .page-intro {
    margin-bottom: .75rem;
}

.supervisor-dashboard-top {
    display: grid;
    grid-template-columns: minmax(0, 7fr) minmax(240px, 3fr);
    gap: .75rem;
}

.supervisor-dashboard-priority {
    align-self: stretch;
}

.supervisor-dashboard-section {
    margin-top: .75rem;
}

.supervisor-dashboard .card-heading {
    padding: 12px 18px;
}

.supervisor-dashboard .portal-table > :not(caption) > * > * {
    padding: .5rem .75rem;
}

.supervisor-dashboard-card--reports {
    background: #f4faf6;
}

.supervisor-dashboard-card--tours {
    background: #f4f8fc;
}

.supervisor-dashboard-card--samplings {
    background: #faefed;
}

.supervisor-dashboard-card--tours .portal-table,
.supervisor-dashboard-card--samplings .portal-table {
    --bs-table-bg: transparent;
    --bs-table-hover-bg: transparent;
}

.supervisor-dashboard-card--tours .portal-table > :not(caption) > * > *,
.supervisor-dashboard-card--samplings .portal-table > :not(caption) > * > * {
    background: transparent;
}

.supervisor-dashboard-card--tours .portal-table > tbody > tr:hover > *,
.supervisor-dashboard-card--samplings .portal-table > tbody > tr:hover > * {
    background: transparent;
}

.supervisor-dashboard-card--samplings .portal-table > thead > tr > th:not(:first-child),
.supervisor-dashboard-card--samplings .portal-table > tbody > tr > td {
    text-align: center;
}

.supervisor-dashboard-card--samplings .portal-table > thead > tr > th {
    border-bottom: 2px solid rgba(102, 117, 139, 0.34);
}

.supervisor-report-summary article + article {
    border-left: 1px solid var(--portal-border);
}

@media (max-width: 767.98px) {
    .supervisor-report-summary { grid-template-columns: 1fr; }
    .supervisor-report-summary article + article {
        border-top: 1px solid var(--portal-border);
        border-left: 0;
    }
}

.supervisor-report-chart {
    display: flex;
    gap: 1rem;
    min-height: 320px;
    padding: 1.5rem;
    overflow-x: auto;
    align-items: flex-start;
}

.supervisor-report-chart-column {
    display: grid;
    flex: 1 0 110px;
    max-width: 180px;
    min-width: 110px;
    gap: .35rem;
    text-align: center;
}

.supervisor-report-chart-track {
    display: flex;
    height: 190px;
    align-items: flex-end;
    justify-content: center;
    border-bottom: 1px solid var(--bs-border-color);
}

.supervisor-report-chart-bar {
    width: min(68px, 70%);
    height: max(3px, var(--bar-height));
    border-radius: .5rem .5rem 0 0;
    background: var(--bs-primary);
}

.supervisor-report-chart-value {
    font-weight: 700;
    color: var(--bs-primary);
}

.supervisor-sampling-chart-track {
    align-items: flex-end;
}

.supervisor-sampling-team-chart {
    gap: .25rem;
    padding-inline: .5rem;
}

.supervisor-sampling-team-chart .supervisor-report-chart-column {
    flex: 1 1 64px;
    min-width: 64px;
    max-width: none;
}

.supervisor-sampling-team-chart .supervisor-sampling-stack {
    width: min(48px, 68%);
}

.supervisor-sampling-team-chart .supervisor-report-chart-name,
.supervisor-sampling-team-chart .supervisor-report-chart-column > small {
    overflow-wrap: anywhere;
}

.supervisor-sampling-stack {
    display: flex;
    flex-direction: column-reverse;
    width: min(68px, 70%);
    height: 100%;
    justify-content: flex-start;
}

.supervisor-sampling-segment {
    min-height: 0;
}

.supervisor-sampling-segment:first-child {
    border-radius: 0 0 .25rem .25rem;
}

.supervisor-sampling-segment:last-child {
    border-radius: .5rem .5rem 0 0;
}

.supervisor-sampling-open {
    background: #f4b942;
}

.supervisor-sampling-successful {
    background: #27896f;
}

.supervisor-sampling-failed {
    background: #c65353;
}

.sampling-dashboard-legend,
.sampling-dashboard-legend span,
.sampling-status-breakdown span {
    display: flex;
    align-items: center;
    gap: .5rem;
}

.sampling-dashboard-legend {
    flex-wrap: wrap;
    gap: 1rem;
}

.sampling-dashboard-swatch {
    display: inline-block;
    width: .75rem;
    height: .75rem;
    border-radius: .2rem;
}

.sampling-status-donut {
    display: grid;
    width: 180px;
    height: 180px;
    place-items: center;
    border-radius: 50%;
    background: conic-gradient(
        #f4b942 0 var(--open-end),
        #27896f var(--open-end) var(--successful-end),
        #c65353 var(--successful-end) 100%
    );
}

.sampling-status-donut > div {
    display: grid;
    width: 112px;
    height: 112px;
    place-content: center;
    border-radius: 50%;
    background: var(--bs-body-bg);
    text-align: center;
}

.sampling-status-donut strong {
    font-size: 2rem;
}

.sampling-status-donut small {
    color: var(--bs-secondary-color);
}

.sampling-status-breakdown {
    display: grid;
    gap: .75rem;
}

.sampling-status-breakdown > div {
    display: flex;
    justify-content: space-between;
    gap: .75rem;
}

.sampling-status-breakdown small {
    color: var(--bs-secondary-color);
    font-weight: 400;
}

.supervisor-dashboard-sampling-layout {
    display: grid;
    grid-template-columns: minmax(0, 3fr) minmax(240px, 1fr);
}

.supervisor-dashboard-sampling-chart {
    align-self: center;
    border-left: 1px solid rgba(102, 117, 139, 0.16);
}

.supervisor-dashboard-sampling-chart .sampling-status-donut {
    width: 150px;
    height: 150px;
}

.supervisor-dashboard-sampling-chart .sampling-status-donut > div {
    width: 92px;
    height: 92px;
}

.supervisor-dashboard-sampling-chart .sampling-status-donut strong {
    font-size: 1.65rem;
}

.supervisor-dashboard-sampling-chart .sampling-status-breakdown {
    display: flex;
    max-width: none;
    margin-inline: auto;
    flex-wrap: wrap;
    justify-content: center;
    gap: .4rem .8rem;
    font-size: .85rem;
}

@media (max-width: 767.98px) {
    .supervisor-dashboard-top { grid-template-columns: 1fr; }
    .supervisor-dashboard-priority { min-height: auto; }
}

.supervisor-dashboard-sampling-chart .sampling-status-breakdown > div {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    gap: .3rem;
    white-space: nowrap;
}

.supervisor-dashboard-sampling-chart .sampling-status-breakdown > div > span {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
}

.supervisor-dashboard-sampling-chart .sampling-status-breakdown > div > strong {
    display: inline-flex;
    align-items: center;
    gap: .2rem;
    font-size: inherit;
    white-space: nowrap;
}

.supervisor-dashboard-sampling-chart [data-sampling-chart-count],
.supervisor-dashboard-sampling-chart [data-sampling-chart-percent] {
    display: inline;
    color: inherit;
    font-size: inherit;
    line-height: inherit;
    white-space: nowrap;
}

.supervisor-sampling-status-open {
    background: #fff3cd;
    color: #765b00;
}

.supervisor-sampling-status-successful {
    background: #d9f2eb;
    color: #17644f;
}

.supervisor-sampling-status-failed {
    background: #f8dede;
    color: #8b3030;
}

.supervisor-sampling-internal-label {
    display: block;
    color: var(--bs-secondary-color);
    font-weight: 600;
}

.supervisor-report-first-name,
.supervisor-report-last-name {
    display: block;
}
