:root {
    --bg: #f8fafc;
    --panel: #ffffff;
    --line: #e2e8f0;
    --line-soft: #edf2f7;
    --text: #0f172a;
    --muted: #64748b;
    --accent: #d97706;
    --accent-strong: #b45309;
    --danger: #dc2626;
    --success: #16a34a;
    --shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
}

*, ::before, ::after {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
    background: var(--bg);
    color: var(--text);
    font-family: "Inter", sans-serif;
    overflow-x: clip;
    max-width: 100vw;
}

a {
    color: inherit;
    text-decoration: none;
}

.material-symbols-rounded {
    font-variation-settings: 'FILL' 1, 'wght' 600, 'GRAD' 0, 'opsz' 24;
    line-height: 1;
}

.wms-layout {
    min-height: 100vh;
    padding-top: 60px; /* Offset for fixed topbar */
    display: flex;
    flex-direction: column;
    background-color: var(--bg);
}

.wms-shell {
    display: flex;
    flex: 1;
    min-height: calc(100vh - 60px);
    position: relative;
}

.sidebar {
    position: fixed;
    top: 60px;
    bottom: 40px; /* Offset above fixed bottom footer */
    left: 0;
    width: 280px;
    min-width: 280px;
    height: calc(100vh - 100px);
    max-height: calc(100vh - 100px);
    border-right: 1px solid var(--line);
    background: #ffffff;
    overflow-y: auto;
    overflow-x: hidden;
    transform: translateX(0);
    transition: transform 0.2s ease, width 0.2s ease;
    z-index: 900;
}

.sidebar::-webkit-scrollbar {
    width: 5px;
}

.sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.sidebar.is-closed {
    transform: translateX(-100%);
    pointer-events: none;
}

.sidebar.is-open {
    transform: translateX(0);
    pointer-events: auto;
}

.content {
    flex: 1;
    margin-left: 280px;
    min-width: 0;
    padding-bottom: 50px; /* Offset above fixed bottom footer */
    transition: margin-left 0.2s ease;
    display: flex;
    flex-direction: column;
}

.wms-shell.sidebar-collapsed .content {
    margin-left: 0;
}

.wms-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 40px;
    background: #ffffff;
    border-top: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-size: 13px;
    color: #64748b;
    z-index: 950;
    box-shadow: 0 -1px 3px rgba(0, 0, 0, 0.03);
}

.footer-logo {
    height: 20px;
    object-fit: contain;
}

@media (max-width: 980px) {
    .content {
        margin-left: 0 !important;
    }
    .sidebar {
        z-index: 1100;
        height: calc(100vh - 60px);
        max-height: calc(100vh - 60px);
        bottom: 0;
    }
}

/* Mobile sidebar backdrop */
.sidebar-backdrop {
    display: none;
}

@media (max-width: 980px) {
    .sidebar-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        top: 0;
        bottom: 0;
        left: 0;
        right: 0;
        background: rgba(15, 23, 42, 0.5);
        z-index: 1050;
        backdrop-filter: blur(3px);
        animation: fadeIn 0.2s ease;
        cursor: pointer;
    }

    @keyframes fadeIn {
        from { opacity: 0; }
        to   { opacity: 1; }
    }
}

.menu {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 10px 0 32px;
    min-height: 100%;
    align-items: stretch;
}

.menu-section {
    margin-top: 14px;
    width: 100%;
    border: 0;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 1.4px;
    padding: 10px 14px 8px;
    position: relative;
    border-top: 1px solid #edf2f7;
    transition: color 0.2s ease, background-color 0.2s ease;
}

.menu-section:hover {
    color: var(--text);
    background-color: var(--line-soft);
}

.menu-section::before {
    content: none;
}

.menu-section .menu-expand-icon {
    font-size: 1rem;
    color: #94a3b8;
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), color 0.2s ease;
}

.menu-section .menu-expand-icon.rotated {
    transform: rotate(180deg);
}

.menu-items {
    display: grid;
    gap: 3px;
    margin: 0 10px 0 16px;
    padding: 0;
    border-left: 2px solid #dde5ef;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.25s ease-out,
                margin 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                padding 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.menu-items.expanded {
    max-height: 2500px;
    opacity: 1;
    overflow: visible;
    margin: 0 10px 6px 16px;
    padding: 4px 0 6px;
}

.menu-subgroup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    background: transparent;
    border: 0;
    cursor: pointer;
    padding: 8px 8px 6px 4px;
    margin-top: 8px;
    margin-bottom: 2px;
    font-size: 0.70rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    color: #64748b;
    border-bottom: 1px solid #e2e8f0;
    transition: color 0.2s ease, background-color 0.2s ease;
    border-radius: 4px;
}

.menu-subgroup-header:hover {
    color: #1e293b;
    background-color: #f8fafc;
}

.menu-subgroup-title {
    display: flex;
    align-items: center;
    gap: 6px;
}

.menu-subgroup-icon {
    font-size: 0.90rem;
    color: #94a3b8;
}

.menu-subgroup-expand {
    font-size: 0.95rem;
    color: #94a3b8;
    transition: transform 0.2s ease;
}

.menu-subgroup-expand.rotated {
    transform: rotate(180deg);
}

.menu-subgroup-items {
    display: grid;
    gap: 2px;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-height 0.25s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s ease-out;
}

.menu-subgroup-items.expanded {
    max-height: 1000px;
    opacity: 1;
    overflow: visible;
    padding: 2px 0;
}

