/* ============================
   ALQUDRA Contractor Portal — Design System v2
   ============================ */
:root {
    --navy: #132D41;
    --navy-light: #1D4260;
    --navy-lighter: #2A5578;
    --charcoal: #2D2D2D;
    --white: #FFFFFF;
    --black: #000000;
    --bg: #F3F5F7;
    --surface: #FFFFFF;
    --border: #E5E8EC;
    --border-light: #EFF1F4;
    --text: #1C232C;
    --text-muted: #707B87;
    --text-faint: #A0A8B1;
    --success-bg: #E6F6ED;
    --success-text: #1E8E4F;
    --warning-bg: #FEF3DD;
    --warning-text: #B77714;
    --danger-bg: #FCE9E7;
    --danger-text: #C1392B;
    --info-bg: #E8F0FA;
    --info-text: #2563AC;
    --radius-sm: 6px;
    --radius: 10px;
    --radius-lg: 14px;
    --shadow-sm: 0 1px 2px rgba(19,45,65,0.06);
    --shadow: 0 2px 8px rgba(19,45,65,0.08);
    --shadow-lg: 0 8px 24px rgba(19,45,65,0.12);
    --font: 'Almarai', sans-serif;
    --font-mono: 'IBM Plex Mono', monospace;
}

* {
    box-sizing: border-box;
}

body {
    font-family: var(--font);
    background-color: var(--bg);
    color: var(--text);
    margin: 0;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, .brand-title {
    font-family: var(--font);
    font-weight: 800;
    color: var(--navy);
    margin: 0;
}

h3 {
    font-size: 1.4rem;
}

h4 {
    font-size: 1.1rem;
}

h5 {
    font-size: 0.98rem;
}

.mono {
    font-family: var(--font-mono);
    letter-spacing: 0.2px;
}

a {
    color: var(--navy);
}

/* Buttons */
.btn-primary {
    background-color: var(--navy) !important;
    border-color: var(--navy) !important;
    border-radius: var(--radius-sm) !important;
    font-weight: 700;
    padding: 0.55rem 1.3rem !important;
    transition: all 0.15s ease;
}

    .btn-primary:hover {
        background-color: var(--navy-light) !important;
        border-color: var(--navy-light) !important;
        transform: translateY(-1px);
        box-shadow: var(--shadow);
    }

.btn-outline-secondary, .btn-outline-primary, .btn-outline-danger {
    border-radius: var(--radius-sm) !important;
    font-weight: 600;
}

/* Layout Shell */
.app-shell {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 264px;
    background: var(--navy);
    color: #DDE4EC;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.sidebar-header {
    padding: 1.75rem 1.5rem 1.5rem;
    text-align: center;
}

    .sidebar-header img {
        max-width: 100%;
        max-height: 50px;
        width: auto;
        height: auto;
    }

.sidebar-nav {
    padding: 0.5rem 0.85rem;
    flex: 1;
}

    .sidebar-nav .nav-item + .nav-item {
        margin-top: 0.15rem;
    }

    .sidebar-nav .nav-link {
        display: flex;
        align-items: center;
        gap: 0.7rem;
        padding: 0.68rem 0.9rem;
        border-radius: var(--radius-sm);
        color: #B7C2CE;
        font-size: 0.9rem;
        font-weight: 600;
        text-decoration: none;
        transition: background 0.15s ease, color 0.15s ease;
    }

        .sidebar-nav .nav-link:hover {
            background: rgba(255,255,255,0.07);
            color: #fff;
        }

        .sidebar-nav .nav-link.active {
            background: var(--white);
            color: var(--navy);
            box-shadow: var(--shadow-sm);
        }

    .sidebar-nav .nav-icon {
        width: 18px;
        text-align: center;
        opacity: 0.85;
        font-size: 0.95rem;
    }

.sidebar-footer {
    padding: 1.1rem 1.5rem;
    border-top: 1px solid rgba(255,255,255,0.08);
    font-size: 0.68rem;
    color: rgba(255,255,255,0.4);
    text-align: center;
    line-height: 1.6;
}

/* Main content + Topbar */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.topbar {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 10;
}

    .topbar .breadcrumb-label {
        font-size: 1rem;
        font-weight: 800;
        color: var(--navy);
    }

    .topbar .user-chip {
        display: flex;
        align-items: center;
        gap: 0.75rem;
        font-size: 0.88rem;
    }

.user-chip .avatar {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    background: var(--navy);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
}

.lang-switch {
    display: flex;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    font-size: 0.75rem;
}

    .lang-switch a {
        padding: 0.35rem 0.7rem;
        text-decoration: none;
        color: var(--text-muted);
        font-weight: 700;
    }

        .lang-switch a.active {
            background: var(--navy);
            color: #fff;
        }

.page-body {
    padding: 2rem;
    flex: 1;
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
}

/* Cards */
.qdc-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.4rem 1.5rem;
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.15s ease;
}

    .qdc-card + .qdc-card {
        margin-top: 1rem;
    }

    .qdc-card.hoverable:hover {
        box-shadow: var(--shadow);
        border-color: #D6DCE3;
    }

