/* g02-drivers.css - Driver listing page */
.page--drivers .main-content { max-width: 1600px; padding: 12px clamp(12px, 2vw, 24px); margin: 0 auto; }
.page--drivers .page-header { margin-bottom: 12px; text-align: right; }
.page--drivers .page-header h1 { padding-bottom: 0; }
.page--drivers .page-header h1::after { display: none; }
.drivers-layout { display: grid; grid-template-columns: 280px 1fr; gap: 28px; align-items: start; }
.filter-panel {
  position: sticky; top: 88px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column;
  /* اللوحة تأخذ ارتفاع محتواها. overflow:hidden مع max-height ثابت
     كان يقصّ تذييل الأزرار (بحث / إعادة تعيين). */
  overflow: hidden;
  max-height: none;
}
/* على الشاشات الطويلة بما يكفي: ثبّت اللوحة واجعل الجسم وحده يتمرّر */
@media (min-height: 760px) {
  .filter-panel { max-height: calc(100vh - 108px); }
}
.filter-panel__header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px;
  background: linear-gradient(135deg, var(--secondary), #16203a);
  color: var(--white);
}
.filter-panel__header h3 { margin: 0; font-size: 1rem; display: flex; align-items: center; gap: 8px; font-weight: 700; }
.filter-panel__header h3 i { color: var(--primary); }
.filter-panel__close { display: none; background: rgba(255,255,255,0.12); border: none; width: 30px; height: 30px; border-radius: 8px; color: var(--white); font-size: 1.2rem; line-height: 1; cursor: pointer; }
/* الاستمارة نفسها عنصر flex داخل اللوحة: يجب أن تتمدد وتوزّع
   الجسم (قابل للتمرير) والتذييل (ثابت) وإلا اختفت أزرار البحث/إعادة التعيين */
.filter-panel > form {
  display: flex; flex-direction: column;
  flex: 1; min-height: 0;
}
.filter-panel__body { padding: 20px; overflow-y: auto; flex: 1; min-height: 0; }
.filter-panel .filter-group { margin-bottom: 18px; }
.filter-panel .filter-group:last-child { margin-bottom: 0; }
.filter-panel .filter-group label { display: flex; align-items: center; gap: 7px; font-weight: 600; font-size: 0.82rem; margin-bottom: 8px; color: var(--secondary); }
.filter-panel .filter-group label i { font-size: 0.8rem; color: var(--primary); width: 16px; text-align: center; }
.filter-panel .filter-group select {
  width: 100%; padding: 11px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius); font-family: inherit; font-size: 0.88rem;
  color: var(--text); background: var(--bg);
  cursor: pointer; transition: all var(--transition);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23888' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: left 12px center; padding-left: 34px;
}
.filter-panel .filter-group select:hover { border-color: var(--primary); }
.filter-panel .filter-group select:focus { outline: none; border-color: var(--primary); background: var(--white); box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.12); }
.filter-panel__footer {
  padding: 16px 20px; border-top: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 10px;
  flex-shrink: 0; background: var(--white);
}
.filter-panel__footer .btn { width: 100%; justify-content: center; }
/* زر إعادة التعيين: كان بحدود شبه شفافة تكاد لا تُرى فوق خلفية بيضاء */
.filter-panel__footer .btn--ghost-light {
  background: var(--bg, #F4F5F7);
  border: 1.5px solid var(--border);
  color: var(--secondary);
}
.filter-panel__footer .btn--ghost-light:hover {
  background: var(--white); border-color: var(--primary); color: var(--primary);
}
.filter-toggle { display: none; align-items: center; gap: 8px; padding: 12px 20px; background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-md); cursor: pointer; font-weight: 600; font-size: 0.9rem; color: var(--secondary); margin-bottom: 16px; width: 100%; justify-content: center; box-shadow: var(--shadow-sm); }
.filter-toggle i { font-size: 1rem; color: var(--primary); }
.filter-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 9999; display: none; }
.filter-overlay--show { display: block; }

