/* ============================================================================
   طيف (tayf) — رأس قُمرة القيادة
   ============================================================================
   منقول عن تصميم tayf.ae (dashboard/index.html + css/dashboard.css): شريط رمز
   المؤسسة + البنر الدعائي + بنر الاشتراك مع العدّاد التنازلي.

   ملف مستقل عن قوالب اللوحة الجاهزة، ويستخدم متغيّراته الخاصة (المسبوقة بـ
   tayf-) حتى لا يتعارض مع --app-primary-color التي يحقنها قالب الأدمن من
   إعدادات المتجر.
   ============================================================================ */

.tayf-dash {
    --tayf-gold: #f8cb25;
    --tayf-ink: #0e0e14;
    --tayf-blue: #3164f5;
    --tayf-white: #ffffff;
    --tayf-gray-900: #333333;
    --tayf-gray-700: #55565c;
    --tayf-gray-500: #afafaf;
    --tayf-gray-300: #e0e0e0;
    --tayf-gray-100: #f4f4f4;
    --tayf-radius-sm: 8px;
    --tayf-radius-md: 14px;
    --tayf-radius-lg: 24px;
    --tayf-radius-full: 999px;

    margin-bottom: 1.5rem;
}

.tayf-dash *,
.tayf-dash *::before,
.tayf-dash *::after {
    box-sizing: border-box;
}

.tayf-dash .tayf-icon {
    width: 18px;
    height: 18px;
    flex: none;
}

/* -------------------------------- شريط رمز المؤسسة -------------------------------- */
.tayf-code-row {
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
    margin-bottom: 1rem;
}

.tayf-code-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--tayf-gray-100);
    border: 1px solid var(--tayf-gray-300);
    border-radius: var(--tayf-radius-md);
    padding: 6px 14px 6px 6px;
}

.tayf-code-label {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--tayf-gray-700);
    white-space: nowrap;
}

.tayf-code-value {
    border: none;
    background: none;
    font-family: inherit;
    font-size: 0.92rem;
    font-weight: 800;
    letter-spacing: 1px;
    color: var(--tayf-gray-900);
    width: 9ch;
    padding: 0;
    cursor: default;
}

.tayf-code-value:focus {
    outline: none;
}

.tayf-copy-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    flex: none;
    border: none;
    border-radius: var(--tayf-radius-sm);
    background: var(--tayf-white);
    color: var(--tayf-blue);
    cursor: pointer;
    transition: background 0.15s ease;
}

.tayf-copy-btn:hover {
    background: rgba(49, 100, 245, 0.1);
}

.tayf-copy-btn .tayf-icon {
    width: 16px;
    height: 16px;
}

/* -------------------------------- البنر الدعائي --------------------------------
   ارتفاع البنر يتبع نسبة أبعاد الصورة (2000×500) فتظهر كاملة بلا قص. */
.tayf-promo-banner {
    border-radius: var(--tayf-radius-lg);
    overflow: hidden;
    margin-bottom: 1.5rem;
    line-height: 0;
}

.tayf-promo-banner img {
    width: 100%;
    height: auto;
    display: block;
}

/* ------------------------- البنر حين لا إعلان من طيف -------------------------
   شريط عريض قصير لا لوحة: الموضع لهوية طيف لا لإعلان، فلا يأخذ من الشاشة
   ما يأخذه الإعلان. ارتفاع ثابت لأنّ الصورة تُقصّ (`cover`) ولا تُقاس
   بنسبتها كما يُقاس بنر طيف. */
.tayf-promo-fallback {
    position: relative;
    overflow: hidden;
    border-radius: var(--tayf-radius-lg);
    margin-bottom: 1.5rem;
    height: 140px;
}

