:root {
    --tepas-orange: #e94c13;
    --tepas-orange-dark: #cf3f0b;

    --tepas-bg: #f5f6f8;
    --tepas-surface: #ffffff;

    --tepas-text: #1f2933;
    --tepas-text-muted: #6b7280;

    --tepas-border: #e5e7eb;

    --tepas-sidebar-width: 240px;
    --tepas-sidebar-collapsed-width: 72px;

    --tepas-radius: 12px;

    --tepas-transition: 180ms ease;
}


/* ---------------------------------------------------------
   Base
--------------------------------------------------------- */

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
}

body {
    font-family:
        Inter,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Roboto,
        Helvetica,
        Arial,
        sans-serif;

    background: var(--tepas-bg);
    color: var(--tepas-text);
}

.sr-only {
    position: absolute;

    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;

    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;

    border: 0;
}


/* ---------------------------------------------------------
   Main application layout
--------------------------------------------------------- */

.app-shell {
    display: flex;
    min-height: 100vh;
}


/* ---------------------------------------------------------
   Sidebar
--------------------------------------------------------- */

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;

    width: var(--tepas-sidebar-width);

    display: flex;
    flex-direction: column;

    background: var(--tepas-surface);
    border-right: 1px solid var(--tepas-border);

    z-index: 100;
}


/* ---------------------------------------------------------
   Tepas branding
--------------------------------------------------------- */

.sidebar-brand {
    height: 86px;

    display: flex;
    align-items: center;

    padding: 16px 20px;

    background: var(--tepas-orange);
}

.sidebar-logo {
    display: block;
    max-width: 100%;
    object-fit: contain;
}

.sidebar-logo-full {
    width: 195px;
    max-height: 58px;
}

.sidebar-logo-small {
    display: none;
    width: 40px;
    height: 40px;
}


/* ---------------------------------------------------------
   Main navigation
--------------------------------------------------------- */

.sidebar-nav {
    display: flex;
    flex-direction: column;

    gap: 4px;

    padding: 18px 12px;
}

.nav-item {
    min-height: 46px;

    display: flex;
    align-items: center;

    gap: 12px;

    padding: 0 14px;

    border-radius: 9px;

    color: #4b5563;
    text-decoration: none;

    font-size: 14px;
    font-weight: 500;

    transition:
        background var(--tepas-transition),
        color var(--tepas-transition);
}

a.nav-item:hover {
    background: #fff2ed;
    color: var(--tepas-orange);
}

.nav-item.active {
    background: #fff0ea;
    color: var(--tepas-orange);

    font-weight: 600;
}

.nav-icon {
    width: 22px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    flex-shrink: 0;

    font-size: 20px;
}

.nav-label {
    white-space: nowrap;
}

.nav-item-disabled {
    cursor: default;
}


/* ---------------------------------------------------------
   Bottom sidebar section
--------------------------------------------------------- */

.sidebar-bottom {
    margin-top: auto;

    padding: 12px;

    border-top: 1px solid var(--tepas-border);
}


/* ---------------------------------------------------------
   Main area
--------------------------------------------------------- */

.app-main {
    width: calc(100% - var(--tepas-sidebar-width));

    margin-left: var(--tepas-sidebar-width);

    min-height: 100vh;
}


/* ---------------------------------------------------------
   Top bar
--------------------------------------------------------- */

.topbar {
    height: 70px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 0 28px;

    background: var(--tepas-surface);
    border-bottom: 1px solid var(--tepas-border);
}

.topbar-left {
    display: flex;
    align-items: center;
}

.sidebar-toggle {
    width: 38px;
    height: 38px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    border: 1px solid var(--tepas-border);
    border-radius: 8px;

    background: var(--tepas-surface);
    color: var(--tepas-text-muted);

    font-size: 18px;

    cursor: pointer;

    transition:
        border-color var(--tepas-transition),
        color var(--tepas-transition),
        background var(--tepas-transition);
}

.sidebar-toggle:hover {
    background: #fff7f3;
    border-color: #ffc7b2;
    color: var(--tepas-orange);
}


/* ---------------------------------------------------------
   User area
--------------------------------------------------------- */

.topbar-user {
    display: flex;
    align-items: center;

    gap: 18px;
}

.user-name {
    font-size: 14px;
    font-weight: 600;
}

.topbar-user form {
    margin: 0;
}

.logout-button {
    border: 0;
    background: transparent;

    padding: 8px 10px;

    color: var(--tepas-text-muted);

    font: inherit;
    font-size: 14px;

    cursor: pointer;

    border-radius: 7px;

    transition:
        color var(--tepas-transition),
        background var(--tepas-transition);
}

.logout-button:hover {
    color: var(--tepas-orange);
    background: #fff2ed;
}


/* ---------------------------------------------------------
   Page content
--------------------------------------------------------- */

.content {
    padding: 30px;

    max-width: 1600px;
    margin: 0 auto;
}


/* ---------------------------------------------------------
   Tablet preparation
--------------------------------------------------------- */

@media (max-width: 1024px) {

    :root {
        --tepas-sidebar-width: 210px;
    }

    .sidebar-brand {
        padding-left: 16px;
        padding-right: 16px;
    }

    .sidebar-logo-full {
        width: 160px;
    }

    .content {
        padding: 24px;
    }
}

/* ---------------------------------------------------------
   Page header
--------------------------------------------------------- */

.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;

    margin-bottom: 28px;
}

.page-title {
    margin: 0;

    font-size: 32px;
    line-height: 1.2;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.page-subtitle {
    margin: 8px 0 0;

    color: var(--tepas-text-muted);
    font-size: 15px;
}


/* ---------------------------------------------------------
   Dashboard overview cards
--------------------------------------------------------- */

.dashboard-cards {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));

    gap: 20px;
}

.dashboard-card {
    position: relative;

    min-height: 180px;

    display: flex;
    align-items: flex-start;

    gap: 16px;

    padding: 22px;

    background: var(--tepas-surface);
    border: 1px solid var(--tepas-border);
    border-radius: var(--tepas-radius);

    box-shadow: 0 2px 8px rgba(31, 41, 51, 0.04);

    transition:
        transform var(--tepas-transition),
        border-color var(--tepas-transition),
        box-shadow var(--tepas-transition);
}

.dashboard-card-link {
    color: inherit;
    text-decoration: none;
    cursor: pointer;
}

.dashboard-card-main-link {
    position: absolute;
    z-index: 1;
    inset: 0;

    border-radius: inherit;
}

.dashboard-card-main-link:focus-visible {
    outline: 3px solid rgba(233, 76, 19, 0.35);
    outline-offset: 3px;
}

.dashboard-card-link:hover {
    transform: translateY(-2px);

    border-color: #ffc2aa;

    box-shadow: 0 7px 20px rgba(31, 41, 51, 0.08);
}

.dashboard-card-future {
    background: #eef1f4;
    color: var(--tepas-text-muted);
    cursor: default;
}

.dashboard-card-future .dashboard-card-icon {
    background: #e1e5e9;
    color: #8a929b;
}

.dashboard-card-future .dashboard-card-value,
.dashboard-card-future .dashboard-card-title {
    color: #737c86;
}

.dashboard-card-icon {
    width: 44px;
    height: 44px;

    display: flex;
    align-items: center;
    justify-content: center;

    flex: 0 0 44px;

    background: #fff0ea;
    border-radius: 10px;

    color: var(--tepas-orange);

    font-size: 23px;
    font-weight: 600;
}

.dashboard-card-content {
    min-width: 0;

    display: flex;
    flex-direction: column;
}

.dashboard-card-value {
    color: var(--tepas-text);

    font-size: 30px;
    line-height: 1;
    font-weight: 700;
}

.dashboard-card-title {
    margin-top: 7px;

    color: var(--tepas-text);

    font-size: 15px;
    font-weight: 600;
}

.dashboard-card-meta {
    display: flex;
    flex-wrap: wrap;

    gap: 5px 12px;

    margin-top: 18px;

    color: var(--tepas-text-muted);

    font-size: 12px;
    line-height: 1.4;
}

.dashboard-card-meta-link {
    position: relative;
    z-index: 2;

    color: inherit;
    text-decoration: none;
}

.dashboard-card-meta-link:hover,
.dashboard-card-meta-link:focus-visible {
    color: var(--tepas-orange);
    text-decoration: underline;
}

.dashboard-card-meta-alert {
    color: #c62828;
    font-weight: 700;
}


/* ---------------------------------------------------------
   Dashboard responsive layout
--------------------------------------------------------- */