.stat-card .stat-value {
    font-family: var(--font-mono);
    font-size: 2rem;
    font-weight: 700;
    color: var(--navy);
    line-height: 1.1;
}

.stat-card .stat-label {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-top: 0.3rem;
    font-weight: 600;
}

/* Progress bar */
.qdc-progress {
    height: 8px;
    border-radius: 20px;
    background: var(--border-light);
    overflow: hidden;
}

.qdc-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--navy), var(--navy-lighter));
    border-radius: 20px;
    transition: width 0.3s ease;
}

/* Status badges */
.badge-status {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    padding: 0.3rem 0.65rem;
    border-radius: 20px;
    font-weight: 700;
    display: inline-block;
}

.badge-approved {
    background: var(--success-bg);
    color: var(--success-text);
}

.badge-pending {
    background: var(--warning-bg);
    color: var(--warning-text);
}

.badge-rejected {
    background: var(--danger-bg);
    color: var(--danger-text);
}

.badge-info {
    background: var(--info-bg);
    color: var(--info-text);
}

/* Tables */
.table {
    margin-bottom: 0;
}

    .table thead th {
        font-size: 0.72rem;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        color: var(--text-muted);
        font-weight: 700;
        border-bottom: 2px solid var(--border);
        padding: 0.7rem 0.6rem;
        background: transparent;
    }

    .table tbody td {
        padding: 0.85rem 0.6rem;
        border-bottom: 1px solid var(--border-light);
        font-size: 0.87rem;
        vertical-align: middle;
    }

    .table tbody tr:hover {
        background: #FAFBFC;
    }

    .table tbody tr:last-child td {
        border-bottom: none;
    }

/* Forms */
.form-control, .form-select {
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    padding: 0.55rem 0.85rem;
    font-size: 0.9rem;
}

    .form-control:focus, .form-select:focus {
        border-color: var(--navy);
        box-shadow: 0 0 0 3px rgba(19,45,65,0.1);
    }

.form-label {
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--text);
    margin-bottom: 0.35rem;
}

/* Login Page (legacy, kept for compatibility) */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    background: var(--bg);
}