.menu a.nav-link {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    margin: 2px 0 2px 2px !important;
    padding: 4px 8px !important;
    border-radius: 8px !important;
    border: 1px solid transparent !important;
    color: #475569 !important;
    font-size: 0.84rem !important;
    font-weight: 700 !important;
    line-height: 1.3 !important;
    text-decoration: none !important;
    background: transparent !important;
    box-shadow: none !important;
    min-height: 32px !important;
    text-transform: none !important;
    letter-spacing: normal !important;
    width: auto !important;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.menu a.nav-link:hover {
    background: #eef2ff !important;
    color: #1e293b !important;
    border-color: #dbeafe !important;
    box-shadow: none !important;
    text-decoration: none !important;
}

.menu a.nav-link:hover .menu-icon {
    color: #c2410c;
}

.menu a.nav-link.active {
    background: #f8efe5 !important;
    color: var(--accent-strong) !important;
    box-shadow: none !important;
    border-color: #f6ddc2 !important;
}

.menu a.nav-link.active .menu-icon {
    color: var(--accent-strong);
}

.menu-icon {
    font-size: 0.92rem;
    color: var(--accent);
    flex-shrink: 0;
}

.content {
    min-width: 0;
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 60px);
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    height: 60px;
    min-height: 60px;
    max-height: 60px;
    padding: 0 16px;
    background: #ffffff;
    border-bottom: 1px solid var(--line);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100vw;
    z-index: 1000;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.topbar-branding {
    display: flex;
    align-items: center;
    gap: 1rem;
    min-width: 0;
}

.menu-trigger {
    border: 0;
    background: transparent;
    padding: 6px;
    color: #64748b;
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
    border-radius: 8px;
}

.menu-trigger:hover {
    background: #f1f5f9;
}

.topbar-logo {
    width: 190px;
    height: 40px;
    object-fit: contain;
    background: transparent;
    box-shadow: none;
    border-radius: 0;
}

.topbar-title {
    margin: 0;
    color: var(--accent);
    font-family: "Roboto", sans-serif;
    font-size: 1.25rem;
    line-height: 1.6;
    font-weight: 800;
    letter-spacing: 1px;
    white-space: nowrap;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.topmenu-wrap {
    position: relative;
}

.topbar-profile-link {
    border: 0;
    background: transparent;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 0;
    cursor: default;
}

.topbar-profile-avatar-button {
    border: 0;
    background: transparent;
    padding: 0;
    margin: 0;
    cursor: pointer;
    display: inline-flex;
}

.topbar-profile-avatar {
    width: 36px;
    height: 36px;
    border-radius: 999px;
    background: #d97706;
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.32);
    flex-shrink: 0;
    box-shadow: 0 2px 4px rgba(15, 23, 42, 0.12);
}

.topbar-profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.topbar-profile-avatar .material-symbols-rounded {
    font-size: 1.35rem;
}

.topbar-user-chip {
    padding: 6px 16px;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(217, 119, 6, 0.2);
    white-space: nowrap;
}

.lang-switch {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px;
    border-radius: 999px;
    background: #f1f5f9;
}

.lang-item {
    border: 0;
    background: transparent;
    padding: 6px 12px;
    border-radius: 999px;
    color: #475569;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    cursor: pointer;
}

.lang-item.active {
    background: linear-gradient(120deg, #f59e0b, #f97316);
    color: #ffffff;
}

.icon-pill {
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 999px;
    background: #f59e0b;
    color: #ffffff;
    display: grid;
    place-items: center;
    position: relative;
    cursor: pointer;
}

.icon-pill .material-symbols-rounded {
    font-size: 1rem;
}

.notif-badge {
    position: absolute;
    right: -5px;
    top: -5px;
    min-width: 14px;
    height: 14px;
    border-radius: 999px;
    background: #ef4444;
    color: #ffffff;
    font-size: 0.62rem;
    font-weight: 900;
    display: grid;
    place-items: center;
    border: 1px solid #ffffff;
}

.chat-fab {
    position: fixed;
    right: 24px;
    bottom: 56px;
    width: 58px;
    height: 58px;
    border: 0;
    border-radius: 999px;
    background: #d97706;
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 24px rgba(217, 119, 6, 0.35);
    cursor: pointer;
    z-index: 999;
    transition: transform 0.2s ease, background-color 0.2s ease;
}

.chat-fab:hover {
    transform: scale(1.08);
    background: #b45309;
}

.chat-fab .material-symbols-rounded {
    font-size: 1.7rem;
}

.chat-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 20px;
    height: 20px;
    border-radius: 999px;
    background: #ef4444;
    color: #ffffff;
    font-size: 0.68rem;
    font-weight: 900;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
    border: 2px solid #ffffff;
}

.profile-chip {
    background: var(--accent);
    border: 1px solid var(--accent);
    border-radius: 6px;
    padding: 6px 12px;
    display: grid;
    gap: 2px;
    color: #ffffff;
    text-transform: uppercase;
    font-weight: 800;
}

.profile-chip span {
    font-size: 0.68rem;
    color: rgba(255, 255, 255, 0.82);
}

.profile-chip strong {
    font-size: 0.75rem;
    letter-spacing: 0.5px;
}

.logout-link {
    border: 0;
    background: transparent;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 0.72rem;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
}

.logout-link .material-symbols-rounded {
    font-size: 1rem;
}

.page-body {
    background: transparent;
    border: 0;
    box-shadow: none;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
    padding: 12px 18px 14px;
    padding-bottom: 64px;
    flex: 1 1 auto;
    align-content: start;
}


.v-header-card,
.panel,
.auth-card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: var(--shadow);
}

.v-header-card {
    overflow: hidden;
    /* overflow: hidden clips the h2 title on mobile – allow it */
}

.v-header-banner {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 18px 20px 16px;
    background: #ffffff;
    border-left: 5px solid var(--accent);
    border-radius: 0 12px 12px 0;
}

.v-header-banner > div:first-child {
    display: grid;
    gap: 3px;
    min-width: 0;
    overflow: hidden;
}

.v-header-banner h2 {
    margin: 0;
    color: #1e293b;
    font-family: "Roboto", sans-serif;
    font-size: 2.8rem;
    font-weight: 900;
    letter-spacing: -1.5px;
    line-height: 1.1;
    word-break: break-word;
    overflow-wrap: break-word;
    min-width: 0;
}

.v-header-banner .secondary-action,
.v-header-banner .primary-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 10px 18px;
    border-radius: 999px;
    border: 0;
    font-weight: 800;
    letter-spacing: 0.02em;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.14);
}

