/* ── Navbar Centered Title ───────────────────────────── */
.navbar-center-text {
    color: #fff;
    white-space: nowrap;
    position: relative;
    z-index: 5;
}

@media (max-width: 991.98px) {

    .rup-header-brand,
    .navbar-center-text {
        position: static !important;
        transform: none !important;
        margin-left: 0;
        margin-top: 0.15rem;
        text-align: center;
        justify-content: center;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        white-space: nowrap !important;
        line-height: 1.15;
    }

    .rup-title-group {
        display: inline-flex !important;
        align-items: baseline !important;
        justify-content: center !important;
        white-space: nowrap !important;
    }

    .rup-title-break-space {
        display: inline-block !important;
        width: 0.35em !important;
    }

    .navbar .container-fluid {
        flex-direction: column;
        align-items: center;
        justify-content: center;
        padding-top: 0.5rem;
        padding-bottom: 0.5rem;
        /* Ensure scaled/glowing R has room to breathe */
        overflow: visible;
    }

    .navbar-brand {
        flex-shrink: 0;
        margin: 0 auto;
        order: 1;
    }

    .rup-navbar .navbar-center-text {
        order: 2;
        margin-left: 0;
        margin-top: 0.25rem;
        /* Give extra top padding so the R's upward scale animation isn't clipped */
        padding-top: 6px;
        overflow: visible;
    }

    .rup-navbar .ms-auto {
        order: 3;
        margin-left: 0 !important;
        margin-top: 0.35rem;
    }

    .rup-navbar .navbar-nav {
        justify-content: center;
        margin: 0 auto;
    }

    .navbar-brand canvas {
        width: auto !important;
        height: 40px !important;
        max-width: 140px !important;
    }

    .rup-navbar .construction-animation {
        margin: 0 auto;
    }

    .rup-navbar .d-flex.align-items-center.ms-auto {
        margin-left: 0 !important;
        width: auto;
    }

    /* Scale down the R on tablets/phones so it stays fully visible */
    .rup-first-r {
        font-size: 1.6em !important;
        margin-right: 5px !important;
    }
}

@media (min-width: 992px) {
    .navbar-center-text {
        padding-left: 0px;
    }
}

@media (max-width: 575.98px) {

    .rup-header-title,
    .navbar-center-text {
        font-size: clamp(0.7rem, 2.8vw, 0.95rem) !important;
        line-height: 1.15;
    }

    /* Further reduce R on small phones — still visually dominant */
    .rup-first-r {
        font-size: 1.5em !important;
        margin-right: 4px !important;
    }

    /* Gentler hammer strike on tiny screens — same feel, less travel */
    @keyframes rupRHammerStrike {
        0% {
            transform: scale(1) translateY(0) skewX(0deg);
            filter:
                drop-shadow(1px 1px 0 #7f2200) drop-shadow(2px 2px 0 #5d1800) drop-shadow(0 0 8px rgba(255, 130, 0, 0.7));
        }

        10% {
            transform: scale(1.02) translateY(-3px) skewX(-1deg);
            filter:
                drop-shadow(1px 1px 0 #7f2200) drop-shadow(2px 2px 0 #5d1800) drop-shadow(0 0 5px rgba(255, 100, 0, 0.5));
        }

        20% {
            transform: scaleX(1.08) scaleY(0.85) translateY(4px);
            filter:
                drop-shadow(0 1px 0 #7f2200) drop-shadow(0 2px 0 #5d1800) drop-shadow(0 0 18px rgba(255, 220, 80, 1)) drop-shadow(0 0 6px rgba(255, 255, 160, 0.85));
        }

        30% {
            transform: scaleX(0.97) scaleY(1.06) translateY(-3px);
            filter:
                drop-shadow(1px 1px 0 #7f2200) drop-shadow(2px 2px 0 #5d1800) drop-shadow(0 0 12px rgba(255, 140, 0, 0.9));
        }

        42% {
            transform: scale(1) translateY(0);
            filter:
                drop-shadow(1px 1px 0 #7f2200) drop-shadow(2px 2px 0 #5d1800) drop-shadow(0 0 14px rgba(255, 80, 0, 0.95));
        }

        80%,
        100% {
            transform: scale(1) translateY(0) skewX(0deg);
            filter:
                drop-shadow(1px 1px 0 #7f2200) drop-shadow(2px 2px 0 #5d1800) drop-shadow(0 0 8px rgba(255, 130, 0, 0.7));
        }
    }
}

.form-inline-row {
    gap: 12px;
    display: flex;
    flex-wrap: wrap;
}

.form-inline-row>* {
    flex: 1;
    min-width: 180px;
}

.text-muted {
    font-size: 0.95rem;
}

textarea.form-control {
    resize: vertical;
}

/* ── Responsive Table Wrapper ───────────────────────── */
.table-responsive {
    -webkit-overflow-scrolling: touch;
}

/* ── Sidebar Responsive & Parent/Submenu Styling ────── */
@media (max-width: 991.98px) {
    .sidebar-card {
        margin-bottom: 1rem;
    }

    .col-lg-2.mb-3 {
        margin-bottom: 0.5rem !important;
    }
}

.nav-parent-item {
    background-color: #f8f9fa !important;
    border-left: 4px solid #0d6efd !important;
    font-weight: 600 !important;
    color: #212529 !important;
    transition: background-color 0.15s ease;
}

.nav-parent-item:hover {
    background-color: #e9ecef !important;
}

.nav-parent-item.active-parent {
    background-color: #e7f1ff !important;
    border-left: 5px solid #0d6efd !important;
    color: #0d6efd !important;
}

.nav-submenu-container {
    background-color: #f1f4f9 !important;
    padding: 6px 10px 6px 12px !important;
}

.nav-submenu-wrapper {
    border-left: 2.5px solid #0d6efd !important;
    padding-left: 6px !important;
}

.nav-sub-item {
    background: transparent !important;
    font-size: 0.86rem !important;
    font-weight: 500 !important;
    color: #495057 !important;
    padding: 6px 10px !important;
    border-radius: 6px !important;
    margin-bottom: 3px !important;
    transition: all 0.15s ease !important;
}

.nav-sub-item:hover {
    background-color: #e2e8f0 !important;
    color: #0d6efd !important;
    padding-left: 14px !important;
}

.nav-sub-item.active-sublink {
    background-color: #0d6efd !important;
    color: #ffffff !important;
    font-weight: 700 !important;
    box-shadow: 0 2px 4px rgba(13, 110, 253, 0.25) !important;
}

.nav-sub-item.active-sublink i {
    color: #ffffff !important;
}

/* ── Dashboard Hero Banner ───────────────────────────── */
.dash-hero {
    background: linear-gradient(135deg, #1a237e 0%, #283593 50%, #3949ab 100%);
    border-radius: 16px;
    color: #fff;
    padding: 2rem 2.5rem;
    position: relative;
    overflow: hidden;
}

.dash-hero::before {
    content: '';
    position: absolute;
    top: -40px;
    right: -40px;
    width: 200px;
    height: 200px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
}

.dash-hero::after {
    content: '';
    position: absolute;
    bottom: -60px;
    left: -30px;
    width: 250px;
    height: 250px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 50%;
}

@media (max-width: 575.98px) {
    .dash-hero {
        padding: 1.25rem 1.25rem;
    }

    .dash-hero h1 {
        font-size: 1.4rem;
    }
}

/* ── Stat / Metric Cards ─────────────────────────────── */
.stat-card {
    border-radius: 14px;
    border: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    text-decoration: none;
    display: block;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.13) !important;
}

.stat-card .stat-icon {
    font-size: 2.4rem;
    opacity: 0.22;
}

.stat-card .stat-label {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.stat-card .stat-value {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1.1;
}

@media (max-width: 575.98px) {
    .stat-card .stat-value {
        font-size: 1.5rem;
    }

    .stat-card .stat-icon {
        font-size: 1.8rem;
    }
}

/* ── Hover Lift (admin dashboard cards) ──────────────── */
.hover-lift {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.hover-lift:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.11) !important;
}

/* ── Project Cards (Engineer Dashboard) ──────────────── */
.project-card {
    border-radius: 12px;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
    border: 1px solid #e3e8f0;
    text-decoration: none;
}

.project-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.10) !important;
    border-color: #7986cb;
}

.project-card .project-num {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1rem;
    flex-shrink: 0;
}

/* ── Quick Action Buttons ────────────────────────────── */
.quick-action {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 1rem 0.5rem;
    border-radius: 12px;
    border: 2px solid transparent;
    text-decoration: none;
    transition: all 0.2s ease;
    background: #f8f9fa;
    color: #333;
    font-size: 0.82rem;
    font-weight: 600;
    text-align: center;
}

.quick-action i {
    font-size: 1.6rem;
}

.quick-action:hover {
    background: #e8eaf6;
    border-color: #7986cb;
    color: #3949ab;
    transform: translateY(-2px);
}

/* ── Welcome Profile Card ────────────────────────────── */
.profile-avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    margin: 0 auto;
}

/* ── Responsive form tweaks ──────────────────────────── */
@media (max-width: 767.98px) {
    .card-body {
        padding: 1rem !important;
    }

    .btn {
        white-space: normal;
    }

    h1 {
        font-size: 1.5rem;
    }

    .form-control,
    .form-control-sm,
    .form-select,
    .form-select-sm,
    .textarea.form-control,
    textarea.form-control {
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        box-sizing: border-box;
    }

    .entry-top-row .col-md-3,
    .entry-top-row .col-md-4,
    .entry-top-row .col-md-5,
    .pay-add-form .col-md-2,
    .pay-add-form .col-md-3,
    .pay-add-form .col-md-4 {
        width: 100% !important;
        max-width: 100% !important;
    }

    .pay-action-inline input,
    .payment-method-table .pay-partial-amount-input,
    .payment-method-table .sales-pay-partial-amount-input,
    .items-table input.form-control,
    .items-table select.form-select {
        width: 100% !important;
        min-width: 0 !important;
    }
}

/* ── Nav Tab Scroll on Mobile ────────────────────────── */
.nav-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.nav-tabs .nav-link {
    white-space: nowrap;
}

/* ── Table compact on mobile ─────────────────────────── */
@media (max-width: 575.98px) {

    .table th,
    .table td {
        font-size: 0.82rem;
        padding: 0.4rem 0.5rem;
    }
}

.suggestions-list {
    max-height: 280px;
    overflow-y: auto;
    border: 1px solid rgba(0, 0, 0, 0.125);
    background: #fff;
}

.item-row {
    position: relative;
}

.item-row .suggestion-item:hover {
    background-color: rgba(0, 0, 0, 0.03);
}

/* ── Notification Bell ─────────────────────────────────── */
#notifBellBtn {
    border: none;
    background: transparent;
    cursor: pointer;
    transition: transform 0.2s ease;
}

#notifBellBtn:hover {
    transform: scale(1.15);
}

#notifBellBtn .bi-bell-fill {
    display: inline-block;
    transform-origin: top center;
}

