/* AbanRah UI V8 — clean master fleet / masters screens + global readability + unified pagination. */
:root {
  --ar8-primary: #0f6170;
  --ar8-primary-dark: #0b4651;
  --ar8-primary-soft: #eaf5f6;
  --ar8-ink: #18343d;
  --ar8-muted: #6a8088;
  --ar8-border: #d8e5e8;
  --ar8-surface: #ffffff;
  --ar8-soft: #f5f9fa;
  --ar8-success: #1d805b;
  --ar8-success-soft: #eaf7f1;
  --ar8-danger: #bd4650;
  --ar8-danger-soft: #fff0f1;
  --ar8-warning: #b87410;
  --ar8-warning-soft: #fff6e4;
  --ar8-info: #326f9c;
  --ar8-finance: #7a538f;
  --ar8-shadow: 0 16px 42px rgba(20, 51, 60, .08);
  --ar8-shadow-sm: 0 7px 22px rgba(20, 51, 60, .06);
}

/* ---------- Global readability ---------- */
body.abanrah-ui .abanrah-main table,
body.abanrah-ui .abanrah-main .table,
body.abanrah-ui .abanrah-main .data-table {
  font-size: .88rem !important;
  line-height: 1.65 !important;
}
body.abanrah-ui .abanrah-main table th,
body.abanrah-ui .abanrah-main .table th,
body.abanrah-ui .abanrah-main .data-table th {
  font-size: .84rem !important;
  font-weight: 900 !important;
}
body.abanrah-ui .abanrah-main table td,
body.abanrah-ui .abanrah-main .table td,
body.abanrah-ui .abanrah-main .data-table td {
  font-size: .86rem !important;
}
body.abanrah-ui .abanrah-main form label,
body.abanrah-ui .abanrah-main form .form-label {
  font-size: .84rem !important;
  font-weight: 800 !important;
}
body.abanrah-ui .abanrah-main form input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="submit"]):not([type="reset"]):not([type="button"]),
body.abanrah-ui .abanrah-main form select,
body.abanrah-ui .abanrah-main form textarea,
body.abanrah-ui .abanrah-main form .select2-selection__rendered,
body.abanrah-ui .abanrah-main form .select2-search__field {
  font-size: .94rem !important;
}
body.abanrah-ui .abanrah-main form input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="submit"]):not([type="reset"]):not([type="button"]),
body.abanrah-ui .abanrah-main form select {
  min-height: 47px !important;
}

/* ---------- Reset buttons: always readable ---------- */
body.abanrah-ui .abanrah-main input[type="reset"],
body.abanrah-ui .abanrah-main button[type="reset"],
body.abanrah-ui .abanrah-main .btn-secondary {
  color: #fff !important;
  -webkit-text-fill-color: #fff !important;
  background: #536e77 !important;
  border: 1px solid #536e77 !important;
  box-shadow: 0 5px 14px rgba(45, 70, 78, .13) !important;
  opacity: 1 !important;
}
body.abanrah-ui .abanrah-main input[type="reset"]:hover,
body.abanrah-ui .abanrah-main button[type="reset"]:hover,
body.abanrah-ui .abanrah-main .btn-secondary:hover {
  color: #fff !important;
  -webkit-text-fill-color: #fff !important;
  background: #405a63 !important;
  border-color: #405a63 !important;
}
body.abanrah-ui .abanrah-main .btn-outline-secondary {
  color: #294851 !important;
  -webkit-text-fill-color: #294851 !important;
  background: #edf3f4 !important;
  border: 1px solid #8fa7ae !important;
  box-shadow: none !important;
}
body.abanrah-ui .abanrah-main .btn-outline-secondary *,
body.abanrah-ui .abanrah-main .btn-outline-secondary i,
body.abanrah-ui .abanrah-main .btn-outline-secondary span {
  color: #294851 !important;
  -webkit-text-fill-color: #294851 !important;
}
body.abanrah-ui .abanrah-main .btn-outline-secondary:hover {
  color: #fff !important;
  -webkit-text-fill-color: #fff !important;
  background: #536e77 !important;
  border-color: #536e77 !important;
}
body.abanrah-ui .abanrah-main .btn-outline-secondary:hover * {
  color: #fff !important;
  -webkit-text-fill-color: #fff !important;
}

