/*
 * هوية باين المشتركة: مصدر الحقيقة الوحيد لألوان وأشكال بوابة الشريك والصفحات العامة
 * وصفحات إدارة الفريق الميداني. القيم مطابقة حرفيًا لـ :root في layouts/app.blade.php
 * ولـ tailwind.config.js، ولا يُضاف هنا لون جديد. فاتح فقط.
 * الأرقام الغربية دائمًا للمبالغ وأرقام المتاجر والرموز (dir="ltr" lang="en" + tabular-nums).
 */

:root {
    color-scheme: light;

    --bn-primary: #0D9488;
    --bn-primary-dark: #0F766E;
    --bn-primary-light: #14B8A6;
    --bn-primary-50: #E6F7F5;
    --bn-primary-100: #CCF0EC;
    --bn-gradient: linear-gradient(180deg, #0D9488 0%, #0F766E 100%);

    /* كما في اللوحة: عنوان القائمة الجانبية وحد العنصر النشط فقط */
    --bn-accent: #F59E0B;
    --bn-accent-light: #FCD34D;

    --bn-canvas: #f3f2f7;
    --bn-card: #ffffff;
    --bn-line: #e5e7eb;
    --bn-text: #1F2937;
    --bn-ink: #0f172a;
    --bn-muted: #64748b;

    --bn-radius-card: 16px;
    --bn-radius-control: 12px;
    --bn-radius-hero: 20px;
    --bn-shadow: 0 4px 20px rgba(0, 0, 0, .06);
}

/* ============ الأرقام ============ */
.bn-num {
    direction: ltr;
    unicode-bidi: isolate;
    font-variant-numeric: tabular-nums lining-nums;
    font-weight: 700;
}

/* ============ الزخرفة المعينية (توقيع الهوية، من أيقونة الشريك) ============ */
.bn-lattice { position: relative; isolation: isolate; }
.bn-lattice::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='15' height='15'%3E%3Cpath d='M7.5 1.5 13.5 7.5 7.5 13.5 1.5 7.5Z' fill='none' stroke='%23fff' stroke-opacity='.8' stroke-width='.7'/%3E%3C/svg%3E");
    background-size: 15px 15px;
    opacity: .09;
}
.bn-lattice--dark::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='15' height='15'%3E%3Cpath d='M7.5 1.5 13.5 7.5 7.5 13.5 1.5 7.5Z' fill='none' stroke='%230F766E' stroke-opacity='.9' stroke-width='.7'/%3E%3C/svg%3E");
    opacity: .07;
}

/* خط الهوية التركوازي الرفيع */
.bn-rule { height: 2px; width: 3rem; border-radius: 2px; background: var(--bn-primary-light); }

/* ============ الأسطح ============ */
.bn-card {
    background: var(--bn-card);
    border: 1px solid var(--bn-line);
    border-radius: var(--bn-radius-card);
}
.bn-card--raised { box-shadow: var(--bn-shadow); }
.bn-hero {
    position: relative;
    overflow: hidden;
    border-radius: var(--bn-radius-hero);
    color: #fff;
    background: var(--bn-gradient);
}

