:root {
    --wms-action-color: #65359A;
    --wms-action-hover: #F3E8FF;
    --wms-action-active: #542881;
    --wms-danger-color: #EF4444;
    --wms-danger-hover: #FEE2E2;
    --wms-disabled-border: #CBD5E1;
    --wms-disabled-text: #94A3B8;
}

/* Login ile şirket/şube seçimi dışındaki ortak WMS buton görünümü. */
.wms-mobile-layout-wrapper :is(.btn, .btn-wms-action),
.wms-button-unified {
    min-height: 42px;
    border: 1.5px solid var(--wms-action-color) !important;
    border-radius: 7px !important;
    color: var(--wms-action-color) !important;
    background: #FFFFFF !important;
    box-shadow: 0 2px 5px rgba(30, 41, 59, .07) !important;
    font-weight: 700;
    transition: color .15s ease, background-color .15s ease, border-color .15s ease, box-shadow .15s ease;
}

.wms-mobile-layout-wrapper :is(.btn, .btn-wms-action) :is(i, span, svg),
.wms-button-unified :is(i, span, svg) {
    color: inherit !important;
}

.wms-mobile-layout-wrapper :is(.btn, .btn-wms-action):hover:not(:disabled):not(.disabled),
.wms-mobile-layout-wrapper :is(.btn, .btn-wms-action):focus-visible:not(:disabled):not(.disabled),
.wms-button-unified:hover:not(:disabled):not(.disabled),
.wms-button-unified:focus-visible:not(:disabled):not(.disabled) {
    border-color: var(--wms-action-color) !important;
    color: var(--wms-action-color) !important;
    background: var(--wms-action-hover) !important;
    box-shadow: 0 0 0 3px rgba(101, 53, 154, .12) !important;
}

.wms-mobile-layout-wrapper :is(.btn-primary, .btn-wms-primary),
.wms-button-unified.wms-button-primary {
    border-color: var(--wms-action-color) !important;
    color: #FFFFFF !important;
    background: var(--wms-action-color) !important;
}

.wms-mobile-layout-wrapper :is(.btn-primary, .btn-wms-primary):hover:not(:disabled):not(.disabled),
.wms-mobile-layout-wrapper :is(.btn-primary, .btn-wms-primary):focus-visible:not(:disabled):not(.disabled),
.wms-button-unified.wms-button-primary:hover:not(:disabled):not(.disabled),
.wms-button-unified.wms-button-primary:focus-visible:not(:disabled):not(.disabled) {
    border-color: var(--wms-action-active) !important;
    color: #FFFFFF !important;
    background: var(--wms-action-active) !important;
}

.wms-mobile-layout-wrapper :is(.btn-danger, .btn-outline-danger),
.wms-button-unified.wms-button-danger {
    border-color: var(--wms-danger-color) !important;
    color: var(--wms-danger-color) !important;
    background: #FFFFFF !important;
}

.wms-mobile-layout-wrapper :is(.btn-danger, .btn-outline-danger):hover:not(:disabled):not(.disabled),
.wms-mobile-layout-wrapper :is(.btn-danger, .btn-outline-danger):focus-visible:not(:disabled):not(.disabled),
.wms-button-unified.wms-button-danger:hover:not(:disabled):not(.disabled),
.wms-button-unified.wms-button-danger:focus-visible:not(:disabled):not(.disabled) {
    border-color: var(--wms-danger-color) !important;
    color: #B91C1C !important;
    background: var(--wms-danger-hover) !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, .12) !important;
}

.wms-mobile-layout-wrapper :is(.btn, .btn-wms-action):active:not(:disabled),
.wms-mobile-layout-wrapper :is(.btn, .btn-wms-action).active,
.wms-mobile-layout-wrapper :is(.btn, .btn-wms-action).selected,
.wms-button-unified:active:not(:disabled),
.wms-button-unified.active,
.wms-button-unified.selected {
    border-color: var(--wms-action-color) !important;
    color: #FFFFFF !important;
    background: var(--wms-action-color) !important;
}

