/* Mandantenportal (portal only). Colours come from the theme (blue in progress, green done). */

/* locked record (after the transfer to C&P): no create button and no row actions in the panels */
.mandantenportal-gesperrt .panel [data-action="createRelated"],
.mandantenportal-gesperrt .panel .list-row-buttons {
    display: none;
}

/* questionnaire form (all users): a question as panel heading wraps instead of being cut off */
.mandantenportal-formular .panel-heading .panel-title,
.mandantenportal-formular .panel-heading .panel-title * {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
}

/* state "Nicht vollständig": outlined, so that it does not look like a button next to "Ausfüllen" */
.mandantenportal-frageboegen .label-primary {
    background: transparent;
    color: var(--brand-primary, #337ab7);
    border: 1px solid currentColor;
}

/* bar with all questionnaires under the title (views/record/detail.js), inside the sticky button bar */
.mandantenportal-leiste {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-top: 10px;
    clear: both;
}

.mandantenportal-leiste-titel {
    margin-right: 4px;
    color: var(--text-muted-color, #777);
}

.mandantenportal-leiste .btn span + span {
    margin-left: 4px;
}

.mandantenportal-fertig {
    color: var(--state-success-text, #3c763d);
}

.mandantenportal-leiste .mandantenportal-aktuell .mandantenportal-fertig {
    color: inherit;
}

/* one more company by typing its name (teile.js neu), in the bar small and next to the questionnaires */
.mandantenportal-neu {
    display: flex;
    gap: 8px;
}

.mandantenportal-neu .form-control {
    flex: 1;
    min-width: 0;
}

.mandantenportal-neu.has-error .form-control {
    border-color: var(--danger, #c00);
}

.mandantenportal-neu-kompakt {
    display: inline-flex;
    vertical-align: middle;
    width: 420px;
    max-width: 100%;
}

/* phones: the field over the whole width, "Hinzufügen" below it */
@media (max-width: 767px) {
    .mandantenportal-neu {
        flex-wrap: wrap;
    }

    .mandantenportal-neu .form-control,
    .mandantenportal-neu .btn {
        flex: 1 1 100%;
    }
}

/* question after the last questionnaire */
.mandantenportal-fertig-liste li {
    padding: 2px 0;
}

/* tile "Ihre Fragebögen" on the start page (views/dashlets/fragebogen.js) */
.mandantenportal-zusammenfassung {
    margin: 0 0 6px;
}

.mandantenportal-frageboegen {
    margin: 0 0 12px;
}

.mandantenportal-frageboegen li {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 0;
    border-bottom: 1px solid var(--default-border-color, #e5e5e5);
}

.mandantenportal-nr {
    flex: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--default-border-color, #e5e5e5);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

.mandantenportal-frageboegen .mandantenportal-name {
    flex: 1;
    min-width: 0;
}

.mandantenportal-frageboegen .mandantenportal-name small {
    display: block;
}

.mandantenportal-oeffnen {
    min-width: 100px;
}

/* the last row of the list takes one more company: light gold with a gold edge and a building, so it stands out */
.mandantenportal-frageboegen li.mandantenportal-neu-zeile {
    padding: 10px;
    border-left: 4px solid var(--haus-gold, currentColor);
    border-radius: 6px;
    background: var(--haus-gold-10, transparent);
}

.mandantenportal-neu-zeile .mandantenportal-nr {
    background: none;
    color: var(--haus-gold, inherit);
    font-size: 18px;
}

.mandantenportal-neu-zeile .mandantenportal-neu {
    flex: 1;
    max-width: 520px;
}

@media (max-width: 767px) {
    .mandantenportal-frageboegen li {
        flex-wrap: wrap;
    }

    .mandantenportal-oeffnen,
    .mandantenportal-neu-zeile .mandantenportal-neu {
        flex: 1 1 100%;
        width: 100%;
        max-width: none;
    }

    /* the name gets its own line next to the number, so "Löschen" and the state do not run into it */
    .mandantenportal-frageboegen .mandantenportal-name {
        flex: 1 1 calc(100% - 42px);
    }

    .mandantenportal-senden {
        flex-wrap: wrap;
    }

    .mandantenportal-senden .btn {
        width: 100%;
        height: auto;
        white-space: normal;
        line-height: 1.35;
        padding-top: 8px;
        padding-bottom: 8px;
    }
}

/* help text to unfold below a field instead of the narrow help window (the PEP footnote) */
.mandantenportal-hilfe-aufgeklappt a.field-info {
    display: none;
}

.mandantenportal-hilfe {
    margin-top: 6px;
}

.mandantenportal-hilfe-link {
    cursor: pointer;
}

.mandantenportal-hilfe-text {
    white-space: pre-line;
    margin-top: 8px;
    padding: 12px 14px;
    line-height: 1.55;
    border-radius: 6px;
    background: var(--default-border-color, #f0f0f0);
}

/* tile: delete link and the box with the send button */
.mandantenportal-loeschen {
    cursor: pointer;
    white-space: nowrap;
}

.mandantenportal-senden {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px;
    margin-top: 14px;
    padding: 14px;
    border-radius: 6px;
    background: var(--default-border-color, #f0f0f0);
}

.mandantenportal-senden-text {
    flex: 1;
    min-width: 200px;
}

.mandantenportal-senden .btn .fa-paper-plane {
    color: var(--haus-gold, currentColor);
}

/* sending: overview and result (senden.js) */
.mandantenportal-senden-liste li {
    padding: 4px 0;
}

.mandantenportal-leer,
.mandantenportal-fehlt {
    margin: 6px 0;
    padding: 10px 12px !important;
    border: 1px solid var(--default-border-color, #ddd);
    border-radius: 6px;
}

.mandantenportal-leer-knoepfe {
    margin-top: 6px;
}

.mandantenportal-alle-frage {
    margin-top: 12px;
    padding: 10px 12px;
    border-radius: 6px;
    background: var(--default-border-color, #f0f0f0);
}

.mandantenportal-alle-frage .btn,
.mandantenportal-fehlt .btn {
    margin-top: 6px;
}

/* dialogs of sending: text left-aligned like the form */
.mandantenportal-dialog {
    text-align: left;
}

/* a gap shown after sending: label and input red until the prospect types there */
.mandantenportal-luecke .control-label {
    color: var(--state-danger-text, #a94442);
}

.mandantenportal-luecke .form-control,
.mandantenportal-luecke .selectize-input,
.mandantenportal-luecke .attachment-button .btn {
    border-color: var(--state-danger-text, #a94442);
}

/* overview: why sending waits */
.mandantenportal-erst-wenn {
    margin: 12px 0 0;
    font-weight: 600;
}

/* Vorgang: window "Fragebogen senden" (internal users) */
.mandantenportal-hinweis {
    color: var(--text-muted-color);
}

.mandantenportal-fragebogen-senden td,
.mandantenportal-fragebogen-senden th {
    vertical-align: middle;
}

/* what goes out (S131): a plain list, the state muted after the name */
.mandantenportal-liste-titel {
    margin: 12px 0 4px;
    font-weight: 600;
}

.mandantenportal-liste {
    padding-left: 20px;
    margin-bottom: 8px;
}

.mandantenportal-liste label {
    font-weight: normal;
    margin: 0;
}

/* the line with the tick "Persönliche Angaben" has no bullet, the tick takes its place */
.mandantenportal-liste li.mandantenportal-haken {
    list-style: none;
    margin-left: -18px;
}

.mandantenportal-stand,
.mandantenportal-ort {
    color: var(--text-muted-color);
    margin-left: 6px;
}

/* "Weiter" once more at the end of the form, on the right like at the top (Testlauf 11.11.2026) */
.mandantenportal-unten {
    text-align: right;
    margin-bottom: 20px;
}

/* "Sie haben Fragen?" in the title bar left of the search, two lines; without the name below 1100 px, hidden on phones
   (costs no width of the form). Colours are the theme's title bar colours. */
#navbar ul.navbar-right > li.mandantenportal-fragen {
    display: none;
}

@media (min-width: 768px) {
    #navbar ul.navbar-right > li.mandantenportal-fragen {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-self: stretch;
        padding: 4px 20px;
        margin-right: 8px;
        border-right: 1px solid var(--navbar-inverse-link-active-bg);
        color: var(--navbar-inverse-link-color);
        font-size: 13px;
        line-height: 1.35;
        white-space: nowrap;
    }

    #navbar li.mandantenportal-fragen .mandantenportal-fragen-titel {
        color: var(--navbar-inverse-link-icon-hover-color);
        font-weight: 600;
        font-size: 14px;
    }

    #navbar li.mandantenportal-fragen a {
        display: inline;
        height: auto;
        padding: 0;
        color: inherit;
        text-decoration: underline;
    }
}

@media (min-width: 768px) and (max-width: 1099px) {
    #navbar li.mandantenportal-fragen .mandantenportal-fragen-name {
        display: none;
    }
}

/* questionnaire in the portal: "Vorname" and "Nachname" start on one line although "Wer ist gemeint?" makes the first
   cell taller; in such a row the labels keep their height instead of filling the cell (Optik 5.13 fills it) */
@media (min-width: 768px) {
    body:not([data-id="espocrm"]) .record .panel-body > .row:has(> .cell.mandantenportal-hilfe-aufgeklappt) > .cell > label.control-label {
        flex: 0 0 auto;
    }
}
