/*
 * Zayavki central UI layer.
 *
 * From R0.3.5 forward, global design changes belong here.
 *
 * Legacy inline CSS remains temporarily while the old app.py
 * templates are migrated incrementally.
 */


/* ==========================================================
   TOP NAVIGATION
   ========================================================== */

.top nav {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}


.top nav > a:not(.admin-bug-nav):not(.role-switch-link) {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-height: 36px;

    padding: 8px 12px;

    border: 1px solid #e1d1bc;
    border-radius: 11px;

    background:
        linear-gradient(
            180deg,
            #fffaf2,
            #f4e7d6
        );

    color: #705a43;

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

    text-decoration: none;

    box-shadow:
        0 3px 10px
        rgba(112, 83, 48, .06);

    transition:
        transform .14s ease,
        background .14s ease,
        border-color .14s ease,
        box-shadow .14s ease;
}


.top nav > a:not(.admin-bug-nav):not(.role-switch-link):hover {
    transform: translateY(-1px);

    border-color: #c9ae89;

    background:
        linear-gradient(
            180deg,
            #fffdf8,
            #efe0cb
        );

    box-shadow:
        0 6px 15px
        rgba(112, 83, 48, .11);
}


.role-switch-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-height: 36px;

    padding: 8px 11px;

    border: 1px dashed #d8c5ad;
    border-radius: 11px;

    color: #947d64;

    background: rgba(255, 250, 242, .55);

    font-size: 12px;
    font-weight: 800;

    text-decoration: none;
}


.role-switch-link:hover {
    background: #f4e9da;
    color: #705941;
}


/* ==========================================================
   CONSISTENT ACTION BUTTONS
   ========================================================== */

.action-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 9px;
}


.action-row > a.btn,
.action-row > button {
    min-height: 39px;

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


/* ==========================================================
   TABLE LINKS
   ========================================================== */

table a {
    color: #76532f;
    font-weight: 800;
    text-decoration: none;
}


table a:hover {
    text-decoration: underline;
}


/* ==========================================================
   API / ARCHITECTURE FRIENDLY STATUS TOKENS
   ========================================================== */

.status-full {
    color: #2f7d46;
}

.status-partial {
    color: #9b6a25;
}

.status-none {
    color: #a54f44;
}


/* ==========================================================
   SMALL SCREENS
   ========================================================== */

@media(max-width: 760px) {

    .top {
        align-items: flex-start;
        flex-direction: column;
    }

    .top nav {
        width: 100%;
    }

    .top nav > a {
        flex: 1 1 auto;
    }
}


/* ==========================================================
   DIALABPOTOK SMART CATALOG SEARCH
   ========================================================== */

.catalog-search {
    position: relative;

    margin:
        12px
        0
        24px;
}


.catalog-search-label {
    display: block;

    margin-bottom: 7px;

    color:
        var(
            --dlp-text-strong,
            #4e3c2b
        );

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


.catalog-search-control {
    position: relative;
}


.catalog-search-icon {
    position: absolute;

    z-index: 2;

    left: 14px;
    top: 50%;

    transform:
        translateY(-50%);

    pointer-events: none;

    opacity: .58;

    font-size: 17px;
}


.catalog-search-input {
    width: 100%;

    min-height: 48px;

    padding:
        10px
        42px;

    border:
        1px solid
        var(
            --dlp-border,
            #e2d1bd
        );

    border-radius:
        var(
            --dlp-radius-md,
            14px
        );

    background:
        var(
            --dlp-surface,
            #fffdf9
        );

    color:
        var(
            --dlp-text-strong,
            #4e3c2b
        );

    font: inherit;

    font-size: 15px;

    outline: none;

    box-shadow:
        0 7px 20px
        rgba(104,77,42,.045);

    transition:
        border-color .14s ease,
        box-shadow .14s ease;
}


.catalog-search-input:focus {
    border-color:
        #c9a581;

    box-shadow:
        0 0 0 3px
        rgba(207,103,56,.10),
        0 9px 23px
        rgba(104,77,42,.055);
}


.catalog-search-results {
    position: absolute;

    z-index: 50;

    top:
        calc(100% + 6px);

    left: 0;
    right: 0;

    max-height: 390px;

    overflow-y: auto;

    padding: 5px;

    border:
        1px solid
        var(
            --dlp-border,
            #e2d1bd
        );

    border-radius:
        var(
            --dlp-radius-md,
            14px
        );

    background:
        rgba(
            255,
            253,
            249,
            .985
        );

    box-shadow:
        0 16px 42px
        rgba(82,58,34,.15);
}


.catalog-search-results[hidden] {
    display: none;
}


.catalog-search-result {
    display: block;

    width: 100%;

    padding:
        11px
        12px;

    border: 0;

    border-radius: 10px;

    background: transparent;

    color:
        var(
            --dlp-text,
            #604c38
        );

    text-align: left;

    cursor: pointer;
}


.catalog-search-result:hover,
.catalog-search-result.is-active {
    background:
        var(
            --dlp-accent-soft,
            #f8e0d1
        );
}


.catalog-search-result-name {
    font-size: 15px;
    font-weight: 850;

    line-height: 1.28;
}


.catalog-search-result-meta {
    margin-top: 3px;

    color:
        var(
            --dlp-text-muted,
            #927d66
        );

    font-size: 12px;

    line-height: 1.3;
}


.catalog-search-empty {
    padding:
        14px
        12px;

    color:
        var(
            --dlp-text-muted,
            #927d66
        );

    font-size: 14px;
}


.catalog-search-status {
    min-height: 17px;

    margin-top: 5px;

    color:
        var(
            --dlp-text-muted,
            #927d66
        );

    font-size: 11px;
}


.catalog-search-hit {
    animation:
        dialabCatalogHit
        1.7s ease;
}


@keyframes dialabCatalogHit {

    0% {
        box-shadow:
            0 0 0 0
            rgba(207,103,56,.35);
    }

    20% {
        background:
            #fff3e8;

        box-shadow:
            0 0 0 4px
            rgba(207,103,56,.15);
    }

    100% {
        box-shadow:
            0 0 0 0
            rgba(207,103,56,0);
    }

}


@media(max-width:640px) {

    .catalog-search {
        margin-bottom: 19px;
    }


    .catalog-search-input {
        min-height: 52px;

        font-size: 16px;
    }


    .catalog-search-results {
        max-height: 320px;
    }

}


/* ==========================================================
   DIALABPOTOK LARGE SEARCH CLEAR BUTTON
   ========================================================== */

/*
 * Chrome / Edge search-field clear button.
 *
 * Large transparent hit area so the user does not have
 * to aim precisely. Burgundy X matches the product UI.
 */

.catalog-search-input::-webkit-search-cancel-button {
    -webkit-appearance: none;

    appearance: none;

    width: 38px;
    height: 38px;

    margin-right: -7px;

    border-radius: 10px;

    cursor: pointer;

    background-color: transparent;

    background-image:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Cpath d='M6 6L18 18M18 6L6 18' fill='none' stroke='%237b2638' stroke-width='3' stroke-linecap='round'/%3E%3C/svg%3E");

    background-repeat: no-repeat;
    background-position: center;
    background-size: 20px 20px;

    transition:
        background-color .12s ease,
        transform .12s ease;
}


.catalog-search-input::-webkit-search-cancel-button:hover {
    background-color:
        rgba(123,38,56,.10);
}


.catalog-search-input::-webkit-search-cancel-button:active {
    background-color:
        rgba(123,38,56,.17);

    transform:
        scale(.94);
}