@media (max-width: 1250px) {

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

@media (max-width: 700px) {

    .dashboard-cards {
        grid-template-columns: 1fr;
    }

    .page-title {
        font-size: 28px;
    }
}

/* ---------------------------------------------------------
   Collapsed sidebar
--------------------------------------------------------- */

.sidebar,
.app-main,
.sidebar-brand,
.nav-item,
.sidebar-logo-full,
.sidebar-logo-small {
    transition:
        width var(--tepas-transition),
        margin-left var(--tepas-transition),
        padding var(--tepas-transition),
        opacity var(--tepas-transition);
}

.app-shell.sidebar-collapsed .sidebar {
    width: var(--tepas-sidebar-collapsed-width);
}

.app-shell.sidebar-collapsed .app-main {
    width: calc(100% - var(--tepas-sidebar-collapsed-width));
    margin-left: var(--tepas-sidebar-collapsed-width);
}

.app-shell.sidebar-collapsed .sidebar-brand {
    padding-left: 16px;
    padding-right: 16px;
    justify-content: center;
}

.app-shell.sidebar-collapsed .sidebar-logo-full {
    display: none;
}

.app-shell.sidebar-collapsed .sidebar-logo-small {
    display: block;
    width: 40px;
    height: 40px;
}

.app-shell.sidebar-collapsed .nav-item {
    justify-content: center;
    padding-left: 0;
    padding-right: 0;
}

.app-shell.sidebar-collapsed .nav-label {
    display: none;
}

.app-shell.sidebar-collapsed .nav-icon {
    width: 22px;
}

.app-shell.sidebar-collapsed .sidebar-bottom {
    padding-left: 12px;
    padding-right: 12px;
}

/* ---------------------------------------------------------
   Mobile navigation
--------------------------------------------------------- */

@media (max-width: 700px) {

    .sidebar {
        width: 260px;
        transform: translateX(-100%);
        box-shadow: 12px 0 30px rgba(31, 41, 51, 0.14);
    }

    .app-main,
    .app-shell.sidebar-collapsed .app-main {
        width: 100%;
        margin-left: 0;
    }

    .app-shell.sidebar-mobile-open .sidebar {
        transform: translateX(0);
    }

    .app-shell.sidebar-mobile-open .sidebar-logo-full {
        display: block;
    }

    .app-shell.sidebar-mobile-open .sidebar-logo-small {
        display: none;
    }

    .app-shell.sidebar-mobile-open .sidebar-brand {
        justify-content: flex-start;
        padding-left: 20px;
        padding-right: 20px;
    }

    .app-shell.sidebar-mobile-open .nav-item {
        justify-content: flex-start;
        padding-left: 14px;
        padding-right: 14px;
    }

    .app-shell.sidebar-mobile-open .nav-label {
        display: inline;
    }

    .topbar {
        padding-left: 18px;
        padding-right: 18px;
    }

    .content {
        padding: 24px 18px;
    }
}

/* ---------------------------------------------------------
   Mobile sidebar overlay
--------------------------------------------------------- */

.mobile-sidebar-overlay {
    display: none;
}

@media (max-width: 700px) {

    .mobile-sidebar-overlay {
        position: fixed;
        inset: 0;

        display: block;

        border: 0;
        padding: 0;

        background: rgba(31, 41, 51, 0.38);

        opacity: 0;
        visibility: hidden;

        z-index: 90;

        transition:
            opacity var(--tepas-transition),
            visibility var(--tepas-transition);
    }

    .app-shell.sidebar-mobile-open .mobile-sidebar-overlay {
        opacity: 1;
        visibility: visible;
    }

    .sidebar {
        z-index: 100;
    }
}

/* ---------------------------------------------------------
   Login page
--------------------------------------------------------- */

.login-page {
    min-height: 100vh;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    padding: 32px 20px;

    background:
        linear-gradient(
            135deg,
            rgba(233, 76, 19, 0.06),
            rgba(255, 255, 255, 0) 45%
        ),
        var(--tepas-bg);
}

.login-brand {
    margin-bottom: 22px;
}

.login-logo {
    display: block;
    width: 220px;
    max-width: 80vw;
    height: auto;
}

.login-card {
    width: 100%;
    max-width: 420px;

    padding: 34px;

    background: var(--tepas-surface);
    border: 1px solid var(--tepas-border);
    border-radius: 16px;

    box-shadow: 0 12px 35px rgba(31, 41, 51, 0.08);
}

.login-header {
    margin-bottom: 28px;
}

.login-header h1 {
    margin: 0;

    font-size: 30px;
    line-height: 1.2;
    font-weight: 700;
}

.login-header p {
    margin: 8px 0 0;

    color: var(--tepas-text-muted);
    font-size: 15px;
}

.login-form {
    display: flex;
    flex-direction: column;

    gap: 20px;
}

.login-field {
    display: flex;
    flex-direction: column;

    gap: 8px;
}

.login-field label {
    color: var(--tepas-text);

    font-size: 14px;
    font-weight: 600;
}

.login-field input {
    width: 100%;
    height: 46px;

    padding: 0 13px;

    border: 1px solid #cfd4da;
    border-radius: 9px;

    background: #ffffff;
    color: var(--tepas-text);

    font: inherit;
    font-size: 15px;

    outline: none;

    transition:
        border-color var(--tepas-transition),
        box-shadow var(--tepas-transition);
}

.login-field input:focus {
    border-color: var(--tepas-orange);
    box-shadow: 0 0 0 3px rgba(233, 76, 19, 0.12);
}

.login-button {
    height: 46px;

    border: 0;
    border-radius: 9px;

    background: var(--tepas-orange);
    color: #ffffff;

    font: inherit;
    font-size: 15px;
    font-weight: 600;

    cursor: pointer;

    transition:
        background var(--tepas-transition),
        transform var(--tepas-transition);
}

.login-button:hover {
    background: var(--tepas-orange-dark);
}

.login-button:active {
    transform: translateY(1px);
}

.login-button-link {
    display: flex;
    align-items: center;
    justify-content: center;

    margin-top: 24px;
    text-decoration: none;
}

.login-error {
    margin-bottom: 20px;

    padding: 12px 14px;

    border: 1px solid #f3c1b0;
    border-radius: 9px;

    background: #fff3ee;
    color: #9f2f0b;

    font-size: 14px;
}

.login-error ul,
.login-field .errorlist {
    margin: 0;
    padding-left: 18px;
}

.login-field .errorlist {
    color: #b42318;
    font-size: 13px;
}

.login-footer {
    margin: 18px 0 0;

    color: var(--tepas-text-muted);

    font-size: 13px;
}

@media (max-width: 700px) {

    .login-page {
        padding: 24px 16px;
    }

    .login-logo {
        width: 190px;
    }

    .login-card {
        padding: 26px 22px;
        border-radius: 14px;
    }

    .login-header h1 {
        font-size: 26px;
    }
}

/* ---------------------------------------------------------
   Customers overview
--------------------------------------------------------- */

.customer-list-card {
    overflow: hidden;

    background: var(--tepas-surface);
    border: 1px solid var(--tepas-border);
    border-radius: var(--tepas-radius);

    box-shadow: 0 2px 8px rgba(31, 41, 51, 0.04);
}


/* Header */

.customer-list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 20px;

    padding: 20px 22px;

    border-bottom: 1px solid var(--tepas-border);
}

.customer-list-header h2 {
    margin: 0;

    font-size: 18px;
    font-weight: 650;
}

.customer-list-header p {
    margin: 5px 0 0;

    color: var(--tepas-text-muted);

    font-size: 13px;
}

.customer-list-header-actions {
    display: flex;
    align-items: center;

    gap: 10px;
}


/* Header actions */

.customer-clear-filters,
.customer-apply-filters {
    min-height: 38px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    padding: 0 14px;

    border-radius: 8px;

    font: inherit;
    font-size: 13px;
    font-weight: 600;

    text-decoration: none;

    cursor: pointer;
}

.customer-clear-filters {
    border: 1px solid var(--tepas-border);

    background: var(--tepas-surface);
    color: var(--tepas-text-muted);
}

.customer-clear-filters:hover {
    border-color: #ffc7b2;

    background: #fff7f3;
    color: var(--tepas-orange);
}

.customer-apply-filters {
    border: 1px solid var(--tepas-orange);

    background: var(--tepas-orange);
    color: #ffffff;
}

.customer-apply-filters:hover {
    background: var(--tepas-orange-dark);
    border-color: var(--tepas-orange-dark);
}


/* Table */

.customer-table-wrapper {
    width: 100%;

    overflow-x: auto;
}

.customer-table-form {
    margin: 0;
}

.customer-mobile-filter-form {
    display: none;
}

.customer-mobile-link-indicator {
    display: none;
}

.customer-table {
    width: 100%;

    table-layout: fixed;
    border-collapse: collapse;

    font-size: 14px;
}

.customer-table th,
.customer-table td {
    padding: 14px 10px;

    text-align: left;
    vertical-align: middle;

    border-bottom: 1px solid var(--tepas-border);

    white-space: nowrap;
}

.customer-table th {
    background: #fafafa;

    color: var(--tepas-text-muted);

    font-size: 12px;
    font-weight: 650;
    letter-spacing: 0.02em;

    text-transform: uppercase;
}

.customer-table tbody tr {
    transition: background var(--tepas-transition);
}

.customer-table tbody tr:hover {
    background: #fff8f5;
}

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

.customer-table td strong {
    color: var(--tepas-text);

    font-weight: 650;
}


/* Filters */

.customer-table-filters th {
    padding-top: 8px;
    padding-bottom: 10px;

    background: #fafafa;
}

.customer-table-filters input,
.customer-table-filters select {
    width: 100%;
    min-width: 0;
    height: 36px;

    padding: 0 7px;

    border: 1px solid #d5d9df;
    border-radius: 7px;

    background: #ffffff;
    color: var(--tepas-text);

    font: inherit;
    font-size: 13px;

    outline: none;
}

.customer-table-filters input:focus,
.customer-table-filters select:focus {
    border-color: var(--tepas-orange);

    box-shadow: 0 0 0 3px rgba(233, 76, 19, 0.10);
}

.customer-filter-hint {
    min-height: 36px;

    display: inline-flex;
    align-items: center;

    color: var(--tepas-text-muted);

    font-size: 12px;
    font-weight: 500;
}


/* Column widths */

/* Company */
.customer-table th:nth-child(1),
.customer-table td:nth-child(1) {
    width: 15%;
}

/* Status */
.customer-table th:nth-child(2),
.customer-table td:nth-child(2) {
    width: 9%;
}

/* Type */
.customer-table th:nth-child(3),
.customer-table td:nth-child(3) {
    width: 9%;
}

/* Sector */
.customer-table th:nth-child(4),
.customer-table td:nth-child(4) {
    width: 10%;
}

/* Product group */
.customer-table th:nth-child(5),
.customer-table td:nth-child(5) {
    width: 13%;
}

/* City */
.customer-table th:nth-child(6),
.customer-table td:nth-child(6) {
    width: 9%;
}

/* Postal code */
.customer-table th:nth-child(7),
.customer-table td:nth-child(7) {
    width: 8%;
}

/* Country */
.customer-table th:nth-child(8),
.customer-table td:nth-child(8) {
    width: 9%;
}

/* Tepas contact */
.customer-table th:nth-child(9),
.customer-table td:nth-child(9) {
    width: 11%;
}

/* Active */
.customer-table th:nth-child(10),
.customer-table td:nth-child(10) {
    width: 7%;
}


/* Cell wrapping */

.customer-table td:nth-child(1),
.customer-table td:nth-child(4),
.customer-table td:nth-child(5),
.customer-table td:nth-child(6),
.customer-table td:nth-child(8),
.customer-table td:nth-child(9) {
    white-space: normal;
    overflow-wrap: anywhere;
}

.customer-table td:nth-child(2),
.customer-table td:nth-child(3),
.customer-table td:nth-child(7),
.customer-table td:nth-child(10) {
    white-space: nowrap;
}


/* Empty state */

.customer-list-empty {
    padding: 42px 22px;

    text-align: center;

    color: var(--tepas-text-muted);
}

.customer-list-empty p {
    margin: 0;
}


/* Responsive */

@media (max-width: 1100px) {

    .customer-list-header {
        align-items: flex-start;
    }

    .customer-list-header-actions {
        flex-wrap: wrap;
        justify-content: flex-end;
    }
}

@media (max-width: 700px) {

    .customer-list-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .customer-list-header-actions {
        width: 100%;

        justify-content: flex-start;
    }

    .customer-list-header-actions > a {
        flex: 1;
    }

    .customer-mobile-filter-form {
        display: block;

        padding: 16px;

        border-bottom: 1px solid var(--tepas-border);
    }

    .customer-mobile-filters {
        border: 1px solid var(--tepas-border);
        border-radius: 8px;

        background: #ffffff;
    }

    .customer-mobile-filters summary {
        min-height: 44px;

        display: flex;
        align-items: center;
        justify-content: center;

        padding: 0 14px;

        color: var(--tepas-text);

        font-size: 14px;
        font-weight: 650;

        cursor: pointer;
        list-style: none;
    }

    .customer-mobile-filters summary::-webkit-details-marker {
        display: none;
    }

    .customer-mobile-filter-grid {
        display: grid;
        grid-template-columns: 1fr;

        gap: 12px;
        padding: 14px;

        border-top: 1px solid var(--tepas-border);
    }

    .customer-mobile-filter-grid label {
        display: flex;
        flex-direction: column;

        gap: 6px;

        color: var(--tepas-text-muted);

        font-size: 12px;
        font-weight: 650;
    }

    .customer-mobile-filter-grid input,
    .customer-mobile-filter-grid select {
        width: 100%;
        min-width: 0;
        height: 42px;

        padding: 0 10px;

        border: 1px solid #d5d9df;
        border-radius: 7px;

        background: #ffffff;
        color: var(--tepas-text);

        font: inherit;
        font-size: 14px;
        font-weight: 400;
    }

    .customer-mobile-filter-grid input:focus,
    .customer-mobile-filter-grid select:focus {
        border-color: var(--tepas-orange);
        outline: none;

        box-shadow: 0 0 0 3px rgba(233, 76, 19, 0.10);
    }

    .customer-mobile-filter-actions {
        display: flex;
        justify-content: flex-end;

        padding: 0 14px 14px;
    }

    .customer-mobile-filter-actions .customer-apply-filters {
        width: 100%;
    }

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

    .customer-table-filters {
        display: none;
    }

    .customer-table-headings th,
    .customer-table tbody td {
        display: none;
    }

    .customer-table-headings .customer-column-company,
    .customer-table-headings .customer-column-country,
    .customer-table tbody .customer-column-company,
    .customer-table tbody .customer-column-country,
    .customer-table tbody .customer-table-empty-cell {
        display: table-cell;
    }

    .customer-table th.customer-column-company,
    .customer-table td.customer-column-company {
        width: 62%;
    }

    .customer-table th.customer-column-country,
    .customer-table td.customer-column-country {
        width: 38%;
    }

    .customer-table td.customer-column-company,
    .customer-table td.customer-column-country {
        white-space: normal;
        overflow-wrap: break-word;
    }

    .customer-table td.customer-column-company .customer-company-link {
        display: inline-flex;
        align-items: center;

        gap: 6px;
    }

    .customer-mobile-link-indicator {
        display: inline-block;
        flex: 0 0 auto;

        color: var(--tepas-orange);

        font-size: 21px;
        line-height: 1;
        font-weight: 700;
    }

    .customer-table th,
    .customer-table td {
        padding-top: 12px;
        padding-bottom: 12px;
    }
}