.login-brand-panel {
    flex: 1;
    background: linear-gradient(135deg, var(--navy) 0%, #0D1F2E 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #fff;
    padding: 3rem;
    position: relative;
    overflow: hidden;
}

    .login-brand-panel::before {
        content: "";
        position: absolute;
        width: 500px;
        height: 500px;
        border: 40px solid rgba(255,255,255,0.04);
        border-radius: 50%;
        top: -150px;
        right: -150px;
    }

    .login-brand-panel img {
        max-width: 220px;
        margin-bottom: 1.5rem;
        position: relative;
        z-index: 1;
    }

    .login-brand-panel h2 {
        color: #fff;
        font-size: 1.3rem;
        position: relative;
        z-index: 1;
    }

    .login-brand-panel p {
        color: rgba(255,255,255,0.6);
        font-size: 0.85rem;
        max-width: 320px;
        text-align: center;
        position: relative;
        z-index: 1;
        margin-top: 0.5rem;
    }

.login-form-panel {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.login-card {
    max-width: 380px;
    width: 100%;
}

    .login-card h3 {
        margin-bottom: 0.3rem;
    }

    .login-card .subtitle {
        color: var(--text-muted);
        font-size: 0.85rem;
        margin-bottom: 2rem;
    }

@media (max-width: 900px) {
    .login-brand-panel {
        display: none;
    }

    .sidebar {
        position: fixed;
        inset-inline-start: -264px;
        top: 0;
        bottom: 0;
        z-index: 50;
        transition: inset-inline-start 0.2s ease;
    }

        .sidebar.open {
            inset-inline-start: 0;
        }

    .app-shell {
        flex-direction: column;
    }
}

a:focus-visible, button:focus-visible, input:focus-visible {
    outline: 2px solid var(--navy);
    outline-offset: 2px;
}

/* ============================
   Icon Badges
   ============================ */
.icon-badge {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    margin-bottom: 1rem;
}

    .icon-badge.navy {
        background: var(--navy);
        color: #fff;
    }

    .icon-badge.amber {
        background: #FDECC8;
        color: #B77714;
    }

    .icon-badge.teal {
        background: #D3F3EA;
        color: #12806A;
    }

    .icon-badge.red {
        background: #FBDCD8;
        color: #C1392B;
    }

    .icon-badge.info {
        background: #D6E4F5;
        color: #2563AC;
    }

.stat-card-v2 .stat-value {
    font-family: var(--font-mono);
    font-size: 1.7rem;
    font-weight: 800;
    color: var(--text);
    line-height: 1.2;
}

.stat-card-v2 .stat-label {
    font-size: 0.82rem;
    color: var(--text-muted);
    font-weight: 600;
    margin-top: 0.15rem;
}

.stat-card-v2 .stat-delta {
    font-size: 0.75rem;
    color: var(--success-text);
    font-weight: 700;
    margin-top: 0.6rem;
}

/* Circular Progress Ring */
.progress-ring-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1rem 0;
}

.progress-ring {
    width: 170px;
    height: 170px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

    .progress-ring .ring-center {
        width: 132px;
        height: 132px;
        border-radius: 50%;
        background: var(--surface);
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
    }

    .progress-ring .ring-value {
        font-size: 1.9rem;
        font-weight: 800;
        color: var(--text);
        font-family: var(--font-mono);
    }

    .progress-ring .ring-label {
        font-size: 0.78rem;
        color: var(--text-muted);
    }

/* List rows */
.list-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.9rem 0.2rem;
    border-bottom: 1px solid var(--border-light);
    text-decoration: none;
    color: var(--text);
    transition: background 0.15s ease;
}

    .list-row:last-child {
        border-bottom: none;
    }

    .list-row:hover {
        background: #FAFBFC;
    }

    .list-row .row-icon {
        width: 40px;
        height: 40px;
        border-radius: 10px;
        background: var(--navy);
        color: #fff;
        display: flex;
        align-items: center;
        justify-content: center;
        font-weight: 700;
        font-size: 0.85rem;
        flex-shrink: 0;
    }

    .list-row .row-main {
        flex: 1;
        padding: 0 1rem;
        min-width: 0;
    }

    .list-row .row-title {
        font-weight: 700;
        font-size: 0.88rem;
    }

    .list-row .row-sub {
        font-size: 0.75rem;
        color: var(--text-muted);
        margin-top: 0.15rem;
    }

    .list-row .row-meta {
        text-align: left;
        flex-shrink: 0;
    }

    .list-row .row-progress-label {
        font-size: 0.75rem;
        color: var(--text-muted);
    }

/* Mini progress bars */
.mini-progress-card .mini-value {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--text);
    font-family: var(--font-mono);
}

.mini-progress-card .mini-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.7rem;
}

.mini-progress-bar {
    height: 6px;
    border-radius: 20px;
    background: var(--border-light);
    overflow: hidden;
}

.mini-progress-fill {
    height: 100%;
    border-radius: 20px;
}