#notifBellBtn.has-unread .bi-bell-fill {
    animation: real-bell-ring 2.5s ease-in-out infinite;
}

@keyframes real-bell-ring {
    0% {
        transform: rotate(0deg);
    }

    4% {
        transform: rotate(24deg);
    }

    8% {
        transform: rotate(-20deg);
    }

    12% {
        transform: rotate(18deg);
    }

    16% {
        transform: rotate(-14deg);
    }

    20% {
        transform: rotate(10deg);
    }

    24% {
        transform: rotate(-6deg);
    }

    28% {
        transform: rotate(3deg);
    }

    32% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(0deg);
    }
}

/* ── Notification Modal Items ───────────────────────────── */
.notif-item {
    padding: 14px 20px;
    background: #fff;
    transition: background 0.2s ease;
}

.notif-item:hover {
    background: #f8f9ff;
}

.notif-unread {
    background: #eff3ff !important;
    border-left: 4px solid #3f51b5;
}

.notif-divider {
    height: 1px;
    background: #e9ecef;
    margin: 0 20px;
}

.notif-item-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}

.notif-action-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
}

.notif-entity-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 0.78rem;
    background: #f0f0f0;
    color: #555;
    font-weight: 500;
}

.notif-new-dot {
    width: 8px;
    height: 8px;
    background: #f44336;
    border-radius: 50%;
    display: inline-block;
}

.notif-time {
    font-size: 0.77rem;
    color: #888;
    white-space: nowrap;
}

.notif-who {
    font-size: 0.9rem;
    margin-bottom: 6px;
    color: #222;
}

.notif-details {
    background: #f5f7fa;
    border: 1px solid #e0e4ee;
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 0.82rem;
    color: #444;
    max-height: 180px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-break: break-word;
}

.notif-detail-line {
    line-height: 1.6;
}

.notif-change {
    color: #1565c0;
    padding-left: 6px;
}

/* ── Notifications Modal Improvements ───────────────────────── */
#notifModal .modal-body {
    background: #f8f9ff;
    overflow-y: auto;
    overflow-x: hidden;
}

#notifList {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1rem;
}

.notif-item {
    border-radius: 14px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.06);
}

.notif-item-header {
    gap: 0.75rem;
}

.notif-who {
    font-size: 0.95rem;
    color: #222;
    margin-bottom: 0.75rem;
}

.notif-details {
    margin-top: 0.5rem;
    background: #fff;
}

@media (max-width: 575.98px) {
    .notif-item {
        padding: 12px 14px;
    }
}

/* ── Notification "View Record" button ──────────────────── */
.notif-goto-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    color: #3f51b5;
    background: rgba(63, 81, 181, 0.1);
    border: 1px solid rgba(63, 81, 181, 0.25);
    text-decoration: none;
    white-space: nowrap;
    transition: all 0.2s ease;
}
.notif-goto-btn:hover {
    background: #3f51b5;
    color: #fff;
    border-color: #3f51b5;
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(63, 81, 181, 0.35);
}

/* Clickable card: subtle highlight on hover */
.notif-item[data-notif-url]:hover {
    background: #eef0ff !important;
    box-shadow: 0 4px 16px rgba(63, 81, 181, 0.12);
}


/* ═══════════════════════════════════════════════════════
   PAYMENT RECORDS — MOBILE RESPONSIVE
   (In Records & Sales pages)
═══════════════════════════════════════════════════════ */

/* ── Entry card header info stacks nicely on mobile ── */
.entry-info-block {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.entry-meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.5rem;
}

/* ── Bill image constrained on mobile ── */
@media (max-width: 767.98px) {

    .bill-image-wrap img,
    .acc-in-preview-image {
        max-width: 100px !important;
        max-height: 100px !important;
    }
}

/* ── Payment section summary bar wraps on mobile ── */
.payment-summary-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 1rem;
    align-items: center;
}

/* ── Add Payment / Received form ── */
.pay-add-form .row {
    row-gap: 0.5rem;
}

@media (max-width: 767.98px) {

    .pay-add-form .col-md-2,
    .pay-add-form .col-md-3,
    .pay-add-form .col-md-4 {
        flex: 0 0 100%;
        max-width: 100%;
    }

    .pay-add-form .btn {
        width: 100%;
        margin-top: 0.25rem;
    }
}

/* ── Stacked card-style tables on mobile ── */
@media (max-width: 767.98px) {

    /* Payment method group tables */
    .payment-method-table,
    .payment-method-table thead {
        display: block;
    }

    .payment-method-table thead {
        display: none;
    }

    .payment-method-table tbody,
    .payment-method-table tr {
        display: block;
    }

    .payment-method-table tr {
        border: 1px solid #dee2e6;
        border-radius: 8px;
        margin-bottom: 0.6rem;
        padding: 0.5rem 0.75rem;
        background: #fff;
        position: relative;
    }

    .payment-method-table tr.history-row {
        background: #f0fff0;
        border-color: #c3e6cb;
        margin-top: -0.4rem;
        border-top-left-radius: 0;
        border-top-right-radius: 0;
    }

    .payment-method-table td {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        border: none !important;
        padding: 0.3rem 0 !important;
        font-size: 0.87rem;
    }

    .payment-method-table td::before {
        content: attr(data-label);
        font-weight: 600;
        color: #555;
        flex-shrink: 0;
        min-width: 110px;
        font-size: 0.8rem;
        padding-top: 1px;
    }

    .payment-method-table td:empty {
        display: none;
    }

    /* Actions cell — full width button bar */
    .payment-method-table td.action-cell {
        flex-direction: column;
        align-items: stretch;
        gap: 0.35rem;
        padding-top: 0.5rem !important;
        border-top: 1px dashed #dee2e6 !important;
        margin-top: 0.25rem;
    }

    .payment-method-table td.action-cell::before {
        display: none;
    }

    .payment-method-table td.action-cell .d-inline-flex,
    .payment-method-table td.action-cell .btn {
        width: 100%;
        justify-content: center;
    }

    .payment-method-table .pay-partial-amount-input,
    .payment-method-table .sales-pay-partial-amount-input {
        width: 100% !important;
        margin-bottom: 0.3rem;
    }

    /* Items table — stacked cards */
    .items-table,
    .items-table thead {
        display: block;
    }

    .items-table thead {
        display: none;
    }

    .items-table tbody,
    .items-table tr {
        display: block;
    }

    .items-table tr {
        border: 1px solid #dee2e6;
        border-radius: 8px;
        margin-bottom: 0.6rem;
        padding: 0.5rem 0.75rem;
        background: #fff;
    }

    .items-table td {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        border: none !important;
        padding: 0.3rem 0 !important;
        font-size: 0.87rem;
    }

    .items-table td::before {
        content: attr(data-label);
        font-weight: 600;
        color: #555;
        flex-shrink: 0;
        min-width: 110px;
        font-size: 0.8rem;
        padding-top: 1px;
    }

    .items-table tfoot {
        display: block;
    }

    .items-table tfoot tr {
        background: #f8f9fa;
        border: 1px solid #dee2e6;
        border-radius: 8px;
        margin-bottom: 0.6rem;
        padding: 0.5rem 0.75rem;
    }

    .items-table tfoot td {
        display: flex;
        justify-content: space-between;
        border: none !important;
        padding: 0.3rem 0 !important;
        font-size: 0.9rem;
        font-weight: 700;
    }

    .items-table tfoot td::before {
        display: none;
    }

    /* Payment history sub-table — stacked */
    .payment-history-sub-table,
    .payment-history-sub-table thead {
        display: block;
    }

    .payment-history-sub-table thead {
        display: none;
    }

    .payment-history-sub-table tbody,
    .payment-history-sub-table tr {
        display: block;
    }

    .payment-history-sub-table tr {
        border: 1px solid #c3e6cb;
        border-radius: 6px;
        margin-bottom: 0.4rem;
        padding: 0.4rem 0.6rem;
        background: #fff;
    }

    .payment-history-sub-table td {
        display: flex;
        justify-content: space-between;
        border: none !important;
        padding: 0.2rem 0 !important;
        font-size: 0.83rem;
    }

    .payment-history-sub-table td::before {
        content: attr(data-label);
        font-weight: 600;
        color: #555;
        min-width: 90px;
        font-size: 0.78rem;
    }

    /* History wrapper always full width on mobile */
    .payment-history-sub-wrapper {
        max-width: 100% !important;
    }

    /* Method badge group header */
    .method-group-header {
        margin-bottom: 0.5rem;
    }

    /* Card body less padding on mobile */
    .card-body {
        padding: 0.85rem !important;
    }

    /* Entry top section stacks */
    .entry-top-row {
        flex-direction: column !important;
    }

    .entry-top-row .col-md-3,
    .entry-top-row .col-md-5,
    .entry-top-row .col-md-4 {
        width: 100% !important;
        max-width: 100% !important;
        text-align: left !important;
    }

    /* Pagination centering */
    .pagination {
        justify-content: center;
        flex-wrap: wrap;
    }
}

/* ── Partial payment input + button always inline ── */
.pay-action-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    align-items: center;
}

.pay-action-inline input {
    min-width: 80px;
    flex: 1;
}

.pay-action-inline .btn {
    white-space: nowrap;
}

/* ── Touch-friendly min button size ── */
@media (max-width: 767.98px) {
    .btn-sm {
        min-height: 36px;
        font-size: 0.85rem;
        padding: 0.3rem 0.7rem;
    }

    .form-control-sm,
    .form-select-sm {
        min-height: 36px;
    }
}

/* ── Mobile-first Username Truncation in Navbar ── */
.navbar-user-name {
    max-width: 150px;
    display: inline-block;
    vertical-align: middle;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (max-width: 575.98px) {
    .navbar-user-name {
        max-width: 80px;
    }
}

/* ── Mobile-first Chat Box Responsiveness ── */
@media (max-width: 575.98px) {
    #floating-chat-widget {
        left: 15px;
        right: 15px;
        bottom: 15px;
    }

    #chat-toggle-btn {
        margin-left: auto;
    }

    #chat-box {
        left: 0;
        right: 0;
        width: auto !important;
        height: 75vh !important;
        max-height: 520px !important;
        bottom: 70px !important;
    }
}

/* ── Card-like Dynamic Rows on Mobile ── */
@media (max-width: 767.98px) {
    .estimation-row {
        border: 1px solid #dee2e6;
        border-radius: 8px;
        padding: 12px;
        background: #f8f9fa;
        margin-bottom: 1.25rem !important;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
    }

    .item-row .remove-btn {
        width: 100%;
        margin-top: 0.5rem;
    }
}

