/* Customer card diagnostics stay available by route/code, but are not part of the operational card UI. */
.api-customer-readonly,
.api-customer-mapping-link {
    display: none !important;
}

/* Global browser-history Back belongs in the shell top actions, not inside the scrollable
   workspace-tab rail. The old global save slot stays hidden; section-level save actions
   remain inside their own editors. */
.workspace-save-button {
    display: none !important;
}

.shell-back-button {
    flex: 0 0 36px !important;
    font-size: 19px !important;
    font-weight: 700 !important;
    line-height: 1 !important;
}

/* Keep the open-tab rail scrollable when many tabs exist, but do not show a permanent
   browser-like horizontal scrollbar. Leave a small visual breath before page content. */
.workspace-tabs {
    margin-bottom: 8px !important;
    scrollbar-width: none !important;
}

.workspace-tabs::-webkit-scrollbar {
    display: none !important;
}

.workspace-tab-tools:empty {
    display: none !important;
}

/* The browser-history Back control supersedes the customer-only “← Πελάτες” link. */
.customer-header .back-link {
    display: none !important;
}

/* Desktop customer header: identity + phone/email stay together; appointment state and
   notes use the free action rail on the right side of the customer tabs. */
@media (min-width: 1200px) {
    .customer-header {
        position: relative !important;
        overflow: visible !important;
    }

    .header-title-row {
        display: flex !important;
        align-items: center !important;
        min-height: 32px !important;
        padding-right: 0 !important;
    }

    .customer-commands {
        display: flex !important;
        align-items: center !important;
        gap: 6px !important;
        flex-wrap: nowrap !important;
    }

    .customer-commands > .contact-command,
    .customer-commands > .email-command {
        position: static !important;
        top: auto !important;
        right: auto !important;
        width: auto !important;
        transform: none !important;
        z-index: auto !important;
    }

    .customer-commands > .contact-command:first-of-type {
        min-width: 130px !important;
    }

    .customer-commands > .email-command {
        min-width: 200px !important;
    }

    .customer-commands > .appointment-command,
    .customer-commands > .notes-command {
        position: absolute !important;
        top: calc(100% + 9px) !important;
        z-index: 35 !important;
    }

    .customer-commands > .appointment-command {
        right: 112px !important;
    }

    .customer-commands > .notes-command {
        right: 0 !important;
    }

    .customer-main > .tabs {
        box-sizing: border-box !important;
        min-height: 32px !important;
        padding-right: 228px !important;
    }
}

/* The tab itself carries the context; do not repeat the same section title underneath. */
.customer-main > .tabs > button:nth-child(4) {
    font-size: 0 !important;
}

.customer-main > .tabs > button:nth-child(4)::after {
    content: "Προκηρύξεις";
    font-size: 12px;
    font-weight: 700;
}

.summary-card > .summary-heading,
.customer-proclamations-card > .proclamation-history-head {
    display: none !important;
}

/* Qualification save belongs on the same action row as the qualification categories. */
.qualifications-card {
    position: relative !important;
}

.qualifications-card > .section-head > h3 {
    display: none !important;
}

@media (min-width: 1000px) {
    .qualifications-card > .section-head {
        position: absolute !important;
        top: 12px !important;
        right: 12px !important;
        z-index: 6 !important;
        margin: 0 !important;
    }

    .qualifications-card > .qualification-tabs {
        box-sizing: border-box !important;
        min-height: 34px !important;
        padding-right: 185px !important;
    }
}

@media (max-width: 999px) {
    .qualifications-card > .section-head {
        justify-content: flex-end !important;
    }
}

/* Customer proclamation filters: label and selected value share one compact field. */
.customer-applications-toolbar > label {
    position: relative !important;
    display: block !important;
}

.customer-applications-toolbar > label > span {
    position: absolute !important;
    top: 50% !important;
    left: 10px !important;
    z-index: 2 !important;
    margin: 0 !important;
    transform: translateY(-50%) !important;
    color: #7f8993 !important;
    font-size: 9px !important;
    font-weight: 800 !important;
    line-height: 1 !important;
    pointer-events: none !important;
}