.wms-mobile-layout-wrapper :is(.btn, .btn-wms-action):disabled,
.wms-mobile-layout-wrapper :is(.btn, .btn-wms-action).disabled,
.wms-button-unified:disabled,
.wms-button-unified.disabled {
    border-color: var(--wms-disabled-border) !important;
    color: var(--wms-disabled-text) !important;
    background: #F8FAFC !important;
    box-shadow: none !important;
    opacity: 1 !important;
}

/* Paket durumu da tek mor renk içinde görünür. */
.wms-package-create-button {
    border-color: var(--wms-action-color) !important;
    color: var(--wms-action-color) !important;
    background: #FFFFFF !important;
    animation: none !important;
}

.wms-package-finish-label { display: none !important; }
.wms-package-finish-button .wms-package-create-label { display: none !important; }
.wms-package-finish-button .wms-package-finish-label { display: inline-flex !important; }

.wms-package-finish-button:not(:disabled),
.wms-mobile-layout-wrapper .package-remove-active:not(:disabled) {
    border-color: #B91C1C !important;
    color: #FFFFFF !important;
    background: #EF4444 !important;
    transform-origin: center;
    animation: wms-danger-heartbeat 1.35s ease-in-out infinite !important;
}

@keyframes wms-danger-heartbeat {
    0%, 100% {
        filter: brightness(1.16) drop-shadow(0 0 0 rgba(239, 68, 68, 0));
        transform: scale(1);
    }
    12% {
        filter: brightness(.72) drop-shadow(0 0 6px rgba(239, 68, 68, .42));
        transform: scale(1.045);
    }
    24% {
        filter: brightness(1.08) drop-shadow(0 0 0 rgba(239, 68, 68, 0));
        transform: scale(1);
    }
    36% {
        filter: brightness(.78) drop-shadow(0 0 5px rgba(185, 28, 28, .36));
        transform: scale(1.035);
    }
    52% {
        filter: brightness(1.08) drop-shadow(0 0 0 rgba(239, 68, 68, 0));
        transform: scale(1);
    }
}

@media (prefers-reduced-motion: reduce) {
    .wms-package-finish-button:not(:disabled),
    .wms-mobile-layout-wrapper .package-remove-active:not(:disabled) {
        animation: none !important;
        filter: none;
    }
}

.wms-button-tone:not(.wms-button-danger):not(.wms-button-primary) {
    border-color: var(--wms-action-color) !important;
    color: var(--wms-action-color) !important;
    background: #FFFFFF !important;
}

.wms-mobile-layout-wrapper :is(.wms-mobile-top-action-bar, .wms-action-bar) {
    border-color: #D8DEE8;
}

.wms-mobile-layout-wrapper .wms-mobile-top-action-bar {
    align-items: stretch !important;
    min-height: 50px;
}

.wms-mobile-layout-wrapper .wms-mobile-top-action-bar > button,
.wms-mobile-layout-wrapper .wms-mobile-top-action-bar > label,
.wms-mobile-layout-wrapper .wms-mobile-top-action-bar .wms-grid-settings-trigger,
.wms-mobile-layout-wrapper .wms-mobile-top-action-bar .planli-transfer-action {
    height: 50px !important;
    min-height: 50px !important;
    align-items: center;
    justify-content: center;
}

.wms-mobile-layout-wrapper .wms-mobile-top-action-bar > button .wms-mobile-action-label,
.wms-mobile-layout-wrapper .wms-mobile-top-action-bar > button > span,
.wms-mobile-layout-wrapper .wms-mobile-top-action-bar > label > span,
.wms-mobile-layout-wrapper .wms-mobile-top-action-bar .wms-grid-settings-trigger .wms-mobile-action-label,
.wms-mobile-layout-wrapper .wms-mobile-top-action-bar .planli-transfer-action > span {
    min-width: 0;
    overflow: visible !important;
    white-space: normal !important;
    text-align: center;
    text-overflow: clip !important;
    line-height: 1.05;
}

