/* Dashboard — Check alerts: نفس سطح ويدجت أوقات الصلاة / الاختصارات / المبيعات */

.cheques-widget-container {
    margin-bottom: 1rem;
}

.cheques-widget-card {
    --pr-mid: #64748b;
    position: relative;
    border-radius: 1.15rem;
    overflow: hidden;
    color: #334155;
    background: linear-gradient(
        155deg,
        color-mix(in srgb, #ffffff 92%, var(--pr-mid) 8%) 0%,
        color-mix(in srgb, #f1f5f9 92%, var(--pr-mid) 8%) 40%,
        color-mix(in srgb, #e8eef5 92%, var(--pr-mid) 8%) 100%
    );
    border: 1px solid rgba(148, 163, 184, 0.36);
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.75) inset,
        0 12px 32px -16px rgba(15, 23, 42, 0.12),
        0 4px 12px -4px rgba(15, 23, 42, 0.06),
        0 0 0 1px color-mix(in srgb, #e2e8f0 87%, var(--pr-mid) 13%);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
}

.cheques-widget-card::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background-image:
        linear-gradient(rgba(148, 163, 184, 0.12) 1px, transparent 1px),
        linear-gradient(90deg, rgba(148, 163, 184, 0.12) 1px, transparent 1px);
    background-size: 20px 20px;
    pointer-events: none;
    opacity: 0.45;
    -webkit-mask-image: radial-gradient(ellipse 90% 65% at 50% 0%, #000 35%, transparent 100%);
    mask-image: radial-gradient(ellipse 90% 65% at 50% 0%, #000 35%, transparent 100%);
}

.cheques-widget-card::after {
    content: "";
    position: absolute;
    inset: -1px;
    border-radius: inherit;
    background:
        radial-gradient(ellipse 120% 80% at 100% 0%, rgba(251, 191, 36, 0.1) 0%, transparent 52%),
        radial-gradient(ellipse 100% 60% at 0% 100%, rgba(99, 102, 241, 0.08) 0%, transparent 50%);
    pointer-events: none;
    opacity: 0.9;
}

.cheques-widget-header {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.7rem 1rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.3);
}

.cheques-widget-title {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #9a3412;
}

:lang(ar) .cheques-widget-title {
    letter-spacing: 0.04em;
    text-transform: none;
    font-size: 0.95rem;
}

.cheques-widget-title i {
    font-size: 0.95rem;
    color: #d97706;
    filter: none;
}

.cheques-widget-content {
    position: relative;
    z-index: 1;
    padding: 1rem 1.1rem 1.15rem;
}

.cheques-sections-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1rem;
}

.cheques-section {
    --pr-mid: #64748b;
    position: relative;
    z-index: 1;
    border-radius: 0.7rem;
    overflow: hidden;
    background: linear-gradient(
        180deg,
        color-mix(in srgb, #ffffff 92%, var(--pr-mid) 8%) 0%,
        color-mix(in srgb, #f8fafc 95%, var(--pr-mid) 5%) 100%
    );
    border: 1px solid rgba(203, 213, 225, 0.86);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.85) inset;
}

.cheques-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.55rem 0.7rem;
    font-size: 0.8rem;
    font-weight: 700;
    color: #0f172a;
    border-bottom: 1px solid rgba(148, 163, 184, 0.28);
}

.cheques-section-header-red {
    background: linear-gradient(90deg, rgba(254, 202, 202, 0.45) 0%, color-mix(in srgb, #fef2f2 88%, #64748b 12%) 100%);
    border-inline-start: 4px solid #f87171;
}

.cheques-section-header-orange {
    background: linear-gradient(90deg, rgba(254, 215, 170, 0.5) 0%, color-mix(in srgb, #fff7ed 88%, #64748b 12%) 100%);
    border-inline-start: 4px solid #fb923c;
}

.cheques-section-header-dark-red {
    background: linear-gradient(90deg, rgba(252, 165, 180, 0.42) 0%, color-mix(in srgb, #fff1f2 88%, #64748b 12%) 100%);
    border-inline-start: 4px solid #f43f5e;
}

.cheques-section-title {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
    min-width: 0;
}

.cheques-section-hint {
    font-size: 0.68rem;
    font-weight: 500;
    color: #64748b;
    line-height: 1.3;
    margin: 0;
}

.cheques-pulse-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
    animation: caw-pulse 2.2s ease-in-out infinite;
}

.cheques-section-header-red .cheques-pulse-dot {
    background: #f87171;
    box-shadow: 0 0 0 2px rgba(248, 113, 113, 0.3);
}

.cheques-section-header-orange .cheques-pulse-dot {
    background: #fb923c;
    box-shadow: 0 0 0 2px rgba(251, 146, 60, 0.28);
}

.cheques-section-header-dark-red .cheques-pulse-dot {
    background: #fb7185;
    box-shadow: 0 0 0 2px rgba(244, 63, 94, 0.28);
}

@keyframes caw-pulse {
    0%,
    100% {
        opacity: 1;
    }
    50% {
        opacity: 0.45;
    }
}

.cheques-count-badge {
    flex-shrink: 0;
    min-width: 1.5rem;
    text-align: center;
    padding: 0.2rem 0.55rem;
    border-radius: 9999px;
    font-size: 0.7rem;
    font-weight: 800;
    color: #334155;
    background: #ffffff;
    border: 1px solid rgba(203, 213, 225, 0.9);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.8) inset;
}

.cheques-count-badge-red {
    color: #b91c1c;
    background: #fef2f2;
    border-color: #fecaca;
}

.cheques-count-badge-orange {
    color: #9a3412;
    background: #fff7ed;
    border-color: #fed7aa;
}

.cheques-count-badge-dark-red {
    color: #9f1239;
    background: #fff1f2;
    border-color: #fecdd3;
}

.cheques-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.75rem;
    padding: 0.75rem;
    max-height: 400px;
    overflow-y: auto;
    scrollbar-color: rgba(100, 116, 139, 0.45) rgba(241, 245, 249, 0.9);
    scrollbar-width: thin;
}

.cheque-item {
    background: #ffffff;
    border: 1px solid rgba(203, 213, 225, 0.88);
    border-radius: 0.55rem;
    padding: 0.65rem 0.6rem;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
    transition: box-shadow 0.15s ease, border-color 0.15s ease, transform 0.15s ease, background 0.15s ease;
    min-height: 120px;
}

.cheque-item:hover {
    background: #f8fafc;
    box-shadow: 0 6px 20px -8px rgba(15, 23, 42, 0.12);
    transform: translateY(-1px);
}

.cheque-item-red {
    border-inline-start: 3px solid #f87171;
}

.cheque-item-red:hover {
    border-color: rgba(252, 165, 165, 0.45);
    border-inline-start-color: #ef4444;
}

.cheque-item-orange {
    border-inline-start: 3px solid #fb923c;
}

.cheque-item-orange:hover {
    border-color: rgba(253, 186, 116, 0.4);
    border-inline-start-color: #f97316;
}

.cheque-item-dark-red {
    border-inline-start: 3px solid #f43f5e;
    background: #fff1f2;
}

.cheque-item-dark-red:hover {
    background: #ffe4e6;
    border-color: rgba(253, 164, 175, 0.55);
    border-inline-start-color: #e11d48;
}

.cheque-item-content {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.cheque-number-row {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.28);
    font-size: 0.7rem;
}

.cheque-number-row i {
    font-size: 12px;
}

.cheque-item-red .cheque-number-row i {
    color: #b91c1c !important;
}

.cheque-item-orange .cheque-number-row i {
    color: #c2410c !important;
}

.cheque-item-dark-red .cheque-number-row i {
    color: #9f1239 !important;
}

/* كتابة داكنة (تباين على الخلفيات الفاتحة/الفضي داخل البطاقة) */
.cheque-label {
    color: #0a0a0a;
    font-weight: 600;
}

.cheque-number {
    color: #0a0a0a;
    font-weight: 800;
}

.cheque-type-badge {
    display: inline-block;
    width: fit-content;
    max-width: 100%;
    background: #e8ecf1;
    color: #0a0a0a;
    padding: 0.15rem 0.4rem;
    border-radius: 0.3rem;
    font-size: 0.64rem;
    font-weight: 600;
    border: 1px solid #cbd5e1;
}

.cheque-contact {
    color: #0a0a0a;
    font-size: 0.68rem;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cheque-amount {
    color: #0a0a0a;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.02em;
}

.cheque-due-info {
    margin-top: 0.15rem;
    padding-top: 0.4rem;
    border-top: 1px solid rgba(148, 163, 184, 0.28);
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.cheque-due-date {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    color: #334155;
    font-size: 0.66rem;
    font-weight: 600;
}

.cheque-due-date i {
    font-size: 10px;
    color: #64748b;
}

.cheque-item-red .cheque-due-date,
.cheque-item-orange .cheque-due-date,
.cheque-item-dark-red .cheque-due-date {
    color: #334155;
}

.cheque-days-badge {
    padding: 0.2rem 0.45rem;
    border-radius: 0.35rem;
    font-size: 0.64rem;
    font-weight: 700;
    text-align: center;
    border: 1px solid transparent;
}

.cheque-days-badge-red {
    background: #fef2f2;
    color: #b91c1c;
    border-color: #fecaca;
}

.cheque-days-badge-orange {
    background: #fff7ed;
    color: #9a3412;
    border-color: #fed7aa;
}

.cheque-days-badge-dark-red {
    background: #fff1f2;
    color: #9f1239;
    border-color: #fecdd3;
}

.cheque-actions {
    margin-top: 0.45rem;
    padding-top: 0.5rem;
    border-top: 1px solid rgba(148, 163, 184, 0.28);
}

.caw-view-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    width: 100%;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.4rem 0.5rem;
    border-radius: 0.45rem;
    text-decoration: none;
    color: #0a0a0a;
    background: #e2e8f0;
    border: 1px solid #94a3b8;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.caw-view-btn:hover,
.caw-view-btn:focus {
    color: #020617;
    background: #cbd5e1;
    border-color: #64748b;
    text-decoration: none;
}

.cheques-empty {
    grid-column: 1 / -1;
    text-align: center;
    color: #64748b;
    font-size: 0.75rem;
    font-weight: 500;
    padding: 2rem 1rem;
    background: color-mix(in srgb, #f1f5f9 92%, #64748b 8%);
    border-radius: 0.45rem;
    border: 1px dashed rgba(148, 163, 184, 0.55);
}

@media (max-width: 768px) {
    .cheques-sections-grid {
        grid-template-columns: 1fr;
    }

    .cheques-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 0.5rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .cheques-pulse-dot {
        animation: none;
    }
}
