/* ==========================================================================
   Rukhsatak — Custom Design Layer
   WHMCS 9.1 · Arabic-first RTL · Digital license marketplace
   Loaded after theme.min.css and before custom.css.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Design tokens
   -------------------------------------------------------------------------- */
:root {
    --rk-ink: #081120;
    --rk-ink-2: #0d1a33;
    --rk-navy: #0b1730;
    --rk-blue: #2563eb;
    --rk-blue-600: #1d4ed8;
    --rk-blue-700: #1e40af;
    --rk-blue-soft: #eff6ff;
    --rk-blue-soft-2: #dbeafe;
    --rk-emerald: #10b981;
    --rk-emerald-600: #059669;
    --rk-emerald-soft: #ecfdf5;
    --rk-gold: #f59e0b;
    --rk-gold-soft: #fffbeb;
    --rk-danger: #dc2626;
    --rk-danger-soft: #fef2f2;
    --rk-warning: #d97706;
    --rk-warning-soft: #fffbeb;
    --rk-info: #0284c7;
    --rk-info-soft: #f0f9ff;
    --rk-success: #059669;
    --rk-success-soft: #ecfdf5;
    --rk-paper: #f6f8fc;
    --rk-surface: #ffffff;
    --rk-surface-2: #f8fafc;
    --rk-surface-3: #f1f5f9;
    --rk-line: #e5eaf2;
    --rk-line-strong: #d7dfeb;
    --rk-text: #0f172a;
    --rk-text-2: #334155;
    --rk-muted: #64748b;
    --rk-muted-2: #94a3b8;
    --rk-radius-sm: 8px;
    --rk-radius: 12px;
    --rk-radius-lg: 18px;
    --rk-radius-xl: 24px;
    --rk-shadow-sm: 0 1px 2px rgba(15, 23, 42, .05);
    --rk-shadow: 0 10px 34px rgba(15, 23, 42, .07);
    --rk-shadow-lg: 0 22px 60px rgba(15, 23, 42, .14);
    --rk-font-body: 'IBM Plex Sans Arabic', 'Cairo', system-ui, -apple-system, 'Segoe UI', Tahoma, sans-serif;
    --rk-font-heading: 'Cairo', 'IBM Plex Sans Arabic', system-ui, -apple-system, 'Segoe UI', Tahoma, sans-serif;
    --rk-font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', monospace;
    --rk-gradient: linear-gradient(135deg, #2563eb 0%, #1e40af 58%, #0b2a6b 100%);
    --rk-gradient-emerald: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

/* --------------------------------------------------------------------------
   2. Base / typography
   -------------------------------------------------------------------------- */
html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body.rk-theme {
    margin: 0;
    border-top: 0 !important;
    font-family: var(--rk-font-body);
    font-size: 15px;
    line-height: 1.7;
    color: var(--rk-text);
    background-color: var(--rk-paper);
    text-align: right;
    direction: rtl;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

body.rk-theme * {
    box-sizing: border-box;
}

h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
    font-family: var(--rk-font-heading);
    font-weight: 700;
    line-height: 1.35;
    color: var(--rk-text);
    letter-spacing: -.01em;
}

h1, .h1 { font-weight: 800; font-size: clamp(1.8rem, 2.6vw, 2.5rem); }
h2, .h2 { font-weight: 800; font-size: clamp(1.45rem, 2vw, 2rem); }
h3, .h3 { font-size: 1.3rem; }
h4, .h4 { font-size: 1.12rem; }
h5, .h5 { font-size: 1rem; }
h6, .h6 { font-size: .92rem; }

p { margin-top: 0; margin-bottom: 1rem; }

a {
    color: var(--rk-blue);
    text-decoration: none;
    transition: color .18s ease, background-color .18s ease, border-color .18s ease, transform .18s ease, box-shadow .18s ease;
}

a:hover,
a:focus {
    color: var(--rk-blue-600);
    text-decoration: none;
}

strong, b { font-weight: 700; }
small { font-size: 85%; }

::selection {
    background: var(--rk-blue);
    color: #fff;
}

:focus-visible {
    outline: 3px solid rgba(37, 99, 235, .35);
    outline-offset: 2px;
}

img { max-width: 100%; height: auto; }

hr {
    border-top: 1px solid var(--rk-line);
    margin: 1.5rem 0;
}

/* Accessibility skip link */
.rk-skip-link {
    position: absolute;
    top: -80px;
    right: 18px;
    z-index: 10000;
    padding: 10px 18px;
    border-radius: 0 0 10px 10px;
    background: var(--rk-blue);
    color: #fff;
    font-weight: 700;
    font-size: 13px;
    transition: top .2s ease;
}
.rk-skip-link:focus { top: 0; color: #fff; }

/* --------------------------------------------------------------------------
   3. Header
   -------------------------------------------------------------------------- */
.rk-topline {
    height: 3px;
    width: 100%;
    background: linear-gradient(90deg, var(--rk-emerald), var(--rk-blue) 45%, #7c3aed);
}

.rk-header {
    position: relative;
    z-index: 1030;
    background: #fff;
}

.rk-header.is-scrolled .rk-header-main {
    box-shadow: 0 10px 28px rgba(15, 23, 42, .08);
}

/* Utility bar */
.rk-topbar {
    background: var(--rk-ink);
    color: #cbd5e1;
    font-size: 12.5px;
}

.rk-topbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    min-height: 38px;
}

.rk-topbar-trust {
    display: flex;
    align-items: center;
    gap: 20px;
    color: #cbd5e1;
    white-space: nowrap;
}

.rk-topbar-trust span {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.rk-topbar-trust i {
    color: var(--rk-emerald);
    font-size: 11px;
}

.rk-topbar-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.rk-topbar-link {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #cbd5e1;
    font-family: var(--rk-font-body);
    font-size: 12.5px;
    line-height: 1.4;
    text-decoration: none;
    cursor: pointer;
    transition: color .18s ease;
    white-space: nowrap;
}

.rk-topbar-link:hover,
.rk-topbar-link:focus {
    color: #fff;
}

.rk-topbar-link i { font-size: 12px; opacity: .9; }

.rk-topbar-cta {
    padding: 4px 12px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--rk-blue), var(--rk-emerald));
    color: #fff;
    font-weight: 700;
    font-size: 11.5px;
}
.rk-topbar-cta:hover { color: #fff; opacity: .92; }

.rk-sep { opacity: .4; margin: 0 2px; }

.rk-notify-btn { position: relative; }

.rk-notify-dot {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 17px;
    height: 17px;
    padding: 0 4px;
    border-radius: 999px;
    background: #ef4444;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
}

/* Brand + search + tools */
.rk-header-main {
    background: #fff;
    border-bottom: 1px solid var(--rk-line);
}

.rk-header-main-inner {
    display: flex;
    align-items: center;
    gap: 26px;
    min-height: 84px;
    padding: 13px 0;
}

.rk-brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    flex: 0 0 auto;
    color: var(--rk-text);
    text-decoration: none;
}
.rk-brand:hover { color: var(--rk-text); }

.rk-brand-mark {
    width: 48px;
    height: 48px;
    border-radius: 15px;
    box-shadow: 0 10px 26px rgba(37, 99, 235, .24);
    transition: transform .2s ease, box-shadow .2s ease;
}
.rk-brand:hover .rk-brand-mark {
    transform: translateY(-2px) rotate(-3deg);
    box-shadow: 0 14px 30px rgba(37, 99, 235, .3);
}

.rk-brand-img { max-height: 52px; width: auto; }

.rk-brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.05;
}

.rk-brand-ar {
    font-family: var(--rk-font-heading);
    font-size: 25px;
    font-weight: 800;
    color: var(--rk-ink);
    letter-spacing: -.02em;
}

.rk-brand-en {
    margin-top: 3px;
    font-family: var(--rk-font-body);
    font-size: 8.5px;
    font-weight: 700;
    letter-spacing: .26em;
    color: var(--rk-muted-2);
    text-transform: uppercase;
}

.rk-header-search {
    flex: 1 1 auto;
    max-width: 560px;
    margin: 0 4px;
}

.rk-search-box {
    display: flex;
    align-items: center;
    gap: 4px;
    width: 100%;
    padding: 4px 6px 4px 6px;
    border: 1px solid var(--rk-line);
    border-radius: 999px;
    background: var(--rk-surface-2);
    transition: border-color .18s ease, box-shadow .18s ease, background-color .18s ease;
}

.rk-search-box:focus-within {
    border-color: var(--rk-blue);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, .1);
}

