:root {
    --portal-sidebar-width: 252px;
    --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;
}

* {
    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: 22px 14px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    min-height: 48px;
    padding: 0 12px;
    color: #fff;
    font-size: 1.65rem;
    font-weight: 750;
    letter-spacing: -0.04em;
    text-decoration: none;
}

.brand-mark {
    position: relative;
    display: inline-block;
    width: 27px;
    height: 32px;
}

.brand-mark span {
    position: absolute;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #f04455;
}

.brand-mark span:nth-child(1) { left: 0; top: 5px; }
.brand-mark span:nth-child(2) { left: 10px; top: 5px; }
.brand-mark span:nth-child(3) { left: 5px; top: 14px; }
.brand-mark span:nth-child(4) { left: 15px; top: 14px; }
.brand-mark span:nth-child(5) { left: 10px; top: 23px; }

.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 {
    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;
}

.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: 76px;
    padding: 0 28px;
    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);
}

.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 {
    border: 1px solid var(--portal-border);
    color: var(--portal-text);
    background: #fff;
}

.portal-main {
    width: 100%;
    max-width: 1600px;
    margin: 0 auto;
    padding: 26px 28px 42px;
}

.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;
}

.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-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;
}

.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-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: 20px;
}

.portal-offcanvas .offcanvas-body {
    padding: 0 14px 24px;
}

.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-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;
}

.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: 1199.98px) {
    .business-information-grid {
        grid-template-columns: 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;
}

.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;
}

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

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

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

.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: flex;
    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-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-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) 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: 28px;
    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-row-error {
    grid-column: 2 / -1;
}

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

    .portal-header {
        min-height: 68px;
        padding: 0 18px;
    }

    .portal-main {
        padding: 22px 18px 34px;
    }

    .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;
    }
}

@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);
    }

    .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-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-stop-number,
.tour-numbered-marker span {
    align-items: center;
    background: #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;
    }
}