.tayf-promo-fallback-bg {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.tayf-promo-fallback-veil {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
}

.tayf-promo-fallback-content {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 20px;
    padding: 16px 24px;
    text-align: start;
}

.tayf-promo-fallback-content img {
    width: 120px;
    flex-shrink: 0;
}

.tayf-promo-fallback-content p {
    margin: 0;
    color: #fff;
    font-size: 1rem;
    font-weight: 700;
    max-width: 260px;
}

@media (max-width: 575.98px) {
    .tayf-promo-fallback {
        height: 120px;
    }

    .tayf-promo-fallback-content {
        gap: 12px;
    }

    .tayf-promo-fallback-content img {
        width: 88px;
    }

    .tayf-promo-fallback-content p {
        font-size: 0.875rem;
        max-width: 180px;
    }
}

/* -------------------------------- بنر الاشتراك -------------------------------- */
.tayf-subscription-banner {
    background: var(--tayf-ink);
    color: var(--tayf-white);
    border-radius: var(--tayf-radius-lg);
    padding: 24px 32px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.tayf-subscription-info {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.tayf-subscription-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 800;
    font-size: 1.05rem;
    margin: 0 0 4px;
    color: var(--tayf-white);
}

.tayf-subscription-title .tayf-icon {
    color: var(--tayf-gold);
}

.tayf-subscription-date {
    color: rgba(255, 255, 255, 0.55);
    font-size: 0.85rem;
    margin: 0;
}

.tayf-subscription-plan-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.tayf-subscription-plan-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.08);
    color: var(--tayf-gold);
    font-size: 0.8rem;
    font-weight: 700;
    padding: 7px 14px;
    border-radius: var(--tayf-radius-full);
    white-space: nowrap;
}

.tayf-subscription-plan-badge .tayf-icon {
    width: 14px;
    height: 14px;
}

.tayf-upgrade-btn {
    background: var(--tayf-gold);
    color: var(--tayf-ink);
    border: none;
    font-weight: 800;
    font-size: 0.85rem;
    padding: 10px 18px;
    border-radius: var(--tayf-radius-full);
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: transform 0.18s ease;
}

.tayf-upgrade-btn:hover {
    transform: translateY(-1px);
    color: var(--tayf-ink);
}

.tayf-upgrade-btn .tayf-icon {
    width: 15px;
    height: 15px;
}

.tayf-renew-btn {
    background: rgba(255, 255, 255, 0.1);
    color: var(--tayf-white);
    border: none;
    font-weight: 700;
    font-size: 0.85rem;
    padding: 11px 18px;
    border-radius: var(--tayf-radius-full);
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: background 0.18s ease;
}

.tayf-renew-btn:hover {
    background: rgba(255, 255, 255, 0.18);
    color: var(--tayf-white);
}

.tayf-renew-btn .tayf-icon {
    width: 15px;
    height: 15px;
}

/* -------------------------------- العدّاد التنازلي -------------------------------- */
.tayf-countdown {
    display: flex;
    gap: 10px;
}

.tayf-countdown-cell {
    background: rgba(255, 255, 255, 0.08);
    border-radius: var(--tayf-radius-sm);
    min-width: 64px;
    padding: 10px 6px;
    text-align: center;
}

.tayf-countdown-num {
    display: block;
    font-size: 1.5rem;
    font-weight: 800;
    /* أرقام متساوية العرض حتى لا يهتزّ العدّاد كل ثانية */
    font-variant-numeric: tabular-nums;
}

.tayf-countdown-label {
    display: block;
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 2px;
}

@media (max-width: 767px) {
    .tayf-subscription-banner {
        padding: 16px;
    }

    .tayf-countdown-cell {
        min-width: 54px;
        padding: 8px 4px;
    }

    .tayf-countdown-num {
        font-size: 1.2rem;
    }

    .tayf-code-row {
        justify-content: flex-start;
    }
}

/* ---------------------------------------------------------------------------
   الزرّان صارا روابط إلى شاشة الباقات
   --------------------------------------------------------------------------- */
.tayf-upgrade-btn,
.tayf-renew-btn {
    text-decoration: none;
}

.tayf-upgrade-btn:hover,
.tayf-renew-btn:hover {
    text-decoration: none;
}

/* ---------------------------------------------------------------------------
   شارة الحالة — تُقرأ لونًا قبل أن تُقرأ نصًّا
   --------------------------------------------------------------------------- */
.tayf-status-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    font-weight: 800;
    padding: 6px 14px;
    border-radius: var(--tayf-radius-full);
    line-height: 1;
}

.tayf-status-chip::before {
    content: '';
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
}

.tayf-status-active,
.tayf-status-trial {
    background: rgba(45, 190, 120, 0.16);
    color: #4ade80;
}

.tayf-status-maintenance {
    background: rgba(255, 193, 7, 0.16);
    color: #ffc107;
}

.tayf-status-cancelled,
.tayf-status-suspended {
    background: rgba(239, 68, 68, 0.16);
    color: #f87171;
}