/* ============ الأزرار ============ */
.bn-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    min-height: 2.75rem;
    padding: .65rem 1.25rem;
    border: 1px solid transparent;
    border-radius: var(--bn-radius-control);
    font: inherit;
    font-size: .9375rem;
    font-weight: 700;
    line-height: 1.5;
    cursor: pointer;
    text-decoration: none;
    transition: background-color .2s ease, border-color .2s ease, color .2s ease;
}
.bn-btn:disabled, .bn-btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
.bn-btn--block { width: 100%; }
.bn-btn--sm { min-height: 2.25rem; padding: .35rem .85rem; font-size: .8125rem; }
/* تباين النص الأبيض على primary-dark: 5.4:1 */
.bn-btn--primary { background: var(--bn-primary-dark); color: #fff; }
.bn-btn--primary:hover:not(:disabled) { background: #0b5f58; }
.bn-btn--soft { background: var(--bn-primary-50); color: var(--bn-primary-dark); }
.bn-btn--soft:hover:not(:disabled) { background: var(--bn-primary-100); }
.bn-btn--ghost { background: #fff; color: var(--bn-text); border-color: var(--bn-line); }
.bn-btn--ghost:hover:not(:disabled) { border-color: var(--bn-primary-light); background: var(--bn-primary-50); }
/* إجراء هادم هادئ، وزر التأكيد النهائي وحده بالأحمر المقيَّد */
.bn-btn--danger-quiet { background: #fff; color: var(--bn-ink); border-color: #94a3b8; }
.bn-btn--danger-quiet:hover:not(:disabled) { background: #f1f5f9; }
.bn-btn--danger { background: #b91c1c; color: #fff; }
.bn-btn--danger:hover:not(:disabled) { background: #991b1b; }

/* ============ الحقول ============ */
.bn-label { display: block; margin-bottom: .375rem; font-size: .8125rem; font-weight: 500; color: var(--bn-text); }
.bn-input {
    width: 100%;
    padding: .7rem .9rem;
    background: #fff;
    border: 1px solid #cbd5e1;
    border-radius: var(--bn-radius-control);
    font: inherit;
    font-size: .9375rem;
    color: var(--bn-text);
    outline: none;
    transition: border-color .2s ease, box-shadow .2s ease;
}
.bn-input::placeholder { color: #94a3b8; }
.bn-input:hover { border-color: #94a3b8; }
.bn-input:focus { border-color: var(--bn-primary); box-shadow: 0 0 0 3px rgba(13, 148, 136, .18); }
.bn-input[aria-invalid="true"] { border-color: #475569; background: #f8fafc; }
.bn-input:disabled { opacity: .55; cursor: not-allowed; }
.bn-hint { margin-top: .375rem; font-size: .75rem; font-weight: 500; color: var(--bn-muted); }
.bn-error { margin-top: .375rem; display: flex; align-items: flex-start; gap: .375rem; font-size: .8125rem; font-weight: 500; color: #334155; }

/* ============ الشارات: أربع نغمات مع نقطة ============ */
.bn-chip {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .15rem .65rem;
    border-radius: 9999px;
    font-size: .75rem;
    font-weight: 700;
    line-height: 1.6;
    white-space: nowrap;
}
.bn-chip::before { content: ''; width: .45rem; height: .45rem; border-radius: 9999px; background: currentColor; flex: none; }
.bn-chip--teal { background: var(--bn-primary-50); color: var(--bn-primary-dark); }
/* خلفية من accent بنسبة 14% ونص أغمق منه للتباين */
.bn-chip--amber { background: rgba(245, 158, 11, .14); color: #92400E; }
.bn-chip--slate { background: #eef2f6; color: #475569; }
.bn-chip--ink { background: var(--bn-ink); color: #fff; }

/* ============ تبويبات الفلاتر ============ */
.bn-tabs { display: flex; flex-wrap: wrap; gap: .375rem; }
.bn-tab {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    min-height: 2.25rem;
    padding: .35rem .9rem;
    border: 1px solid var(--bn-line);
    border-radius: 9999px;
    background: #fff;
    color: var(--bn-muted);
    font-size: .8125rem;
    font-weight: 500;
    text-decoration: none;
    transition: background-color .2s ease, color .2s ease, border-color .2s ease;
}
.bn-tab:hover { border-color: var(--bn-primary-light); color: var(--bn-primary-dark); }
.bn-tab.is-active { background: var(--bn-primary-dark); border-color: var(--bn-primary-dark); color: #fff; font-weight: 700; }

/* ============ التقدّم ============ */
.bn-progress { height: .5rem; border-radius: 9999px; background: var(--bn-primary-100); overflow: hidden; }
.bn-progress > span { display: block; height: 100%; border-radius: inherit; background: var(--bn-primary-dark); transition: width .4s ease; }

/* ============ التركيز بلوحة المفاتيح ============ */
:where(.bn-btn, .bn-tab, .bn-input):focus-visible {
    outline: 3px solid rgba(13, 148, 136, .55);
    outline-offset: 2px;
}

/* ============ الحركة ============ */
@keyframes bn-fade-in-up { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.bn-in { animation: bn-fade-in-up .35s ease both; }

/* يقتصر على مكونات bn-* حتى لا يمس أنماط اللوحة القائمة */
@media (prefers-reduced-motion: reduce) {
    .bn-in { animation: none; }
    .bn-btn, .bn-tab, .bn-input, .bn-progress > span { transition: none; }
}