/* ── Improved Touch scrolling for responsive tables ── */
.table-responsive {
    -webkit-overflow-scrolling: touch;
    overflow-y: hidden;
    margin-bottom: 1rem;
}

/* ── Modern Animated Mobile Navigation Toggle & Compact Constructive Sidebar Options ── */
.mobile-nav-toggle-btn {
    background: linear-gradient(135deg, #4a148c 0%, #6a1b9a 50%, #7b1fa2 100%);
    box-shadow: 0 4px 14px rgba(106, 27, 154, 0.35);
    transition: all 0.3s ease;
    cursor: pointer;
}

.mobile-nav-toggle-btn:active {
    transform: scale(0.98);
}

.mobile-nav-toggle-btn .toggle-icon-badge {
    width: 30px;
    height: 30px;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.35);
    transition: transform 0.3s ease;
}

.mobile-nav-toggle-btn .toggle-arrow-badge {
    width: 26px;
    height: 26px;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: transform 0.3s ease;
}

.mobile-nav-toggle-btn[aria-expanded="true"] {
    background: linear-gradient(135deg, #311b92 0%, #4527a0 50%, #512da8 100%);
    box-shadow: 0 4px 16px rgba(81, 45, 168, 0.4);
}

.mobile-nav-toggle-btn[aria-expanded="true"] .toggle-arrow-badge {
    transform: rotate(180deg);
    background: rgba(255, 255, 255, 0.35);
}

.mobile-nav-toggle-btn[aria-expanded="true"] .toggle-icon-badge {
    transform: rotate(90deg);
    background: rgba(255, 255, 255, 0.35);
}

/* ── Sticky Navigation Menu (Stops at top when scrolling/sliding up on Phone & Desktop) ── */
@media (max-width: 991.98px) {
    #mobileNavStickyContainer {
        position: relative;
        z-index: 1000;
        width: 100%;
    }

    #mobileNavStickyContainer.is-fixed {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        z-index: 100005 !important;
        background: transparent !important;
        padding: 0 !important;
        margin: 0 !important;
        box-shadow: none !important;
        border: none !important;
        pointer-events: none !important;
    }

    #mobileNavStickyContainer.is-fixed .mobile-nav-toggle-btn {
        margin: 0 !important;
        border-top-left-radius: 0 !important;
        border-top-right-radius: 0 !important;
        border-bottom-left-radius: 12px !important;
        border-bottom-right-radius: 12px !important;
        pointer-events: auto !important;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.45) !important;
        padding: 10px 16px !important;
    }

    #mobileNavStickyContainer.is-fixed #sidebarNav {
        pointer-events: auto !important;
    }

    #mobileNavStickyContainer.is-fixed #sidebarNav.collapsing,
    #mobileNavStickyContainer.is-fixed #sidebarNav.show {
        max-height: calc(100dvh - 60px) !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
        margin: 6px 8px 0 8px !important;
        pointer-events: auto !important;
        box-shadow: 0 16px 48px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(13, 110, 253, 0.2) !important;
        border-radius: 12px;
        background: #ffffff !important;
    }

    .sidebar-sticky-wrapper {
        position: relative;
        margin-bottom: 6px;
    }

    .mobile-nav-toggle-btn {
        margin-bottom: 4px !important;
    }

    #sidebarNav.collapsing,
    #sidebarNav.show {
        max-height: calc(100dvh - 65px);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
    }

    .sidebar-card {
        border: 1px solid rgba(37, 99, 235, 0.2) !important;
        border-radius: 12px !important;
        overflow: hidden;
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12) !important;
        background: #ffffff !important;
        padding: 4px 0;
    }

    /* Custom sleek scrollbar for mobile sidebar */
    #sidebarNav::-webkit-scrollbar {
        width: 5px;
    }
    #sidebarNav::-webkit-scrollbar-track {
        background: rgba(0, 0, 0, 0.04);
        border-radius: 4px;
    }
    #sidebarNav::-webkit-scrollbar-thumb {
        background: rgba(13, 110, 253, 0.35);
        border-radius: 4px;
    }
    #sidebarNav::-webkit-scrollbar-thumb:hover {
        background: rgba(13, 110, 253, 0.6);
    }

    .sidebar-card .list-group-item {
        padding: 0.5rem 0.85rem !important;
        margin: 2px 4px !important;
        border-radius: 8px !important;
        font-size: 0.86rem !important;
        font-weight: 600 !important;
        transition: all 0.18s ease !important;
    }

    .sidebar-card .list-group-item i {
        font-size: 0.95rem;
        transition: transform 0.18s ease;
    }

    .sidebar-card .list-group-item:hover,
    .sidebar-card .list-group-item:focus {
        transform: translateX(4px);
        background-color: #eff6ff !important;
        color: #1d4ed8 !important;
    }

    .sidebar-card .list-group-item:hover i {
        transform: scale(1.12);
    }

    .sidebar-card .list-group-item.active {
        background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%) !important;
        color: #ffffff !important;
        box-shadow: 0 3px 10px rgba(37, 99, 235, 0.3) !important;
        border: none !important;
    }

    .sidebar-card .list-group-item.active i {
        color: #ffffff !important;
    }

    .nav-parent-item {
        margin: 2px 4px !important;
        border-radius: 8px !important;
    }

    .nav-submenu-container {
        margin: 2px 6px !important;
        border-radius: 6px !important;
        padding: 4px 6px !important;
    }

    .nav-sub-item {
        padding: 5px 8px !important;
        font-size: 0.82rem !important;
    }
}

/* Mobile Sidebar Backdrop Overlay (No blur, smooth fade) */
#mobileNavBackdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.35);
    z-index: 99990;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    pointer-events: none;
}

#mobileNavBackdrop.show {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

@media (min-width: 992px) {
    .sidebar-sticky-wrapper {
        position: -webkit-sticky;
        position: sticky;
        top: 16px;
        z-index: 1020;
    }

    .sidebar-card {
        max-height: calc(100vh - 32px);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
}

@keyframes mobileNavSlideDown {
    0% {
        opacity: 0;
        transform: translateY(-14px) scale(0.97);
    }

    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ── Dashboard Glassmorphic Clock & Unique Tick Pulse Animation ── */
.dash-clock-badge {
    background: rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 50px;
    padding: 6px 22px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.dash-clock-badge .clock-time {
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace, sans-serif;
    font-weight: 700;
    font-size: 1.25rem;
    color: #ffffff;
    letter-spacing: 1.5px;
    display: inline-block;
    transition: transform 0.15s ease, text-shadow 0.15s ease;
}

.dash-clock-badge .clock-time.tick-pulse {
    animation: clockPulseFlip 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes clockPulseFlip {
    0% {
        transform: scale(1);
        text-shadow: 0 0 0 transparent;
    }

    50% {
        transform: scale(1.09);
        text-shadow: 0 0 12px rgba(255, 255, 255, 0.7);
    }

    100% {
        transform: scale(1);
        text-shadow: 0 0 0 transparent;
    }
}

/* ═══════════════════════════════════════════════════════
   MODALS — FIXED POSITION, CENTERED, SCROLLABLE & RESPONSIVE
   Ensures all modals appear above headers/everything else,
   stay centered in the middle of the screen, and fit fully.
 ═══════════════════════════════════════════════════════ */

/* Modal Backdrop — fixed full-screen overlay covering header & page */
.modal-backdrop {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 105000 !important;
    background-color: rgba(0, 0, 0, 0.65) !important;
    pointer-events: auto !important;
}

/* Modal Container — fixed full-screen overlay, highest z-index above everything */
.modal {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 106000 !important;
    padding: 0.5rem;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    -webkit-overflow-scrolling: touch;
    pointer-events: auto !important;
}

/* Modal Shown — Flex center in middle of screen */
.modal.show {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* Stacked modals & backdrops support */
.modal-backdrop+.modal-backdrop {
    z-index: 106500 !important;
}

.modal.show~.modal.show {
    z-index: 107000 !important;
}

/* Dialog — centered, constrained, passes clicks outside content to modal backdrop */
.modal-dialog {
    position: relative !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    max-width: 500px;
    width: 100% !important;
    max-height: calc(100vh - 1.5rem);
    margin: auto !important;
    pointer-events: none !important;
}

/* Size Variants */
.modal-dialog.modal-sm {
    max-width: 340px !important;
}

.modal-dialog.modal-md {
    max-width: 560px !important;
}

.modal-dialog.modal-lg {
    max-width: 860px !important;
}

.modal-dialog.modal-xl {
    max-width: 1180px !important;
}

/* Centered Variant */
.modal-dialog.modal-dialog-centered {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: calc(100% - 1.5rem) !important;
    margin: auto !important;
}

/* Content — Card box inside modal */
.modal-content {
    position: relative !important;
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    pointer-events: auto !important;
    background-color: #ffffff;
    background-clip: padding-box;
    border: 1px solid rgba(0, 0, 0, 0.15);
    border-radius: 0.85rem !important;
    outline: 0;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3) !important;
    max-height: calc(100dvh - 1.5rem);
    overflow: hidden !important;
}

.modal-content>form {
    display: flex !important;
    flex-direction: column !important;
    flex: 1 1 auto !important;
    min-height: 0 !important;
    max-height: calc(100dvh - 1.5rem) !important;
    overflow: hidden !important;
}

/* Scrollable Variant */
.modal-dialog.modal-dialog-scrollable .modal-content {
    max-height: calc(100dvh - 1.5rem);
    display: flex !important;
    flex-direction: column !important;
}

.modal-dialog.modal-dialog-scrollable .modal-body,
.modal-dialog.modal-dialog-scrollable .modal-content>form>.modal-body {
    overflow-y: auto !important;
    flex: 1 1 auto !important;
    max-height: none !important;
}

/* Header — sticky at top of modal card */
.modal-header {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 0.9rem 1.25rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    flex-shrink: 0 !important;
    position: sticky !important;
    top: 0 !important;
    z-index: 105 !important;
    background-color: inherit;
    pointer-events: auto !important;
}

/* Close Button — Touch friendly */
.modal-header .btn-close,
.modal .btn-close {
    padding: 0.5rem !important;
    margin: -0.5rem -0.5rem -0.5rem auto !important;
    min-width: 44px !important;
    min-height: 44px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    pointer-events: auto !important;
    z-index: 110 !important;
    opacity: 0.85;
}

.modal-header .btn-close:hover,
.modal-header .btn-close:focus,
.modal .btn-close:hover,
.modal .btn-close:focus {
    opacity: 1;
    outline: none;
}

/* Body — scrollable content inside modal */
.modal-body {
    position: relative !important;
    flex: 1 1 auto !important;
    padding: 1.25rem;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    -webkit-overflow-scrolling: touch;
    pointer-events: auto !important;
    max-height: calc(100dvh - 8rem);
}

/* Footer — flex-shrink 0 at bottom */
.modal-footer {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    justify-content: flex-end !important;
    padding: 0.75rem 1.25rem;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    flex-shrink: 0 !important;
    pointer-events: auto !important;
}

.modal-footer .btn {
    pointer-events: auto !important;
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* ── Lightbox & Photo Modals — Centered Full Image Display ── */
.modal-content.bg-transparent,
#sk-in-lightbox-modal .modal-content,
#adminSupImgModal .modal-content,
#expenseImageLightbox .modal-content {
    background: transparent !important;
    box-shadow: none !important;
    border: none !important;
}

.modal-content.bg-transparent .modal-body,
#expenseImageLightbox .modal-body,
#adminSupImgModal .modal-body,
#sk-in-lightbox-modal .modal-body {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    max-height: 85vh !important;
    padding: 0.5rem !important;
}

.modal-content.bg-transparent img,
#expenseImageLightbox img,
#adminSupImgModal img,
#sk-in-lightbox-modal img,
#lightbox-img {
    max-width: 98% !important;
    max-height: 78vh !important;
    object-fit: contain !important;
    margin: auto !important;
    border-radius: 8px;
}

/* ── Responsive Tablet & Mobile Breakpoints ── */
@media (max-width: 991.98px) {
    .modal-dialog.modal-xl {
        max-width: 95vw !important;
    }

    .modal-dialog.modal-lg {
        max-width: 95vw !important;
    }
}

@media (max-width: 767.98px) {
    .modal {
        padding: 0.35rem !important;
    }

    .modal-dialog {
        max-width: calc(100vw - 0.75rem) !important;
        margin: auto !important;
        max-height: calc(100dvh - 0.7rem) !important;
    }

    .modal-content {
        max-height: calc(100dvh - 0.7rem) !important;
        border-radius: 0.75rem !important;
    }

    .modal-body {
        padding: 1rem 0.75rem !important;
        max-height: calc(100dvh - 6.5rem) !important;
    }

    .modal-header {
        padding: 0.75rem 1rem !important;
    }

    .modal-footer {
        padding: 0.65rem 1rem !important;
    }

    .modal-header .modal-title {
        font-size: 1rem;
    }
}

@media (max-width: 575.98px) {
    .modal {
        padding: 0.25rem !important;
    }

    .modal-dialog {
        max-width: calc(100vw - 0.5rem) !important;
        margin: auto !important;
        max-height: calc(100dvh - 0.5rem) !important;
    }

    .modal-content {
        max-height: calc(100dvh - 0.5rem) !important;
        border-radius: 0.65rem !important;
    }

    .modal-body {
        padding: 0.85rem 0.65rem !important;
        max-height: calc(100dvh - 6rem) !important;
    }

    .modal-header {
        padding: 0.65rem 0.75rem !important;
    }

    .modal-footer {
        padding: 0.5rem 0.75rem !important;
        gap: 0.5rem;
    }

    .modal-footer .btn {
        flex: 1 1 auto;
        min-width: 0;
    }
}

/* ── Gallery / lightbox modal bodies with inline styles ── */
.gallery-modal-body,
#galleryModalBody,
#lightboxImgWrapper,
#lightbox-img-wrapper {
    overflow: hidden !important;
    touch-action: none;
    cursor: grab;
    -webkit-user-select: none;
    user-select: none;
}

.gallery-modal-body:active,
#galleryModalBody:active {
    cursor: grabbing;
}