/* ---------------------------------------------------------
   Conversation Reports overview
--------------------------------------------------------- */

.report-list-card {
    overflow: hidden;

    background: var(--tepas-surface);
    border: 1px solid var(--tepas-border);
    border-radius: var(--tepas-radius);

    box-shadow: 0 2px 8px rgba(31, 41, 51, 0.04);
}

.report-list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 20px;

    padding: 20px 22px;

    border-bottom: 1px solid var(--tepas-border);
}

.report-list-header h2 {
    margin: 0;

    font-size: 18px;
    font-weight: 650;
}

.report-list-header p {
    margin: 5px 0 0;

    color: var(--tepas-text-muted);

    font-size: 13px;
}

.report-list-header-actions {
    display: flex;
    align-items: center;

    gap: 10px;
}

.report-clear-filters {
    min-height: 38px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    padding: 0 14px;

    border: 1px solid var(--tepas-border);
    border-radius: 8px;

    background: var(--tepas-surface);
    color: var(--tepas-text-muted);

    font-size: 13px;
    font-weight: 600;
    text-decoration: none;

    cursor: pointer;
}

.report-clear-filters:hover {
    border-color: #ffc7b2;

    background: #fff7f3;
    color: var(--tepas-orange);
}

.report-table-wrapper {
    width: 100%;

    overflow-x: auto;
}

.report-table-form {
    margin: 0;
}

.report-mobile-filter-form {
    display: none;
}

.report-table {
    width: 100%;
    min-width: 780px;

    table-layout: fixed;
    border-collapse: collapse;

    font-size: 14px;
}

.report-table th,
.report-table td {
    padding: 14px 10px;

    text-align: left;
    vertical-align: middle;

    border-bottom: 1px solid var(--tepas-border);
}

.report-table th {
    background: #fafafa;

    color: var(--tepas-text-muted);

    font-size: 12px;
    font-weight: 650;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.report-table tbody tr {
    transition: background var(--tepas-transition);
}

.report-table tbody tr:hover {
    background: #fff8f5;
}

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

.report-table td strong {
    color: var(--tepas-text);
    font-weight: 650;
}

.report-table-filters th {
    padding-top: 8px;
    padding-bottom: 10px;

    background: #fafafa;
    vertical-align: top;
}

.report-table-filters input,
.report-table-filters select {
    width: 100%;
    min-width: 0;
    height: 36px;

    padding: 0 7px;

    border: 1px solid #d5d9df;
    border-radius: 7px;

    background: #ffffff;
    color: var(--tepas-text);

    font: inherit;
    font-size: 12px;

    outline: none;
}

.report-table-filters input:focus,
.report-table-filters select:focus {
    border-color: var(--tepas-orange);

    box-shadow: 0 0 0 3px rgba(233, 76, 19, 0.10);
}

.report-filter-stack {
    display: grid;

    gap: 6px;
}

/* Date */
.report-table th:nth-child(1),
.report-table td:nth-child(1) {
    width: 12%;
}

/* Subject */
.report-table th:nth-child(2),
.report-table td:nth-child(2) {
    width: 19%;
}

/* Primary customer */
.report-table th:nth-child(3),
.report-table td:nth-child(3) {
    width: 18%;
}

/* Conversation type */
.report-table th:nth-child(4),
.report-table td:nth-child(4) {
    width: 14%;
}

/* Tepas participants */
.report-table th:nth-child(5),
.report-table td:nth-child(5) {
    width: 15%;
}

/* Status */
.report-table th:nth-child(6),
.report-table td:nth-child(6) {
    width: 12%;
}

/* Tasks */
.report-table th:nth-child(7),
.report-table td:nth-child(7) {
    width: 10%;
}

.report-cell-secondary {
    display: block;

    margin-top: 3px;

    color: var(--tepas-text-muted);
    font-size: 12px;
}

.report-subject-link,
.report-customer-link {
    color: var(--tepas-text);

    text-decoration: none;
}

.report-subject-link {
    font-weight: 650;
}

.report-subject-link:hover,
.report-customer-link:hover {
    color: var(--tepas-orange);

    text-decoration: underline;
}

.report-status,
.report-archived-label {
    display: inline-flex;
    align-items: center;

    padding: 4px 8px;

    border-radius: 999px;

    font-size: 12px;
    font-weight: 650;
}

.report-status-draft {
    background: #f1f3f5;
    color: #4b5563;
}

.report-status-finalised {
    background: #fff3db;
    color: #9a5b00;
}

.report-status-closed {
    background: #e9f7ef;
    color: #237a45;
}

.report-archived-label {
    margin-top: 5px;

    background: #fce8e6;
    color: #a1271d;
}

.report-list-empty {
    padding: 42px 22px;

    text-align: center;

    color: var(--tepas-text-muted);
}

.report-list-empty p {
    margin: 0;
}

/* ---------------------------------------------------------
   Task overview
--------------------------------------------------------- */

.task-primary-filters {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));

    gap: 12px;

    padding: 14px 12px;

    border-bottom: 1px solid var(--tepas-border);

    background: #fafafa;
}

.task-primary-filters label {
    min-width: 0;

    display: grid;

    gap: 5px;
}

