/*
 * Icon rail and RTL rules — hides Filament's own navigation groups for the
 * icon rail, and gives Urdu / Arabic their typefaces under [dir="rtl"].
 * Printed inline by AdminPanelProvider until it was a file; it keeps the same
 * position in the cascade, after the organisation colour overrides.
 */

/* ── Icon Rail: hide Filament default nav groups ── */
.fi-sidebar-nav-groups { display: none !important; }
.fi-sidebar-collapse-btn { display: none !important; }

/* ── Sidebar: permanent icon rail ── */
.fi-sidebar { overflow: visible !important; }
.fi-sidebar-nav  { overflow: visible !important; padding: 0 !important; position: relative !important; }

/* ── Logo: horizontally centered, brand text hidden ── */
.fi-sidebar-header {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0.875rem 0 !important;
    width: 100% !important;
    box-sizing: border-box !important;
}
.fi-logo {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin-left: 15px;
}
.fi-logo img,
.fi-brand-logo {
    width: 42px !important;
    height: auto !important;
    display: block !important;
    flex-shrink: 0 !important;
}
/* Show brand name as the sidebar header text. */
.fi-brand-name,
.fi-sidebar-header [class*="brand-name"],
.fi-logo,
.fi-logo span,
.fi-logo .fi-brand-name {
    display: inline-block !important;
    font-size: 0.8rem !important;
    font-weight: 700 !important;
    color: #0f172a !important;
    letter-spacing: -0.01em !important;
    white-space: nowrap !important;
    word-spacing: -0.15em !important;
    line-height: 1 !important;
    overflow: visible !important;
    width: auto !important;
    max-width: none !important;
    margin-left: 2px !important;
}

/* ── Rail container ── */

.irs-rail {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 6px 0;
    width: 100%;
    overflow-y: auto !important;
    overflow-x: visible;
    scrollbar-width: none;
    -ms-overflow-style: none;
    max-height: calc(100vh - 0px);
    gap: 8px;
}
.irs-rail::-webkit-scrollbar { width: 0; background: transparent; }
.irs-rail::-webkit-scrollbar-thumb { background: transparent; border-radius: 8px; }
.irs-rail:hover { scrollbar-width: thin; -ms-overflow-style: auto; }
.irs-rail:hover::-webkit-scrollbar { width: 6px; }
.irs-rail:hover::-webkit-scrollbar-thumb { background: #e2e8f0; }

/* ── Rail button ── */
.irs-btn {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 82px;
  min-height: 62px;
  padding: 11px 4px 7px;
  margin-top: 8px;
  border-radius: 10px;
  cursor: pointer;
  text-decoration: none !important;
  color: inherit;
  background: #f6f6f6;
  border: none;
  transition: background-color 0.15s ease, color 0.15s ease;
  gap: 3px;
  line-height: 1;
}
.irs-btn:first-child { margin-top: 0; }
.irs-btn:hover, .irs-btn--open { background-color: #ececec; }
.irs-btn--active { background-color: var(--primary-orange,#ff5100) !important; color: #fff !important; }

/* ── Rail icon ── */
.irs-icon { width: 26px !important; height: 26px !important; flex-shrink: 0; pointer-events: none; }

/* ── Rail label ── */
.irs-lbl {
  font-size: 10px;
  font-weight: 600;
  text-align: center;
  letter-spacing: 0.01em;
  pointer-events: none;
  max-width: 88px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  opacity: 0.82;
}
.irs-btn--active .irs-lbl { opacity: 1; }

/* ── Flyout panel ── */
.irs-flyout {
  position: fixed;
  left: 120px;
  z-index: 9999;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.13), 0 1px 4px rgba(0,0,0,0.06);
  min-width: 210px;
  max-width: 250px;
  max-height: 80vh;
  overflow-y: auto;
  padding: 6px 0 8px;
  border: 1px solid rgba(0,0,0,0.08);
  scrollbar-width: thin;
  scrollbar-color: #e5e7eb transparent;
}
.irs-flyout__head {
  padding: 8px 14px 7px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #9ca3af;
  border-bottom: 1px solid #f3f4f6;
  margin-bottom: 3px;
}
.irs-flyout__link {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 9px;
  padding: 8px 14px;
  font-size: 13px;
  color: #374151 !important;
  text-decoration: none !important;
  transition: background-color 0.1s ease, color 0.1s ease;
  cursor: pointer;
  white-space: nowrap;
  text-align: left;
  width: 100%;
}
.irs-flyout__link:hover {
  background-color: #f9fafb !important;
  color: #111827 !important;
}
.irs-flyout__link--active {
  color: var(--primary-orange,#ff5100) !important;
  background-color: rgba(255,81,0,0.05) !important;
  font-weight: 600;
}
/* Sub-menu item icon (pre-rendered SVG injected via x-html) */
.irs-flyout__icon-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: #6b7280;
}
.irs-flyout__icon {
  width: 18px !important;
  height: 18px !important;
}
.irs-flyout__link:hover .irs-flyout__icon-wrap { color: #111827; }
.irs-flyout__link--active .irs-flyout__icon-wrap { color: var(--primary-orange,#ff5100); }
.irs-flyout__label { flex: 1; }
[x-cloak] { display: none !important; }

/* ── RTL (Urdu / Arabic): the rail sits on the right, so the hover flyout
      must open to its LEFT, not off on the far left of the screen. ── */
[dir="rtl"] .irs-flyout { left: auto; right: 120px; }
[dir="rtl"] .irs-flyout__link { text-align: right; }
[dir="rtl"] .irs-flyout__head { text-align: right; }

/* ── A proper Urdu/Arabic typeface under RTL. Naskh for the dense UI (stays
      compact in buttons, tables and the icon rail); Nastaliq — the calligraphic
      Urdu script — for the big page title, which has the height to carry it. ── */
html[dir="rtl"] body,
html[dir="rtl"] .fi-body,
html[dir="rtl"] .fi-sidebar,
html[dir="rtl"] .fi-topbar,
html[dir="rtl"] .fi-main,
html[dir="rtl"] .irs-rail,
html[dir="rtl"] .irs-lbl,
html[dir="rtl"] .irs-flyout,
html[dir="rtl"] input,
html[dir="rtl"] button,
html[dir="rtl"] select,
html[dir="rtl"] textarea {
  font-family: "Noto Naskh Arabic", "Segoe UI", Tahoma, system-ui, sans-serif !important;
}
html[dir="rtl"] .fi-header-heading {
  font-family: "Noto Nastaliq Urdu", "Noto Naskh Arabic", serif !important;
  line-height: 1.9 !important;
}