.rk-search-icon {
    flex: 0 0 auto;
    margin-inline-start: 12px;
    color: var(--rk-muted-2);
    font-size: 14px;
}

.rk-search-input {
    flex: 1 1 auto;
    min-width: 0;
    height: 38px;
    padding: 0 6px;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--rk-text);
    font-family: var(--rk-font-body);
    font-size: 13.5px;
}

.rk-search-input::placeholder { color: var(--rk-muted-2); }

.rk-search-btn {
    flex: 0 0 auto;
    padding: 8px 20px;
    border: 0;
    border-radius: 999px;
    background: var(--rk-gradient);
    color: #fff;
    font-family: var(--rk-font-body);
    font-size: 13px;
    font-weight: 700;
    box-shadow: 0 5px 16px rgba(37, 99, 235, .25);
}
.rk-search-btn:hover { color: #fff; filter: brightness(1.05); }

.rk-header-tools {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-inline-start: auto;
    flex: 0 0 auto;
}

.rk-tool {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 7px 10px;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: var(--rk-text);
    font-family: var(--rk-font-body);
    text-align: right;
    text-decoration: none;
    cursor: pointer;
    transition: background-color .18s ease, color .18s ease;
}
.rk-tool:hover,
.rk-tool:focus {
    background: var(--rk-surface-3);
    color: var(--rk-text);
    text-decoration: none;
}

.rk-tool-icon {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: var(--rk-surface-3);
    color: var(--rk-ink);
    font-size: 17px;
    transition: background-color .18s ease, color .18s ease;
}
.rk-tool:hover .rk-tool-icon {
    background: var(--rk-blue-soft);
    color: var(--rk-blue);
}

.rk-cart-count {
    position: absolute;
    top: -5px;
    inset-inline-start: -5px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    border: 2px solid #fff;
    border-radius: 999px;
    background: var(--rk-emerald);
    color: #fff;
    font-size: 9.5px;
    font-weight: 700;
    line-height: 1;
}

.rk-tool-label {
    flex-direction: column;
    line-height: 1.15;
    min-width: 0;
}
.rk-tool-label small {
    font-size: 10.5px;
    color: var(--rk-muted);
    white-space: nowrap;
}
.rk-tool-label strong {
    max-width: 120px;
    overflow: hidden;
    font-size: 13px;
    font-weight: 700;
    color: var(--rk-text);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rk-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--rk-gradient);
    color: #fff;
    font-size: 15px;
    box-shadow: 0 6px 18px rgba(37, 99, 235, .22);
}

.rk-avatar-lg { width: 46px; height: 46px; font-size: 17px; }

.rk-chevron { font-size: 10px; color: var(--rk-muted-2); }

.rk-menu-toggle {
    display: none;
    width: 42px;
    height: 42px;
    padding: 0;
    justify-content: center;
    background: var(--rk-ink);
    color: #fff;
    font-size: 17px;
}
.rk-menu-toggle:hover { background: var(--rk-blue); color: #fff; }

/* Account dropdown */
.rk-account-menu {
    min-width: 280px;
    margin-top: 10px;
    padding: 8px;
}

.rk-account-menu-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 10px 12px;
}

.rk-account-menu-id {
    display: flex;
    flex-direction: column;
    min-width: 0;
    line-height: 1.3;
}
.rk-account-menu-id strong {
    overflow: hidden;
    font-size: 13.5px;
    color: var(--rk-text);
    text-overflow: ellipsis;
    white-space: nowrap;
}
.rk-account-menu-id small {
    overflow: hidden;
    font-size: 11.5px;
    color: var(--rk-muted);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rk-account-menu .dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
}
.rk-account-menu .dropdown-item i {
    width: 18px;
    color: var(--rk-muted-2);
    font-size: 13px;
    text-align: center;
}
.rk-account-menu .dropdown-item:hover i { color: var(--rk-blue); }

/* Main navigation */
.rk-navbar {
    min-height: 56px;
    padding: 0;
    background: #fff;
    border-bottom: 1px solid var(--rk-line);
    box-shadow: 0 3px 14px rgba(15, 23, 42, .035);
}

.rk-navbar .container {
    display: flex;
    align-items: center;
}

.rk-navbar .navbar-collapse {
    align-items: center;
    gap: 14px;
}

.rk-navbar .navbar-nav {
    align-items: center;
    gap: 3px;
}

.rk-navbar .navbar-nav > li {
    position: relative;
}

.rk-navbar .navbar-nav > li > a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 14px !important;
    border-radius: 10px;
    color: var(--rk-text-2);
    font-family: var(--rk-font-body);
    font-size: 13.5px;
    font-weight: 600;
    line-height: 1.4;
    white-space: nowrap;
    transition: background-color .18s ease, color .18s ease;
}

