/* iBoundHost — theme layer on top of Bootstrap 5.3 (RTL + LTR, light + dark) */

:root {
  --ibh-black: #0B0D12;
  --ibh-bg: #F5F6F8;
  --ibh-surface: #FFFFFF;
  --ibh-surface-2: #F9FAFB;
  --ibh-border: #E4E7EC;
  --ibh-ink: #101828;
  --ibh-muted: #475467;
  --ibh-primary: #2563EB;
  --ibh-primary-ink: #1D4ED8;
  --ibh-primary-soft: #EAF1FF;
  --ibh-bright: #60A5FA;
  --ibh-radius: 14px;
  --ibh-font: "IBM Plex Sans Arabic", "Segoe UI", Tahoma, sans-serif;
  --ibh-font-display: "Readex Pro", "IBM Plex Sans Arabic", sans-serif;

  --bs-body-font-family: var(--ibh-font);
  --bs-body-bg: var(--ibh-bg);
  --bs-body-color: var(--ibh-ink);
  --bs-secondary-color: var(--ibh-muted);
  --bs-border-color: var(--ibh-border);
  --bs-primary: #2563EB;
  --bs-primary-rgb: 37, 99, 235;
  --bs-link-color: #2563EB;
  --bs-link-color-rgb: 37, 99, 235;
  --bs-link-hover-color: #1D4ED8;
  --bs-link-hover-color-rgb: 29, 78, 216;
  --bs-focus-ring-color: rgba(37, 99, 235, .3);
}

[data-bs-theme="dark"] {
  --ibh-bg: #0F1218;
  --ibh-surface: #161A22;
  --ibh-surface-2: #1B2029;
  --ibh-border: #262C38;
  --ibh-ink: #E4E7EC;
  --ibh-muted: #98A2B3;
  --ibh-primary-soft: rgba(37, 99, 235, .18);
  --ibh-primary-ink: #93C5FD;
  --bs-body-bg: var(--ibh-bg);
  --bs-body-color: var(--ibh-ink);
  --bs-link-color: #60A5FA;
  --bs-link-color-rgb: 96, 165, 250;
  --bs-link-hover-color: #93C5FD;
}

body { background: var(--ibh-bg); color: var(--ibh-ink); }
h1, h2, h3, h4, .display-font { font-family: var(--ibh-font-display); }
a { text-decoration: none; }

.skip-link { position: absolute; inset-inline-start: 1rem; top: -60px; z-index: 2000; background: var(--ibh-primary); color: #fff; padding: .5rem 1rem; border-radius: 8px; }
.skip-link:focus { top: 1rem; }

/* Buttons */
.btn { border-radius: 10px; font-weight: 600; }
.btn-primary {
  --bs-btn-bg: #2563EB; --bs-btn-border-color: #2563EB;
  --bs-btn-hover-bg: #1D4ED8; --bs-btn-hover-border-color: #1D4ED8;
  --bs-btn-active-bg: #1E40AF; --bs-btn-active-border-color: #1E40AF;
  --bs-btn-disabled-bg: #2563EB; --bs-btn-disabled-border-color: #2563EB;
}
.btn-outline-primary {
  --bs-btn-color: var(--ibh-primary-ink); --bs-btn-border-color: #2563EB;
  --bs-btn-hover-bg: #2563EB; --bs-btn-hover-border-color: #2563EB; --bs-btn-hover-color: #fff;
}
.btn-icon { width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--ibh-border); background: var(--ibh-surface); color: var(--ibh-ink); padding: 0; }
.btn-icon:hover { background: var(--ibh-surface-2); }
.btn-lg { min-height: 52px; }