.customer-applications-toolbar > label > select {
    width: 100% !important;
    padding-left: 82px !important;
}

/* Keep useful section controls/counters, remove explanatory copy that only repeats the
   active tab or internal source-of-truth implementation. */
.customer-email-head p {
    display: none !important;
}

.customer-transactions-card > .transactions-heading > div:first-child {
    display: none !important;
}

.customer-transactions-card > .transactions-heading {
    justify-content: flex-end !important;
}

.customer-transactions-card > .transactions-heading:has(> div:first-child:last-child) {
    display: none !important;
}

.communication-card > .communication-heading > div:first-child {
    display: none !important;
}

.communication-card > .communication-heading {
    justify-content: flex-end !important;
}

@media (max-width: 1199px) {
    .customer-commands > .appointment-command,
    .customer-commands > .notes-command,
    .customer-commands > .contact-command,
    .customer-commands > .email-command {
        position: static !important;
        top: auto !important;
        right: auto !important;
        width: auto !important;
        transform: none !important;
    }

    .customer-main > .tabs {
        padding-right: 0 !important;
    }
}

/* Final operational polish: use the real tab label once, make Back match the topbar
   action sizing/brand treatment, and keep appointment details inside the viewport. */
.customer-main > .tabs > button:nth-child(4) {
    font-size: 12px !important;
}

.customer-main > .tabs > button:nth-child(4)::after {
    content: none !important;
}

.shell-back-button {
    width: 36px !important;
    min-width: 36px !important;
    height: 36px !important;
    padding: 0 !important;
    border: 1px solid #ef6c35 !important;
    border-radius: 9px !important;
    background: #ef6c35 !important;
    color: #fff !important;
}

.shell-back-button:hover {
    border-color: #ff7a42 !important;
    background: #ff7a42 !important;
    color: #fff !important;
}

@media (min-width: 1200px) {
    .customer-commands > .appointment-command .appointment-popover {
        left: auto !important;
        right: 0 !important;
        box-sizing: border-box !important;
        max-width: calc(100vw - 32px) !important;
    }
}

/* Identity documents are one compact action group: upload and preview belong side by side,
   while file state/removal feedback sits on the next row instead of forming a vertical stack. */
.identity-file-control {
    flex-direction: row !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 6px !important;
}

.identity-upload-button,
.identity-document-button {
    box-sizing: border-box !important;
    min-width: 104px !important;
    min-height: 31px !important;
    height: 31px !important;
    margin: 0 !important;
    padding: 0 11px !important;
    justify-content: center !important;
}

.identity-file-control > .education-file-delete {
    flex: 0 1 auto !important;
    min-height: 28px !important;
    margin: 0 !important;
    padding: 0 9px !important;
    border-radius: 5px !important;
}

.identity-file-control > small,
.identity-file-control > .identity-upload-status {
    flex: 1 0 100% !important;
    margin-top: 1px !important;
}

/* The same status element carries both success and backend rejection text today; keep it
   neutral/attention-colored so a failed delete is never presented as a green success. */
.identity-upload-status {
    color: #d8ae68 !important;
}

/* Give previews a predictable work area. Image links are wrapped by ExternalCustomerDocumentLink
   in a fit-to-window document; PDFs and other browser-supported files keep using the iframe. */
.document-preview-popup {
    width: min(1180px, 94vw) !important;
    height: min(820px, 90vh) !important;
}

.document-preview-popup iframe {
    display: block !important;
    min-width: 0 !important;
    min-height: 0 !important;
    background: #171a1d !important;
}

@media (max-width: 700px) {
    .identity-upload-button,
    .identity-document-button {
        min-width: 0 !important;
        flex: 1 1 calc(50% - 3px) !important;
    }

    .document-preview-popup {
        width: 96vw !important;
        height: 88vh !important;
    }
}