.rk-navbar .navbar-nav > li > a:hover,
.rk-navbar .navbar-nav > li > a:focus,
.rk-navbar .navbar-nav > li > a.active,
.rk-navbar .navbar-nav > li.active > a {
    background: var(--rk-blue-soft);
    color: var(--rk-blue-700);
}

.rk-navbar .navbar-nav > li > a i {
    color: var(--rk-muted-2);
    font-size: 12px;
    transition: color .18s ease;
}
.rk-navbar .navbar-nav > li > a:hover i,
.rk-navbar .navbar-nav > li > a.active i {
    color: var(--rk-blue);
}

.rk-navbar .dropdown-menu {
    margin-top: 8px;
}

.rk-navbar .dropdown-item > a {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--rk-text-2);
    font-size: 13.5px;
    font-weight: 500;
}
.rk-navbar .dropdown-item > a:hover { color: var(--rk-blue-700); }

.rk-navbar .navbar-nav > li > a .badge {
    margin-inline-start: 4px;
    background: var(--rk-blue-soft);
    color: var(--rk-blue-700);
}

.rk-mobile-search {
    padding: 12px 0 8px;
}

/* --------------------------------------------------------------------------
   4. Breadcrumb
   -------------------------------------------------------------------------- */
.rk-breadcrumb-wrap {
    padding: 9px 0;
    background: var(--rk-surface-2);
    border-bottom: 1px solid var(--rk-line);
}

.rk-breadcrumb-wrap .breadcrumb {
    margin: 0;
    padding: 0;
    background: transparent;
    font-size: 12.5px;
}

.rk-breadcrumb-wrap .breadcrumb-item,
.rk-breadcrumb-wrap .breadcrumb-item a {
    color: var(--rk-muted);
}
.rk-breadcrumb-wrap .breadcrumb-item a:hover { color: var(--rk-blue); }
.rk-breadcrumb-wrap .breadcrumb-item.active { color: var(--rk-text); font-weight: 600; }

/* --------------------------------------------------------------------------
   5. Main body / WHMCS surfaces
   -------------------------------------------------------------------------- */
.rk-main-body {
    padding: 34px 0 66px;
    background: var(--rk-paper);
}

.rk-main-body--cart {
    padding: 0;
    background: #fff;
}

.rk-main-row { min-height: 40vh; }
.rk-primary-content { min-width: 0; }

.rk-sidebar {
    position: sticky;
    top: 18px;
}

.rk-sidebar .card,
.sidebar .card {
    overflow: hidden;
    margin-bottom: 18px;
    border: 0;
    border-radius: var(--rk-radius-lg);
    box-shadow: var(--rk-shadow);
}

.rk-sidebar .card-header,
.sidebar .card-header {
    padding: 16px 18px;
    background: #fff;
    border-bottom: 1px solid var(--rk-line);
}

.rk-sidebar .card-title,
.sidebar .card-title {
    font-family: var(--rk-font-heading);
    font-size: 15px;
    font-weight: 700;
}

.rk-sidebar .list-group-item,
.sidebar .list-group-item {
    margin: 2px 8px;
    padding: 10px 12px;
    border: 0;
    border-radius: 9px;
    color: var(--rk-text-2);
    font-size: 13px;
    font-weight: 500;
}
.rk-sidebar .list-group-item:hover,
.sidebar .list-group-item:hover {
    background: var(--rk-blue-soft);
    color: var(--rk-blue-700);
}
.rk-sidebar .list-group-item.active,
.sidebar .list-group-item.active {
    background: var(--rk-gradient);
    color: #fff;
}
.rk-sidebar .list-group-item.active .badge,
.sidebar .list-group-item.active .badge {
    background: rgba(255, 255, 255, .18);
    color: #fff;
}

/* Header-lined (WHMCS page headings) */
.header-lined {
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--rk-line);
}
.header-lined h1 {
    margin-bottom: 6px;
    font-size: clamp(1.5rem, 2.2vw, 2rem);
    font-weight: 800;
}
.header-lined p {
    margin-bottom: 0;
    color: var(--rk-muted);
    font-size: 14px;
}
.header-lined .font-size-36 { font-size: clamp(1.5rem, 2.2vw, 2rem) !important; }

/* Cards */
.card {
    border: 1px solid var(--rk-line);
    border-radius: var(--rk-radius-lg);
    background: #fff;
    box-shadow: var(--rk-shadow-sm);
}

.card-header {
    padding: 17px 22px;
    background: #fff;
    border-bottom: 1px solid var(--rk-line);
    border-radius: var(--rk-radius-lg) var(--rk-radius-lg) 0 0 !important;
}

.card-title {
    font-family: var(--rk-font-heading);
    font-weight: 700;
}

.card-body { padding: 22px; }

.card-footer {
    padding: 15px 22px;
    background: var(--rk-surface-2);
    border-top: 1px solid var(--rk-line);
    border-radius: 0 0 var(--rk-radius-lg) var(--rk-radius-lg) !important;
}

.card-columns .card { margin-bottom: 1.25rem; }

/* Buttons */
.btn {
    padding: 9px 19px;
    border-radius: var(--rk-radius);
    font-family: var(--rk-font-body);
    font-size: 13.5px;
    font-weight: 700;
    line-height: 1.5;
    box-shadow: none;
    transition: transform .18s ease, box-shadow .18s ease, background-color .18s ease, border-color .18s ease, color .18s ease;
}
.btn:active { transform: translateY(1px); }
.btn:focus { box-shadow: 0 0 0 4px rgba(37, 99, 235, .16); }

.btn-primary {
    border-color: var(--rk-blue);
    background: var(--rk-gradient);
    color: #fff;
    box-shadow: 0 7px 20px rgba(37, 99, 235, .22);
}
.btn-primary:hover,
.btn-primary:focus,
.btn-primary:not(:disabled):not(.disabled):active,
.btn-primary:not(:disabled):not(.disabled).active {
    border-color: var(--rk-blue-700);
    background: linear-gradient(135deg, var(--rk-blue-600), var(--rk-blue-700));
    color: #fff;
    box-shadow: 0 10px 26px rgba(37, 99, 235, .28);
}

