/* WE Container command-center theme for all pages that inherit core/base.html. */
body:not(.we-dashboard) {
    --we-ink: #092f3b;
    --we-muted: #6b7d82;
    --we-line: #dce6e7;
    --we-paper: #f4f7f6;
    --we-card: #ffffff;
    --we-navy: #061d27;
    --we-navy-2: #0a2a34;
    --we-cyan: #20c9d8;
    --we-lime: #bce94b;
    --we-green: #159c79;
    --we-amber: #ffbe46;
    --we-coral: #ff6c62;
    --we-shadow: 0 18px 48px rgba(7, 36, 45, .08);
    min-width: 320px;
    color: var(--we-ink);
    background:
        radial-gradient(circle at 88% 0, rgba(32, 201, 216, .08), transparent 24rem),
        var(--we-paper);
    font-family: Inter, "Segoe UI", Tahoma, Arial, sans-serif;
}

body:not(.we-dashboard).dsc-dark {
    --we-ink: #eaf7f8;
    --we-muted: #91a9ad;
    --we-line: #27434a;
    --we-paper: #07171d;
    --we-card: #0c242c;
    --we-shadow: 0 20px 60px rgba(0, 0, 0, .24);
}

body:not(.we-dashboard) > .container-fluid {
    max-width: 1680px;
    padding-inline: clamp(16px, 2.4vw, 40px);
}

body:not(.we-dashboard) .main-content {
    padding: 34px 0 64px;
}