.task-primary-filters label > span {
    color: var(--tepas-text-muted);

    font-size: 11px;
    font-weight: 650;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.task-primary-filters select,
.task-table-filters input,
.task-table-filters select {
    width: 100%;
    min-width: 0;
    height: 36px;

    padding: 0 8px;

    border: 1px solid #d5d9df;
    border-radius: 7px;

    background: #ffffff;
    color: var(--tepas-text);

    font: inherit;
    font-size: 12px;

    outline: none;
}

.task-primary-filters select:focus,
.task-table-filters input:focus,
.task-table-filters select:focus {
    border-color: var(--tepas-orange);

    box-shadow: 0 0 0 3px rgba(233, 76, 19, 0.10);
}

.task-table-wrapper {
    width: 100%;

    overflow: hidden;
}

.task-table {
    width: 100%;

    table-layout: fixed;
    border-collapse: collapse;

    font-size: 13px;
}

.task-table th,
.task-table td {
    padding: 13px 10px;

    border-bottom: 1px solid var(--tepas-border);

    text-align: left;
    vertical-align: top;

    overflow-wrap: anywhere;
}

.task-table th {
    background: #fafafa;
    color: var(--tepas-text-muted);

    font-size: 11px;
    font-weight: 650;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.task-table tbody tr {
    transition: background var(--tepas-transition);
}

.task-table tbody tr:hover {
    background: #fff8f5;
}

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

.task-table td strong {
    color: var(--tepas-text);

    font-weight: 650;
}

.task-table-filters th {
    padding-top: 8px;
    padding-bottom: 10px;

    background: #fafafa;
    vertical-align: top;
}

.task-table th:nth-child(1),
.task-table td:nth-child(1) {
    width: 12%;
}

.task-table th:nth-child(2),
.task-table td:nth-child(2) {
    width: 18%;
}

.task-table th:nth-child(3),
.task-table td:nth-child(3) {
    width: 15%;
}

.task-table th:nth-child(4),
.task-table td:nth-child(4) {
    width: 14%;
}

.task-table th:nth-child(5),
.task-table td:nth-child(5) {
    width: 9%;
}

.task-table th:nth-child(6),
.task-table td:nth-child(6) {
    width: 13%;
}

.task-table th:nth-child(7),
.task-table td:nth-child(7) {
    width: 10%;
}

.task-table th:nth-child(8),
.task-table td:nth-child(8) {
    width: 9%;
}

.task-table .report-task-action-cell a,
.task-table .report-task-action-cell button {
    min-width: 44px;

    padding-right: 8px;
    padding-left: 8px;

    white-space: nowrap;
}

.task-row-actions {
    display: flex;
    align-items: flex-end;
    flex-direction: column;

    gap: 5px;
}

.task-row-actions form {
    margin: 0;
}

.task-team-assignee-cell {
    background-color: var(--team-light-color, #f5f5f5);
    box-shadow: inset 4px 0 0 var(--team-color, var(--tepas-orange));
    color: var(--tepas-text);
}

.task-pagination {
    display: flex;
    align-items: center;
    justify-content: center;

    gap: 14px;

    padding: 14px 18px;

    border-top: 1px solid var(--tepas-border);

    background: #fafafa;
    color: var(--tepas-text-muted);

    font-size: 13px;
}

.task-pagination a {
    min-height: 34px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    padding: 0 12px;

    border: 1px solid var(--tepas-border);
    border-radius: 7px;

    background: var(--tepas-surface);
    color: var(--tepas-text);

    font-weight: 600;
    text-decoration: none;
}

.task-pagination a:hover {
    border-color: #ffc7b2;

    background: #fff7f3;
    color: var(--tepas-orange);
}

.task-row-overdue {
    background: #fffaf5;
}

.task-overdue-label {
    display: block;

    margin-top: 4px;

    color: #a14b00;

    font-size: 11px;
    font-weight: 650;
}

.task-source-link {
    color: var(--tepas-text);

    font-weight: 600;
    text-decoration: none;
}

.task-title-link {
    color: var(--tepas-text);

    font-weight: 650;
    text-decoration: none;
}

.task-title-link:hover {
    color: var(--tepas-orange);

    text-decoration: underline;
}

.task-source-link:hover {
    color: var(--tepas-orange);

    text-decoration: underline;
}

.task-detail-page-header {
    align-items: center;
}

.task-detail-overdue {
    display: inline-flex;
    align-items: center;

    min-height: 28px;

    padding: 0 10px;

    border-radius: 999px;

    background: #fff0e5;
    color: #a14b00;

    font-size: 12px;
    font-weight: 650;
}

.task-detail-layout {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));

    gap: 20px;
}

.task-detail-description {
    line-height: 1.55;

    overflow-wrap: anywhere;
}

.task-status-form {
    display: flex;
    align-items: center;

    gap: 8px;

    margin: 0;
}

.task-status-form select {
    min-width: 150px;
    min-height: 40px;

    padding: 0 34px 0 11px;

    border: 1px solid var(--tepas-border);
    border-radius: 8px;

    background: #ffffff;
    color: var(--tepas-text);

    font: inherit;
    font-size: 13px;
}

.task-workflow-button {
    min-height: 40px;

    padding: 0 14px;
}

.task-release-claim-button {
    min-height: 40px;

    padding: 0 14px;

    border: 1px solid var(--tepas-orange);
    border-radius: 8px;

    background: #ffffff;
    color: var(--tepas-orange);

    font: inherit;
    font-size: 13px;
    font-weight: 650;

    cursor: pointer;
}

.task-release-claim-button:hover {
    background: #fff7f3;
    border-color: var(--tepas-orange-dark);
    color: var(--tepas-orange-dark);
}

.task-workflow-card-header form,
.task-detail-layout .customer-detail-card-header form {
    margin: 0;
}

@media (max-width: 900px) {

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

    .task-workflow-card-header {
        align-items: flex-start;
        flex-direction: column;
    }
}

@media (max-width: 520px) {

    .task-status-form {
        width: 100%;
    }

    .task-status-form select {
        min-width: 0;
        flex: 1;
    }
}

@media (max-width: 1180px) {

    .task-table th:nth-child(7),
    .task-table td:nth-child(7) {
        display: none;
    }
}

@media (max-width: 980px) {

    .task-primary-filters {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .task-table th:nth-child(5),
    .task-table td:nth-child(5) {
        display: none;
    }
}

@media (max-width: 760px) {

    .task-table th:nth-child(4),
    .task-table td:nth-child(4) {
        display: none;
    }
}

@media (max-width: 560px) {

    .task-primary-filters {
        grid-template-columns: 1fr;
    }

    .task-table th:nth-child(3),
    .task-table td:nth-child(3) {
        display: none;
    }

    .task-table th:first-child,
    .task-table td:first-child {
        width: 34%;
    }

    .task-table th:nth-child(2),
    .task-table td:nth-child(2) {
        width: 30%;
    }

    .task-table th:nth-child(6),
    .task-table td:nth-child(6) {
        width: 22%;
    }

    .task-table th:nth-child(8),
    .task-table td:nth-child(8) {
        width: 14%;
    }

    .task-pagination {
        justify-content: space-between;

        gap: 8px;

        padding-right: 12px;
        padding-left: 12px;
    }

    .task-pagination a {
        padding-right: 9px;
        padding-left: 9px;
    }
}

@media (max-width: 1180px) {

    .report-table th:nth-child(4),
    .report-table td:nth-child(4) {
        display: none;
    }
}

@media (max-width: 980px) {

    .report-table th:nth-child(5),
    .report-table td:nth-child(5) {
        display: none;
    }
}

@media (max-width: 780px) {

    .report-table th:nth-child(7),
    .report-table td:nth-child(7) {
        display: none;
    }

    .report-list-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .report-table th,
    .report-table td {
        padding-top: 12px;
        padding-bottom: 12px;
    }
}

@media (max-width: 700px) {

    .report-list-header-actions {
        width: 100%;
    }

    .report-list-header-actions > a {
        flex: 1;
    }

    .report-mobile-filter-form {
        display: block;

        padding: 16px;

        border-bottom: 1px solid var(--tepas-border);
    }

    .report-mobile-filters {
        border: 1px solid var(--tepas-border);
        border-radius: 8px;

        background: #ffffff;
    }

    .report-mobile-filters summary {
        min-height: 44px;

        display: flex;
        align-items: center;
        justify-content: center;

        padding: 0 14px;

        color: var(--tepas-text);

        font-size: 14px;
        font-weight: 650;

        cursor: pointer;
        list-style: none;
    }

    .report-mobile-filters summary::-webkit-details-marker {
        display: none;
    }

    .report-mobile-filter-grid {
        display: grid;
        grid-template-columns: 1fr;

        gap: 12px;
        padding: 14px;

        border-top: 1px solid var(--tepas-border);
    }

    .report-mobile-filter-grid label {
        display: flex;
        flex-direction: column;

        gap: 6px;

        color: var(--tepas-text-muted);

        font-size: 12px;
        font-weight: 650;
    }

    .report-mobile-filter-grid input,
    .report-mobile-filter-grid select {
        width: 100%;
        min-width: 0;
        height: 42px;

        padding: 0 10px;

        border: 1px solid #d5d9df;
        border-radius: 7px;

        background: #ffffff;
        color: var(--tepas-text);

        font: inherit;
        font-size: 14px;
        font-weight: 400;
    }

    .report-mobile-filter-grid input:focus,
    .report-mobile-filter-grid select:focus {
        border-color: var(--tepas-orange);
        outline: none;

        box-shadow: 0 0 0 3px rgba(233, 76, 19, 0.10);
    }

    .report-mobile-filter-actions {
        display: flex;

        padding: 0 14px 14px;
    }

    .report-mobile-filter-actions .customer-apply-filters {
        width: 100%;
    }

    .report-table {
        min-width: 0;
    }

    .report-table-filters {
        display: none;
    }

    .report-table-headings th,
    .report-table tbody td {
        display: none;
    }

    .report-table-headings .report-column-date,
    .report-table-headings .report-column-subject,
    .report-table-headings .report-column-customer,
    .report-table tbody .report-column-date,
    .report-table tbody .report-column-subject,
    .report-table tbody .report-column-customer,
    .report-table tbody .report-table-empty-cell {
        display: table-cell;
    }

    .report-table th.report-column-date,
    .report-table td.report-column-date {
        width: 27%;
    }

    .report-table th.report-column-subject,
    .report-table td.report-column-subject {
        width: 30%;
    }

    .report-table th.report-column-customer,
    .report-table td.report-column-customer {
        width: 43%;
    }

    .report-table td.report-column-date,
    .report-table td.report-column-subject,
    .report-table td.report-column-customer {
        overflow-wrap: break-word;
    }
}

/* ---------------------------------------------------------
   Conversation Report form
--------------------------------------------------------- */

.report-form .customer-form-field input[type="search"],
.report-form .customer-form-field input[type="date"],
.report-form .customer-form-field input[type="time"] {
    width: 100%;
    min-height: 42px;

    padding: 9px 11px;

    border: 1px solid #cfd4da;
    border-radius: 8px;

    background: #ffffff;
    color: var(--tepas-text);

    font: inherit;
    font-size: 14px;

    outline: none;

    transition:
        border-color var(--tepas-transition),
        box-shadow var(--tepas-transition);
}

.report-form .customer-form-field input[type="search"]:focus,
.report-form .customer-form-field input[type="date"]:focus,
.report-form .customer-form-field input[type="time"]:focus {
    border-color: var(--tepas-orange);

    box-shadow: 0 0 0 3px rgba(233, 76, 19, 0.10);
}

.report-dynamic-field[hidden],
.report-event-section[hidden],
.report-event-grid[hidden],
.report-address-grid[hidden],
.report-location-message[hidden] {
    display: none;
}

.report-location-message {
    margin: 20px;
    padding: 14px 16px;

    border: 1px dashed #d7dbe0;
    border-radius: 8px;

    background: #fafafa;
    color: var(--tepas-text-muted);

    font-size: 13px;
}

.report-address-grid {
    display: grid;
    grid-template-columns:
        minmax(180px, 2fr)
        minmax(100px, 0.7fr)
        minmax(120px, 1fr)
        minmax(140px, 1fr)
        minmax(140px, 1fr);

    gap: 14px;
}

.report-event-section {
    display: flex;
    flex-direction: column;

    gap: 18px;

    padding: 20px;
}

.report-event-mode-options > div {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));

    gap: 10px;
}

.report-event-mode-options label {
    min-height: 42px;

    display: flex;
    align-items: center;

    gap: 9px;

    padding: 9px 11px;

    border: 1px solid var(--tepas-border);
    border-radius: 8px;

    background: #fafafa;

    font-size: 13px;
    font-weight: 500;

    cursor: pointer;
}

.report-event-mode-options label:hover {
    border-color: #ffc7b2;

    background: #fff7f3;
}

.report-event-mode-options input[type="radio"] {
    width: 17px;
    height: 17px;

    margin: 0;

    accent-color: var(--tepas-orange);
}

.report-event-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));

    gap: 18px 24px;
}

.report-existing-event-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));

    gap: 1px;

    overflow: hidden;

    border: 1px solid var(--tepas-border);
    border-radius: 9px;

    background: var(--tepas-border);
}

.report-existing-event-summary[hidden] {
    display: none;
}

.report-existing-event-summary > div {
    min-width: 0;

    display: flex;
    flex-direction: column;

    gap: 5px;

    padding: 13px 14px;

    background: #fafafa;
}

.report-existing-event-summary span {
    color: var(--tepas-text-muted);

    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.report-existing-event-summary strong {
    overflow-wrap: anywhere;

    color: var(--tepas-text);

    font-size: 13px;
    font-weight: 650;
}

@media (max-width: 1050px) {

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

    .report-address-street {
        grid-column: 1 / -1;
    }

    .report-event-mode-options > div {
        grid-template-columns: 1fr;
    }

    .report-existing-event-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 700px) {

    .report-address-grid,
    .report-event-grid,
    .report-existing-event-summary {
        grid-template-columns: 1fr;
    }

    .report-address-street {
        grid-column: auto;
    }
}

/* ---------------------------------------------------------
   Conversation Report detail
--------------------------------------------------------- */

.report-lock-notice {
    margin-bottom: 18px;
    padding: 13px 15px;

    border: 1px solid #f2c66d;
    border-radius: 9px;

    background: #fff8e6;
    color: #73510d;

    font-size: 13px;
    line-height: 1.5;
}

.report-lock-notice strong {
    display: block;

    margin-bottom: 2px;
}

.report-transition-errors {
    margin-bottom: 18px;
    padding: 14px 16px;

    border: 1px solid #efb269;
    border-radius: 9px;

    background: #fff7ed;
    color: #75410d;

    font-size: 13px;
    line-height: 1.5;
}

.report-transition-errors strong {
    display: block;

    margin-bottom: 5px;

    color: #5e3108;
}

.report-transition-errors ul {
    margin: 0 0 5px;
    padding-left: 20px;
}

.report-detail-page-header {
    align-items: center;
}

.report-detail-header-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;

    gap: 8px;

    margin-top: 10px;
}

.report-detail-header-meta > span:not(.report-status):not(.report-archived-label) {
    display: inline-flex;
    align-items: center;

    min-height: 28px;

    padding: 0 10px;

    border: 1px solid #e2e5e9;
    border-radius: 999px;

    background: #f7f8f9;
    color: var(--tepas-text-muted);

    font-size: 12px;
    font-weight: 600;
}

.report-detail-header-meta .report-status,
.report-detail-header-meta .report-archived-label {
    min-height: 28px;

    margin-top: 0;

    padding: 0 10px;
}

.report-detail-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;

    gap: 10px;
}

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

.report-transition-button {
    min-height: 42px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    padding: 0 18px;

    border: 1px solid var(--tepas-orange);
    border-radius: 8px;

    background: var(--tepas-orange);
    color: #ffffff;

    font: inherit;
    font-size: 13px;
    font-weight: 650;

    cursor: pointer;

    transition:
        background var(--tepas-transition),
        border-color var(--tepas-transition);
}