.btn-success {
    border-color: var(--rk-emerald);
    background: var(--rk-gradient-emerald);
    color: #fff;
    box-shadow: 0 7px 20px rgba(16, 185, 129, .2);
}
.btn-success:hover,
.btn-success:focus,
.btn-success:not(:disabled):not(.disabled):active {
    border-color: var(--rk-emerald-600);
    background: linear-gradient(135deg, #0ea371, var(--rk-emerald-600));
    color: #fff;
}

.btn-outline-primary {
    border-color: var(--rk-blue);
    color: var(--rk-blue);
    background: transparent;
}
.btn-outline-primary:hover,
.btn-outline-primary:focus {
    border-color: var(--rk-blue);
    background: var(--rk-blue);
    color: #fff;
}

.btn-default,
.btn-secondary,
.btn-light {
    border: 1px solid var(--rk-line-strong);
    background: #fff;
    color: var(--rk-text-2);
}
.btn-default:hover,
.btn-secondary:hover,
.btn-light:hover {
    border-color: var(--rk-blue);
    background: var(--rk-blue-soft);
    color: var(--rk-blue-700);
}

.btn-link {
    color: var(--rk-blue);
    font-weight: 700;
    box-shadow: none;
}
.btn-link:hover { color: var(--rk-blue-700); }

.btn-sm { padding: 6px 12px; font-size: 12.5px; border-radius: 9px; }
.btn-lg { padding: 12px 27px; font-size: 15.5px; border-radius: 14px; }
.btn-block { width: 100%; }

.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    padding: 0;
    border-radius: 10px;
}

/* Forms */
.form-control,
.custom-select,
.input-group-text {
    border-color: var(--rk-line-strong);
    border-radius: var(--rk-radius);
    background-color: #fff;
    color: var(--rk-text);
    font-family: var(--rk-font-body);
    font-size: 13.5px;
}

.form-control {
    height: auto;
    padding: 10px 14px;
    line-height: 1.5;
}
.form-control:focus,
.custom-select:focus {
    border-color: var(--rk-blue);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, .12);
}
.form-control::placeholder { color: var(--rk-muted-2); opacity: 1; }
.form-control:disabled,
.form-control[readonly] { background: var(--rk-surface-2); color: var(--rk-muted); }

.custom-select {
    height: auto;
    padding: 10px 14px;
    line-height: 1.5;
}

.form-group { margin-bottom: 1.1rem; }
.form-group label,
.col-form-label {
    margin-bottom: 6px;
    color: var(--rk-text-2);
    font-size: 13px;
    font-weight: 700;
}

.input-group-text {
    padding: 9px 13px;
    background: var(--rk-surface-2);
    color: var(--rk-muted);
    font-size: 13px;
}

.custom-control-input:checked ~ .custom-control-label::before {
    border-color: var(--rk-blue);
    background-color: var(--rk-blue);
}
.custom-control-input:focus ~ .custom-control-label::before {
    box-shadow: 0 0 0 4px rgba(37, 99, 235, .16);
}
.custom-control-label::before,
.custom-control-label::after { border-radius: 4px; }

/* Tables */
.table {
    margin-bottom: 0;
    color: var(--rk-text);
    font-size: 13.5px;
}
.table thead th {
    padding: 12px 14px;
    border-top: 0;
    border-bottom: 1px solid var(--rk-line);
    background: var(--rk-surface-2);
    color: var(--rk-muted);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .01em;
    white-space: nowrap;
}
.table td,
.table th {
    padding: 13px 14px;
    border-top: 1px solid var(--rk-line);
    vertical-align: middle;
}
.table-hover tbody tr:hover { background: #f8fafc; }
.table-responsive { border-radius: var(--rk-radius); }
.table-striped tbody tr:nth-of-type(odd) { background: rgba(248, 250, 252, .7); }

/* DataTables */
.dataTables_wrapper { font-size: 13px; }
.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter { margin-bottom: 14px; }
.dataTables_wrapper .dataTables_filter input,
.dataTables_wrapper .dataTables_length select {
    height: auto;
    padding: 8px 12px;
    border: 1px solid var(--rk-line-strong);
    border-radius: 9px;
    background: #fff;
    font-family: var(--rk-font-body);
    font-size: 13px;
}
.dataTables_wrapper .dataTables_filter input:focus,
.dataTables_wrapper .dataTables_length select:focus {
    border-color: var(--rk-blue);
    outline: 0;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}
.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_paginate { padding-top: 14px; color: var(--rk-muted); }
.dataTables_wrapper .dataTables_paginate .paginate_button {
    padding: 6px 11px !important;
    border: 1px solid var(--rk-line) !important;
    border-radius: 8px !important;
    background: #fff !important;
    color: var(--rk-text) !important;
    font-weight: 600;
}
.dataTables_wrapper .dataTables_paginate .paginate_button.current,
.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
    border-color: var(--rk-blue) !important;
    background: var(--rk-blue) !important;
    color: #fff !important;
}