.drop-zone {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 2rem 1rem;
    text-align: center;
    cursor: pointer;
    background: var(--bg);
    transition: all 0.15s ease;
}

    .drop-zone.drag-active {
        border-color: var(--navy);
        background: var(--info-bg);
    }

    .drop-zone:hover {
        border-color: var(--navy-light);
    }

.file-list {
    margin-top: 1rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
}

.file-chip {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 0.35rem 0.5rem 0.35rem 0.8rem;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.remove-file {
    cursor: pointer;
    color: var(--danger-text);
    font-weight: 700;
    padding: 0 0.3rem;
}

    .remove-file:hover {
        background: var(--danger-bg);
        border-radius: 50%;
    }

.password-wrapper {
    position: relative;
}

    .password-wrapper .form-control {
        padding-inline-end: 2.6rem;
    }

.password-toggle-icon {
    position: absolute;
    top: 50%;
    inset-inline-end: 0.8rem;
    transform: translateY(-50%);
    cursor: pointer;
    user-select: none;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    transition: color 0.15s ease;
}

    .password-toggle-icon:hover {
        color: var(--navy);
    }

.topbar-search {
    flex: 1;
    max-width: 380px;
    margin: 0 1.5rem;
}

    .topbar-search input {
        border-radius: 20px;
        padding-inline-start: 1rem;
        background: var(--bg);
    }

.searchable-dropdown {
    display: none;
    position: relative;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm);
    max-height: 220px;
    overflow-y: auto;
    margin-top: 6px;
    width: 100%;
}

.dropdown-item {
    padding: 0.6rem 0.9rem;
    font-size: 0.85rem;
    cursor: pointer;
    border-bottom: 1px solid var(--border-light);
}

    .dropdown-item:last-child {
        border-bottom: none;
    }

    .dropdown-item:hover {
        background: var(--bg);
    }

.dropdown-empty {
    padding: 0.8rem;
    font-size: 0.82rem;
    color: var(--text-muted);
    text-align: center;
}

.type-description-box {
    margin-top: 0.5rem;
    padding: 0.6rem 0.8rem;
    background: var(--info-bg);
    color: var(--info-text);
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    line-height: 1.5;
}

/* ============================
   Premium Login v2
   ============================ */
.login-wrapper-v2 {
    min-height: 100vh;
    display: flex;
    background: var(--bg);
}

.login-brand-panel-v2 {
    flex: 1.1;
    position: relative;
    overflow: hidden;
    background: linear-gradient(160deg, #0B1D2C 0%, var(--navy) 55%, #1D4260 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    color: #fff;
}

.brand-grid-bg {
    position: absolute;
    inset: 0;
    background-image: linear-gradient(rgba(255,255,255,0.045) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,0.045) 1px, transparent 1px);
    background-size: 42px 42px;
    animation: gridDrift 30s linear infinite;
}

@keyframes gridDrift {
    0% {
        background-position: 0 0;
    }

    100% {
        background-position: 200px 200px;
    }
}

.brand-ring {
    position: absolute;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.08);
}

.ring-1 {
    width: 620px;
    height: 620px;
    top: -220px;
    right: -220px;
    animation: spinSlow 90s linear infinite;
}

.ring-2 {
    width: 420px;
    height: 420px;
    bottom: -180px;
    left: -160px;
    border-color: rgba(255,255,255,0.06);
    animation: spinSlow 70s linear infinite reverse;
}