.report-transition-button:hover {
    border-color: var(--tepas-orange-dark);

    background: var(--tepas-orange-dark);
}

.report-detail-layout {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));

    gap: 20px;
}

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

.report-detail-empty {
    padding: 28px 20px;

    color: var(--tepas-text-muted);

    font-size: 13px;
}

.report-participants-card {
    grid-column: 1 / -1;
}

.report-participants-manage-button {
    min-height: 36px;

    padding: 0 13px;
}

.report-participant-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));

    gap: 1px;

    background: var(--tepas-border);
}

.report-participant-group {
    min-width: 0;

    padding: 18px 20px;

    background: #ffffff;
}

.report-participant-group h3 {
    margin: 0 0 12px;

    font-size: 14px;
    font-weight: 650;
}

.report-participant-group ul,
.report-one-off-participants {
    margin: 0;
    padding: 0;

    list-style: none;
}

.report-participant-group li {
    display: flex;
    flex-direction: column;

    gap: 3px;

    padding: 8px 0;

    border-top: 1px solid #edf0f2;
}

.report-participant-group li:first-child {
    padding-top: 0;

    border-top: 0;
}

.report-participant-group strong {
    color: var(--tepas-text);

    font-size: 13px;
    font-weight: 600;
}

.report-participant-contact-link {
    width: fit-content;

    text-decoration: none;
}

.report-participant-contact-link strong,
.report-participant-contact-link:visited strong {
    color: var(--tepas-orange);
}

.report-participant-contact-link:hover strong {
    color: var(--tepas-orange-dark);

    text-decoration: underline;
}

.report-participant-group span,
.report-fixed-participant span,
.report-one-off-participants span {
    color: var(--tepas-text-muted);

    font-size: 12px;
}

.report-participant-empty {
    color: var(--tepas-text-muted);

    font-size: 13px;
    font-style: italic;
}

/* ---------------------------------------------------------
   Conversation Report participant management
--------------------------------------------------------- */

.report-back-button {
    padding: 0;

    border: 0;

    background: transparent;
    color: var(--tepas-text-muted);

    font: inherit;
    font-size: 14px;
    font-weight: 500;

    cursor: pointer;
}

.report-back-button:hover {
    color: var(--tepas-orange);
}

.report-participant-manage-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));

    gap: 20px;

    margin-bottom: 20px;
}

.report-participant-manage-card {
    min-width: 0;
}

.report-participant-manage-card .customer-detail-card-header,
.report-add-organisation-card .customer-detail-card-header {
    align-items: flex-start;
}

.report-participant-manage-card .customer-detail-card-header p,
.report-add-organisation-card .customer-detail-card-header p {
    margin: 4px 0 0;

    color: var(--tepas-text-muted);

    font-size: 12px;
    font-weight: 400;
}

.report-fixed-participant {
    display: flex;
    flex-direction: column;

    gap: 3px;

    margin: 18px 20px 0;
    padding: 12px 14px;

    border: 1px solid #ffd0bf;
    border-radius: 8px;

    background: #fff7f3;
}

.report-fixed-participant strong {
    color: var(--tepas-text);

    font-size: 13px;
}

.report-checkbox-list {
    padding: 18px 20px;
}

.report-checkbox-list > div,
.report-checkbox-list > ul {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));

    gap: 9px 14px;

    margin: 0;
    padding: 0;

    list-style: none;
}

.report-checkbox-list label {
    display: flex;
    align-items: center;

    gap: 8px;

    min-height: 36px;
    padding: 7px 9px;

    border: 1px solid #e3e6e9;
    border-radius: 7px;

    color: var(--tepas-text);

    font-size: 13px;

    cursor: pointer;
}

.report-checkbox-list input[type="checkbox"],
.report-organisation-mode input[type="radio"] {
    width: 17px;
    height: 17px;

    margin: 0;

    accent-color: var(--tepas-orange);
}

.report-selection-actions {
    margin-top: -4px;
}

.report-contact-actions-grid {
    align-items: start;
}

.report-inline-participant-form,
.report-add-organisation-form {
    padding: 20px;
}

.report-quick-contact-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));

    gap: 14px;

    margin-bottom: 16px;
}

.report-quick-contact-grid .customer-form-field:first-child,
.report-quick-contact-grid .customer-form-field:nth-child(2) {
    grid-column: span 1;
}

.report-quick-contact-grid input,
.report-add-organisation-form input[type="text"],
.report-add-organisation-form input[type="search"],
.report-add-organisation-form select {
    width: 100%;
    min-height: 42px;

    padding: 9px 11px;

    border: 1px solid #cfd4da;
    border-radius: 8px;

    background: #ffffff;
    color: var(--tepas-text);

    font: inherit;
    font-size: 14px;
}

.report-participant-card-heading {
    gap: 14px;
}

.report-remove-button {
    padding: 0;

    border: 0;

    background: transparent;
    color: #a63b21;

    font: inherit;
    font-size: 12px;
    font-weight: 600;

    cursor: pointer;
}

.report-remove-button:hover {
    color: #d43f17;
    text-decoration: underline;
}

.report-one-off-participants {
    padding: 0 20px;
}

.report-one-off-participants li {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 12px;

    padding: 11px 0;

    border-bottom: 1px solid #edf0f2;
}

.report-one-off-participants li > div {
    display: flex;
    flex-direction: column;

    gap: 3px;
}

.report-add-organisation-card {
    margin-bottom: 20px;
}

.report-organisation-mode {
    margin-bottom: 18px;
}

.report-organisation-mode > div {
    display: flex;
    flex-wrap: wrap;

    gap: 10px;
}

.report-organisation-mode label {
    display: inline-flex;
    align-items: center;

    gap: 8px;

    min-height: 40px;
    padding: 8px 11px;

    border: 1px solid #e1e4e7;
    border-radius: 8px;

    color: var(--tepas-text);

    font-size: 13px;

    cursor: pointer;
}

.report-organisation-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));

    gap: 18px;

    margin-bottom: 18px;
}

.report-organisation-fields[hidden],
#new-organisation-field[hidden],
#new-customer-type-field[hidden],
#new-organisation-contact-fields[hidden],
#existing-contact-field[hidden] {
    display: none;
}

#new-organisation-field,
#new-customer-type-field {
    margin-bottom: 18px;
}

#new-organisation-contact-fields h3 {
    margin: 0 0 14px;

    color: var(--tepas-text);

    font-size: 14px;
}

.report-participants-done {
    margin-top: 4px;
}

/* ---------------------------------------------------------
   Conversation Report content
--------------------------------------------------------- */

.report-content-detail-card {
    grid-column: 1 / -1;
}

.report-content-edit-button,
.report-participants-manage-button {
    flex: 0 0 auto;
}

.report-content-detail {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));

    gap: 1px;

    background: var(--tepas-border);
}

.report-content-detail > section {
    min-width: 0;

    padding: 20px;

    background: #ffffff;
}

.report-content-detail > section:first-child {
    grid-column: 1 / -1;
}

.report-content-detail h3 {
    margin: 0 0 14px;

    color: var(--tepas-text);

    font-size: 14px;
    font-weight: 650;
}

.report-rich-text,
.report-next-topics {
    color: var(--tepas-text);

    font-size: 14px;
    line-height: 1.65;

    overflow-wrap: anywhere;
}

.report-rich-text > :first-child {
    margin-top: 0;
}

.report-rich-text > :last-child {
    margin-bottom: 0;
}

.report-rich-text img {
    max-width: 100%;
    height: auto;
}

.report-content-card .customer-detail-card-header {
    align-items: flex-start;
}

.report-editor-field,
.report-plain-text-field {
    padding: 20px;
}

.report-editor-field .django-ckeditor-widget {
    width: 100%;
}

.report-editor-field .ck-editor__editable_inline {
    min-height: 260px;
}

.report-plain-text-field textarea {
    min-height: 130px;
}

.report-content-form .errorlist {
    margin: 8px 0 0;
    padding-left: 18px;

    color: #b42318;

    font-size: 12px;
}

/* ---------------------------------------------------------
   Conversation Report Tasks
--------------------------------------------------------- */

.report-tasks-card {
    grid-column: 1 / -1;
}

.report-task-add-button {
    min-height: 36px;

    padding: 0 13px;
}

.report-task-table-wrap {
    width: 100%;

    overflow: hidden;
}

.report-task-table {
    width: 100%;

    border-collapse: collapse;
    table-layout: fixed;
}

.report-task-table th,
.report-task-table td {
    padding: 13px 12px;

    border-bottom: 1px solid var(--tepas-border);

    text-align: left;
    vertical-align: top;

    overflow-wrap: anywhere;
}

.report-task-table th {
    color: var(--tepas-text-muted);

    font-size: 11px;
    font-weight: 650;
    letter-spacing: 0.02em;

    text-transform: uppercase;
}

.report-task-table td {
    color: var(--tepas-text);

    font-size: 13px;
}

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

.report-task-table th:first-child,
.report-task-table td:first-child {
    width: 25%;

    padding-left: 20px;
}

.report-task-table th:last-child,
.report-task-table td:last-child {
    padding-right: 20px;
}

.report-task-table td strong,
.report-task-table td span {
    display: block;
}

.report-task-table td > span:not(.report-task-priority):not(.report-task-state):not(.report-task-status) {
    margin-top: 3px;

    color: var(--tepas-text-muted);

    font-size: 11px;
}

.report-task-priority,
.report-task-state,
.report-task-status {
    width: max-content;
    max-width: 100%;

    padding: 3px 7px;

    border-radius: 999px;

    font-size: 11px;
    font-weight: 650;
}

.report-task-priority-low {
    background: #edf7f0;
    color: #287445;
}

.report-task-priority-normal {
    background: #eef3f8;
    color: #405b73;
}

.report-task-priority-high {
    background: #fff0eb;
    color: #a63b21;
}

.report-task-state-provisional {
    background: #fff7df;
    color: #7a5b00;
}

.report-task-state-active {
    background: #eaf4ff;
    color: #23669c;
}

.report-task-status {
    margin-top: 5px;

    background: #f1f3f5;
    color: var(--tepas-text-muted);
}

.report-task-action-cell {
    width: 58px;

    text-align: right;
}

.report-task-action-cell a,
.report-task-action-cell button {
    min-height: 30px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    padding: 0 11px;

    border: 1px solid var(--tepas-orange);
    border-radius: 7px;

    background: var(--tepas-orange);
    color: #ffffff;

    font-size: 12px;
    font-weight: 600;
    text-decoration: none;

    cursor: pointer;

    transition:
        background var(--tepas-transition),
        border-color var(--tepas-transition);
}

.report-task-action-cell a:hover,
.report-task-action-cell button:hover {
    border-color: var(--tepas-orange-dark);

    background: var(--tepas-orange-dark);
    color: #ffffff;

    text-decoration: none;
}

.report-task-form input[type="date"] {
    width: 100%;
    min-height: 42px;

    padding: 9px 11px;

    border: 1px solid #cfd4da;
    border-radius: 8px;

    background: #ffffff;
    color: var(--tepas-text);

    font: inherit;
    font-size: 14px;
}

.report-task-state-options > div {
    display: flex;
    flex-wrap: wrap;

    gap: 10px;
}