.gallery-image-stage {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.gallery-image-stage img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* ═══════════════════════════════════════════════════════
   RUPSON HEADER — CONSTRUCTION ANIMATION & STYLING
═══════════════════════════════════════════════════════ */

/* ── Navbar base — Realistic Heavy Construction Equipment Background ── */
.rup-navbar {
    background: 
        linear-gradient(180deg, 
            rgba(10, 18, 42, 0.78) 0%, 
            rgba(15, 23, 42, 0.58) 45%, 
            rgba(8, 14, 30, 0.85) 100%),
        linear-gradient(90deg, 
            rgba(13, 27, 78, 0.72) 0%, 
            rgba(15, 23, 42, 0.38) 25%, 
            rgba(20, 20, 45, 0.45) 50%, 
            rgba(15, 23, 42, 0.38) 75%, 
            rgba(13, 27, 78, 0.72) 100%),
        url('../images/construction_header_bg.jpg') center 54% / cover no-repeat !important;
    min-height: 70px;
    box-shadow: 0 4px 28px rgba(0, 0, 0, 0.70), 0 2px 12px rgba(245, 158, 11, 0.22), inset 0 -1px 0 rgba(245, 158, 11, 0.35) !important;
    border-bottom: 2px solid rgba(245, 158, 11, 0.45) !important;
    position: relative;
    /* Allow the animated letters' glow/scale to show without clipping */
    overflow: visible !important;
}


.rup-navbar::after {
    display: none !important;
}

/* ── Header Material Delivery Dump Truck Animation ── */
.header-truck-wrapper {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    pointer-events: none;
    z-index: 1;
    /* behind construction animation (z-index:3) and navbar text (z-index:5) */
    overflow: hidden;
}

.header-truck {
    position: absolute;
    width: 80px;
    height: 34px;
    top: 50%;
    /*
     * translateY(-50%) centers the truck div vertically.
     * The truck SVG viewBox is 90x38: wheels touch y≈32.5 (85% down).
     * The construction SVG viewBox is 160x65: ground at y=60 (92% down).
     * Both elements are the same height in the navbar, so shift the truck
     * down by ~6px so its wheel baseline aligns with the construction ground line.
     */
    transform: translateX(100vw) translateY(calc(-50% + 6px));
    animation: truckDrive15s 45s linear infinite;
    pointer-events: none;
}

.truck-svg {
    width: 100%;
    height: 100%;
    overflow: visible;
}

/* Dump bed: hinged at rear axle (x=84). Rotating CCW lifts the front, opens rear tailgate */
.truck-dump-bed {
    transform-origin: 84px 25px;
    /* linear keeps keyframe % in sync with the truck's linear movement on ALL screen sizes */
    animation: bedTiltUp 45s linear infinite;
}

/* Hydraulic arm: base fixed on chassis under front of bed (x=46), pushes bed front upward */
.hydraulic-arm {
    transform-origin: 46px 27px;
    animation: hydraulicExtend 45s linear infinite;
}

.truck-cargo {
    animation: cargoDisappear 45s linear infinite;
}

.unloaded-materials {
    opacity: 0;
    animation: materialsSpill 45s linear infinite;
}

/* ── Exhaust Smoke Puffs: 6 circles share ONE keyframe, tightly staggered ── */
.truck-exhaust-1 {
    animation: exhaustSmoke 45s linear infinite;
    opacity: 0;
}

.truck-exhaust-2 {
    animation: exhaustSmoke 45s linear infinite;
    opacity: 0;
    animation-delay: -0.6s;
}

.truck-exhaust-3 {
    animation: exhaustSmoke 45s linear infinite;
    opacity: 0;
    animation-delay: -1.2s;
}

.truck-exhaust-4 {
    animation: exhaustSmoke 45s linear infinite;
    opacity: 0;
    animation-delay: -1.8s;
}

.truck-exhaust-5 {
    animation: exhaustSmoke 45s linear infinite;
    opacity: 0;
    animation-delay: -2.4s;
}

.truck-exhaust-6 {
    animation: exhaustSmoke 45s linear infinite;
    opacity: 0;
    animation-delay: -3.0s;
}

.wheel.wheel-front {
    transform-origin: 20px 27px;
    animation: wheelRotate 45s linear infinite;
}

.wheel.wheel-mid {
    transform-origin: 56px 27px;
    animation: wheelRotate 45s linear infinite;
}

.wheel.wheel-rear {
    transform-origin: 72px 27px;
    animation: wheelRotate 45s linear infinite;
}

@keyframes truckDrive15s {

    /* ── ACTIVE phase: 0%–33.33% = 0s–15s | PAUSE: 33.33%–100% = 15s–45s ── */
    0% {
        transform: translateX(calc(100vw - 90px)) translateY(calc(-50% + 6px)) scaleX(1);
    }

    /* Truck arrives and parks at 10% (=4.5s) */
    10%,
    16.33% {
        transform: translateX(165px) translateY(calc(-50% + 6px)) scaleX(1);
    }

    /* Truck rotates after unload at 17.33% (=7.8s) */
    17.33% {
        transform: translateX(165px) translateY(calc(-50% + 6px)) scaleX(-1);
    }

    /* Truck fully off-screen at 27.33% (=12.3s) */
    27.33% {
        transform: translateX(calc(100vw + 100px)) translateY(calc(-50% + 6px)) scaleX(-1);
    }

    /* Snap back to start direction at 27.67% (=12.45s), hold off-screen for 30s pause */
    27.67%,
    100% {
        transform: translateX(calc(100vw + 100px)) translateY(calc(-50% + 6px)) scaleX(1);
    }
}

/* Pivot at x=84 (rear hinge). CW rotation (+deg) → front of bed rises UP = backward dump.
   Materials slide toward rear tailgate (x=84, right side) as front is elevated. */
@keyframes bedTiltUp {

    /* 45s cycle: active 0%–33.33% (0s–15s), pause 33.33%–100% (15s–45s) */
    0% {
        transform: rotate(0deg);
    }

    10% {
        transform: rotate(0deg);
    }

    /* arrived (=4.5s) — begin tilt */
    12% {
        transform: rotate(35deg);
    }

    /* fully up (=5.4s) */
    14.67% {
        transform: rotate(35deg);
    }

    /* hold at peak (=6.6s) */
    16.33% {
        transform: rotate(0deg);
    }

    /* bed down before rotation (=7.35s) */
    100% {
        transform: rotate(0deg);
    }

    /* flat through 30s pause */
}

/* Hydraulic arm: base fixed on chassis under front of bed (x=46).
   When bed front rises (CW rotation), this arm pushes upward → also rotates CW */
@keyframes hydraulicExtend {
    0% {
        transform: rotate(0deg) scaleY(1);
    }

    10% {
        transform: rotate(0deg) scaleY(1);
    }

    /* arrived (=4.5s) — start extend */
    12% {
        transform: rotate(30deg) scaleY(1.5);
    }

    /* fully extended (=5.4s) */
    14.67% {
        transform: rotate(30deg) scaleY(1.5);
    }

    /* hold (=6.6s) */
    16.33% {
        transform: rotate(0deg) scaleY(1);
    }

    /* retracted (=7.35s) */
    100% {
        transform: rotate(0deg) scaleY(1);
    }

    /* retracted through 30s pause */
}

/* Cargo slides and falls out the rear tailgate (rightward +x when truck faces left) */
@keyframes cargoDisappear {
    0% {
        opacity: 1;
        transform: translate(0, 0);
    }

    11.33% {
        opacity: 1;
        transform: translate(0, 0);
    }

    /* cargo in bed while parked (=5.1s) */
    14.33% {
        opacity: 0;
        transform: translate(12px, 10px);
    }

    /* slid out as bed tilts (=6.45s) */
    100% {
        opacity: 0;
        transform: translate(12px, 10px);
    }

    /* hidden through 30s pause */
}

/* Materials spill and settle at the rear (right side, +x) of the truck */
@keyframes materialsSpill {
    0% {
        opacity: 0;
        transform: translate(0, -5px);
    }

    12% {
        opacity: 0;
        transform: translate(0, -5px);
    }

    /* hidden during travel (=5.4s) */
    13.67% {
        opacity: 1;
        transform: translate(10px, 5px);
    }

    /* spill at peak (=6.15s) */
    15% {
        opacity: 1;
        transform: translate(10px, 5px);
    }

    /* hold (=6.75s) */
    16.33% {
        opacity: 0;
        transform: translate(16px, 14px);
    }

    /* fade before rotation (=7.35s) */
    100% {
        opacity: 0;
        transform: translate(16px, 14px);
    }

    /* hidden through 30s pause */
}

/*
 * ── Exhaust Smoke Strategy ──────────────────────────────────────────────
 * 45s total cycle: 0s–15s active (truck moving/unloading), 15s–45s = 30s pause.
 * Active keyframe % = old_30s_% × (2/3)
 * PARKED window (10%–17.33%) and PAUSE window (27.33%–100%) are opacity:0.
 * ───────────────────────────────────────────────────────────────────────
 */
@keyframes exhaustSmoke {

    /* ── DRIVE-IN phase: 0% → 10% (= 0s–4.5s) ── */
    0% {
        opacity: 0;
        transform: translate(0, 0) scale(0.4);
    }

    0.33% {
        opacity: 0.7;
        transform: translate(3px, -3px) scale(0.8);
    }

    1% {
        opacity: 0.85;
        transform: translate(6px, -7px) scale(1.2);
    }

    1.67% {
        opacity: 0.6;
        transform: translate(9px, -11px) scale(1.6);
    }

    2.33% {
        opacity: 0;
        transform: translate(12px, -15px) scale(2.0);
    }

    2.37% {
        opacity: 0;
        transform: translate(0, 0) scale(0.4);
    }

    2.67% {
        opacity: 0.7;
        transform: translate(3px, -3px) scale(0.8);
    }

    3.33% {
        opacity: 0.85;
        transform: translate(6px, -7px) scale(1.2);
    }

    4% {
        opacity: 0.6;
        transform: translate(9px, -11px) scale(1.6);
    }

    4.67% {
        opacity: 0;
        transform: translate(12px, -15px) scale(2.0);
    }

    4.7% {
        opacity: 0;
        transform: translate(0, 0) scale(0.4);
    }

    5% {
        opacity: 0.7;
        transform: translate(3px, -3px) scale(0.8);
    }

    5.67% {
        opacity: 0.85;
        transform: translate(6px, -7px) scale(1.2);
    }

    6.33% {
        opacity: 0.6;
        transform: translate(9px, -11px) scale(1.6);
    }

    7% {
        opacity: 0;
        transform: translate(12px, -15px) scale(2.0);
    }

    7.03% {
        opacity: 0;
        transform: translate(0, 0) scale(0.4);
    }

    7.33% {
        opacity: 0.7;
        transform: translate(3px, -3px) scale(0.8);
    }

    8% {
        opacity: 0.85;
        transform: translate(6px, -7px) scale(1.2);
    }

    8.67% {
        opacity: 0.6;
        transform: translate(9px, -11px) scale(1.6);
    }

    9.33% {
        opacity: 0;
        transform: translate(12px, -15px) scale(2.0);
    }

    /* ── PARKED phase: 9.67%–17.33% — NO smoke ── */
    9.67% {
        opacity: 0;
        transform: translate(0, 0) scale(0.4);
    }

    17.33% {
        opacity: 0;
        transform: translate(0, 0) scale(0.4);
    }

    /* ── DRIVE-OUT phase: 17.33% → 27.33% (= 7.8s–12.3s) ── */
    17.4% {
        opacity: 0;
        transform: translate(0, 0) scale(0.4);
    }

    18% {
        opacity: 0.7;
        transform: translate(3px, -3px) scale(0.8);
    }

    18.67% {
        opacity: 0.85;
        transform: translate(6px, -7px) scale(1.2);
    }

    19.33% {
        opacity: 0.6;
        transform: translate(9px, -11px) scale(1.6);
    }

    20% {
        opacity: 0;
        transform: translate(12px, -15px) scale(2.0);
    }

    20.03% {
        opacity: 0;
        transform: translate(0, 0) scale(0.4);
    }

    20.67% {
        opacity: 0.7;
        transform: translate(3px, -3px) scale(0.8);
    }

    21.33% {
        opacity: 0.85;
        transform: translate(6px, -7px) scale(1.2);
    }

    22% {
        opacity: 0.6;
        transform: translate(9px, -11px) scale(1.6);
    }

    22.67% {
        opacity: 0;
        transform: translate(12px, -15px) scale(2.0);
    }

    22.7% {
        opacity: 0;
        transform: translate(0, 0) scale(0.4);
    }

    23.33% {
        opacity: 0.7;
        transform: translate(3px, -3px) scale(0.8);
    }

    24% {
        opacity: 0.85;
        transform: translate(6px, -7px) scale(1.2);
    }

    24.67% {
        opacity: 0.6;
        transform: translate(9px, -11px) scale(1.6);
    }

    25.33% {
        opacity: 0;
        transform: translate(12px, -15px) scale(2.0);
    }

    25.37% {
        opacity: 0;
        transform: translate(0, 0) scale(0.4);
    }

    26% {
        opacity: 0.7;
        transform: translate(3px, -3px) scale(0.8);
    }

    26.67% {
        opacity: 0.85;
        transform: translate(6px, -7px) scale(1.2);
    }

    27% {
        opacity: 0;
        transform: translate(12px, -15px) scale(2.0);
    }

    /* ── PAUSE phase: 27.33%–100% = 12.3s–45s — NO smoke ── */
    27.33% {
        opacity: 0;
        transform: translate(0, 0) scale(0.4);
    }

    100% {
        opacity: 0;
        transform: translate(0, 0) scale(0.4);
    }
}

@keyframes wheelRotate {

    /* Spinning while driving in: 0%–10% (=0s–4.5s) */
    0%,
    10% {
        transform: rotate(-720deg);
    }

    /* Stopped while parked and unloading: 10.1%–17.33% (=4.5s–7.8s) */
    10.1%,
    17.33% {
        transform: rotate(0deg);
    }

    /* Spinning while driving out: 17.4%–27.33% (=7.8s–12.3s) */
    17.4%,
    27.33% {
        transform: rotate(720deg);
    }

    /* Stopped off-screen + 30s pause: 27.4%–100% (=12.3s–45s) */
    27.4%,
    100% {
        transform: rotate(0deg);
    }
}

/* ── Mobile: truck stays inside navbar, runs along the header behind text ── */
@media (max-width: 991.98px) {
    .header-truck-wrapper {
        /* Keep inside the navbar, not pushed outside */
        top: 0;
        bottom: 0;
        left: 0;
        right: 0;
        transform: none;
        z-index: 1;
        overflow: hidden;
    }

    .header-truck {
        width: 60px;
        height: 26px;
        /*
         * MOBILE ALIGNMENT FIX:
         * On mobile the navbar stacks in columns (flex-direction:column).
         * The truck wrapper spans the FULL navbar height, so top:50% would
         * put the truck in the middle of the entire navbar — wrong.
         *
         * The construction animation (.construction-animation) is 60px tall
         * and sits in the first row which has 0.5rem (8px) top padding.
         * Construction ground line is at 92% of 60px = 55.2px from its top.
         * First row top offset: 8px (padding) → ground at 8 + 55 = 63px from navbar top.
         * Truck is 26px tall; wheel bottom is at ~85% of 26px = 22px from truck top.
         * So truck top = 63 - 22 = 41px from navbar top.
         */
        top: 41px;
        transform: translateX(100vw);
        animation: truckDriveMobile 45s linear infinite;
    }
}

@keyframes truckDriveMobile {

    /* ── ACTIVE phase: 0%–33.33% = 0s–15s | PAUSE: 33.33%–100% = 15s–45s ── */
    0% {
        transform: translateX(100vw) scaleX(1);
    }

    /* Truck parks at 10% (=4.5s) */
    10%,
    16.33% {
        transform: translateX(70px) scaleX(1);
    }

    /* Truck rotates at 17.33% (=7.8s) */
    17.33% {
        transform: translateX(70px) scaleX(-1);
    }

    /* Truck off-screen at 27.33% (=12.3s) */
    27.33% {
        transform: translateX(calc(100vw + 80px)) scaleX(-1);
    }

    /* Snap to start direction at 27.67% (=12.45s), hold off-screen for 30s pause */
    27.67%,
    100% {
        transform: translateX(calc(100vw + 80px)) scaleX(1);
    }
}

/* ── Construction SVG Animation ── */
.construction-animation {
    position: relative;
    /* establish stacking context so z-index works */
    z-index: 3;
    /* sits above truck wrapper (z-index:1) */
    width: 160px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.98;
    transition: opacity 0.3s ease, transform 0.3s ease;
    background: transparent !important;
    overflow: visible;
}

.construction-animation:hover {
    opacity: 1;
    transform: scale(1.04);
}

.construction-svg {
    width: 100%;
    height: 100%;
    overflow: visible;
    background: transparent !important;
}

/* Red Aviation Warning Beacon Light */
.crane-beacon {
    animation: beaconBlink 1.2s ease-in-out infinite;
    transform-origin: 25px 1px;
}

@keyframes beaconBlink {

    0%,
    100% {
        opacity: 0.3;
        transform: scale(0.9);
    }

    50% {
        opacity: 1;
        transform: scale(1.3);
    }
}

/* Active Joint Welding Flash Spark */
.welding-spark {
    animation: sparkFlash 2.5s ease-in-out infinite;
    transform-origin: 124px 22px;
}

@keyframes sparkFlash {

    0%,
    40%,
    100% {
        opacity: 0;
        transform: scale(0.5);
    }

    48% {
        opacity: 1;
        transform: scale(1.5);
    }

    54% {
        opacity: 0.2;
        transform: scale(0.8);
    }

    60% {
        opacity: 0.9;
        transform: scale(1.3);
    }

    66% {
        opacity: 0;
        transform: scale(0.5);
    }
}

/* Crane Hoist Assembly (Trolley + Cable + Load) Movement */
.crane-hoist-assembly {
    animation: buildingTrolley 9s ease-in-out infinite;
}

@keyframes buildingTrolley {
    0% {
        transform: translateX(48px);
    }

    30% {
        transform: translateX(48px);
    }

    55% {
        transform: translateX(124px);
    }

    80% {
        transform: translateX(124px);
    }

    100% {
        transform: translateX(48px);
    }
}

/* Hoist Lifting & Lowering Load */
.hoist-load-group {
    animation: buildingHoist 9s ease-in-out infinite;
}

@keyframes buildingHoist {
    0% {
        transform: translateY(12px);
    }

    /* Lowered at supply stack */
    15% {
        transform: translateY(0px);
    }

    /* Hoisted up high */
    30% {
        transform: translateY(0px);
    }

    /* Carrying across high */
    45% {
        transform: translateY(16px);
    }

    /* Lowered onto top floor */
    65% {
        transform: translateY(16px);
    }

    /* Placing slab & installing */
    75% {
        transform: translateY(0px);
    }

    /* Lifting empty hook */
    100% {
        transform: translateY(12px);
    }
}

/* Cable Stretch */
.hoist-cable-1,
.hoist-cable-2 {
    animation: buildingCable 9s ease-in-out infinite;
    transform-origin: 0px 12.5px;
}

@keyframes buildingCable {
    0% {
        transform: scaleY(1.7);
    }

    15% {
        transform: scaleY(1);
    }

    30% {
        transform: scaleY(1);
    }

    45% {
        transform: scaleY(1.9);
    }

    65% {
        transform: scaleY(1.9);
    }

    75% {
        transform: scaleY(1);
    }

    100% {
        transform: scaleY(1.7);
    }
}

/* Building Floors Making / Growing Animation */
.bld-floor-1 {
    animation: floorBuild1 9s ease-in-out infinite;
    transform-origin: 124px 60px;
}

@keyframes floorBuild1 {

    0%,
    100% {
        opacity: 0.7;
        transform: scaleY(0.9);
    }

    20%,
    85% {
        opacity: 1;
        transform: scaleY(1);
    }
}

.bld-floor-2 {
    animation: floorBuild2 9s ease-in-out infinite;
    transform-origin: 124px 49px;
}

@keyframes floorBuild2 {

    0%,
    15% {
        opacity: 0;
        transform: translateY(8px) scaleY(0.2);
    }

    35%,
    85% {
        opacity: 1;
        transform: translateY(0) scaleY(1);
    }

    95%,
    100% {
        opacity: 0;
        transform: translateY(8px) scaleY(0.2);
    }
}

.bld-floor-3 {
    animation: floorBuild3 9s ease-in-out infinite;
    transform-origin: 124px 37px;
}

@keyframes floorBuild3 {

    0%,
    45% {
        opacity: 0;
        transform: translateY(8px) scaleY(0.2);
    }

    60%,
    85% {
        opacity: 1;
        transform: translateY(0) scaleY(1);
    }

    95%,
    100% {
        opacity: 0;
        transform: translateY(8px) scaleY(0.2);
    }
}

/* Carried Slab Visibility (disappears when placed onto top floor) */
.carried-slab {
    animation: slabPlacing 9s ease-in-out infinite;
}

@keyframes slabPlacing {

    0%,
    55% {
        opacity: 1;
    }

    60%,
    75% {
        opacity: 0;
    }

    80%,
    100% {
        opacity: 1;
    }
}

/* ── Header Title — Unique Modern Architectural Font + Harmonized Gradients ── */
.rup-header-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    line-height: 1.15;
}

