/* ═══════════════════════════════════════════════════════════════════════
   إدارة المركبات — قوائم الأسطول (fl-*) والمرفقات (fla-*)
   نفس نسق قوائم SALES (رأس + شريط فلاتر + جدول أبيض + تذييل) الذي تسير عليه
   الفروع والسيارات، وصفحات السجل على record-page.css (rc-*).
   ═══════════════════════════════════════════════════════════════════════ */
.fl { --ink:#0f172a; --muted:#64748b; --line:#e5e7eb; --line2:#f1f5f9; --bg:#f8fafc; --green:#10b981; --green-d:#047857; color: var(--ink); padding-bottom: 2rem; }
.fl .num { font-variant-numeric: tabular-nums; direction: ltr; unicode-bidi: isolate; }
.fl-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin: .25rem 0 1rem; }
.fl-title { font-size: 1.55rem; font-weight: 800; margin: 0; display: flex; align-items: center; gap: .55rem; }
.fl-desc { color: var(--muted); font-size: .92rem; margin: .3rem 0 0; }
.fl-acts { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.fl-btn { display: inline-flex; align-items: center; gap: .45rem; height: 40px; padding: 0 1rem; border-radius: 10px; border: 1px solid var(--line); background: #fff; color: var(--ink); font-weight: 600; font-size: .92rem; cursor: pointer; font-family: inherit; white-space: nowrap; text-decoration: none; transition: background .15s; }
.fl-btn:hover:not(:disabled) { background: var(--bg); color: var(--ink); }
.fl-btn:disabled { opacity: .55; cursor: not-allowed; }
.fl-btn-sq { width: 40px; padding: 0; justify-content: center; }
.fl-btn-green { background: var(--green-d); border-color: var(--green-d); color: #fff; }
.fl-btn-green:hover:not(:disabled) { background: #065f46; color: #fff; }
.fl-btn-sm { height: 32px; padding: 0 .7rem; font-size: .84rem; border-radius: 8px; }

/* شريط الأقسام: السيارات + الشاشات الثماني */
.fl-nav { display: flex; gap: .4rem; overflow-x: auto; padding-bottom: .35rem; margin-bottom: 1rem; scrollbar-width: thin; }
.fl-nav a { display: inline-flex; align-items: center; gap: .4rem; padding: .45rem .95rem; border-radius: 50px; border: 1px solid #e5e7eb; background: #fff; color: #334155; font-size: .86rem; font-weight: 600; white-space: nowrap; text-decoration: none; transition: all .15s; }
.fl-nav a:hover { border-color: #a7f3d0; background: #ecfdf5; color: #047857; }
.fl-nav a.on { background: #047857; border-color: #047857; color: #fff; }
.fl-nav a .bi { font-size: .95rem; }
.fl-nav a .fl-nav__n { background: rgba(255,255,255,.25); border-radius: 50px; padding: 0 .4rem; font-size: .74rem; }
.fl-nav a:not(.on) .fl-nav__n { background: #fee2e2; color: #b91c1c; }

/* مؤشرات */
.fl-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: .75rem; margin-bottom: 1rem; }
.fl-kpi { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: .8rem 1rem; display: flex; align-items: center; gap: .8rem; text-decoration: none; color: inherit; }
.fl-kpi .bi { font-size: 1.35rem; width: 42px; height: 42px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.fl-kpi__v { font-size: 1.25rem; font-weight: 800; line-height: 1.1; }
.fl-kpi__l { font-size: .78rem; color: var(--muted); font-weight: 600; }
.fl-kpi.mint .bi { background: #ecfdf5; color: #047857; } .fl-kpi.sky .bi { background: #eff6ff; color: #1d4ed8; } .fl-kpi.rose .bi { background: #fef2f2; color: #b91c1c; }
.fl-kpi.peach .bi { background: #fff7ed; color: #c2410c; } .fl-kpi.lavender .bi { background: #f5f3ff; color: #6d28d9; } .fl-kpi.slate .bi { background: #f1f5f9; color: #334155; }
a.fl-kpi:hover { border-color: #a7f3d0; }

/* فلاتر */
.fl-filters { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: .8rem 1rem; margin-bottom: 1rem; display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.fl-search { flex: 1 1 220px; display: flex; align-items: center; gap: .5rem; height: 40px; padding: 0 .8rem; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: #94a3b8; margin: 0; }
.fl-search input { border: 0; outline: 0; flex: 1; min-width: 0; font-size: .92rem; color: var(--ink); font-family: inherit; background: transparent; }
.fl-search:focus-within { border-color: var(--green); box-shadow: 0 0 0 3px rgba(16,185,129,.12); }
.fl-sel, .fl-date { height: 40px; border: 1px solid var(--line); border-radius: 10px; background: #fff; padding: 0 .7rem; font-family: inherit; font-size: .9rem; color: var(--ink); }
.fl-date { width: 150px; }
.fl-sel:focus, .fl-date:focus { outline: 0; border-color: var(--green); box-shadow: 0 0 0 3px rgba(16,185,129,.12); }
.fl-car { flex: 1 1 240px; min-width: 220px; }
.fl-tabs { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff; }
.fl-tabs button { border: 0; background: #fff; height: 38px; padding: 0 .85rem; color: var(--muted); cursor: pointer; font-family: inherit; font-weight: 600; font-size: .85rem; }
.fl-tabs button + button { border-inline-start: 1px solid var(--line); }
.fl-tabs button.on { background: #ecfdf5; color: var(--green-d); }

/* الجدول */
.fl-card { background: #fff; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.fl-wrap { overflow-x: auto; }
.fl-tbl { width: 100%; border-collapse: collapse; font-size: .9rem; }
.fl-tbl th { background: var(--bg); color: var(--muted); font-weight: 600; font-size: .82rem; padding: .7rem .85rem; border-bottom: 1px solid var(--line); text-align: start; white-space: nowrap; }
.fl-tbl td { padding: .62rem .85rem; border-bottom: 1px solid var(--line2); vertical-align: middle; text-align: start; }
.fl-tbl tr:hover td { background: var(--bg); }
.fl-tbl tfoot td { background: #f0fdf4; font-weight: 700; border-top: 1px solid #bbf7d0; }
.fl-n { font-weight: 700; color: var(--ink); text-decoration: none; }
.fl-n:hover { color: var(--green-d); text-decoration: underline; }
.fl-s { font-size: .78rem; color: var(--muted); }
.fl-car-cell { display: flex; align-items: center; gap: .6rem; min-width: 0; }
.fl-car-cell img, .fl-car-cell .fl-av { width: 38px; height: 38px; border-radius: 10px; object-fit: cover; flex-shrink: 0; background: #ecfdf5; color: #047857; display: inline-flex; align-items: center; justify-content: center; font-size: 1.1rem; }
.fl-pill { display: inline-flex; align-items: center; gap: .3rem; font-size: .75rem; font-weight: 700; padding: .14rem .55rem; border-radius: 7px; border: 1px solid; background: #fff; white-space: nowrap; }
.fl-pill.g { color: #047857; border-color: #a7f3d0; background: #ecfdf5; } .fl-pill.r { color: #b91c1c; border-color: #fecaca; background: #fef2f2; } .fl-pill.a { color: #b45309; border-color: #fde68a; background: #fffbeb; }
.fl-pill.b { color: #1d4ed8; border-color: #bfdbfe; background: #eff6ff; } .fl-pill.m { color: #475569; border-color: #e2e8f0; background: #f8fafc; } .fl-pill.v { color: #6d28d9; border-color: #ddd6fe; background: #f5f3ff; }
.fl-ib { width: 32px; height: 32px; border-radius: 8px; border: 1px solid transparent; background: transparent; color: #64748b; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; font-size: .95rem; text-decoration: none; }
.fl-ib:hover { background: var(--bg); border-color: var(--line); color: var(--ink); }
.fl-ib.red:hover { color: #dc2626; background: #fef2f2; border-color: #fecaca; }
.fl-empty { padding: 2.5rem 1rem; text-align: center; color: var(--muted); }
.fl-empty .bi { display: block; font-size: 2rem; color: #cbd5e1; margin-bottom: .4rem; }
.fl-foot { display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap; padding: .85rem 1rem; border-top: 1px solid var(--line2); }
.fl-foot-i { color: var(--muted); font-size: .88rem; }
.fl-foot-r { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.fl-rpp { display: inline-flex; align-items: center; gap: .5rem; color: var(--muted); font-size: .85rem; margin: 0; }
.fl-sel-sm { height: 34px; border: 1px solid var(--line); border-radius: 8px; background: #fff; padding: 0 .5rem; font-family: inherit; font-size: .88rem; }
.fl-pg { display: flex; align-items: center; gap: .3rem; }
.fl-pg-btn { height: 34px; min-width: 34px; padding: 0 .7rem; border-radius: 8px; border: 1px solid var(--line); background: #fff; color: var(--ink); font-size: .85rem; font-weight: 600; cursor: pointer; font-family: inherit; }
.fl-pg-btn:hover:not(:disabled) { background: var(--bg); }
.fl-pg-btn:disabled { opacity: .45; cursor: not-allowed; }
.fl-pg-btn.on { background: var(--green-d); border-color: var(--green-d); color: #fff; }

/* تنبيه ضمن الصف: أيام متبقية */
.fl-due { display: inline-flex; align-items: center; gap: .3rem; font-weight: 700; font-size: .84rem; }
.fl-due.ok { color: #047857; } .fl-due.soon { color: #b45309; } .fl-due.bad { color: #b91c1c; }

/* ── المرفقات ───────────────────────────────────────────────────────── */
.fla-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: .6rem; }
.fla-ph { position: relative; aspect-ratio: 4/3; border-radius: 12px; overflow: hidden; border: 1px solid #e5e7eb; background: #f8fafc; }
.fla-ph img { width: 100%; height: 100%; object-fit: cover; display: block; }
.fla-ph a { display: block; height: 100%; }
.fla-ph__x { position: absolute; top: 6px; inset-inline-end: 6px; width: 26px; height: 26px; border-radius: 8px; border: 0; background: rgba(15,23,42,.65); color: #fff; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; font-size: .8rem; }
.fla-ph__x:hover { background: #b91c1c; }
.fla-list { display: flex; flex-direction: column; gap: .4rem; }
.fla-row { display: flex; align-items: center; gap: .6rem; padding: .5rem .7rem; border: 1px solid #e5e7eb; border-radius: 10px; background: #fff; }
.fla-row .bi { font-size: 1.15rem; color: #475569; }
.fla-row a { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; color: #0f172a; text-decoration: none; }
.fla-row a:hover { color: #047857; }
.fla-row small { color: #64748b; font-size: .76rem; white-space: nowrap; }
.fla-drop { border: 1.5px dashed #a7f3d0; border-radius: 12px; padding: .9rem; text-align: center; color: #047857; background: #f0fdf4; position: relative; font-size: .86rem; font-weight: 600; margin-top: .7rem; }
.fla-drop input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.fla-drop.busy { opacity: .6; pointer-events: none; }
.fla-prog { height: 6px; border-radius: 6px; background: #e5e7eb; overflow: hidden; margin-top: .5rem; }
.fla-prog > div { height: 100%; background: #047857; transition: width .2s; }
.fla-hero { width: 100%; max-height: 260px; object-fit: cover; border-radius: 14px; border: 1px solid #e5e7eb; display: block; }
.fla-cover { width: 96px; height: 96px; border-radius: 16px; object-fit: cover; border: 1px solid #e5e7eb; background: #f8fafc; }

@media (max-width: 768px) {
    .fl-tbl thead { display: none; }
    .fl-tbl, .fl-tbl tbody, .fl-tbl tr, .fl-tbl td { display: block; width: 100%; }
    .fl-tbl tr { border-bottom: 1px solid var(--line); padding: .35rem 0; }
    .fl-tbl td { display: flex; align-items: center; justify-content: space-between; gap: 1rem; border-bottom: 0; padding: .4rem .85rem; }
    .fl-tbl td::before { content: attr(data-label); color: var(--muted); font-size: .76rem; font-weight: 700; }
    .fl-tbl td.fl-no { display: none; }
    .fl-tbl tfoot { display: none; }
    .fl-foot { justify-content: center; }
    .fl-date { width: 100%; }
}
