@import url('open.iconic/font/css/open-iconic-bootstrap.min.css');
/*@import url('merc.css');*/
@import url('merc-media.css');
@import url('breadcrumb.css');
@import url('pivot-report-page.css');

html,
body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

html,
body {
    height: 100%;
    overflow: hidden;
}

.valid.modified:not([type='checkbox']) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid red;
}

.validation-message {
    color: red;
}

.button-link {
    text-decoration: unset;
}

#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
    }

.title {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding-bottom: 0.625rem;
}

.title-header-text {
    font-size: 2.5rem;
    line-height: 3rem;
    font-weight: 600;
    letter-spacing: 0rem;
}

.title-content-text {
    font-size: 1.75rem;
    font-weight: 400;
    line-height: 2.5rem;
    letter-spacing: 0rem;
}

.main-content {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
    width: 100%;
}

.block-content {
    width: 31.25rem;
    height: auto;
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
    max-width: 100%;
}

.or {
    display: flex;
    flex-direction: row;
    align-items: center;
}

    .or .or-line {
        border-bottom: 1px solid var(--bs-body-color);
        width: 100%;
        opacity: 0.7;
    }

    .or .or-text {
        padding: 0 0.625rem 0px 0.625rem;
        font-size: 0.75rem;
        line-height: 1.125rem;
        color: var(--bs-body-color);
        opacity: 0.7;
    }

.links-area {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
    padding-top: 0.625rem;
}

.links-container {
    display: flex;
    gap: 0.625rem;
    justify-content: center;
    align-items: center;
}

    .links-container .dot {
        height: 0.3125rem;
        width: 0.3125rem;
        border-radius: 50%;
        background-color: var(--bs-body-color);
        opacity: 0.7;
    }

.manage-layout {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
}

.info-message::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    opacity: 0.15;
    background: var(--bs-primary);
    z-index: -1;
}

.info-message {
    padding: 0.625rem 1rem 0.625rem 1rem;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.manage-content {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
}

.large-input {
    height: 4.3125rem;
    font-size: 1.875rem;
}

.title-content-text-secondary {
    font-size: 1.25rem;
    line-height: 1.75rem;
}

.button-group {
    display: flex;
    flex-direction: row;
    gap: 0.625rem;
}

.autocomplete {
    position: relative;
}

    .autocomplete .options {
        position: absolute;
        left: 0;
        width: 100%;
        padding: 0;
        z-index: 10;
        border: 1px solid #615f63;
        border-radius: 0.1875rem;
        box-shadow: 0 30px 25px 8px rgba(0, 0, 0, 0.1);
    }

    .autocomplete .option {
        display: block;
        padding: 0.25rem;
        background: var(--bs-body-bg);
        border: 0px solid #615f63;
    }

        .autocomplete .option:hover {
            cursor: auto;
            background: #46444a;
        }

        .autocomplete .option:focus-within {
            background-color: green;
            border: 0px solid #615f63;
        }

        .autocomplete .option .option-text {
            padding: 0.25rem 0.5rem;
            cursor: context-menu;
        }

#dropzone-external {
    height: 350px;
    background-color: rgba(183, 183, 183, 0.1);
    border-width: 2px;
    border-style: dashed;
    padding: 10px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

    #dropzone-external > * {
        pointer-events: none;
    }

    #dropzone-external.dropzone-hover {
        border-style: solid;
    }

#dropzone-image {
    max-width: 100%;
    max-height: 100%;
}

#dropzone-text > span {
    font-weight: 100;
    opacity: 0.5;
}

.upload-progress {
    display: flex;
    margin-top: 10px;
}