.rup-header-title {
    text-transform: uppercase;
    letter-spacing: 1.2px;
    font-weight: 800;
    font-size: clamp(1.08rem, 2.1vw, 1.48rem) !important;
    display: inline-flex;
    align-items: baseline;
    line-height: 1;
}

.rup-header-tagline {
    font-family: 'Space Grotesk', 'Outfit', sans-serif;
    font-size: clamp(0.68rem, 1.1vw, 0.88rem);
    font-weight: 600;
    color: #ffffff !important;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    line-height: 1.2;
    margin-top: 3px;
    opacity: 0.98;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.95);
    pointer-events: none;
    user-select: none;
    animation: none !important;
    transition: none !important;
}

.rup-title-group {
    display: inline-flex;
    align-items: baseline;
    white-space: nowrap;
}

.rup-title-break-space {
    display: inline-block;
    width: 0.5em;
}

.rup-title-letter {
    display: inline-block;
    font-size: 1em;
    transform: scale(1);
    will-change: transform, filter;
}

/*
 * RUPSON: Warm radiant gold & amber gradient matching construction accents
 */
.rup-rupson-letter {
    font-family: 'Syne', 'Outfit', sans-serif !important;
    font-size: 1.28em !important;
    font-weight: 800 !important;
    line-height: 1;
    vertical-align: baseline;
    letter-spacing: 0.05em;
    background: linear-gradient(135deg,
            #ffffff 0%,
            #fffbeb 15%,
            #fde68a 35%,
            #f59e0b 70%,
            #d97706 90%,
            #b45309 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent !important;
    text-shadow: none;
    position: relative;
    background-size: 100% 200%;
    filter:
        drop-shadow(0 2px 4px rgba(0, 0, 0, 0.75))
        drop-shadow(0 0 14px rgba(245, 158, 11, 0.45))
        drop-shadow(0 0 24px rgba(217, 119, 6, 0.25));
    animation: rupsonStrikePaused 13s cubic-bezier(0.25, 1, 0.5, 1) infinite;
    animation-delay: calc(var(--ri, 0) * 0.10s);
}

/* Gloss sweep sheen over each RUPSON letter */
.rup-rupson-letter::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(110deg,
            transparent 0%,
            rgba(255, 255, 255, 0.45) 42%,
            rgba(255, 255, 255, 0.85) 50%,
            rgba(255, 255, 255, 0.45) 58%,
            transparent 100%);
    background-size: 300% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    pointer-events: none;
    z-index: 3;
    animation: rupsonSheenPaused 13s ease-in-out infinite;
    animation-delay: calc(var(--ri, 0) * 0.10s);
}