/* Header and product identity */
body:not(.we-dashboard) > .navbar {
    position: sticky;
    top: 0;
    z-index: 1030;
    min-height: 76px;
    padding: 10px clamp(12px, 2vw, 30px) !important;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
    background:
        radial-gradient(circle at 72% -120%, rgba(32, 201, 216, .34), transparent 42%),
        linear-gradient(110deg, var(--we-navy), #073440) !important;
    box-shadow: 0 14px 32px rgba(3, 31, 40, .16);
}

body:not(.we-dashboard) > .navbar .container-fluid {
    gap: 20px;
    padding: 0;
}

body:not(.we-dashboard) .we-app-brand {
    min-width: 190px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0;
    text-decoration: none;
}

body:not(.we-dashboard) .we-app-brand img {
    width: 46px;
    height: 46px;
    object-fit: contain;
    border-radius: 14px;
    background: #082d38;
    border: 1px solid rgba(255, 255, 255, .12);
    box-shadow: 0 10px 28px rgba(0, 93, 255, .22);
}

body:not(.we-dashboard) .we-app-brand-copy {
    display: grid;
    line-height: 1.05;
}

body:not(.we-dashboard) .we-app-brand-copy strong {
    color: #fff !important;
    font-size: .89rem;
    letter-spacing: .055em;
}

body:not(.we-dashboard) .we-app-brand-copy small {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 6px;
    color: #8fb0b6;
    font-size: .58rem;
    font-weight: 800;
    letter-spacing: .15em;
}

body:not(.we-dashboard) .dsc-version-badge {
    margin: 0;
    padding: 3px 6px;
    color: #082c34;
    background: var(--we-lime);
    font-size: .52rem;
}

body:not(.we-dashboard) .nav-pills-custom {
    gap: 4px;
}

body:not(.we-dashboard) .nav-pills-custom .nav-link {
    position: relative;
    padding: 9px 11px;
    border-radius: 11px;
    color: #91adb3 !important;
    font-size: .78rem;
    font-weight: 750;
}

body:not(.we-dashboard) .nav-pills-custom .nav-link:hover {
    color: #fff !important;
    background: rgba(255, 255, 255, .08);
}

body:not(.we-dashboard) .nav-pills-custom .nav-link.active {
    color: #082e37 !important;
    background: var(--we-lime);
    box-shadow: 0 8px 22px rgba(188, 233, 75, .16);
}

body:not(.we-dashboard) .nav-pills-custom .nav-link i {
    color: currentColor;
}

body:not(.we-dashboard) .dsc-search-input {
    width: 172px;
    height: 40px;
    padding-left: 35px;
    border-color: rgba(255, 255, 255, .12);
    border-radius: 12px;
    background: rgba(255, 255, 255, .06);
}

body:not(.we-dashboard) .dsc-search-input:focus {
    width: 230px;
    border-color: var(--we-cyan);
    background: rgba(255, 255, 255, .1);
    box-shadow: 0 0 0 3px rgba(32, 201, 216, .12);
}

body:not(.we-dashboard) #themeToggle,
body:not(.we-dashboard) .dsc-notif-bell {
    min-height: 40px;
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 12px;
    background: rgba(255, 255, 255, .05);
}

/* Reusable page masthead */
body:not(.we-dashboard) .we-page-head {
    min-height: 108px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 22px;
    margin-bottom: 22px;
    padding: 22px 24px;
    overflow: hidden;
    position: relative;
    border: 1px solid rgba(255, 255, 255, .09);
    border-radius: 22px;
    color: #eafafa;
    background:
        radial-gradient(circle at 82% 0, rgba(32, 201, 216, .16), transparent 30%),
        linear-gradient(145deg, #061c25, #092b34 64%, #073440);
    box-shadow: 0 22px 54px rgba(3, 31, 40, .16);
}

body:not(.we-dashboard) .we-page-head::after {
    content: "";
    width: 230px;
    height: 230px;
    position: absolute;
    right: 13%;
    top: -145px;
    border: 1px solid rgba(188, 233, 75, .14);
    border-radius: 50%;
}

body:not(.we-dashboard) .we-page-head > * {
    position: relative;
    z-index: 1;
}

body:not(.we-dashboard) .we-page-kicker {
    display: block;
    margin-bottom: 5px;
    color: #7bdbe1;
    font-size: .67rem;
    font-weight: 850;
    letter-spacing: .16em;
    text-transform: uppercase;
}

body:not(.we-dashboard) .we-page-head h1 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    color: #fff !important;
    font-size: clamp(1.45rem, 2.3vw, 2rem);
    letter-spacing: -.035em;
}

body:not(.we-dashboard) .we-page-head h1 > i {
    color: var(--we-lime);
}

body:not(.we-dashboard) .we-page-head p {
    margin: 6px 0 0;
    color: #91aeb4;
    font-size: .82rem;
}

body:not(.we-dashboard) .we-document-id {
    padding: 5px 9px;
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: 9px;
    color: var(--we-lime);
    background: rgba(255, 255, 255, .05);
    font-size: .75rem;
    letter-spacing: .02em;
}

body:not(.we-dashboard) .we-page-head .btn-outline-secondary {
    color: #dff7f7;
    border-color: rgba(255, 255, 255, .18);
    background: rgba(255, 255, 255, .05);
}

body:not(.we-dashboard) .we-page-head .btn-outline-secondary:hover {
    color: #082e37;
    border-color: var(--we-lime);
    background: var(--we-lime);
}

/* Existing pages keep their markup but receive the same command-center masthead. */
body:not(.we-dashboard) .main-content > .d-flex.justify-content-between.align-items-center:is(.mb-3, .mb-4):not(.we-page-head) {
    min-height: 88px;
    gap: 18px;
    padding: 18px 22px;
    overflow: hidden;
    position: relative;
    border: 1px solid rgba(255, 255, 255, .09);
    border-radius: 20px;
    color: #eafafa;
    background:
        radial-gradient(circle at 82% 0, rgba(32, 201, 216, .14), transparent 30%),
        linear-gradient(145deg, #061c25, #092b34 64%, #073440);
    box-shadow: 0 18px 44px rgba(3, 31, 40, .14);
}

body:not(.we-dashboard) .main-content > .d-flex.justify-content-between.align-items-center:is(.mb-3, .mb-4):not(.we-page-head) h1,
body:not(.we-dashboard) .main-content > .d-flex.justify-content-between.align-items-center:is(.mb-3, .mb-4):not(.we-page-head) h2,
body:not(.we-dashboard) .main-content > .d-flex.justify-content-between.align-items-center:is(.mb-3, .mb-4):not(.we-page-head) h3,
body:not(.we-dashboard) .main-content > .d-flex.justify-content-between.align-items-center:is(.mb-3, .mb-4):not(.we-page-head) h4 {
    color: #fff !important;
    font-size: clamp(1.2rem, 2vw, 1.7rem);
    letter-spacing: -.025em;
}

body:not(.we-dashboard) .main-content > .d-flex.justify-content-between.align-items-center:is(.mb-3, .mb-4):not(.we-page-head) h1 i,
body:not(.we-dashboard) .main-content > .d-flex.justify-content-between.align-items-center:is(.mb-3, .mb-4):not(.we-page-head) h2 i,
body:not(.we-dashboard) .main-content > .d-flex.justify-content-between.align-items-center:is(.mb-3, .mb-4):not(.we-page-head) h3 i,
body:not(.we-dashboard) .main-content > .d-flex.justify-content-between.align-items-center:is(.mb-3, .mb-4):not(.we-page-head) h4 i {
    color: var(--we-lime);
}

body:not(.we-dashboard) .main-content > .d-flex.justify-content-between.align-items-center:is(.mb-3, .mb-4):not(.we-page-head) .btn {
    color: #dff7f7;
    border-color: rgba(255, 255, 255, .18);
    background: rgba(255, 255, 255, .06);
}

body:not(.we-dashboard) .main-content > .d-flex.justify-content-between.align-items-center:is(.mb-3, .mb-4):not(.we-page-head) .btn:hover {
    color: #082e37;
    border-color: var(--we-lime);
    background: var(--we-lime);
}

body:not(.we-dashboard) .we-primary-action {
    color: #082e37;
    border-color: var(--we-lime);
    background: var(--we-lime);
    box-shadow: 0 12px 28px rgba(188, 233, 75, .18);
}

body:not(.we-dashboard) .main-content > :is(h1, h2, h3, h4, h5):first-child {
    margin-bottom: 20px;
    padding-left: 14px;
    border-left: 4px solid var(--we-lime);
    color: var(--we-ink) !important;
    font-weight: 800;
    letter-spacing: -.025em;
}

body:not(.we-dashboard) .we-primary-action:hover {
    color: #082e37;
    border-color: #d2f77b;
    background: #d2f77b;
}

/* Cards, forms and data surfaces */
body:not(.we-dashboard) .card {
    overflow: hidden;
    border: 1px solid var(--we-line);
    border-radius: 18px;
    background: var(--we-card);
    box-shadow: var(--we-shadow);
}

body:not(.we-dashboard) .card-header {
    min-height: 52px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 13px 18px;
    border: 0;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
    border-radius: 0 !important;
    color: #eafafa;
    background: linear-gradient(115deg, var(--we-navy-2), #0b414a);
    font-size: .82rem;
    font-weight: 800;
    letter-spacing: .015em;
}

body:not(.we-dashboard) .card-header span {
    color: #9db7bc;
    font-size: .72rem;
    font-weight: 500;
}

body:not(.we-dashboard) .card-body {
    padding: 20px;
}

body:not(.we-dashboard) .card-footer {
    padding: 13px 18px;
    border-color: var(--we-line);
    background: color-mix(in srgb, var(--we-paper) 54%, var(--we-card));
}

body:not(.we-dashboard) .we-filter-card {
    border-top: 3px solid var(--we-cyan);
}

body:not(.we-dashboard) .we-create-card {
    border: 1px solid #b8dfde !important;
    border-top: 3px solid var(--we-lime) !important;
}

body:not(.we-dashboard) .we-form-card {
    border-top: 3px solid var(--we-cyan);
}

body:not(.we-dashboard) .form-label {
    margin-bottom: 7px;
    color: var(--we-ink);
    font-size: .75rem;
    font-weight: 750 !important;
}

body:not(.we-dashboard) .form-control,
body:not(.we-dashboard) .form-select,
body:not(.we-dashboard) form input[type="text"],
body:not(.we-dashboard) form input[type="number"],
body:not(.we-dashboard) form input[type="email"],
body:not(.we-dashboard) form input[type="date"],
body:not(.we-dashboard) form textarea,
body:not(.we-dashboard) form select {
    min-height: 42px;
    padding: 9px 12px;
    border: 1px solid var(--we-line);
    border-radius: 11px;
    color: var(--we-ink);
    background-color: var(--we-card);
    font-size: .82rem;
    box-shadow: none;
}

body:not(.we-dashboard) .form-control:focus,
body:not(.we-dashboard) .form-select:focus,
body:not(.we-dashboard) form input:focus,
body:not(.we-dashboard) form textarea:focus,
body:not(.we-dashboard) form select:focus {
    border-color: var(--we-cyan);
    box-shadow: 0 0 0 3px rgba(32, 201, 216, .12);
}

body:not(.we-dashboard) .form-control-sm,
body:not(.we-dashboard) .form-select-sm {
    min-height: 37px;
}

body:not(.we-dashboard) .form-text,
body:not(.we-dashboard) .text-muted {
    color: var(--we-muted) !important;
}

body:not(.we-dashboard) .btn {
    min-height: 38px;
    padding: 8px 13px;
    border-radius: 11px;
    font-size: .78rem;
    font-weight: 750;
    transition: transform .18s ease, box-shadow .18s ease, background-color .18s ease;
}

body:not(.we-dashboard) .btn:hover {
    transform: translateY(-1px);
}

body:not(.we-dashboard) .btn-primary {
    color: #fff;
    border-color: #0c6f79;
    background: linear-gradient(135deg, #087a85, #0aa6b3);
    box-shadow: 0 8px 20px rgba(10, 166, 179, .15);
}

body:not(.we-dashboard) .btn-primary:hover {
    border-color: #0a919c;
    background: linear-gradient(135deg, #096873, #0a919c);
}

body:not(.we-dashboard) .btn-success {
    border-color: var(--we-green);
    background: var(--we-green);
}

body:not(.we-dashboard) .btn-secondary {
    border-color: #5f7479;
    background: #5f7479;
}

body:not(.we-dashboard) .btn-outline-primary {
    color: #087a85;
    border-color: #8ccfd3;
}

body:not(.we-dashboard) .btn-outline-primary:hover {
    color: #fff;
    border-color: #087a85;
    background: #087a85;
}

body:not(.we-dashboard) .we-icon-btn {
    width: 38px;
    min-width: 38px;
    height: 38px;
    min-height: 38px;
    display: inline-grid;
    place-items: center;
    padding: 0 !important;
    border-radius: 11px;
    font-size: 1rem !important;
    line-height: 1 !important;
    vertical-align: middle;
}

body:not(.we-dashboard) .we-icon-btn i {
    margin: 0;
    transform: none;
}

body:not(.we-dashboard) .we-icon-btn:hover i {
    transform: scale(1.08);
}

body:not(.we-dashboard) .btn-warning {
    color: #3d2a00;
    border-color: var(--we-amber);
    background: var(--we-amber);
}

body:not(.we-dashboard) .btn-danger {
    border-color: var(--we-coral);
    background: var(--we-coral);
}

body:not(.we-dashboard) .btn-info {
    color: #07333a;
    border-color: var(--we-cyan);
    background: var(--we-cyan);
}

body:not(.we-dashboard) .pagination .page-link {
    min-width: 38px;
    min-height: 38px;
    display: grid;
    place-items: center;
    border-color: var(--we-line);
    color: #087a85;
    background: var(--we-card);
}

body:not(.we-dashboard) .pagination .active > .page-link {
    color: #082e37;
    border-color: var(--we-lime);
    background: var(--we-lime);
}

body:not(.we-dashboard) .table-responsive {
    scrollbar-color: #9cb8bc transparent;
}

body:not(.we-dashboard) .table {
    --bs-table-bg: transparent;
    --bs-table-color: var(--we-ink);
    margin: 0;
    color: var(--we-ink);
    font-size: .78rem;
}

body:not(.we-dashboard) .table thead th {
    padding: 13px 14px;
    border: 0;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
    color: #9ec0c4;
    background: var(--we-navy-2);
    font-size: .66rem;
    font-weight: 850;
    letter-spacing: .075em;
    text-transform: uppercase;
    vertical-align: middle;
}

body:not(.we-dashboard) .table tbody td,
body:not(.we-dashboard) .table tbody th {
    padding: 13px 14px;
    border-color: var(--we-line);
    vertical-align: middle;
}

body:not(.we-dashboard) .table-hover tbody tr {
    transition: background-color .16s ease;
}

body:not(.we-dashboard) .table-hover tbody tr:hover > * {
    --bs-table-bg-state: rgba(32, 201, 216, .055);
    color: var(--we-ink);
}

body:not(.we-dashboard) .table-success > * {
    --bs-table-bg-state: rgba(21, 156, 121, .1);
}

body:not(.we-dashboard) .table-danger > * {
    --bs-table-bg-state: rgba(255, 108, 98, .1);
}

body:not(.we-dashboard) .badge {
    padding: 6px 8px;
    border-radius: 8px;
    font-size: .66rem;
    font-weight: 800;
}

body:not(.we-dashboard) .badge-pending,
body:not(.we-dashboard) .bg-warning {
    color: #3d2a00 !important;
    background: var(--we-amber) !important;
}

body:not(.we-dashboard) .badge-confirmed,
body:not(.we-dashboard) .badge-paid,
body:not(.we-dashboard) .badge-cleared,
body:not(.we-dashboard) .bg-success {
    background: var(--we-green) !important;
}

body:not(.we-dashboard) .badge-in_transit,
body:not(.we-dashboard) .bg-info {
    color: #07333a !important;
    background: var(--we-cyan) !important;
}

body:not(.we-dashboard) .badge-cancelled,
body:not(.we-dashboard) .bg-danger {
    background: var(--we-coral) !important;
}

body:not(.we-dashboard) .alert {
    border-width: 1px;
    border-radius: 14px;
    font-size: .8rem;
}

body:not(.we-dashboard) .modal-content,
body:not(.we-dashboard) .dropdown-menu {
    border: 1px solid var(--we-line);
    border-radius: 16px;
    background: var(--we-card);
    box-shadow: var(--we-shadow);
}

body:not(.we-dashboard) .dsc-chat-fab {
    background: linear-gradient(135deg, #087a85, #0aa6b3);
    box-shadow: 0 10px 28px rgba(10, 166, 179, .26);
}

body:not(.we-dashboard) .dsc-ai-fab {
    background: linear-gradient(135deg, #7b3fe4, #a75fc6);
}

body:not(.we-dashboard).dsc-dark .card,
body:not(.we-dashboard).dsc-dark .modal-content,
body:not(.we-dashboard).dsc-dark .dropdown-menu,
body:not(.we-dashboard).dsc-dark .form-control,
body:not(.we-dashboard).dsc-dark .form-select,
body:not(.we-dashboard).dsc-dark form input,
body:not(.we-dashboard).dsc-dark form textarea,
body:not(.we-dashboard).dsc-dark form select {
    color: var(--we-ink);
    border-color: var(--we-line);
    background-color: var(--we-card);
}

body:not(.we-dashboard).dsc-dark .table thead th {
    background: #082b34;
}

@media (max-width: 1199.98px) {
    body:not(.we-dashboard) > .navbar {
        position: relative;
    }

    body:not(.we-dashboard) > .navbar .navbar-collapse {
        margin-top: 12px;
        padding: 12px;
        border: 1px solid rgba(255, 255, 255, .08);
        border-radius: 14px;
        background: rgba(255, 255, 255, .04);
    }

    body:not(.we-dashboard) .dsc-search-wrap,
    body:not(.we-dashboard) .dsc-search-input,
    body:not(.we-dashboard) .dsc-search-input:focus {
        width: 100%;
    }
}

@media (max-width: 767.98px) {
    body:not(.we-dashboard) .main-content {
        padding-top: 18px;
    }

    body:not(.we-dashboard) .we-page-head {
        min-height: 0;
        align-items: flex-start;
        flex-direction: column;
        padding: 19px;
        border-radius: 18px;
    }

    body:not(.we-dashboard) .we-page-head .btn {
        width: 100%;
    }

    body:not(.we-dashboard) .card {
        border-radius: 15px;
    }

    body:not(.we-dashboard) .card-body {
        padding: 16px;
    }

    body:not(.we-dashboard) .table thead th,
    body:not(.we-dashboard) .table tbody td,
    body:not(.we-dashboard) .table tbody th {
        padding: 11px 10px;
    }
}