/* Forms */
.form-control, .form-select { border-radius: 10px; min-height: 44px; border-color: #D0D5DD; background-color: var(--ibh-surface); }
[data-bs-theme="dark"] .form-control, [data-bs-theme="dark"] .form-select { border-color: var(--ibh-border); }
.form-label { font-weight: 600; font-size: .9rem; color: var(--ibh-ink); }
.form-text { color: var(--ibh-muted); }
.form-check-input:checked { background-color: #2563EB; border-color: #2563EB; }
.ltr-input { direction: ltr; text-align: start; }
[dir="rtl"] .ltr-input { text-align: right; }

/* Cards & surfaces */
.card-ibh { background: var(--ibh-surface); border: 1px solid var(--ibh-border); border-radius: 16px; }
.card-ibh-head { padding: 1rem 1.4rem; border-bottom: 1px solid var(--ibh-border); display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.card-ibh-head h2 { font-size: 1.1rem; margin: 0; font-family: var(--ibh-font); font-weight: 600; }
.card-ibh-body { padding: 1.25rem 1.4rem; }

.stat-card { background: var(--ibh-surface); border: 1px solid var(--ibh-border); border-radius: 16px; padding: 1.25rem; height: 100%; }
.stat-card .stat-label { color: var(--ibh-muted); font-size: .95rem; }
.stat-card .stat-value { font-family: var(--ibh-font-display); font-size: 2rem; font-weight: 700; line-height: 1.3; }
.stat-card.is-warning { background: #FFFAEB; border-color: #FEDF89; color: #93370D; }
.stat-card.is-warning .stat-label { color: #93370D; }

/* Tables */
.table-ibh { margin: 0; --bs-table-bg: transparent; }
.table-ibh thead th { background: var(--ibh-surface-2); color: var(--ibh-muted); font-size: .85rem; font-weight: 600; border-bottom: 1px solid var(--ibh-border); padding: .75rem 1.4rem; white-space: nowrap; }
.table-ibh td { padding: .9rem 1.4rem; vertical-align: middle; border-color: var(--ibh-border); }
.table-ibh tbody tr:last-child td { border-bottom: 0; }

.empty-state { padding: 2.5rem 1.4rem; text-align: center; color: var(--ibh-muted); }
.empty-state i { font-size: 2rem; display: block; margin-bottom: .5rem; color: var(--ibh-primary); }

/* Status badges */
.badge-status { display: inline-block; font-size: .8rem; font-weight: 600; padding: .3rem .7rem; border-radius: 999px; white-space: nowrap; }
.badge-status-success { color: #067647; background: #ECFDF3; }
.badge-status-warning { color: #B54708; background: #FFFAEB; }
.badge-status-danger { color: #B42318; background: #FEF3F2; }
.badge-status-primary { color: #1D4ED8; background: #EAF1FF; }
.badge-status-secondary { color: #344054; background: #F2F4F7; }
[data-bs-theme="dark"] .badge-status-success { color: #75E0A7; background: rgba(6,118,71,.25); }
[data-bs-theme="dark"] .badge-status-warning { color: #FEC84B; background: rgba(181,71,8,.25); }
[data-bs-theme="dark"] .badge-status-danger { color: #FDA29B; background: rgba(180,35,24,.25); }
[data-bs-theme="dark"] .badge-status-primary { color: #93C5FD; background: rgba(37,99,235,.25); }
[data-bs-theme="dark"] .badge-status-secondary { color: #D0D5DD; background: #262C38; }

.notice-bar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding: 1rem 1.25rem; border-radius: 14px; background: #FFF6ED; border: 1px solid #F9DBAF; color: #93370D; }
.notice-bar .btn { white-space: nowrap; }
[data-bs-theme="dark"] .notice-bar { background: rgba(196,87,15,.15); border-color: rgba(196,87,15,.4); color: #FDB022; }

/* ------------------------------------------------------------------
   Public site
------------------------------------------------------------------ */
.site-nav { background: var(--ibh-black); min-height: 80px; border-bottom: 1px solid #1F242F; }
.site-nav .nav-link { color: #E4E7EC; font-weight: 500; }
.site-nav .nav-link:hover, .site-nav .nav-link.active { color: #fff; }

.hero { background: var(--ibh-black); color: #fff; padding: 5rem 0 4.5rem; }
.hero h1 { font-size: clamp(2rem, 4.5vw, 3.2rem); line-height: 1.3; font-weight: 700; max-width: 18ch; margin-inline: auto; }
.hero-rule { width: 140px; height: 4px; border-radius: 4px; background: var(--ibh-bright); margin: 1.25rem auto; }
.hero p.lead { color: #C0C5CE; max-width: 46ch; margin-inline: auto; }
.domain-search { max-width: 820px; margin: 2rem auto 1rem; background: #fff; border-radius: 14px; padding: 8px; display: flex; gap: 8px; }
.domain-search input { border: 0; font-size: 1.2rem; padding: 0 1rem; flex: 1; min-width: 0; background: transparent; color: #101828; direction: ltr; }
[dir="rtl"] .domain-search input { text-align: right; }
.domain-search input:focus { outline: none; }
.domain-search:focus-within { box-shadow: 0 0 0 4px rgba(96,165,250,.45); }
.domain-search .btn { min-height: 54px; padding-inline: 2.25rem; font-size: 1.1rem; }
.tld-chips { display: flex; gap: .6rem; justify-content: center; flex-wrap: wrap; }
.tld-chip { border: 1px solid #2B313D; border-radius: 10px; padding: .4rem .9rem; color: #E4E7EC; direction: ltr; }

.section { padding: 5rem 0; }
.section-title { font-size: clamp(1.6rem, 3vw, 2.4rem); font-weight: 700; }
.section-sub { color: var(--ibh-muted); font-size: 1.1rem; }

.plan-card { background: var(--ibh-surface); border: 1px solid var(--ibh-border); border-radius: 18px; padding: 2rem; height: 100%; display: flex; flex-direction: column; gap: 1.25rem; }
.plan-card.is-featured { border: 2px solid var(--ibh-primary); }
.plan-card h3 { font-size: 1.5rem; margin: 0; }
.plan-price { font-family: var(--ibh-font-display); font-size: 2.4rem; font-weight: 700; }
.plan-badge { background: var(--ibh-primary); color: #fff; font-size: .8rem; font-weight: 700; padding: .3rem .8rem; border-radius: 999px; }
.plan-features { list-style: none; padding: 0; margin: 0; display: grid; gap: .8rem; }
.plan-features li { display: flex; gap: .6rem; align-items: flex-start; }
.plan-features i { color: #067647; }

.feature { border: 1px solid var(--ibh-border); border-radius: 16px; padding: 1.75rem; height: 100%; background: var(--ibh-surface); }
.feature-icon { width: 48px; height: 48px; border-radius: 12px; background: var(--ibh-primary-soft); color: var(--ibh-primary); display: flex; align-items: center; justify-content: center; font-size: 1.4rem; margin-bottom: 1rem; }
.feature h3 { font-size: 1.15rem; font-family: var(--ibh-font); font-weight: 700; }
.feature p { color: var(--ibh-muted); margin: 0; }

.pay-chip { border: 1px solid var(--ibh-border); background: var(--ibh-surface); border-radius: 12px; padding: .7rem 1.1rem; font-weight: 600; }

.site-footer { background: var(--ibh-black); color: #D0D5DD; padding: 3.5rem 0 2rem; }
.site-footer a { color: #D0D5DD; }
.site-footer a:hover { color: #fff; }
.site-footer-title { color: #fff; font-weight: 600; margin-bottom: .75rem; }
.site-footer li { margin-bottom: .5rem; }
.site-footer-bottom { border-top: 1px solid #344054; margin-top: 2rem; padding-top: 1.5rem; display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; font-size: .9rem; }

/* ------------------------------------------------------------------
   Auth pages (split layout)
------------------------------------------------------------------ */
.auth-shell { min-height: 100vh; display: flex; }
.auth-brand { width: 40%; max-width: 560px; background: var(--ibh-black); color: #C0C5CE; padding: 3.5rem 4rem; display: flex; flex-direction: column; justify-content: space-between; gap: 2rem; }
.auth-brand-title { font-family: var(--ibh-font-display); color: #fff; font-size: 2.3rem; font-weight: 700; line-height: 1.35; margin: 0 0 1.25rem; }
.auth-brand-title::after { content: ""; display: block; width: 120px; height: 4px; border-radius: 4px; background: var(--ibh-bright); margin-top: 1.25rem; }
.auth-brand-list { list-style: none; padding: 0; margin: 0; display: grid; gap: .75rem; font-size: 1.05rem; }
.auth-brand-list li { display: flex; align-items: center; gap: .75rem; }
.auth-brand-list li::before { content: ""; width: 8px; height: 8px; border-radius: 2px; background: var(--ibh-bright); flex-shrink: 0; }
.auth-main { flex: 1; display: flex; flex-direction: column; padding: 1.5rem; }
.auth-topbar { display: flex; justify-content: flex-end; }
.auth-topbar a { color: var(--ibh-muted); }
.auth-card { width: 100%; max-width: 460px; margin: auto; padding: 2rem 0; }
.auth-card.wide, .auth-card:has(.auth-wide) { max-width: 660px; }
.auth-card h1 { font-size: 1.9rem; margin-bottom: .35rem; }
.auth-card .auth-sub { color: var(--ibh-muted); margin-bottom: 1.75rem; }

.strength { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: .5rem; }
.strength span { height: 6px; border-radius: 999px; background: var(--ibh-border); transition: background-color .2s; }
.strength[data-score="1"] span:nth-child(-n+1) { background: #D92D20; }
.strength[data-score="2"] span:nth-child(-n+2) { background: #F79009; }
.strength[data-score="3"] span:nth-child(-n+3) { background: #2563EB; }
.strength[data-score="4"] span { background: #067647; }

@media (max-width: 991.98px) {
  .auth-shell { flex-direction: column; }
  .auth-brand { width: 100%; max-width: none; padding: 1.5rem; }
  .auth-brand-body, .auth-brand small { display: none; }
}

/* ------------------------------------------------------------------
   Client & admin shell
------------------------------------------------------------------ */
.app-shell { display: flex; min-height: 100vh; }
.app-sidebar { width: 270px; flex-shrink: 0; background: var(--ibh-surface); border-inline-end: 1px solid var(--ibh-border); }
@media (min-width: 992px) {
  .app-sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 1.5rem 1rem; gap: 1.5rem; overflow-y: auto; }
}
@media (max-width: 991.98px) {
  .app-sidebar .offcanvas-body, .app-sidebar { padding: 1.25rem 1rem; }
  .app-sidebar.show, .app-sidebar.showing { display: flex; flex-direction: column; gap: 1.25rem; }
}
.app-sidebar-dark { background: var(--ibh-black); border-color: #1F242F; }
/* Bootstrap makes .offcanvas-lg transparent on desktop — keep our backgrounds */
.app-sidebar.offcanvas-lg { --bs-offcanvas-width: 280px; background-color: var(--ibh-surface) !important; }
.app-sidebar.app-sidebar-dark.offcanvas-lg { background-color: var(--ibh-black) !important; }
.app-sidebar-head { display: flex; align-items: center; justify-content: space-between; padding: 0 .5rem; }
.app-logo { display: flex; flex-direction: column; gap: .3rem; }
.app-logo small { color: #98A2B3; font-size: .8rem; }
.logo-for-dark { display: none; }
[data-bs-theme="dark"] .logo-for-dark { display: block; }
[data-bs-theme="dark"] .logo-for-light { display: none; }

.app-nav { display: flex; flex-direction: column; gap: 2px; }
.app-nav-link { display: flex; align-items: center; gap: .75rem; min-height: 46px; padding: 0 .9rem; border-radius: 10px; color: #344054; font-weight: 500; }
.app-nav-link i { font-size: 1.15rem; }
.app-nav-link:hover { background: var(--ibh-surface-2); color: var(--ibh-ink); }
.app-nav-link.active { background: var(--ibh-primary-soft); color: var(--ibh-primary-ink); font-weight: 600; }
.app-nav-link.is-soon { color: #98A2B3; cursor: default; }
.app-nav-link.is-soon:hover { background: transparent; }
.app-nav-link.is-soon small { margin-inline-start: auto; font-size: .7rem; border: 1px dashed #D0D5DD; border-radius: 999px; padding: 0 .5rem; }
.nav-count { margin-inline-start: auto; min-width: 22px; height: 22px; border-radius: 999px; background: #C4570F; color: #fff; font-size: .75rem; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; padding: 0 6px; }
[data-bs-theme="dark"] .app-nav-link { color: #D0D5DD; }

.app-sidebar-dark .app-nav-link { color: #D0D5DD; min-height: 42px; }
.app-sidebar-dark .app-nav-link:hover { background: #161A22; color: #fff; }
.app-sidebar-dark .app-nav-link.active { background: #1F2530; color: #fff; }
.app-sidebar-dark .app-nav-link.is-soon { color: #667085; }
.app-sidebar-dark .app-nav-link.is-soon small { border-color: #344054; }

.app-sidebar-cta { margin-top: auto; }

.app-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.app-topbar { min-height: 72px; background: var(--ibh-surface); border-bottom: 1px solid var(--ibh-border); display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .75rem 1.5rem; position: sticky; top: 0; z-index: 1020; }
.app-page-title { font-family: var(--ibh-font); font-size: 1.2rem; font-weight: 600; margin: 0; }
.app-content { padding: 2rem 1.5rem; }
@media (min-width: 1200px) { .app-content { padding: 2rem 2.5rem; } }

.info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.info-grid > div { padding: 1rem 1.4rem; border-bottom: 1px solid var(--ibh-border); }
.info-grid dt { font-size: .85rem; color: var(--ibh-muted); font-weight: 500; }
.info-grid dd { margin: .2rem 0 0; font-weight: 600; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* v1.2 */
.promo-banner { background: #067647; color: #fff; text-align: center; padding: .55rem 1rem; font-weight: 600; font-size: .95rem; }
.plan-badge.bg-success { background: #067647 !important; }
.site-nav .dropdown-menu { --bs-dropdown-min-width: 9rem; }

/* Grouped admin sidebar (v2.1) */
.app-nav-group { margin-bottom: .25rem; }
.app-nav-group-head {
  width: 100%; display: flex; justify-content: space-between; align-items: center;
  background: none; border: 0; padding: .45rem .75rem; margin-top: .35rem;
  font-size: .75rem; font-weight: 600; letter-spacing: .02em; color: var(--bs-secondary-color);
  border-radius: .5rem;
}
.app-nav-group-head:hover { background: rgba(255, 255, 255, .05); color: var(--bs-body-color); }
.app-nav-group-head .bi { transition: transform .2s; font-size: .8rem; }
.app-nav-group-head[aria-expanded="false"] .bi { transform: rotate(-90deg); }
[dir="rtl"] .app-nav-group-head[aria-expanded="false"] .bi { transform: rotate(90deg); }
@media (prefers-reduced-motion: reduce) { .app-nav-group-head .bi { transition: none; } }

/* Sortable table headers (v2.4) */
.sort-btn { background: none; border: 0; padding: 0; font: inherit; color: inherit; cursor: pointer; white-space: nowrap; }
.sort-btn:hover, th[aria-sort="ascending"] .sort-btn, th[aria-sort="descending"] .sort-btn { color: var(--bs-primary); }

/* Tabs (v2.7) */
.ibh-tabs { flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden; scrollbar-width: thin; }
.ibh-tabs .nav-link { white-space: nowrap; position: relative; }
.ibh-tab-error { display: inline-block; width: .5rem; height: .5rem; border-radius: 50%; background: var(--bs-danger); margin-inline-start: .35rem; vertical-align: middle; }
.ibh-tab-error[hidden] { display: none; }