/* RUPSON keyframes — 13s cycle */
@keyframes rupsonStrikePaused {
    0%,
    11.5%,
    100% {
        transform: scale(1) translateY(0);
        filter:
            drop-shadow(0 2px 4px rgba(0, 0, 0, 0.75))
            drop-shadow(0 0 14px rgba(245, 158, 11, 0.45))
            drop-shadow(0 0 24px rgba(217, 119, 6, 0.25));
    }

    3.5% {
        transform: scale(1.06) translateY(-4px);
        filter:
            drop-shadow(0 3px 6px rgba(0, 0, 0, 0.8))
            drop-shadow(0 0 20px rgba(245, 158, 11, 0.65))
            drop-shadow(0 0 35px rgba(254, 240, 138, 0.4));
    }

    6.5% {
        transform: scaleX(1.08) scaleY(0.92) translateY(1.5px);
        filter:
            drop-shadow(0 1px 2px rgba(0, 0, 0, 0.6))
            drop-shadow(0 0 24px rgba(245, 158, 11, 0.75))
            drop-shadow(0 0 40px rgba(217, 119, 6, 0.5));
    }

    8.8% {
        transform: scaleX(0.98) scaleY(1.04) translateY(-1px);
        filter:
            drop-shadow(0 2px 4px rgba(0, 0, 0, 0.7))
            drop-shadow(0 0 16px rgba(245, 158, 11, 0.5))
            drop-shadow(0 0 28px rgba(254, 240, 138, 0.3));
    }
}

/* Sheen for RUPSON */
@keyframes rupsonSheenPaused {
    0% {
        background-position: -200% 0;
    }

    4.6% {
        background-position: 0% 0;
    }

    9.2%,
    100% {
        background-position: 300% 0;
    }
}

/*
 * CONSTRUCTION: Frosted iridescent platinum-lavender-sapphire gradient matching header backdrop
 */
.rup-construction-letter {
    font-family: 'Space Grotesk', 'Syne', sans-serif !important;
    font-size: 1.04em !important;
    font-weight: 700 !important;
    line-height: 1;
    vertical-align: baseline;
    letter-spacing: 0.16em;
    background: linear-gradient(135deg,
            #ffffff 0%,
            #f1f5f9 20%,
            #e0e7ff 45%,
            #c084fc 75%,
            #a855f7 90%,
            #7c3aed 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent !important;
    text-shadow: none;
    position: relative;
    background-size: 100% 200%;
    filter:
        drop-shadow(0 2px 4px rgba(0, 0, 0, 0.7))
        drop-shadow(0 0 12px rgba(192, 132, 252, 0.4))
        drop-shadow(0 0 20px rgba(124, 58, 237, 0.2));
    animation: constructionStrikePaused 15s cubic-bezier(0.25, 1, 0.5, 1) infinite;
    animation-delay: calc(var(--ci, 0) * 0.13s);
}

/* Gloss sweep sheen for CONSTRUCTION */
.rup-construction-letter::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(110deg,
            transparent 0%,
            rgba(255, 255, 255, 0.45) 42%,
            rgba(255, 255, 255, 0.85) 50%,
            rgba(255, 255, 255, 0.45) 58%,
            transparent 100%);
    background-size: 300% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    pointer-events: none;
    z-index: 3;
    animation: constructionSheenPaused 15s ease-in-out infinite;
    animation-delay: calc(var(--ci, 0) * 0.13s);
}

/* CONSTRUCTION keyframes — 15s cycle */
@keyframes constructionStrikePaused {
    0%,
    16.5%,
    100% {
        transform: scale(1) translateY(0);
        filter:
            drop-shadow(0 2px 4px rgba(0, 0, 0, 0.7))
            drop-shadow(0 0 12px rgba(192, 132, 252, 0.4))
            drop-shadow(0 0 20px rgba(124, 58, 237, 0.2));
    }

    5% {
        transform: scale(1.05) translateY(-4px);
        filter:
            drop-shadow(0 3px 6px rgba(0, 0, 0, 0.8))
            drop-shadow(0 0 18px rgba(192, 132, 252, 0.6))
            drop-shadow(0 0 32px rgba(224, 231, 255, 0.35));
    }

    9.3% {
        transform: scaleX(1.08) scaleY(0.92) translateY(1.5px);
        filter:
            drop-shadow(0 1px 2px rgba(0, 0, 0, 0.6))
            drop-shadow(0 0 22px rgba(192, 132, 252, 0.7))
            drop-shadow(0 0 36px rgba(124, 58, 237, 0.45));
    }

    12.5% {
        transform: scaleX(0.98) scaleY(1.04) translateY(-1px);
        filter:
            drop-shadow(0 2px 4px rgba(0, 0, 0, 0.7))
            drop-shadow(0 0 14px rgba(192, 132, 252, 0.45))
            drop-shadow(0 0 24px rgba(224, 231, 255, 0.25));
    }
}