/* ---------- Unified pagination throughout the project ---------- */
body.abanrah-ui .abanrah-main .pagination,
body.abanrah-ui .abanrah-main .ar-pagination,
body.abanrah-ui .abanrah-main .ar-v6-pagination,
body.abanrah-ui .abanrah-main nav[aria-label*="صفحه"],
body.abanrah-ui .abanrah-main nav[aria-label*="page"] {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex-wrap: wrap !important;
  gap: 7px !important;
  width: 100%;
  margin: 22px 0 8px !important;
  padding: 0 !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  list-style: none !important;
}
body.abanrah-ui .abanrah-main .pagination .step-links {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex-wrap: wrap !important;
  gap: 7px !important;
}
body.abanrah-ui .abanrah-main .pagination .page-item {
  display: flex !important;
  margin: 0 !important;
  padding: 0 !important;
  background: transparent !important;
  border: 0 !important;
}
body.abanrah-ui .abanrah-main .pagination a,
body.abanrah-ui .abanrah-main .pagination span:not(.step-links),
body.abanrah-ui .abanrah-main .pagination .page-link,
body.abanrah-ui .abanrah-main .ar-pagination a,
body.abanrah-ui .abanrah-main .ar-pagination span,
body.abanrah-ui .abanrah-main .ar-v6-pagination a,
body.abanrah-ui .abanrah-main .ar-v6-pagination span {
  min-width: 40px !important;
  min-height: 40px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px !important;
  margin: 0 !important;
  padding: 8px 12px !important;
  color: #31515a !important;
  -webkit-text-fill-color: #31515a !important;
  background: #fff !important;
  border: 1px solid #d1e0e3 !important;
  border-radius: 10px !important;
  box-shadow: 0 4px 12px rgba(20, 53, 63, .04) !important;
  text-decoration: none !important;
  font-size: .8rem !important;
  font-weight: 850 !important;
  line-height: 1.2 !important;
}
body.abanrah-ui .abanrah-main .pagination a:hover,
body.abanrah-ui .abanrah-main .pagination .page-link:hover,
body.abanrah-ui .abanrah-main .ar-pagination a:hover,
body.abanrah-ui .abanrah-main .ar-v6-pagination a:hover {
  color: #fff !important;
  -webkit-text-fill-color: #fff !important;
  background: var(--ar8-primary) !important;
  border-color: var(--ar8-primary) !important;
}
body.abanrah-ui .abanrah-main .pagination .active .page-link,
body.abanrah-ui .abanrah-main .pagination .page-item.active .page-link,
body.abanrah-ui .abanrah-main .pagination .current,
body.abanrah-ui .abanrah-main .pagination .is-current,
body.abanrah-ui .abanrah-main .ar-pagination .is-current,
body.abanrah-ui .abanrah-main .ar-v6-pagination .is-current,
body.abanrah-ui .abanrah-main .ar-v6-pagination > span {
  color: #fff !important;
  -webkit-text-fill-color: #fff !important;
  background: linear-gradient(135deg, #0f6572, #164852) !important;
  border-color: #0f6572 !important;
  box-shadow: 0 7px 18px rgba(15, 101, 114, .17) !important;
}
body.abanrah-ui .abanrah-main .pagination a.disabled,
body.abanrah-ui .abanrah-main .pagination .disabled .page-link {
  color: #9aa9ae !important;
  background: #f2f5f6 !important;
  border-color: #e2e9eb !important;
  pointer-events: none;
}

/* ---------- Shared V8 elements ---------- */
.ar-v8-kicker {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 8px;
  color: #dfb35c;
  font-size: .72rem;
  font-weight: 900;
}
.ar-v8-count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 7px 12px;
  color: #31545d;
  background: #eef5f6;
  border: 1px solid #d7e5e7;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 900;
  white-space: nowrap;
}
.ar-v8-count-badge.is-empty { color: #9c4f2e; background: #fff5e9; border-color: #efdbc1; }
.ar-v8-count-badge.is-travel { color: #176447; background: #eaf7f1; border-color: #c8e4d7; }
.ar-v8-count-badge.is-muted { color: #65777d; background: #f1f4f5; border-color: #dce4e6; }
.ar-v8-muted { color: #87969b; }
.ar-v8-alert { margin-bottom: 14px; border-radius: 13px; }
.ar-v8-access-denied { max-width: 620px; margin: 60px auto; padding: 34px; text-align: center; background: #fff; border: 1px solid var(--ar8-border); border-radius: 22px; box-shadow: var(--ar8-shadow); }
.ar-v8-access-denied i { display: block; margin-bottom: 14px; color: var(--ar8-danger); font-size: 2rem; }
.ar-v8-access-denied h2 { margin-bottom: 7px; font-size: 1.25rem; }
.ar-v8-access-denied p { margin: 0; color: var(--ar8-muted); }

/* ---------- Master fleet page ---------- */
.ar-v8-master-fleet { max-width: none; }
.ar-v8-fleet-hero {
  min-height: 142px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  margin-bottom: 16px;
  padding: clamp(22px, 3vw, 34px);
  color: #fff;
  background: radial-gradient(circle at 10% 15%, rgba(255,255,255,.13), transparent 31%), linear-gradient(135deg, #0c5662, #173844 75%);
  border-radius: 24px;
  box-shadow: 0 18px 44px rgba(18, 52, 62, .13);
}
.ar-v8-fleet-hero-copy h1 { margin: 0 0 7px; color: #fff !important; font-size: clamp(1.35rem, 2.5vw, 1.85rem); font-weight: 950; }
.ar-v8-fleet-hero-copy p { margin: 0; color: rgba(255,255,255,.75); font-size: .82rem; }
.ar-v8-fleet-hero-actions { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.ar-v8-fleet-hero-actions .btn { min-height: 43px; }

.ar-v8-stat-strip { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 12px; margin-bottom: 14px; }
.ar-v8-stat {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 15px 17px;
  background: #fff;
  border: 1px solid var(--ar8-border);
  border-radius: 17px;
  box-shadow: var(--ar8-shadow-sm);
}
.ar-v8-stat-icon { width: 45px; height: 45px; flex: 0 0 45px; display: grid; place-items: center; color: var(--ar8-primary); background: var(--ar8-primary-soft); border-radius: 13px; font-size: 1rem; }
.ar-v8-stat.is-empty .ar-v8-stat-icon { color: #a96119; background: #fff4df; }
.ar-v8-stat.is-travel .ar-v8-stat-icon { color: var(--ar8-success); background: var(--ar8-success-soft); }
.ar-v8-stat > div { min-width: 0; display: grid; grid-template-columns: 1fr auto; column-gap: 9px; align-items: baseline; }
.ar-v8-stat small { grid-column: 1 / -1; color: var(--ar8-muted); font-size: .68rem; font-weight: 850; }
.ar-v8-stat strong { color: var(--ar8-ink); font-size: 1.45rem; font-weight: 950; }
.ar-v8-stat > div > span { color: #819198; font-size: .63rem; font-weight: 750; }

.ar-v8-section-nav { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 9px; margin-bottom: 16px; }
.ar-v8-section-nav a { display: flex; align-items: center; gap: 9px; min-height: 45px; padding: 9px 13px; color: #365660; background: #fff; border: 1px solid #d9e5e7; border-radius: 13px; text-decoration: none; font-size: .76rem; font-weight: 850; }
.ar-v8-section-nav a:hover { color: var(--ar8-primary); border-color: #9fc6cc; background: #f5fbfb; }
.ar-v8-section-nav a b { margin-right: auto; min-width: 28px; padding: 3px 7px; text-align: center; color: var(--ar8-primary); background: #eaf5f6; border-radius: 999px; font-size: .68rem; }

.ar-v8-fleet-panel { scroll-margin-top: 90px; margin-bottom: 16px; background: #fff; border: 1px solid var(--ar8-border); border-radius: 20px; box-shadow: var(--ar8-shadow); overflow: hidden; }
.ar-v8-panel-head { min-height: 70px; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 13px 17px; background: #fbfdfd; border-bottom: 1px solid #e0eaec; }
.ar-v8-panel-head > div:first-child { display: flex; align-items: center; gap: 11px; min-width: 0; }
.ar-v8-panel-head small { display: block; margin-bottom: 2px; color: #849399; font-size: .63rem; font-weight: 800; }
.ar-v8-panel-head h2 { margin: 0; color: #213f48; font-size: 1rem; font-weight: 950; }
.ar-v8-panel-icon { width: 42px; height: 42px; flex: 0 0 42px; display: grid; place-items: center; color: var(--ar8-primary); background: var(--ar8-primary-soft); border-radius: 12px; }
.ar-v8-panel-icon.is-empty { color: #a96119; background: #fff3de; }
.ar-v8-panel-icon.is-travel { color: var(--ar8-success); background: var(--ar8-success-soft); }
.ar-v8-panel-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ar-v8-panel-body { padding: 15px 17px 17px; }

.ar-v8-search-form { display: grid; grid-template-columns: minmax(240px,1fr) auto auto; align-items: end; gap: 9px; margin-bottom: 13px; padding: 11px; background: #f5f9fa; border: 1px solid #e0eaec; border-radius: 14px; }
.ar-v8-search-field { min-width: 0; }
.ar-v8-search-field p { margin: 0; }
.ar-v8-search-field label { display: block; margin-bottom: 5px; color: #4c656d; }
.ar-v8-search-field input { margin: 0 !important; background: #fff !important; }
.ar-v8-selection-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; padding: 9px 11px; color: #60757c; background: #f7fafb; border: 1px solid #e0e9eb; border-radius: 12px; font-size: .7rem; }
.ar-v8-selection-toolbar > div { display: flex; align-items: center; gap: 7px; }

.ar-v8-table-shell { width: 100%; overflow: visible; border: 1px solid #dce7e9; border-radius: 14px; }
body.abanrah-ui .abanrah-main .ar-v8-fleet-table { width: 100% !important; min-width: 0 !important; table-layout: fixed !important; margin: 0 !important; border: 0 !important; border-collapse: separate !important; border-spacing: 0 !important; box-shadow: none !important; }
body.abanrah-ui .abanrah-main .ar-v8-fleet-table thead th { min-width: 0 !important; padding: 11px 8px !important; color: #31515a !important; background: #edf5f6 !important; border-bottom: 1px solid #d4e3e6 !important; text-align: right !important; white-space: normal !important; }
body.abanrah-ui .abanrah-main .ar-v8-fleet-table td { min-width: 0 !important; padding: 11px 8px !important; color: #35515a; background: #fff; border-bottom: 1px solid #edf2f3 !important; vertical-align: middle !important; overflow-wrap: anywhere; word-break: normal; }
body.abanrah-ui .abanrah-main .ar-v8-fleet-table tbody tr:last-child td { border-bottom: 0 !important; }
body.abanrah-ui .abanrah-main .ar-v8-fleet-table tbody tr:hover td { background: #f8fbfb !important; }
.ar-v8-fleet-table .is-index { width: 56px !important; text-align: center !important; }
.ar-v8-fleet-table .is-action { width: 72px !important; text-align: center !important; }
.ar-v8-empty-table .is-check { width: 48px !important; text-align: center !important; }
.ar-v8-entity-link { color: #0e6270 !important; font-weight: 950; text-decoration: none !important; }
.ar-v8-phone { color: #3d6874 !important; font-weight: 800; white-space: nowrap; }
.ar-v8-status { display: inline-flex; align-items: center; gap: 5px; padding: 5px 8px; border-radius: 999px; font-size: .67rem; font-weight: 900; white-space: nowrap; }
.ar-v8-status.is-active { color: #176347; background: #e8f6ef; }
.ar-v8-status.is-inactive { color: #7b6b6d; background: #f0f2f3; }
.ar-v8-eye { width: 35px; height: 35px; display: inline-grid; place-items: center; color: #145e79 !important; background: #edf7fb; border: 1px solid #cee2eb; border-radius: 10px; text-decoration: none !important; }
.ar-v8-eye:hover { color: #fff !important; background: #145e79; border-color: #145e79; }
.ar-v8-days { display: inline-flex; padding: 5px 8px; color: #8b5419; background: #fff3df; border-radius: 8px; font-size: .7rem; font-weight: 900; }
.ar-v8-jalali-date { display: inline-flex; align-items: center; gap: 6px; direction: ltr; color: #315d66; background: #f0f7f8; padding: 5px 8px; border-radius: 8px; font-weight: 900; white-space: nowrap; }
.ar-v8-empty-state { padding: 30px 18px; text-align: center; color: #697f86; }
.ar-v8-empty-state > i { display: block; margin-bottom: 9px; color: #8ba2a8; font-size: 1.65rem; }
.ar-v8-empty-state.is-success > i { color: var(--ar8-success); }
.ar-v8-empty-state h3 { margin: 0 0 5px; color: #38545d; font-size: .95rem; }
.ar-v8-empty-state p { margin: 0; font-size: .75rem; }

/* ---------- Masters page ---------- */
.ar-v8-masters-page { max-width: none; }
.ar-v8-masters-hero { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 17px; padding: clamp(23px,3vw,34px); color: #fff; background: radial-gradient(circle at 88% 10%, rgba(255,255,255,.11), transparent 34%), linear-gradient(135deg,#0d5865,#193844); border-radius: 24px; box-shadow: 0 18px 44px rgba(18,52,62,.13); }
.ar-v8-masters-hero h1 { margin: 0 0 7px; color: #fff !important; font-size: clamp(1.4rem,2.6vw,1.9rem); font-weight: 950; }
.ar-v8-masters-hero p { max-width: 700px; margin: 0; color: rgba(255,255,255,.75); font-size: .82rem; line-height: 1.9; }
.ar-v8-master-summary { display: flex; gap: 8px; }
.ar-v8-master-summary > span { min-width: 85px; display: flex; flex-direction: column; align-items: center; padding: 10px 13px; background: rgba(255,255,255,.09); border: 1px solid rgba(255,255,255,.13); border-radius: 14px; }
.ar-v8-master-summary strong { color: #fff; font-size: 1.25rem; }
.ar-v8-master-summary small { color: rgba(255,255,255,.68); font-size: .63rem; }

.ar-v8-master-section { margin-bottom: 18px; padding: 15px; background: #fff; border: 1px solid var(--ar8-border); border-radius: 20px; box-shadow: var(--ar8-shadow); }
.ar-v8-master-section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 13px; padding: 3px 2px 11px; border-bottom: 1px solid #e6edef; }
.ar-v8-master-section-head > div { display: flex; align-items: center; gap: 10px; }
.ar-v8-master-section-head small { display: block; color: #8a9a9f; font-size: .62rem; font-weight: 800; }
.ar-v8-master-section-head h2 { margin: 2px 0 0; color: #2a4851; font-size: 1rem; font-weight: 950; }
.ar-v8-dot { width: 10px; height: 10px; border-radius: 50%; box-shadow: 0 0 0 5px rgba(30,128,91,.10); }
.ar-v8-dot.is-active { background: var(--ar8-success); }
.ar-v8-dot.is-inactive { background: #87969b; box-shadow: 0 0 0 5px rgba(120,140,146,.10); }
.ar-v8-master-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; }
.ar-v8-master-card { min-width: 0; padding: 15px; background: #fbfdfd; border: 1px solid #dce7e9; border-radius: 16px; transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease; }
.ar-v8-master-card:hover { transform: translateY(-2px); border-color: #aecbd0; box-shadow: 0 10px 24px rgba(20,53,63,.08); }
.ar-v8-master-card.is-inactive { opacity: .84; background: #fafbfb; }
.ar-v8-master-card-top { display: flex; align-items: center; gap: 11px; margin-bottom: 10px; }
.ar-v8-master-logo { width: 54px; height: 54px; flex: 0 0 54px; overflow: hidden; display: grid; place-items: center; background: #eef5f6; border: 1px solid #dce8ea; border-radius: 14px; }
.ar-v8-master-logo img { width: 100%; height: 100%; object-fit: cover; }
.ar-v8-master-logo span { color: #5e7b83; font-size: 1.2rem; }
.ar-v8-master-name { min-width: 0; }
.ar-v8-master-name h3 { margin: 4px 0 0; color: #203f48; font-size: 1.03rem; font-weight: 950; overflow-wrap: anywhere; }
.ar-v8-master-info { min-height: 45px; margin: 0 0 12px; color: #6b8087; font-size: .74rem; line-height: 1.9; }
.ar-v8-master-actions { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 7px; }
.ar-v8-master-actions a { min-height: 39px; display: flex; align-items: center; justify-content: center; gap: 6px; padding: 7px 9px; color: #35535c !important; background: #fff; border: 1px solid #d9e5e7; border-radius: 10px; text-decoration: none !important; font-size: .69rem; font-weight: 900; }
.ar-v8-master-actions a:hover { transform: translateY(-1px); }
.ar-v8-master-actions a.is-primary { color: #0f6570 !important; background: #edf7f8; border-color: #c8e2e5; }
.ar-v8-master-actions a.is-success { color: #1c7454 !important; background: #edf8f3; border-color: #cce6da; }
.ar-v8-master-actions a.is-info { color: #306f9e !important; background: #eef6fb; border-color: #cfdfec; }
.ar-v8-master-actions a.is-finance { color: #76508a !important; background: #f7f0fa; border-color: #e2d3e9; }

@media (max-width: 1180px) {
  .ar-v8-master-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  body.abanrah-ui .abanrah-main .ar-v8-fleet-table { table-layout: auto !important; min-width: 820px !important; }
  .ar-v8-table-shell { overflow-x: auto; -webkit-overflow-scrolling: touch; }
}
@media (max-width: 900px) {
  .ar-v8-fleet-hero, .ar-v8-masters-hero { align-items: flex-start; flex-direction: column; }
  .ar-v8-stat-strip, .ar-v8-section-nav { grid-template-columns: 1fr; }
  .ar-v8-search-form { grid-template-columns: 1fr 1fr; }
  .ar-v8-search-field { grid-column: 1 / -1; }
  .ar-v8-master-grid { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .ar-v8-panel-head, .ar-v8-master-section-head, .ar-v8-selection-toolbar { align-items: flex-start; flex-direction: column; }
  .ar-v8-search-form { grid-template-columns: 1fr; }
  .ar-v8-search-field { grid-column: auto; }
  .ar-v8-search-form .btn { width: 100%; }
  .ar-v8-master-summary { width: 100%; }
  .ar-v8-master-summary > span { flex: 1; }
  .ar-v8-master-actions { grid-template-columns: 1fr; }
}