@keyframes spinSlow {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.brand-content {
    position: relative;
    z-index: 2;
    text-align: center;
    max-width: 460px;
}

.brand-logo-v2 {
    max-width: 190px;
    margin-bottom: 2rem;
    opacity: 0;
    animation: fadeSlideUp 0.8s ease forwards, logoPulse 4s ease-in-out 1s infinite;
    filter: drop-shadow(0 4px 18px rgba(0,0,0,0.35));
}

.brand-headline {
    color: #fff;
    font-size: 1.85rem;
    font-weight: 800;
    margin-bottom: 0.75rem;
    opacity: 0;
    animation: fadeSlideUp 0.8s ease 0.15s forwards;
}

.brand-sub {
    color: rgba(255,255,255,0.62);
    font-size: 0.92rem;
    line-height: 1.8;
    margin-bottom: 2.5rem;
    opacity: 0;
    animation: fadeSlideUp 0.8s ease 0.3s forwards;
}

.brand-features {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.feature-chip {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: rgba(255,255,255,0.045);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 14px;
    padding: 0.9rem 1.2rem;
    text-align: right;
    backdrop-filter: blur(8px);
    opacity: 0;
    animation: fadeSlideUp 0.7s ease forwards, chipGlow 0.7s ease forwards;
    animation-delay: var(--delay), var(--delay);
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

    .feature-chip:hover {
        background: rgba(255,255,255,0.075);
        border-color: rgba(255,255,255,0.15);
        transform: translateX(-2px);
    }

@keyframes chipGlow {
    0% {
        box-shadow: 0 0 0 rgba(242,169,59,0);
    }

    60% {
        box-shadow: 0 0 20px rgba(242,169,59,0.15);
    }

    100% {
        box-shadow: 0 0 0 rgba(242,169,59,0);
    }
}

.feature-icon-v2 {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(242,169,59,0.18), rgba(242,169,59,0.06));
    border: 1px solid rgba(242,169,59,0.25);
    color: #F2C572;
}

.feature-text {
    flex: 1;
    min-width: 0;
}

.feature-title {
    color: #fff;
    font-weight: 700;
    font-size: 0.88rem;
    margin-bottom: 0.15rem;
}

.feature-sub {
    color: rgba(255,255,255,0.5);
    font-size: 0.74rem;
    line-height: 1.5;
}

.brand-footer-v2 {
    position: absolute;
    bottom: 1.5rem;
    font-size: 0.68rem;
    color: rgba(255,255,255,0.35);
    letter-spacing: 0.5px;
    z-index: 2;
}

@keyframes fadeSlideUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== اللوحة اليسرى (الفورم) ===== */
.login-form-panel-v2 {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: radial-gradient(circle at 20% 20%, rgba(19,45,65,0.04), transparent 40%), radial-gradient(circle at 80% 80%, rgba(19,45,65,0.03), transparent 40%), var(--bg);
}

.login-card-v2 {
    max-width: 400px;
    width: 100%;
    background: var(--surface);
    border-radius: 20px;
    padding: 2.75rem 2.5rem;
    box-shadow: 0 20px 60px rgba(19,45,65,0.14), 0 4px 14px rgba(19,45,65,0.06);
    position: relative;
    z-index: 2;
    opacity: 0;
    animation: cardEntrance 0.7s cubic-bezier(.2,.8,.2,1) 0.1s forwards;
}

@keyframes cardEntrance {
    from {
        opacity: 0;
        transform: translateY(24px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.login-card-v2::before {
    content: "";
    position: absolute;
    inset: -30px;
    border-radius: 40px;
    background: radial-gradient(circle at 50% 40%, rgba(19,45,65,0.06), transparent 65%);
    z-index: -1;
    animation: cardGlowPulse 4s ease-in-out infinite;
}

@keyframes cardGlowPulse {
    0%, 100% {
        opacity: 0.55;
        transform: scale(0.96);
    }

    50% {
        opacity: 1;
        transform: scale(1.04);
    }
}

.login-card-accent {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    border-radius: 20px 20px 0 0;
    background: linear-gradient(90deg, var(--navy), var(--navy-lighter), var(--navy));
}

.login-card-v2 h3 {
    margin-bottom: 0.3rem;
    font-size: 1.5rem;
}

.login-card-v2 .subtitle {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 2rem;
}

.input-with-icon {
    position: relative;
}

    .input-with-icon .form-control {
        padding-inline-start: 2.6rem;
        height: 46px;
    }

    .input-with-icon.password-wrapper .form-control {
        padding-inline-end: 2.6rem;
    }

.input-icon {
    position: absolute;
    top: 50%;
    inset-inline-start: 0.85rem;
    transform: translateY(-50%);
    color: var(--text-faint);
    display: flex;
    pointer-events: none;
}

.btn-login-v2 {
    width: 100%;
    height: 48px;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--navy), var(--navy-light));
    color: #fff;
    font-weight: 700;
    font-size: 0.98rem;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    box-shadow: 0 6px 18px rgba(19,45,65,0.25);
}

    .btn-login-v2:hover {
        transform: translateY(-2px);
        box-shadow: 0 10px 24px rgba(19,45,65,0.32);
    }

    .btn-login-v2::after {
        content: "";
        position: absolute;
        top: 0;
        left: -60%;
        width: 40%;
        height: 100%;
        background: linear-gradient(120deg, transparent, rgba(255,255,255,0.25), transparent);
        transform: skewX(-20deg);
        transition: left 0.5s ease;
    }

    .btn-login-v2:hover::after {
        left: 130%;
    }

@media (max-width: 900px) {
    .login-brand-panel-v2 {
        display: none;
    }
}

/* ============================
   Dashboard Cards Entrance Animation
   ============================ */
@keyframes cardFadeUp {
    from {
        opacity: 0;
        transform: translateY(14px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.page-body .row.g-3 > [class*="col-"] {
    opacity: 0;
    animation: cardFadeUp 0.5s ease forwards;
}

    .page-body .row.g-3 > [class*="col-"]:nth-child(1) {
        animation-delay: 0.05s;
    }

    .page-body .row.g-3 > [class*="col-"]:nth-child(2) {
        animation-delay: 0.12s;
    }

    .page-body .row.g-3 > [class*="col-"]:nth-child(3) {
        animation-delay: 0.19s;
    }

    .page-body .row.g-3 > [class*="col-"]:nth-child(4) {
        animation-delay: 0.26s;
    }

.list-row {
    opacity: 0;
    animation: cardFadeUp 0.4s ease forwards;
}

    .list-row:nth-child(1) {
        animation-delay: 0.15s;
    }

    .list-row:nth-child(2) {
        animation-delay: 0.2s;
    }

    .list-row:nth-child(3) {
        animation-delay: 0.25s;
    }

    .list-row:nth-child(4) {
        animation-delay: 0.3s;
    }

    .list-row:nth-child(5) {
        animation-delay: 0.35s;
    }

.qdc-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

    .qdc-card:hover {
        transform: translateY(-2px);
    }

.stat-card-v2 .icon-badge {
    transition: transform 0.2s ease;
}

.qdc-card:hover .icon-badge {
    transform: scale(1.08) rotate(-3deg);
}

.col-md-2dot4-fix {
    flex: 0 0 auto;
    width: 100%;
}

@media (min-width: 768px) {
    .col-md-2dot4-fix {
        width: 20%;
    }
}

/* ============================
   Dashboard Premium v3
   ============================ */
.dashboard-hero {
    background: linear-gradient(135deg, var(--navy) 0%, #0D1F2E 60%, #1D4260 100%);
    border-radius: 20px;
    padding: 2.5rem 2.5rem;
    margin-bottom: 1.75rem;
    position: relative;
    overflow: hidden;
    color: #fff;
}

    .dashboard-hero::before {
        content: "";
        position: absolute;
        width: 380px;
        height: 380px;
        border-radius: 50%;
        border: 30px solid rgba(255,255,255,0.05);
        top: -140px;
        left: -100px;
        animation: heroSpin 60s linear infinite;
    }

    .dashboard-hero::after {
        content: "";
        position: absolute;
        width: 240px;
        height: 240px;
        border-radius: 50%;
        background: radial-gradient(circle, rgba(242,169,59,0.12), transparent 70%);
        bottom: -100px;
        right: -60px;
    }

@keyframes heroSpin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.hero-greeting {
    position: relative;
    z-index: 1;
    opacity: 0;
    animation: fadeSlideUp 0.6s ease forwards;
}

    .hero-greeting .wave-emoji {
        display: inline-block;
        animation: wave 2.2s ease-in-out infinite;
        transform-origin: 70% 70%;
    }

@keyframes wave {
    0%, 60%, 100% {
        transform: rotate(0deg);
    }

    10%, 30% {
        transform: rotate(14deg);
    }

    20% {
        transform: rotate(-8deg);
    }

    40% {
        transform: rotate(-4deg);
    }

    50% {
        transform: rotate(10deg);
    }
}

.hero-greeting h2 {
    color: #fff;
    font-size: 1.7rem;
    margin-bottom: 0.35rem;
}

.hero-greeting .hero-id {
    color: rgba(255,255,255,0.55);
    font-family: var(--font-mono);
    font-size: 0.82rem;
}

.glass-stat-row {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-top: 2rem;
}

@media (max-width: 900px) {
    .glass-stat-row {
        grid-template-columns: repeat(2, 1fr);
    }
}

.glass-stat-card {
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 16px;
    padding: 1.2rem 1.3rem;
    backdrop-filter: blur(10px);
    opacity: 0;
    animation: fadeSlideUp 0.55s ease forwards;
    transition: transform 0.25s ease, background 0.25s ease;
}

    .glass-stat-card:hover {
        transform: translateY(-4px);
        background: rgba(255,255,255,0.11);
    }

    .glass-stat-card .gs-icon {
        width: 38px;
        height: 38px;
        border-radius: 10px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1.05rem;
        margin-bottom: 0.75rem;
    }

    .glass-stat-card .gs-value {
        font-family: var(--font-mono);
        font-size: 1.9rem;
        font-weight: 800;
        color: #fff;
        line-height: 1;
    }

    .glass-stat-card .gs-label {
        color: rgba(255,255,255,0.6);
        font-size: 0.78rem;
        margin-top: 0.35rem;
        font-weight: 600;
    }

.mega-progress-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 1.75rem;
    display: flex;
    align-items: center;
    gap: 1.75rem;
    box-shadow: var(--shadow-sm);
    opacity: 0;
    animation: fadeSlideUp 0.6s ease 0.15s forwards;
}

.mega-ring-wrap {
    position: relative;
    width: 130px;
    height: 130px;
    flex-shrink: 0;
}

    .mega-ring-wrap svg {
        transform: rotate(-90deg);
    }

.mega-ring-bg {
    fill: none;
    stroke: var(--border-light);
    stroke-width: 10;
}

.mega-ring-fg {
    fill: none;
    stroke: url(#megaGradient);
    stroke-width: 10;
    stroke-linecap: round;
    transition: stroke-dashoffset 1.2s cubic-bezier(.34,1.56,.64,1);
}

.mega-ring-center {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

    .mega-ring-center .mrc-value {
        font-family: var(--font-mono);
        font-size: 1.6rem;
        font-weight: 800;
        color: var(--navy);
    }

    .mega-ring-center .mrc-label {
        font-size: 0.68rem;
        color: var(--text-muted);
    }

.timeline-row {
    display: flex;
    gap: 1rem;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-light);
    text-decoration: none;
    color: var(--text);
    opacity: 0;
    animation: fadeSlideUp 0.5s ease forwards;
    transition: background 0.15s ease;
}

    .timeline-row:last-child {
        border-bottom: none;
    }

    .timeline-row:hover {
        background: #FAFBFC;
        margin: 0 -0.5rem;
        padding-inline: 0.5rem;
        border-radius: 10px;
    }

.timeline-dot-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 14px;
    flex-shrink: 0;
    padding-top: 0.35rem;
}

.timeline-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--navy);
    flex-shrink: 0;
    box-shadow: 0 0 0 4px rgba(19,45,65,0.1);
}

    .timeline-dot.completed {
        background: var(--success-text);
        box-shadow: 0 0 0 4px rgba(30,142,79,0.12);
    }

.timeline-line {
    width: 2px;
    flex: 1;
    background: var(--border);
    margin-top: 4px;
}

.timeline-content {
    flex: 1;
    min-width: 0;
}

    .timeline-content .tc-title {
        font-weight: 700;
        font-size: 0.9rem;
        margin-bottom: 0.2rem;
    }

    .timeline-content .tc-sub {
        font-size: 0.76rem;
        color: var(--text-muted);
        font-family: var(--font-mono);
    }

/* ============================
   Login Page — Extra Glam v3
   ============================ */
.login-brand-panel-v2::after {
    content: "";
    position: absolute;
    width: 320px;
    height: 320px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(242,169,59,0.10), transparent 70%);
    top: 40%;
    left: -80px;
    filter: blur(10px);
    animation: glowPulse 6s ease-in-out infinite;
}

@keyframes glowPulse {
    0%, 100% {
        opacity: 0.5;
        transform: scale(1);
    }

    50% {
        opacity: 0.9;
        transform: scale(1.15);
    }
}

.login-particles {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    overflow: hidden;
}

    .login-particles span {
        position: absolute;
        bottom: -30px;
        font-family: var(--font-mono);
        font-size: 0.95rem;
        font-weight: 700;
        color: rgba(242,169,59,0.65);
        text-shadow: 0 0 8px rgba(242,169,59,0.4);
        animation: particleFloat linear infinite;
        user-select: none;
    }

@keyframes particleFloat {
    0% {
        transform: translateY(0) translateX(0);
        opacity: 0;
    }

    10% {
        opacity: 1;
    }

    90% {
        opacity: 1;
    }

    100% {
        transform: translateY(-420px) translateX(30px);
        opacity: 0;
    }
}

/* ============================
   Notification Badge
   ============================ */
.notification-badge {
    position: absolute;
    top: -6px;
    inset-inline-end: -6px;
    background: var(--danger-text);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 800;
    min-width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 3px;
    box-shadow: 0 0 0 2px var(--surface);
    animation: badgePulse 2s ease-in-out infinite;
}

@keyframes badgePulse {
    0%, 100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.12);
    }
}

/* ============================
   Mobile Menu Toggle
   ============================ */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 1.4rem;
    color: var(--navy);
    cursor: pointer;
    padding: 0.3rem 0.5rem;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 40;
}

    .sidebar-overlay.active {
        display: block;
    }

