:root {
    --card: #4d5361;
    --success: #10b981;
    --danger: #ef4444;
    --bg: #f8fafc;
    --surface: #ffffff;
    --primary: #1c48ac;
    --accent: #cc2d79;
    --color-light: #ebf9ff;
    --color-light-secondary: #fff6fc;
    --accent-2: #a774ec;
    --muted: #6b7280;
    --muted-light: #d1dbf1;
    --text: #111827;
    --radius: 12px;
    --glass: rgba(255, 255, 255, 0.7);
}

* {
    box-sizing: border-box
}

.container {
    max-width: 1120px;
    margin: 0 auto;
    padding: 20px
}

.cb-header {
    padding: 18px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    margin-top: 15px;
}

.brand {
    display: flex;
    gap: 12px;
    align-items: center
}

.logo {
    width: 44px;
    height: 44px;
    border-radius: 8px
}

.subtitle {
    margin: 0;
    color: var(--muted);
    font-size: 0.85rem
}

.header-right {
    margin-left: auto;
    display: flex;
    gap: 12px;
    align-items: center
}

.balance {
    color: var(--muted)
}

.amount {
    font-weight: 700;
}

.actions .btn {
    margin-left: 8px
}

.dashboard {
    display: grid;
    grid-template-columns:1fr 320px;
    gap: 20px;
    padding: 28px
}

.projects {
    background: transparent
}

.section-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px
}

.projects-list {
    display: flex;
    flex-direction: column;
    gap: 12px
}

.project-card {
    background: linear-gradient(90deg, rgba(28, 72, 172, 0.1) 0%, rgba(204, 45, 121, 0.1) 100%);
    backdrop-filter: blur(6px);
    padding: 16px;
    border-radius: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
}

.left {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.proj-title {
    font-weight: 700;
}

.proj-meta {
    color: var(--muted);
    font-size: 0.9rem;
}

.progress {
    width: 220px;
    height: 10px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 999px;
    overflow: hidden;
    border: 0.5px solid rgba(204, 45, 121, 0.2);
}

.progress > i {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--accent));
}

.badge {
    padding: 4px 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.03);
    font-size: 0.85rem;
}

.right-column {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.card {
    background: var(--card);
    color: #fff;
    padding: 14px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.03);
}

.card h3 {
    margin: 0 0 8px 0;
}

.list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.document a {
    color: var(--accent);
}

.quick-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}


.muted {
    color: var(--muted);
}

.muted-light {
    color: var(--muted-light);
}

@media (max-width: 768px) {
    .container {
        padding: 15px;
        max-width: 100vw;
        margin: 0 10px;
    }

    .cb-header {
        padding: 10px 0;
        margin-top: 0;
    }

    .brand {
        flex-direction: row;
        gap: 8px;
    }

    .logo {
        width: 36px;
        height: 36px;
    }

    .header-right {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        margin-left: 0;
        margin-top: 0;
    }

    .dashboard {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .projects-list {
        gap: 8px;
    }

    .project-card {
        flex-direction: column;
        align-items: flex-start;
        padding: 10px;
        gap: 8px;
    }

    .left {
        gap: 4px;
    }

    .right {
        flex-direction: row;
        gap: 8px;
        width: 100%;
        justify-content: flex-start;
    }

    .progress {
        width: 100px;
        min-width: 60px;
        height: 8px;
    }

    .badge {
        font-size: 0.8rem;
        padding: 2px 6px;
    }

    .right-column {
        gap: 10px;
        margin-top: 10px;
    }

    .card {
        padding: 8px;
        border-radius: 10px;
    }

    .card h3 {
        font-size: 1rem;
        margin-bottom: 4px;
    }

    .list {
        gap: 4px;
    }

    .facture-header, .facture-details {
        flex-direction: column;
        gap: 2px;
    }

    .actions .btn {
        margin-left: 0;
    }

    .actions {
        margin-top: 8px;
    }

    .balance {
        font-size: 0.9rem;
        margin-left: 4px;
    }
}

.kv {
    font-size: 0.9rem;
    color: var(--muted);
}

.project-card img {
    max-width: 120px;
    border-radius: 8px;
}

.project-card:hover {
    transform: translateY(-3px);
    transition: all .18s ease;
}

.danger {
    color: var(--danger);
}

.success {
    color: var(--success);
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.loading-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 320px;
    width: 100%;
    background: transparent;
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 6px solid #e0e0e0;
    border-top: 6px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 16px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.loading-block p {
    color: var(--muted);
    font-size: 1.1rem;
    margin: 0;
}