/* Sheen for CONSTRUCTION */
@keyframes constructionSheenPaused {
    0% {
        background-position: -200% 0;
    }

    6.6% {
        background-position: 0% 0;
    }

    13.2%,
    100% {
        background-position: 300% 0;
    }
}

/* Space between RUPSON and CONSTRUCTION */
.rup-title-space {
    display: inline-block;
    width: 0.55em;
}

/* ── Document View Modes (Extra Large, Large, Small, List) ── */
.doc-view-controls {
    user-select: none;
}

.doc-grid-container {
    --doc-col: 4;
    --doc-img-h: 210px;
    display: grid;
    grid-template-columns: repeat(var(--doc-col), 1fr);
    gap: 1rem;
}

.doc-grid-container[data-view="xl"] {
    --doc-col: 4;
    --doc-img-h: 210px;
}

.doc-grid-container[data-view="lg"] {
    --doc-col: 6;
    --doc-img-h: 150px;
}

.doc-grid-container[data-view="sm"] {
    --doc-col: 8;
    --doc-img-h: 80px;
}

.doc-grid-container[data-view="list"] {
    --doc-col: 1;
    --doc-img-h: 60px;
}

.doc-grid-container .doc-card-item {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.doc-grid-container .doc-card-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1) !important;
}

.doc-grid-container .doc-img-wrap {
    height: var(--doc-img-h);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #1a1a1a;
    cursor: pointer;
    position: relative;
}

.doc-grid-container .doc-img-wrap img {
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: var(--doc-img-h) !important;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.doc-grid-container .doc-card-item:hover .doc-img-wrap img {
    transform: scale(1.05);
}

.doc-grid-container .doc-img-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    opacity: 0;
    transition: opacity 0.25s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
}

.doc-grid-container .doc-card-item:hover .doc-img-overlay {
    opacity: 1;
}

/* List view: show only name, hide the image box */
.doc-grid-container[data-view="list"] .doc-img-wrap {
    display: none;
}

.doc-grid-container[data-view="list"] .doc-card-item {
    display: flex;
    align-items: center;
    padding: 0.5rem 0.75rem;
}

.doc-grid-container[data-view="list"] .doc-card-body {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0;
    border: none;
}

.doc-grid-container[data-view="list"] .doc-card-title {
    margin: 0;
    font-size: 0.9rem;
}

.doc-grid-container[data-view="list"] .doc-card-actions {
    display: flex;
    gap: 0.25rem;
    flex-shrink: 0;
}

.doc-grid-container[data-view="list"] .doc-card-meta {
    display: none;
}

/* Small view: hide meta and buttons, show only icon + name */
.doc-grid-container[data-view="sm"] .doc-card-meta,
.doc-grid-container[data-view="sm"] .doc-card-actions {
    display: none;
}

.doc-grid-container[data-view="sm"] .doc-card-body {
    padding: 0.4rem;
}

.doc-grid-container[data-view="sm"] .doc-card-title {
    font-size: 0.7rem;
    text-align: center;
    margin: 0;
}

@media (max-width: 767.98px) {
    .doc-grid-container[data-view="xl"] {
        --doc-col: 2;
    }

    .doc-grid-container[data-view="lg"] {
        --doc-col: 3;
    }

    .doc-grid-container[data-view="sm"] {
        --doc-col: 4;
    }
}