.v-header-banner .secondary-action {
    background: linear-gradient(120deg, #2563eb, #1d4ed8);
    color: #ffffff;
}

.v-header-banner .secondary-action::before {
    content: "refresh";
    font-family: "Material Symbols Rounded";
    font-size: 1.05rem;
    line-height: 1;
    font-variation-settings: 'FILL' 1, 'wght' 600, 'GRAD' 0, 'opsz' 24;
}

.v-header-banner .primary-action {
    background: linear-gradient(120deg, #f59e0b, #ea580c);
    color: #ffffff;
}

.v-header-banner .primary-action::before {
    content: "bolt";
    font-family: "Material Symbols Rounded";
    font-size: 1.05rem;
    line-height: 1;
    font-variation-settings: 'FILL' 1, 'wght' 600, 'GRAD' 0, 'opsz' 24;
}

.v-header-banner .secondary-action:hover,
.v-header-banner .primary-action:hover {
    filter: brightness(0.96);
    transform: translateY(-1px);
    color: #ffffff;
}

.v-header-banner .secondary-action:disabled,
.v-header-banner .primary-action:disabled {
    background: #64748b;
    color: #ffffff;
    border: 1px solid #475569;
    box-shadow: none;
    transform: none;
    filter: none;
}

.v-header-banner .secondary-action:disabled::before,
.v-header-banner .primary-action:disabled::before {
    color: #ffffff;
}

.v-title-row {
    display: flex;
    align-items: center;
    gap: 14px;
}

.v-title-icon {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    background: var(--accent);
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    box-shadow: 0 8px 18px rgba(217, 119, 6, 0.25);
    flex-shrink: 0;
}

.report-hero h2 {
    font-size: 2.8rem;
    letter-spacing: -1.5px;
}

.eyebrow,
.muted,
.kpi-sub,
.brand-subtitle,
.muted-text {
    color: var(--muted);
}

.muted {
    margin-top: 12px;
    font-size: 1.05rem;
    font-weight: 400;
    line-height: 1.6;
}

.eyebrow {
    margin: 0 0 4px;
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(210px, 45%), 1fr));
    gap: 14px;
}

.kpi-card {
    position: relative;
    overflow: hidden;
    padding: 18px;
    border: 0;
    border-radius: 12px;
    color: #ffffff;
    transition: all 0.2s ease-in-out;
}

.kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.kpi-card::after {
    content: "";
    position: absolute;
    right: -18px;
    top: -18px;
    width: 84px;
    height: 84px;
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-radius: 18px;
    transform: rotate(-12deg);
}