.drivers-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }
.driver-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: all var(--transition);
  display: flex; flex-direction: column;
}
.driver-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.driver-card__banner { height: 100px; overflow: hidden; }
.driver-card__banner img { width: 100%; height: 100%; object-fit: cover; }
.driver-card__avatar-wrap { text-align: center; margin-top: -36px; }
.driver-card__avatar-wrap img { width: 72px; height: 72px; border-radius: 50%; border: 3px solid var(--white); box-shadow: 0 2px 8px rgba(0,0,0,0.1); object-fit: cover; }
.driver-card__content { padding: 12px 16px 16px; text-align: center; flex: 1; display: flex; flex-direction: column; gap: 8px; }
.driver-card__content h3 { font-size: 1.05rem; font-weight: 700; margin: 0; }
.driver-card__company { font-size: .82rem; color: var(--text-secondary); }
.driver-card__rating { display: flex; align-items: center; justify-content: center; gap: 2px; font-size: .82rem; color: #f59e0b; }
.driver-card__rating i { font-size: .75rem; }
.driver-card__rating span { color: var(--text-secondary); font-weight: 600; margin-inline-start: 4px; }
.driver-card .badge { display: inline-block; padding: 3px 12px; border-radius: 20px; font-size: .78rem; font-weight: 600; width: fit-content; margin: 0 auto; }
.badge--success { background: #d1fae5; color: #065f46; }
.badge--warning { background: #fef3c7; color: #92400e; }
.driver-card__vehicle { display: flex; align-items: center; gap: 8px; justify-content: center; font-size: .88rem; color: var(--text-secondary); }
.driver-card__vehicle img { width: 40px; height: 40px; border-radius: 8px; object-fit: cover; }
.driver-card__vehicle-label { font-weight: 600; }
.driver-card__price { font-family: var(--font-number); font-size: 1.2rem; font-weight: 800; color: var(--primary); }
.driver-card__price small { font-size: .78rem; font-weight: 600; color: var(--text-secondary); }
.driver-card__actions { display: flex; gap: 8px; margin-top: auto; }
.driver-card__actions .btn { flex: 1; padding: 9px 12px; font-size: .85rem; border-radius: 8px; font-weight: 600; cursor: pointer; transition: all var(--transition); text-decoration: none; text-align: center; }

.pagination { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 32px; direction: ltr; }
.pagination__item { width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; border: 1px solid var(--border); font-size: .85rem; cursor: pointer; transition: all var(--transition); background: var(--white); color: var(--text); text-decoration: none; }
.pagination__item:hover { border-color: var(--primary); color: var(--primary); }
.pagination__item--active { background: var(--primary); color: var(--white); border-color: var(--primary); }
.pagination__item--disabled { opacity: .4; pointer-events: none; }

@media (max-width: 1024px) {
  .drivers-layout { grid-template-columns: 240px 1fr; gap: 20px; }
}
@media (max-width: 768px) {
  .drivers-layout { grid-template-columns: 1fr; }
  .filter-toggle { display: flex; }
  .filter-panel {
    position: fixed; top: 0; right: -100%; left: auto;
    width: 320px; max-width: 88vw; height: 100%; max-height: none;
    z-index: 10000; border-radius: 0;
    box-shadow: -4px 0 24px rgba(0,0,0,0.18);
    transition: right 0.3s ease;
  }
  .filter-panel--open { right: 0; }
  .filter-panel__close { display: flex; align-items: center; justify-content: center; }
  .page-header { text-align: center; }
  .page-header h1 { font-size: 1.3rem; }
  .page-header p { font-size: .85rem; }
  .driver-card { max-width: 400px; margin-left: auto; margin-right: auto; }
  .driver-card__banner { height: 90px; }
  .driver-card__avatar-wrap img { width: 68px; height: 68px; }
  .driver-card__avatar-wrap { margin-top: -34px; }
  .driver-card__content { padding: 10px 14px 14px; }
  .driver-card__content h3 { font-size: 1rem; }
  .driver-card__price { font-size: 1.1rem; }
  .driver-card__actions { flex-direction: column; }
  .driver-card__actions .btn { width: 100%; }
  .pagination { gap: 4px; }
  .pagination__item { width: 34px; height: 34px; font-size: .8rem; }
}
@media (max-width: 480px) {
  .driver-card__banner { height: 70px; }
  .driver-card__avatar-wrap img { width: 56px; height: 56px; }
  .driver-card__avatar-wrap { margin-top: -28px; }
  .driver-card__content { padding: 8px 12px 12px; }
}