.report-task-state-options label {
    min-height: 40px;

    display: inline-flex;
    align-items: center;

    gap: 8px;

    padding: 8px 11px;

    border: 1px solid #e1e4e7;
    border-radius: 8px;

    cursor: pointer;
}

.report-task-state-options input[type="radio"] {
    width: 17px;
    height: 17px;

    margin: 0;

    accent-color: var(--tepas-orange);
}

#report-related-contact-field[hidden],
.report-active-required[hidden] {
    display: none;
}

.report-task-form-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;

    gap: 16px;

    padding-bottom: 20px;
}

.report-task-form-actions > div:first-child {
    flex: 1 1 auto;
}

.report-task-form-actions .customer-form-actions {
    flex: 0 0 auto;

    padding-bottom: 0;
}

.report-task-delete-button {
    min-height: 42px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    padding: 0 16px;

    border: 1px solid #aeb5bd;
    border-radius: 8px;

    background: #ffffff;
    color: #4f5964;

    font: inherit;
    font-size: 13px;
    font-weight: 600;

    cursor: pointer;

    transition:
        background var(--tepas-transition),
        border-color var(--tepas-transition),
        color var(--tepas-transition);
}

.report-task-delete-button:hover {
    border-color: #77818c;

    background: #f1f3f5;
    color: #26313c;
}

/* ---------------------------------------------------------
   Conversation Report attachments
--------------------------------------------------------- */

.report-attachments-card {
    grid-column: 1 / -1;
}

.report-attachment-add-button {
    min-height: 36px;

    padding: 0 13px;
}

.report-attachment-list {
    display: grid;
}

.report-attachment-row {
    min-width: 0;

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 20px;

    padding: 15px 20px;

    border-bottom: 1px solid var(--tepas-border);
}

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

.report-attachment-information {
    min-width: 0;

    display: grid;

    gap: 4px;
}

.report-attachment-information strong,
.report-attachment-information span {
    overflow-wrap: anywhere;
}

.report-attachment-information strong {
    color: var(--tepas-text);

    font-size: 14px;
}

.report-attachment-information span {
    color: var(--tepas-text-muted);

    font-size: 12px;
}

.report-attachment-actions {
    flex: 0 0 auto;

    display: flex;
    align-items: center;

    gap: 8px;
}

.report-attachment-actions form {
    margin: 0;
}

.report-attachment-download,
.report-attachment-delete {
    min-height: 32px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    padding: 0 11px;

    border-radius: 7px;

    font: inherit;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;

    cursor: pointer;
}

.report-attachment-download {
    border: 1px solid var(--tepas-orange);

    background: var(--tepas-orange);
    color: #ffffff;
}

.report-attachment-download:hover {
    border-color: var(--tepas-orange-dark);

    background: var(--tepas-orange-dark);
    color: #ffffff;

    text-decoration: none;
}

.report-attachment-delete {
    border: 1px solid #aeb5bd;

    background: #ffffff;
    color: #4f5964;
}

.report-attachment-delete:hover {
    border-color: #77818c;

    background: #f1f3f5;
    color: #26313c;
}

.report-attachment-form input[type="file"] {
    width: 100%;

    color: var(--tepas-text);

    font: inherit;
    font-size: 14px;
}

@media (max-width: 700px) {

    .report-attachment-row {
        align-items: flex-start;
        flex-direction: column;

        gap: 12px;
    }
}

@media (max-width: 1200px) {

    .report-task-table th:nth-child(5),
    .report-task-table td:nth-child(5) {
        display: none;
    }
}

@media (max-width: 900px) {

    .report-task-table th:nth-child(3),
    .report-task-table td:nth-child(3) {
        display: none;
    }

    .report-task-table th:first-child,
    .report-task-table td:first-child {
        width: 31%;
    }
}

@media (max-width: 1050px) {

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

    .report-participant-summary,
    .report-participant-manage-grid,
    .report-content-detail {
        grid-template-columns: 1fr;
    }

    .report-content-detail > section:first-child {
        grid-column: auto;
    }
}

@media (max-width: 700px) {

    .report-detail-page-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .report-detail-actions {
        width: 100%;

        justify-content: flex-start;
        flex-wrap: wrap;
    }

    .report-checkbox-list > div,
    .report-checkbox-list > ul,
    .report-quick-contact-grid,
    .report-organisation-fields {
        grid-template-columns: 1fr;
    }

    .report-participants-card .customer-detail-card-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .report-content-detail-card .customer-detail-card-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .report-tasks-card .customer-detail-card-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .report-task-table th:nth-child(4),
    .report-task-table td:nth-child(4) {
        display: none;
    }

    .report-task-table th,
    .report-task-table td {
        padding-right: 8px;
        padding-left: 8px;
    }

    .report-task-table th:first-child,
    .report-task-table td:first-child {
        width: 45%;
        padding-left: 14px;
    }

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

    .report-task-form-actions .customer-form-actions {
        justify-content: flex-start;
    }

    .report-task-delete-button {
        width: 100%;
    }
}

/* ---------------------------------------------------------
   Customer detail page
--------------------------------------------------------- */

.customer-detail-back {
    margin-bottom: 18px;
}

.customer-detail-back a {
    color: var(--tepas-text-muted);

    font-size: 14px;
    font-weight: 500;

    text-decoration: none;
}

.customer-detail-back a:hover {
    color: var(--tepas-orange);
}


/* ---------------------------------------------------------
   Customer detail header
--------------------------------------------------------- */

.customer-detail-page-header {
    align-items: center;
}

.customer-detail-heading {
    display: flex;
    align-items: center;

    gap: 18px;
}

.customer-logo {
    width: 74px;
    height: 74px;

    flex: 0 0 74px;
}

.customer-logo img,
.customer-logo-placeholder {
    width: 100%;
    height: 100%;

    border: 1px solid var(--tepas-border);
    border-radius: 12px;

    background: var(--tepas-surface);
}

.customer-logo img {
    display: block;

    padding: 7px;

    object-fit: contain;
}

.customer-logo-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;

    background: #fff0ea;
    color: var(--tepas-orange);

    font-size: 30px;
    font-weight: 700;
}

.customer-detail-header-meta {
    display: flex;
    flex-wrap: wrap;

    gap: 8px;

    margin-top: 10px;
}

.customer-detail-header-meta span {
    display: inline-flex;
    align-items: center;

    min-height: 28px;

    padding: 0 10px;

    border: 1px solid #f1d5ca;
    border-radius: 999px;

    background: #fff7f3;
    color: #8f3514;

    font-size: 12px;
    font-weight: 600;
}


/* ---------------------------------------------------------
   Customer detail layout
--------------------------------------------------------- */

.customer-detail-layout {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));

    gap: 20px;
}

.customer-detail-card {
    overflow: hidden;

    background: var(--tepas-surface);
    border: 1px solid var(--tepas-border);
    border-radius: var(--tepas-radius);

    box-shadow: 0 2px 8px rgba(31, 41, 51, 0.04);
}

.customer-detail-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 16px;

    padding: 17px 20px;

    border-bottom: 1px solid var(--tepas-border);
}

.customer-detail-card-header h2 {
    margin: 0;

    font-size: 17px;
    font-weight: 650;
}

.customer-detail-card-header p {
    margin: 4px 0 0;

    color: var(--tepas-text-muted);

    font-size: 12px;
}

.customer-detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));

    gap: 0;

    padding: 6px 20px 18px;
}

.customer-detail-field {
    min-width: 0;

    display: flex;
    flex-direction: column;

    gap: 5px;

    padding: 14px 16px 14px 0;

    border-bottom: 1px solid #f0f1f3;
}

.customer-detail-field:nth-last-child(-n + 2) {
    border-bottom: 0;
}

.customer-detail-field-wide {
    grid-column: span 2;
}

.customer-detail-label {
    color: var(--tepas-text-muted);

    font-size: 11px;
    font-weight: 650;
    letter-spacing: 0.03em;

    text-transform: uppercase;
}

.customer-detail-value {
    min-width: 0;

    color: var(--tepas-text);

    font-size: 14px;
    line-height: 1.5;

    overflow-wrap: anywhere;
}

.customer-detail-value a {
    color: var(--tepas-orange);
    text-decoration: none;
}

.customer-detail-value a:hover {
    text-decoration: underline;
}


/* ---------------------------------------------------------
   Addresses
--------------------------------------------------------- */

.customer-address-columns {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));

    gap: 20px;

    padding: 20px;
}

.customer-address-block {
    padding: 16px;

    border: 1px solid #eceef1;
    border-radius: 9px;

    background: #fafafa;
}

.customer-address-block h3 {
    margin: 0 0 9px;

    font-size: 13px;
    font-weight: 650;
}

.customer-address-block p {
    margin: 0;

    color: var(--tepas-text);

    font-size: 14px;
    line-height: 1.65;
}

.customer-address-map-link,
.customer-address-map-link:visited {
    display: inline-flex;
    align-items: center;

    gap: 5px;

    margin-top: 10px;

    color: var(--tepas-orange);

    font-size: 13px;
    font-weight: 650;
    text-decoration: none;
}

.customer-address-map-link:hover {
    color: var(--tepas-orange-dark);

    text-decoration: underline;
}

.customer-address-map-link span {
    transition: transform var(--tepas-transition);
}

.customer-address-map-link:hover span {
    transform: translateX(2px);
}

.report-task-table .task-title-link span {
    color: var(--tepas-text-muted);

    font-size: 11px;
    font-weight: 400;
}


/* ---------------------------------------------------------
   Product groups
--------------------------------------------------------- */

.customer-product-groups {
    display: flex;
    flex-wrap: wrap;

    gap: 8px;

    padding: 20px;
}

.customer-product-group {
    display: inline-flex;
    align-items: center;

    min-height: 30px;

    padding: 0 11px;

    border: 1px solid #f3cbbd;
    border-radius: 999px;

    background: #fff5f0;
    color: #9c3a16;

    font-size: 12px;
    font-weight: 600;
}


/* ---------------------------------------------------------
   Contact persons
--------------------------------------------------------- */

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


/* ---------------------------------------------------------
   Inactive contact label
--------------------------------------------------------- */

.customer-contact-inactive-label {
    display: inline-flex;
    align-items: center;

    min-height: 22px;

    padding: 0 8px;

    border-radius: 999px;

    background: #eceef1;
    color: var(--tepas-text-muted);

    font-size: 10px;
    font-weight: 700;

    text-transform: uppercase;
}


/* ---------------------------------------------------------
   Customer detail responsive
--------------------------------------------------------- */

@media (max-width: 1050px) {

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

    .customer-contacts-card {
        grid-column: auto;
    }
}

@media (max-width: 700px) {

    .customer-detail-heading {
        align-items: flex-start;
    }

    .customer-logo {
        width: 60px;
        height: 60px;

        flex-basis: 60px;
    }

    .customer-detail-grid,
    .customer-address-columns {
        grid-template-columns: 1fr;
    }

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

    .customer-detail-field {
        padding-right: 0;
    }

    .customer-detail-field:nth-last-child(-n + 2) {
        border-bottom: 1px solid #f0f1f3;
    }

    .customer-detail-field:last-child {
        border-bottom: 0;
    }
}

/* ---------------------------------------------------------
   Customer company & address details
--------------------------------------------------------- */

.customer-company-contact-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));

    gap: 0;

    padding: 6px 20px 0;
}