.kpi-label {
    color: rgba(255, 255, 255, 0.92);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.kpi-val {
    margin-top: 6px;
    color: #ffffff;
    font-size: 1.8rem;
    font-weight: 900;
}

.kpi-indigo { background: linear-gradient(120deg, #2563eb, #4f46e5); }
.kpi-blue { background: linear-gradient(120deg, #0ea5e9, #3b82f6); }
.kpi-green { background: linear-gradient(120deg, #10b981, #14b8a6); }
.kpi-emerald { background: linear-gradient(120deg, #10b981, #059669); }
.kpi-purple { background: linear-gradient(120deg, #8b5cf6, #6366f1); }
.kpi-orange { background: linear-gradient(120deg, #f59e0b, #f97316); }
.kpi-red { background: linear-gradient(120deg, #ef4444, #dc2626); }

.kpi-card .kpi-sub {
    color: rgba(255, 255, 255, 0.86);
}

.panel {
    padding: 16px;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
}

.panel h3 {
    margin-top: 0;
    color: #1e293b;
    font-weight: 800;
}

.panel-grid {
    display: grid;
    gap: 14px;
}

.panel-grid.two-columns {
    grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr));
}

.profile-layout {
    display: grid;
    grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}

.profile-summary-panel,
.profile-form-panel {
    padding: 16px 18px;
}

.profile-summary-content {
    display: grid;
    justify-items: center;
    gap: 18px;
    text-align: center;
}

.profile-page-avatar-wrap {
    position: relative;
}

.profile-page-avatar {
    width: 150px;
    height: 150px;
    border-radius: 999px;
    overflow: hidden;
    background: #f1f5f9;
    display: grid;
    place-items: center;
    box-shadow: 0 4px 10px rgba(15, 23, 42, 0.1);
    border: 4px solid #ffffff;
}

.profile-upload-btn {
    position: absolute;
    right: 6px;
    bottom: 6px;
    width: 38px;
    height: 38px;
    border-radius: 999px;
    background: #d97706;
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: 3px solid #ffffff;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.28);
}

.profile-upload-btn .material-symbols-rounded {
    font-size: 1.2rem;
}

.profile-page-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-page-avatar .material-symbols-rounded {
    font-size: 4.8rem;
    color: #cbd5e1;
}

.profile-summary-name {
    display: grid;
    gap: 6px;
}

.profile-summary-name h3 {
    margin: 0;
    font-size: 1.05rem;
}

.profile-summary-name p {
    margin: 0;
    color: #64748b;
    font-weight: 600;
}

.profile-role-block {
    display: grid;
    gap: 6px;
    justify-items: center;
}

.profile-role-block span {
    color: #64748b;
    font-size: 0.8rem;
}

.profile-role-block strong {
    color: #0f172a;
}

.profile-section-title {
    margin: 0 0 18px;
    padding-bottom: 12px;
    border-bottom: 2px solid #f1f5f9;
}

.profile-fields-grid {
    margin-bottom: 14px;
}

.profile-fields-two-col {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.profile-field-wide {
    grid-column: 1 / -1;
}

.profile-message {
    margin: 0 0 12px;
}

.profile-actions {
    justify-content: flex-end;
}

.action-row .secondary-action.profile-change-password-btn {
    background: #ffffff !important;
    color: #dc2626 !important;
    border: 1px solid #dc2626 !important;
    box-shadow: none;
}

.action-row .secondary-action.profile-change-password-btn:hover {
    background: #fef2f2 !important;
    color: #b91c1c !important;
    border-color: #b91c1c !important;
}

.profile-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    z-index: 1200;
    display: grid;
    place-items: center;
    padding: 16px;
}

.profile-modal {
    width: min(520px, 100%);
    background: #ffffff;
    border-radius: 14px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 16px 36px rgba(15, 23, 42, 0.2);
    padding: 18px;
    display: grid;
    gap: 12px;
}

.profile-modal h3 {
    margin: 0;
    font-size: 1.2rem;
}

.profile-modal label {
    display: grid;
    gap: 6px;
}

.profile-modal label span {
    font-size: 0.9rem;
    font-weight: 700;
    color: #334155;
}

.profile-modal input {
    min-height: 38px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 8px 10px;
    font: inherit;
}

.status-active {
    background: #dbeafe;
    color: #2563eb;
}

.status-inactive {
    background: #fee2e2;
    color: #b91c1c;
}

.table-wrap {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    position: relative;
}

.data-table {
    width: 100%;
    min-width: 680px;
    border-collapse: collapse;
    background: #ffffff;
    border-radius: 12px;
}

.data-table th,
.data-table td {
    padding: 10px 8px;
    border-bottom: 1px solid var(--line-soft);
    text-align: left;
    vertical-align: top;
}

.data-table th {
    color: var(--muted);
    font-size: 0.78rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    background-color: #f8fafc;
}

/* Frozen columns support for WMS data grids */
.wms-data-table th.frozen-column,
.wms-data-table td.frozen-column {
    position: sticky;
    right: 0;
    z-index: 5;
    background-color: #ffffff !important; /* Solid background to prevent overlap bleed-through */
    border-left: 1px solid var(--line-soft, #e2e8f0);
}

.wms-data-table th.frozen-column {
    background-color: #f8fafc !important;
    z-index: 10;
}

/* Hover style for table rows */
.wms-data-table tr:hover {
    background-color: #f8fafc !important;
}

.wms-data-table tr:hover td.frozen-column {
    background-color: #f8fafc !important;
}


.chip-row,
.action-row,
.filter-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.action-row .secondary-action {
    border-radius: 999px;
    padding: 8px 16px;
    font-weight: 800;
}

.action-row .secondary-action:nth-child(2n) {
    background: linear-gradient(120deg, #8b5cf6, #6366f1);
    color: #ffffff;
    border-color: transparent;
}

.action-row .secondary-action:nth-child(3n) {
    background: linear-gradient(120deg, #0ea5e9, #2563eb);
    color: #ffffff;
    border-color: transparent;
}

.action-row .secondary-action:nth-child(5n) {
    background: linear-gradient(120deg, #22c55e, #10b981);
    color: #ffffff;
    border-color: transparent;
}

.action-row .secondary-action:hover {
    transform: translateY(-1px);
}

.status-chip {
    border-radius: 999px;
    background: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
    font-size: 0.78rem;
    font-weight: 700;
    padding: 6px 10px;
}

.status-chip-warning {
    background: #ffedd5;
    color: #9a3412;
    border-color: #fed7aa;
}

.status-chip-success {
    background: #dcfce7;
    color: #166534;
    border-color: #bbf7d0;
}

.status-chip-info {
    background: #e0f2fe;
    color: #0369a1;
    border-color: #bae6fd;
}

.status-chip-danger {
    background: #fee2e2;
    color: #991b1b;
    border-color: #fecaca;
}

.status-chip-primary {
    background: #e0e7ff;
    color: #3730a3;
    border-color: #c7d2fe;
}

.selected-row {
    background: rgba(79, 70, 229, 0.06);
}

.detail-stack {
    display: grid;
    gap: 14px;
}

.summary-strip {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid var(--line-soft);
    border-radius: 14px;
    background: #f8fafc;
}

.compact-list {
    margin: 8px 0 0;
    padding-left: 18px;
    color: var(--muted);
}

.inline-stack {
    display: grid;
    gap: 4px;
}

.inner-panel {
    padding: 12px;
    box-shadow: none;
}

.auth-wrap {
    min-height: 70vh;
    display: grid;
    place-items: center;
}

.login-screen {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(240px, 380px) minmax(320px, 1fr);
    align-items: stretch;
    gap: 0;
    padding: 0;
    background:
        radial-gradient(circle at 12% 18%, rgba(245, 158, 11, 0.2), rgba(245, 158, 11, 0) 24%),
        linear-gradient(120deg, #1d2637 0%, #0f1f43 40%, #071738 100%);
}

.login-brand-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1e3a8a, #0f172a);
    color: #fff;
    padding: 48px 36px;
    text-align: center;
}

.login-side-logo {
    width: min(210px, 100%);
    object-fit: contain;
    filter: brightness(0) invert(1);
    margin-bottom: 20px;
}

.login-card {
    width: min(440px, calc(100% - 2rem));
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    padding: 2rem 2.2rem;
    box-shadow: 0 24px 60px rgba(2, 8, 23, 0.18);
    display: grid;
    gap: 1rem;
    justify-self: center;
    align-self: center;
}

/* Card panel wrapping div gets a light background */
.login-screen > div {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f1f5f9;
    padding: 32px 24px;
}

.login-card-logo {
    width: min(270px, 100%);
    margin: 0 auto;
    object-fit: contain;
}

.login-card-subtitle {
    margin: 0;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.24em;
    font-size: 0.68rem;
    font-weight: 800;
    color: #64748b;
}

.login-lang-switch {
    margin: 0.25rem auto 0.5rem;
    background: #e2e8f0;
    border-radius: 999px;
    display: inline-flex;
    padding: 4px;
    gap: 4px;
}

.login-lang-item {
    border: 0;
    background: transparent;
    border-radius: 999px;
    padding: 6px 16px;
    font-size: 0.78rem;
    font-weight: 900;
    color: #475569;
    cursor: pointer;
}

.login-lang-item.active {
    background: linear-gradient(120deg, #f59e0b, #f97316);
    color: #ffffff;
}

.login-check-inline {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #475569;
    font-weight: 600;
}

.login-check-inline input {
    width: auto;
}

.login-submit {
    border: 0;
    border-radius: 999px;
    padding: 11px 16px;
    font: inherit;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #ffffff;
    background: linear-gradient(120deg, #f59e0b, #ea580c);
    cursor: pointer;
}

.login-submit:hover {
    filter: brightness(0.95);
}

.auth-card {
    width: min(420px, 100%);
    padding: 24px;
    display: grid;
    gap: 12px;
    border-radius: 16px;
}

.auth-logo {
    width: min(280px, 100%);
    height: 72px;
    object-fit: contain;
    margin: 0 auto 4px;
    background: transparent;
}

label {
    display: grid;
    gap: 6px;
    font-weight: 600;
}

input,
select,
textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    font: inherit;
}

textarea {
    resize: vertical;
}

.search-input {
    max-width: 260px;
}

.form-grid {
    display: grid;
    gap: 12px;
}

.compact-grid {
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.primary-action,
.secondary-action {
    border: none;
    border-radius: 999px;
    padding: 10px 16px;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.primary-action {
    background: var(--accent);
    color: #ffffff;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.primary-action:hover {
    background: var(--accent-strong);
}

.secondary-action {
    background: #ffffff;
    color: #475569;
    border: 1px solid var(--line);
}

.secondary-action:hover {
    background: #cbd5e1;
    color: #1e293b;
    border-color: #94a3b8;
}

button:disabled,
.primary-action:disabled,
.secondary-action:disabled,
.login-submit:disabled {
    opacity: 1;
    cursor: not-allowed;
}

.error-text {
    color: var(--danger);
    font-weight: 600;
}

.success-text {
    color: var(--success);
    font-weight: 600;
}

.check-inline {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
}

.check-inline input {
    width: auto;
}

.mt-12 {
    margin-top: 12px;
}

.wms-footer strong {
    color: var(--accent-strong);
}

.panel canvas,
.panel svg {
    background: #ffffff;
    border-radius: 12px;
}

.panel .table-wrap,
.panel .summary-strip {
    background: #ffffff;
    border-radius: 12px;
}

@media (max-width: 980px) {
    .wms-layout {
        grid-template-rows: auto auto minmax(0, 1fr);
    }

    .wms-shell {
        grid-template-columns: 1fr;
        min-height: 0;
    }

    .wms-shell.sidebar-collapsed,
    .wms-shell.sidebar-open {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: fixed;
        left: 0;
        top: 60px;
        width: min(280px, calc(100vw - 40px));
        height: calc(100vh - 60px);
        border-right: 0;
        border-bottom: 0;
        border-radius: 0 16px 16px 0;
        box-shadow: 4px 0 30px rgba(15, 23, 42, 0.22);
        transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.25s ease;
        overflow-y: auto;
        z-index: 1100;
    }

    .sidebar.is-open {
        transform: translateX(0);
        opacity: 1;
        pointer-events: auto;
    }

    .sidebar.is-closed {
        transform: translateX(-110%);
        opacity: 0;
        pointer-events: none;
    }

    /* Better menu section labels on mobile */
    .menu-section {
        padding: 10px 12px 8px;
        font-size: 0.68rem;
    }

    /* Larger touch targets for nav links */
    .menu a.nav-link {
        padding: 11px 10px 11px 14px !important;
        font-size: 0.9rem !important;
        margin: 2px 0 2px 8px !important;
    }

    .menu a.nav-link .menu-icon {
        font-size: 1.05rem !important;
    }

    .menu {
        max-height: none;
        padding-bottom: 24px;
    }

    .menu-items.expanded {
        max-height: 2000px;
    }

    .topbar {
        padding: 10px 14px;
    }

    .topbar-title {
        display: none;
    }

    .topbar-actions {
        gap: 8px;
    }

    .topbar-profile-link {
        gap: 8px;
    }

    .chat-fab {
        right: 16px;
        bottom: 52px;
        width: 54px;
        height: 54px;
        z-index: 999;
    }

    .topbar-actions .topbar-user-chip,
    .topbar-actions .profile-chip {
        display: none !important;
    }

    .topbar-actions .logout-link span:last-child {
        display: none !important;
    }

    .topbar-logo {
        width: 160px;
    }

    .page-body {
        padding: 14px;
        padding-bottom: 64px;
    }

    .v-header-banner {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        padding: 14px 16px;
    }

    .profile-layout {
        grid-template-columns: 1fr;
    }

    .profile-fields-two-col {
        grid-template-columns: 1fr;
    }

    .login-screen {
        grid-template-columns: 1fr !important;
        gap: 0 !important;
        padding: 0 !important;
        overflow-y: auto !important;
        height: 100vh !important;
    }

    .login-brand-panel {
        justify-self: center;
        padding-top: 0;
        flex: none !important;
        width: 100% !important;
        min-height: 220px;
        padding: 32px 24px !important;
        align-self: stretch !important;
    }

    .login-side-logo {
        width: 140px;
        margin-bottom: 12px;
    }

    .login-card {
        width: min(460px, 100%) !important;
        max-width: 100% !important;
        padding: 1.6rem 1.25rem;
        border-radius: 20px 20px 0 0;
        margin: 0 auto;
        box-shadow: 0 -4px 24px rgba(2,8,23,0.14);
    }
}

/* Datagrid Actions & Circular Action Buttons */
.datagrid-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: nowrap;
}

.btn-circle-action {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 32px !important;
    height: 32px !important;
    min-width: 32px !important;
    min-height: 32px !important;
    max-width: 32px !important;
    max-height: 32px !important;
    border-radius: 50% !important;
    border: none !important;
    background: #3b82f6 !important; /* solid blue background */
    color: #ffffff !important; /* high contrast white icon */
    padding: 0 !important;
    margin: 0 !important;
    cursor: pointer !important;
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.3) !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.btn-circle-action:hover {
    background: #1d4ed8 !important; /* darker blue */
    transform: scale(1.1) !important;
    box-shadow: 0 4px 8px rgba(59, 130, 246, 0.4) !important;
    color: #ffffff !important;
}

.btn-circle-action.btn-activate {
    background: #10b981 !important; /* solid green background */
    box-shadow: 0 2px 4px rgba(16, 185, 129, 0.3) !important;
}

.btn-circle-action.btn-activate:hover {
    background: #047857 !important; /* darker green */
    box-shadow: 0 4px 8px rgba(16, 185, 129, 0.4) !important;
    color: #ffffff !important;
}

.btn-circle-action.btn-deactivate {
    background: #ef4444 !important; /* solid red background */
    box-shadow: 0 2px 4px rgba(239, 68, 68, 0.3) !important;
}

.btn-circle-action.btn-deactivate:hover {
    background: #b91c1c !important; /* darker red */
    box-shadow: 0 4px 8px rgba(239, 68, 68, 0.4) !important;
    color: #ffffff !important;
}

.btn-circle-action.btn-delete {
    background: #ef4444 !important; /* solid red background */
    box-shadow: 0 2px 4px rgba(239, 68, 68, 0.3) !important;
}

.btn-circle-action.btn-delete:hover {
    background: #b91c1c !important; /* darker red */
    box-shadow: 0 4px 8px rgba(239, 68, 68, 0.4) !important;
    color: #ffffff !important;
}

.btn-circle-action.btn-distribution {
    background: #8b5cf6 !important; /* solid purple background */
    box-shadow: 0 2px 4px rgba(139, 92, 246, 0.3) !important;
}

.btn-circle-action.btn-distribution:hover {
    background: #6d28d9 !important; /* darker purple */
    box-shadow: 0 4px 8px rgba(139, 92, 246, 0.4) !important;
    color: #ffffff !important;
}

.btn-circle-action .material-symbols-rounded {
    font-size: 1.15rem !important;
    line-height: 1 !important;
}

/* Global pill shape style to all text boxes, dropdowns, and text fields */
.mud-input-outlined-border {
    border-radius: 999px !important;
}

.mud-input-outlined {
    border-radius: 999px !important;
}

/* Make all buttons globally pill-shaped */
.mud-button-root {
    border-radius: 999px !important;
}

.mud-input-outlined .mud-input-slot {
    padding-left: 20px !important;
    padding-right: 20px !important;
}

.mud-input-outlined .mud-select-input {
    padding-left: 20px !important;
    padding-right: 20px !important;
}

/* Standard input elements */
input[type="text"],
input[type="password"],
input[type="number"],
input[type="email"],
input[type="tel"],
select,
textarea {
    border-radius: 20px !important;
}

input[type="text"],
input[type="password"],
input[type="number"],
input[type="email"],
input[type="tel"],
select {
    border-radius: 999px !important;
    padding-left: 20px !important;
    padding-right: 20px !important;
}

/* 2D Map Designer Revamp Styles */
.map-workspace {
    position: relative;
    width: 100%;
    height: calc(100vh - 280px);
    min-height: 480px;
    background: #0f172a; /* Premium dark blueprint canvas area */
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid #1e293b;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.4);
}

.map-canvas-container {
    width: 100%;
    height: 100%;
    overflow: hidden;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: grab;
}

.map-canvas-container:active {
    cursor: grabbing;
}

.designer-toolbar {
    position: absolute;
    z-index: 1050;
    background: rgba(15, 23, 42, 0.75); /* Dark translucent glassmorphic look */
    backdrop-filter: blur(12px) saturate(180%);
    -webkit-backdrop-filter: blur(12px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
    padding: 6px 10px;
    display: flex;
    align-items: center;
    gap: 6px;
    user-select: none;
}

.designer-toolbar-handle {
    cursor: move;
    color: #64748b;
    display: flex;
    align-items: center;
    padding-right: 6px;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    margin-right: 4px;
}

.designer-toolbar-btn {
    border-radius: 8px !important;
    color: #94a3b8 !important;
    transition: all 0.2s !important;
}

.designer-toolbar-btn:hover {
    color: #f8fafc !important;
    background-color: rgba(255, 255, 255, 0.08) !important;
}

.designer-toolbar-btn.active {
    color: #38bdf8 !important; /* Sky blue active accent */
    background-color: rgba(56, 189, 248, 0.15) !important;
}

.designer-zoom-badge {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #38bdf8;
    font-weight: 700;
    font-size: 0.78rem;
    padding: 4px 8px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.designer-zoom-badge:hover {
    background: rgba(56, 189, 248, 0.15);
    border-color: #38bdf8;
}

.designer-navigator-hud {
    position: absolute;
    bottom: 20px;
    left: 20px;
    z-index: 1030;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
    padding: 4px 8px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.designer-layers-panel {
    position: absolute;
    right: 20px;
    top: 20px;
    bottom: 20px;
    width: 320px;
    z-index: 1040;
    background: rgba(15, 23, 42, 0.85); /* Dark translucent overlay */
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    box-shadow: -10px 10px 40px rgba(0, 0, 0, 0.4);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s;
}

.designer-layers-panel.collapsed {
    transform: translateX(350px);
    opacity: 0;
    pointer-events: none;
}

.designer-layers-header {
    padding: 10px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 700;
    color: #f8fafc;
}

.designer-tab-btn {
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 0.8rem;
    font-weight: 700;
    padding: 6px 10px;
    border-radius: 8px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
}

.designer-tab-btn:hover {
    color: #f8fafc;
    background: rgba(255, 255, 255, 0.06);
}

.designer-tab-btn.active {
    color: #38bdf8;
    background: rgba(56, 189, 248, 0.12);
    border: 1px solid rgba(56, 189, 248, 0.25);
}

.preset-badge-btn {
    background: rgba(30, 41, 59, 0.8);
    color: #cbd5e1;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 4px 8px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    transition: all 0.15s ease;
}

.preset-badge-btn:hover {
    background: #334155;
    color: #38bdf8;
    border-color: #38bdf8;
}

.designer-layers-content {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
}

.designer-layers-toggle-btn {
    position: absolute;
    right: 20px;
    top: 20px;
    z-index: 1045;
    background: rgba(15, 23, 42, 0.85) !important;
    backdrop-filter: blur(8px) !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: #f8fafc !important;
}

.blueprint-grid-rect {
    fill: url(#blueprint-grid);
}

.canvas-blueprint {
    background-color: #0f172a;
    transition: background-image 0.3s;
}

.map-workspace.maximized {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 9999 !important;
    border-radius: 0 !important;
    border: none !important;
}

.quick-actions-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    width: 100%;
}

@media (max-width: 1200px) {
    .quick-actions-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .quick-actions-grid {
        grid-template-columns: 1fr;
    }
}

.qa-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 10px !important;
    border-radius: 999px !important;
    padding: 13px 20px !important;
    font-size: 14px !important;
    font-weight: 800 !important;
    color: #ffffff !important;
    border: none !important;
    cursor: pointer !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08) !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
    text-decoration: none !important;
    white-space: nowrap !important;
    min-height: 48px !important;
    width: 100% !important;
}

.qa-btn:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.15) !important;
    filter: brightness(1.06) !important;
}

.qa-btn .material-symbols-rounded {
    font-size: 20px !important;
    color: #ffffff !important;
}

.qa-btn-amber {
    background: linear-gradient(135deg, #f59e0b, #ea580c) !important;
}

.qa-btn-emerald {
    background: linear-gradient(135deg, #059669, #10b981) !important;
}

.qa-btn-indigo {
    background: linear-gradient(135deg, #4f46e5, #6366f1) !important;
}

.qa-btn-teal {
    background: linear-gradient(135deg, #0d9488, #14b8a6) !important;
}

.qa-btn-rose {
    background: linear-gradient(135deg, #e11d48, #f43f5e) !important;
}

.qa-btn-blue {
    background: linear-gradient(135deg, #2563eb, #3b82f6) !important;
}

.qa-btn-purple {
    background: linear-gradient(135deg, #7c3aed, #8b5cf6) !important;
}

/* Custom colorful buttons for quick actions */
.quick-actions-grid .primary-action {
    text-transform: none !important;
    letter-spacing: normal !important;
}

.quick-actions-grid button {
    gap: 8px;
    font-size: 0.95rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: none !important;
    color: #ffffff !important;
}

.quick-actions-grid button:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15) !important;
}

.quick-actions-grid button .material-symbols-rounded {
    font-size: 20px;
}

.btn-task-exec {
    background: linear-gradient(135deg, #059669, #10b981) !important; /* Emerald */
}
.btn-receiving {
    background: linear-gradient(135deg, #4f46e5, #6366f1) !important; /* Indigo */
}
.btn-put-away {
    background: linear-gradient(135deg, #7c3aed, #8b5cf6) !important; /* Violet */
}
.btn-cycle-count {
    background: linear-gradient(135deg, #db2777, #ec4899) !important; /* Pink */
}
.btn-picking {
    background: linear-gradient(135deg, #ea580c, #f97316) !important; /* Orange */
}
.btn-packing {
    background: linear-gradient(135deg, #0891b2, #0ea5e9) !important; /* Cyan */
}
.btn-shipping {
    background: linear-gradient(135deg, #dc2626, #ef4444) !important; /* Red */
}
.btn-reports {
    background: linear-gradient(135deg, #0d9488, #14b8a6) !important; /* Teal */
}
.btn-transfer {
    background: linear-gradient(135deg, #6366f1, #818cf8) !important; /* Indigo-light */
}
.btn-replenishment {
    background: linear-gradient(135deg, #10b981, #34d399) !important; /* Green-light */
}
.btn-reverse {
    background: linear-gradient(135deg, #e11d48, #f43f5e) !important; /* Rose */
}
.btn-tasks-db {
    background: linear-gradient(135deg, #2563eb, #3b82f6) !important; /* Blue */
}
.btn-items-db {
    background: linear-gradient(135deg, #d97706, #f59e0b) !important; /* Amber */
}
.btn-sopo {
    background: linear-gradient(135deg, #65a30d, #84cc16) !important; /* Lime */
}
.btn-qa {
    background: linear-gradient(135deg, #0284c7, #06b6d4) !important; /* Sky/Cyan */
}
.btn-lot {
    background: linear-gradient(135deg, #9333ea, #a855f7) !important; /* Purple */
}

/* RadzenDataGrid Responsive Layout & Scrollbar Overrides */
.rz-datagrid {
    width: 100% !important;
}

.rz-grid-table-wrap {
    overflow-x: auto !important;
}

.rz-grid-table {
    width: 100% !important;
    table-layout: auto !important;
}

.rz-grid-table th, 
.rz-grid-table td {
    white-space: nowrap !important;
}

/* Freeze Action / Last Column of all Datagrids on the Right */
.rz-grid-table th:last-child,
.rz-grid-table td:last-child {
    position: sticky !important;
    right: 0 !important;
    left: auto !important; /* Override Radzen's inline left style for frozen columns */
    z-index: 3 !important;
    box-shadow: -4px 0 8px -3px rgba(0, 0, 0, 0.15) !important;
}

/* Header Cell Background */
.rz-grid-table th:last-child {
    background-color: #fafafa !important;
}

/* Body Cell Background (Odd rows) */
.rz-grid-table td:last-child {
    background-color: #ffffff !important;
}

/* Ensure alternate rows keep their correct background color when sticky (Even rows) */
.rz-grid-table tr:nth-child(even) td:last-child {
    background-color: #fafafa !important;
}

/* Ensure selected rows and hovered rows keep their correct background color when sticky */
.rz-grid-table tr.rz-state-highlight td:last-child,
.rz-grid-table tr:hover td:last-child {
    background-color: #f1f5f9 !important;
}

/* Responsive Form Rows & Header Actions Utility Classes */
.responsive-flex-row {
    display: flex;
    gap: 16px;
}

.header-actions-responsive {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.dialog-image-upload-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-right: 1px solid #e2e8f0;
    padding-right: 24px;
}

.dialog-form-fields-section {
    padding-left: 24px;
}

@media (max-width: 959px) {
    .dialog-image-upload-section {
        border-right: 0 !important;
        border-bottom: 1px solid #e2e8f0;
        padding-right: 0 !important;
        padding-bottom: 24px;
        margin-bottom: 16px;
    }
    .dialog-form-fields-section {
        padding-left: 0 !important;
    }
}

@media (max-width: 600px) {
    .responsive-flex-row {
        flex-direction: column !important;
        gap: 12px !important;
    }
    
    .header-actions-responsive {
        width: 100%;
        justify-content: stretch;
        gap: 6px;
    }
    
    .header-actions-responsive .mud-button {
        flex: 1;
        min-width: 80px;
        font-size: 0.8rem !important;
        padding: 6px 10px !important;
    }
    
    .v-header-banner h2 {
        font-size: 1.8rem !important;
        letter-spacing: -0.5px !important;
    }

    /* Mobile-optimized topbar spacing and sizing */
    .topbar {
        padding: 0 8px !important;
        gap: 8px !important;
    }
    .topbar-branding {
        gap: 8px !important;
    }
    .topbar-logo {
        width: 130px !important;
    }
    .topbar-actions {
        gap: 6px !important;
    }
    .lang-switch {
        gap: 2px !important;
        padding: 2px !important;
    }
    .lang-item {
        padding: 4px 8px !important;
        font-size: 0.65rem !important;
    }
    .icon-pill {
        width: 30px !important;
        height: 30px !important;
    }
    .topbar-profile-avatar {
        width: 30px !important;
        height: 30px !important;
    }
    .logout-link {
        gap: 2px !important;
    }
    
    /* Hide button text on mobile in the v-header-banner and filter-row */
    .v-header-banner .secondary-action span,
    .v-header-banner .primary-action span,
    .filter-row .mud-button span {
        display: none !important;
    }
    .v-header-banner .secondary-action,
    .v-header-banner .primary-action,
    .filter-row .mud-button {
        min-width: 38px !important;
        padding: 0 10px !important;
    }


    /* Grid header actions: wrap & turn into icon-only buttons on mobile */
    .wms-grid-header {
        padding: 12px 14px !important;
    }
    .grid-header-right {
        width: 100% !important;
        justify-content: space-between !important;
        gap: 8px !important;
    }
    .grid-actions {
        flex-wrap: wrap !important;
        gap: 6px !important;
        width: 100% !important;
        justify-content: flex-end !important;
    }
    .grid-actions .rz-button {
        padding: 0 10px !important;
        min-width: 36px !important;
        height: 36px !important;
    }
    .grid-actions .rz-button-text {
        display: none !important;
    }
}

@media (max-width: 480px) {
    .kpi-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
    }
    
    .kpi-card {
        padding: 12px !important;
    }
    
    .kpi-val {
        font-size: 1.4rem !important;
    }
    
    .kpi-label {
        font-size: 0.65rem !important;
    }
    
    .panel-grid.two-columns {
        grid-template-columns: 1fr !important;
    }
}

/* Custom styling for Radzen Dropdown/MultiSelect Popup Panels to prevent transparency and ensure high-end aesthetics */
.rz-dropdown-panel,
.rz-multiselect-panel {
    background-color: #ffffff !important;
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 8px !important;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1) !important;
    z-index: 9999 !important;
}

.rz-dropdown-items-wrapper,
.rz-multiselect-items-wrapper {
    background-color: #ffffff !important;
    background: #ffffff !important;
}

.rz-dropdown-header,
.rz-multiselect-header {
    background-color: #f8fafc !important;
    background: #f8fafc !important;
    border-bottom: 1px solid #e2e8f0 !important;
    padding: 8px 12px !important;
    white-space: nowrap !important;
}

.rz-dropdown-header *,
.rz-multiselect-header * {
    white-space: nowrap !important;
}

.rz-dropdown-item,
.rz-multiselect-item {
    background-color: #ffffff !important;
    background: #ffffff !important;
    color: #1e293b !important;
    padding: 8px 12px !important;
    transition: background-color 0.15s ease;
    white-space: nowrap !important;
}

.rz-dropdown-item:hover,
.rz-multiselect-item:hover {
    background-color: #f1f5f9 !important;
    background: #f1f5f9 !important;
    color: #0f172a !important;
}

.rz-dropdown-item.rz-state-highlight,
.rz-multiselect-item.rz-state-highlight {
    background-color: #e2e8f0 !important;
    background: #e2e8f0 !important;
    color: #0f172a !important;
}

/* Sizing overrides for Radzen dropdown/multiselect filter cells to look elegant in narrow columns */
.rz-cell-filter-content .rz-dropdown,
.rz-cell-filter-content .rz-multiselect {
    height: 38px !important;
    font-size: 0.8rem !important;
    border-radius: 999px !important;
    display: inline-flex !important;
    align-items: center !important;
}

.rz-cell-filter-content .rz-dropdown-trigger,
.rz-cell-filter-content .rz-multiselect-trigger {
    width: 28px !important;
    height: 36px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.rz-cell-filter-content .rz-dropdown-label,
.rz-cell-filter-content .rz-multiselect-label {
    padding: 0 10px 0 12px !important;
    line-height: 36px !important;
    height: 36px !important;
    font-size: 0.8rem !important;
    display: inline-flex !important;
    align-items: center !important;
}

/* Ensure WMS Grid Container never causes horizontal page scroll */
.wms-grid-container {
    max-width: 100% !important;
    min-width: 0 !important;
    overflow: hidden !important;
}

/* Ensure the inner Radzen DataGrid wrapper handles horizontal scrolling internally */
.wms-grid-container .rz-datagrid {
    max-width: 100% !important;
    width: 100% !important;
}

.wms-grid-container .rz-data-grid-box {
    max-width: 100% !important;
    overflow-x: auto !important;
}

.wms-grid-container .rz-grid-table-wrapper,
.wms-grid-container .rz-datagrid-scrollable-wrapper,
.wms-grid-container .rz-datagrid-scrollable-body {
    max-width: 100% !important;
    overflow-x: auto !important;
}

/* Responsive Stacking & Grid Alignment for Header Banners on Mobile/Tablet */
@media (max-width: 768px) {
    .v-header-banner {
        display: grid !important;
        grid-template-columns: auto 1fr !important;
        align-items: center !important;
        gap: 12px 14px !important;
        padding: 14px 16px !important;
    }
    
    .v-header-banner .v-header-icon-wrap {
        width: 44px !important;
        height: 44px !important;
        border-radius: 10px !important;
        grid-column: 1 !important;
        grid-row: 1 !important;
        flex-shrink: 0 !important;
    }
    
    .v-header-banner .v-header-content,
    .v-header-banner > div:first-child:not(.v-header-icon-wrap) {
        grid-column: 2 !important;
        grid-row: 1 !important;
        min-width: 0 !important;
        width: 100% !important;
        text-align: left !important;
    }

    .v-header-banner h2,
    .v-header-content .rz-text-h4,
    .v-header-content h4 {
        font-size: 1.25rem !important;
        line-height: 1.25 !important;
        word-break: break-word !important;
    }
    
    /* Optimize filter-row and actions placement on mobile screens */
    .v-header-actions {
        grid-column: 1 / -1 !important;
        grid-row: 2 !important;
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: wrap !important;
        align-items: center !important;
        gap: 8px !important;
        width: 100% !important;
        margin-top: 4px !important;
    }

    .v-header-actions .rz-button,
    .v-header-actions .v-btn-pill {
        flex: 0 0 auto !important;
        min-height: 36px !important;
    }
    
    .v-header-banner .filter-row {
        grid-column: 1 / -1 !important;
        grid-row: 2 !important;
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: wrap !important;
        align-items: center !important;
        gap: 8px !important;
        width: 100% !important;
        margin-top: 4px !important;
    }
}