.flex-box {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.formlayout-detail-grid > div {
    margin-top: 0 !important;
}

.merc-hide-column-headers thead {
    display: none;
}

.merc-grid-editform {
    min-width: 80%;
}

.form-details-label {
    min-width: 140px;
    font-weight: 600;
    font-size: 1rem;
    margin-right: 0.5rem;
}

.form-details-value {
    font-size: 1rem;
    flex: 1 1 auto;
    padding-left: 0.25rem;
}

/* Fixed-width font for EDI/code content */
.edi-document-memo textarea,
.edi-document-memo .dxbl-edit-area {
    font-family: 'Consolas', 'Courier New', 'Monaco', 'Lucida Console', monospace;
    font-size: 16px;
    line-height: 1.5;
    letter-spacing: 0;
}

@media screen and (max-width: 768px) {
    input[type="text"],
    input[type="email"],
    input[type="tel"],
    input[type="number"],
    input[type="date"],
    input[type="time"],
    input[type="search"],
    textarea,
    select,
    .dxbl-edit-input,
    .dxbl-textbox input,
    .dxbl-editor input,
    .dxbl-spin-edit input,
    .dxbl-date-edit input,
    .dxbl-time-edit input,
    .dxbl-combo-box input {
        font-size: 16px !important;
    }
}

.grid-link {
    color: inherit;
    text-decoration: underline;
}

.grid-link:hover {
    text-decoration: none;
}

.cmp-invalid .dxbl-input-group {
    border-color: var(--dxds-color-content-danger-default-rest, #dc3545) !important;
}

/* Fixed-height grids (e.g. CreateProductWizard). DxGrid has no Height
   parameter, so we set a concrete height on its root element via the
   CssClass="wizard-grid" hook. With VirtualScrollingEnabled, this caps the
   grid height and shows a vertical scrollbar instead of expanding to fit all
   rows. The height is driven by --wizard-grid-height (default 300px), which can
   be overridden on the surrounding .wizard-grid-container. This rule is global
   (not scoped) because the grids render inside a DxPopup that teleports its
   content outside the component's DOM subtree, where ::deep selectors fail. */
.wizard-grid.dxbl-grid {
    height: var(--wizard-grid-height, 300px);
}

/* ContactSupportPopup header: accent background, applied via DxPopup's
   HeaderCssClass. Global (not scoped) because DxPopup teleports its markup
   outside the component's DOM subtree. */
.dxbl-popup-header.contact-support-popup-header,
.contact-support-popup-header {
    background-color: var(--bs-primary, #0d6efd) !important;
    color: #fff !important;
    border-bottom: none !important;
    padding-top: 1rem;
    padding-bottom: 1rem;
}

.contact-support-popup-header .contact-support-subtitle {
    opacity: 0.85;
}

.contact-support-popup-header .contact-support-header-icon {
    background: rgba(255, 255, 255, 0.2) !important;
    color: #fff !important;
}

.contact-support-popup-header .dxbl-btn,
.contact-support-popup-header .dxbl-image {
    color: #fff !important;
}

/* DxGrid command column: replace the built-in DevExpress SVG glyphs with
   FontAwesome (fa-light) icons so they match the rest of the app. DevExpress
   renders each command as
     <button title="Edit" class="dxbl-btn dxbl-grid-command-button"><svg class="dxbl-image">...</svg></button>
   where title is the default localized button text (New/Edit/Delete/Save/Cancel).
   Verified against DevExpress.Blazor v26.1.3; revisit after an upgrade.
   The Fluent theme underlines .dxbl-btn-text-link buttons; that underline
   propagates into the ::before glyph and, with skip-ink, shows up as two
   small dots either side of the icon, so it is switched off here. */
.dxbl-grid .dxbl-grid-command-button[title="New"],
.dxbl-grid .dxbl-grid-command-button[title="Edit"],
.dxbl-grid .dxbl-grid-command-button[title="Delete"],
.dxbl-grid .dxbl-grid-command-button[title="Save"],
.dxbl-grid .dxbl-grid-command-button[title="Cancel"] {
    --dxbl-btn-text-decoration: none;
    text-decoration: none;
}

.dxbl-grid .dxbl-grid-command-button[title="New"] .dxbl-image,
.dxbl-grid .dxbl-grid-command-button[title="Edit"] .dxbl-image,
.dxbl-grid .dxbl-grid-command-button[title="Delete"] .dxbl-image,
.dxbl-grid .dxbl-grid-command-button[title="Save"] .dxbl-image,
.dxbl-grid .dxbl-grid-command-button[title="Cancel"] .dxbl-image {
    display: none;
}

.dxbl-grid .dxbl-grid-command-button[title="New"]::before,
.dxbl-grid .dxbl-grid-command-button[title="Edit"]::before,
.dxbl-grid .dxbl-grid-command-button[title="Delete"]::before,
.dxbl-grid .dxbl-grid-command-button[title="Save"]::before,
.dxbl-grid .dxbl-grid-command-button[title="Cancel"]::before {
    font-family: "Font Awesome 7 Pro";
    font-weight: 300;
    font-style: normal;
    font-variant: normal;
    font-size: 1rem;
    line-height: 1;
    display: inline-block;
    text-rendering: auto;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.dxbl-grid .dxbl-grid-command-button[title="New"]::before {
    content: "\2b"; /* fa-plus */
}

.dxbl-grid .dxbl-grid-command-button[title="Edit"]::before {
    content: "\f304"; /* fa-pen */
}

.dxbl-grid .dxbl-grid-command-button[title="Delete"]::before {
    content: "\e2b4"; /* fa-trash-xmark */
}

.dxbl-grid .dxbl-grid-command-button[title="Save"]::before {
    content: "\f00c"; /* fa-check */
}

.dxbl-grid .dxbl-grid-command-button[title="Cancel"]::before {
    content: "\f00d"; /* fa-xmark */
}

/* Organisation management pages (theme-aware via Bootstrap CSS variables) */
.org-page {
    max-width: 1200px;
}

.org-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.org-section-title {
    font-weight: 600;
    margin: 1.25rem 0 0.75rem;
    color: var(--bs-body-color);
}

.org-quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.org-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1rem;
}

.org-card {
    background-color: var(--bs-body-bg);
    color: var(--bs-body-color);
    border: 1px solid var(--bs-border-color);
    border-radius: var(--bs-border-radius-lg, 0.5rem);
    overflow: hidden;
}

.org-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.25rem 0;
}

.org-card-title {
    font-weight: 600;
    font-size: 1rem;
}

.org-card-subtitle,
.org-muted {
    color: var(--bs-secondary-color);
    font-size: 0.875rem;
}

.org-card-body {
    padding: 1rem 1.25rem 1.25rem;
}

.org-metric {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.1;
}

.org-metric-row {
    display: flex;
    gap: 2rem;
    margin-top: 1rem;
    font-weight: 600;
}

.org-meter {
    height: 6px;
    background-color: var(--bs-secondary-bg);
    border-radius: 3px;
    margin-top: 1rem;
    overflow: hidden;
}

.org-meter-bar {
    height: 100%;
    background-color: var(--bs-primary);
    border-radius: 3px;
    transition: width 0.3s ease;
}

.org-meter-bar.org-meter-warning {
    background-color: var(--bs-warning);
}

.org-meter-bar.org-meter-danger {
    background-color: var(--bs-danger);
}

.org-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.org-table th,
.org-table td {
    padding: 0.75rem 1.25rem;
    text-align: left;
    border-bottom: 1px solid var(--bs-border-color);
    vertical-align: middle;
}

.org-table thead th {
    background-color: var(--bs-tertiary-bg);
    color: var(--bs-secondary-color);
    font-weight: 600;
}

.org-table tbody tr:last-child td {
    border-bottom: none;
}

.org-badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
}

.org-badge-info {
    background-color: var(--bs-primary-bg-subtle);
    color: var(--bs-primary-text-emphasis);
}

.org-badge-success {
    background-color: var(--bs-success-bg-subtle);
    color: var(--bs-success-text-emphasis);
}

.org-badge-danger {
    background-color: var(--bs-danger-bg-subtle);
    color: var(--bs-danger-text-emphasis);
}

.org-text-danger {
    color: var(--bs-danger-text-emphasis);
}

.org-empty {
    color: var(--bs-secondary-color);
    text-align: center;
    padding: 1.5rem;
}

.org-dl {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 0.4rem 1.5rem;
    margin-bottom: 1rem;
}

.org-dl dt {
    color: var(--bs-secondary-color);
    font-weight: 500;
}

.org-dl dd {
    margin: 0;
}