.wms-mobile-layout-wrapper .wms-mobile-action-label-stacked {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.wms-mobile-layout-wrapper .top-row .wms-mobile-top-action-bar {
    height: 48px;
    min-height: 48px;
}

.wms-mobile-layout-wrapper .top-row .wms-mobile-top-action-bar > label,
.wms-mobile-layout-wrapper .top-row .wms-mobile-top-action-bar .planli-transfer-action {
    height: 48px !important;
    min-height: 48px !important;
}

.wms-mobile-layout-wrapper .wms-list-command-bar {
    min-height: 54px;
    padding-top: 6px !important;
    padding-bottom: 6px !important;
    background: #F8FAFC;
    border-bottom: 1px solid #D8DEE8;
}

.wms-mobile-layout-wrapper .wms-list-command-bar > button,
.wms-mobile-layout-wrapper .wms-list-command-bar .wms-grid-settings-trigger {
    width: 142px;
    height: 42px !important;
    min-height: 42px !important;
}

@media (max-width: 520px) {
    .wms-mobile-layout-wrapper .wms-list-command-bar > button,
    .wms-mobile-layout-wrapper .wms-list-command-bar > div {
        flex: 1 1 0;
        width: auto;
        max-width: 150px;
        min-width: 0;
    }

    .wms-mobile-layout-wrapper .wms-list-command-bar .wms-grid-settings-trigger {
        width: 100%;
        padding-right: 8px;
        padding-left: 8px;
    }
}

/* Mobil alt işlem barı: iki işlemde iki sütun; üç işlemde tek satır. */
@media (max-width: 767.98px) {
    .wms-mobile-layout-wrapper .wms-action-bar {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px !important;
    }

    .wms-mobile-layout-wrapper .wms-action-bar > * {
        width: 100% !important;
        min-width: 0 !important;
        max-width: none !important;
    }

    .wms-mobile-layout-wrapper .wms-action-bar > :last-child:nth-child(odd) {
        grid-column: 1 / -1;
    }

    .wms-mobile-layout-wrapper .wms-action-bar:has(> :nth-child(3):last-child) {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 6px !important;
    }

    .wms-mobile-layout-wrapper .wms-action-bar:has(> :nth-child(3):last-child) > :last-child {
        grid-column: auto;
    }

    .wms-mobile-layout-wrapper .wms-action-bar:has(> :nth-child(3):last-child) > :is(.btn, .btn-wms-action),
    .wms-mobile-layout-wrapper .wms-action-bar:has(> :nth-child(3):last-child) > div > :is(.btn, .btn-wms-action) {
        min-height: 44px !important;
        padding: 5px 4px !important;
        gap: 4px !important;
    }

    .wms-mobile-layout-wrapper .wms-action-bar:has(> :nth-child(3):last-child) > :is(.btn, .btn-wms-action) > span,
    .wms-mobile-layout-wrapper .wms-action-bar:has(> :nth-child(3):last-child) > div > :is(.btn, .btn-wms-action) > span {
        min-width: 0;
        font-size: clamp(.72rem, 3.1vw, .84rem) !important;
        line-height: 1.05;
        white-space: normal !important;
    }

    .wms-mobile-layout-wrapper .wms-action-bar:has(> :nth-child(3):last-child) > :is(.btn, .btn-wms-action) > i,
    .wms-mobile-layout-wrapper .wms-action-bar:has(> :nth-child(3):last-child) > div > :is(.btn, .btn-wms-action) > i {
        flex: 0 0 auto;
        font-size: .9rem;
    }

    .wms-mobile-layout-wrapper .wms-action-bar :is(.btn, .btn-wms-action) {
        width: 100% !important;
        min-height: 48px !important;
        white-space: normal;
        line-height: 1.1;
    }
}