.customer-company-contact-grid .customer-detail-field:nth-last-child(-n + 2) {
    border-bottom: 0;
}


/* ---------------------------------------------------------
   Contact persons - table layout
--------------------------------------------------------- */

.customer-contact-table {
    width: 100%;
}

.customer-contact-table-heading,
.customer-contact-row {
    display: grid;
    grid-template-columns:
        minmax(200px, 1.4fr)
        minmax(220px, 1.5fr)
        minmax(160px, 1.1fr)
        minmax(150px, 1fr)
        70px;

    column-gap: 16px;

    align-items: start;
}

.customer-contact-table-heading {
    padding: 10px 20px;

    border-bottom: 1px solid var(--tepas-border);

    background: #fafafa;

    color: var(--tepas-text-muted);

    font-size: 11px;
    font-weight: 650;
    letter-spacing: 0.03em;

    text-transform: uppercase;
}

.customer-contact-row {
    padding: 16px 20px;

    border-bottom: 1px solid var(--tepas-border);
}

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

/* Customer related records */

.customer-related-records-card {
    grid-column: 1 / -1;
}

.customer-related-table-wrapper {
    width: 100%;
    overflow-x: auto;
}

.customer-related-table {
    width: 100%;
    min-width: 980px;
    table-layout: fixed;
    border-collapse: collapse;
    font-size: 13px;
}

.customer-related-table th,
.customer-related-table td {
    padding: 13px 10px;
    border-bottom: 1px solid var(--tepas-border);
    text-align: left;
    vertical-align: middle;
    overflow-wrap: anywhere;
}

.customer-related-table th {
    background: #fafafa;
    color: var(--tepas-text-muted);
    font-size: 11px;
    font-weight: 650;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.customer-related-table tbody tr {
    transition: background var(--tepas-transition);
}

.customer-related-table tbody tr:hover {
    background: #fff8f5;
}

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

.customer-related-table th:nth-child(1),
.customer-related-table td:nth-child(1) {
    width: 11%;
}

.customer-related-table th:nth-child(2),
.customer-related-table td:nth-child(2) {
    width: 22%;
}

.customer-related-table th:nth-child(3),
.customer-related-table td:nth-child(3) {
    width: 14%;
}

.customer-related-table th:nth-child(4),
.customer-related-table td:nth-child(4) {
    width: 14%;
}

.customer-related-table th:nth-child(5),
.customer-related-table td:nth-child(5) {
    width: 15%;
}

.customer-related-table th:nth-child(6),
.customer-related-table td:nth-child(6) {
    width: 10%;
}

.customer-related-table th:nth-child(7),
.customer-related-table td:nth-child(7) {
    width: 14%;
}

.customer-contact-row:hover {
    background: #fffaf8;
}


/* ---------------------------------------------------------
   Contact person identity
--------------------------------------------------------- */

.customer-contact-person {
    min-width: 0;

    display: flex;
    align-items: center;

    gap: 12px;
}

.customer-contact-photo {
    width: 46px;
    height: 46px;

    flex: 0 0 46px;
}

.customer-contact-photo img,
.customer-contact-photo-placeholder {
    width: 46px;
    height: 46px;

    border-radius: 50%;
}

.customer-contact-photo img {
    display: block;

    border: 1px solid var(--tepas-border);

    object-fit: cover;
}

.customer-contact-photo-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;

    border: 1px solid #f2d1c5;

    background: #fff0ea;
    color: var(--tepas-orange);

    font-size: 13px;
    font-weight: 700;
}

.customer-contact-name {
    min-width: 0;

    display: flex;
    flex-direction: column;

    gap: 4px;
}

.customer-contact-name strong {
    overflow-wrap: anywhere;

    color: var(--tepas-text);

    font-size: 14px;
    font-weight: 650;
}

.customer-contact-name > span {
    color: var(--tepas-text-muted);

    font-size: 12px;
    line-height: 1.4;
}


/* ---------------------------------------------------------
   Contact details
--------------------------------------------------------- */

.customer-contact-data {
    min-width: 0;

    display: flex;
    flex-direction: column;

    gap: 5px;

    color: var(--tepas-text-muted);

    font-size: 12px;
    line-height: 1.4;
}

.customer-contact-data a {
    color: var(--tepas-orange);

    text-decoration: none;

    overflow-wrap: anywhere;
}

.customer-contact-data a:hover {
    text-decoration: underline;
}


/* ---------------------------------------------------------
   Contact functions and roles
--------------------------------------------------------- */

.customer-contact-functions,
.customer-contact-roles {
    min-width: 0;

    display: flex;
    flex-wrap: wrap;

    gap: 5px;
}

.customer-contact-tag {
    display: inline-flex;
    align-items: center;

    min-height: 24px;

    padding: 3px 8px;

    border-radius: 6px;

    background: #f2f3f5;
    color: #4b5563;

    font-size: 10px;
    font-weight: 600;

    line-height: 1.25;
}

.customer-contact-role-tag {
    background: #fff1eb;
    color: #9c3a16;
}

.customer-contact-main-column {
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
}

.customer-contact-main {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-height: 24px;

    padding: 0 8px;

    border-radius: 999px;

    background: #fff0ea;
    color: var(--tepas-orange);

    font-size: 10px;
    font-weight: 700;

    text-transform: uppercase;
}

.customer-contact-empty {
    color: #9ca3af;

    font-size: 12px;
}


/* ---------------------------------------------------------
   Additional contact information
--------------------------------------------------------- */

.customer-contact-additional {
    grid-column: 2 / -1;

    margin-top: 12px;
    padding-top: 10px;

    border-top: 1px dashed #e1e4e8;

    color: var(--tepas-text-muted);

    font-size: 12px;
    line-height: 1.5;
}


/* ---------------------------------------------------------
   Inactive contacts
--------------------------------------------------------- */

.customer-inactive-contacts {
    margin: 0;

    padding: 0 20px 20px;

    border-top: 1px solid var(--tepas-border);
}

.customer-inactive-contacts summary {
    display: inline-flex;

    margin-top: 16px;

    color: var(--tepas-orange);

    font-size: 13px;
    font-weight: 600;

    cursor: pointer;
}

.customer-inactive-contact-list {
    margin-top: 12px;

    border: 1px solid var(--tepas-border);
    border-radius: 9px;

    overflow: hidden;
}

.customer-inactive-contact-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;

    gap: 8px 16px;

    padding: 12px 14px;

    border-bottom: 1px solid var(--tepas-border);

    background: #fafafa;

    font-size: 12px;
}

.customer-inactive-contact-row:last-child {
    border-bottom: 0;
}

.customer-inactive-contact-row strong {
    font-size: 13px;
}

.customer-inactive-contact-row > span:not(.customer-contact-inactive-label) {
    color: var(--tepas-text-muted);
}

.customer-inactive-contact-row a {
    color: var(--tepas-orange);

    text-decoration: none;
}


/* ---------------------------------------------------------
   Customer detail responsive refinements
--------------------------------------------------------- */

@media (max-width: 1200px) {

    .customer-contact-table {
        overflow-x: auto;
    }

    .customer-contact-table-heading,
    .customer-contact-row {
        min-width: 960px;
    }
}

@media (max-width: 700px) {

    .customer-company-contact-grid {
        grid-template-columns: 1fr;
    }

    .customer-company-contact-grid .customer-detail-field {
        padding-right: 0;
    }

    .customer-company-contact-grid .customer-detail-field:nth-last-child(-n + 2) {
        border-bottom: 1px solid #f0f1f3;
    }

    .customer-company-contact-grid .customer-detail-field:last-child {
        border-bottom: 0;
    }

    .customer-contact-table-heading {
        display: none;
    }

    .customer-contact-table {
        padding: 12px;
    }

    .customer-contact-row {
        min-width: 0;

        grid-template-columns: 1fr;

        row-gap: 14px;

        margin-bottom: 12px;
        padding: 15px;

        border: 1px solid var(--tepas-border);
        border-radius: 9px;
    }

    .customer-contact-row:last-child {
        margin-bottom: 0;
    }

    .customer-contact-additional {
        grid-column: auto;

        margin-top: 0;
    }
}

.customer-company-link {
    color: var(--tepas-text);
    font-weight: 650;
    text-decoration: none;
}

.customer-company-link:hover {
    color: var(--tepas-orange);
    text-decoration: underline;
}

/* ---------------------------------------------------------
   Customer detail actions
--------------------------------------------------------- */

.customer-detail-header-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;

    gap: 10px;
}

.customer-edit-button {
    min-height: 40px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    padding: 0 16px;

    border: 1px solid var(--tepas-orange);
    border-radius: 8px;

    background: var(--tepas-orange);
    color: #ffffff;

    font-size: 14px;
    font-weight: 600;

    text-decoration: none;

    transition:
        background var(--tepas-transition),
        border-color var(--tepas-transition),
        transform var(--tepas-transition);
}

.customer-edit-button:hover {
    background: var(--tepas-orange-dark);
    border-color: var(--tepas-orange-dark);
}

.customer-edit-button:active {
    transform: translateY(1px);
}

@media (max-width: 700px) {

    .customer-detail-page-header {
        gap: 18px;
        flex-direction: column;
        align-items: flex-start;
    }

    .customer-detail-header-actions {
        width: 100%;
        justify-content: flex-start;
    }
}

/* ---------------------------------------------------------
   Customer form
--------------------------------------------------------- */

.customer-form {
    display: flex;
    flex-direction: column;

    gap: 20px;
}

.customer-form-card {
    overflow: visible;

    margin-bottom: 20px;

    background: var(--tepas-surface);
    border: 1px solid var(--tepas-border);
    border-radius: var(--tepas-radius);

    box-shadow: 0 2px 8px rgba(31, 41, 51, 0.04);
}

.customer-form-card > h2 {
    margin: 0;

    padding: 17px 20px;

    border-bottom: 1px solid var(--tepas-border);

    font-size: 17px;
    font-weight: 650;
}

.customer-form-card > .customer-form-field {
    padding: 20px;
}

/* ---------------------------------------------------------
   Form grids
--------------------------------------------------------- */

.customer-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));

    gap: 18px 24px;

    padding: 20px;
}

.customer-form-field {
    min-width: 0;

    display: flex;
    flex-direction: column;

    gap: 7px;
}

.customer-form-field-wide {
    grid-column: 1 / -1;
}

.customer-form-field label {
    color: var(--tepas-text);

    font-size: 13px;
    font-weight: 600;
}


/* ---------------------------------------------------------
   Inputs
--------------------------------------------------------- */

.customer-form-field input[type="text"],
.customer-form-field input[type="email"],
.customer-form-field input[type="url"],
.customer-form-field input[type="tel"],
.customer-form-field input[type="number"],
.customer-form-field input[type="file"],
.customer-form-field select,
.customer-form-field textarea {
    width: 100%;

    min-height: 42px;

    padding: 9px 11px;

    border: 1px solid #cfd4da;
    border-radius: 8px;

    background: #ffffff;
    color: var(--tepas-text);

    font: inherit;
    font-size: 14px;

    outline: none;

    transition:
        border-color var(--tepas-transition),
        box-shadow var(--tepas-transition);
}

.customer-form-field textarea {
    min-height: 110px;

    resize: vertical;
}

.customer-form-field input:focus,
.customer-form-field select:focus,
.customer-form-field textarea:focus {
    border-color: var(--tepas-orange);

    box-shadow: 0 0 0 3px rgba(233, 76, 19, 0.10);
}