/* ── Welcome Section — Designable & Animated Name ── */
.rup-welcome-hero {
    background: linear-gradient(135deg, #1a237e 0%, #283593 50%, #3949ab 100%);
    border-radius: 12px;
    color: #fff;
    padding: 1.2rem 1.5rem;
    position: relative;
    overflow: hidden;
    text-align: center;
}

.rup-welcome-hero::before {
    content: '';
    position: absolute;
    top: -40px;
    right: -40px;
    width: 160px;
    height: 160px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
}

.rup-welcome-hero::after {
    content: '';
    position: absolute;
    bottom: -50px;
    left: -30px;
    width: 180px;
    height: 180px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 50%;
}

/* ── Animated Circular Profile Border Design ── */
.rup-welcome-avatar-wrap {
    cursor: pointer;
    position: relative;
    display: inline-block;
    padding: 6px;
    border-radius: 50%;
    background: transparent;
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Outer Spinning Animated Conic Gradient Ring */
.rup-welcome-avatar-wrap::before {
    content: "";
    position: absolute;
    inset: 0px;
    border-radius: 50%;
    padding: 4px;
    background: conic-gradient(from 0deg,
            #fbbf24 0%,
            #f59e0b 25%,
            #38bdf8 50%,
            #e0e7ff 75%,
            #fbbf24 100%);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: exclude;
    animation: avatarBorderSpin 4s linear infinite;
    z-index: 1;
}

/* Glowing Backlight Aura */
.rup-welcome-avatar-wrap::after {
    content: "";
    position: absolute;
    inset: -3px;
    border-radius: 50%;
    background: conic-gradient(from 0deg,
            rgba(251, 191, 36, 0.7),
            rgba(245, 158, 11, 0.7),
            rgba(56, 189, 248, 0.7),
            rgba(251, 191, 36, 0.7));
    filter: blur(10px);
    opacity: 0.7;
    z-index: 0;
    animation: avatarBorderSpin 4s linear infinite, avatarAuraGlow 3s ease-in-out infinite;
}

.rup-welcome-avatar-wrap:hover {
    transform: scale(1.08);
}

.rup-welcome-avatar-wrap:hover::after {
    opacity: 1;
    filter: blur(14px);
}

.rup-welcome-avatar {
    position: relative;
    z-index: 2;
    width: 92px;
    height: 92px;
    object-fit: cover;
    border-radius: 50%;
    border: 3px solid #ffffff !important;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4) !important;
    transition: box-shadow 0.3s ease;
}

@keyframes avatarBorderSpin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

@keyframes avatarAuraGlow {

    0%,
    100% {
        opacity: 0.6;
    }

    50% {
        opacity: 0.95;
    }
}



.rup-welcome-title {
    font-size: clamp(1.1rem, 2.4vw, 1.6rem);
    letter-spacing: 0.5px;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.rup-welcome-name {
    display: inline-block;
    margin-left: 0.5rem;
    background: linear-gradient(90deg, #ffd54f, #ff8f00, #ffd54f);
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    animation: welcomeNameShine 4s linear infinite, welcomeNamePulse 4s ease-in-out infinite;
    font-weight: 900;
}

.rup-welcome-clock-wrap {
    display: flex;
    justify-content: center;
    align-items: center;
}

.rup-welcome-clock {
    background: rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 50px;
    padding: 3px 14px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.rup-welcome-clock-time {
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace, sans-serif;
    font-weight: 700;
    font-size: 0.95rem;
    color: #ffffff;
    letter-spacing: 1px;
    display: inline-block;
    transition: transform 0.15s ease, text-shadow 0.15s ease;
}

.rup-welcome-clock-time.tick-pulse {
    animation: clockPulseFlip 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes welcomeNameShine {
    0% {
        background-position: 0% center;
    }

    50% {
        background-position: 100% center;
    }

    100% {
        background-position: 0% center;
    }
}

@keyframes welcomeNamePulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.08);
    }
}

.rup-welcome-role {
    font-size: 0.9rem;
    letter-spacing: 0.5px;
    color: rgba(255, 255, 255, 0.9);
}

.rup-welcome-role-badge {
    color: #1a237e !important;
    font-size: 0.8rem;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.rup-welcome-portal {
    margin-left: 0.5rem;
    font-weight: 500;
    opacity: 0.85;
}

@media (max-width: 575.98px) {
    .rup-welcome-hero {
        padding: 1rem 0.75rem;
    }

    .rup-welcome-avatar {
        width: 76px;
        height: 76px;
    }

    .rup-welcome-title {
        font-size: 1rem;
    }

    .rup-welcome-role {
        font-size: 0.8rem;
    }
}

/* ── Profile Dropdown — Stylish & Animated ── */
.rup-profile-btn {
    width: 44px;
    height: 44px;
    border-radius: 50% !important;
    background: rgba(255, 255, 255, 0.12) !important;
    border: 2px solid rgba(255, 255, 255, 0.35) !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
    padding: 0 !important;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
}

.rup-profile-btn:hover {
    background: rgba(255, 255, 255, 0.25) !important;
    border-color: #ffd54f !important;
    transform: scale(1.1) rotate(8deg);
    box-shadow: 0 4px 18px rgba(255, 213, 79, 0.35);
}

.rup-profile-btn:focus {
    box-shadow: 0 0 0 0.25rem rgba(255, 213, 79, 0.3) !important;
}

.rup-profile-btn .rup-profile-icon {
    font-size: 1.5rem;
    color: #fff;
    transition: transform 0.3s ease;
}

.rup-profile-btn:hover .rup-profile-icon {
    transform: scale(1.15);
}

.rup-profile-btn::after {
    display: none !important;
}

/* Dropdown menu — glassmorphic */
.rup-profile-menu {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 213, 79, 0.4);
    border-radius: 14px;
    box-shadow: 0 12px 40px rgba(26, 35, 126, 0.25);
    padding: 8px;
    min-width: 220px;
    animation: dropMenuIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) both;
    transform-origin: top right;
}

@keyframes dropMenuIn {
    0% {
        opacity: 0;
        transform: translateY(-12px) scale(0.92);
    }

    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Dropdown items */
.rup-drop-item {
    border-radius: 10px;
    padding: 10px 14px;
    font-weight: 600;
    color: #1a237e;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    overflow: hidden;
}

.rup-drop-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(180deg, #ffd54f, #ff8f00);
    border-radius: 0 4px 4px 0;
    transform: scaleY(0);
    transition: transform 0.25s ease;
}

.rup-drop-item:hover {
    background: linear-gradient(135deg, #e8eaf6, #c5cae9) !important;
    color: #1a237e !important;
    transform: translateX(6px);
    box-shadow: 0 4px 12px rgba(26, 35, 126, 0.15);
}

.rup-drop-item:hover::before {
    transform: scaleY(1);
}

.rup-drop-item .rup-drop-icon {
    font-size: 1.1rem;
    color: #3949ab;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.rup-drop-item:hover .rup-drop-icon {
    transform: scale(1.25) rotate(-8deg);
    color: #ff8f00;
}

/* Mobile adjustments */
@media (max-width: 575.98px) {
    .construction-animation {
        width: 90px;
        height: 45px;
    }

    .rup-header-title {
        font-size: clamp(0.88rem, 3.5vw, 1.08rem) !important;
        letter-spacing: 0.8px;
    }

    .rup-header-tagline {
        font-size: clamp(0.55rem, 2.1vw, 0.68rem) !important;
        letter-spacing: 0.14em;
    }

    .rup-profile-btn {
        width: 38px;
        height: 38px;
    }

    .rup-profile-btn .rup-profile-icon {
        font-size: 1.2rem;
    }
}

/* 3D Model Viewer Card Styles */
.glb-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.glb-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.12) !important;
}

/* ══════════════════════════════════════════════════════════
   Header Profile Symbolic Man Explorer & Walk Animation
   ══════════════════════════════════════════════════════════ */
.rup-profile-svg-icon {
    display: block;
    overflow: visible;
    color: #ffffff;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.rup-profile-btn:hover .rup-profile-svg-icon {
    transform: scale(1.15);
    color: #ffd54f;
}

.rup-prof-ring {
    stroke: currentColor;
    transition: stroke 0.35s ease, filter 0.35s ease;
}

.rup-prof-ring.prof-ring-active {
    stroke: #fbbf24 !important;
    filter: drop-shadow(0 0 6px rgba(251, 191, 36, 0.85));
}

.rup-prof-inner-person {
    transform-origin: 16px 16px;
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.35s ease;
}

.rup-prof-inner-person.prof-inner-hidden {
    transform: scale(0);
    opacity: 0;
}


.rup-symbolic-walker {
    position: absolute;
    width: 44px;
    height: 58px;
    z-index: 1050;
    pointer-events: auto;
    cursor: pointer;
    transform-origin: center bottom;
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.25s ease;
    user-select: none;
    will-change: left, top, transform;
}

.rup-symbolic-walker:hover {
    filter: drop-shadow(0 0 10px rgba(251, 191, 36, 0.95)) brightness(1.12);
}

.rup-symbolic-walker.mode-hidden {
    display: none !important;
    opacity: 0;
    pointer-events: none;
}

.rup-walker-svg {
    width: 100%;
    height: 100%;
    overflow: visible;
    display: block;
}

/* Facing directions */
.rup-symbolic-walker.facing-left {
    transform: scaleX(1);
}

.rup-symbolic-walker.facing-right {
    transform: scaleX(-1);
}

/* Walking Shadow */
.walker-shadow {
    position: absolute;
    bottom: 2px;
    left: 8px;
    right: 8px;
    height: 6px;
    background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.55) 0%, rgba(0, 0, 0, 0) 75%);
    border-radius: 50%;
    pointer-events: none;
    z-index: -1;
    animation: walkerShadowPulse 0.65s ease-in-out infinite alternate;
}

/* Alert Bubble on Panic Run */
.walker-alert-bubble {
    opacity: 0;
    transform: scale(0);
    transform-origin: 32px 7px;
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.2s ease;
}

.rup-symbolic-walker.panic-alert .walker-alert-bubble {
    opacity: 1;
    transform: scale(1.2);
    animation: walkerAlertShake 0.4s ease-in-out infinite alternate;
}

/* Mode: Emerging from Icon */
.rup-symbolic-walker.mode-emerging {
    animation: walkerEmerge 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* Mode: Entering back into Icon */
.rup-symbolic-walker.mode-entering {
    animation: walkerEnter 0.55s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

/* ── WALKING CYCLE ── */
.rup-symbolic-walker.mode-walking .walker-torso {
    animation: walkerBodyBob 0.65s ease-in-out infinite;
}

.rup-symbolic-walker.mode-walking .walker-head-group {
    animation: walkerHeadBob 0.65s ease-in-out infinite;
}

.rup-symbolic-walker.mode-walking .walker-leg-left {
    transform-origin: 28px 46px;
    animation: walkerLegStrideLeft 0.65s ease-in-out infinite alternate;
}

.rup-symbolic-walker.mode-walking .walker-leg-right {
    transform-origin: 36px 46px;
    animation: walkerLegStrideRight 0.65s ease-in-out infinite alternate;
}

.rup-symbolic-walker.mode-walking .walker-arm-left {
    transform-origin: 27px 26px;
    animation: walkerArmSwingLeft 0.65s ease-in-out infinite alternate;
}

.rup-symbolic-walker.mode-walking .walker-arm-right {
    transform-origin: 37px 26px;
    animation: walkerArmSwingRight 0.65s ease-in-out infinite alternate;
}

.rup-symbolic-walker.mode-walking .walker-hand .finger {
    animation: walkerFingerGrip 0.65s ease-in-out infinite alternate;
}

/* ── LOOKING AROUND AT RUPSON CONSTRUCTION ── */
.rup-symbolic-walker.mode-looking .walker-head-group {
    transform-origin: 32px 18px;
    animation: walkerLookAroundHead 2.6s ease-in-out infinite;
}

.rup-symbolic-walker.mode-looking .walker-arm-right {
    transform-origin: 37px 26px;
    animation: walkerPointHand 2.6s ease-in-out infinite;
}

.rup-symbolic-walker.mode-looking .walker-hand-right .finger {
    animation: walkerFingerPoint 2.6s ease-in-out infinite;
}

.rup-symbolic-walker.mode-looking .walker-torso {
    animation: walkerIdleBreathing 1.8s ease-in-out infinite;
}

/* ── PANIC RUNNING CYCLE ── */
.rup-symbolic-walker.mode-running {
    transform: scaleX(-1) skewX(8deg);
}

.rup-symbolic-walker.mode-running .walker-torso {
    animation: walkerRunBodyBob 0.22s ease-in-out infinite;
}

.rup-symbolic-walker.mode-running .walker-head-group {
    animation: walkerRunHeadBob 0.22s ease-in-out infinite;
}

.rup-symbolic-walker.mode-running .walker-leg-left {
    transform-origin: 28px 46px;
    animation: walkerRunLegLeft 0.22s ease-in-out infinite alternate;
}

.rup-symbolic-walker.mode-running .walker-leg-right {
    transform-origin: 36px 46px;
    animation: walkerRunLegRight 0.22s ease-in-out infinite alternate;
}

.rup-symbolic-walker.mode-running .walker-arm-left {
    transform-origin: 27px 26px;
    animation: walkerRunArmLeft 0.22s ease-in-out infinite alternate;
}

.rup-symbolic-walker.mode-running .walker-arm-right {
    transform-origin: 37px 26px;
    animation: walkerRunArmRight 0.22s ease-in-out infinite alternate;
}

/* Keyframes */
@keyframes walkerEmerge {
    0% {
        transform: scale(0) translateY(8px);
        opacity: 0;
    }

    60% {
        transform: scale(1.18) translateY(-4px);
        opacity: 1;
    }

    100% {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

@keyframes walkerEnter {
    0% {
        transform: scaleX(-1) scale(1) translateY(0);
        opacity: 1;
    }

    40% {
        transform: scaleX(-1) scale(1.2) translateY(-4px);
        opacity: 1;
    }

    100% {
        transform: scaleX(-1) scale(0) translateY(8px);
        opacity: 0;
    }
}

@keyframes walkerBodyBob {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-2.5px);
    }
}

@keyframes walkerHeadBob {

    0%,
    100% {
        transform: translateY(0) rotate(0deg);
    }

    50% {
        transform: translateY(-2px) rotate(-1.5deg);
    }
}

@keyframes walkerLegStrideLeft {
    0% {
        transform: rotate(-24deg);
    }

    100% {
        transform: rotate(24deg);
    }
}

@keyframes walkerLegStrideRight {
    0% {
        transform: rotate(24deg);
    }

    100% {
        transform: rotate(-24deg);
    }
}

@keyframes walkerArmSwingLeft {
    0% {
        transform: rotate(26deg);
    }

    100% {
        transform: rotate(-26deg);
    }
}

@keyframes walkerArmSwingRight {
    0% {
        transform: rotate(-26deg);
    }

    100% {
        transform: rotate(26deg);
    }
}

@keyframes walkerFingerGrip {
    0% {
        transform: scale(0.95);
    }

    100% {
        transform: scale(1.08);
    }
}

@keyframes walkerShadowPulse {
    0% {
        transform: scaleX(0.85);
        opacity: 0.45;
    }

    100% {
        transform: scaleX(1.1);
        opacity: 0.75;
    }
}

@keyframes walkerAlertShake {
    0% {
        transform: scale(1.2) rotate(-6deg);
    }

    100% {
        transform: scale(1.3) rotate(6deg);
    }
}

/* Looking Around Keyframes */
@keyframes walkerLookAroundHead {

    0%,
    100% {
        transform: rotate(0deg);
    }

    20% {
        transform: rotate(-16deg);
    }

    45% {
        transform: rotate(18deg);
    }

    70% {
        transform: rotate(-10deg);
    }

    85% {
        transform: rotate(8deg);
    }
}

@keyframes walkerPointHand {

    0%,
    100% {
        transform: rotate(0deg);
    }

    25% {
        transform: rotate(-48deg) translateY(-3px);
    }

    60% {
        transform: rotate(-55deg) translateY(-4px);
    }

    80% {
        transform: rotate(-20deg);
    }
}

@keyframes walkerFingerPoint {

    0%,
    100% {
        transform: scale(1);
    }

    30%,
    65% {
        transform: scale(1.2) rotate(-8deg);
    }
}

@keyframes walkerIdleBreathing {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.02);
    }
}

/* Running Keyframes (High Speed) */
@keyframes walkerRunBodyBob {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-4px);
    }
}

@keyframes walkerRunHeadBob {

    0%,
    100% {
        transform: translateY(0) rotate(-3deg);
    }

    50% {
        transform: translateY(-3px) rotate(3deg);
    }
}

@keyframes walkerRunLegLeft {
    0% {
        transform: rotate(-45deg);
    }

    100% {
        transform: rotate(45deg);
    }
}

@keyframes walkerRunLegRight {
    0% {
        transform: rotate(45deg);
    }

    100% {
        transform: rotate(-45deg);
    }
}

@keyframes walkerRunArmLeft {
    0% {
        transform: rotate(50deg);
    }

    100% {
        transform: rotate(-50deg);
    }
}

@keyframes walkerRunArmRight {
    0% {
        transform: rotate(-50deg);
    }

    100% {
        transform: rotate(50deg);
    }
}