/* Alerts */
.alert {
    padding: 14px 18px;
    border: 0;
    border-inline-start: 4px solid transparent;
    border-radius: var(--rk-radius);
    font-size: 13.5px;
}
.alert-info { background: var(--rk-info-soft); color: #075985; border-inline-start-color: #0ea5e9; }
.alert-success { background: var(--rk-success-soft); color: #065f46; border-inline-start-color: var(--rk-emerald); }
.alert-warning { background: var(--rk-warning-soft); color: #92400e; border-inline-start-color: #f59e0b; }
.alert-danger { background: var(--rk-danger-soft); color: #991b1b; border-inline-start-color: #ef4444; }
.alert a { font-weight: 700; text-decoration: underline; }
.alert h2 { font-size: 16px; margin-bottom: 6px; }
.alert ul { margin-bottom: 0; padding-inline-start: 18px; }

/* Badges */
.badge {
    padding: 4px 8px;
    border-radius: 6px;
    font-family: var(--rk-font-body);
    font-size: 11px;
    font-weight: 700;
    line-height: 1.4;
}
.badge-info { background: var(--rk-blue-soft); color: var(--rk-blue-700); }
.badge-success { background: var(--rk-success-soft); color: var(--rk-success); }
.badge-warning { background: var(--rk-warning-soft); color: var(--rk-warning); }
.badge-danger { background: var(--rk-danger-soft); color: var(--rk-danger); }
.badge-secondary { background: var(--rk-surface-3); color: var(--rk-muted); }

/* Dropdowns */
.dropdown-menu {
    min-width: 220px;
    padding: 8px;
    border: 1px solid var(--rk-line);
    border-radius: var(--rk-radius);
    background: #fff;
    box-shadow: var(--rk-shadow-lg);
}
.dropdown-item {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 9px 12px;
    border-radius: 8px;
    color: var(--rk-text-2);
    font-size: 13.5px;
    font-weight: 500;
}
.dropdown-item:hover,
.dropdown-item:focus {
    background: var(--rk-blue-soft);
    color: var(--rk-blue-700);
}
.dropdown-divider { margin: 6px 0; border-top-color: var(--rk-line); }

/* Nav tabs / pills */
.nav-tabs {
    gap: 3px;
    border-bottom: 1px solid var(--rk-line);
}
.nav-tabs .nav-link {
    padding: 10px 14px;
    border: 0;
    border-bottom: 2px solid transparent;
    border-radius: 8px 8px 0 0;
    color: var(--rk-muted);
    font-size: 13.5px;
    font-weight: 700;
}
.nav-tabs .nav-link:hover { color: var(--rk-blue); }
.nav-tabs .nav-link.active {
    border-bottom-color: var(--rk-blue);
    background: transparent;
    color: var(--rk-blue);
}
.nav-pills { gap: 5px; }
.nav-pills .nav-link {
    border-radius: 9px;
    color: var(--rk-muted);
    font-size: 13.5px;
    font-weight: 700;
}
.nav-pills .nav-link.active { background: var(--rk-blue); color: #fff; }

/* List group */
.list-group-item {
    padding: 12px 16px;
    border-color: var(--rk-line);
    color: var(--rk-text-2);
    font-size: 13.5px;
}
.list-group-item.active {
    border-color: var(--rk-blue);
    background: var(--rk-gradient);
    color: #fff;
}

/* Pagination */
.pagination { gap: 5px; }
.page-link {
    padding: 8px 13px;
    border: 1px solid var(--rk-line);
    border-radius: 8px !important;
    background: #fff;
    color: var(--rk-text);
    font-size: 13px;
    font-weight: 700;
}
.page-link:hover { border-color: var(--rk-blue-soft-2); background: var(--rk-blue-soft); color: var(--rk-blue-700); }
.page-item.active .page-link { border-color: var(--rk-blue); background: var(--rk-blue); color: #fff; }
.page-item.disabled .page-link { border-color: var(--rk-line); background: var(--rk-surface-2); color: var(--rk-muted-2); }

/* Progress */
.progress { height: 8px; border-radius: 999px; background: #e2e8f0; }
.progress-bar { background: linear-gradient(90deg, var(--rk-blue), var(--rk-emerald)); }

/* Modals */
.modal-content {
    border: 0;
    border-radius: var(--rk-radius-lg);
    box-shadow: var(--rk-shadow-lg);
}
.modal-header { padding: 18px 22px; border-bottom: 1px solid var(--rk-line); }
.modal-title { font-family: var(--rk-font-heading); font-weight: 700; }
.modal-body { padding: 22px; }
.modal-footer { padding: 15px 22px; border-top: 1px solid var(--rk-line); }

.modal-localisation .modal-content {
    border: 1px solid rgba(255, 255, 255, .1);
    background: linear-gradient(135deg, var(--rk-ink), #12244a);
    color: #fff;
}
.modal-localisation .modal-body { padding: 34px; }
.modal-localisation .h5 { color: #fff; }
.modal-localisation .close { color: #fff; opacity: .8; }
.item-selector .item {
    display: block;
    margin-bottom: 10px;
    padding: 11px 10px;
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: 10px;
    background: rgba(255, 255, 255, .04);
    color: #cbd5e1;
    font-size: 13px;
    font-weight: 600;
    text-align: center;
}
.item-selector .item:hover,
.item-selector .item.active {
    border-color: var(--rk-blue);
    background: var(--rk-blue);
    color: #fff;
}

/* Popovers / tooltips */
.popover {
    border: 1px solid var(--rk-line);
    border-radius: var(--rk-radius);
    box-shadow: var(--rk-shadow-lg);
    font-family: var(--rk-font-body);
}
.popover-header {
    border-bottom: 1px solid var(--rk-line);
    background: var(--rk-surface-2);
    font-family: var(--rk-font-heading);
    font-weight: 700;
}
.tooltip-inner {
    padding: 6px 10px;
    border-radius: 7px;
    background: var(--rk-ink);
    font-family: var(--rk-font-body);
    font-size: 12px;
}

/* Client alert list inside popover */
.client-alerts { margin: 0; padding: 0; list-style: none; }
.client-alerts li a {
    display: flex;
    gap: 10px;
    padding: 10px;
    border-radius: 8px;
    color: var(--rk-text);
    font-size: 13px;
}
.client-alerts li a:hover { background: var(--rk-blue-soft); }
.client-alerts li.none { padding: 10px; color: var(--rk-muted); font-size: 13px; }
.client-alerts .message { min-width: 0; }

/* WHMCS utility */
.w-hidden { display: none !important; }
.clearfix::after { display: block; clear: both; content: ""; }

/* Verification banners */
.verification-banner {
    padding: 10px 0;
    border-bottom: 1px solid #fde68a;
    background: #fffbeb;
    color: #92400e;
    font-size: 13px;
}
.verification-banner.email-verification { border-bottom-color: #bfdbfe; background: #eff6ff; color: #1e40af; }
.verification-banner .btn-action { border-color: transparent; background: #fff; color: inherit; }

/* Network issues */
.network-issue-alert { border-inline-start: 0; border-radius: 0; }

/* Homepage baseline helpers (Twenty-One fallback until Step 3) */
.action-icon-btns a {
    display: block;
    height: 100%;
    padding: 24px 14px;
    border: 1px solid var(--rk-line);
    border-radius: var(--rk-radius-lg);
    background: #fff;
    color: var(--rk-text);
    font-size: 13.5px;
    font-weight: 700;
    text-align: center;
    box-shadow: var(--rk-shadow-sm);
}
.action-icon-btns a:hover {
    border-color: var(--rk-blue);
    color: var(--rk-blue);
    box-shadow: var(--rk-shadow);
    transform: translateY(-3px);
}
.action-icon-btns .ico-container {
    margin-bottom: 10px;
    color: var(--rk-blue);
    font-size: 25px;
}
.home-domain-search {
    padding: 34px 0;
    background: linear-gradient(135deg, var(--rk-ink), #12305f 60%, #0b3b3a);
}
.home-domain-search h2 { color: #fff; }
.home-domain-search .form-control { border-color: rgba(255, 255, 255, .2); }
.home-domain-search .tld-logos { margin-top: 18px; color: #cbd5e1; }

/* --------------------------------------------------------------------------
   6. Footer
   -------------------------------------------------------------------------- */
.rk-footer {
    position: relative;
    overflow: hidden;
    padding: 64px 0 0;
    background:
        radial-gradient(circle at 12% 18%, rgba(37, 99, 235, .2), transparent 38%),
        radial-gradient(circle at 88% 8%, rgba(16, 185, 129, .14), transparent 34%),
        var(--rk-ink);
    color: #94a3b8;
}

.rk-footer::before {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, .03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, .03) 1px, transparent 1px);
    background-size: 44px 44px;
    content: "";
    pointer-events: none;
    -webkit-mask-image: linear-gradient(to bottom, rgba(0, 0, 0, .55), transparent 72%);
    mask-image: linear-gradient(to bottom, rgba(0, 0, 0, .55), transparent 72%);
}

.rk-footer-glow {
    position: absolute;
    top: -120px;
    inset-inline-start: 8%;
    width: 320px;
    height: 320px;
    border-radius: 50%;
    background: rgba(37, 99, 235, .16);
    filter: blur(70px);
    pointer-events: none;
}

.rk-footer-container { position: relative; z-index: 1; }

.rk-footer-grid {
    display: grid;
    grid-template-columns: 1.65fr 1fr 1fr 1.2fr;
    gap: 42px;
}

.rk-footer-brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
    color: #fff;
    text-decoration: none;
}
.rk-footer-brand:hover { color: #fff; }

.rk-footer-brand img {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    box-shadow: 0 12px 30px rgba(37, 99, 235, .38);
}

.rk-footer-brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.05;
}
.rk-footer-brand-text strong {
    font-family: var(--rk-font-heading);
    font-size: 24px;
    font-weight: 800;
    color: #fff;
}
.rk-footer-brand-text small {
    margin-top: 4px;
    color: #64748b;
    font-size: 8.5px;
    font-weight: 700;
    letter-spacing: .26em;
}

.rk-footer-about {
    max-width: 360px;
    margin-bottom: 18px;
    color: #94a3b8;
    font-size: 13px;
    line-height: 1.9;
}

.rk-footer-trust {
    display: flex;
    flex-wrap: wrap;
    gap: 9px 16px;
    margin-bottom: 20px;
}
.rk-footer-trust span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #cbd5e1;
    font-size: 11.5px;
    font-weight: 600;
}
.rk-footer-trust i { color: var(--rk-emerald); font-size: 11px; }

.rk-payment-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}
.rk-pay-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 8px;
    background: rgba(255, 255, 255, .055);
    color: #e2e8f0;
    font-size: 10.5px;
    font-weight: 600;
    line-height: 1;
}
.rk-pay-badge i { font-size: 14px; }
.rk-pay-text { letter-spacing: .02em; }

.rk-footer-title {
    margin-bottom: 18px;
    color: #fff;
    font-family: var(--rk-font-heading);
    font-size: 14px;
    font-weight: 700;
}

.rk-footer-links {
    margin: 0;
    padding: 0;
    list-style: none;
}
.rk-footer-links li { margin-bottom: 9px; }
.rk-footer-links a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #94a3b8;
    font-size: 12.5px;
    font-weight: 500;
    text-decoration: none;
    transition: color .18s ease, transform .18s ease;
}
.rk-footer-links a i {
    color: #475569;
    font-size: 8px;
    transition: color .18s ease, transform .18s ease;
}
.rk-footer-links a:hover { color: #fff; transform: translateX(-3px); }
.rk-footer-links a:hover i { color: var(--rk-emerald); }

.rk-footer-support {
    display: flex;
    align-items: center;
    gap: 11px;
    margin-top: 18px;
    padding: 12px;
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 12px;
    background: rgba(255, 255, 255, .04);
}
.rk-footer-support-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    flex: 0 0 auto;
    border-radius: 10px;
    background: rgba(37, 99, 235, .18);
    color: #93c5fd;
    font-size: 15px;
}
.rk-footer-support div { display: flex; flex-direction: column; line-height: 1.4; }
.rk-footer-support small { color: #64748b; font-size: 10px; }
.rk-footer-support a { color: #e2e8f0; font-size: 12px; font-weight: 700; }
.rk-footer-support a:hover { color: #fff; }

.rk-footer-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-top: 48px;
    padding: 20px 0;
    border-top: 1px solid rgba(255, 255, 255, .08);
}

.rk-copyright {
    margin: 0;
    color: #64748b;
    font-size: 11.5px;
}

.rk-footer-social {
    display: flex;
    gap: 6px;
}
.rk-footer .btn-icon {
    width: 36px;
    height: 36px;
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 9px;
    background: rgba(255, 255, 255, .05);
    color: #cbd5e1;
    font-size: 13px;
}
.rk-footer .btn-icon:hover {
    border-color: var(--rk-blue);
    background: var(--rk-blue);
    color: #fff;
    transform: translateY(-2px);
}

/* Back to top */
.rk-back-top {
    position: fixed;
    bottom: 24px;
    left: 24px;
    z-index: 1040;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 12px;
    background: var(--rk-gradient);
    color: #fff;
    font-size: 15px;
    box-shadow: 0 12px 28px rgba(37, 99, 235, .32);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity .2s ease, visibility .2s ease, transform .2s ease, box-shadow .2s ease;
}
.rk-back-top.is-visible { opacity: 1; visibility: visible; transform: none; }
.rk-back-top:hover { color: #fff; box-shadow: 0 16px 34px rgba(37, 99, 235, .4); }

.btn-return-to-admin {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 1040;
    border-radius: 12px;
    box-shadow: var(--rk-shadow-lg);
}

/* --------------------------------------------------------------------------
   7. Code / LTR isolation
   -------------------------------------------------------------------------- */
.rk-ltr,
.rk-code,
.license-key,
.coupon-code,
.invoice-number,
.order-number,
.email-address,
.text-monospace,
[data-rk-ltr] {
    direction: ltr !important;
    unicode-bidi: isolate;
    text-align: left;
    font-family: var(--rk-font-mono);
    letter-spacing: .01em;
}

code, kbd, samp, pre {
    direction: ltr;
    unicode-bidi: isolate;
    font-family: var(--rk-font-mono);
}

code {
    padding: 2px 6px;
    border-radius: 5px;
    background: var(--rk-surface-3);
    color: #be123c;
    font-size: .88em;
}

pre {
    padding: 16px;
    border-radius: var(--rk-radius);
    background: var(--rk-ink);
    color: #e2e8f0;
    font-size: 12.5px;
    text-align: left;
}

/* Codes, coupons, emails and identifiers always render left-to-right */
input[type="email"],
input[type="url"],
input[name*="email"],
input[name*="coupon"],
input[name*="promo"],
input[name*="code"],
input[name*="license"],
input[name*="serial"],
input[name*="key"] {
    direction: ltr;
    text-align: left;
    font-family: var(--rk-font-mono);
    font-size: 12.5px;
}

input[type="email"]::placeholder,
input[name*="email"]::placeholder {
    font-family: var(--rk-font-body);
}

/* Keep numeric identifiers from visually reordering around Arabic text */
.rk-number {
    direction: ltr;
    unicode-bidi: isolate;
    display: inline-block;
}

/* --------------------------------------------------------------------------
   8. RTL corrections for Bootstrap 4 components
   -------------------------------------------------------------------------- */
html[dir="rtl"] body { text-align: right; }

/* Text alignment */
html[dir="rtl"] .text-left { text-align: right !important; }
html[dir="rtl"] .text-right { text-align: left !important; }

/* Floats */
html[dir="rtl"] .float-left { float: right !important; }
html[dir="rtl"] .float-right { float: left !important; }

/* Margin-left utilities become margin-right */
html[dir="rtl"] .ml-0 { margin-right: 0 !important; margin-left: 0 !important; }
html[dir="rtl"] .ml-1 { margin-right: .25rem !important; margin-left: 0 !important; }
html[dir="rtl"] .ml-2 { margin-right: .5rem !important; margin-left: 0 !important; }
html[dir="rtl"] .ml-3 { margin-right: 1rem !important; margin-left: 0 !important; }
html[dir="rtl"] .ml-4 { margin-right: 1.5rem !important; margin-left: 0 !important; }
html[dir="rtl"] .ml-5 { margin-right: 3rem !important; margin-left: 0 !important; }
html[dir="rtl"] .ml-auto { margin-right: auto !important; margin-left: 0 !important; }

/* Margin-right utilities become margin-left */
html[dir="rtl"] .mr-0 { margin-left: 0 !important; margin-right: 0 !important; }
html[dir="rtl"] .mr-1 { margin-left: .25rem !important; margin-right: 0 !important; }
html[dir="rtl"] .mr-2 { margin-left: .5rem !important; margin-right: 0 !important; }
html[dir="rtl"] .mr-3 { margin-left: 1rem !important; margin-right: 0 !important; }
html[dir="rtl"] .mr-4 { margin-left: 1.5rem !important; margin-right: 0 !important; }
html[dir="rtl"] .mr-5 { margin-left: 3rem !important; margin-right: 0 !important; }
html[dir="rtl"] .mr-auto { margin-left: auto !important; margin-right: 0 !important; }

/* Padding-left utilities become padding-right */
html[dir="rtl"] .pl-0 { padding-right: 0 !important; padding-left: 0 !important; }
html[dir="rtl"] .pl-1 { padding-right: .25rem !important; padding-left: 0 !important; }
html[dir="rtl"] .pl-2 { padding-right: .5rem !important; padding-left: 0 !important; }
html[dir="rtl"] .pl-3 { padding-right: 1rem !important; padding-left: 0 !important; }
html[dir="rtl"] .pl-4 { padding-right: 1.5rem !important; padding-left: 0 !important; }
html[dir="rtl"] .pl-5 { padding-right: 3rem !important; padding-left: 0 !important; }

/* Padding-right utilities become padding-left */
html[dir="rtl"] .pr-0 { padding-left: 0 !important; padding-right: 0 !important; }
html[dir="rtl"] .pr-1 { padding-left: .25rem !important; padding-right: 0 !important; }
html[dir="rtl"] .pr-2 { padding-left: .5rem !important; padding-right: 0 !important; }
html[dir="rtl"] .pr-3 { padding-left: 1rem !important; padding-right: 0 !important; }
html[dir="rtl"] .pr-4 { padding-left: 1.5rem !important; padding-right: 0 !important; }
html[dir="rtl"] .pr-5 { padding-left: 3rem !important; padding-right: 0 !important; }

/* Borders */
html[dir="rtl"] .border-left { border-right: 1px solid #dee2e6 !important; border-left: 0 !important; }
html[dir="rtl"] .border-right { border-left: 1px solid #dee2e6 !important; border-right: 0 !important; }

/* Rounded corners */
html[dir="rtl"] .rounded-left {
    border-top-right-radius: .25rem !important;
    border-bottom-right-radius: .25rem !important;
    border-top-left-radius: 0 !important;
    border-bottom-left-radius: 0 !important;
}
html[dir="rtl"] .rounded-right {
    border-top-left-radius: .25rem !important;
    border-bottom-left-radius: .25rem !important;
    border-top-right-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
}

/* Dropdowns */
html[dir="rtl"] .dropdown-menu-right { right: auto; left: 0; }
html[dir="rtl"] .dropdown-menu-left { right: 0; left: auto; }
html[dir="rtl"] .dropdown-toggle::after { margin-right: .255em; margin-left: 0; }
html[dir="rtl"] .dropleft .dropdown-toggle::before { margin-right: 0; margin-left: .255em; }
html[dir="rtl"] .dropright .dropdown-toggle::after { margin-left: 0; margin-right: .255em; }

/* Breadcrumb */
html[dir="rtl"] .breadcrumb-item + .breadcrumb-item { padding-right: .5rem; padding-left: 0; }
html[dir="rtl"] .breadcrumb-item + .breadcrumb-item::before {
    padding-right: 0;
    padding-left: .5rem;
    color: var(--rk-muted-2);
    content: "/";
}

/* Input groups */
html[dir="rtl"] .input-group > .form-control:not(:last-child) {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    border-top-right-radius: var(--rk-radius);
    border-bottom-right-radius: var(--rk-radius);
}
html[dir="rtl"] .input-group > .form-control:not(:first-child) {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    border-top-left-radius: var(--rk-radius);
    border-bottom-left-radius: var(--rk-radius);
}
html[dir="rtl"] .input-group > .input-group-prepend > .btn,
html[dir="rtl"] .input-group > .input-group-prepend > .input-group-text {
    border-radius: 0 var(--rk-radius) var(--rk-radius) 0;
}
html[dir="rtl"] .input-group > .input-group-append > .btn,
html[dir="rtl"] .input-group > .input-group-append > .input-group-text {
    border-radius: var(--rk-radius) 0 0 var(--rk-radius);
}
html[dir="rtl"] .input-group > .input-group-prepend { margin-left: -1px; margin-right: 0; }
html[dir="rtl"] .input-group > .input-group-append { margin-right: -1px; margin-left: 0; }

/* Custom select arrow */
html[dir="rtl"] .custom-select {
    padding-right: 14px;
    padding-left: 1.75rem;
    background-position: left .75rem center;
}

/* Checkboxes / radios */
html[dir="rtl"] .form-check { padding-right: 1.25rem; padding-left: 0; }
html[dir="rtl"] .form-check-input { margin-right: -1.25rem; margin-left: 0; }
html[dir="rtl"] .custom-control { padding-right: 1.5rem; padding-left: 0; }
html[dir="rtl"] .custom-control-label::before,
html[dir="rtl"] .custom-control-label::after { right: -1.5rem; left: auto; }
html[dir="rtl"] .custom-switch { padding-right: 2.25rem; padding-left: 0; }
html[dir="rtl"] .custom-switch .custom-control-label::before { right: -2.25rem; left: auto; }
html[dir="rtl"] .custom-switch .custom-control-label::after {
    right: calc(-2.25rem + 2px);
    left: auto;
}
html[dir="rtl"] .custom-switch .custom-control-input:checked ~ .custom-control-label::after {
    transform: translateX(-.75rem);
}

/* Close buttons */
html[dir="rtl"] .close { float: left; }
html[dir="rtl"] .modal-header .close { margin: -1rem auto -1rem -1rem; }
html[dir="rtl"] .alert-dismissible { padding-right: 1.25rem; padding-left: 4rem; }
html[dir="rtl"] .alert-dismissible .close { right: auto; left: 0; }

/* List inline */
html[dir="rtl"] .list-inline-item:not(:last-child) { margin-right: 0; margin-left: .5rem; }

/* Navbar */
html[dir="rtl"] .navbar-brand { margin-right: 0; margin-left: 1rem; }
html[dir="rtl"] .navbar-nav { padding-right: 0; }

/* DataTables controls */
html[dir="rtl"] .dataTables_wrapper .dataTables_length { float: right; }
html[dir="rtl"] .dataTables_wrapper .dataTables_filter { float: left; text-align: left; }
html[dir="rtl"] .dataTables_wrapper .dataTables_info { float: right; }
html[dir="rtl"] .dataTables_wrapper .dataTables_paginate { float: left; }
html[dir="rtl"] .dataTables_wrapper .dataTables_filter input { margin-right: .5rem; margin-left: 0; }

/* Select2 */
html[dir="rtl"] .select2-container--default .select2-selection--single .select2-selection__arrow { right: auto; left: 10px; }
html[dir="rtl"] .select2-container--default .select2-selection--single .select2-selection__rendered {
    padding-right: 0;
    padding-left: 20px;
    text-align: right;
}
html[dir="rtl"] .select2-container--default .select2-selection--multiple .select2-selection__choice { float: right; margin-right: 0; margin-left: 5px; }
html[dir="rtl"] .select2-container--default .select2-search--inline { float: right; }

/* Intl telephone input */
html[dir="rtl"] .intl-tel-input .flag-container { right: auto; left: 0; }
html[dir="rtl"] .intl-tel-input input,
html[dir="rtl"] .intl-tel-input input[type="tel"],
html[dir="rtl"] .intl-tel-input input[type="text"] {
    padding-right: 12px;
    padding-left: 36px;
    direction: ltr;
    text-align: left;
}

/* Tables */
html[dir="rtl"] .table th,
html[dir="rtl"] .table td { text-align: right; }
html[dir="rtl"] .table .text-center { text-align: center !important; }

/* Progress / pagination */
html[dir="rtl"] .pagination { padding-right: 0; }

/* Modal localisation close */
html[dir="rtl"] .modal-localisation .close { float: left; }

/* --------------------------------------------------------------------------
   9. Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 1199.98px) {
    .rk-header-search { max-width: 420px; }

    .rk-navbar .navbar-collapse.show {
        display: block;
        padding: 12px 0 18px;
        border-top: 1px solid var(--rk-line);
    }

    .rk-navbar .navbar-nav {
        align-items: stretch;
        gap: 2px;
        margin-right: 0 !important;
        margin-left: 0 !important;
    }

    .rk-navbar .navbar-nav > li > a {
        padding: 11px 12px !important;
    }

    .rk-navbar .dropdown-menu {
        position: static;
        float: none;
        margin: 4px 0 8px;
        border: 0;
        border-radius: 10px;
        background: var(--rk-surface-2);
        box-shadow: none;
    }

    .rk-navbar .rk-nav-secondary {
        margin-top: 8px;
        padding-top: 8px;
        border-top: 1px solid var(--rk-line);
    }

    .rk-menu-toggle { display: inline-flex; }
}

@media (max-width: 991.98px) {
    .rk-header-main-inner { gap: 16px; min-height: 74px; }
    .rk-brand-ar { font-size: 23px; }
    .rk-brand-mark { width: 44px; height: 44px; border-radius: 13px; }

    .rk-topbar-trust { gap: 14px; }
    .rk-topbar-trust span:nth-child(2) { display: none; }

    .rk-main-body { padding: 26px 0 52px; }
    .rk-sidebar { position: static; }

    .rk-footer { padding-top: 52px; }
    .rk-footer-grid { grid-template-columns: 1fr 1fr; gap: 34px; }
    .rk-footer-brand-col { grid-column: 1 / -1; }
    .rk-footer-about { max-width: 560px; }
}

@media (max-width: 767.98px) {
    body.rk-theme { font-size: 14px; }

    .rk-topbar-inner { min-height: 34px; gap: 10px; }
    .rk-topbar-trust span:not(:first-child) { display: none; }
    .rk-topbar-actions { gap: 10px; }

    .rk-header-main-inner { min-height: 68px; gap: 10px; padding: 10px 0; }
    .rk-brand { gap: 9px; }
    .rk-brand-mark { width: 42px; height: 42px; }
    .rk-brand-ar { font-size: 21px; }
    .rk-brand-en { font-size: 7.5px; letter-spacing: .2em; }

    .rk-tool { padding: 5px 6px; }
    .rk-tool-icon { width: 38px; height: 38px; }

    .rk-main-body { padding: 22px 0 44px; }
    .card-body { padding: 18px; }
    .card-header { padding: 15px 18px; }

    .rk-footer-grid { grid-template-columns: 1fr; gap: 28px; }
    .rk-footer-brand-col { grid-column: auto; }
    .rk-footer-bottom { flex-direction: column; align-items: flex-start; margin-top: 34px; }
    .rk-copyright { font-size: 11px; }

    .rk-back-top { bottom: 16px; left: 16px; width: 40px; height: 40px; }
    .btn-return-to-admin { right: 16px; bottom: 16px; }
}

@media (max-width: 575.98px) {
    .rk-topbar-link span.d-none.d-sm-inline { display: none !important; }
    .rk-brand-text { max-width: 120px; }
    .rk-brand-ar { font-size: 19px; }
    .rk-brand-en { display: none; }

    .rk-header-main-inner { min-height: 62px; }
    .rk-tool-icon { width: 36px; height: 36px; border-radius: 10px; font-size: 15px; }
    .rk-avatar { width: 36px; height: 36px; font-size: 13px; }

    .rk-footer { padding-top: 44px; }
    .rk-footer-brand-text strong { font-size: 21px; }
    .rk-pay-badge { font-size: 9.5px; padding: 5px 8px; }
    .rk-pay-badge i { font-size: 12px; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after {
        animation-duration: .001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .001ms !important;
    }
}