@media (max-width: 900px) {
    .mobile-menu-btn {
        display: inline-block;
    }
}
/* ============================
   Topbar Mobile Fix
   ============================ */
@media (max-width: 900px) {
    .topbar {
        flex-wrap: wrap;
        padding: 0.7rem 1rem;
        gap: 0.5rem;
    }

    .topbar-search {
        display: none; /* نخفي البحث على الموبايل، مساحة قليلة */
    }

    .topbar .breadcrumb-label {
        font-size: 0.85rem;
        flex: 1;
    }

    .user-chip {
        gap: 0.4rem !important;
        flex-wrap: nowrap;
    }

        .user-chip span:not(.avatar) {
            display: none; /* نخفي اسم المستخدم النصي، نكتفي بالـ Avatar */
        }

    .lang-switch {
        font-size: 0.65rem;
    }

        .lang-switch a {
            padding: 0.25rem 0.45rem;
        }

    .user-chip .btn {
        font-size: 0.7rem;
        padding: 0.3rem 0.5rem;
    }

    .user-chip .avatar {
        width: 30px;
        height: 30px;
        font-size: 0.72rem;
    }
}
/* ============================
   Contractor Project Count Chip
   ============================ */
.contractor-count-chip {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 64px;
    padding: 0.5rem 0.9rem;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--navy), var(--navy-light));
    color: #fff;
    box-shadow: 0 3px 10px rgba(19,45,65,0.18);
    transition: transform 0.2s ease;
}

.list-row:hover .contractor-count-chip {
    transform: scale(1.05);
}

.contractor-count-chip .ccc-value {
    font-family: var(--font-mono);
    font-size: 1.15rem;
    font-weight: 800;
    line-height: 1.1;
}

.contractor-count-chip .ccc-label {
    font-size: 0.62rem;
    opacity: 0.8;
    margin-top: 0.1rem;
}
/* ============================
   Fix: منع العناصر الزخرفية من اعتراض النقر على صندوق البحث
   ============================ */
.dashboard-hero::before,
.dashboard-hero::after {
    pointer-events: none;
}

.dashboard-hero form {
    position: relative;
    z-index: 5;
}