/* ---------------------------------------------------------
   Checkbox fields
--------------------------------------------------------- */

.customer-form-checkbox-field {
    justify-content: flex-end;
}

.customer-form-checkbox-field label {
    min-height: 42px;

    display: flex;
    align-items: center;

    gap: 9px;

    padding: 0 2px;

    cursor: pointer;
}

.customer-form-checkbox-field input[type="checkbox"] {
    width: 18px;
    height: 18px;

    margin: 0;

    accent-color: var(--tepas-orange);
}


/* ---------------------------------------------------------
   Help and errors
--------------------------------------------------------- */

.customer-form-help {
    color: var(--tepas-text-muted);

    font-size: 11px;
    line-height: 1.45;
}

.customer-form-field .errorlist,
.customer-form-errors .errorlist {
    margin: 2px 0 0;
    padding-left: 18px;

    color: #b42318;

    font-size: 12px;
}

.customer-form-errors {
    padding: 12px 14px;

    border: 1px solid #f3c1b0;
    border-radius: 8px;

    background: #fff3ee;
    color: #9f2f0b;
}


/* ---------------------------------------------------------
   Information icon
--------------------------------------------------------- */

.customer-info-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    margin-left: 4px;

    color: #4da3ff;

    font-size: 17px;
    font-weight: 700;

    cursor: help;
}


/* ---------------------------------------------------------
   Address form blocks
--------------------------------------------------------- */

.customer-form-addresses {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));

    gap: 20px;

    padding: 0 20px 20px;
}

.customer-form-address {
    padding: 16px;

    border: 1px solid #eceef1;
    border-radius: 9px;

    background: #fafafa;
}

.customer-form-address h3 {
    margin: 0 0 16px;

    font-size: 14px;
    font-weight: 650;
}

.customer-form-address-grid {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(100px, 0.7fr);

    gap: 14px;
}

.customer-form-street {
    min-width: 0;
}


/* ---------------------------------------------------------
   Product groups
--------------------------------------------------------- */

.customer-form-product-groups {
    padding: 20px 20px 0;
}

.customer-form-product-groups > div {
    display: flex;
    flex-wrap: wrap;

    gap: 10px 18px;
}

.customer-form-product-groups label {
    display: inline-flex;
    align-items: center;

    gap: 7px;

    font-size: 13px;

    cursor: pointer;
}

.customer-form-product-groups input[type="checkbox"] {
    width: 17px;
    height: 17px;

    margin: 0;

    accent-color: var(--tepas-orange);
}


/* ---------------------------------------------------------
   Placeholder
--------------------------------------------------------- */

.customer-form-placeholder {
    margin: 0 20px 20px;

    padding: 13px 15px;

    border: 1px dashed #d7dbe0;
    border-radius: 8px;

    background: #fafafa;
    color: var(--tepas-text-muted);

    font-size: 12px;
}


/* ---------------------------------------------------------
   Form actions
--------------------------------------------------------- */

.customer-form-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;

    gap: 10px;

    padding-bottom: 10px;
}

.customer-form-cancel,
.customer-form-save {
    min-height: 42px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    padding: 0 17px;

    border-radius: 8px;

    font: inherit;
    font-size: 14px;
    font-weight: 600;

    text-decoration: none;

    cursor: pointer;
}

.customer-form-cancel {
    border: 1px solid var(--tepas-border);

    background: #ffffff;
    color: var(--tepas-text-muted);
}

.customer-form-cancel:hover {
    border-color: #ffc7b2;

    background: #fff7f3;
    color: var(--tepas-orange);
}

.customer-form-save {
    border: 1px solid var(--tepas-orange);

    background: var(--tepas-orange);
    color: #ffffff;
}

.customer-form-save:hover {
    border-color: var(--tepas-orange-dark);

    background: var(--tepas-orange-dark);
}


/* ---------------------------------------------------------
   Customer form responsive
--------------------------------------------------------- */

@media (max-width: 800px) {

    .customer-form-grid,
    .customer-form-addresses {
        grid-template-columns: 1fr;
    }

    .customer-form-field-wide {
        grid-column: auto;
    }
}

@media (max-width: 700px) {

    .customer-form-address-grid {
        grid-template-columns: 1fr;
    }

    .customer-form-actions {
        justify-content: stretch;
    }

    .customer-form-cancel,
    .customer-form-save {
        flex: 1;
    }
}


/* ---------------------------------------------------------
   Customer form - Tepas relationship
--------------------------------------------------------- */

.customer-form-relationship {
    display: flex;
    flex-direction: column;

    gap: 18px;

    padding: 20px 20px 22px;
}

.customer-form-relationship .customer-form-checkbox-field {
    align-items: flex-start;
    justify-content: flex-start;

    gap: 7px;
}

.customer-form-relationship .customer-form-checkbox-field label {
    min-height: auto;

    padding: 0;

    font-size: 13px;
    font-weight: 600;
}

.customer-form-relationship .customer-form-help {
    display: block;

    max-width: 900px;

    line-height: 1.5;
}

.customer-partner-selection {
    width: 100%;

    padding-top: 18px;

    border-top: 1px solid var(--tepas-border);
}

.customer-partner-selection[hidden] {
    display: none;
}

.customer-partner-selection .customer-form-field {
    max-width: 100%;
}

.customer-partner-search {
    width: 100%;
    max-width: 100%;

    min-height: 42px;

    padding: 9px 11px;

    border: 1px solid #cfd4da;
    border-radius: 8px;

    background: #ffffff;
    color: var(--tepas-text);

    font: inherit;
    font-size: 14px;

    outline: none;
}

.customer-partner-search:focus {
    border-color: var(--tepas-orange);

    box-shadow: 0 0 0 3px rgba(233, 76, 19, 0.10);
}

.customer-partner-options {
    width: 100%;

    margin-top: 14px;
}

.customer-partner-options > div {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));

    gap: 8px 18px;
}

.customer-partner-options ul {
    margin: 0;
    padding: 0;

    list-style: none;
}

.customer-partner-options li {
    margin: 0 0 7px;
}

.customer-partner-options label {
    min-height: 36px;

    display: flex;
    align-items: center;

    gap: 8px;

    padding: 7px 9px;

    border: 1px solid var(--tepas-border);
    border-radius: 7px;

    background: #fafafa;

    font-size: 13px;

    cursor: pointer;
}

.customer-partner-options label:hover {
    border-color: #ffc7b2;

    background: #fff7f3;
}

.customer-partner-options input[type="checkbox"] {
    width: 17px;
    height: 17px;

    margin: 0;

    accent-color: var(--tepas-orange);
}

/* ---------------------------------------------------------
   Customer form heading responsive
--------------------------------------------------------- */

@media (max-width: 700px) {

    .customer-partner-options > div {
        grid-template-columns: 1fr;
    }
}

/* ---------------------------------------------------------
   Customer form - inline company logo
--------------------------------------------------------- */

.customer-form-inline-logo {
    min-width: 0;

    display: flex;
    flex-direction: column;

    gap: 7px;
}

.customer-form-inline-logo-label {
    color: var(--tepas-text);

    font-size: 13px;
    font-weight: 600;
}

/* ---------------------------------------------------------
   Customer detail - larger company logo
--------------------------------------------------------- */

.customer-detail-heading .customer-logo {
    width: 165px;
    height: 85px;

    flex: 0 0 165px;
}

.customer-detail-heading .customer-logo img,
.customer-detail-heading .customer-logo-placeholder {
    width: 100%;
    height: 100%;
}

.customer-detail-heading .customer-logo img {
    padding: 8px;

    object-fit: contain;
}

@media (max-width: 700px) {

    .customer-detail-heading .customer-logo {
        width: 115px;
        height: 65px;

        flex-basis: 115px;
    }
}

/* ---------------------------------------------------------
   Customer form - company logo remove / replace
--------------------------------------------------------- */

.customer-logo-stage {
    min-height: 78px;
    padding: 10px;

    display: flex;
    align-items: center;

    border: 1px solid #cfd7df;
    border-radius: 8px;

    background: #ffffff;
}

.customer-logo-current {
    width: 100%;
}

.customer-logo-image-wrapper {
    position: relative;

    display: inline-block;

    line-height: 0;
}

.customer-logo-image-wrapper img {
    display: block;

    max-width: 165px;
    max-height: 64px;

    width: auto;
    height: auto;

    object-fit: contain;
}

.customer-logo-remove-button {
    position: absolute;

    right: -8px;
    bottom: -8px;

    width: 22px;
    height: 22px;
    padding: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    border: 2px solid #ffffff;
    border-radius: 50%;

    background: #d92d20;
    color: #ffffff;

    font-size: 16px;
    font-weight: 700;
    line-height: 1;

    cursor: pointer;

    box-shadow: 0 2px 5px rgba(31, 41, 51, 0.20);
}

.customer-logo-remove-button:hover {
    background: #b42318;
}

.customer-logo-remove-button:focus-visible {
    outline: 3px solid rgba(233, 76, 19, 0.20);
    outline-offset: 2px;
}

.customer-logo-upload {
    width: 100%;

    display: flex;
    align-items: center;
    gap: 12px;
}

.customer-logo-hidden {
    display: none !important;
}

.customer-logo-clear-checkbox {
    display: none;
}

/* Contact person form - customer name */

.contact-form-customer-name {
    font-size: 1.15em;
    font-weight: 700;
    color: #1f2937;
}

/* Contact persons - edit link */

.customer-contact-edit-link {
    color: var(--tepas-text);
    font-weight: 700;
    text-decoration: none;
}

.customer-contact-edit-link:hover {
    color: var(--tepas-orange);
    text-decoration: underline;
}

/* ---------------------------------------------------------
   Contact person form - images
--------------------------------------------------------- */

.contact-image-stage {
    min-height: 112px;
    padding: 12px;

    display: flex;
    align-items: center;

    border: 1px solid var(--tepas-border);
    border-radius: 8px;

    background: #ffffff;
}

.contact-image-current {
    width: 100%;
}

.contact-image-wrapper {
    position: relative;
    display: inline-block;
    line-height: 0;
}

.contact-image-wrapper img {
    display: block;

    width: 96px;
    height: 96px;

    border-radius: 8px;

    object-fit: cover;
}

.contact-image-remove-button {
    position: absolute;

    right: -8px;
    bottom: -8px;

    width: 22px;
    height: 22px;
    padding: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    border: 2px solid #ffffff;
    border-radius: 50%;

    background: #d92d20;
    color: #ffffff;

    font-size: 16px;
    font-weight: 700;
    line-height: 1;

    cursor: pointer;

    box-shadow: 0 2px 5px rgba(31, 41, 51, 0.20);
}

.contact-image-remove-button:hover {
    background: #b42318;
}

.contact-image-upload {
    width: 100%;

    display: flex;
    flex-direction: column;
    gap: 8px;
}

.contact-image-hidden {
    display: none !important;
}

.contact-image-clear-checkbox {
    display: none;
}

/* Contact person form - business card preview */

.contact-business-card-wrapper {
    position: relative;

    display: inline-block;

    line-height: 0;
}

.contact-business-card-wrapper img {
    display: block;

    max-width: 280px;
    max-height: 160px;

    width: auto;
    height: auto;

    border-radius: 8px;

    object-fit: contain;
}
